Difference between revisions of "External Preview"

From OpenKM Documentation
Jump to: navigation, search
m
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
External Preview feature allow to preview some document based on external url request. There two parameters passed as request parameter in url request, the document '''uuid''' and the '''downloadUrl'''.
+
External Preview feature allow to preview some document based on external URL request. There two parameters passed as request parameter in URL request, the document '''uuid''' and the '''downloadUrl'''.
  
 
'''Configuration'''
 
'''Configuration'''
 +
There's a configuration property at Administration / Configuration called '''extension.external.preview'''. Each row couple of values is a preview content declaration, the format is:
  
There's a configuration property at Administration / Configuration called '''extended.external.preview'''. Each row couple of values is a menu popup declaration, the format is:
+
'''mime-type;url'''
'''mime-type,url'''
 
  
 
Example
 
Example
 
  application/illustrator;http://localhost:8180/OpenKM/test.jsp
 
  application/illustrator;http://localhost:8180/OpenKM/test.jsp
 
  application/epub+zip;http://localhost:8180/OpenKM/epub_previewer.jsp
 
  application/epub+zip;http://localhost:8180/OpenKM/epub_previewer.jsp
  application/x-mspublisher;;http://localhost:8180/OpenKM/mspreviewer_previewer.jsp
+
  application/x-mspublisher;http://localhost:8180/OpenKM/mspreviewer_previewer.jsp
 
 
 
 
[[File:Okm_user_guide_544.png|center]]
 
  
 
'''Use'''
 
'''Use'''
  
Select a document with one of the mime-type set in configuration parameters. Show preview parameter. Will be shown the external url based on document mime-type.
+
Select a document with one of the MIME type set in configuration parameters. Show preview parameter. Will be shown the external URL based on document mime-type.
  
  
[[File:Okm_user_guide_545.png|center]]
+
[[File:Okm_user_guide_565.png|center]]
  
  
Line 25: Line 22:
 
File test.jsp.
 
File test.jsp.
 
<source lang="java">
 
<source lang="java">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 
<?xml version="1.0" encoding="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">
 
<!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">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
 
<head>
<title>External URL request example</title>
+
<title>External URL request example</title>
 
</head>
 
</head>
 
<body>
 
<body>
Request parameters<br/><br/>
+
Request parameters
<b>uuid:</b><%=request.getParameter("uuid") %><br/><br/>
+
<br />
<b>dowloadUrl:</b><%=request.getParameter("dowloadUrl") %><br/>
+
<br />
 +
<b>uuid:</b><%=request.getParameter("uuid")%><br />
 +
<br />
 +
<b>dowloadUrl:</b><%=request.getParameter("dowloadUrl")%><br />
 
</body>
 
</body>
 
</html>
 
</html>

Latest revision as of 13:59, 4 November 2014

External Preview feature allow to preview some document based on external URL request. There two parameters passed as request parameter in URL request, the document uuid and the downloadUrl.

Configuration There's a configuration property at Administration / Configuration called extension.external.preview. Each row couple of values is a preview content declaration, the format is:

mime-type;url

Example

application/illustrator;http://localhost:8180/OpenKM/test.jsp
application/epub+zip;http://localhost:8180/OpenKM/epub_previewer.jsp
application/x-mspublisher;http://localhost:8180/OpenKM/mspreviewer_previewer.jsp

Use

Select a document with one of the MIME type set in configuration parameters. Show preview parameter. Will be shown the external URL based on document mime-type.


Okm user guide 565.png


Sample test File test.jsp.

<%@ 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>