Params form fields

Params forms are based on a formal XML definition. The DTD (Document Type Definition) defines the structure and the legal elements and attributes of an XML document.

You can see the latest DTD on our website http://www.openkm.com/dtd/report-parameters-{major}.{minor}.dtd where {major} and {minor} values are two numbers (major release and minor release). For example, the location for version 2.1 of the DTD is http://www.openkm.com/dtd/report-parameters-2.1.dtd

Each application version supports only a couple of DTD definitions. Read Application version compatibility table to see which are supported by your application.

Basic XML skeleton

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE report-parameters PUBLIC "-//OpenKM//DTD Report Parameters 2.1//EN"
                                   "http://www.openkm.com/dtd/report-parameters-2.1.dtd">
<report-parameters>

</report-parameters>
  • The DOCTYPE is a formal definition of a DTD. In the previous example, the DOCTYPE is report-parameters-2.1.dtd.
  • The XML begins with the <report-parameters> tag and ends with </report-parameters>. Within this hierarchy the metadata groups are defined.

Basic example

Available field types:

  • Checkbox
  • Input
  • Select
  • Separator
  • Suggestbox
  • Text
  • TextArea

More information about field type elements is at Params fields

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE report-parameters PUBLIC "-//OpenKM//DTD Report Parameters 2.1//EN"
                                   "http://www.openkm.com/dtd/report-parameters-2.1.dtd">
<report-parameters>
  <input label="From" name="from_date" type="date">
    <validator type="req"/>
  </input>
  <input label="To" name="to_date" type="date">
    <validator type="req"/>
  </input>
</report-parameters>

Using a file system DTD

If the server has no access to the Internet, then the DTD file must be accessible in some way; for example, you can store a copy on your application server.

The XML definition must be changed to refer to the new DTD location; otherwise you will get an application error while trying to process the DTD file.

This can be a file system path (example below) or a valid intranet URL.

<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.1//EN"
                                 "file:///home/openkm/report-parameters-2.1.dtd">
  • In the example, /home/openkm/report-parameters-2.1.dtd is the file system path to the file.