External preview extension
OpenKM 7.1 comes with two user interfaces, called "classic" and "kcenter". Although both are functionally very similar, the layout and the way they are used may differ significantly. This page is based on the "classic" user interface. If you are using the "kcenter" user interface and are unsure how to access any of these features, please create a ticket in the support website.
The External Preview feature helps you preview documents based on an external URL request.
This option is only available if you have enabled the External preview feature.
There are two parameters passed in the URL request:
- The document uuid.
- The downloadUrl.
Configuration
Field / Property | Type | Description |
---|---|---|
extension.external.preview |
List |
Each row, a pair of values, is a preview content declaration. The format is: mime-type;url application/illustrator;http://localhost:8180/openkm/test.jsp |
More information at Configuration parameters.
Sample
Configuration
Create a file named test.jsp and copy it into the $TOMCAT_HOME/webapps/openkm folder.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>External URL request example</title>
</head>
<body>
Request parameters
<br />
<br />
<b>uuid:</b><%=request.getParameter("uuid")%><br />
<br />
<b>dowloadUrl:</b><%=request.getParameter("dowloadUrl")%><br />
</body>
</html>
Usage
- Choose a document with one of the MIME types set in the configuration parameters.
- Open the preview tab. The external URL based on the document MIME type will be shown.