Interface IContainerPolicy
- All Superinterfaces:
IBasicPolicy
,IBizPolicy
,IComponent
,IInitializable
,ISystemHandler
,IViewableContainerPolicy
,IViewablePolicy
Policy used to manipulate (create, move, delete, etc.) metadata service container things (ie topics and folders).
Policy commands are always invoked with a IContext
object.
The IContext
object contains information about the user on whose
behalf the command is invoked, as well as access, event, and workflow states.
These states, which can be toggled on and off, are known as traits,
and are encapsulated by the ITraits
object.
By default, all policy commands will check access, fire events, and initiate workflow
as appropriate for the command.
-
Method Summary
Modifier and TypeMethodDescriptionclonePortalPage
(IContext context, IURI resourceURI) Clones a portal Page to the user's home folderCreates a copy of the specified item in the specified container.Creates a copy of the specified item in the specified container.Creates a new thing as a primary child in the specified container, with the specified properties.createUniqueName
(IContext context, IThingID resourceURI, String name) Creates a unique name in the given foldergetSelectedListView
(IContext context, IThingID rootID, IURI resourceURI, int depth) Given a root, and a current resource, walk down from the rootdepth
levels.listChildren
(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems) Deprecated.listChildren
(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo) Deprecated.listChildren
(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo, int filter) Deprecated.listChildren
(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems) Lists the primary and reference items in the specified container.listChildren
(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems, boolean extraInfo) Lists the primary and reference items in the specified container.listChildren
(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems, boolean extraInfo, int filter) Lists the primary and reference items in the specified container.matchChildren
(IContext context, IThingID containerId, String regEx, int start, int end, int rights) Deprecated.matchChildren
(IContext context, IThingID containerId, String regEx, int start, int end, IRightSet rights) Lists the primary children in the specified container which match the RegEx.matchChildren
(IContext context, IThingID containerId, String regEx, IPagingCookie cookie, int rights) Deprecated.matchChildren
(IContext context, IThingID containerId, String regEx, IPagingCookie cookie, IRightSet rights) Lists the primary children in the specified container which match the RegEx.obtainOwnedFolder
(IContext context, IThingID parentID, int type, String name, Map<String, ?> properties) Finds the folder of the specified folder type for the specified context, or creates a new one with the specified properties if not found.validatePublish
(IContext context, IThingID resourceURI, String xtype, String name) Validate a user can publish an item of the given xtype in the specified folder.Methods inherited from interface com.webmethods.portal.bizPolicy.biz.meta.IBasicPolicy
addNote, addToTopics, canUser, cloneRemote, copyToClipboard, cutToClipboard, delete, deleteReference, destroy, getContent, listContainers, listNotes, moveThing, moveThing, pasteFromClipboard, removeNote, setOwner, updateProperties
Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.bizPolicy.biz.view.IViewableContainerPolicy
getPagingCookie, getPagingCookie, pageBackward, pageForeward, setPagingCookie
Methods inherited from interface com.webmethods.portal.bizPolicy.biz.view.IViewablePolicy
getIcon, view
-
Method Details
-
listChildren
@Deprecated IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems) throws BizException Deprecated.Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
listChildren
IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems) throws BizException Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
listChildren
@Deprecated IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo) throws BizException Deprecated.Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.extraInfo
- True to add extra info (such as portlet properties) to eachIView
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
listChildren
IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems, boolean extraInfo) throws BizException Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.extraInfo
- True to add extra info (such as portlet properties) to eachIView
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
listChildren
@Deprecated IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo, int filter) throws BizException Deprecated.Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.extraInfo
- True to add extra info (such as portlet properties) to eachIView
.filter
- apply a filter in the form of anIThingType
. All items in the result list will be of this type- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
listChildren
IListView<? extends IView> listChildren(IContext context, IThingID containerId, String view, int action, IRightSet rights, int depth, boolean includeItems, boolean extraInfo, int filter) throws BizException Lists the primary and reference items in the specified container.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.view
- User-defined name of view. Null by default.action
- Paging action:IPagingCookie.ACTION_REFRESH
,IPagingCookie.ACTION_PREVIOUS
, orIPagingCookie.ACTION_NEXT
.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.depth
- Number of levels of descendants to list. If one, lists children; if two, lists children and grandchildren; etc. If less than one, lists all descendants.includeItems
- True if all descendant types should be included in list; false if only container types should be included.extraInfo
- True to add extra info (such as portlet properties) to eachIView
.filter
- apply a filter in the form of anIThingType
. All items in the result list will be of this type- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
matchChildren
@Deprecated IListView<? extends IView> matchChildren(IContext context, IThingID containerId, String regEx, int start, int end, int rights) throws BizException Deprecated.Lists the primary children in the specified container which match the RegEx.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
matchChildren
IListView<? extends IView> matchChildren(IContext context, IThingID containerId, String regEx, int start, int end, IRightSet rights) throws BizException Lists the primary children in the specified container which match the RegEx.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
matchChildren
@Deprecated IListView<? extends IView> matchChildren(IContext context, IThingID containerId, String regEx, IPagingCookie cookie, int rights) throws BizException Deprecated.Lists the primary children in the specified container which match the RegEx.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
matchChildren
IListView<? extends IView> matchChildren(IContext context, IThingID containerId, String regEx, IPagingCookie cookie, IRightSet rights) throws BizException Lists the primary children in the specified container which match the RegEx.- Parameters:
context
- Command context (user state information).containerId
- Container whose contents to list.rights
- Right set by which to filter. UsuallyIAccessRight.READ
.- Returns:
- List of
IView
s representing metadata things contained by the specified container. - Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
createChild
IThingID createChild(IContext context, IThingID parentID, Map<String, ? extends Object> properties) throws BizExceptionCreates a new thing as a primary child in the specified container, with the specified properties. Common properties include:
IConstants.XTYPE_NAME
('xtype') -- requiredIConstants.NAME
('name') -- requiredIConstants.DESCRIPTION
('description') -- optionalIConstants.INFO
('info') -- optionalIConstants.FOLDER_TYPE
('folderType') -- optional, and only used by folder items
- Parameters:
context
- Command context (user state information).parentID
- Container in which to create the new child.properties
- Properties of the new child. Must includeIConstants.XTYPE_NAME
andIConstants.NAME
.- Returns:
- Id of newly created child.
- Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
copy
Creates a copy of the specified item in the specified container.- Parameters:
context
- Command context (user state information).parentID
- Container in which to create the new child.childID
- Original item to copy.- Returns:
- Id of newly created child.
- Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
copy
Creates a copy of the specified item in the specified container.- Parameters:
context
- Command context (user state information).parentID
- Container in which to create the new child.childID
- Original item to copy.newName
- new name for the copied thing- Returns:
- Id of newly created child.
- Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
obtainOwnedFolder
IThingID obtainOwnedFolder(IContext context, IThingID parentID, int type, String name, Map<String, ?> properties) throws BizExceptionFinds the folder of the specified folder type for the specified context, or creates a new one with the specified properties if not found.- Parameters:
context
- Command context (user state information).parentID
- Container in which to search.type
-IFolderType
for which to search.name
- Name to use for folder if it is not found and must be created.properties
- Properties with which to create the new folder, if the folder type is not found. SeecreateChild(com.webmethods.portal.bizPolicy.IContext, com.webmethods.portal.service.meta2.thing.IThingID, java.util.Map<java.lang.String, ? extends java.lang.Object>)
for common property info. May be null.- Returns:
- Id of folder, whether created or merely found.
- Throws:
BizException
- if command fails because access was denied or a datasource error occured.
-
validatePublish
Integer validatePublish(IContext context, IThingID resourceURI, String xtype, String name) throws BizException Validate a user can publish an item of the given xtype in the specified folder.- Parameters:
context
- the current user contextresourceURI
- the URI of the folder to queryxtype
- the xtype of the child that will be createdname
- the name of the resource- Returns:
- an Integer wrapping one of the response codes in
PublishValidateCommand
- Throws:
BizException
-
createUniqueName
Creates a unique name in the given folder- Parameters:
context
- the current user contextresourceURI
- the URI of the folder to queryname
- the starting name- Returns:
- a unique name based on the starting name
- Throws:
BizException
-
clonePortalPage
Clones a portal Page to the user's home folder- Parameters:
context
-resourceURI
-- Returns:
- the new portlet page
- Throws:
BizException
-
getSelectedListView
ISelectedListView getSelectedListView(IContext context, IThingID rootID, IURI resourceURI, int depth) throws BizException Given a root, and a current resource, walk down from the rootdepth
levels. (0 would equal the root). Then return theISelectedListView
that shows the sibling items at that level, including the current item which is selected.
Selected implies that that resource is along the path to the root from the current resource.- Parameters:
context
- the current user contextrootID
- the root of the depth based list viewresourceURI
- the item that helps determine the selected pathdepth
- how many levels to descend from the root (0 = root)- Returns:
- the IListView that contains selected information
- Throws:
BizException
-
listChildren(IContext, IThingID, String, int, IRightSet, int, boolean)
instead