Package wt.inf.container
Class WTContainerHelper
java.lang.Object
wt.inf.container.WTContainerHelper
Supported API: true
Extendable: false
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic WTContainergetContainer(WTContained contained)
Supported API: truestatic WhereExpressiongetWhereContainerIn(ContainerSpec spec, Class[] search_classes) Utility api to append container-based where conditions to queries.static WhereExpressiongetWhereContainerIn(ContainerSpec spec, Class[] search_classes, boolean negate)
Supported API: truestatic WhereExpressiongetWhereContainerIn(WTContainerRef[] container_refs)
Supported API: truestatic voidsetContainer(WTContained contained, WTContainerRef container_ref) Assigns a container reference to an unpersisted contained object.static voidsetPrivateAccess(WTContainer container, boolean private_access) Assigns the privateAccess property to an unpersisted container.static voidsetPublicParentDomain(WTContainer container, AdminDomainRef public_parent) Assigns the parentPublicDomain property to an unpersisted container.
-
Field Details
-
service
Supported API: true
-
-
Method Details
-
getContainer
Supported API: true- Parameters:
contained-- Returns:
- the
WTContainedobject's container. - Throws:
WTException
-
getWhereContainerIn
public static WhereExpression getWhereContainerIn(ContainerSpec spec, Class[] search_classes) throws WTException Utility api to append container-based where conditions to queries. For example:// Find all WTPartMasters with the given name that // are selected by a container spec ContainerSpec cs = new ContainerSpec(); // configure the container spec (these are just examples) cs.setMembershipState(ContainerSpec.CONFIRMED_ONLY); cs.setDeleteState(ContainerSpec.DELETED_ONLY); QuerySpec qs = new QuerySpec(WTPartMaster.class); qs.appendWhere(new SearchCondition(WTPartMaster.class, WTPartMaster.NAME, SearchCondition.LIKE, "MyName"), new int[]{0}); qs.appendAnd(); // Only find part masters that are in containers selected by the spec qs.appendWhere(WTContainerHelper.getWhereContainerIn(cs,new Class[]{PDMLinkProduct.class}),new int[]{0}); return PersistenceHelper.manager.find(qs);
Supported API: true- Parameters:
spec-search_classes-- Returns:
- A
WhereExpressionthat will filter a query for the object types specified insearch_classesby the containers specified in the suppliedContainerSpec - Throws:
WTException- See Also:
-
getWhereContainerIn
public static WhereExpression getWhereContainerIn(ContainerSpec spec, Class[] search_classes, boolean negate) throws WTException
Supported API: true- Parameters:
spec-search_classes-negate-- Returns:
- A
WhereExpressionthat will filter a query for the object types specified insearch_classesby the containers specified in the suppliedContainerSpec - Throws:
WTException- See Also:
-
getWhereContainerIn
public static WhereExpression getWhereContainerIn(WTContainerRef[] container_refs) throws WTException
Supported API: true- Parameters:
container_refs-- Returns:
- A
WhereExpressionthat wil filter a query forWTContainedobjects to only look in the suppliedWTContainers. - Throws:
WTException
-
setContainer
public static void setContainer(WTContained contained, WTContainerRef container_ref) throws WTPropertyVetoException Assigns a container reference to an unpersisted contained object.- Parameters:
contained-container_ref-- Throws:
WTPropertyVetoException
-
setPrivateAccess
public static void setPrivateAccess(WTContainer container, boolean private_access) throws WTPropertyVetoException Assigns the privateAccess property to an unpersisted container. To change this property on a persistent container, use WTContainerService.makePrivate and WTContainerService.makePublic.
Supported API: true- Parameters:
container-private_access-- Throws:
WTPropertyVetoException- See Also:
-
setPublicParentDomain
public static void setPublicParentDomain(WTContainer container, AdminDomainRef public_parent) throws WTPropertyVetoException Assigns the parentPublicDomain property to an unpersisted container. To change this property on a persistent container, use WTContainerService.changePublicParentDomain
Supported API: true- Parameters:
container-public_parent-- Throws:
WTPropertyVetoException- See Also:
-