Package com.ptc.windchill.esi.tgt
Class ESITargetUtility
java.lang.Object
com.ptc.windchill.esi.tgt.ESITargetUtility
Utility class used for operations related to ESITarget object.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic final voidadjustTargetAssignments(String ufids, Group targetInfo) Given a concatenated set of UFIDs (for Releasable object viz.static final voidadjustTargetAssignments(Collection<Persistable> objects, Group targetInfo) Given a collection of WTParts and a Collection of ESITarget UFIDs, make (or remove) any required assignments.final voidassignTargets(Collection<ESITargetAssociation> targetAssociations) Given a collection of ESITargetAssociation objects, create an ESITargetAssignmentLink object for each entry in the collection that is not already persisted in the database.final voidassignTargets(Persistable object, Group targets) Given a Persistable object and an InfoEngine group of ESITarget objects, create an ESITargetAssignmentLink for each unassigned ESITarget object in the group.final voidassignTargets(Persistable object, Collection<ESITarget> tgtCol) Associates the targets in the input collection to the input persistable object.static voidcacheResponse(com.infoengine.object.IeCollection response, WTContained objToPublish, String transactionID) If the value of the preference "Enable Response Cache" is true, this API creates a copy of the response at the location specified in the preference "ESI Response Cache Location".final voiddeleteESITarget(ESITarget tgt) Deletes an ESITarget from the database.final voiddeleteTargetAssociation(Group links) Deletes from the database the ESITargetAssignmentLink objects that are identified by the argument.final voidDeletes the argument from the database.static Collection<ESITarget> getAssociatedTargets(Persistable obj, TypeIdentifier[] targetTypesToReturn) Returns a collection of distribution targets that are associated with the input object and are of type specified in the input array of type identifiers.static StringgetEmailSystem(ESITarget distributionTarget) Returns the system value of the input E-mail type distribution target.static StringgetFileSystem(ESITarget distributionTarget) Returns the system value of the input file type distribution target.static StringgetFTPSystem(ESITarget distributionTarget) Returns the system value of the input FTP type distribution target.static StringgetOASystem(ESITarget distributionTarget) Returns the system value of the input OA type distribution target.static StringgetSAPSystem(ESITarget distributionTarget) Returns the system value of the input SAP type distribution target.static StringReturns the system value of the input ESITarget object based on its type.final ESITargetReturns the ESITarget having the input number and residing in the exchange container (viz., the Site context)
Supported API: truefinal ESITargetgetTarget(String number, WTContainerRef containerRef) Returns an ESITarget object having the input number and residing in the input container, or in any of its parent containers.getTargetAssnsForTarget(Collection objects, ESITarget tgt) Returns a collection ofESITargetAssociationobjects for the releasable objects in the input collection and for the input distribution target.getTargetAssnsForTarget(Collection objects, Persistable base, ESITarget tgt) Returns a collection ofESITargetAssociationobjects for the releasable objects in the input collection and for the input distribution target.final Collection<ESITargetAssociation> getTargetAssnsFromAssns(Collection<ESITargetAssociation> associations) Given a collection of ESITargetAssociations, returns a Collection of ESITargetAssociations that have been persisted.final Collection<ESITargetAssociation> getTargetAssnsFromAssns(Collection<ESITargetAssociation> associations, Persistable base) Given a collection of ESITargetAssociations, returns a Collection of ESITargetAssociations that have been persisted.static final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects) Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the argument collection.static final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects, ESITargetUtility.EsiResponseOutputFormat outputFormat) Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the input collection and for which the distribution target attribute "ESI Response Output Format" is set to the input value.final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects, Persistable base) Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the argument collection.getTargetAssociationForTarget(Persistable object, ESITarget tgt) Returns theESITargetAssociationobjects (as a singleton collection) for the input releasable object and distribution target.getTargetAssociationForTarget(Persistable object, Persistable base, ESITarget tgt, Collection<ESITargetAssociation> allTgtAssocs) Returns theESITargetAssociationobjects (as a singleton collection) for the input releasable object and distribution target.static StatementSpecgetTargetAssociationNavigateSpec(WTCollection releasableObject, ESITargetStatusType checkStatus, Boolean checkDefaultForContextFlag, Class<?> targetAssignmentClass) Returns the navigate specification for the specified collection of releasable persistable objects and for active/inactive and default and non default targets.static StatementSpecgetTargetAssociationQuerySpec(Long[] releasableObjectOids, Long[] targetOids, boolean queryLinks, Class<?> targetAssignmentClass) Returns the query specification for the specified collection of releasable persistable objects and targets.final GroupgetTargetAssociations(String ufids, String groupName) Given a string of concatenated UFIDs, return the ESITarget objects that are associated with those objects.final Collection<ESITargetAssociation> getTargetAssociations(Persistable object) Returns a Collection of ESITargetAssociations that are associated with the argument.final Collection<ESITargetAssociation> getTargetAssociations(Persistable object, ESITargetUtility.EsiResponseOutputFormat outputFormat) Returns a Collection of ESITargetAssociations that are associated with the input object and for which the distribution target attribute "ESI Response Output Format" is set to the input value.final Collection<ESITargetAssociation> getTargetAssociations(Persistable object, Persistable base) Returns a Collection ofESITargetAssociationobjects that are associated with the argument.static Collection<ESITargetAssociation> Returns a Collection ofESITargetAssociationobjects that are associated with the input object.static Collection<ESITargetAssociation> getTargetAssociationsForObject(Persistable object, ESITargetUtility.EsiResponseOutputFormat outputFormat) Returns a Collection ofESITargetAssociationthat are associated with the input object and for which the distribution target attribute "ESI Response Output Format" is set to the input value.final Collection<ESITargetAssociation> Deprecated.This method is depreciated as of R10.0.20.static booleanReturns true if the attribute "ESIOS_PublishAssociatedVariantsSpecFlag" on the input target is set to true.static booleanisTargetValid(Persistable obj, ESITarget target) Checks if the target is valid for explicit assignment.static booleanisTargetValidForAutoAssignment(Persistable obj, ESITarget target) Checks if the target is valid for auto assignment.final ESITargetAssignmentLinknewESITargetAssignmentLink(Persistable persistable, ESITarget target) Returns an instance ofESITargetAssignmentLink.final voidremoveTargetAssociations(Collection<ESITargetAssociation> associations) Deletes the ESITargetAssignments that are related to the objects in the argument.static booleanReturns a true if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible
Supported API: truestatic booleanshallPublishAssocVariantSpec(ESITarget target, WTPart part) Returns a true if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible
Supported API: truevalidateESITargetAssignments(WTChangeOrder2 chgOrder) Validates the input change notice by ensuring that (i) it has at least one changeable that is valid for publication and (ii) each of its publishable changeables has at least one valid distribution target associated to it.validatePromotablesAndFetchAssociatedTargets(PromotionNotice promotionNotice) Checks whether or not the input Promotion Notice has at least one valid Promotable.
-
Method Details
-
adjustTargetAssignments
Given a concatenated set of UFIDs (for Releasable object viz. WTPart) and a Collection of ESITarget UFIDs, make (or remove) any required assignments.- The ufids argument contains a set of UFIDs which define the releasable to operate on.
- The targetInfo argument is an Group. Each element in the group has Atts that:
- define the ufid of an ESITarget
- define the operation to perform on the parts. If the operation is add, then all parts that do not have the target assigned are given the assignment. If the operation is remove, then all existing assignments for that target to any of the existing parts are removed. However, an exception is thrown if any of the assignments have already been published
Supported API: true- Parameters:
ufids- - A concatenated list of UFIDs of the objects to operate on.targetInfo- - A collection of Info*Engine elements containing the UFIDs of the ESITargets to assign/remove and the operation to perform.- Throws:
WTException
-
adjustTargetAssignments
public static final void adjustTargetAssignments(Collection<Persistable> objects, Group targetInfo) throws WTException Given a collection of WTParts and a Collection of ESITarget UFIDs, make (or remove) any required assignments.- The objects argument contains a collection of parts to operate on.
- The targetInfo argument is an Group. Each element in the group has Atts that:
- define the ufid of an ESITarget
- define the operation to perform on the parts. If the operation is add, then all parts that do not have the target assigned are given the assignment. If the operation is remove, then all existing assignments for that target to any of the existing parts are removed.
Supported API: true- Parameters:
objects- - A collection of objects to operate on.targetInfo- - A collection of Info*Engine elements containing the UFIDs of the ESITargets to assign/remove and the operation to perform.- Throws:
WTException
-
assignTargets
Given a Persistable object and an InfoEngine group of ESITarget objects, create an ESITargetAssignmentLink for each unassigned ESITarget object in the group. Save the results. Use a database transaction to ensure that all are saved or none are saved. If one or more ESITarget object in the group is already assigned, throws an exception after creating an ESITargetAssignmentLink for the unassigned ESITarget object in the group.
Supported API: true- Parameters:
object- - A Persistable object to be assigned to the unassigned targets.targets- - An InfoEngine group of ESITarget objects to be assigned to the Persistable object, if these ESITarget objects are unassigned.- Throws:
WTException
-
assignTargets
public final void assignTargets(Collection<ESITargetAssociation> targetAssociations) throws WTException Given a collection of ESITargetAssociation objects, create an ESITargetAssignmentLink object for each entry in the collection that is not already persisted in the database. Save the results in the database. Uses a database transaction to ensure that all are saved or none are saved. If one or more association is already persisted in the database, throws an exception after persisting the unassigned associations.
Supported API: true- Parameters:
targetAssociations- - A collection of ESITargetAssociations.- Throws:
WTException
-
deleteESITarget
Deletes an ESITarget from the database.
Supported API: true- Parameters:
tgt- - The object to be deleted.- Throws:
WTException
-
deleteTargetAssociation
Deletes the argument from the database.
Supported API: true- Parameters:
link- - The object to be deleted.- Throws:
WTException
-
deleteTargetAssociation
Deletes from the database the ESITargetAssignmentLink objects that are identified by the argument. Uses a database transaction so that all objects are deleted or none of them are.
Supported API: true- Parameters:
links- An Info*Engine group of Element objects. Each element has an Att object that contains the UFID of an ESITargetAssignmentLink that is to be deleted.- Throws:
WTException
-
getTargetAssociations
public final Collection<ESITargetAssociation> getTargetAssociations(Persistable object) throws WTException Returns a Collection of ESITargetAssociations that are associated with the argument. This method callsAPI which associates the default targets if they are not already assigned.invalid reference
#associateDefaultTargets(Persistable, short, Collection)
Supported API: true- Parameters:
object- - The object whose target associations are to be queried- Returns:
- Collection - Collection of ESITargetAssociations
- Throws:
WTException
-
getTargetAssociations
public final Collection<ESITargetAssociation> getTargetAssociations(Persistable object, ESITargetUtility.EsiResponseOutputFormat outputFormat) throws WTException Returns a Collection of ESITargetAssociations that are associated with the input object and for which the distribution target attribute "ESI Response Output Format" is set to the input value. Also, default targets (that expect to receive data in the specified format) are assigned to the object, if they are not already assigned. Note: If ANY_FORMAT was passed in for outputFormat, the distribution target attribute "ESI Response Output Format" is not accounted for while fetching the distribution target associations.
Supported API: true- Parameters:
object- - The object whose target associations are to be queried.outputFormat- - The output format that the distribution targets in the fetched associations expect to receive data in - for e.g., ESI_XML_FORMAT, PLM_FORMAT etc. See the Note that appears in the method description as well.- Returns:
- Collection - Collection of ESITargetAssociations.
- Throws:
WTException
-
getTargetAssociations
public final Collection<ESITargetAssociation> getTargetAssociations(Persistable object, Persistable base) throws WTException Returns a Collection ofESITargetAssociationobjects that are associated with the argument. Uses aESITargetFinderto obtain the result.
Supported API: true- Parameters:
object- - The object of interest.base- - The object to pass to the TargetFinder initiator.- Returns:
- Collection
- Throws:
WTException
-
getTargetAssociations
Given a string of concatenated UFIDs, return the ESITarget objects that are associated with those objects. If the ESITarget is assigned to all of the objects identified by a ufid, indicate that it is a full assignment. Otherwise, indicate that the value is partial.
Supported API: true- Parameters:
ufids- - A concatenated list of UFIDs.groupName- - The name of the Info*Engine group to return.- Returns:
- Group
- Throws:
WTException
-
getTargetAssnsFromObjects
public static final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects) throws WTException Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the argument collection.
Supported API: true- Parameters:
objects- - A collection of Persistable.- Returns:
- Collection
- Throws:
WTException
-
getTargetAssnsFromObjects
public static final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects, ESITargetUtility.EsiResponseOutputFormat outputFormat) throws WTException Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the input collection and for which the distribution target attribute "ESI Response Output Format" is set to the input value.
Supported API: true- Parameters:
objects- - A collection of Persistables for which to fetch the target associations.outputFormat- - The output format that the distribution targets in the fetched associations expect to receive data in (see EsiResponseOutputFormat enum).- Returns:
- Collection of target associations.
- Throws:
WTException
-
getTargetAssnsFromObjects
public final Collection<ESITargetAssociation> getTargetAssnsFromObjects(Collection objects, Persistable base) throws WTException Returns a Collection ofESITargetAssociationobjects that are associated with the objects in the argument collection. Uses aESITargetFinderto obtain the assignment associations.
Supported API: true- Parameters:
objects- - A collection of Persistables.base- - The object to pass to the target finder.- Returns:
- Collection
- Throws:
WTException
-
getTargetAssnsFromAssns
public final Collection<ESITargetAssociation> getTargetAssnsFromAssns(Collection<ESITargetAssociation> associations) throws WTException Given a collection of ESITargetAssociations, returns a Collection of ESITargetAssociations that have been persisted.
Supported API: true- Parameters:
associations- - A collection of ESITargetAssociations- Returns:
- Collection - Collection of
ESITargetAssociationobjects that have been persisted. - Throws:
WTException
-
getTargetAssnsFromAssns
public final Collection<ESITargetAssociation> getTargetAssnsFromAssns(Collection<ESITargetAssociation> associations, Persistable base) throws WTException Given a collection of ESITargetAssociations, returns a Collection of ESITargetAssociations that have been persisted. Uses a target finder to obtain the assignment associations.
Supported API: true- Parameters:
associations- A collection of ESITargetAssociationsbase- The object to pass to the target finder.- Returns:
- Collection
- Throws:
WTException
-
getTarget
Returns the ESITarget having the input number and residing in the exchange container (viz., the Site context)
Supported API: true- Parameters:
number- - Number attribute of the target being sought.- Returns:
- ESITarget
- Throws:
WTException
-
getTarget
Returns an ESITarget object having the input number and residing in the input container, or in any of its parent containers.
Supported API: true- Parameters:
number- - Number attribute of the target being sought.containerRef- - The container reference in which to look for the target.- Returns:
- ESITarget
- Throws:
WTException
-
newESITargetAssignmentLink
public final ESITargetAssignmentLink newESITargetAssignmentLink(Persistable persistable, ESITarget target) throws WTException Returns an instance ofESITargetAssignmentLink. If ESIProperties specifies a subclass of ESITargetAssignmentLink, an instance of that class will be returned. This method will attempt to invoke the newESITargetAssignmentLink(Persistable, ESITarget) method on the class identified in ESIProperties.
Supported API: true- Parameters:
persistable- - The object that is to be related to an ESI target.target- - The ESITarget that is to receive ESI releases of the object.- Returns:
- ESITargetAssignmentLink
- Throws:
WTException
-
removeTargetAssociations
public final void removeTargetAssociations(Collection<ESITargetAssociation> associations) throws WTException Deletes the ESITargetAssignments that are related to the objects in the argument.
Supported API: true- Parameters:
associations- - A collection of ESITargetAssociation objects.- Throws:
WTException
-
getSystem
Returns the system value of the input ESITarget object based on its type. Following are the supported types.
Note: System attribute population is needed to maintain uniqueness of the ESITarget object.
- WCTYPE|com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt. ESIFileTarget
- WCTYPE|com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt. ESIFTPTarget
- WCTYPE|com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt. ESIEmailTarget
- WCTYPE|com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt. ESISAPTarget
- WCTYPE|com.ptc.windchill.esi.tgt.ESITarget|com.ptc.windchill.esi.tgt. ESIOATarget
Supported API: true
- Parameters:
distributionTarget- - The ESITarget instance for which to populate the system attribute.- Returns:
- The system value for distribution target.
- Throws:
WTException
-
getFileSystem
Returns the system value of the input file type distribution target.
Supported API: true
- Parameters:
distributionTarget- - The file type distribution target instance for which the system value is returned.- Returns:
- - The system value for File type distribution target.
-
getFTPSystem
Returns the system value of the input FTP type distribution target.
Supported API: true
- Parameters:
distributionTarget- - The FTP type distribution target instance for which the system value is returned.- Returns:
- The system value for FTP type distribution target.
-
getEmailSystem
Returns the system value of the input E-mail type distribution target.
Supported API: true
- Parameters:
distributionTarget- - The E-mail type distribution target instance for which the system value is returned.- Returns:
- The system value for E-mail type distribution target.
-
getSAPSystem
Returns the system value of the input SAP type distribution target.
Supported API: true
- Parameters:
distributionTarget- - The SAP type distribution target instance for which the system value is returned.- Returns:
- The system value for SAP type distribution target.
-
getOASystem
Returns the system value of the input OA type distribution target.
Supported API: true
- Parameters:
distributionTarget- - The OA type distribution target instance for which the system value is returned.- Returns:
- The system value for OA type distribution target.
-
getTargetAssnsForTarget
public Collection<ESITargetAssociation> getTargetAssnsForTarget(Collection objects, Persistable base, ESITarget tgt) throws WTException Returns a collection ofESITargetAssociationobjects for the releasable objects in the input collection and for the input distribution target.
Supported API: true- Parameters:
objects- - Input collection of releasable objects for which to fetch the ESITargetAssociations.base- - The object to set the attribute base on the target finder instance to.tgt- - ESITarget object for which to fetch the output collection.- Returns:
- ArrayList of ESITargetAssociations for the objects in the input collection that are associated to the distribution target in tgt.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
getTargetAssnsForTarget
public Collection<ESITargetAssociation> getTargetAssnsForTarget(Collection objects, ESITarget tgt) throws WTException Returns a collection ofESITargetAssociationobjects for the releasable objects in the input collection and for the input distribution target.
Supported API: true- Parameters:
objects- - Input collection of releasable objects for which to fetch the ESITargetAssociations.tgt- - ESITarget object for which to fetch the output collection.- Returns:
- ArrayList of ESITargetAssociations for the objects in the input collection that are associated to the distribution target in tgt.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
getTargetAssociationForTarget
public Collection<ESITargetAssociation> getTargetAssociationForTarget(Persistable object, Persistable base, ESITarget tgt, Collection<ESITargetAssociation> allTgtAssocs) throws WTException Returns theESITargetAssociationobjects (as a singleton collection) for the input releasable object and distribution target. Optionally populates all the ESITargetAssociations for the input part in the collection in allTgtAssocs.
Supported API: true- Parameters:
object- - Input releasable object for which to fetch the ESITargetAssociation.base- - The object to set the attribute base on the target finder instance to.tgt- - ESITarget object for which to fetch the output collection.allTgtAssocs- - If this is not null, it is populated with all the ESITargetAssociations associated to the input part- Returns:
- ArrayList of ESITargetAssociations; clearly, this will be a singleton collection.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
getTargetAssociationForTarget
public Collection<ESITargetAssociation> getTargetAssociationForTarget(Persistable object, ESITarget tgt) throws WTException Returns theESITargetAssociationobjects (as a singleton collection) for the input releasable object and distribution target. Additionally this associates default targets to the input persistable.
Supported API: true- Parameters:
object- - Input releasable object for which to fetch the ESITargetAssociation.tgt- - ESITarget object for which to fetch the output collection.- Returns:
- ArrayList of ESITargetAssociations; clearly, this will be a singleton collection.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
cacheResponse
public static void cacheResponse(com.infoengine.object.IeCollection response, WTContained objToPublish, String transactionID) throws ESIException If the value of the preference "Enable Response Cache" is true, this API creates a copy of the response at the location specified in the preference "ESI Response Cache Location".
Supported API: true- Parameters:
response- - the ESI response contained in an IeCollection.objToPublish- - the primary business object.transactionID- - The number of theESITransactionin which this primary business object is being published.- Throws:
ESIException
-
isTargetValidForAutoAssignment
Checks if the target is valid for auto assignment. This method internally loads the class which is provided as value for the preference "Distribution Target Assignment Validator" and invokes its method "isTargetValidForAutoAssignment" to find the result.
Supported API: true- Parameters:
obj- - Input persistable object.target- - ESITarget object that needs to be validated for auto assignment.- Returns:
- - true if the input target is auto assignable to the input object, false otherwise.
-
isTargetValid
Checks if the target is valid for explicit assignment. This method internally loads the class which is provided as value for the preference "Distribution Target Assignment Validator" and invokes its method "isTargetValid" to find the result.
Supported API: true- Parameters:
obj- - Input persistable object.target- - ESITarget object that needs to be validated for explicit assignment.- Returns:
- - true if the input target is assignable to the input object, false otherwise.
-
assignTargets
public final void assignTargets(Persistable object, Collection<ESITarget> tgtCol) throws WTException Associates the targets in the input collection to the input persistable object. To check the validity of targets, usesisTargetValid(Persistable, ESITarget)API and throws WTException if the target/s found to be invalid. If all the targets are valid it delegates the assignment work toassignTargets(Collection)API. Apart from this, it checks if the target in the input collection is supported or not for the input persistable object. If it is not supported, then removes that target from the input collection.
Supported API: true- Parameters:
object- - Input persistable object.tgtCol- - Collection of the selected targets.- Throws:
WTException- If the target(s) are invalid or already associated.
-
getTgtAssocsWithoutDefault
public final Collection<ESITargetAssociation> getTgtAssocsWithoutDefault(Persistable object) throws WTException Deprecated.This method is depreciated as of R10.0.20. The API getTargetAssignmentLinks() is invoked instead.Returns a Collection of ESITargetAssociations that are associated with the argument. This method will be used by the UI where default target association is not needed at the time of target association
Supported API: true- Parameters:
object- - The object whose target associations are to be queried- Returns:
- Collection collection of target associations
- Throws:
WTException
-
getTargetAssociationsForObject
public static Collection<ESITargetAssociation> getTargetAssociationsForObject(Persistable object) throws WTException Returns a Collection ofESITargetAssociationobjects that are associated with the input object.
Supported API: true- Parameters:
object- - The object whose target associations are to be queried- Returns:
- Collection of target associations.
- Throws:
WTException
-
getTargetAssociationsForObject
public static Collection<ESITargetAssociation> getTargetAssociationsForObject(Persistable object, ESITargetUtility.EsiResponseOutputFormat outputFormat) throws WTException Returns a Collection ofESITargetAssociationthat are associated with the input object and for which the distribution target attribute "ESI Response Output Format" is set to the input value. Note: If ANY_FORMAT was passed in for outputFormat, the distribution target attribute "ESI Response Output Format" is not accounted for while fetching the distribution target associations.
Supported API: true- Parameters:
object- - The object whose target associations are to be queried.outputFormat- - The output format that the distribution targets in the fetched associations expect to receive data in - see EsiResponseOutputFormat enum. See the Note that appears in the method description as well.- Returns:
- A Collection of target associations.
- Throws:
WTException
-
validatePromotablesAndFetchAssociatedTargets
public Collection<ESITarget> validatePromotablesAndFetchAssociatedTargets(PromotionNotice promotionNotice) throws WTException Checks whether or not the input Promotion Notice has at least one valid Promotable. If not, throws a PreReleaseValidationException. Additionally it checks whether or not each valid Promotable has at least one distribution target associated to it. If not, throws an ESINoTargetAssignmentException. If the said checks succeeded, it returns all the associated distribution targets to the caller.
Note:
1) A valid Promotable is an object that can published by ESI as a primary business object (e.g., part, process plan, document etc.). Be aware that a one-off version is not considered valid for publication.
2) If the preference "Distribution Target Finder" is set to the ESIRootInheritTargetFinder class, and if there is a BOM in the Promotion Notice that has at least one associated distribution target, it is assumed that the other parts in the Promotion Notice (if any) will inherit the distribution target(s) from the BOM and will thus not be separately validated for target assignments.
Supported API: true- Parameters:
promotionNotice- - Input Promotion Notice.- Returns:
- Collection of distribution targets associated with the valid Promotables.
- Throws:
WTException- If any of the invoked APIs threw this exception.
ESIException- If the input Promotion Notice does not have at least one valid Promotable.
ESINoTargetAssignmentException- If at least one valid Promotable does not have any targets associated.
-
validateESITargetAssignments
public Collection<ESITarget> validateESITargetAssignments(WTChangeOrder2 chgOrder) throws WTException Validates the input change notice by ensuring that (i) it has at least one changeable that is valid for publication and (ii) each of its publishable changeables has at least one valid distribution target associated to it. Also, populates the collection in targets with all the valid distribution targets that are associated to the changeables.
Note:
1) Unlike other changeables, a document is considered as a valid changeable only when it has target associations. In other words, if a document doesn't have target associations, it will be ignored. Also, one-off versions and new objects in a workspae are not considered valid for publication.
2) If the preference "Distribution Target Finder" is set to the ESIRootInheritTargetFinder class, and if there is a BOM in the Change Notice that has at least one associated distribution target, it is assumed that the other parts in the Change Notice (if any) will inherit the distribution target(s) from the BOM and will thus not be separately validated for target assignments.
Supported API: true- Parameters:
chgOrder- - Input change notice to be validated.- Returns:
- Collection of targets associated with the valid changeables.
- Throws:
ESIException- if the input change notice has no changeables that are valid for publication;WTException- if any of the invoked APIs throws this exception.
-
getTargetAssociationQuerySpec
public static StatementSpec getTargetAssociationQuerySpec(Long[] releasableObjectOids, Long[] targetOids, boolean queryLinks, Class<?> targetAssignmentClass) throws QueryException Returns the query specification for the specified collection of releasable persistable objects and targets. API considersESITargetAssignmentLinkclass while building query specification.
Supported API: true- Parameters:
releasableObjectOids- - The collection containing the OBIDs of persistables implementingReleasableinterface.targetOids- - The collection containing the OBIDs of ESITarget.queryLinks- - Indicates whether or not the links need to be queried. Based on this flag, the class list will be set on the query spec.- Returns:
- - The query specification to query ESITarget associations.
- Throws:
QueryException
-
getAssociatedTargets
public static Collection<ESITarget> getAssociatedTargets(Persistable obj, TypeIdentifier[] targetTypesToReturn) throws WTException Returns a collection of distribution targets that are associated with the input object and are of type specified in the input array of type identifiers.
Supported API: true- Parameters:
obj- - The object to which targets are associated with.targetTypesToReturn- - The list of target TypeIdentifier(targets's sub types) to be consider.- Returns:
- - The collection of associated targets of specified target type identifier.
- Throws:
WTException
-
shallPublishAssocVariantSpec
Returns a true if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible
Supported API: true- Parameters:
target- - Input distribution targetpart- - Input part- Returns:
- - A true, if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible.
-
shallPublishAssocVariantSpec
Returns a true if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible
Supported API: true- Parameters:
target- - Input distribution targetpart- - Input part- Returns:
- - A true, if the attribute ESIOS_PublishAssociatedVariantsSpecFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible.
-
isPublishAssocVariantSpecFlagEnabled
Returns true if the attribute "ESIOS_PublishAssociatedVariantsSpecFlag" on the input target is set to true. A false, otherwise.
Supported API: true- Parameters:
target- - Input distribution target.- Returns:
- True if the attribute "ESIOS_PublishAssociatedVariantsSpecFlag" on the input target is set to true. A false, otherwise.
-