wt.inf.container
Class ContainerSpec

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

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: false

Extendable: false

See Also:
Serialized Form

Field Summary
static int ACTIVE_ONLY
          

Supported API: false
static int ANY_USER
          

Supported API: false
private static String CLASSNAME
           
static int CONFIRMED_ONLY
          Only supported for use as the int parameter to getMembersOf.
private static int DEFAULT
           
private static int DELETE_STATES
           
static int DELETED_AND_ACTIVE
          

Supported API: false
static int DELETED_ONLY
          

Supported API: false
static int FILTER_BY_NAMESPACE
          

Supported API: false
static int INCLUDE_SHARED
          

Supported API: false
static int MEMBERS_ONLY
          

Supported API: false
private static int MEMBERSHIP_STATES
           
private  int modifiers
           
private static String RESOURCE
           
private  Collection resultClasses
           
private  Collection searchContainers
           
static int SELECT_OIDS
          Select only the oids (ida2a2) of the containers in the spec.
static int SELECT_PERSISTABLE
          Select the full container, not specific attributes (Default)

Supported API: false
static int SELECT_REFERENCE
          Select the classname and oid (in that order) of the containers in the spec

Supported API: false
private static int SELECT_STATES
           
static int UNCONFIRMED_ONLY
          Only supported for use as the int parameter to getMembersOf.
private  WTPrincipalReference user
           
 
Constructor Summary
ContainerSpec()
          

Supported API: false
ContainerSpec(Class result_class)
          

Supported API: false
ContainerSpec(Class[] result_classes)
          

Supported API: false
ContainerSpec(Class[] result_classes, boolean descendants_included)
          Deprecated.  
 
Method Summary
 boolean addResultClass(Class result_class)
          Adds the given container class to the set of classes that the query should select containers from.
 boolean addResultClasses(Class[] result_classes)
          Adds the container classes to the set of classes that the query should select containers from.
 boolean addSearchContainer(WTContainerRef search_container)
          Adds the container to the list of containers to search from.
 boolean addSearchContainers(WTContainerRef[] search_containers)
          Convenience method.
 Object clone()
          

Supported API: false
 int getDeleteState()
          Gets the value of the attribute: deleteState; Determines how mark for deleted containers are handled.
private  String getLogName(int state)
           
 int getMembershipState()
          Gets the value of the attribute: membershipState; Determines how the spec's user property should filter the query.
 Collection getResultClasses()
          Gets the value of the attribute: resultClasses; The collection of container types that should be included in the resulting query.
 Collection getSearchContainers()
          Gets the value of the attribute: searchContainers; A collection of container references to search in.
 int getSelectState()
          Gets the value of the attribute: selectState; Determines what attributes of the containers in the spec are selected.
 WTPrincipalReference getUser()
          Gets the value of the attribute: user; The user that membership state will be filtered by, if necessary.
 boolean isFilterByNamespace()
          Gets the value of the attribute: filterByNamespace; When true, the spec will only select containers that are in the same namespace as the search containers.
 boolean isIncludeShared()
          Gets the value of the attribute: includeShared; Should objects that are shared to a container be included in the result set.
private  void logModifiers(StringBuffer sb)
           
 void setDeleteState(int a_DeleteState)
          Sets the value of the attribute: deleteState; Determines how mark for deleted containers are handled.
 void setFilterByMembership(boolean filter_by_membership)
          Deprecated. Replaced by setMembershipState
 void setFilterByNamespace(boolean a_FilterByNamespace)
          Sets the value of the attribute: filterByNamespace; When true, the spec will only select containers that are in the same namespace as the search containers.
 void setIncludeShared(boolean a_IncludeShared)
          Sets the value of the attribute: includeShared; Should objects that are shared to a container be included in the result set.
 void setMembershipState(int a_MembershipState)
          Sets the value of the attribute: membershipState; Determines how the spec's user property should filter the query.
 void setResultClasses(Collection a_ResultClasses)
          Sets the value of the attribute: resultClasses; The collection of container types that should be included in the resulting query.
 void setSearchContainers(Collection a_SearchContainers)
          Sets the value of the attribute: searchContainers; A collection of container references to search in.
 void setSelectOids(boolean select_oids)
          Deprecated. Replaced by setSelectState
 void setSelectState(int a_SelectState)
          Sets the value of the attribute: selectState; Determines what attributes of the containers in the spec are selected.
 void setUser(WTPrincipalReference a_User)
          Sets the value of the attribute: user; The user that membership state will be filtered by, if necessary.
 void setUser(WTPrincipalReference user, boolean filter_by_membership)
          Deprecated. Use setUser and setMembership state instead.
 String toString()
           
private  void userValidate(WTPrincipalReference a_User)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

resultClasses

private Collection resultClasses

searchContainers

private Collection searchContainers

user

private WTPrincipalReference user

modifiers

private int modifiers

SELECT_OIDS

public static final int SELECT_OIDS
Select only the oids (ida2a2) of the containers in the spec.

Supported API: false

See Also:
getSelectState(), Constant Field Values

SELECT_PERSISTABLE

public static final int SELECT_PERSISTABLE
Select the full container, not specific attributes (Default)

Supported API: false

See Also:
getSelectState(), Constant Field Values

SELECT_REFERENCE

public static final int SELECT_REFERENCE
Select the classname and oid (in that order) of the containers in the spec

Supported API: false

See Also:
getSelectState(), Constant Field Values

ACTIVE_ONLY

public static final int ACTIVE_ONLY


Supported API: false

See Also:
getDeleteState(), Constant Field Values

DELETED_ONLY

public static final int DELETED_ONLY


Supported API: false

See Also:
getDeleteState(), Constant Field Values

DELETED_AND_ACTIVE

public static final int DELETED_AND_ACTIVE


Supported API: false

See Also:
getDeleteState(), Constant Field Values

CONFIRMED_ONLY

public static final int CONFIRMED_ONLY
Only supported for use as the int parameter to getMembersOf.

Supported API: false

See Also:
getMembershipState(), Constant Field Values

UNCONFIRMED_ONLY

public static final int UNCONFIRMED_ONLY
Only supported for use as the int parameter to getMembersOf.

Supported API: false

See Also:
getMembershipState(), Constant Field Values

MEMBERS_ONLY

public static final int MEMBERS_ONLY


Supported API: false

See Also:
getMembershipState(), Constant Field Values

ANY_USER

public static final int ANY_USER


Supported API: false

See Also:
getMembershipState(), Constant Field Values

FILTER_BY_NAMESPACE

public static final int FILTER_BY_NAMESPACE


Supported API: false

See Also:
isFilterByNamespace(), Constant Field Values

INCLUDE_SHARED

public static final int INCLUDE_SHARED


Supported API: false

See Also:
isIncludeShared(), Constant Field Values

SELECT_STATES

private static final int SELECT_STATES
See Also:
Constant Field Values

DELETE_STATES

private static final int DELETE_STATES
See Also:
Constant Field Values

MEMBERSHIP_STATES

private static final int MEMBERSHIP_STATES
See Also:
Constant Field Values

DEFAULT

private static final int DEFAULT
See Also:
Constant Field Values
Constructor Detail

ContainerSpec

public ContainerSpec(Class result_class)
              throws WTException


Supported API: false

Parameters:
result_class -
Throws:
WTException

ContainerSpec

public ContainerSpec(Class[] result_classes)


Supported API: false

Parameters:
result_classes -

ContainerSpec

public ContainerSpec(Class[] result_classes,
                     boolean descendants_included)
              throws WTException
Deprecated.  

This method will be removed in build 31.

Supported API: false

Parameters:
result_classes -
descendants_included - Whether or not subclasses of the supplied container classes should be included in the query.
Throws:
WTException

ContainerSpec

public ContainerSpec()
              throws WTException


Supported API: false

Throws:
WTException
Method Detail

getDeleteState

public int getDeleteState()
Gets the value of the attribute: deleteState; Determines how mark for deleted containers are handled. The options are: Note that unrestorable containers are never included.

Supported API: false

Returns:
int

setDeleteState

public void setDeleteState(int a_DeleteState)
                    throws WTPropertyVetoException
Sets the value of the attribute: deleteState; Determines how mark for deleted containers are handled. The options are: Note that unrestorable containers are never included.

Supported API: false

Parameters:
a_DeleteState -
Throws:
WTPropertyVetoException

isFilterByNamespace

public boolean isFilterByNamespace()
Gets the value of the attribute: filterByNamespace; When true, the spec will only select containers that are in the same namespace as the search containers.

Default: false

Supported API: false

Returns:
boolean

setFilterByNamespace

public void setFilterByNamespace(boolean a_FilterByNamespace)
                          throws WTPropertyVetoException
Sets the value of the attribute: filterByNamespace; When true, the spec will only select containers that are in the same namespace as the search containers.

Default: false

Supported API: false

Parameters:
a_FilterByNamespace -
Throws:
WTPropertyVetoException

isIncludeShared

public boolean isIncludeShared()
Gets the value of the attribute: includeShared; Should objects that are shared to a container be included in the result set. This property only applies when a ContainerSpec is used to generate a WhereExpression via WTContainerHelper.getWhereContainerIn(ContainerSpec,Class)

Default: true

Supported API: false

Returns:
boolean

setIncludeShared

public void setIncludeShared(boolean a_IncludeShared)
                      throws WTPropertyVetoException
Sets the value of the attribute: includeShared; Should objects that are shared to a container be included in the result set. This property only applies when a ContainerSpec is used to generate a WhereExpression via WTContainerHelper.getWhereContainerIn(ContainerSpec,Class)

Default: true

Supported API: false

Parameters:
a_IncludeShared -
Throws:
WTPropertyVetoException

getMembershipState

public int getMembershipState()
Gets the value of the attribute: membershipState; Determines how the spec's user property should filter the query. Supported options are: There are two additional membership state constants that are only supported for use as the int parameter to getMembersOf. These states are: When these constants are used with other ContainerSpec APIs, they function the same was as MEMBERS_ONLY does.

Supported API: false

Returns:
int

setMembershipState

public void setMembershipState(int a_MembershipState)
                        throws WTPropertyVetoException
Sets the value of the attribute: membershipState; Determines how the spec's user property should filter the query. Supported options are: There are two additional membership state constants that are only supported for use as the int parameter to getMembersOf. These states are: When these constants are used with other ContainerSpec APIs, they function the same was as MEMBERS_ONLY does.

Supported API: false

Parameters:
a_MembershipState -
Throws:
WTPropertyVetoException

getResultClasses

public Collection getResultClasses()
Gets the value of the attribute: resultClasses; The collection of container types that should be included in the resulting query. Note that if the spec is not constructed with a result class, then this collection is initialized by default to include WTContainer.class

Supported API: false

Returns:
Collection

setResultClasses

public void setResultClasses(Collection a_ResultClasses)
                      throws WTPropertyVetoException
Sets the value of the attribute: resultClasses; The collection of container types that should be included in the resulting query. Note that if the spec is not constructed with a result class, then this collection is initialized by default to include WTContainer.class

Supported API: false

Parameters:
a_ResultClasses -
Throws:
WTPropertyVetoException

getSearchContainers

public Collection getSearchContainers()
Gets the value of the attribute: searchContainers; A collection of container references to search in.

Supported API: false

Returns:
Collection

setSearchContainers

public void setSearchContainers(Collection a_SearchContainers)
                         throws WTPropertyVetoException
Sets the value of the attribute: searchContainers; A collection of container references to search in.

Supported API: false

Parameters:
a_SearchContainers -
Throws:
WTPropertyVetoException

getSelectState

public int getSelectState()
Gets the value of the attribute: selectState; Determines what attributes of the containers in the spec are selected. Options are:

Supported API: false

Returns:
int

setSelectState

public void setSelectState(int a_SelectState)
                    throws WTPropertyVetoException
Sets the value of the attribute: selectState; Determines what attributes of the containers in the spec are selected. Options are:

Supported API: false

Parameters:
a_SelectState -
Throws:
WTPropertyVetoException

getUser

public WTPrincipalReference getUser()
Gets the value of the attribute: user; The user that membership state will be filtered by, if necessary. If this property isn't set, it is defaulted to the current user.

Supported API: false

Returns:
WTPrincipalReference

setUser

public void setUser(WTPrincipalReference a_User)
             throws WTPropertyVetoException
Sets the value of the attribute: user; The user that membership state will be filtered by, if necessary. If this property isn't set, it is defaulted to the current user.

Supported API: false

Parameters:
a_User -
Throws:
WTPropertyVetoException

userValidate

private void userValidate(WTPrincipalReference a_User)
                   throws WTPropertyVetoException
Parameters:
a_User -
Throws:
WTPropertyVetoException

addResultClass

public boolean addResultClass(Class result_class)
Adds the given container class to the set of classes that the query should select containers from.

Supported API: false

Parameters:
result_class -
Returns:
boolean

addResultClasses

public boolean addResultClasses(Class[] result_classes)
Adds the container classes to the set of classes that the query should select containers from.

Supported API: false

Parameters:
result_classes -
Returns:
boolean

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: false

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: false

Parameters:
search_containers -
Returns:
boolean
See Also:
addSearchContainer(WTContainerRef)

setSelectOids

public void setSelectOids(boolean select_oids)
                   throws WTPropertyVetoException
Deprecated. Replaced by setSelectState



Supported API: false

Parameters:
select_oids -
Throws:
WTPropertyVetoException

setFilterByMembership

public void setFilterByMembership(boolean filter_by_membership)
                           throws WTPropertyVetoException
Deprecated. Replaced by setMembershipState



Supported API: false

Parameters:
filter_by_membership -
Throws:
WTPropertyVetoException

setUser

public void setUser(WTPrincipalReference user,
                    boolean filter_by_membership)
             throws WTPropertyVetoException
Deprecated. Use setUser and setMembership state instead.



Supported API: false

Parameters:
user -
filter_by_membership -
Throws:
WTPropertyVetoException

clone

public Object clone()
             throws CloneNotSupportedException


Supported API: false

Returns:
Object
Throws:
CloneNotSupportedException

toString

public String toString()

logModifiers

private void logModifiers(StringBuffer sb)

getLogName

private String getLogName(int state)