com.webmethods.portal.bizPolicy.biz.meta
Interface IContainerPolicy

All Superinterfaces:
IBasicPolicy, IViewablePolicy

public interface IContainerPolicy
extends IBasicPolicy

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
 IThingID clonePortalPage(IContext context, IURI resourceURI)
          Clones a portal Page to the user's home folder
 IThingID copy(IContext context, IURI parentID, IURI childID)
          Creates a copy of the specified item in the specified container.
 IThingID copy(IContext context, IURI parentID, IURI childID, String newName)
          Creates a copy of the specified item in the specified container.
 IThingID createChild(IContext context, IThingID parentID, Map properties)
          Creates a new thing as a primary child in the specified container, with the specified properties.
 String createUniqueName(IContext context, IThingID resourceURI, String name)
          Creates a unique name in the given folder
 ISelectedListView getSelectedListView(IContext context, IThingID rootID, IURI resourceURI, int depth)
          Given a root, and a current resource, walk down from the root depth levels.
 IListView listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems)
          Lists the primary and reference items in the specified container.
 IListView listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo)
          Lists the primary and reference items in the specified container.
 IListView listChildren(IContext context, IThingID containerId, String view, int action, int rights, int depth, boolean includeItems, boolean extraInfo, int filter)
          Lists the primary and reference items in the specified container.
 IListView matchChildren(IContext context, IThingID containerId, String regEx, int start, int end, int rights)
          Lists the primary children in the specified container which match the RegEx.
 IListView matchChildren(IContext context, IThingID containerId, String regEx, IPagingCookie cookie, int rights)
          Lists the primary children in the specified container which match the RegEx.
 IThingID obtainOwnedFolder(IContext context, IThingID parentID, int type, String name, Map 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.
 Integer 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.bizPolicy.biz.view.IViewablePolicy
getIcon, getPagingCookie, getPagingCookie, pageBackward, pageForeward, setPagingCookie, view
 

Method Detail

listChildren

IListView listChildren(IContext context,
                       IThingID containerId,
                       String view,
                       int action,
                       int 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, or IPagingCookie#ACTION_NEXT.
rights - Right set by which to filter. Usually IAccessRight#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 IViews representing metadata things contained by the specified container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

listChildren

IListView listChildren(IContext context,
                       IThingID containerId,
                       String view,
                       int action,
                       int 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, or IPagingCookie#ACTION_NEXT.
rights - Right set by which to filter. Usually IAccessRight#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 each IView.
Returns:
List of IViews representing metadata things contained by the specified container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

listChildren

IListView listChildren(IContext context,
                       IThingID containerId,
                       String view,
                       int action,
                       int 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, or IPagingCookie#ACTION_NEXT.
rights - Right set by which to filter. Usually IAccessRight#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 each IView.
filter - apply a filter in the form of an com.webmethods.portal.service.meta2.type.IThingType. All items in the result list will be of this type
Returns:
List of IViews representing metadata things contained by the specified container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

matchChildren

IListView matchChildren(IContext context,
                        IThingID containerId,
                        String regEx,
                        int start,
                        int end,
                        int 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. Usually IAccessRight#READ.
Returns:
List of IViews representing metadata things contained by the specified container.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

matchChildren

IListView matchChildren(IContext context,
                        IThingID containerId,
                        String regEx,
                        IPagingCookie cookie,
                        int 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. Usually IAccessRight#READ.
Returns:
List of IViews 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 properties)
                     throws BizException

Creates a new thing as a primary child in the specified container, with the specified properties. Common properties include:

  1. IConstants#XTYPE_NAME ('xtype') -- required
  2. IConstants#NAME ('name') -- required
  3. IConstants#DESCRIPTION ('description') -- optional
  4. IConstants#INFO ('info') -- optional
  5. IConstants#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 include IConstants#XTYPE_NAME and IConstants#NAME.
Returns:
Id of newly created child.
Throws:
BizException - if command fails because access was denied or a datasource error occured.

copy

IThingID copy(IContext context,
              IURI parentID,
              IURI childID)
              throws BizException
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

IThingID copy(IContext context,
              IURI parentID,
              IURI childID,
              String newName)
              throws BizException
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 properties)
                           throws BizException
Finds 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. See IContainerPolicy.createChild(com.webmethods.portal.bizPolicy.IContext, com.webmethods.portal.service.meta2.thing.IThingID, java.util.Map) 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 context
resourceURI - the URI of the folder to query
xtype - the xtype of the child that will be created
name - the name of the resource
Returns:
an Integer wrapping one of the response codes in com.webmethods.portal.bizPolicy.command.meta.PublishValidateCommand
Throws:
BizException

createUniqueName

String createUniqueName(IContext context,
                        IThingID resourceURI,
                        String name)
                        throws BizException
Creates a unique name in the given folder

Parameters:
context - the current user context
resourceURI - the URI of the folder to query
name - the starting name
Returns:
a unique name based on the starting name
Throws:
BizException

clonePortalPage

IThingID clonePortalPage(IContext context,
                         IURI resourceURI)
                         throws BizException
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 root depth levels. (0 would equal the root). Then return the ISelectedListView 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 context
rootID - the root of the depth based list view
resourceURI - the item that helps determine the selected path
depth - how many levels to descend from the root (0 = root)
Returns:
the IListView that contains selected information
Throws:
BizException