Difference between revisions of "Temple"

(Editing template and templateAssociation)
Line 7: Line 7:
 
temple will be opened for demo1- project. If opened from ART, the template being viewed is opened. Temple is not an Orbeon XForms application, but eXist + HTML. This means that you need to be logged in to eXist to use Temple. Temple (or more correctly, your browser) may ask credentials when opening Temple.
 
temple will be opened for demo1- project. If opened from ART, the template being viewed is opened. Temple is not an Orbeon XForms application, but eXist + HTML. This means that you need to be logged in to eXist to use Temple. Temple (or more correctly, your browser) may ask credentials when opening Temple.
  
==Editing template and templateAssociation==
+
==The code editor==
 
When opening a template, the corresponding templateAssociation is automatically retrieved. If it does not exist, it is created in Temple (though not saved yet). The attributes @templateId and @effectiveDate are not shown on templateAssociation. On saving, Temple will copy them from the template. (If you add them manually, they will be overwritten on save.)
 
When opening a template, the corresponding templateAssociation is automatically retrieved. If it does not exist, it is created in Temple (though not saved yet). The attributes @templateId and @effectiveDate are not shown on templateAssociation. On saving, Temple will copy them from the template. (If you add them manually, they will be overwritten on save.)
  
Line 23: Line 23:
 
* If templateAssociation does not exist, it is created (maybe empty, if no concepts are provided).
 
* If templateAssociation does not exist, it is created (maybe empty, if no concepts are provided).
  
When saving, Temple will validate against the DECOR schema. If there are errors, those will be displayed. In most modern browsers, hitting the back button will take you back to the template to fix those. If the template is valid, after saving you will stay on the edited template page, thus allowing to Save and continue working. Only when creating a template with @id='new', you will be redirected to an empty page, and will havev to navigate to the new template from ART (where you might need to refresh the page you were on).
+
When saving, Temple will validate against the DECOR schema. If there are errors, those will be displayed. This will land you on an error page, so go back in the browser to edit further. It's also possible to validatte without saving. If the template is valid, after saving you will stay on the edited template page, thus allowing to Save and continue working. Only when creating a template with @id='new', you will be redirected to an empty page, and will have to navigate to the new template from ART (where you might need to refresh the page you were on).
  
 
Temple will add names to:
 
Temple will add names to:
Line 31: Line 31:
 
* @valueSet
 
* @valueSet
 
when those are referenced by id. The names are discarded again when saving.
 
when those are referenced by id. The names are discarded again when saving.
 +
==The inspector==
 +
When the cursor is in on any construct containing the name or id of a template, a valueSet or concept, press Ctrl-S to inspect it. Temple will look for an effectiveDate or flexibility on the same line of code and use that, and else will use 'dynamic'. For instance, put the cursor inside the id in:
 +
 +
  <element name="hl7:id" datatype="II.NL.BSN" id="2.16.840.1.113883.3.1937.99.62.3.11.7.1">
 +
 +
and press Ctrl-S to inspect the referenced concept(s). Within the inspector one can also inspect further, for instance to inspect the parent of a concept or an included template.

Revision as of 10:08, 4 September 2015

Temple is an XML-based editor for templates. Temple is fast and well suited for those who are confomfortable with the template XML syntax. Temple is aware of names and id's of concepts, valueSets and templates and supports autocompletion of those. Temple has a built-in inspector (Ctrl+S) to quickly inspect references.

Starting Temple

Temple may be opened from the template viewer in ART, with the 'Temple' button, or directly. In the latter case, an editor with just some boilerplate template in it is opened. If opened from a browser with:

 {hostname}/temple/modules/temple.xquery?prefix=demo1-&language=nl-NL&mode=edit

temple will be opened for demo1- project. If opened from ART, the template being viewed is opened. Temple is not an Orbeon XForms application, but eXist + HTML. This means that you need to be logged in to eXist to use Temple. Temple (or more correctly, your browser) may ask credentials when opening Temple.

The code editor

When opening a template, the corresponding templateAssociation is automatically retrieved. If it does not exist, it is created in Temple (though not saved yet). The attributes @templateId and @effectiveDate are not shown on templateAssociation. On saving, Temple will copy them from the template. (If you add them manually, they will be overwritten on save.)

If you need a new template/@id, simply type in 'new', and Temple will create a legal template/@id when saving:

<template id="new"

You can (manually) enter a new @effectiveDate, or choose from the drop-down. In the drop-down, 'now' translates to the time Temple was opened (i.e. "2014-01-21T13:16:08") and 'today' translates to the start of today (i.e. "2014-01-21T00:00:00").

The following rules apply when saving a template:

  • If @id and @effectiveDate exist, template and templateAssociation are overwritten.
  • If @id exists, and @effectiveDate not, a new template is created (in effect, a new version of the template).
  • If @id = 'new', a new template is created. An @effectiveDate must be supplied by the user.
  • If templateAssociation does not exist, it is created (maybe empty, if no concepts are provided).

When saving, Temple will validate against the DECOR schema. If there are errors, those will be displayed. This will land you on an error page, so go back in the browser to edit further. It's also possible to validatte without saving. If the template is valid, after saving you will stay on the edited template page, thus allowing to Save and continue working. Only when creating a template with @id='new', you will be redirected to an empty page, and will have to navigate to the new template from ART (where you might need to refresh the page you were on).

Temple will add names to:

  • templateAssociation/concept/@ref
  • include/@ref
  • @contains
  • @valueSet

when those are referenced by id. The names are discarded again when saving.

The inspector

When the cursor is in on any construct containing the name or id of a template, a valueSet or concept, press Ctrl-S to inspect it. Temple will look for an effectiveDate or flexibility on the same line of code and use that, and else will use 'dynamic'. For instance, put the cursor inside the id in:

 <element name="hl7:id" datatype="II.NL.BSN" id="2.16.840.1.113883.3.1937.99.62.3.11.7.1">

and press Ctrl-S to inspect the referenced concept(s). Within the inspector one can also inspect further, for instance to inspect the parent of a concept or an included template.