ILMSinfo / RBIS: XML

From ILMS-Wiki
(Difference between revisions)
Jump to: navigation, search
(view)
(attribute)
 
(44 intermediate revisions by one user not shown)
Line 1: Line 1:
 
=General structure=
 
=General structure=
 +
The XML definition will be used to automatically create all views on the dataset (overview, detailed view, search view, edit/new view) and all SQL queries in the background. All attribute elements with given position (group and order) will be displayed except of no-matching '''cond'''-condition attributes.
 +
 +
 
=Detailed description=
 
=Detailed description=
 +
 +
 
==view==
 
==view==
*'''basedir''':
+
*'''basedir''': set to : ".."
*'''name''':
+
*'''name''': not in use
*'''title''': Headline
+
*'''title''': not in use (Headline in old Layout)
*'''''template''''' (true|false): Enable function to save content as template.
+
*'''''template''''' (true|false): Enable function to save content as template
 +
*'''''parent''''': Parent XML-file (will be used to manipulate log entries)
  
 
'''Example:'''
 
'''Example:'''
  <view basedir=".." name="variable" title="geodata_headline" template="true">
+
  <view basedir=".." name="variable" title="c_person_headline" parent="c_person_org" template="true">
  
 
==rights==
 
==rights==
Line 18: Line 24:
  
 
==id==
 
==id==
 +
*'''name''': Identifier of the dataset. "md_metadata_id" should be used if available.
 +
<nowiki><id name="geodata.md_metadata_id"/></nowiki>
 +
 
==group==
 
==group==
 +
*'''name''': Internal name of the group (g + number). The number defines also the order of display. 
 +
*'''title''': Group name (headline of group) replaced by translation id.
 +
 +
<nowiki><group name="g0" title="geodata_g0"/>
 +
<group name="g1" title="geodata_g1"/>
 +
<group name="g2" title="geodata_g2"/></nowiki>
 +
 
==map==
 
==map==
 +
The map-section describes if and how geometry information or displayed and linked to maps.
 +
*'''layer'''
 +
**'''id''': Identification ID (should be equal to view -> id)
 +
**'''layer_type''' (station|map): type of given geometry (station = point; map = bounding box)
 +
<nowiki><layer id="dsstation.md_metadata_id" link_type="station"/></nowiki>
 +
 +
At least there is one section necessary to describe in which columns the geometry is located and to add rules to which layer the dataset should be linked to (RBISmap)
 +
*'''layer'''
 +
**'''name''': name of target layer (RBISmap)
 +
**'''title''' (station|map): not used
 +
**'''id''': Identification ID (must equal to view -> id)
 +
***'''geometry''':
 +
****'''type''' (point|bounding_box): Type of geometry
 +
****'''spat_ref_sys''': Database field with SRID
 +
*****'''source''':
 +
******'''contains''': Database field (part of geometry)
 +
******'''ref''': Refers to part of geometry
 +
***'''metadata''':
 +
****'''column'''
 +
****'''contains''': Database field with datase name
 +
***'''conditions''':
 +
****'''sql''': SQL statement to define association rules
 +
 +
'''Example 1''' (bounding box):
 +
<nowiki>
 +
    <map>
 +
        <layer id="geodata.md_metadata_id" link_type="map"/>
 +
        <display_link title="geodata_display_link"/>
 +
          <layer name="bounding_box" title="Teststation" id="dsstation.md_metadata_id">
 +
            <geometry type="bbox" spat_ref_sys="map_srid.srid">
 +
                <source contains="geobndbox.westbl" ref="west"/>
 +
                <source contains="geobndbox.eastbl" ref="east"/>
 +
                <source contains="geobndbox.southbl" ref="south"/>
 +
                <source contains="geobndbox.northbl" ref="north"/>
 +
            </geometry>
 +
        </layer>       
 +
    </map></nowiki>
 +
 +
'''Example 2''' (station coordinates with association rules):
 +
<nowiki>
 +
    <map>
 +
        <layer id="dsstation.md_metadata_id" link_type="station"/>
 +
        <layer name="station_precip" title="Teststation" id="dsstation.md_metadata_id">
 +
            <geometry type="point" spat_ref_sys="map_srid.srid">
 +
                <source contains="dsstation.latutm" ref="lat"/>
 +
                <source contains="dsstation.longutm" ref="long"/>
 +
                <source sql=""/>
 +
                <source file=""/>
 +
            </geometry>
 +
            <metadata>
 +
                <column name="statname" contains="dsstation.statname"/>
 +
                <column name="fp_featpar" sql="SELECT featpar FROM ds_otherpar left join fp_featpar ON ds_otherpar.fp_featpar_id=fp_featpar.fp_featpar_id WHERE dsstation_id = &quot;.$result[&quot;dsstation.dsstation_id&quot;].&quot;"/>
 +
            </metadata>
 +
            <conditions sql="dsstation.dsstation_id IN (SELECT dsstation_id FROM ds_otherpar WHERE dsstation_id = &quot;.$result[&quot;dsstation.dsstation_id&quot;].&quot; and fp_featpar_id=12027014) "/>
 +
        </layer>
 +
    </map>
 +
</nowiki>
 +
 
==edit==
 
==edit==
 +
*'''title''': Headline (e.g. Edit dataset:)
 +
*'''ref_id''': Identifier (e.g. metadata.md_metadata_id)
 +
 +
*'''''change''''' (true|false): Display link
 +
*'''''change_view''''' : Reference view for action.
 +
*'''''change_ov''''' (true|false): Display link in overview
 +
*'''''change_title''''': Title replaced by translation id (e.g. Edit).
 +
 +
*'''''delete''''' (true|false): Display link
 +
*'''''delete_view''''' : Reference view for action.
 +
*'''''delete_ov''''' (true|false): Display link in overview
 +
*'''''delete_title''''': Title replaced by translation id (e.g. Delete).
 +
 +
*'''''add''''' (true|false): Display link
 +
*'''''add_view''''' : Reference view for action.
 +
*'''''add_ov''''' (true|false): Display link in overview
 +
*'''''add_title''''': Title replaced by translation id (e.g. Add).
 +
 +
'''Example 1:'''
 +
<nowiki><edit title="c_person_edit_title"
 +
ref_id="respparty.ci_respparty_id"
 +
change="true"
 +
change_ov="false" change_title="c_person_edit_change_title" delete="true"
 +
delete_ov="false" delete_title="c_person_edit_delete_title"/></nowiki>
 +
 +
'''Example 2 (with "add" & reference view):'''
 +
<nowiki><edit title="adm_select_dropdown_edit_title"
 +
ref_id="app_view_dropdown_ids.app_view_dropdown_ids_id"
 +
change="true"
 +
change_ov="false"
 +
change_title="adm_select_dropdown_edit_change_title"
 +
change_view="adm_select_dropdown_edit"
 +
delete="true"
 +
delete_ov="false"
 +
delete_title="adm_select_dropdown_edit_delete_title"
 +
delete_view="adm_select_dropdown_edit"
 +
add="true"
 +
add_ov="false"
 +
add_title="adm_select_dropdown_edit_add_title"/></nowiki>
 +
 
==document==
 
==document==
 +
Activate the possibility to add files to a dataset (only possible if the dataset has a global identifier (md_metadata_id))
 +
*'''title''': not used (Title in old Layout)
 +
*'''ref_id''': Identifier to associate Documents
 +
*'''''ref_view_name''''': Reference view name if not identical with XML name
 +
 +
'''Example 1''':
 +
<nowiki>
 +
    <document title="geodata_document" ref_id="metadata.md_metadata_id"/>
 +
</nowiki>
 +
 +
'''Example 2''' (XML only for search):
 +
<nowiki>
 +
    <document title="station_search_document" ref_id="dsstation.md_metadata_id" ref_view_name="station_meta"/>
 +
</nowiki>
 +
 +
==association==
 +
*'''edit''':
 +
*'''''overview''''':
 +
 
==table==
 
==table==
 
*'''name''': table name in the database
 
*'''name''': table name in the database
Line 36: Line 169:
  
 
==attribute==
 
==attribute==
*'''''cond''''': name of condition (if the name is not set in the config.php, the attribute will be ignored. The cond-attribute must be also set in the table and join element.)
+
*'''''cond''''': name of condition (if the name is not set in the config.php, the attribute will be ignored. The cond-attribute can/must be also set in the table and join element.)
 
  <nowiki><attribute cond="workgroup" name="featpar" title="geo.... /></nowiki>
 
  <nowiki><attribute cond="workgroup" name="featpar" title="geo.... /></nowiki>
 +
 +
*'''''pk'''''
 +
*'''type'''
 +
**'''text''': limited by the length given under '''size'''. Input field will be a text field or textarea according to the given maximal length.
 +
**'''email''': input will be checked against the structure of an email adress.
 +
**'''float|integer''': only checked by "is_numeric()"
 +
**'''date''': dateformat is described under '''dateformat'''
 +
**'''timestamp''': date is stored as UNIX-timestamp
 +
**'''bool''': Boolean values; a selection list with "true/fals" will be created
 +
**'''serialized''': content(array) is stored with "serialize()" and shown with "unserialized()" as array
 +
**'''password''': md5 encryption
 +
**'''id''': foreign key field
 +
**'''hidden''':  field is not displayed, but value is send
 +
*'''''default''''': default value (text or ID)
 +
*'''''dateformat''''': Dateformat ( e.g. "Y-m-d")
 +
*'''''check''''':
 +
*'''''multi_lang'''''(true):multilingual field in the database
 +
 +
*'''''link_id''''': Specifies the ID used for the link
 +
*'''''link_view''''': Specifies the target view
 +
*'''''link_target''''': Define the target php-file. The default target is '''view.php'''
 +
 +
*'''''size''''': text field -> number for max length; selection field -> name of predefined list
 +
*'''''sort''''':
 +
 +
*'''''depend_on''''':
 +
*'''''depend_on_rule_table''''':
 +
 +
*'''''required''''':
 +
*'''''update''''':
 +
 +
*'''''filter''''': true -> display selection list on overview column
 +
 +
*'''''group''''':
 +
*'''''order''''':
 +
*'''''overview''''':
 +
 
===example: Primaray key===
 
===example: Primaray key===
 
===example: Selection list===
 
===example: Selection list===
 
===example: Date===
 
===example: Date===
 +
===example: Link ===
 +
<nowiki>link_id="int_method_set.int_method_set_id" link_view="int_method_set_list" link_target="overview.php"</nowiki>
 +
===example: Dependency ===
 +
<nowiki><attribute name="unit" title="ts_timeseriesfeature_uomunits_all_unit" default="" type="text" size="measured_group" group="g0" order="3" update="dropdown" required="mandatory" overview="3" depend_on="fp_featpar_all.featpar" depend_on_rule_table="app_depend_featpar_uom"/></nowiki>
  
 
==join==
 
==join==
 
*'''''cond''''': name of condition (if the name is not set in the config.php, the table will be ignored. The cond-attribute must be also set in the table and attribute element.)
 
*'''''cond''''': name of condition (if the name is not set in the config.php, the table will be ignored. The cond-attribute must be also set in the table and attribute element.)
 
  <nowiki><join cond="workgroup" from_table="geodata" ... /></nowiki>
 
  <nowiki><join cond="workgroup" from_table="geodata" ... /></nowiki>

Latest revision as of 17:01, 23 February 2015

Contents

General structure

The XML definition will be used to automatically create all views on the dataset (overview, detailed view, search view, edit/new view) and all SQL queries in the background. All attribute elements with given position (group and order) will be displayed except of no-matching cond-condition attributes.


Detailed description

view

  • basedir: set to : ".."
  • name: not in use
  • title: not in use (Headline in old Layout)
  • template (true|false): Enable function to save content as template
  • parent: Parent XML-file (will be used to manipulate log entries)

Example:

<view basedir=".." name="variable" title="c_person_headline" parent="c_person_org" template="true">

rights

Controls the actions executed on the XML-file

  • read (true|false): view activities
  • write (true|false): write activities
  • delete (true|false): delete activities
<rights read="true" write="true" delete="true"/>

id

  • name: Identifier of the dataset. "md_metadata_id" should be used if available.
<id name="geodata.md_metadata_id"/>

group

  • name: Internal name of the group (g + number). The number defines also the order of display.
  • title: Group name (headline of group) replaced by translation id.
<group name="g0" title="geodata_g0"/>
<group name="g1" title="geodata_g1"/>
<group name="g2" title="geodata_g2"/>

map

The map-section describes if and how geometry information or displayed and linked to maps.

  • layer
    • id: Identification ID (should be equal to view -> id)
    • layer_type (station|map): type of given geometry (station = point; map = bounding box)
<layer id="dsstation.md_metadata_id" link_type="station"/>

At least there is one section necessary to describe in which columns the geometry is located and to add rules to which layer the dataset should be linked to (RBISmap)

  • layer
    • name: name of target layer (RBISmap)
    • title (station|map): not used
    • id: Identification ID (must equal to view -> id)
      • geometry:
        • type (point|bounding_box): Type of geometry
        • spat_ref_sys: Database field with SRID
          • source:
            • contains: Database field (part of geometry)
            • ref: Refers to part of geometry
      • metadata:
        • column
        • contains: Database field with datase name
      • conditions:
        • sql: SQL statement to define association rules

Example 1 (bounding box):

    <map>
        <layer id="geodata.md_metadata_id" link_type="map"/>
        <display_link title="geodata_display_link"/>
          <layer name="bounding_box" title="Teststation" id="dsstation.md_metadata_id">
            <geometry type="bbox" spat_ref_sys="map_srid.srid">
                <source contains="geobndbox.westbl" ref="west"/>
                <source contains="geobndbox.eastbl" ref="east"/>
                <source contains="geobndbox.southbl" ref="south"/>
                <source contains="geobndbox.northbl" ref="north"/>
            </geometry>
        </layer>        
    </map>

Example 2 (station coordinates with association rules):

    <map>
        <layer id="dsstation.md_metadata_id" link_type="station"/>
        <layer name="station_precip" title="Teststation" id="dsstation.md_metadata_id">
            <geometry type="point" spat_ref_sys="map_srid.srid">
                <source contains="dsstation.latutm" ref="lat"/>
                <source contains="dsstation.longutm" ref="long"/>
                <source sql=""/>
                <source file=""/>
            </geometry>
            <metadata>
                <column name="statname" contains="dsstation.statname"/>
                <column name="fp_featpar" sql="SELECT featpar FROM ds_otherpar left join fp_featpar ON ds_otherpar.fp_featpar_id=fp_featpar.fp_featpar_id WHERE dsstation_id = ".$result["dsstation.dsstation_id"].""/>
            </metadata>
            <conditions sql="dsstation.dsstation_id IN (SELECT dsstation_id FROM ds_otherpar WHERE dsstation_id = ".$result["dsstation.dsstation_id"]." and fp_featpar_id=12027014) "/>
        </layer>
    </map>

edit

  • title: Headline (e.g. Edit dataset:)
  • ref_id: Identifier (e.g. metadata.md_metadata_id)
  • change (true|false): Display link
  • change_view : Reference view for action.
  • change_ov (true|false): Display link in overview
  • change_title: Title replaced by translation id (e.g. Edit).
  • delete (true|false): Display link
  • delete_view : Reference view for action.
  • delete_ov (true|false): Display link in overview
  • delete_title: Title replaced by translation id (e.g. Delete).
  • add (true|false): Display link
  • add_view : Reference view for action.
  • add_ov (true|false): Display link in overview
  • add_title: Title replaced by translation id (e.g. Add).

Example 1:

<edit title="c_person_edit_title" 
ref_id="respparty.ci_respparty_id" 
change="true" 
change_ov="false" change_title="c_person_edit_change_title" delete="true" 
delete_ov="false" delete_title="c_person_edit_delete_title"/>

Example 2 (with "add" & reference view):

<edit title="adm_select_dropdown_edit_title"
ref_id="app_view_dropdown_ids.app_view_dropdown_ids_id" 
change="true" 
change_ov="false" 
change_title="adm_select_dropdown_edit_change_title" 
change_view="adm_select_dropdown_edit" 
delete="true" 
delete_ov="false" 
delete_title="adm_select_dropdown_edit_delete_title"
delete_view="adm_select_dropdown_edit" 
add="true" 
add_ov="false" 
add_title="adm_select_dropdown_edit_add_title"/>

document

Activate the possibility to add files to a dataset (only possible if the dataset has a global identifier (md_metadata_id))

  • title: not used (Title in old Layout)
  • ref_id: Identifier to associate Documents
  • ref_view_name: Reference view name if not identical with XML name

Example 1:

    <document title="geodata_document" ref_id="metadata.md_metadata_id"/>
 

Example 2 (XML only for search):

    <document title="station_search_document" ref_id="dsstation.md_metadata_id" ref_view_name="station_meta"/>
 

association

  • edit:
  • overview:

table

  • name: table name in the database
<table name="metadata">
  • cond: name of condition (if the name is not set in the config.php, the table will be ignored. The cond-attribute must be also set in the attribute and join element.)
config.php: $conditions["workgroup"] = 1;
<table name="fp_featpar_all2" cond="workgroup">

Example:

<table name="metadata">
</table>

attribute

  • cond: name of condition (if the name is not set in the config.php, the attribute will be ignored. The cond-attribute can/must be also set in the table and join element.)
<attribute cond="workgroup" name="featpar" title="geo.... />
  • pk
  • type
    • text: limited by the length given under size. Input field will be a text field or textarea according to the given maximal length.
    • email: input will be checked against the structure of an email adress.
    • float|integer: only checked by "is_numeric()"
    • date: dateformat is described under dateformat
    • timestamp: date is stored as UNIX-timestamp
    • bool: Boolean values; a selection list with "true/fals" will be created
    • serialized: content(array) is stored with "serialize()" and shown with "unserialized()" as array
    • password: md5 encryption
    • id: foreign key field
    • hidden: field is not displayed, but value is send
  • default: default value (text or ID)
  • dateformat: Dateformat ( e.g. "Y-m-d")
  • check:
  • multi_lang(true):multilingual field in the database
  • link_id: Specifies the ID used for the link
  • link_view: Specifies the target view
  • link_target: Define the target php-file. The default target is view.php
  • size: text field -> number for max length; selection field -> name of predefined list
  • sort:
  • depend_on:
  • depend_on_rule_table:
  • required:
  • update:
  • filter: true -> display selection list on overview column
  • group:
  • order:
  • overview:

example: Primaray key

example: Selection list

example: Date

example: Link

link_id="int_method_set.int_method_set_id" link_view="int_method_set_list" link_target="overview.php"

example: Dependency

<attribute name="unit" title="ts_timeseriesfeature_uomunits_all_unit" default="" type="text" size="measured_group" group="g0" order="3" update="dropdown" required="mandatory" overview="3" depend_on="fp_featpar_all.featpar" depend_on_rule_table="app_depend_featpar_uom"/>

join

  • cond: name of condition (if the name is not set in the config.php, the table will be ignored. The cond-attribute must be also set in the table and attribute element.)
<join cond="workgroup" from_table="geodata" ... />
Personal tools