Class ContainerSpec

java.lang.Object
wt.inf.container.ContainerSpec
All Implemented Interfaces:
Serializable, Cloneable

public final class ContainerSpec extends Object implements Cloneable, Serializable
A 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 Details

    • ContainerSpec

      public ContainerSpec(Class result_class) throws WTException


      Supported API: true
      Parameters:
      result_class -
      Throws:
      WTException
    • ContainerSpec

      public ContainerSpec(Class[] result_classes)


      Supported API: true
      Parameters:
      result_classes -
  • Method Details

    • addSearchContainer

      public boolean addSearchContainer(WTContainerRef search_container)
      Adds the container to the list of containers to search from. For example, if you wanted to search within an OrgContainer, then you would add a reference to it here.

      Supported API: true
      Parameters:
      search_container -
      Returns:
      true if the container was not previously in the set of search containers
    • addSearchContainers

      public boolean addSearchContainers(WTContainerRef[] search_containers)
      Convenience method.

      Supported API: true
      Parameters:
      search_containers -
      Returns:
      boolean
      See Also: