Skip to content
Other versions

Loading…

Form UI template

Developer information for Sample Spring Boot base project with OpenKM authentication and support for JSP, JSTL & REST.

To learn more about Spring Boot, please visit https://projects.spring.io/spring-boot/

There is also a very good tutorial about Spring Boot at https://spring.io/guides/gs/spring-boot/

This application could be packaged as well as a jar and war. In this pom configuration the artifact will be a war.

If you need to change packaging please see this url: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging (section 66.2)

  • Go to Administration > Metadata and register the metadata definition:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.1//EN"
"http://www.openkm.com/dtd/property-groups-2.1.dtd">
<property-groups>
<property-group label="Sample Template" name="okg:tpl">
<input label="Name" name="okp:tpl.name"/>
<input label="Birth Date" name="okp:tpl.birth_date" type="date" />
<select label="Language" name="okp:tpl.language" type="simple">
<option label="Java" value="java"/>
<option label="Python" value="python"/>
<option label="PHP" value="php" />
</select>
</property-group>
</property-groups>
  • Enable “Sample templates” metadata group in the profiles.
  • Create file named template.html with content:
<html>
<body>
<h1>Sample template</h1>
<table>
<tr>
<td><b>Name</b></td>
<td>${okp_tpl_name!}</td>
</tr>
<tr>
<td><b>Birth Date</b></td>
<td>${okp_tpl_birth_date?string("yyyy-MM-dd")}</td>
</tr>
<tr>
<td><b>Language</b></td>
<td>${okp_tpl_language!}</td>
</tr>
</table>
</body>
</html>
  •  Upload the template.html file to “/okm:templates/template.html”
  • Assign metadata group “Sample template” to the document “/okm:templates/template.html”

Step 3 - deploy the application

  • Copy the forms-X.war into your **$TOMCAT_HOME/**webapps

Step 4 - create a document from UI

  • Set in the browser the URL http://localhost:8080/forms-1.0/
  • Fill the fields shown in the screen and click on submit button
  • Check that into OpenKM has been created a document