Interface BOHelper<T extends BusinessObject>
- All Known Implementing Classes:
ActivityCodeAssignmentHelper,ActivityCodeHelper,ActivityCodeTypeHelper,ActivityCodeUpdateHelper,ActivityCommentHelper,ActivityExpenseHelper,ActivityFilterHelper,ActivityHelper,ActivityNoteHelper,ActivityNoteUpdateHelper,ActivityOwnerHelper,ActivityPeriodActualHelper,ActivityRiskHelper,ActivityStepCreateHelper,ActivityStepDeleteHelper,ActivityStepHelper,ActivityStepTemplateHelper,ActivityStepTemplateItemHelper,ActivityStepUpdateHelper,ActivityUpdateHelper,AlertHelper,AutovueAttrHelper,BaselineProjectHelper,BaselineTypeHelper,com.primavera.integration.client.bo.BOHelperImpl,CalendarHelper,CBSDurationSummaryHelper,CBSHelper,ChangeSetHelper,CostAccountHelper,CurrencyHelper,DocumentCategoryHelper,DocumentHelper,DocumentStatusCodeHelper,EPSBudgetChangeLogHelper,EPSFundingHelper,EPSHelper,EPSNoteHelper,EPSSpendingPlanHelper,ExpenseCategoryHelper,FinancialPeriodHelper,FinancialPeriodTemplateHelper,FundingSourceHelper,GatewayDeploymentHelper,GlobalPreferencesHelper,GlobalProfileHelper,GlobalReplaceHelper,ImportOptionsTemplateHelper,IssueHistoryHelper,JobServiceHelper,LeanTaskHelper,LocationHelper,MSPTemplateHelper,NotebookTopicHelper,OBSHelper,OverheadCodeHelper,PAuditXHelper,ProfileHelper,ProjectBudgetChangeLogHelper,ProjectCodeAssignmentHelper,ProjectCodeHelper,ProjectCodeTypeHelper,ProjectDeploymentHelper,ProjectDocumentHelper,ProjectFundingHelper,ProjectHelper,ProjectIssueHelper,ProjectNoteHelper,ProjectPortfolioHelper,ProjectProfileHelper,ProjectResourceCategoryHelper,ProjectResourceHelper,ProjectResourceQuantityHelper,ProjectSpendingPlanHelper,ProjectThresholdHelper,RelationshipHelper,ResourceAccessHelper,ResourceAssignmentCodeAssignmentHelper,ResourceAssignmentCodeHelper,ResourceAssignmentCodeTypeHelper,ResourceAssignmentCreateHelper,ResourceAssignmentHelper,ResourceAssignmentPeriodActualHelper,ResourceAssignmentUpdateHelper,ResourceCodeAssignmentHelper,ResourceCodeHelper,ResourceCodeTypeHelper,ResourceCurveHelper,ResourceHelper,ResourceHourHelper,ResourceLocationHelper,ResourceRateHelper,ResourceRoleHelper,ResourceTeamHelper,RiskCategoryHelper,RiskHelper,RiskImpactHelper,RiskMatrixHelper,RiskMatrixScoreHelper,RiskMatrixThresholdHelper,RiskResponseActionHelper,RiskResponseActionImpactHelper,RiskResponsePlanHelper,RiskThresholdHelper,RiskThresholdLevelHelper,RoleCodeAssignmentHelper,RoleCodeHelper,RoleCodeTypeHelper,RoleHelper,RoleLimitHelper,RoleRateHelper,RoleTeamHelper,ScheduleCheckOptionHelper,ScheduleOptionsHelper,ShiftHelper,ShiftPeriodHelper,StepUserDefinedValueUpdateHelper,ThresholdParameterHelper,TimesheetAuditHelper,TimesheetDelegateHelper,TimesheetHelper,TimesheetPeriodHelper,UDFCodeHelper,UDFTypeHelper,UDFValueHelper,UnitOfMeasureHelper,UpdateBaselineOptionHelper,UserConsentHelper,UserDefinedValueUpdateHelper,UserFieldTitleHelper,UserHelper,UserInterfaceViewHelper,UserLicenseHelper,UserOBSHelper,WBSCategoryHelper,WBSHelper,WBSMilestoneHelper,WbsReviewersHelper
public interface BOHelper<T extends BusinessObject>
Interface to business object helper classes used to simplify access to business objects exposed
in the API.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this type of business object class has create methods.booleanIndicates whether this type of business object class has delete methods.booleanIndicates whether this type of business object class has update methods.ObjectId[]create(Session session, List<? extends BusinessObject> alObjects) Creates multiple business objects of this type in the database.T[]createBusinessObjectArray(int iSize) Creates an array of a particular business object type.voiddelete(Session session, List<? extends BusinessObject> alObjects) Deletes business objects of this type.voiddelete(Session session, List<? extends BusinessObject> alObjects, ObjectId replacementParent) Deletes business objects of this type, specifying a replacement parentString[]Gets all non-code and non-UDF fields for this business objectString[]Gets the class names of all parents that can be used to load this business object using a where clause.Gets the name of the business object class.getClassNameFromObjectIdFieldName(String objectIdFieldName) Gets the class name from an ObjectId field name.Gets the name of the parent class that is most commonly used for loading this type of business object.Gets a map of delete associations that this business object has to other business objects.intgetFieldType(String sFieldName) Gets the type of a given field in the business object class.String[]Gets all non-code and non-UDF fields for this business object.String[]Gets the key field names used for this class.Gets a map of load associations that this business object has to other business objects.String[]Gets all fields that are not code, UDF, or summary fields.getMaxFieldLength(Session session, String fieldName) Retrieves the field length limit for string type field.String[]Gets all fields that are always exported at a minimum by the new flat XML exporterString[]Gets an array of ObjectId field names that exist as fields in this business object class.Gets the plural name of the business object class.String[]Gets all fields that are filterable.getValue(BusinessObject bo, String sFieldName) Gets the value as a String of a particular field that was loaded for the given business object.getValueAsObject(BusinessObject bo, String sFieldName) Gets the value as an Object of a particular field that was loaded for the given business object.String[]Gets all writable non-code and non-UDF fields for this business objectbooleanhasFieldValue(BusinessObject bo, String fieldName) Checks if the business object has a value for the specified fieldbooleanIndicates whether this type of business object has a multi-part ObjectId.booleanisAssociatedClass(String sName) Indicates whether the given class has an association to this business object class.booleanIndicates whether the given field is a valid field for this business object class.booleanisFilterableField(String sName) Indicates whether the given field is a filterable field in this business object class.booleanisGlobal()Indicates whether the business object class is global and therefore accessible from the GlobalObjectManager.booleanIndicates whether this type of business object is hierarchical.booleanisScriptableField(String sName) Indicates whether the given field is a scriptable field in this business object class.booleanIndicates whether this type of business object is singular (one and only one instance exists in the database).booleanisWritableField(String sName) Indicates whether the given field is a writable field in this business object class.load(Session session, BusinessObject boParent, String[] fields, String sWhereClause, String sOrderBy) Loads business objects of this type from a given parent.Loads a business object of this type by ObjectId.Loads multiple business objects of this type by ObjectId.newBusinessObject(Session session) Creates a new client-side instance of this type of business object; call create() on the object to add it to the database.newBusinessObject(Session session, ObjectId objectId) Creates a new client-side instance of this type of business object and sets its unique ID.newBusinessObject(Session session, Map<String, String> fieldValueMap) Creates a new client-side instance of this type of business object and sets its field values from a mapvoidsetValue(BusinessObject bo, String sFieldName, String sValue) Sets the value of a particular field for the given business object.voidsetValues(BusinessObject bo, Map<String, String> fieldValueMap) Sets field values (from a map) for the given business objectbooleanIndicates whether this type of business object supports codes.booleanIndicates whether this type of business object supports live spread data.booleanIndicates whether this type of business object supports summarized spread data.booleanIndicates whether this type of business object supports user-defined fields (UDFs).booleanIndicates whether this type of business object supports UDFCode.voidupdate(Session session, List<? extends BusinessObject> alObjects) Updates business objects of this type.
-
Method Details
-
getClassName
String getClassName()Gets the name of the business object class.- Returns:
- String the name of the business object class
-
getPluralName
String getPluralName()Gets the plural name of the business object class.- Returns:
- String the plural name of the business object class
-
isField
Indicates whether the given field is a valid field for this business object class.- Parameters:
sName- the name of the field- Returns:
- boolean true if the field is a valid field name for this class
-
isWritableField
Indicates whether the given field is a writable field in this business object class.- Parameters:
sName- the name of the field- Returns:
- boolean true if the field is writable in this class
-
isScriptableField
Indicates whether the given field is a scriptable field in this business object class. Only scriptable fields can be used withsetValue(..)andgetValue()methods- Parameters:
sName- the name of the field- Returns:
- boolean true if the field is scriptable in this class
-
getFieldType
Gets the type of a given field in the business object class.- Parameters:
sFieldName- the name of a field in the class- Returns:
- int the field type
- Throws:
InvalidFieldException- if the specified field name is not valid
-
isFilterableField
Indicates whether the given field is a filterable field in this business object class.- Parameters:
sName- the name of the field- Returns:
- boolean true if the field is filterable in this class
-
getKeyFields
String[] getKeyFields()Gets the key field names used for this class. Business objects with one key will always return "ObjectId".- Returns:
- String[] the key fields
-
isAssociatedClass
Indicates whether the given class has an association to this business object class.- Parameters:
sName- the name of the class- Returns:
- boolean true if the class is associated with this class
-
isGlobal
boolean isGlobal()Indicates whether the business object class is global and therefore accessible from the GlobalObjectManager.- Returns:
- boolean true if the business object class is global
-
canCreate
boolean canCreate()Indicates whether this type of business object class has create methods.- Returns:
- boolean true if the business object can be created in the server
-
canUpdate
boolean canUpdate()Indicates whether this type of business object class has update methods.- Returns:
- boolean true if the business object can be updated on the server
-
canDelete
boolean canDelete()Indicates whether this type of business object class has delete methods.- Returns:
- boolean true if the business object can be deleted from the server
-
hasMultiPartKey
boolean hasMultiPartKey()Indicates whether this type of business object has a multi-part ObjectId.- Returns:
- boolean true if the business object has a multi-part ObjectId
-
isHierarchical
boolean isHierarchical()Indicates whether this type of business object is hierarchical.- Returns:
- boolean true if the business object is hierarchical
-
isSingular
boolean isSingular()Indicates whether this type of business object is singular (one and only one instance exists in the database).- Returns:
- boolean true if the business object is singular
-
supportsLiveSpreads
boolean supportsLiveSpreads()Indicates whether this type of business object supports live spread data.- Returns:
- boolean true if the business object supports live spread data
-
supportsSummarizedSreads
boolean supportsSummarizedSreads()Indicates whether this type of business object supports summarized spread data.- Returns:
- boolean true if the business object supports summarized spread data
-
supportsUDF
boolean supportsUDF()Indicates whether this type of business object supports user-defined fields (UDFs).- Returns:
- boolean true if the business object supports UDFs
-
supportsUDFCode
boolean supportsUDFCode()Indicates whether this type of business object supports UDFCode.- Returns:
- boolean true if the business object supports UDFCode
-
supportsCodes
boolean supportsCodes()Indicates whether this type of business object supports codes.- Returns:
- boolean true if the business object supports codes
-
getValueAsObject
Gets the value as an Object of a particular field that was loaded for the given business object. Fields of type boolean, double, and int are returned as Boolean, Double, and Integer, respectively.- Parameters:
bo- the business objectsFieldName- the name of the field- Returns:
- Object the value of the field
- Throws:
BusinessObjectException- if the get method could not be invoked
-
getValue
Gets the value as a String of a particular field that was loaded for the given business object. The format of the returned string corresponds to the format used when exporting this field to XML.- Parameters:
bo- the business objectsFieldName- the name of the field- Returns:
- String a string representation of the value
- Throws:
BusinessObjectException- if the get method could not be invoked
-
setValue
Sets the value of a particular field for the given business object.- Parameters:
bo- the business objectsFieldName- the name of the field to setsValue- the value to set, as a String- Throws:
BusinessObjectException- if the set method could not be invoked
-
setValues
Sets field values (from a map) for the given business object- Parameters:
bo- the business objectfieldValueMap- the map that contains field value pairs where value is in String type- Throws:
BusinessObjectException- if the set method could not be invokedIllegalArgumentException- if the business object or field name parameters are nullInvalidFieldException- if the field is not a valid writable field for this business object
-
getLoadAssociations
Gets a map of load associations that this business object has to other business objects. The keys are String class names to which a load association exists. The values are Lists of all load association method names to that particular class.- Returns:
- Map a map of load association names
-
getDeleteAssociations
Gets a map of delete associations that this business object has to other business objects. The keys are String class names to which a delete association exists. The values are Lists of all delete association method names to that particular class.- Returns:
- Map a map of delete association names
-
getObjectIdFieldNames
String[] getObjectIdFieldNames()Gets an array of ObjectId field names that exist as fields in this business object class. This array does not include the field named "ObjectId"- Returns:
- String[] an array of ObjectId field names
-
getClassNameFromObjectIdFieldName
Gets the class name from an ObjectId field name. For example, in the Activity class, PrimaryResourceObjectId is an ObjectId field name, but the class name is Resource.- Parameters:
objectIdFieldName- the ObjectId field name- Returns:
- String the class name for the ObjectId field name; null if not valid
-
getDefaultParentClassName
String getDefaultParentClassName()Gets the name of the parent class that is most commonly used for loading this type of business object.- Returns:
- String the parent class name
-
getAllParentClassNames
String[] getAllParentClassNames()Gets the class names of all parents that can be used to load this business object using a where clause.- Returns:
- String[] an array of parent class names
-
getRequiredCreateFields
String[] getRequiredCreateFields()Gets all fields that are filterable.- Returns:
- String[] an array of filterable fields
-
getAllFields
String[] getAllFields()Gets all non-code and non-UDF fields for this business object- Returns:
- String[] an array of all non-code and non-UDF fields
-
getWritableFields
String[] getWritableFields()Gets all writable non-code and non-UDF fields for this business object- Returns:
- String[] an array of all writable non-code and non-UDF fields
-
getMinimumXMLExportFields
String[] getMinimumXMLExportFields()Gets all fields that are always exported at a minimum by the new flat XML exporter- Returns:
- String[] an array of exported fields
-
getFilterableFields
String[] getFilterableFields()Gets all non-code and non-UDF fields for this business object.- Returns:
- String[] an array of all non-code fields
-
getMainFields
String[] getMainFields()Gets all fields that are not code, UDF, or summary fields. Code types assigned and UDF types assigned fields are also not included.- Returns:
- String[] an array of all non-code fields
-
getMaxFieldLength
Retrieves the field length limit for string type field.- Parameters:
session- the current sessionfieldName- the name of the field- Returns:
- Integer maximum field length for string type field. null means no limit.
- Throws:
BusinessObjectException- if there is trouble loading GlobalPreferences
-
newBusinessObject
Creates a new client-side instance of this type of business object; call create() on the object to add it to the database.- Parameters:
session- the current session- Returns:
- BusinessObject a client-side business object
-
newBusinessObject
Creates a new client-side instance of this type of business object and sets its unique ID.- Parameters:
session- the current sessionobjectId- the ObjectId of the business object- Returns:
- BusinessObject a client-side business object
- Throws:
BusinessObjectException- if the object could not be created
-
newBusinessObject
T newBusinessObject(Session session, Map<String, String> fieldValueMap) throws BusinessObjectExceptionCreates a new client-side instance of this type of business object and sets its field values from a map- Parameters:
session- the current sessionfieldValueMap- the map that contains field value pairs where value is in String type- Returns:
- T a client-side business object
- Throws:
BusinessObjectException- if the object could not be created
-
createBusinessObjectArray
Creates an array of a particular business object type. The returned array is of the specified size, but each index contains null.- Parameters:
iSize- the size of the array- Returns:
- BusinessObject[] a business object array, initialized to this specific type
-
create
ObjectId[] create(Session session, List<? extends BusinessObject> alObjects) throws ServerException, NetworkException, BusinessObjectException Creates multiple business objects of this type in the database.- Parameters:
session- the current sessionalObjects- a list of objects to be created, all of this type- Returns:
- ObjectId[] the array of unique IDs of newly created business objects
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
load
BOIterator<T> load(Session session, BusinessObject boParent, String[] fields, String sWhereClause, String sOrderBy) throws ServerException, NetworkException, BusinessObjectException Loads business objects of this type from a given parent.- Parameters:
session- the current sessionboParent- the parent business objectfields- the fields to loadsWhereClause- the where clausesOrderBy- the order by clause- Returns:
- BOIterator a business object iterator used to get the results of the load request
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
load
BOIterator<T> load(Session session, String[] fields, ObjectId[] objIds) throws ServerException, NetworkException, BusinessObjectException Loads multiple business objects of this type by ObjectId.- Parameters:
session- the Session objectfields- fields to loadobjIds- object ids of the business objects- Returns:
- BOIterator a business object iterator used to get the results of the load request
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
load
T load(Session session, String[] fields, ObjectId objId) throws ServerException, NetworkException, BusinessObjectException Loads a business object of this type by ObjectId.- Parameters:
session- the Session objectfields- fields to loadobjId- object id of the business object- Returns:
- BusinessObject business object of the type
- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
update
void update(Session session, List<? extends BusinessObject> alObjects) throws ServerException, NetworkException, BusinessObjectException Updates business objects of this type.- Parameters:
session- the current sessionalObjects- a list of objects to update, all of this type- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
delete
void delete(Session session, List<? extends BusinessObject> alObjects) throws ServerException, NetworkException, BusinessObjectException Deletes business objects of this type.- Parameters:
session- the current sessionalObjects- a list of objects to delete, all of this type- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-
hasFieldValue
boolean hasFieldValue(BusinessObject bo, String fieldName) throws InvalidFieldException, BusinessObjectException Checks if the business object has a value for the specified field- Parameters:
bo- the business objectfieldName- the name of the field- Throws:
InvalidFieldException- if the field is not a valid field for this business objectBusinessObjectException- if a problem occurred in the client-side business objects
-
delete
void delete(Session session, List<? extends BusinessObject> alObjects, ObjectId replacementParent) throws ServerException, NetworkException, BusinessObjectException Deletes business objects of this type, specifying a replacement parent- Parameters:
session- the current sessionalObjects- a list of objects to delete, all of this typereplacementParent- replacement parent object- Throws:
ServerException- if a problem occurred on the server-sideNetworkException- if a problem occurred in the network layerBusinessObjectException- if a problem occurred in the client-side business objects
-