|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.inf.container.ContainerSpec
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
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 |
private static final String RESOURCE
private static final String CLASSNAME
private Collection resultClasses
private Collection searchContainers
private WTPrincipalReference user
private int modifiers
public static final int SELECT_OIDS
getSelectState()
,
Constant Field Valuespublic static final int SELECT_PERSISTABLE
getSelectState()
,
Constant Field Valuespublic static final int SELECT_REFERENCE
getSelectState()
,
Constant Field Valuespublic static final int ACTIVE_ONLY
getDeleteState()
,
Constant Field Valuespublic static final int DELETED_ONLY
getDeleteState()
,
Constant Field Valuespublic static final int DELETED_AND_ACTIVE
getDeleteState()
,
Constant Field Valuespublic static final int CONFIRMED_ONLY
int
parameter to getMembersOf
.
getMembershipState()
,
Constant Field Valuespublic static final int UNCONFIRMED_ONLY
int
parameter to getMembersOf
.
getMembershipState()
,
Constant Field Valuespublic static final int MEMBERS_ONLY
getMembershipState()
,
Constant Field Valuespublic static final int ANY_USER
getMembershipState()
,
Constant Field Valuespublic static final int FILTER_BY_NAMESPACE
isFilterByNamespace()
,
Constant Field Valuespublic static final int INCLUDE_SHARED
isIncludeShared()
,
Constant Field Valuesprivate static final int SELECT_STATES
private static final int DELETE_STATES
private static final int MEMBERSHIP_STATES
private static final int DEFAULT
Constructor Detail |
public ContainerSpec(Class result_class) throws WTException
result_class
-
WTException
public ContainerSpec(Class[] result_classes)
result_classes
- public ContainerSpec(Class[] result_classes, boolean descendants_included) throws WTException
result_classes
- descendants_included
- Whether or not subclasses of the supplied container classes should be included in the query.
WTException
public ContainerSpec() throws WTException
WTException
Method Detail |
public int getDeleteState()
public void setDeleteState(int a_DeleteState) throws WTPropertyVetoException
a_DeleteState
-
WTPropertyVetoException
public boolean isFilterByNamespace()
Default: false
Supported API: false
public void setFilterByNamespace(boolean a_FilterByNamespace) throws WTPropertyVetoException
Default: false
Supported API: false
a_FilterByNamespace
-
WTPropertyVetoException
public boolean isIncludeShared()
ContainerSpec
is used to generate
a WhereExpression
via WTContainerHelper.getWhereContainerIn(ContainerSpec,Class)
Default: true
Supported API: false
public void setIncludeShared(boolean a_IncludeShared) throws WTPropertyVetoException
ContainerSpec
is used to generate
a WhereExpression
via WTContainerHelper.getWhereContainerIn(ContainerSpec,Class)
Default: true
Supported API: false
a_IncludeShared
-
WTPropertyVetoException
public int getMembershipState()
int
parameter to getMembersOf
. These states are:
ContainerSpec
APIs, they function the same was as MEMBERS_ONLY
does.
public void setMembershipState(int a_MembershipState) throws WTPropertyVetoException
int
parameter to getMembersOf
. These states are:
ContainerSpec
APIs, they function the same was as MEMBERS_ONLY
does.
a_MembershipState
-
WTPropertyVetoException
public Collection getResultClasses()
WTContainer.class
public void setResultClasses(Collection a_ResultClasses) throws WTPropertyVetoException
WTContainer.class
a_ResultClasses
-
WTPropertyVetoException
public Collection getSearchContainers()
public void setSearchContainers(Collection a_SearchContainers) throws WTPropertyVetoException
a_SearchContainers
-
WTPropertyVetoException
public int getSelectState()
public void setSelectState(int a_SelectState) throws WTPropertyVetoException
a_SelectState
-
WTPropertyVetoException
public WTPrincipalReference getUser()
public void setUser(WTPrincipalReference a_User) throws WTPropertyVetoException
a_User
-
WTPropertyVetoException
private void userValidate(WTPrincipalReference a_User) throws WTPropertyVetoException
a_User
-
WTPropertyVetoException
public boolean addResultClass(Class result_class)
result_class
-
public boolean addResultClasses(Class[] result_classes)
result_classes
-
public boolean addSearchContainer(WTContainerRef search_container)
OrgContainer
, then
you would add a reference to it here.
search_container
-
true
if the container was not previously in the
set of search containerspublic boolean addSearchContainers(WTContainerRef[] search_containers)
search_containers
-
addSearchContainer(WTContainerRef)
public void setSelectOids(boolean select_oids) throws WTPropertyVetoException
select_oids
-
WTPropertyVetoException
public void setFilterByMembership(boolean filter_by_membership) throws WTPropertyVetoException
filter_by_membership
-
WTPropertyVetoException
public void setUser(WTPrincipalReference user, boolean filter_by_membership) throws WTPropertyVetoException
user
- filter_by_membership
-
WTPropertyVetoException
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
public String toString()
private void logModifiers(StringBuffer sb)
private String getLogName(int state)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |