Class DMSUtil

java.lang.Object
com.groiss.dms.html.DMSUtil

public class DMSUtil extends Object
Utility class containing methods for customizing web interfaces of the document management.
  • Method Details

    • getIconClass

      public static String getIconClass(DMSObject object)
      Returns css classes for the icon of the document. The document icon can be created from an empty div element with these css classes.
      Parameters:
      object - a DMSObject
      Returns:
      css classes string
    • showDMSFolder

      public static Page showDMSFolder(HttpServletRequest req) throws Exception
      Show a DMS folder specified by one of the following request parameters: The appearance of the resulting page can be customized with the following request parameters which accept true or false as value:
      • showToolbar: show/hide a toolbar, if missing defaults to false
      • hideCloseButton: show/hide a close button on the bottom, if missing defaults to false
      • disableUpNav: enable/disable up-navigation, if missing defaults to false
      Parameters:
      req -
      Returns:
      a page containing the folder contents
      Throws:
      Exception
    • getEditUrl

      public static String getEditUrl(DMSObject object, DMSFolder folder, boolean readOnly)
      Returns a relative URL (starting with classname) for editing or viewing a document in the DMS.
      Parameters:
      object - a DMSObject
      folder - the folder containing the document
      readOnly - if true the object is opened in view mode (applicable for forms where an edit url is returned)
      Returns:
      a relative URL
    • showDocument

      public static void showDocument(DMSDocForm document, HttpServletRequest req, HttpServletResponse res) throws Exception
      Send the contents of a document to the client. The mime-type is set based on the document extension. If the mime-type starts with "text/" the configured text character is used (system configuration, section DMS).
      Parameters:
      document - a document
      Throws:
      Exception
    • getPath

      public static String getPath(DMSFolder folder, DMSObject object)
      Returns the path string for a object in a folder. Note, that the path string for the folder is cached for the thread.
      Parameters:
      folder - a folder
      object - a object in the folder
      Returns:
      a path string: list of the names of the folders up to the root folder followed by the object name, separated by "/", for example: Common/projects/ep/document.txt