Interface IContainerMechanics

All Superinterfaces:
IAccessMechanics, IBasicMechanics, IClipboardMechanics, IComponent, IInitializable, IMechanics, ISubscribableMechanics, ISystemHandler, IVersionableMechanics, IViewableContainerMechanics, IViewableMechanics
All Known Subinterfaces:
IFolderMechanics, ITemplateMechanics, ITopicMechanics

public interface IContainerMechanics extends IVersionableMechanics, IViewableContainerMechanics
Mechanics for a metadata container.
  • Field Details

  • Method Details

    • canListChildren

      boolean canListChildren(IThingID containerId, IThingID userId, Map<?,?> capabilities) throws PortalException
      Returns true if the specified user has access to view a contents list.
      Throws:
      PortalException
    • checkListChildren

      void checkListChildren(IThingID containerId, IThingID userId, Map<?,?> capabilities) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user does not have access to view a contents list.
      Throws:
      PortalException
      PortalAccessException
    • canAddChild

      boolean canAddChild(IThingID containerId, IThingID userId, int xtype) throws PortalException
      Returns true if the specified user can add a child of the specified type can to the specified container.
      Throws:
      PortalException
    • checkAddChild

      void checkAddChild(IThingID containerId, IThingID userId, int xtype) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot add a child of the specified type can to the specified container.
      Throws:
      PortalException
      PortalAccessException
    • canAddReference

      boolean canAddReference(IThingID containerId, IThingID user, int xtype) throws PortalException
      Returns true if the specified user can add a reference to the specified type can to the specified container.
      Throws:
      PortalException
    • checkAddReference

      void checkAddReference(IThingID containerId, IThingID user, int xtype) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot add a reference to the specified type can to the specified container.
      Throws:
      PortalException
      PortalAccessException
    • canRemoveChild

      boolean canRemoveChild(IThingID containerId, IThingID userId, int xtype) throws PortalException
      Returns true if the specified user can remove a child of the specified type can to the specified container.
      Throws:
      PortalException
    • checkRemoveChild

      void checkRemoveChild(IThingID containerId, IThingID userId, int xtype) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot remove a child of the specified type can to the specified container.
      Throws:
      PortalException
      PortalAccessException
    • canRemoveReference

      boolean canRemoveReference(IThingID containerId, IThingID user, int xtype) throws PortalException
      Returns true if the specified user can remove a reference to the specified type can to the specified container.
      Throws:
      PortalException
    • checkRemoveReference

      void checkRemoveReference(IThingID containerId, IThingID user, int xtype) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot remove a reference to the specified type can to the specified container.
      Throws:
      PortalException
      PortalAccessException
    • fireListChildrenEvent

      void fireListChildrenEvent(IThingID containerId, IThingID userId, int status) throws PortalException
      Fires a list contents event.
      Parameters:
      containerId - Container whose children were listed.
      userId - User for whom the children were listed.
      status - Status of the event (sucessful, denied, error).
      Throws:
      PortalException
    • fireAddChildEvent

      void fireAddChildEvent(IThingID containerId, IThingID userId, int status, IThingID childId) throws PortalException
      Fires a add child event.
      Parameters:
      containerId - Container to which the child was added.
      userId - User on whose behalf the child was added.
      status - Status of the event (sucessful, denied, error).
      childId - Added child.
      Throws:
      PortalException
    • fireAddReferenceEvent

      void fireAddReferenceEvent(IThingID containerId, IThingID userId, int status, IThingID referenceId) throws PortalException
      Fires a add reference event.
      Parameters:
      containerId - Container to which the reference to the child was added.
      userId - User on whose behalf the reference to the child was added.
      status - Status of the event (sucessful, denied, error).
      referenceId - Referenced child.
      Throws:
      PortalException
    • fireCopyChildEvent

      void fireCopyChildEvent(IThingID dstContainerId, IThingID userId, int status, IThingID dstChildId, IThingID srcContainerId, IThingID srcChildId) throws PortalException
      Fires a copy child event.
      Parameters:
      dstContainerId - Container into which the child was copied.
      userId - User on whose behalf the child was copied.
      status - Status of the event (sucessful, denied, error).
      dstChildId - New copy of the child.
      srcContainerId - Container from which the child was copied.
      srcChildId - Old copy of the child.
      Throws:
      PortalException
    • fireCopyReferenceEvent

      void fireCopyReferenceEvent(IThingID dstContainerId, IThingID userId, int status, IThingID referenceId, IThingID srcContainerId) throws PortalException
      Fires a copy reference event.
      Parameters:
      dstContainerId - Container into which the reference was copied.
      userId - User on whose behalf the reference was copied.
      status - Status of the event (sucessful, denied, error).
      referenceId - Copied reference.
      srcContainerId - Container from which the reference was copied.
      Throws:
      PortalException
    • fireMoveChildEvent

      void fireMoveChildEvent(IThingID dstContainerId, IThingID userId, int status, IThingID childId, IThingID srcContainerId) throws PortalException
      Fires a move child event.
      Parameters:
      dstContainerId - Container into which the child was moved.
      userId - User on whose behalf the child was moved.
      status - Status of the event (sucessful, denied, error).
      childId - Moved child.
      srcContainerId - Container from which the child was moved.
      Throws:
      PortalException
    • fireMoveChildEvent

      void fireMoveChildEvent(IThingID dstContainerId, IThingID userId, int status, IThingID childId, IThingID srcContainerId, String srcName) throws PortalException
      Fires a move child event.
      Parameters:
      dstContainerId - Container into which the child was moved.
      userId - User on whose behalf the child was moved.
      status - Status of the event (sucessful, denied, error).
      childId - Moved child.
      srcContainerId - Container from which the child was moved.
      srcName - the original name of the moved item
      Throws:
      PortalException
    • fireMoveReferenceEvent

      void fireMoveReferenceEvent(IThingID dstContainerId, IThingID userId, int status, IThingID referenceId, IThingID srcContainerId) throws PortalException
      Fires a move reference event.
      Parameters:
      dstContainerId - Container into which the reference was moved.
      userId - User on whose behalf the reference was moved.
      status - Status of the event (sucessful, denied, error).
      referenceId - Moved reference.
      srcContainerId - Container from which the reference was moved.
      Throws:
      PortalException
    • fireRemoveReferenceEvent

      void fireRemoveReferenceEvent(IThingID containerId, IThingID userId, int status, IThingID referenceId) throws PortalException
      Fires a remove reference event.
      Parameters:
      containerId - Container from which the reference was removed.
      userId - User on whose behalf the reference was removed.
      status - Status of the event (sucessful, denied, error).
      referenceId - Removed reference.
      Throws:
      PortalException
    • isDescendantOrSelf

      boolean isDescendantOrSelf(IThingID containerId, IThingID descendantId) throws PortalException
      True if the second thing is a descendant of the first, or is the same thing.
      Parameters:
      containerId - the target container for the move or copy operation
      descendantId - the thing that will be moved or copied
      Throws:
      PortalException
    • checkIsDescendantOrSelf

      void checkIsDescendantOrSelf(IThingID containerId, IThingID descendantId, boolean isCopy) throws PortalException
      Parameters:
      containerId - the target container for the move or copy operation
      descendantId - the thing that will be moved or copied
      isCopy - whether to throw a move or a copy exception if it fails
      Throws:
      PortalException
    • makeUniqueName

      String makeUniqueName(IThingID containerId, String name) throws PortalException
      Makes a name unique to specified container from the specified name. If the name is already unique in this container, returns the unchanged name. Otherwise, some number or text is appended to the name to make it unique.
      Throws:
      PortalException
    • getPrimaryChild

      IThingID getPrimaryChild(IThingID containerID, String name) throws PortalException
      Retrieve a primary child of the given container by name.
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the child to retrieve
      Returns:
      the child thingID or null if not found
      Throws:
      PortalException
    • getPrimaryChildNoCache

      IThingID getPrimaryChildNoCache(IThingID containerID, String name) throws PortalException
      Retrieves primary child of given container by name bypassing container cache
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the child to retrieve
      Returns:
      the child thingID or null if not found
      Throws:
      PortalException
    • hasPrimaryChild

      boolean hasPrimaryChild(IThingID containerId, String name) throws PortalException
      Returns true if this container has an active, non-reference child with the specified name.
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the child to retrieve
      Returns:
      true if the child was found, false otherwise
      Throws:
      PortalException
    • checkHasPrimaryChild

      void checkHasPrimaryChild(IThingID containerId, String name) throws PortalException
      Throws an exception if this container has an active, non-reference child with the specified name.
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the child to check
      Throws:
      PortalException - if the primary child exists.
    • viewPrimaryChild

      IView viewPrimaryChild(IThingID containerId, String name) throws PortalException
      Returns the active, non-reference child with the specified name, or null if not found.
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the child to retrieve
      Returns:
      the view of the child, or null if the child was not found
      Throws:
      PortalException
    • getReference

      IThingID getReference(IThingID containerID, String name) throws PortalException
      Retrieve a reference in the given container by name.
      Parameters:
      containerID - the id of the container
      name - the (case-insensitive) name of the reference to retrieve
      Returns:
      the thingId, or null if the reference was not found
      Throws:
      PortalException
    • hasReference

      boolean hasReference(IThingID containerId, String name) throws PortalException
      Returns true if this container has a reference child with the specified name.
      Parameters:
      containerId - the container to lookup the child in
      name - the (case-insensitive) name of the reference to lookup
      Returns:
      true if the container has a child with the given name
      Throws:
      PortalException
    • listChildren

      IThingIDList listChildren(IThingID containerId, String name) throws PortalException
      Returns the active children and references with the specified name.
      Parameters:
      containerId - the container to lookup the child in
      name - the (case-insensitive) name of the reference to lookup
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • listChildren

      IThingIDList listChildren(IThingID containerID, String name, boolean ignoreCase) throws PortalException
      Returns all children of the given container with the specified name
      Parameters:
      containerId - the container to lookup the child in
      name - the name of the reference to lookup
      ignoreCase - whether to use case sensitive matching. If false, case sensitive matching would be done.
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • listChildren

      IThingIDList listChildren(IThingID containerId) throws PortalException
      Returns a list of all the children in the specified container. May return null to signal no children.
      Parameters:
      containerId - Container.
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • listChildren

      IThingIDList listChildren(IThingID containerId, IThingID userId, int start, int end) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      userId - User for which to filter.
      start - List starting index (0 for first item).
      end - List ending index (<1 for all items).
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • listChildren

      IThingIDList listChildren(IThingID containerId, IThingID userId, int start, int end, int relType) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      userId - User for which to filter.
      start - List starting index (0 for first item).
      end - List ending index (<1 for all items).
      relType - the relation type to include
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • listChildren

      @Deprecated IListView<? extends IView> listChildren(IThingID containerId, IPagingCookie cookie, int action, int rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of children.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listChildren

      IListView<? extends IView> listChildren(IThingID containerId, IPagingCookie cookie, int action, IRightSet rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of children.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listChildren

      @Deprecated IListView<? extends IView> listChildren(IThingID containerId, IThingID userId, IPagingCookie cookie, int action, int rights) throws PortalException
      Deprecated.
      Returns a list of the specified length (or less) from the specified start index filtered for the specified user.
      Parameters:
      containerId - Container of children.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listChildren

      IListView<? extends IView> listChildren(IThingID containerId, IThingID userId, IPagingCookie cookie, int action, IRightSet rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index filtered for the specified user.
      Parameters:
      containerId - Container of children.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • matchChildren

      IThingIDList matchChildren(IThingID containerId, String regEx, Locale locale) throws PortalException
      Returns a list of all the children in the specified container which match the regEx. May return null to signal no children.
      Parameters:
      containerId - Container.
      Throws:
      PortalException
    • matchChildren

      IThingIDList matchChildren(IThingID containerId, String regEx, Locale locale, IThingID userId, int start, int end) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container which match the regEx.
      Parameters:
      containerId - Container of descendants.
      userId - User for which to filter.
      start - List starting index (0 for first item).
      end - List ending index (<1 for all items).
      Returns:
      an IThingIDList of IThingID objects
      Throws:
      PortalException
    • matchChildren

      @Deprecated IListView<? extends IView> matchChildren(IThingID containerId, String regEx, Locale locale, IPagingCookie cookie, int action, int rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container which match the regEx.
      Parameters:
      containerId - Container of children.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • matchChildren

      IListView<? extends IView> matchChildren(IThingID containerId, String regEx, Locale locale, IPagingCookie cookie, int action, IRightSet rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container which match the regEx.
      Parameters:
      containerId - Container of children.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • matchChildren

      @Deprecated IListView<? extends IView> matchChildren(IThingID containerId, String regEx, Locale locale, IThingID userId, IPagingCookie cookie, int action, int rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index filtered for the specified user which match the regEx.
      Parameters:
      containerId - Container of children.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • matchChildren

      IListView<? extends IView> matchChildren(IThingID containerId, String regEx, Locale locale, IThingID userId, IPagingCookie cookie, int action, IRightSet rights) throws PortalException
      Returns a list of the specified length (or less) from the specified start index filtered for the specified user which match the regEx.
      Parameters:
      containerId - Container of children.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listDescendants

      @Deprecated IListView<? extends IView> listDescendants(IThingID containerId, IPagingCookie cookie, int action, int rights, int depth, boolean includeItems) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      depth - Depth to descend. 0 for all, 1 for children, 2 for children & grandchildren, etc.
      includeItems - True to list containers and noncontainers; false to list containers only.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listDescendants

      IListView<? extends IView> listDescendants(IThingID containerId, IPagingCookie cookie, int action, IRightSet rights, int depth, boolean includeItems) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      depth - Depth to descend. 0 for all, 1 for children, 2 for children & grandchildren, etc.
      includeItems - True to list containers and noncontainers; false to list containers only.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listDescendants

      @Deprecated IListView<? extends IView> listDescendants(IThingID containerId, IThingID userId, IPagingCookie cookie, int action, int rights, int depth, boolean includeItems) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      depth - Depth to descend. 0 for all, 1 for children, 2 for children & grandchildren, etc.
      includeItems - True to list containers and noncontainers; false to list containers only.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • listDescendants

      IListView<? extends IView> listDescendants(IThingID containerId, IThingID userId, IPagingCookie cookie, int action, IRightSet rights, int depth, boolean includeItems) throws PortalException
      Returns a list of the specified length (or less) from the specified start index in the specified container.
      Parameters:
      containerId - Container of descendants.
      userId - User for which to filter.
      cookie - Paging state.
      action - Paging action to perform.
      rights - User's rights by which to filter.
      depth - Depth to descend. 0 for all, 1 for children, 2 for children & grandchildren, etc.
      includeItems - True to list containers and noncontainers; false to list containers only.
      Returns:
      List of IView items, or an empty list.
      Throws:
      PortalException
    • getSelectedListView

      ISelectedListView getSelectedListView(IThingID rootID, IThingID resourceID, IThingID userID, int depth) throws PortalException
      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:
      rootID - the root of the depth based list view
      resourceID - 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:
      PortalException
    • getSelectedListView

      ISelectedListView getSelectedListView(IThingID rootID, IThingID resourceID, IThingID userID, int depth, boolean includeItems) throws PortalException
      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:
      rootID - the root of the depth based list view
      resourceID - the item that helps determine the selected path
      depth - how many levels to descend from the root (0 = root)
      includeItems - True to list containers and noncontainers; false to list containers only.
      Returns:
      the IListView that contains selected information
      Throws:
      PortalException
    • createChild

      IThingID createChild(IThingID containerId, IThingID userId, int xtype, Map<String,? extends Object> properties) throws PortalException
      Creates a new child of the specified xtype in the specified container.
      Parameters:
      containerId - Container in which to create.
      userId - User for which to create.
      xtype - Child type to create.
      properties - New child's properties. May not be null.
      Throws:
      PortalException
    • createChild

      IThingID createChild(IThingID containerId, IThingID userId, int xtype, Map<String,? extends Object> properties, Locale locale) throws PortalException
      Parameters:
      containerId -
      userId -
      xtype -
      properties -
      locale -
      Returns:
      Throws:
      PortalException
    • copyChild

      IThingID copyChild(IThingID containerId, IThingID userId, IThingID childId) throws PortalException
      Creates a new copy of the specified child in the specified container.
      Parameters:
      containerId - Container in which to copy.
      userId - User for which to copy.
      childId - Child to copy.
      Throws:
      PortalException
    • copyChild

      IThingID copyChild(IThingID containerId, IThingID userId, IThingID childId, String newName) throws PortalException
      Moves and renames the specified child into the specified container.
      Parameters:
      containerId - Container in which to copy.
      userId - User for which to copy.
      childId - Child to copy.
      newName - the new name to give the child
      Throws:
      PortalException
    • moveChild

      void moveChild(IThingID containerId, IThingID childId) throws PortalException
      Moves the specified child into the specified container.
      Parameters:
      containerId - Container into which to move.
      childId - Child to move.
      Throws:
      PortalException
    • moveChild

      void moveChild(IThingID containerId, IThingID childId, String newName) throws PortalException
      Moves and renames the specified child into the specified container.
      Parameters:
      containerId - Container into which to move.
      childId - Child to move.
      newName - the new name to give the child
      Throws:
      PortalException
    • addReferenceToChild

      void addReferenceToChild(IThingID containerId, IThingID childId) throws PortalException
      Adds a reference to the specified child into the specified container.
      Parameters:
      containerId - Container in which to add.
      childId - Child to add.
      Throws:
      PortalException
    • removeReferenceToChild

      void removeReferenceToChild(IThingID containerId, IThingID childId) throws PortalException
      Removes the reference to the specified child from the specified container.
      Parameters:
      containerId - Container from which to remove.
      childId - Child to remove.
      Throws:
      PortalException