Interface IViewableMechanics

All Superinterfaces:
IComponent, IInitializable, IMechanics, ISystemHandler
All Known Subinterfaces:
IBasicMechanics, IClipboardMechanics, IContainerContentConstraintMechanics, IContainerMechanics, IContentMechanics, IContextMechanics, IDirServiceMechanics, IDirSystemMechanics, IFolderMechanics, IGroupMechanics, ILinkMechanics, ILocalePortletMechanics, IPortalRulesMechanics, IPortletMechanics, IPrincipalAttributeMechanics, IPrincipalMechanics, IRoleMechanics, IRuleMechanics, IScheduleMechanics, ISecurityServiceMechanics, ISkinMechanics, ISubscribableMechanics, ITaskMechanics, ITaskScheduleMechanics, ITemplateMechanics, ITopicMechanics, IUserMechanics, IVersionableMechanics, IViewableContainerMechanics, IXTypeMechanics

public interface IViewableMechanics extends IMechanics
Mechanics for a viewable resource. All viewable resources have at least one IView associated with them.
  • Field Details

  • Method Details

    • canView

      boolean canView(IURI itemId, IThingID userId, Map<?,?> capabilities) throws PortalException
      Returns true if the specified user can view the specified item.
      Parameters:
      itemId - IURI of item
      userId - IThingID of user
      capabilities - Known set of capabilities for this user. May be null, in which case they'll be looked up from the IContext.SCOPE_REQUEST attributes on the user's IContext.
      Returns:
      True if user can view the item, false if they can't.
      Throws:
      PortalException - if the userId is invalid.
    • checkView

      void checkView(IURI itemId, IThingID userId, Map<?,?> capabilities) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot view the specified item.
      Parameters:
      itemId - Item to view.
      userId - User whose access to test.
      capabilities - User's capabilities. Null for default.
      Throws:
      PortalAccessException - if the specified user cannot view the specified item.
      PortalException - if an error occurred checking access.
    • fireViewEvent

      void fireViewEvent(IURI itemId, IThingID userId, int status) throws PortalException
      Fires a view properties event.
      Parameters:
      itemId - Item whose properties were viewed.
      userId - User who viewed the properties.
      status - Status of the event (successful, denied, error).
      Throws:
      PortalException - if an error occurs raising the event.
    • view

      IView view(IURI itemId) throws PortalException
      Returns the standard view of the specified item.
      Parameters:
      itemId - Item to view.
      Returns:
      View of item or null.
      Throws:
      PortalException - if an error occurs.
    • view

      IView view(IURI itemId, IThingID userId) throws PortalException
      Returns the view of the specified item, filtered for the specified user.
      Parameters:
      itemId - Item to view.
      userId - User for which to filter the view.
      Returns:
      View of item or null.
      Throws:
      PortalException - if an error occurs.
    • getIcon

      String getIcon(IURI itemId) throws PortalException
      Gets the web path, relative to the web server root, to the default icon representing this resource.
      Parameters:
      itemId - Item for which to get the icon.
      Returns:
      Icon path (such as '/server/ui/images/icon_basic.gif').
      Throws:
      PortalException - if an error occurs.
    • getIcon

      String getIcon(IURI itemId, String type) throws PortalException
      Gets the web path, relative to the web server root, to the specified type of icon representing this resource.
      Parameters:
      itemId - Item for which to get the icon.
      type - Icon type (ie 'reference'). Null for default icon.
      Returns:
      Icon path (such as '/server/ui/images/icon_basic.gif').
      Throws:
      PortalException - if an error occurs.
    • getLink

      String getLink(IURI itemId) throws PortalException
      Gets the web path, relative to the web server root, to the default view of the resource.
      Parameters:
      itemId - Item for which to get the link.
      Returns:
      Link path (such as '/server/nis/home').
      Throws:
      PortalException - if an error occurs.
    • getHierachicalUri

      String getHierachicalUri(IURI itemId) throws PortalException
      Returns natural hierarchical URI for the given item. May return null if uri may not be produced
      Parameters:
      itemId -
      Returns:
      Throws:
      PortalException
    • getLink

      String getLink(IURI itemId, String type) throws PortalException
      Gets the web path, relative to the web server root, to the specified view of the resource.
      Parameters:
      itemId - Item for which to get the link.
      type - View type (ie 'content' or 'properties'). Null for default view.
      Returns:
      Link path (such as '/server/nis/home').
      Throws:
      PortalException - if an error occurs.
    • getDefaultLinkType

      String getDefaultLinkType(IURI itemId)
      Returns the default link type for the specified item. If the default link to the item will return a properties page, the type should be PROPERTIES_LINK_TYPE. If the default link will return return non-portal content (such as a word document or an external web page) the type should be CONTENT_LINK_TYPE.
      Parameters:
      itemId - Item of interest.
      Returns:
      Default link type.
    • getCss

      String getCss(IURI itemId) throws PortalException

      Gets the css style content for the specified item. A sample style follows:

      table.random908983274 { padding: 2px; }
       td.random908983274 { color: pink; }
      Parameters:
      itemId - Item for which to get the css.
      Returns:
      Css style content.
      Throws:
      PortalException - if an error occurs.
    • getCss

      String getCss(IURI itemId, String type) throws PortalException

      Gets the css style content for the specified item. A sample style follows:

      table.random908983274 { padding: 2px; }
       td.random908983274 { color: pink; }
      Parameters:
      itemId - Item for which to get the css.
      type - Context type (ie 'leftnav'). Null for default css.
      Returns:
      Css style content.
      Throws:
      PortalException - if an error occurs.
    • getListProperty

      String getListProperty(IView view, String property) throws PortalException
      Returns a condensed display string, appropriate for a table listing display, representing the value of the view's specified property.
      Parameters:
      view - View whose property to get.
      property - Property to display.
      Returns:
      List property text.
      Throws:
      PortalException - if an error occurs.
    • getListPropertyJS

      default String getListPropertyJS(IView view, String property) throws PortalException
      Same as getListProperty, but the result is JS encoded suitable for use in scripting.
      Throws:
      PortalException
    • getListPropertyHTML

      default String getListPropertyHTML(IView view, String property) throws PortalException
      Same as getListProperty, but the result is HTML encoded for direct display in browser.
      Throws:
      PortalException
    • getFormattedProperty

      String getFormattedProperty(IView view, String property, Map<String,Object> formatInfo) throws PortalException
      Returns a formatted display for the value of the view's specified property.
      Parameters:
      view - View whose property to get.
      property - Property to display.
      formatInfo - Formatting information.
      Returns:
      Formatted property content.
      Throws:
      PortalException - if an error occurs.
    • isEnabled

      boolean isEnabled(IView view) throws PortalException
      True if the specified view represents an active, enabled, and addressable resource.
      Parameters:
      view - View to test.
      Returns:
      True if the specified view represents an active, enable, and addressable resource.
      Throws:
      PortalException - if an error occurs.
    • createPagingCookie

      IPagingCookie createPagingCookie(IURI itemId, IThingID userId, String view, int start, int pageSize, String sort, String order) throws PortalException
      Returns a new paging cookie for a list view of the specified resource, initialized with the specified default values, or null if the resource cannot produce a paging cookie.
      Parameters:
      itemId - Resource for which to get the paging cookie.
      userId - User for which to get the paging cookie.
      view - Name of the view (ie 'versions'). Null for default view.
      start - Default starting index.
      pageSize - Default items per page.
      sort - Default sort key.
      order - Default sort order.
      Returns:
      Paging cookie or null.
      Throws:
      PortalException - if an error occurs.