= Sub-templates = || '''Date''' || 2011/05/25 || || '''Contact(s)''' || Francois, Simon || || '''Last edited''' || || || '''Status''' || draft || || '''Assigned to release''' || 2.7.0 || || '''Resources''' || Available || || '''Ticket''' || #XYZ || == Overview == This proposal aims to provide the capability to handle sub-templates. Sub-templates are XML fragment of metadata records. Example for a point of contact in ISO19139: {{{ NAME Name of the responsible organization Function performed by the responsible party }}} Sub-templates are designed to be inserted into metadata records using 2 mode: * one time link with copy/paste action * permanent link with XLink. === Proposal Type === * '''Type''': Metadata * '''App''': !GeoNetwork * '''Module''': Admin, Editor === Links === * '''Documents''': * '''Email discussions''': * '''Other wiki discussions''': === Voting History === * Vote proposed by on , result was ---- == Proposal == Sub-templates are: * XML document * stored in the Metadata table with * value 's' for the template column (reminder: 'y' is for template, 'n' is for metadata) * 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) * schema is defined like metadata or template documents * indexed using Lucene identified by field _isTemplate='s' * imported through the metadata record import administration page ? * similar to metadata document for privileges management In the user interface, sub-templates are accessible through: * a sub-templates manager in the administration * a popup selection mechanism in the metadata editor (like CRS, Thesaurus) Types of sub-templates: * contact * ... extent ? === Manage sub-templates === A service is added to return the list of available sub-templates available. * getTypes method: return the list of available sub-templates available Sub-templates actions: * insert : Use the metadata insert form to create a sub-template * update/delete : Use the sub-template manager * search : Use any search services with _isTemplate='s' * privileges : Define privileges for the sub-template. === Using sub-templates in the editor === TODO : basically using similar popup like CRS or Thesaurus * full text search * select one or more elements * add (as XLink or using simple copy) * could this be generic ? * add selector according to the types available in the catalogue (using the _root info) ? === Questions: === * do we need more than full text indexing ? * should we use metadata import page to import sub template ? or a custom one ? * 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 ? * we always edit in advanced mode - at least non flat mode to provide all schema elements ? * Subtemplate model * we need a title for all types of subtemplate (to be display in search). Where/how to configure ? * Quid on extent ? using description which is not mandatory ? Future feature: * Capability to extract subtemplate from existing record (cf. ReusableObjectStrategy in geocat.ch)? === Backwards Compatibility Issues === None. === New libraries added === None. == Participants == * Francois Prunayre * Simon Pigot