public class IBAHelper
extends Object
implements RemoteAccess
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
DATE_DE
predefined date format "dd.MM.yyyy hh:mm:ss"
|
static SimpleDateFormat |
DATE_US
predefined date format "yyyy-MM-dd hh:mm:ss"
|
static SimpleDateFormat |
DATE_WITH_TIME
predefined date format "yyyyMMdd hh:mm:ss"
|
static int |
MAJOR |
static int |
MINOR |
static int |
MULTIVAL_ERR
throw Exception if multi value IBA detected
|
static int |
MULTIVAL_FIRST
return first encountered value if multi value IBA detected
|
static int |
MULTIVAL_LAST
return last encountered value if multi value IBA detected
|
static int |
MULTIVAL_SET
if multi value IBA found, return values in a Set
|
static int |
MULTIVAL_VECTOR
if multi value IBA found, return values in Vector
|
static boolean |
WITH_UNITS
flag if we want unit string appended to value of float-with-unit
|
static boolean |
WITHOUT_UNITS
flag if we want unit string appended to value of float-with-unit
|
Constructor and Description |
---|
IBAHelper() |
Modifier and Type | Method and Description |
---|---|
static AbstractValueView |
createAbstractValueView(AttributeDefDefaultView def,
String value)
helper method for iba stuff
|
static void |
forcedUpdate(IBAHolder h,
Object cpm,
Locale l,
MeasurementSystemDefaultView m)
TODO javadoc
|
static List<TypeSingleAttrConstraint> |
getConstraints()
return ALL constraint definitions
|
static Map |
getMultiValIBAsOfObject(IBAHolder ibaHolder)
TODO javadoc
|
static List |
getTypedAttributeNameList(String typedObjectClassName)
TODO javadoc
|
static Map<String,Map<String,List<TypeSingleAttrConstraint>>> |
getTypesAndAttsAndConstraints()
TODO javadoc
|
static Map<String,List<TypeSingleAttrConstraint>> |
getTypesAndConstraints()
TODO javadoc
|
static Hashtable |
IBAHash(DefaultAttributeContainer dac)
return the result of IBAHash(DefaultAttributeContainer,SimpleDateFormat) with default date "yyyyMMdd hh:mm:ss"
|
static Hashtable |
IBAHash(DefaultAttributeContainer dac,
SimpleDateFormat f)
return the IBAs of an IBAHolder's attribute container; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(DefaultAttributeContainer dac,
SimpleDateFormat f,
boolean withUnits)
return the IBAs of an IBAHolder's attribute container; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(DefaultAttributeContainer dac,
SimpleDateFormat f,
boolean withUnits,
int multival_flag)
return the IBAs of an IBAHolder's attribute container; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(IBAHolder i)
return the result of IBAHash(IBAHolder,SimpleDateFormat) with default date "yyyyMMdd hh:mm:ss"
|
static Hashtable |
IBAHash(IBAHolder h,
SimpleDateFormat f)
return the IBAs of an IBAHolder; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(IBAHolder h,
SimpleDateFormat f,
boolean withUnits)
return the IBAs of an IBAHolder; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(IBAHolder h,
SimpleDateFormat f,
boolean withUnits,
int multival_flag)
return the IBAs of an IBAHolder; format Timestamps with dateformat passed in.
|
static Hashtable |
IBAHash(IBAHolder i,
String newFmt)
return the result of IBAHash(IBAHolder,SimpleDateFormat) with dateformat passed in
|
static Hashtable |
IBAHash(IBAHolder i,
String newFmt,
boolean withUnits)
return the result of IBAHash(IBAHolder,SimpleDateFormat,withUnits) with dateformat passed in
|
static boolean |
isObjectMultiValued(IBAHolder ibaHolder)
TODO javadoc
|
static Map<String,Object> |
rawIBAs(IBAHolder h)
return all ibas as raw objects, if multival makes List.
|
static String |
updateDeltaIBAs(IBAHolder holder,
Map parameters,
Map<String,Object> ibaData)
update only if delta in ibas found, does nothing if all values passed in are unchanged.
|
static String |
updateIBAs(IBAHolder holder,
boolean add,
boolean csm,
boolean famTable,
boolean emptyOk,
boolean force,
boolean useMaster,
String type,
Map ibaData)
do update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean add,
boolean csm,
boolean famTable,
boolean emptyOk,
boolean force,
String checkinMessage,
boolean useMaster,
String type,
String dateFormat,
Map ibaData)
do update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean add,
boolean csm,
boolean emptyOk,
boolean force,
boolean useMaster,
String type,
Map ibaData)
do update for iba-holder ibaholder must not be a generic or instance!
|
static String |
updateIBAs(IBAHolder holder,
boolean add,
boolean emptyOk,
boolean force,
boolean useMaster,
Map ibaData)
do single/multivalue update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean add,
boolean emptyOk,
boolean force,
boolean useMaster,
Map ibaData,
boolean allowFamilyTable)
do single/multivalue update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean emptyOk,
boolean force,
boolean useMaster,
Map ibaData)
do value update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean emptyOk,
boolean force,
boolean useMaster,
Map ibaData,
boolean allowFamilyTable)
do value update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
boolean emptyOk,
boolean force,
String checkinText,
boolean useMaster,
Map ibaData,
boolean allowFamilyTable)
do value update for iba-holder
|
static String |
updateIBAs(IBAHolder holder,
Map parameters,
String type,
Map ibaData)
update the IBAs of an object
|
static String |
updateIBAs(IBAHolder holder,
String ibaName,
String ibaValue,
boolean emptyOk,
boolean force,
boolean useMaster)
do single value update for iba-holder
ibaholder must not be a generic or instance!
|
static String |
updateIBAs(IBAHolder holder,
String ibaName,
String ibaValue,
boolean emptyOk,
boolean force,
boolean useMaster,
boolean allowFamilyTable)
do single value update for iba-holder
(supports familytable members)
|
static String |
updateIBAs(List<IBAHolder> ibaHolders,
boolean alwaysAddValues,
boolean disableConstraintChecks,
boolean allowFamilyTable,
boolean allowEmptyValues,
boolean doNotIterate,
boolean useMaster,
String type,
String dateFormat,
Map ibaData)
TODO javadoc
|
static String |
updateIBAs(List<IBAHolder> ibaHolders,
boolean disableConstraintChecks,
boolean allowFamilyTable,
boolean allowEmptyValues,
boolean doNotIterate,
boolean useMaster,
Map ibaData)
TODO javadoc
|
static String |
updateIBAs(List<IBAHolder> ibaHolders,
boolean disableConstraintChecks,
boolean allowFamilyTable,
boolean allowEmptyValues,
boolean doNotIterate,
boolean useMaster,
String type,
String dateFormat,
Map ibaData)
TODO javadoc
|
public static final int MAJOR
public static final int MINOR
public static final int MULTIVAL_ERR
public static final int MULTIVAL_FIRST
public static final int MULTIVAL_VECTOR
public static final int MULTIVAL_SET
public static final int MULTIVAL_LAST
public static final boolean WITH_UNITS
public static final boolean WITHOUT_UNITS
public static SimpleDateFormat DATE_WITH_TIME
public static SimpleDateFormat DATE_DE
public static SimpleDateFormat DATE_US
public static String updateDeltaIBAs(IBAHolder holder, Map parameters, Map<String,Object> ibaData) throws Exception
holder
- obj. to updateparameters
- Map with optionsibaData
- the key/values to updateException
public static String updateIBAs(IBAHolder holder, Map parameters, String type, Map ibaData) throws WTException
holder
- the object to updateparameters
- Map with key/Boolean controlling behavior:
key | if true | if false |
---|---|---|
add | create multi-value IBAs | overrides existing value |
csm | disable constraint checking | |
ft | update family table object | |
emptyOk | leave empty IBA values | remove IAB value if empty |
force | update object without checkout | iterate the object (unless already checked out) |
useMaster | update the master | update latest version's latest iteration |
type
- optional: new type to setibaData
- input map with key/values to setWTException
public static String updateIBAs(IBAHolder holder, String ibaName, String ibaValue, boolean emptyOk, boolean force, boolean useMaster) throws WTException
holder
- emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- WTException
public static String updateIBAs(IBAHolder holder, String ibaName, String ibaValue, boolean emptyOk, boolean force, boolean useMaster, boolean allowFamilyTable) throws WTException
holder
- ibaName
- name of attribute to be updatedibaValue
- new value for the atrributeemptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)allowFamilyTable
- set to allow update of generics & instancesWTException
public static String updateIBAs(IBAHolder holder, boolean emptyOk, boolean force, boolean useMaster, Map ibaData) throws WTException
holder
- emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- WTException
public static String updateIBAs(IBAHolder holder, boolean emptyOk, boolean force, boolean useMaster, Map ibaData, boolean allowFamilyTable) throws WTException
holder
- emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- allowFamilyTable
- allow update of familytable membersWTException
public static String updateIBAs(IBAHolder holder, boolean emptyOk, boolean force, String checkinText, boolean useMaster, Map ibaData, boolean allowFamilyTable) throws WTException
holder
- emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)checkinText
- if not null, string will be used as a checkin message.useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- allowFamilyTable
- allow update of familytable membersWTException
public static String updateIBAs(IBAHolder holder, boolean add, boolean emptyOk, boolean force, boolean useMaster, Map ibaData) throws WTException
holder
- add
- if true: add iba value instead of replacing -> multivalue!emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- WTException
public static String updateIBAs(IBAHolder holder, boolean add, boolean emptyOk, boolean force, boolean useMaster, Map ibaData, boolean allowFamilyTable) throws WTException
holder
- add
- if true: add iba value instead of replacing -> multivalue!emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)ibaData
- allowFamilyTable
- allow update of familytable membersWTException
public static String updateIBAs(IBAHolder holder, boolean add, boolean csm, boolean emptyOk, boolean force, boolean useMaster, String type, Map ibaData) throws WTException
holder
- add
- adds IBA values, leaving existing values in placecsm
- disable checks! (option is to be considered experimental ... handle with care, validate results!!!)emptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)type
- "types" the objects, csm allow update of classification nodes/family table epmdocs.ibaData
- WTException
public static String updateIBAs(IBAHolder holder, boolean add, boolean csm, boolean famTable, boolean emptyOk, boolean force, boolean useMaster, String type, Map ibaData) throws WTException
holder
- add
- adds IBA values, leaving existing values in placecsm
- set to true for disabling constraint checksfamTable
- set to true to allow update of generics/instancesemptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)type
- "types" the objects (requires csm=true)ibaData
- WTException
public static String updateIBAs(List<IBAHolder> ibaHolders, boolean disableConstraintChecks, boolean allowFamilyTable, boolean allowEmptyValues, boolean doNotIterate, boolean useMaster, Map ibaData) throws WTException
ibaHolders
- disableConstraintChecks
- allowFamilyTable
- allowEmptyValues
- doNotIterate
- useMaster
- ibaData
- WTException
public static String updateIBAs(List<IBAHolder> ibaHolders, boolean disableConstraintChecks, boolean allowFamilyTable, boolean allowEmptyValues, boolean doNotIterate, boolean useMaster, String type, String dateFormat, Map ibaData) throws WTException
ibaHolders
- disableConstraintChecks
- allowFamilyTable
- allowEmptyValues
- doNotIterate
- useMaster
- type
- dateFormat
- ibaData
- WTException
public static String updateIBAs(List<IBAHolder> ibaHolders, boolean alwaysAddValues, boolean disableConstraintChecks, boolean allowFamilyTable, boolean allowEmptyValues, boolean doNotIterate, boolean useMaster, String type, String dateFormat, Map ibaData) throws WTException
ibaHolders
- alwaysAddValues
- disableConstraintChecks
- allowFamilyTable
- allowEmptyValues
- doNotIterate
- useMaster
- type
- dateFormat
- ibaData
- WTException
public static String updateIBAs(IBAHolder holder, boolean add, boolean csm, boolean famTable, boolean emptyOk, boolean force, String checkinMessage, boolean useMaster, String type, String dateFormat, Map ibaData) throws WTException
holder
- add
- adds IBA values, leaving existing values in placecsm
- set to true for disabling constraint checksfamTable
- set to true to allow update of generics/instancesemptyOk
- allow empty attribute valuesforce
- forced update, no checkout necessary (= no iteration for update)useMaster
- update not latest iteration but master (default if *master passed as holder)type
- "types" the objects (requires csm=true)dateFormat
- default (if null) = dd.MM.yyy HH:mm:ss -> see UpdateIBA.updateIBAsibaData
- WTException
public static AbstractValueView createAbstractValueView(AttributeDefDefaultView def, String value) throws Exception
def
- value
- Exception
public static void forcedUpdate(IBAHolder h, Object cpm, Locale l, MeasurementSystemDefaultView m) throws WTException
h
- cpm
- l
- m
- WTException
public static List<TypeSingleAttrConstraint> getConstraints() throws WTException
WTException
public static Map<String,List<TypeSingleAttrConstraint>> getTypesAndConstraints() throws WTException
WTException
public static Map<String,Map<String,List<TypeSingleAttrConstraint>>> getTypesAndAttsAndConstraints() throws WTException
WTException
public static List getTypedAttributeNameList(String typedObjectClassName) throws Exception
typedObjectClassName
- Exception
public static boolean isObjectMultiValued(IBAHolder ibaHolder) throws RemoteException, WTException
ibaHolder
- RemoteException
WTException
public static Map getMultiValIBAsOfObject(IBAHolder ibaHolder) throws RemoteException, WTException
ibaHolder
- RemoteException
WTException
public static Map<String,Object> rawIBAs(IBAHolder h) throws WTException, RemoteException
h
- the IBA HolderWTException
- from windchill codeRemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder i) throws WTException, RemoteException
i
- the IBA HolderWTException
- from windchill codeRemoteException
- from windchill codepublic static Hashtable IBAHash(DefaultAttributeContainer dac) throws WTException, RemoteException
dac
- an IBA Holder's AttributeContainerWTException
- from windchill codeRemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder i, String newFmt) throws WTException, RemoteException
i
- the IBA HoldernewFmt
- the DateFormat to use for formatting TimestampsWTException
- from windchill code or if SimpleDateFormat is badRemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder i, String newFmt, boolean withUnits) throws WTException, RemoteException
i
- the IBA HoldernewFmt
- the DateFormat to use for formatting TimestampsWTException
- from windchill code or if SimpleDateFormat is badRemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder h, SimpleDateFormat f) throws WTException, RemoteException
h
- the IBA Holderf
- the DateFormat to use for formatting TimestampsWTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill codepublic static Hashtable IBAHash(DefaultAttributeContainer dac, SimpleDateFormat f) throws WTException, RemoteException
dac
- an IBA Holder's AttributeContainerf
- the DateFormat to use for formatting TimestampsWTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder h, SimpleDateFormat f, boolean withUnits) throws WTException, RemoteException
WTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill codepublic static Hashtable IBAHash(DefaultAttributeContainer dac, SimpleDateFormat f, boolean withUnits) throws WTException, RemoteException
WTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill codepublic static Hashtable IBAHash(IBAHolder h, SimpleDateFormat f, boolean withUnits, int multival_flag) throws WTException, RemoteException
h
- the IBA Holderf
- the DateFormat to use for formatting TimestampswithUnits
- if true add a float/units att's unit display string to the string valuemultival_flag
- indicate what to do if multivalued IBA found:
WTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill codepublic static Hashtable IBAHash(DefaultAttributeContainer dac, SimpleDateFormat f, boolean withUnits, int multival_flag) throws WTException, RemoteException
dac
- an IBA Holder's AttributeContainerf
- the DateFormat to use for formatting TimestampswithUnits
- if true add a float/units att's unit display string to the string valuemultival_flag
- indicate what to do if multivalued IBA found:
WTException
- from windchill code or if multivalued IBA encountered.RemoteException
- from windchill code