Using iframe for extending frontend UI

This sample gives some clues about how to use iframe in frontend UI. This sample use ExtraTab feature with an iframe that contains references to OpenKM object as links.

The HTML file has a valid OpenKM UUID's links.

The sample below use Exposed frontend JavaScript API .

File extra_tab.html:

<html>
<head>
  <title>Example</title>
</head>
<script type="text/javascript">
  function openPath(path) { 
    parent.jsOpenPathByUuid(path);
  }
</script>
<body>
<h1>url</h1>
  <a href="javascript:void();" onclick="openPath('9789ac11-ac03-4ce7-87e9-9643b0ddf99a');">Document link example 1</a>
</body>
</html>

Copy the extra_tab.html file into  $TOMCAT/webapps/OpenKM folder.

Copy to OpenKM folder is mandatory, otherside from iframe will not be able to access protected resource.

When you change the contents of the OpenKM.war file is deployed a new version of the application and all the contents into $TOMCAT_HOME/webapps/OpenKM will be refreshed and you will lost any change you made directly in the webapps/OpenKM folder.

Finally configure ExtraTab feature with the new url, for example  http://localhost:8080/OpenKM/extra_tab.html.

Consider http://localhost:8080/OpenKM/extra_tab.html as an example. You should use your own public OpenKM application url.