|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.inf.container.WTContainerHelper
Supported API: true
Extendable: false
Nested Class Summary | |
private static class |
WTContainerHelper.Classic
|
protected static class |
WTContainerHelper.ContainerConfig
|
protected static class |
WTContainerHelper.ContainerInfo
|
private static class |
WTContainerHelper.Exchange
|
Constructor Summary | |
WTContainerHelper()
|
Method Summary | |
static Role |
getAdminRole(Class container_class)
Finds the Role to use to provide a localized display
name for a container's administrators group. |
static ContainerIterator |
getAncestors(WTContainerRef container_ref)
Supported API: false |
static WTContainerRef |
getClassicRef()
Return a locally cached, uninflated reference to the classic container. |
static WTContainer |
getContainer(WTContained contained)
Supported API: true |
static ContainerPath |
getContainerPath(WTContainerRef container_ref)
Deprecated. Replaced by #getPath and #getDisplayPath. |
protected static WTContainerRef |
getContainerRef(Object[] arr)
|
static WTContainerRef |
getContainerRef(WTContained contained)
Supported API: false |
static Role |
getCreatorsRole(Class container_class)
Finds the Role to use to provide a localized display
name for a container's administrators group. |
static boolean |
getDefaultAutoPopulateCreators(Class container_class)
Returns the default autoPopulate setting for the given container class. |
static Class[] |
getDefaultCreatorsClasses(OrgContainer container)
Returns the list of classes for which creators groups are created by default, for the given OrgContainer
Supported API: false |
protected static CreatorsMap |
getDefaultCreatorsMap(OrgContainer org)
|
static Map |
getDefaultPublicDomainMapping(Class parent_container_class)
Given a parent container class, returns a mapping of all possible child container classes to their default base public domain names. |
static String |
getDisplayPath(WTContainerRef container_ref)
Returns a path consisting of the display identities of the given container and its parent containers. |
static String |
getDisplayPath(WTContainerRef container_ref,
Locale locale)
Returns a path consisting of the display identities of the given container and its parent containers. |
static WTContainerRef |
getExchangeRef()
Return a locally cached, uninflated reference to the exchange container. |
static String |
getLocalizedContainerName(WTContained contained,
Locale locale)
Returns a localized String representing the container name or a message denoting that the user does not have access to contained's WTContainer name. |
protected static ObjectReference |
getObjectReference(Object[] arr)
|
static String |
getPath(WTContainerRef container_ref)
Returns a container path that is compatabile with WTContainerService 's
getByPath API. |
protected static String |
getPublicParentDisplay(String full_path,
String base_path,
Locale locale)
|
static String |
getPublicParentDisplay(WTContainer container)
Return a display "type" for the container's public parent domain. |
static String |
getPublicParentDisplay(WTContainer container,
Locale locale)
Return a display "type" for the container's public parent domain. |
static StatementSpec |
getStatementForContainersIn(ContainerSpec spec)
Returns a statement that can be used to build non-standard container queries. |
static StatementSpec |
getStatementForSearchClasses(ContainerSpec spec,
Class[] search_classes)
Creates a StatementSpec that will find instances of the
specified search classes that are either contained by or shared into
a WTContainer specified by the supplied ContainerSpec
Supported API: false |
static WhereExpression |
getWhereContainerIn(ContainerSpec spec,
Class search_class)
Deprecated. Replaced by getWhereContainerIn(ContainerSpec,Class[]) |
static WhereExpression |
getWhereContainerIn(ContainerSpec spec,
Class[] search_classes)
Utility api to append container-based where conditions to queries. |
static WhereExpression |
getWhereContainerIn(ContainerSpec spec,
Class[] search_classes,
boolean negate)
Supported API: false |
static WhereExpression |
getWhereContainerIn(ContainerSpec spec,
ClassAttribute container_attribute)
Supported API: false |
static WhereExpression |
getWhereContainerIn(WTContainerRef[] container_refs)
Supported API: false |
static WhereExpression |
getWhereContainerIs(WTContainer container)
Supported API: false |
static WhereExpression |
getWhereContainerIs(WTContainerRef container_ref)
Supported API: false |
static boolean |
isChildOf(WTContainerRef parent_ref,
WTContainerRef child_ref)
Deprecated. Replaced by WTContainerService#isDescendedFrom(WTContainerRef,WTContainerRef) |
static boolean |
isClassicContainer(WTContainer container)
Determines whether or not the given container is the installation's "classic" container. |
private static boolean |
isClassicOid(ObjectIdentifier oid)
|
static boolean |
isClassicRef(WTContainerRef container_ref)
Determines whether or not the given reference refers to the installation's "classic" container. |
static boolean |
isContainedBy(WTContained contained,
WTContainerRef container_ref)
Determine if the WTContained object is immediately contained
by the given WTContainer
Supported API: false |
static boolean |
isExchangeContainer(WTContainer container)
Determines whether or not the given container is the installation's exchange container. |
private static boolean |
isExchangeOid(ObjectIdentifier oid)
|
static boolean |
isExchangeRef(WTContainerRef container_ref)
Determines whether or not the given reference refers to the installation's exchange container. |
private static boolean |
isInstalled(Class container_class)
|
protected static boolean |
isSpecialContainer(WTContainer container)
|
static void |
log(String property,
AdminDomainRef ref,
StringBuffer sb)
|
static void |
log(String property,
boolean value,
StringBuffer sb)
|
static void |
log(String property,
Collection values,
StringBuffer sb)
|
static void |
log(String property,
ObjectReference ref,
StringBuffer sb)
|
static void |
log(String property,
Object value,
StringBuffer sb)
|
static void |
log(String property,
WTContainerRef ref,
StringBuffer sb)
|
static void |
log(String property,
WTPrincipalReference ref,
StringBuffer sb)
|
static void |
logContainerRefs(String property,
Collection refs,
StringBuffer sb)
|
static boolean |
sameContainer(WTContained contained1,
WTContained contained2)
Supported API: false |
static void |
setBusinessNamespace(WTContainer container,
boolean business_namespace)
Assigns the businessNamespace property to an unpersisted container. |
protected static void |
setClassicOid(ObjectIdentifier oid)
|
static void |
setContainer(WTContained contained,
WTContainerRef container_ref)
Assigns a container reference to an unpersisted contained object. |
static void |
setPrivateAccess(WTContainer container,
boolean private_access)
Assigns the privateAccess property to an unpersisted container. |
static void |
setPublicParentDomain(WTContainer container,
AdminDomainRef public_parent)
Assigns the parentPublicDomain property to an unpersisted container. |
static void |
setRestrictedDirectorySearchScope(OrgContainer container,
boolean restrict)
Assigns the restrictedDirectorySearchScope property to
an unpersisted OrgContainer . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final WTContainerService service
private static final boolean DEBUG
private static final DebugWriter LOG
private static final String PROPERTY_FILE
private static final String ROLE_RESOURCE
private static final String DEFAULT_ADMINISTRATORS_NAME
private static final String DEFAULT_CREATORS_NAME
public static final String PUBLIC_NODE_NAME
public static final String ORG_ADMIN_MANAGED_GROUPS
public static final String PRIVATE_DOMAIN_NAME
public static final String DEFAULT_CABINET_NAME
public static final String SYSTEM_CABINET_NAME
public static final String UNRESTRICTED_ORG_GROUP_NAME
public static final String ALL_PARTICIPATING_MEMBERS_NAME
public static final String CREATORS_NODE_NAME
private static final String PUBLIC_PARENT_DISPLAY_SEPARATOR
private static final int PUBLIC_PARENT_DISPLAY_SEPARATOR_LENGTH
protected static final WTContainerHelper.ContainerConfig containerConfig
protected static final Class[] EMPTY_CLASS_ARRAY
protected static final String[] EMPTY_STRING_ARRAY
private static final String BASE_DOMAIN_MAPPING
protected static final int[] ZERO
protected static final String WTORG_ID
public static final String CONTAINER_ID
Constructor Detail |
public WTContainerHelper()
Method Detail |
public static Role getAdminRole(Class container_class) throws WTException
Role
to use to provide a localized display
name for a container's administrators group.
container_class
-
WTException
public static ContainerIterator getAncestors(WTContainerRef container_ref) throws WTException
container_ref
-
WTException
public static WTContainerRef getClassicRef() throws WTException
WTException
public static WTContainer getContainer(WTContained contained) throws WTException
contained
-
WTContained
object's container.
WTException
public static ContainerPath getContainerPath(WTContainerRef container_ref) throws WTException
container_ref
-
WTException
public static WTContainerRef getContainerRef(WTContained contained) throws WTException
contained
-
WTContained
object's container.
WTException
public static Role getCreatorsRole(Class container_class) throws WTException
Role
to use to provide a localized display
name for a container's administrators group.
container_class
-
WTException
public static boolean getDefaultAutoPopulateCreators(Class container_class) throws WTException
container_class
-
WTException
public static Class[] getDefaultCreatorsClasses(OrgContainer container) throws WTException
OrgContainer
container
-
WTException
public static Map getDefaultPublicDomainMapping(Class parent_container_class) throws WTException
parent_container_class
-
WTException
public static String getDisplayPath(WTContainerRef container_ref) throws WTException
If the user does not have access to a parent container, then "Secured
Information" is displayed instead of the remainder of the path.
Supported API: false
container_ref
-
WTException
getPath(wt.inf.container.WTContainerRef)
public static String getDisplayPath(WTContainerRef container_ref, Locale locale) throws WTException
If the user does not have access to a parent container, then "Secured
Information" is displayed instead of the remainder of the path.
Supported API: false
container_ref
- locale
-
WTException
getPath(wt.inf.container.WTContainerRef)
public static WTContainerRef getExchangeRef() throws WTException
WTException
public static String getPath(WTContainerRef container_ref) throws WTException
WTContainerService
's
getByPath API.
container_ref
-
WTException
getDisplayPath(wt.inf.container.WTContainerRef)
,
WTContainerService.getByPath(java.lang.String)
public static String getPublicParentDisplay(WTContainer container) throws WTException
container
-
WTException
public static String getPublicParentDisplay(WTContainer container, Locale locale) throws WTException
container
- locale
-
WTException
public static StatementSpec getStatementForContainersIn(ContainerSpec spec) throws WTException
// Find PDMLink products that the current user // is a member of that have a name like the // given name QuerySpec qs = new QuerySpec(PDMLinkProduct.class); qs.appendWhere(new SearchCondition(PDMLinkProduct.class, PDMLinkProduct.NAME, SearchCondition.LIKE, "MyName"), new int[]{0}); // Now build a container spec that we can use to filter the // query by membership ContainerSpec cs = new ContainerSpec(PDMLinkProduct.class); cs.setMembershipState(ContainerSpec.MEMBERS_ONLY); // Since we are going to use the container spec to build a // a sub select, only select oids cs.setSelectState(ContainerSpec.SELECT_OIDS); // Add the container statement to the query using s sub select StatementSpec ss = WTContainerHelper.getStatementForContainersIn(cs); qs.appendAnd(); qs.appendWhere(new SearchCondition(new ClassAttribute(PDMLinkProduct.class, WTAttributeNameIfc.ID_NAME), SearchCondition.IN, new SubSelectExpression(ss)), new int[]{0}); return PersistenceHelper.manager.find(qs);
spec
-
StatementSpec
that will find the WTContainer
s
specified by the supplied ContainerSpec
WTException
ContainerSpec
public static StatementSpec getStatementForSearchClasses(ContainerSpec spec, Class[] search_classes) throws WTException
StatementSpec
that will find instances of the
specified search classes that are either contained by or shared into
a WTContainer
specified by the supplied ContainerSpec
spec
- search_classes
-
WTException
ContainerSpec
public static WhereExpression getWhereContainerIn(ContainerSpec spec, Class search_class) throws WTException
getWhereContainerIn(ContainerSpec,Class[])
spec
- search_class
-
WTException
public static WhereExpression getWhereContainerIn(ContainerSpec spec, Class[] search_classes) throws WTException
// 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);
spec
- search_classes
-
WhereExpression
that will filter a query for
the object types specified in search_classes
by the containers
specified in the supplied ContainerSpec
WTException
ContainerSpec
public static WhereExpression getWhereContainerIn(ContainerSpec spec, Class[] search_classes, boolean negate) throws WTException
spec
- search_classes
- negate
-
WhereExpression
that will filter a query for
the object types specified in search_classes
by the containers
specified in the supplied ContainerSpec
WTException
ContainerSpec
public static WhereExpression getWhereContainerIn(ContainerSpec spec, ClassAttribute container_attribute) throws WTException
spec
- container_attribute
-
WhereExpression
that will filter the given
ClassAttribute
by the WTContainer
s specified
in the supplied ContainerSpec
. The ClassAttribute
should represent a container oid.
WTException
ContainerSpec
public static WhereExpression getWhereContainerIn(WTContainerRef[] container_refs) throws WTException
container_refs
-
WhereExpression
that wil filter a query for
WTContained
objects to only look in the supplied WTContainer
s.
WTException
public static WhereExpression getWhereContainerIs(WTContainer container) throws WTException
container
-
WhereExpression
that wil filter a query for
WTContained
objects to only look in the supplied WTContainer
.
WTException
public static WhereExpression getWhereContainerIs(WTContainerRef container_ref) throws WTException
container_ref
-
WhereExpression
that wil filter a query for
WTContained
objects to only look in the supplied WTContainer
s.
WTException
public static boolean isChildOf(WTContainerRef parent_ref, WTContainerRef child_ref) throws WTException
parent_ref
- child_ref
-
WTException
public static boolean isClassicContainer(WTContainer container)
container
-
public static boolean isClassicRef(WTContainerRef container_ref)
container_ref
-
public static boolean isContainedBy(WTContained contained, WTContainerRef container_ref)
WTContained
object is immediately contained
by the given WTContainer
contained
- container_ref
-
public static boolean isExchangeContainer(WTContainer container)
container
-
public static boolean isExchangeRef(WTContainerRef container_ref)
container_ref
-
public static boolean sameContainer(WTContained contained1, WTContained contained2) throws WTException
contained1
- contained2
-
true
if the objects refer to the same container
WTException
public static void setBusinessNamespace(WTContainer container, boolean business_namespace) throws WTPropertyVetoException
container
- business_namespace
-
WTPropertyVetoException
public static void setContainer(WTContained contained, WTContainerRef container_ref) throws WTPropertyVetoException
contained
- container_ref
-
WTPropertyVetoException
public static void setPrivateAccess(WTContainer container, boolean private_access) throws WTPropertyVetoException
container
- private_access
-
WTPropertyVetoException
WTContainerService.makePrivate(wt.inf.container.WTContainer)
,
WTContainerService.makePublic(wt.inf.container.WTContainer)
public static void setPublicParentDomain(WTContainer container, AdminDomainRef public_parent) throws WTPropertyVetoException
container
- public_parent
-
WTPropertyVetoException
WTContainerService.changePublicParentDomain(wt.inf.container.WTContainer, wt.admin.AdminDomainRef)
public static void setRestrictedDirectorySearchScope(OrgContainer container, boolean restrict) throws WTPropertyVetoException
restrictedDirectorySearchScope
property to
an unpersisted OrgContainer
.
The OrgContainerCreator
will add the WTOrganization
associated with the container to the site-level All Unrestricted
Organizations
group if the value of this property is false
.
By default, members of the All Unrestricted Organizations
group are granted read access to all principals in the User
domain or any of its child domains.
Use WTContainerServicer#changeRestrictedDirectorySearchScope(OrgContainer,boolean)
to assign this value to a persistent container.
Supported API: false
container
- restrict
-
WTPropertyVetoException
OrgContainer.restrictedDirectorySearchScope
protected static final ObjectReference getObjectReference(Object[] arr) throws WTException
WTException
protected static final WTContainerRef getContainerRef(Object[] arr) throws WTException
WTException
protected static final String getPublicParentDisplay(String full_path, String base_path, Locale locale)
protected static final CreatorsMap getDefaultCreatorsMap(OrgContainer org) throws WTException
WTException
private static final boolean isClassicOid(ObjectIdentifier oid)
private static final boolean isExchangeOid(ObjectIdentifier oid)
protected static boolean isSpecialContainer(WTContainer container) throws WTException
WTException
private static boolean isInstalled(Class container_class)
protected static void setClassicOid(ObjectIdentifier oid) throws WTPropertyVetoException
WTPropertyVetoException
public static void log(String property, ObjectReference ref, StringBuffer sb)
public static void log(String property, AdminDomainRef ref, StringBuffer sb)
public static void log(String property, WTContainerRef ref, StringBuffer sb)
public static void log(String property, WTPrincipalReference ref, StringBuffer sb)
public static void log(String property, boolean value, StringBuffer sb)
public static void log(String property, Object value, StringBuffer sb)
public static void logContainerRefs(String property, Collection refs, StringBuffer sb)
public static void log(String property, Collection values, StringBuffer sb)
public static String getLocalizedContainerName(WTContained contained, Locale locale)
contained
- locale
-
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |