Package com.groiss.dms.html
Class DMSUtil
java.lang.Object
com.groiss.dms.html.DMSUtil
Utility class containing methods for customizing web interfaces of the document management.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getEditUrl
(DMSObject object, DMSFolder folder, boolean readOnly) Returns a relative URL (starting with classname) for editing or viewing a document in the DMS.static String
getIconClass
(DMSObject object) Returns css classes for the icon of the document.static String
Returns the path string for a object in a folder.static Page
Show a DMS folder specified by one of the following request parameters: folder: in syntax classname:oid, object: in syntax classname:oid or path: syntax seegetPath(DMSFolder, DMSObject)
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 falsestatic void
showDocument
(DMSDocForm document, HttpServletRequest req, HttpServletResponse res) Send the contents of a document to the client.
-
Method Details
-
getIconClass
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
Show a DMS folder specified by one of the following request parameters:- folder: in syntax classname:oid,
- object: in syntax classname:oid or
- path: syntax see
getPath(DMSFolder, DMSObject)
- 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
Returns a relative URL (starting with classname) for editing or viewing a document in the DMS.- Parameters:
object
- a DMSObjectfolder
- the folder containing the documentreadOnly
- 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
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 folderobject
- 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
-