Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The client application calls a specific URL (the parameter service) with all relevant parameter values already entered by the user and gets back the updated parameter list. For cascading parameters the available values may change when user parameters change.

Element:

...

parameters

Each parameter document uses "parameters" as tag name of the root element. The document and all elements and attributes must belong to the namespace "http://reporting.pentaho.org/namespaces/parameters/1.0".

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
           elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://reporting.pentaho.org/namespaces/parameters/1.0"
           targetNamespace="http://reporting.pentaho.org/namespaces/parameters/metadata/1.0">


 <xs:complexType name="parametersType">
    <xs:sequence>
      <xs:element type="parameterType" name="parameter" maxOccurs="unbounded" minOccurs="0"/>
      <xs:element type="errorsType" name="errors" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute type="xs:boolean" name="show-parameter-ui" use="optional"/>
    <xs:attribute type="xs:boolean" name="is-prompt-needed" use="optional"/>
    <xs:attribute type="xs:boolean" name="paginate" use="optional"/>
    <xs:attribute type="xs:boolean" name="subscribe" use="optional"/>
    <xs:attribute type="xs:string" name="layout" use="optional"/>
    <xs:attribute type="xs:int" name="accepted-page" use="optional"/>
    <xs:attribute type="xs:int" name="page-count" use="optional"/>
    <xs:attribute type="xs:boolean" name="autoSubmit" use="optional"/>
    <xs:attribute type="xs:boolean" name="autoSubmitUI" use="optional"/>
  </xs:complexType>

Element: parameter

The parameters element contains a list of parameter definitions and a map of error messages. Each parameter
has a unique name.

Code Block
<xs:complexType name="parameterType">
    <xs:sequence>
      <xs:element type="attributeType" name="attribute" maxOccurs="1" minOccurs="0"/>
      <xs:element type="valuesType" name="values" maxOccurs="1" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute type="xs:string" name="name" use="required"/>
    <xs:attribute type="xs:string" name="type" use="required"/>
    <xs:attribute type="xs:string" name="timezone-hint" use="required"/>
    <xs:attribute type="xs:boolean" name="is-strict" use="optional"/> <!-- was is-strict -->
    <xs:attribute type="xs:boolean" name="is-multi-select" use="optional"/>
    <xs:attribute type="xs:boolean" name="is-mandatory" use="optional"/>
  </xs:complexType>

The parameter element has a unique name (within the document). The type attribute specifies the Java data type the parameter expects. The UI must respect the type specified here and must provide data in the correct format matching the type given. For web-environments, the web-UI must provide a string in a parsable format.

Type can be any of
"java.lang.String" (free form text),

"java.lang.Number", "java.lang.Double", "java.lang.Float", "java.lang.Short", "java.lang.Byte", "java.lang.Integer", "java.lang.Long", "java.math.BigDecimal" or "java.math.BigInteger"

The string representation consists of an optional sign, '+' ('\u002B') or '-' ('\u002D'), followed by a sequence of zero or more decimal digits ("the integer"), optionally followed by a fraction, optionally followed by an exponent.

The fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The number formed by the sign, the integer and the fraction is referred to as the significand.

The exponent consists of the character 'e' ('\u0075') or 'E' ('\u0045') followed by one or more decimal digits. The value of the exponent must lie between -Integer.MAX_VALUE (Integer.MIN_VALUE+1) and Integer.MAX_VALUE, inclusive.

Valid examples are:

  • 100
  • 100.90
  • +50.45
  • -200.50
  • 1E-10
  • 1E+10
  • 10E5

"java.util.Date", "java.sql.Date", "java.sql.Time", "java.sql.Timestamp"

The string representation for Dates constists of the standard ISO-8601 datetime format with or without timezone information. The format string used is "yyyy-MM-dd'T'HH:mm:ss.SSSZ" or "yyyy-MM-dd'T'HH:mm:ss.SSS".

Example: 2010-09-30T23:59:59.000+0500

"java.lang.Boolean"

The Boolean value of "true" is represented by the all-lower-case text "true". The value "false" is represented by the all-lower-case value of "false".

Additional types beyond the ones given in this specification can be supported if both the client and the server understand them and as long as these values are encoded in a way that makes them safe to use in internationalized environments.

Representing Null Values

The textual representation of a undefined value is an empty string. Therefore any empty string given by the user or in a parameter document must be normalized to a <null> value.

Element: attribute

Code Block

  <xs:complexType name="attributeType">
    <xs:attribute type="xs:string" name="namespace" use="required"
                  default="http://reporting.pentaho.org/namespaces/engine/parameter-attributes/core"/>
    <xs:attribute type="xs:string" name="name" use="required"/>
    <xs:attribute type="xs:string" name="value" use="required"/>
  </xs:complexType>

Element: values

Code Block

  <xs:complexType name="valuesType">
    <xs:sequence>
      <xs:element type="valueType" name="value" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

Element: value

Code Block

  <xs:complexType name="valueType">
    <xs:attribute type="xs:string" name="label" use="optional"/>
    <xs:attribute type="xs:string" name="type" use="required"/>
    <xs:attribute type="xs:string" name="value" use="required"/>
    <xs:attribute type="xs:boolean" name="selected" use="required"/>
  </xs:complexType>

Element: errors

Code Block

  <xs:complexType name="errorsType">
    <xs:sequence>
      <xs:element type="errorType" name="error" maxOccurs="unbounded" minOccurs="0"/>
      <xs:element type="globalErrorType" name="global-error" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>

  </xs:complexType>

Element: error

Code Block

  <xs:complexType name="errorType">
    <xs:attribute type="xs:string" name="message" use="required"/>
    <xs:attribute type="xs:string" name="parameter" use="required"/>
  </xs:complexType>

Element global-error

Code Block

  <xs:complexType name="globalErrorType">
    <xs:attribute type="xs:string" name="message" use="required"/>
  </xs:complexType>
</xs:schema>