Class ContainerSpec
- All Implemented Interfaces:
Serializable,Cloneable
ContainerSpec encapsulates a set of criteria used to specify
a set of containers.
A query that includes a ContainerSpec-generated WhereExpression
or StatementSpec must be executed from server-side code.
This is because this query requires the "advancedQueryEnabled" property
to be set to true, which can only be done on the server.
Usage:
//find projects that user1 is a confirmed member of, within org1
WTUser user1 = ...
WTOrganization wtorg1 = OrganizationServicesHelper.manager.getOrganization(user1);
OrgContainer org1 = WTContainerHelper.service.getOrgContainer(org1);
ContainerSpec cs = new ContainerSpec(Project2.class);
cs.addSearchContainer(WTContainerRef.newWTContainerRef(org1));
cs.setMembershipState(ContainerSpec.MEMBER_ONLY);
cs.setUser(user1);
QueryResult qr = WTContainerHelper.service.getContainers(cs);
//find doc masters in the projects
QuerySpec qs = new QuerySpec(WTDocumentMaster.class);
qs.setAdvancedQueryEnabled(true);
qs.appendWhere(WTContainerHelper.getWhereContainerIn(cs),new int[]{0});
qr = PersistenceHelper.manger.find(qs);
Supported API: true
Extendable: false
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContainerSpec(Class result_class)
Supported API: trueContainerSpec(Class[] result_classes)
Supported API: true -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSearchContainer(WTContainerRef search_container) Adds the container to the list of containers to search from.booleanaddSearchContainers(WTContainerRef[] search_containers) Convenience method.
-
Constructor Details
-
ContainerSpec
Supported API: true- Parameters:
result_class-- Throws:
WTException
-
ContainerSpec
Supported API: true- Parameters:
result_classes-
-
-
Method Details
-
addSearchContainer
Adds the container to the list of containers to search from. For example, if you wanted to search within anOrgContainer, then you would add a reference to it here.
Supported API: true- Parameters:
search_container-- Returns:
trueif the container was not previously in the set of search containers
-
addSearchContainers
Convenience method.
Supported API: true- Parameters:
search_containers-- Returns:
- boolean
- See Also:
-