Apps and development tools - Basic App Kit


View reference

A view is defined by XML. The format in general is

<view {view-attributes}>

   {view-body}

</view>

If a storage should show more then one view, the <view>s is embedded into a <views> tag:

<views {views-attributes}>

    <view>...</view>

    <view>...</view>

    ...

</views>

For a details description of the view attributes see the <view> reference and <views> reference.

View Body:

The body of the view tag defines 

  • What documents should be shown in the view
  • Optional groupchange
  • What columns should be rendered

In general the view body contains the following section:

<view {view-attributes}>

   {document selection (optional)}

   {group-change (optional)}

   {conditions (optional)}

   {columns (mandatory)}

</view>

For a details description see the sub tags of <view>.

Document selection:

The db-query is calculated based on the document selection tags:

<select>, <filter>, <search>, <orderby>

Each of this tags is optional and has a default value. 

In case of query-type="hql" (the default) the resulting query is:

<select> AND <filter> AND <search like :user-input>

order by <orderby>

In case of view query-type=="custom" the db-query is completely used from the <view>'s <query> tag.

in case of query-type="lucene" the resulting query is:

<select> <filter> <search(if defined)> :user-input

Group-change:

  • <grouchange>{TMLScript expression}</groupchange>
    Defines a groupchange between the view rows.

Column definition:

  • <col {col-attribites}>{TMLScript expression or script}</col>
    Defines the colums of the view

Sample:

<view selectable="false" pagesize="10">

  <search label="Filter By Lastname:">content.items['lastname'].text</search>

  <filter>content.contentclass='docs'</filter>

  <col label="Lastname">lastname</col>

  <col label="Autor">AUTHOR</col>

  <col label="Created">CREATED</col>

</view>

Table of contents: