The content_redir.properties file configures redirections to Workplace Java™ Server Pages (JSP) or servlets, or to custom or vendor applications, when a user attempts to open a file from inside Workplace. Redirections are based on content MIME type. This topic shows you how to customize the redirections. The following section explains how the application uses content_redir.properties. To customize redirections, see the section Modifying the redirection properties file.
The content_redir.properties consists of key/value pairs, where the key is a MIME type, and the value specifies the component to be used to open a file of the associated MIME type. The lisiting below is for Image Viewer and is used here as an example. The example can be applied to other applications. In examining the listing, note the following points:
/WcmJavaViewer.jsp?{QUERY_STRING}
. See Work with Image Viewer for more information about Image Viewer.{QUERY_STRING}
. The available macros are documented in content_redir.properties.
# Comment the lines with MIME types to not be opened by the Image Viewer applet
image/pjpeg=/WcmJavaViewer.jsp?{QUERY_STRING}
image/jpg=/WcmJavaViewer.jsp?{QUERY_STRING}
image/jpeg=/WcmJavaViewer.jsp?{QUERY_STRING}
image/bmp=/WcmJavaViewer.jsp?{QUERY_STRING}
image/tiff=/WcmJavaViewer.jsp?{QUERY_STRING}
image/gif=/WcmJavaViewer.jsp?{QUERY_STRING}
application/x-cold=/WcmJavaViewer.jsp?{QUERY_STRING}
application/x-visio=/redirect/customAppRedirect.jsp?vsId={VERSION_SERIES_ID}&objectStoreName={OBJECT_STORE_NAME}&id={OBJECT_ID}&objectType=document
application/vnd.filenet.im-image=/WcmJavaViewer.jsp?{QUERY_STRING}
application/vnd.filenet.im-cold=/WcmJavaViewer.jsp?{QUERY_STRING}
application/vnd.filenet.im-form=/WcmJavaViewer.jsp?{QUERY_STRING}
application/vnd.filenet.im-other=/WcmJavaViewer.jsp?{QUERY_STRING}
folder=/WcmObjectBookmark.jsp
customobject=/integrationWebBasedCommand?_commandId=3010
showPropertiesCommand=/integrationWebBasedCommand?_commandId=3010
application/x-filenet-search=/WcmObjectBookmark.jsp
application/x-filenet-searchtemplate=/WcmObjectBookmark.jsp
application/x-filenet-workflowdefinition=/eprocess/WcmDesigner.jsp
application/x-filenet-scenariodefinition=/eprocess/WcmSimDesigner.jsp
...
If a MIME type is not specified in content_redir.properties, the application invokes the getContent servlet. The servlet's behavior is determined by the type of object selected, as listed below.
In addition to the content_redir.properties file settings, a hidden property on document type objects, which includes images, affects the redirection behavior. This hidden property, called "IgnoreRedirect" is not set by default. It can only be set programmatically or through Enterprise Manager.
When opening document-type objects, the application looks at the IgnoreRedirect property and does the following actions:
For documents stored in an external library, such as Image Services, there is a external service site preference called "Include Redirect". By default, this preference is set to "Yes". If it is set to "Yes", the URL is appended with the IgnoreRedirect property setting on the image. See External site preferences for more information about this preference.
When opening images stored in Image Services, the application does the following actions:
You can customize the redirections by modifying content_redir.properties. For example, you can add redirections to vendor applications, or comment out existing redirections and allow the getContent servlet to handle objects of the commented-out MIME type.
NOTE Before modifying content_redir.properties, check the IgnoreRedirect property and the "Include Redirect" site preference for the MIME types for which you want to define redirections.
To modify the redirection properties file
#
symbol; for example, #image/pjpeg=/WcmJavaViewer.jsp?{QUERY_STRING}
.application/x-filenet-workflowdefinition=/eprocess/WcmDesigner.jsp
Using macros, you can pass the URL query string of the selected object to the component specified in the key and value pair. For example, you can include the {QUERY_STRING}
macro to pass the entire query string. Or you can pass individual parameters from the query string with {OBJECT_TYPE}
, {OBJECT_ID}
, and other macros. See the content_redir.properties file for a complete list of macros.
text/x-speech =/redirect/customAppRedirect.jsp?{QUERY_STRING}
To redirect to an external application, the JSP redirection code can be as simple as the following line.
<%response.sendRedirect("http://hostServer:8080/customWebApp"+request.getParameter("vsId"));%>
Typically, however, the redirection logic to an external application is more involved, leveraging the same base APIs as Workplace, to return the URL, parameters, security token, and any other values required by the external application. (For Workplace, you can use the Web Application Toolkit to accomplish this. For more information on the framework and APIs on which Workplace is built, see Web Application Toolkit Developer's Guide.)