public class OwMimeManager extends OwEventTarget
MIME Manager, holds the MIME table, creates Object hyper links,
handles requests to view and open objects according to their MIME type.
NOTE: ALWAYS CALL Reset() in your onRender method before using the insertLink functions,
otherwise the map increases to infinite.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Class and Description |
---|---|
static class |
OwMimeManager.OwOpenCommand
Identifies a open command URL or script.
|
protected static class |
OwMimeManager.OwReplaceScanner
Class to perform search and replace on strings.
Derive a subclass and implement getReplacement. |
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_MIMETYPE_KEY
query string key for the MIME type of the property based content
|
static String |
CONTENT_PROPERTY_KEY
query string key for property name of the property based content
|
static String |
CONTENT_TYPE_KEY
query string key for the content type parameter
|
static String |
DMSID_KEY
query string key for the DMSID parameter
|
protected String |
documentTitle
label to use for tooltip on documents
use "app.OwMimeManager.documenttitle" to localize/control value |
static String |
DWL_MODE_KEY
query string key for the download mode parameter
|
static int |
DWL_MODE_OPEN
download mode used with DWL_MODE_KEY: opens the document directly in the browser
|
static int |
DWL_MODE_SAVE_COPY
download mode used with DWL_MODE_KEY: queries to save the document
|
static String |
FILE_PREVIEW_ATTRIBUTE_FILENAME
session attribute file name for file preview
|
static String |
FILE_PREVIEW_ATTRIBUTE_MIMETYPE
session attribute MIME type of file to preview
|
static String |
FILE_PREVIEW_ATTRIBUTE_NAME
session attribute name for file preview
|
static String |
FILE_PREVIEW_DMSID
DMSID for MimeManager file preview
|
protected OwConfiguration |
m_Configuration
application m_Configuration reference
|
protected boolean |
m_fDEBUG_ResetCalled
flag signal for debug reasons, to throw an error if client forgets to call reset
|
protected OwMainAppContext |
m_MainContext
reference to the cast AppContext
|
protected String |
m_mimeTypeContext
the context to be used for MIME type resolution
|
protected NumberFormat |
m_NumberFormat |
protected Map |
m_ObjectMap
map which keeps the objects to be opened and create links upon
|
protected OwObject |
m_parent |
protected OwClientRefreshContext |
m_RefreshContext
event listener for the function plugin refresh events
|
protected String |
m_strMimeIconStyle
style to be used for icons
|
protected String |
m_strMimeItemStyle
style to be used for items
|
static String |
MDI_OBJECTS_COLLECTION_ATTRIBUTE_NAME
session attribute name for objects collection for MDI viewer
|
static String |
MIME_ATT_AUTOVIEWERMODE
attribute name for autoviewermode of MIME node
|
static String |
MIME_DOCUMENTFUNCTION
tag name for document function of MIME node
|
static String |
MIME_DOWNLOAD_URL
tag name of the downloadurl in MIME node
|
static String |
MIME_EDITSERLVET
tag name of the viewer servlet definition in MIME node
|
static String |
MIME_EVENTHANDLER
tag name for eventhandler of MIME node
|
static String |
MIME_ICON_NAME
tag name of the icon in the mimenode
|
static String |
MIME_ICON_SUBPATH |
static String |
MIME_OPENICON_NAME
tag name of the openicon in mimenode
|
static String |
MIME_TYPE_PREFIX_OW_CUSTOMOBJECT
prefix for custom object, used to configure the MIME types in the owmimetable.xml file
|
static String |
MIME_TYPE_PREFIX_OW_DEFAULT
prefix for default types (OBJECT_TYPE_DOCUMENT, OBJECT_TYPE_FOLDER, OBJECT_TYPE_HISTORY...),
used to configure the MIME types in the owmimetable.xml file
|
static String |
MIME_TYPE_PREFIX_OW_FOLDER
prefix for a specific folder class, used to configure the MIME types in the owmimetable.xml file
|
static String |
MIME_VIEWERSERLVET
tag name of the viewer servlet definition in MIME node
|
protected static String |
OBJECT_INDEX_KEY
query string key for the objectlist index to find the selected object upon onMimeOpenObject.
|
protected String |
objectTitle
label to use for tooltip on objects
use "app.OwMimeManager.objecttitle" to localize/control value |
static String |
PAGE_KEY
query string key for the page parameter
|
protected static OwMimeManager.OwReplaceScanner |
PAGECOUNT_REPLACE_SCANNER
page count replacement scanner for high performance replacement
|
static String |
REPLACE_TOKEN_VIID
Token to be replaced for specific version independent id representation
|
static String |
SCRIPT_URL_PREFIX
prefix to create a URL out of a script command
|
protected static String |
SUBPATH_KEY
query string key for the subpath of the record subfolder to open
|
protected String |
undefName
label to use when name is null
|
protected static OwMimeManager.OwReplaceScanner |
URL_REPLACE_SCANNER
URL replacement scanner for high performance replacement
|
static int |
VIEWER_MODE_COMPARE
autoviewermode to use: open one viewer for each document and try to put viewers next to each other for comparision
|
static int |
VIEWER_MODE_DEFAULT
autoviewermode to use: use default mode of application
|
static int |
VIEWER_MODE_JAVASCRIPT
autoviewermode to use: call given javascript, i.e.
|
static int |
VIEWER_MODE_MULTI
autoviewermode to use: open one viewer for each document
|
static int |
VIEWER_MODE_SIMPLE
autoviewermode to use: display upload link
|
static int |
VIEWER_MODE_SINGLE
autoviewermode to use: open one single viewer for all documents
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_BASEDIR
token in the viewer servlet to be replaced by the base dir of the server deploy
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_BASEURL
token in the viewer servlet to be replaced by the base URL of the server with application context
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_CONTENT_TYPE
token in the viewer servlet to be replaced by the requested page
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_DMSID
token in the viewer servlet to be replaced by the DMSID
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_DOWNLOAD_URL
token in the viewer servlet to be replaced by the requested page
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_PAGE
token in the viewer servlet to be replaced by the requested page
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_PAGE_COUNT
token in the viewer servlet to be replaced by the number of pages in the requested object
|
static char |
VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_ENCODE_CHAR
char to indicate encoding of given property
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_END
token in the viewer servlet to be replaced by the property end delimiter
|
static char |
VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_JSENCODE_CHAR
char to indicate JavaScript encoding of given property
|
static char |
VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_NOENCODE_CHAR
char to indicate NO encoding of given property
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_START
token in the viewer servlet to be replaced by the property following the :
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_SECURITYTOKEN
token in the viewer servlet to be replaced by the security token
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_SECURITYTOKEN_ENC
token in the viewer servlet to be replaced by the encoded security token
|
static String |
VIEWER_SERVLET_REPLACE_TOKEN_SERVERURL
token in the viewer servlet to be replaced by the base URL of the server
|
static String |
XSL_TRANSFORMATOR_ENCODING_KEY
query string key for the xsl transformator encoding to use
|
static String |
XSL_TRANSFORMATOR_KEY
query string key for the xsl transformator URL
|
Constructor and Description |
---|
OwMimeManager() |
Modifier and Type | Method and Description |
---|---|
static String |
createAutoViewerRestoreMainWindowScript(OwMainAppContext context_p,
int viewermode_p)
create a script that closes the autoviewer and rearrange the browser.
|
protected StringBuffer |
createIconLink(OwObjectReference obj_p)
Create the icon link for the given object
|
protected String |
createLinkUrl(String eventName_p,
OwObjectReference obj_p,
String subpath_p)
create the URL of the given event and the additional parameter
|
protected static void |
delegateToMasterPlugin(OwMainAppContext context_p,
OwMasterDocument masterPlugin_p,
OwObjectReference obj_p,
String subpath_p)
overridable handler function
|
static OwMimeManager.OwOpenCommand |
editObject(OwMainAppContext context_p,
OwObjectReference obj_p)
Creates an OwOpenCommand handling the
<editservlet> tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown. |
static OwMimeManager.OwOpenCommand |
editObject(OwMainAppContext context_p,
OwObjectReference obj_p,
int page_p)
Creates an OwOpenCommand handling the
<editservlet> tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown. |
static OwMimeManager.OwOpenCommand |
editObject(OwMainAppContext context_p,
OwObjectReference obj_p,
String additionalParams_p,
int page_p)
Creates an OwOpenCommand handling the
<editservlet> tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown. |
static OwMimeManager.OwOpenCommand |
editObject(OwMainAppContext context_p,
OwObjectReference obj_p,
String mimeContext_p,
String additionalParams_p,
int page_p)
Creates an OwOpenCommand handling the
<editservlet> tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown. |
static String |
getAutoViewerScript(OwMainAppContext context_p,
String strOpenURL_p,
int viewermode_p,
String id_p,
String sDmsID_p,
int iPage_p)
create a script that opens the URL in a viewer and automatically arranges the browser and the viewer
the script can be applied with the addFinalScript() method.
|
static String |
getAutoViewerScript(OwMainAppContext context_p,
String strOpenURL_p,
int viewermode_p,
String id_p,
String sDmsID_p,
int iPage_p,
OwWindowPositions windowpos_p)
create a script that opens the URL in a viewer and automatically arranges the browser and the viewer
the script can be applied with the addFinalScript() method.
|
protected static String |
getDefaultDownloadURL(OwMainAppContext context_p,
OwObjectReference obj_p,
int iContentType_p,
int iPage_p)
create a default download URL where the content of the specified object, contenttype and page can be found
|
static String |
getDownloadLink(OwMainAppContext context_p,
String strDisplayName_p,
OwObjectReference obj_p)
get a link to save/download the given OwObjectReference to the local hard drive
|
static String |
getDownloadURL(OwMainAppContext context_p,
OwObjectReference obj_p,
int iContentType_p,
int iPage_p)
create a download URL where the content of the specified object, contenttype and page can be found
|
static String |
getDownloadURL(OwMainAppContext context_p,
OwObjectReference obj_p,
int iContentType_p,
int iPage_p,
OwXMLUtil mimeNode_p)
create a download URL where the content of the specified object, contenttype and page can be found
|
static OwDocumentFunction |
getHandlerDocumentPlugin(OwMainAppContext context_p,
OwObjectReference obj_p)
get the handler document plugin for the given object reference if defined.
|
static OwMasterDocument |
getHandlerMasterPlugin(OwMainAppContext context_p,
OwObjectReference obj_p)
get the handler master plugin for the given object reference if defined.
|
String |
getIconStyle()
Return the style for icons which are rendered
by this MIME type manager.
|
static String |
getMimeIcon(OwMainAppContext context_p,
OwObjectReference obj_p)
get the icon path for the mimetype
|
static OwXMLUtil |
getMimeNode(OwConfiguration configuration_p,
OwObjectReference obj_p)
get the MIME info node from the MIME table for the requested object
|
String |
getMimeTypeContext()
Returns the context to be used for MIME type resolution
|
protected NumberFormat |
getNumberFormater()
get the formatter used for numbers
|
static OwMimeManager.OwOpenCommand |
getOpenCommand(OwMainAppContext context_p,
OwObjectReference obj_p)
Create URL or script command to open the object according to MIME settings.
|
static OwMimeManager.OwOpenCommand |
getOpenCommand(OwMainAppContext context_p,
OwObjectReference obj_p,
String additionalParams_p)
Create an URL or script to open the object according to MIME settings.
|
static OwMimeManager.OwOpenCommand |
getOpenCommand(OwMainAppContext context_p,
OwObjectReference obj_p,
String additionalParams_p,
int page_p)
Create an URL or script to open the referenced object, according to the defined MIME settings.
|
static OwMimeManager.OwOpenCommand |
getOpenCommand(OwMainAppContext context_p,
OwObjectReference obj_p,
String mimeContext_p,
String additionalParams_p)
Create an URL or script to open the object according to MIME settings.
|
static OwMimeManager.OwOpenCommand |
getOpenCommand(OwMainAppContext context_p,
OwObjectReference obj_p,
String mimeContext_p,
String additionalParams_p,
int page_p)
Create an URL or script to open the referenced object, according to the defined MIME settings.
|
OwMimeManager.OwOpenCommand |
getOpenCommand(OwObjectReference obj_p)
Create URL or script command to open the object according to MIME settings.
|
OwMimeManager.OwOpenCommand |
getOpenCommand(OwObjectReference obj_p,
String additionalParams_p)
Create an URL or script using current instance of OwMimeManager.
|
OwMimeManager.OwOpenCommand |
getOpenCommand(OwObjectReference obj_p,
String additionalParams_p,
int page_p)
Create an URL or script using current instance of OwMimeManager.
|
static String |
getSaveDownloadURL(OwMainAppContext context_p,
OwObjectReference obj_p)
get a URL to save / download the given OwObjectReference to the local hard drive
|
protected static String |
getServletReplacedTokenString(String servletURL_p,
OwMainAppContext currentContext_p,
OwObjectReference obj_p,
OwXMLUtil mimeNode_p,
int page_p)
Calls the
getServletReplacedTokenString(String, OwMainAppContext, OwObjectReference, OwXMLUtil, int, int) method
with following parameters |
protected static String |
getServletReplacedTokenString(String servletURL_p,
OwMainAppContext currentContext_p,
OwObjectReference obj_p,
OwXMLUtil mimeNode_p,
int page_p,
int contentType_p)
This method is a Helper and replace the most used placeholder in a URL string.
|
String |
getUndefinedLabel()
Get label to use for rendering of text links,
if the given display value is
null . |
protected void |
init()
init the target after the context is set.
|
void |
insertHtmlLink(Writer w_p,
String strHtmlCode_p,
OwObjectReference obj_p,
String subpath_p)
insert a hyperlink wrapped around arbitrary HTML code to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertHtmlLink(Writer w_p,
String strHtmlCode_p,
OwObjectReference obj_p,
String subpath_p,
int page_p)
insert a hyperlink wrapped around arbitrary HTML code to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertIconLink(Writer w_p,
OwObjectReference obj_p)
insert a icon object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertIconLink(Writer w_p,
OwObjectReference obj_p,
String subpath_p)
insert a icon object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertIconLink(Writer w_p,
OwObjectReference obj_p,
String subpath_p,
int page_p)
insert a icon object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertTextLink(Writer w_p,
String strDisplayName_p,
OwObjectReference obj_p)
insert a text object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertTextLink(Writer w_p,
String strDisplayName_p,
OwObjectReference obj_p,
String subpath_p)
insert a text object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
void |
insertTextLink(Writer w_p,
String strDisplayName_p,
OwObjectReference obj_p,
String subpath_p,
int page_p)
insert a text object hyperlink to download or open a OwObjectReference in a viewer
This function is useful for objects listed by OwObjectCollection
|
static boolean |
isObjectDownloadable(OwMainAppContext context_p,
OwObjectReference obj_p)
check if given object can be downloaded to hard drive
|
static boolean |
isObjectDownloadable(OwMainAppContext context_p,
OwObjectReference obj_p,
String mimeContext_p)
check if given object can be downloaded to hard drive
|
static String |
makeViewerTitleString(String id_p)
Make sure ID does not consist of invalid characters for java script window name
|
void |
onDocumentFunctionHandler(javax.servlet.http.HttpServletRequest request_p)
event called when user clicked on a name link of an object entry in the list
Creates a new dialog for the clicked object
|
void |
onPluginEventHandler(javax.servlet.http.HttpServletRequest request_p)
event called when user clicked on a name link of an object entry in the list
Dispatches the object to a plugin
|
static void |
openFilePreview(OwMainAppContext context_p,
String mimeType_p,
String path_p)
open the given file according to MIME settings for preview
|
static void |
openFilePreview(OwMainAppContext context_p,
String mimeType_p,
String path_p,
String fileName_p)
open the given file according to the MIME settings for preview,
Changes the file name to the given parameter fileName_p.
|
static void |
openObject(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p)
open the given object according to MIME settings
|
static void |
openObject(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p,
int iPage_p,
OwWindowPositions windowpos_p,
Collection objects_p)
open the given object according to MIME settings
|
static void |
openObject(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p,
int iPage_p,
OwWindowPositions windowpos_p,
Collection objects_p,
String additionalParams_p)
open the given object according to the MIME settings, and add also the additional params to the
caller URL.
|
static void |
openObject(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p,
int iPage_p,
OwWindowPositions windowpos_p,
Collection objects_p,
String additionalParams_p,
String mimeContext_p)
open the given object according to the MIME settings, and add also the additional params to the
caller URL.
|
static void |
openObject(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p,
String mimeContext_p)
open the given object according to MIME settings
|
static void |
openObjectPreview(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p)
open the given object according to MIME settings
|
static void |
openObjectPreview(OwMainAppContext context_p,
OwObjectReference obj_p,
OwObject parent_p,
int iViewerMode_p,
OwClientRefreshContext refreshCtx_p,
int iPage_p,
OwWindowPositions windowpos_p,
Collection objects_p)
open the given object according to MIME settings
|
protected void |
registerObject(OwObjectReference obj_p)
register a object to find it later in the events
|
protected static String |
replaceProperties(OwMainAppContext context_p,
String strIn_p,
OwObjectReference obj_p)
replace a object property placeholder
|
void |
reset()
clear the map before you call insertLink methods, otherwise the map would increase to infinite
|
void |
setIconStyle(String strMimeIconStyle_p)
set the style for the MIME icons
|
void |
setItemStyle(String strMimeItemStyle_p)
set the style for the MIME items
|
void |
setMimeTypeContext(String context_p)
Set the context to be used for MIME type resolution
|
void |
setParent(OwObject parent_p)
set parent to use in document functions
|
void |
setRefreshContext(OwClientRefreshContext eventlister_p)
register an eventlistener with this view to receive notifications
|
void |
setUndefinedLabel(String undefLabel_p)
Set the Label which should be used for
rendering of text links, if given display value is
null . |
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getFormName, getFormTarget, getID, onExternalRequest, onFormEvent, onRequest, setExternalFormTarget, updateExternalFormTarget
protected static final OwMimeManager.OwReplaceScanner URL_REPLACE_SCANNER
protected static final OwMimeManager.OwReplaceScanner PAGECOUNT_REPLACE_SCANNER
public static final String DWL_MODE_KEY
public static final String DMSID_KEY
public static final String CONTENT_TYPE_KEY
public static final String CONTENT_PROPERTY_KEY
public static final String CONTENT_MIMETYPE_KEY
public static final String PAGE_KEY
public static final String XSL_TRANSFORMATOR_KEY
public static final String XSL_TRANSFORMATOR_ENCODING_KEY
public static final int DWL_MODE_OPEN
public static final int DWL_MODE_SAVE_COPY
public static final String MDI_OBJECTS_COLLECTION_ATTRIBUTE_NAME
public static final String FILE_PREVIEW_ATTRIBUTE_NAME
public static final String FILE_PREVIEW_ATTRIBUTE_FILENAME
public static final String FILE_PREVIEW_ATTRIBUTE_MIMETYPE
public static final String FILE_PREVIEW_DMSID
public static final String MIME_ICON_NAME
public static final String MIME_OPENICON_NAME
public static final String MIME_DOWNLOAD_URL
public static final String MIME_VIEWERSERLVET
public static final String MIME_EDITSERLVET
public static final String MIME_EVENTHANDLER
public static final String MIME_DOCUMENTFUNCTION
public static final String MIME_ATT_AUTOVIEWERMODE
public static final String MIME_ICON_SUBPATH
public static final int VIEWER_MODE_SIMPLE
public static final int VIEWER_MODE_DEFAULT
public static final int VIEWER_MODE_SINGLE
public static final int VIEWER_MODE_MULTI
public static final int VIEWER_MODE_COMPARE
public static final int VIEWER_MODE_JAVASCRIPT
public static final String VIEWER_SERVLET_REPLACE_TOKEN_DMSID
public static final String VIEWER_SERVLET_REPLACE_TOKEN_SERVERURL
public static final String VIEWER_SERVLET_REPLACE_TOKEN_BASEURL
public static final String VIEWER_SERVLET_REPLACE_TOKEN_BASEDIR
public static final String VIEWER_SERVLET_REPLACE_TOKEN_SECURITYTOKEN
public static final String VIEWER_SERVLET_REPLACE_TOKEN_SECURITYTOKEN_ENC
public static final String VIEWER_SERVLET_REPLACE_TOKEN_PAGE_COUNT
public static final String VIEWER_SERVLET_REPLACE_TOKEN_PAGE
public static final String VIEWER_SERVLET_REPLACE_TOKEN_CONTENT_TYPE
public static final String VIEWER_SERVLET_REPLACE_TOKEN_DOWNLOAD_URL
public static final String REPLACE_TOKEN_VIID
public static final String VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_START
public static final char VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_ENCODE_CHAR
public static final char VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_JSENCODE_CHAR
public static final char VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_NOENCODE_CHAR
public static final String VIEWER_SERVLET_REPLACE_TOKEN_PROPERTY_END
protected static final String OBJECT_INDEX_KEY
protected static final String SUBPATH_KEY
public static final String SCRIPT_URL_PREFIX
public static final String MIME_TYPE_PREFIX_OW_FOLDER
public static final String MIME_TYPE_PREFIX_OW_DEFAULT
public static final String MIME_TYPE_PREFIX_OW_CUSTOMOBJECT
protected OwMainAppContext m_MainContext
protected OwConfiguration m_Configuration
protected OwObject m_parent
protected OwClientRefreshContext m_RefreshContext
protected boolean m_fDEBUG_ResetCalled
protected Map m_ObjectMap
protected String m_strMimeItemStyle
protected String m_strMimeIconStyle
protected String undefName
protected String documentTitle
protected String objectTitle
protected NumberFormat m_NumberFormat
protected String m_mimeTypeContext
protected void init() throws Exception
init
in class OwEventTarget
Exception
public void setIconStyle(String strMimeIconStyle_p)
strMimeIconStyle_p
- String new CSS stylepublic String getIconStyle()
public void setItemStyle(String strMimeItemStyle_p)
strMimeItemStyle_p
- String new CSS stylepublic void setUndefinedLabel(String undefLabel_p)
null
.undefLabel_p
- String label to use, should be non-null valuepublic String getUndefinedLabel()
null
.setUndefinedLabel(String)
public void setMimeTypeContext(String context_p)
context_p
- the context to be used for MIME type resolution, can be null
public String getMimeTypeContext()
null
public static OwXMLUtil getMimeNode(OwConfiguration configuration_p, OwObjectReference obj_p) throws Exception
configuration_p
- OwConfiguration object for static useobj_p
- OwObjectReference to retrieve MIME info forException
public static String getMimeIcon(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
public void insertIconLink(Writer w_p, OwObjectReference obj_p, String subpath_p) throws Exception
w_p
- obj_p
- subpath_p
- optional path to the subitem to open or nullException
public void insertIconLink(Writer w_p, OwObjectReference obj_p, String subpath_p, int page_p) throws Exception
w_p
- obj_p
- subpath_p
- optional path to the subitem to open or nullpage_p
- int requested page numberException
protected StringBuffer createIconLink(OwObjectReference obj_p) throws Exception
obj_p
- - the OwObjectReference
objectStringBuffer
object containing the link.Exception
public void insertIconLink(Writer w_p, OwObjectReference obj_p) throws Exception
w_p
- obj_p
- Exception
public static String getDownloadURL(OwMainAppContext context_p, OwObjectReference obj_p, int iContentType_p, int iPage_p, OwXMLUtil mimeNode_p) throws Exception
context_p
- OwMainAppContext since method is staticobj_p
- OwObjectReference to retrieve the URLiContentType_p
- int requested content type as specified in OwContentCollectioniPage_p
- int requested page numbermimeNode_p
- OwXMLUtil MIME nodeException
protected static String getDefaultDownloadURL(OwMainAppContext context_p, OwObjectReference obj_p, int iContentType_p, int iPage_p) throws Exception
context_p
- OwMainAppContext since method is staticobj_p
- OwObjectReference to retrieve the URLiContentType_p
- int requested content type as specified in OwContentCollectioniPage_p
- int requested page numberException
protected static String replaceProperties(OwMainAppContext context_p, String strIn_p, OwObjectReference obj_p) throws Exception
strIn_p
- String to search and replaceobj_p
- OwObjectReferenceException
public void insertTextLink(Writer w_p, String strDisplayName_p, OwObjectReference obj_p) throws Exception
w_p
- Writer where to write the text as linkstrDisplayName_p
- String text/name/label to use in link representationobj_p
- OwObjectReference which is mapped to the linkException
public void insertTextLink(Writer w_p, String strDisplayName_p, OwObjectReference obj_p, String subpath_p) throws Exception
w_p
- strDisplayName_p
- obj_p
- subpath_p
- optional path to the subitem to open or nullException
public void insertTextLink(Writer w_p, String strDisplayName_p, OwObjectReference obj_p, String subpath_p, int page_p) throws Exception
w_p
- strDisplayName_p
- obj_p
- subpath_p
- subpath_p optional path to the subitem to open or nullpage_p
- integer representing the value of page to openException
public void insertHtmlLink(Writer w_p, String strHtmlCode_p, OwObjectReference obj_p, String subpath_p) throws Exception
w_p
- strHtmlCode_p
- obj_p
- subpath_p
- optional path to the subitem to open or nullException
public void insertHtmlLink(Writer w_p, String strHtmlCode_p, OwObjectReference obj_p, String subpath_p, int page_p) throws Exception
w_p
- strHtmlCode_p
- obj_p
- subpath_p
- optional path to the subitem to open or nullpage_p
- integer representing the value of page to openException
protected String createLinkUrl(String eventName_p, OwObjectReference obj_p, String subpath_p)
eventName_p
- obj_p
- subpath_p
- String subpath or null to open rootString
public void reset()
NOTE: Never forget to call this function in your onRender Method
public void setParent(OwObject parent_p)
public void onDocumentFunctionHandler(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequestException
public void setRefreshContext(OwClientRefreshContext eventlister_p)
eventlister_p
- OwClientRefreshContext interfacepublic void onPluginEventHandler(javax.servlet.http.HttpServletRequest request_p) throws Exception
request_p
- HttpServletRequestException
protected NumberFormat getNumberFormater()
protected static void delegateToMasterPlugin(OwMainAppContext context_p, OwMasterDocument masterPlugin_p, OwObjectReference obj_p, String subpath_p) throws Exception
masterPlugin_p
- OwMasterDocument of the handler plugin to open the objectobj_p
- the OwObjectReference to opensubpath_p
- String subpath or null to open rootException
public static OwMasterDocument getHandlerMasterPlugin(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReference to openException,
- OwConfigurationExceptionException
public static OwDocumentFunction getHandlerDocumentPlugin(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReference to openException,
- OwAccessDeniedExceptionException
public static void openObject(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p, String mimeContext_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceparent_p
- OwObjectiViewerMode_p
- mode as defined in VIEWER_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is neededmimeContext_p
- String context for MIME retrieval, can be nullException
public static void openObject(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceparent_p
- OwObjectiViewerMode_p
- mode as defined in VIEWER_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is neededException
public static void openObjectPreview(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceparent_p
- OwObjectiViewerMode_p
- mode as defined in VIEWER_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is neededException
public static void openObject(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p, int iPage_p, OwWindowPositions windowpos_p, Collection objects_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceparent_p
- OwObjectiViewerMode_p
- mode as defined in VIEWER_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is needediPage_p
- int page numberwindowpos_p
- OwWindowPositionsobjects_p
- optional Collection of objects to view in MDI mode, can be nullException
public static void openObject(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p, int iPage_p, OwWindowPositions windowpos_p, Collection objects_p, String additionalParams_p, String mimeContext_p) throws Exception
context_p
- OwMainAppContext of the appobj_p
- OwObjectReference to the object which should be openedparent_p
- OwObject parent of the referenced objectiViewerMode_p
- mode as defined in VIEWR_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is needediPage_p
- int page numberwindowpos_p
- OwWindowPositionsobjects_p
- optional Collection of objects to view in MDI mode, can be nulladditionalParams_p
- String additional params which should be added to the URLmimeContext_p
- String context for MIME retrieval, can be nullException
- if the context can not resolve the the object reference, or MIME settings.public static void openObject(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p, int iPage_p, OwWindowPositions windowpos_p, Collection objects_p, String additionalParams_p) throws Exception
context_p
- OwMainAppContext of the appobj_p
- OwObjectReference to the object which should be openedparent_p
- OwObject parent of the referenced objectiViewerMode_p
- mode as defined in VIEWR_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is needediPage_p
- int page numberwindowpos_p
- OwWindowPositionsobjects_p
- optional Collection of objects to view in MDI mode, can be nulladditionalParams_p
- String additional params which should be added to the URLException
- if the context can not resolve the the object reference, or MIME settings.public static void openObjectPreview(OwMainAppContext context_p, OwObjectReference obj_p, OwObject parent_p, int iViewerMode_p, OwClientRefreshContext refreshCtx_p, int iPage_p, OwWindowPositions windowpos_p, Collection objects_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceparent_p
- OwObjectiViewerMode_p
- mode as defined in VIEWER_MODE_...refreshCtx_p
- OwClientRefreshContext callback interface for the function plugins to signal refresh events to clients, can be null if no refresh is needediPage_p
- int page numberwindowpos_p
- OwWindowPositionsobjects_p
- optional Collection of objects to view in MDI mode, can be nullException
public static OwMimeManager.OwOpenCommand editObject(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
<editservlet>
tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown.context_p
- OwMainAppContext current context to useobj_p
- OwObjectReference which should be open over edit servletException
public static OwMimeManager.OwOpenCommand editObject(OwMainAppContext context_p, OwObjectReference obj_p, int page_p) throws Exception
<editservlet>
tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown.context_p
- OwMainAppContext current context to useobj_p
- OwObjectReference which should be open over edit servletpage_p
- int load content of the obj_pException
public static OwMimeManager.OwOpenCommand editObject(OwMainAppContext context_p, OwObjectReference obj_p, String additionalParams_p, int page_p) throws Exception
<editservlet>
tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown.context_p
- OwMainAppContext current context to useobj_p
- OwObjectReference which should be open over edit servletadditionalParams_p
- String parameter which should be added to the created URLpage_p
- int load content of the obj_pException
public static OwMimeManager.OwOpenCommand editObject(OwMainAppContext context_p, OwObjectReference obj_p, String mimeContext_p, String additionalParams_p, int page_p) throws Exception
<editservlet>
tag from MIME node, if it exist or
else an OwInvalidOperationException is thrown.context_p
- OwMainAppContext current context to useobj_p
- OwObjectReference which should be open over edit servletmimeContext_p
- context used to determine the object MIME configuration
(see getMimeNode(OwConfiguration, OwObjectReference, String)
additionalParams_p
- String parameter which should be added to the created URLpage_p
- int load content of the obj_pException
public static void openFilePreview(OwMainAppContext context_p, String mimeType_p, String path_p) throws Exception
context_p
- OwMainAppContextmimeType_p
- the MIME type of the preview filepath_p
- absolute path to file on server to previewException
public static void openFilePreview(OwMainAppContext context_p, String mimeType_p, String path_p, String fileName_p) throws Exception
context_p
- OwMainAppContext to use for requesting MIME-settingsmimeType_p
- String MIME type of the preview filepath_p
- String representing full path of the preview filefileName_p
- String can be null, name is then extracted from path_pException
public static boolean isObjectDownloadable(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceException
public static boolean isObjectDownloadable(OwMainAppContext context_p, OwObjectReference obj_p, String mimeContext_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferencemimeContext_p
- optional context for MIME node resolution. Can be null
.Exception
public static String getDownloadLink(OwMainAppContext context_p, String strDisplayName_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextstrDisplayName_p
- String link nameobj_p
- OwObjectReferenceException
public static String getSaveDownloadURL(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceException
public static String getDownloadURL(OwMainAppContext context_p, OwObjectReference obj_p, int iContentType_p, int iPage_p) throws Exception
context_p
- OwMainAppContext since method is staticobj_p
- OwObjectReference to retrieve the URLiContentType_p
- int requested content type as specified in OwContentCollectioniPage_p
- int requested page numberException
public static OwMimeManager.OwOpenCommand getOpenCommand(OwMainAppContext context_p, OwObjectReference obj_p) throws Exception
context_p
- OwMainAppContextobj_p
- OwObjectReferenceException
public static OwMimeManager.OwOpenCommand getOpenCommand(OwMainAppContext context_p, OwObjectReference obj_p, String additionalParams_p) throws Exception
context_p
- OwMainAppContext to handle/request MIME settingsobj_p
- OwObjectRefernce which should be openedadditionalParams_p
- String representing additional parameter, can be nullException
- if the object reference is null, if the MIME handling definition is wrongpublic static OwMimeManager.OwOpenCommand getOpenCommand(OwMainAppContext context_p, OwObjectReference obj_p, String mimeContext_p, String additionalParams_p) throws Exception
context_p
- OwMainAppContext to handle/request MIME settingsobj_p
- OwObjectRefernce which should be openedmimeContext_p
- context used to determine the object MIME configuration
(see getMimeNode(OwConfiguration, OwObjectReference, String)
additionalParams_p
- String representing additional parameter, can be nullException
- if the object reference is null, if the MIME handling definition is wrongpublic static OwMimeManager.OwOpenCommand getOpenCommand(OwMainAppContext context_p, OwObjectReference obj_p, String additionalParams_p, int page_p) throws Exception
context_p
- OwmainAppCotnext to handle/request MIME settingsobj_p
- OwObjectReference which should be openedadditionalParams_p
- page_p
- Exception
- if the object reference is null, if the MIME handling definition is wrongpublic static OwMimeManager.OwOpenCommand getOpenCommand(OwMainAppContext context_p, OwObjectReference obj_p, String mimeContext_p, String additionalParams_p, int page_p) throws Exception
context_p
- OwmainAppCotnext to handle/request MIME settingsobj_p
- OwObjectReference which should be openedmimeContext_p
- context used to determine the object MIME configuration
(see getMimeNode(OwConfiguration, OwObjectReference, String)
additionalParams_p
- page_p
- Exception
- if the object reference is null, if the MIME handling definition is wrongpublic OwMimeManager.OwOpenCommand getOpenCommand(OwObjectReference obj_p) throws Exception
obj_p
- OwObjectReferenceException
public OwMimeManager.OwOpenCommand getOpenCommand(OwObjectReference obj_p, String additionalParams_p) throws Exception
obj_p
- OwObjectReference the object reference which should be handledadditionalParams_p
- String additional parameters which should be added, can be nullException
public OwMimeManager.OwOpenCommand getOpenCommand(OwObjectReference obj_p, String additionalParams_p, int page_p) throws Exception
obj_p
- OwObjectReference the object reference which should be handledadditionalParams_p
- String additional parameters which should be added, can be nullpage_p
- integer representing the value of page to openException
protected void registerObject(OwObjectReference obj_p)
obj_p
- OwObjectReferencepublic static String createAutoViewerRestoreMainWindowScript(OwMainAppContext context_p, int viewermode_p)
public static String makeViewerTitleString(String id_p)
id_p
- String
public static String getAutoViewerScript(OwMainAppContext context_p, String strOpenURL_p, int viewermode_p, String id_p, String sDmsID_p, int iPage_p)
strOpenURL_p
- String URL to viewviewermode_p
- int mode as defined in OwMimeManager.VIEWER_MODE_...id_p
- String unique ID of document to distinguish viewer instancessDmsID_p
- String DMSID of document to openiPage_p
- int page to openpublic static String getAutoViewerScript(OwMainAppContext context_p, String strOpenURL_p, int viewermode_p, String id_p, String sDmsID_p, int iPage_p, OwWindowPositions windowpos_p)
strOpenURL_p
- String URL to viewviewermode_p
- int mode as defined in OwMimeManager.VIEWER_MODE_...id_p
- String unique ID of document to distinguish viewer instancessDmsID_p
- String DMSID of document to openiPage_p
- int page to openprotected static String getServletReplacedTokenString(String servletURL_p, OwMainAppContext currentContext_p, OwObjectReference obj_p, OwXMLUtil mimeNode_p, int page_p) throws UnsupportedEncodingException, Exception
getServletReplacedTokenString(String, OwMainAppContext, OwObjectReference, OwXMLUtil, int, int)
method
with following parameters
getServletReplacedTokenString(servletURL, currentContext, obj, mimeNode, page, Integer.MIN_VALUE)
servletURL_p
- String URL with placeholders to replacecurrentContext_p
- OwMainAppContext which is currently usedobj_p
- OwObjectReference to use for replacementmimeNode_p
- OwXMLUtil XML node from owmimetablepage_p
- int page number to use for replacing VIEWER_SERVLET_REPLACE_TOKEN_PAGE
placeholderUnsupportedEncodingException
- if URL encoding of values failsException
getServletReplacedTokenString(String, OwMainAppContext, OwObjectReference, OwXMLUtil, int, int)
protected static String getServletReplacedTokenString(String servletURL_p, OwMainAppContext currentContext_p, OwObjectReference obj_p, OwXMLUtil mimeNode_p, int page_p, int contentType_p) throws UnsupportedEncodingException, Exception
ATTENTION: This method calls obj.getDMSID()
and
many other methods, if this can lead to an exception replace the
placeholder in servletURL before calling this method.
servletURL_p
- String URL with tokens that should be replacedcurrentContext_p
- OwMainAppContext current context to use for replacingobj_p
- OwObjectReference object to use for replacement of DMSID and properties placeholdersmimeNode_p
- OwXMLUtil XML MIME node from owmimetablepage_p
- int page number to replace VIEWER_SERVLET_REPLACE_TOKEN_PAGE
contentType_p
- int should be some of OwContentCollection.CONTENT_TYPE_... if equals Integer.MIN_VALUE it is ignoredUnsupportedEncodingException
- if values cannot be encoded to a URLException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.