Class WTContainerHelper

java.lang.Object
wt.inf.container.WTContainerHelper

public final class WTContainerHelper extends Object


Supported API: true

Extendable: false
  • Field Details

  • Method Details

    • getContainer

      public static WTContainer getContainer(WTContained contained) throws WTException


      Supported API: true
      Parameters:
      contained -
      Returns:
      the WTContained object'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 WhereExpression that will filter a query for the object types specified in search_classes by the containers specified in the supplied ContainerSpec
      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 WhereExpression that will filter a query for the object types specified in search_classes by the containers specified in the supplied ContainerSpec
      Throws:
      WTException
      See Also:
    • getWhereContainerIn

      public static WhereExpression getWhereContainerIn(WTContainerRef[] container_refs) throws WTException


      Supported API: true
      Parameters:
      container_refs -
      Returns:
      A WhereExpression that wil filter a query for WTContained objects to only look in the supplied WTContainers.
      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: