Changes between Version 10 and Version 11 of proposals/SubTemplates


Ignore:
Timestamp:
Jun 3, 2011, 6:30:01 AM (13 years ago)
Author:
fxp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • proposals/SubTemplates

    v10 v11  
    1111== Overview ==
    1212
    13 This proposal aims to provide the capability to handle sub-templates. Sub-templates are XML fragment of metadata records.
    14 
    15 Example for a point of contact in ISO19139:
     13This proposal aims to provide the capability to handle sub-templates. Sub-templates are XML fragments of metadata records. A set of fragments compose a directory (ie. contact directory, extent directory).
     14
     15Sub-templates are designed to be inserted into existing metadata records using two modes:
     16 * copy/paste mode which insert once the fragment.
     17 * permanent link mode which insert an XLink to the fragment.
     18
     19The copy/pase mode allows user to add a fragment which could be modified after insertion. This mode provides default values or editing instructions which could be helpful to fill in the appropriate values (eg. a default quality report). It extends the suggestion mechanism which only expand element and does not provide sample values. It allows also to add a fragment with real value and change them.
     20
     21The XLink mode create a dynamic link between the metadata record and the fragment. Editor can't edit such a fragment from the editor. The sub-template manager should be used and the cache of XLinks cleared from the administration panel.
     22
     23
     24[[Image(sub-template-using-xlinks-disabled.png)]]
     25
     26
     27
     28=== Example ===
     29
     30
     31For example, a sub-template for a contact in ISO19139 standard is:
    1632{{{
    17 <?xml version="1.0" encoding="UTF-8"?>
    18 <gmd:pointOfContact xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gml="http://www.opengis.net/gml">
    19         <gmd:CI_ResponsibleParty>
     33        <gmd:CI_ResponsibleParty xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" >
    2034                <gmd:individualName>
    21                         <gco:CharacterString>NAME</gco:CharacterString>
     35                        <gco:CharacterString>Individual name</gco:CharacterString>
    2236                </gmd:individualName>
    2337                <gmd:organisationName>
     
    3145                </gmd:role>
    3246        </gmd:CI_ResponsibleParty>
    33 </gmd:pointOfContact>
    3447}}}
    3548
    36 Sub-templates are designed to be inserted into metadata records using 2 mode:
    37  * one time link with copy/paste action
    38  * permanent link with XLink.
    39 
    40 The copy/pase mode allows user to add a fragment which could be modified. This is useful because it provides default values or editing instructions which could be helpful to fill in the appropriate values (eg. a default quality report). It allows also to add a fragment with real value and change them.
    41 
    42 The XLink mode create a dynamic link between the metadata record and the fragment. Editor can't edit such a fragment from the editor. The sub-template manager should be used.
    4349
    4450
     
    6167== Proposal ==
    6268
     69=== Sub-template definition ===
    6370Sub-templates are:
    6471 * XML document
     72 * Based on an element which is a complexType of a schema (eg. gmd:CI_ResponsibleParty)
    6573 * stored in the Metadata table with
    6674  * value 's' for the template column (reminder: 'y' is for template, 'n' is for metadata)
    67   * root element is stored in the root column. It allows us to know the type of sub-templates (and where it could be inserted in an existing record)
    68   * schema is defined like metadata or template documents
    69  * indexed using Lucene identified by field _isTemplate='s'
    70  * imported through the metadata record import administration page ?
     75  * root element is stored in the root column. It allows us to know the type of sub-templates. This information is used to define where this element could be inserted.
     76  * schema is defined like metadata or template documents (only iso19139 supported for now)
     77 * indexed using Lucene
     78  * field _isTemplate='s'
     79  * field _root= root column
     80  * full text indexing for search
     81 * imported through the metadata record import administration or the directory manager page (TODO)
    7182 * similar to metadata document for privileges management
    7283
     84
     85=== User interface ===
     86
    7387In the user interface, sub-templates are accessible through:
    74  * a sub-templates manager in the administration
     88 * a directory manager in the administration
    7589 * a popup selection mechanism in the metadata editor (like CRS, Thesaurus)
    7690
    77 Types of sub-templates:
    78  * contact
    79  * ... extent ?
    80 
    81 === Manage sub-templates ===
    82 
    83 A service is added to return the list of available sub-templates available.
    84  * getTypes method: return the list of available sub-templates available
    85 
    86 Sub-templates actions:
    87  * insert : Use the metadata insert form to create a sub-template
    88  * update/delete : Use the sub-template manager
    89  * search : Use any search services with _isTemplate='s'
    90  * privileges : Define privileges for the sub-template.
     91
     92==== Manage sub-templates in the directory manager ====
     93
     94The directory manager is accessible to all editors. It is composed of 2 parts:
     95 * a search form to find sub-templates
     96 * an editor to edit sub-templates
     97
     98
     99The search form is composed of:
     100 * a list of type of directory (eg. contact, extent, keywords) (TODO : translate)
     101 * a full text criteria for search
     102
     103Sub-templates found are displayed in a grid where editors could select one.
     104Once selected, the current sub-template is open in the editor. Editors could click:
     105 * the duplicate button to create a copy
     106 * the delete button to delete it
     107 * the privileges button to set privileges.
     108
     109Privileges allows to share sub-template across a group of users. Therefore, the sub-template
     110needs to be publicly available for all while used through XLink mode.
    91111
    92112Sub-template could be edited in simple,advanced and XML mode.
     
    94114[[Image(sub-template-manager.png)]]
    95115
    96 === Using sub-templates in the editor ===
    97 
    98 TODO : basically using similar popup like CRS or Thesaurus
    99  * full text search
    100  * select one or more elements
    101  * add (as XLink or using simple copy)
    102  * could this be generic ?
    103   * add selector according to the types available in the catalogue (using the _root info) ?
     116
     117==== Using sub-templates in the editor ====
     118
     119From the editor, a new button is added to access the sub-template selector. The selector panel provides a similar interface like CRS or Thesaurus selector. Editors could:
     120 * search,
     121 * drag-and-drop the elements to add to the record
     122 * select the mode (copy/paste or linked)
     123 * add
     124
     125For some kind of sub-template, another option is available. In case of contact directory, editor could also select the role of the contact. This will override the role defined in the directory manager (a same contact could be a point of contact in a record and a distributor in another record).
     126
     127
     128[[Image(sub-template-selector.png)]]
     129
     130
     131=== Sub-template configuration ===
     132
     133In config-gui.xml, a mapping define for each type of sub-template the list of element where this type could be use. This is used then in the XSL to display or not an extra button to open the sub-template selector.
     134{{{
     135  <editor-subtemplate>
     136    <mapping>
     137      <subtemplate type="gmd:CI_ResponsibleParty">
     138        <type id="gmd:pointOfContact"/>
     139        <type id="gmd:userContactInfo"/>
     140        <type id="gmd:distributorContact"/>
     141        <type id="gmd:citedResponsibleParty"/>
     142        <type id="gmd:contact"/>
     143        <type id="gmd:source"/>
     144        <type id="gmd:processor"/>
     145        <type id="gmd:responsibleParty"/>
     146      </subtemplate>
     147      <subtemplate type="gmd:EX_Extent">
     148        <type id="gmd:extent"/>
     149      </subtemplate>
     150      <subtemplate type="gmd:MD_Keywords">
     151        <type id="gmd:descriptiveKeywords"/>
     152      </subtemplate>
     153      <subtemplate type="gmd:DQ_FormatConsistency">
     154        <type id="gmd:report"/>
     155      </subtemplate>
     156    </mapping>
     157  </editor-subtemplate>
     158}}}
     159
     160In order to have some information when searching for sub-template, a brief mode has been added for sub-templates.
     161This brief mode defines at least a title.
     162This is defined in schema present XSL. Example for contact :
     163{{{
     164<xsl:template mode="iso19139-subtemplate" match="gmd:CI_ResponsibleParty">
     165    <xsl:variable name="langId">
     166      <xsl:call-template name="getLangId">
     167        <xsl:with-param name="langGui" select="/root/gui/language"/>
     168        <xsl:with-param name="md" select="."/>
     169      </xsl:call-template>
     170    </xsl:variable>
     171    <title>
     172      <xsl:apply-templates mode="localised" select="gmd:organisationName">
     173        <xsl:with-param name="langId" select="$langId"></xsl:with-param>
     174      </xsl:apply-templates> -
     175      <xsl:apply-templates mode="localised" select="gmd:individualName">
     176        <xsl:with-param name="langId" select="$langId"></xsl:with-param>
     177      </xsl:apply-templates>
     178    </title>
     179  </xsl:template>
     180}}}
     181
     182
     183=== Sub-template services ===
     184
     185A new package is added : org.fao.geonet.services.subtemplate.
     186
     1872 services are added:
     188 * "subtemplate.type" to return the list of available sub-templates available.
     189 * "subtemplate" to return a subtemplate
     190  * Sub template are all public - no privileges check. Parameter "uuid" is mandatory.
     191  * One or more "process" parameters could be added in order to alter the template extracted. This parameter is composed of one XPath expression pointing to a single {@link Element} or {@link Attribute} and a text value separated by "{@value #SEPARATOR}". For example, to return a contact template with a custom role use "&process=gmd:role/gmd:CI_RoleCode/@codeListValue~updatedRole".
     192
     193
     194=== TODO ===
     195 * load codelist in sub-template selector
     196 * translate sub-template type in directory manager
    104197
    105198=== Questions: ===
    106199
    107200 * Sub template for simple element ? eg. gmd:abstract
    108  * not supporting XLinks
    109  * Model
    110   * Root element :
    111    * how-to manage same types ? eg. gmd:pointOfContact, gmd:contact, gmd:citedResponsibleParty, gmd:distributorContact elements are all gmd:CI_ResponsibleParty. Root element is not enough to be able to decide where a sub-template could be inserted. For the contact gmd:CI_ResponsibleParty would be a better type identifier.
    112    * qualifiedName in the root column : maybe namespace is better ?
     201 * not supporting XLinks in subtemplates. eg. organisation in contacts
    113202 * Search
    114   * Index
    115    * do we need more than full text indexing ?
    116   * BriefFormat : defined in metadata-iso19139 using a subtemplate XSL mode
    117    * for extent, how to define a title ? using description which is not mandatory ?
    118  * Editor
    119   * When adding a contact as sub-template, editor want to set his role (which could be different according to the record) ? How to set this as a parameter to the sub-template ?
     203  * Index: do we need more than full text indexing ?
     204  * BriefFormat : for extent, how to define a title ? using description which is not mandatory ?
    120205 * Manage
    121206  * should we use metadata import page to import sub template ? or a custom one ?
    122207  * how to autodetect schema for templates ? - maybe we need a specific import page to set schema value. or if user set subtemplate for the type, then schema is mandatory ?
    123208  * deleting a subtemplate and lost XLinks - how to manage ?
    124   * privileges:
    125    * using a not public subtemplate in a public record. All sub template must be public (to be accessible by XLink resolver at least) ? A new service is added to directly retrieve the sub template in the metadata table
    126    * but privileges could be set for each group, to define their visibility ? in the privileges, internet is not accessible.
    127 
    128 Future feature:
     209  * privileges: to be tested
     210
     211=== Future improvements ===
     212
     213Here is a list of tasks not adressed in that proposal which could be plan for later:
    129214 * Capability to extract subtemplate from existing record (cf. ReusableObjectStrategy in geocat.ch)?
    130  * Multilingual subtemplate?
     215 * Multilingual subtemplate
    131216
    132217=== Backwards Compatibility Issues ===