Interface IContainerPolicy

All Superinterfaces:
IBasicPolicy, IBizPolicy, IComponent, IInitializable, ISystemHandler, IViewableContainerPolicy, IViewablePolicy

public interface IContainerPolicy extends IBasicPolicy, IViewableContainerPolicy

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 Details

    • listChildren

      @Deprecated IListView<? extends IView> 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<? 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, 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

      @Deprecated IListView<? extends IView> 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<? 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, 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

      @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
      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 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.
    • 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, 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 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

      @Deprecated IListView<? extends IView> 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<? 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. 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

      @Deprecated IListView<? extends IView> 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.
    • 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. 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<String,? extends Object> 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<String,?> 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 createChild(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 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 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