IBM FileNet P8, Version 5.2            

Content redirection properties

The content_redir.properties file configures redirections to Workplace XT Java Server Pages (JSP) or servlets, or to custom or vendor applications, when a user attempts to open a file from inside Workplace XT. 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.

Overview of content redirection

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 listing 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:
  • The first group of key/value pairs map MIME types to the Image Viewer. To take advantage of the annotations feature in Image Viewer, you can edit this file to specify which image types open in Image Viewer. The listing shows the MIME types that are opened by the Image Viewer, those with a value of /WcmJavaViewer.jsp?{QUERY_STRING}. See Work with Image Viewer for more information about Image Viewer.
  • Keys in content_redir.properties are based on the mimeType property defined in certain Content Engine classes. See About MIME types for more information.
  • A value can include macros, such as {QUERY_STRING}. The available macros are documented in content_redir.properties.
  • If a MIME type is not defined in content_redir.properties, the getContent servlet is invoked, and responds according to the object type selected. See Default behavior of the getContent servlet, below.
  • For document object types, redirection behavior is additionally defined by certain settings, which you must take into account if you modify content_redir.properties. See Interaction with other settings, below.
# 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
...

Default behavior of the getContent servlet

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.
Folder
Redirects client to a page displaying the folder.
Document
If the document has content, the content is returned to the browser.
If the document has an external reference, the servlet redirects the client appropriately.
If the document has no content, an error is reported.
Workflow Definition Document
Redirects client to Workflow Designer.
Stored Search
Redirects client to a page displaying the stored search.
Search Template
Redirects client to a page displaying the search template.
Publish Template
The content of the publish template is returned as XML.

Interaction with other settings

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:
  • If IgnoreRedirect is set to True, it sends the document to the browser.
  • If IgnoreRedirect is set to False, it sends the document to the component specified in content_redir.properties.
  • If IgnoreRedirect is not set (NULL), it sends the document to the component specified in content_redir.properties.

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 services preferences for more information about this preference.

When opening images stored in Image Services, the application does the following actions:
  • If "Include Redirect" = Yes, and the document property IgnoreRedirect = true, the application sends the image to the browser.
  • If "Include Redirect" = Yes, and the document property IgnoreRedirect = false, the application sends the image to the destination specified in content_redir.properties.
  • If "Include Redirect" = No, the IgnoreRedirect property setting is not included on the URL, and the application sends the image to the destination specified in content_redir.properties.

Modifying the redirection properties file

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

  1. Open content_redir.properties with a text editor. By default, the file is installed in the following location:
    Workplace XT: <install_location>/FileNet/Config/WebClient
  2. Modify the properties as desired.
    • To remove an existing MIME type mapping, comment out the applicable key and value pair with a leading # symbol; for example, #image/pjpeg=/WcmJavaViewer.jsp?{QUERY_STRING}.
    • To add a MIME type mapping, enter a key and value pair, with a key that corresponds to a mimeType property value defined in a Content Engine class. The value must specify a path to a JSP page or servlet in the application, relative to the application directory.

      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.

    • To map a MIME type to a vendor or custom application, you must specify a component within the application that redirects to the external application. For example, in the following Workplace key and value pair, Workplace would redirect to Workplace/redirect/customAppRedirect.jsp if a user selected a file with a MIME type of "text/x-speech".
      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 XT, to return the URL, parameters, security token, and any other values required by the external application.

  3. Save content_redir.properties.
  4. Restart the web server for your new settings to take effect.


Feedback

Last updated: March 2013
aeadm_config_file_content_redir.htm

© Copyright IBM Corporation 2013.
This information center is powered by Eclipse technology. (http://www.eclipse.org)