Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

Documentation ediarum.jar (english)

Stefan Dumont edited this page Dec 17, 2013 · 14 revisions

This page documents the Java operations which are offered by the Java archive "ediarum.jar" and which extend the functionalities avaible in Oxygen XML for frameworks. The file ediarum.jar is part of the software solution "ediarum" which is a package of three different combinable software solutions and technologies: eXistdb, Oxygen XML Author and ConTeXt. The package and multiple extensions - not the software himself - are developed by TELOTA - an iniatitve for the "Digital Humanities" at the Berlin-Brandenburg Academy of Sciences and Humanities. Read the project description for more information.

Installation

The file ediarum.jar offers additionals Java operations for the use in an Oxygen XML framework. If you would like to only use these functions you just have to download the file ediarum.jar and store it into your framework. Then you have to reference to this JAR file in your Oxygen framework definition in the tab "Classpath". After this you will find the additional Java operations in the list when creating or editing an action.

For people, who are able to read german texts, there is a step-by-step tutorial "Implementing index functions in Oxygen XML Frameworks" on digiversity.

Index functions

Functions for inserting references from an xml file to a central index file.

Insert Register Operation

org.bbaw.telota.ediarum.InsertRegisterOperation

Opens a dialogue where the user can select an entry from an index. Inserts then an XML element (including an attribut like xml:id) at the position of the caret or around the selection.

Parameter Description
URL URL of the central index xml file, e.g.: http://user:passwort@example.edu/persons.xml
node XPath expression to the selectable elements, e.g.: //person
expression The phrase displayed in the select list (strings are noted in "", attributes start with @, elements with /, kindelements with // and XPath expressions with .), e.g.: /name+", "+/firstname+" "+/biography
element The element to be inserted in the xml document, e.g.: "<persName xmlns='http://www.tei-c.org/ns/1.0' key='" + @id + "' />"

Insert Register At Operation

org.bbaw.telota.ediarum.InsertRegisterAtOperation

Opens a dialogue where the user can select an entry from an index. An xml element with the corresponding ID will be inserted at the location defined by an XPath.

Parameter Description
URL URL of the central index xml file, e.g.: http://user:passwort@example.edu/persons.xml
node XPath expression to the selectable elements, e.g.: //person
expression The phrase displayed in the select list (strings are noted in "", attributes start with @, elements with /, kindelements with // and XPath expressions with .), e.g.: /name+", "+/firstname+" "+/biography
element The element to be inserted in the xml document, e.g.: "<persName xmlns='http://www.tei-c.org/ns/1.0' key='" + @id + "' />"
insertLocation An XPath expression indicating the insert location for the fragment.
insertPosition The insert position relative to the node determined by the XPath expression. Can be: Before, Inside as first child, Inside as last child or After.
schemaAware Controlling if the insertion is schema aware or not.

Insert Register Attribute Operation

org.bbaw.telota.ediarum.InsertRegisterAttributeOperation

Opens a dialogue where the user can select an entry from an index. This operation inserts an attribute with ID corresponding to the selected index entry in the xml element defined via XPath.

Parameter Description
URL URL of the central index xml file, e.g.: http://user:passwort@example.edu/persons.xml
node XPath expression to the selectable elements, e.g.: //person
expression The phrase displayed in the select list (strings are noted in "", attributes start with @, elements with /, kindelements with // and XPath expressions with .), e.g.: /name+", "+/firstname+" "+/biography
attribute name The name of the attribute to be inserted, e.g.: key
attribute value Value of this attribute, e.g.: "someText" + @id
xpath to element of the attribute A relative XPath expression to the element, starting at the current selected text, e.g.: ./child

Insert Index Operation

org.bbaw.telota.ediarum.InsertIndexOperation

Opens a dialogue where the user can select an entry from an index. This operation inserts one or more element(s) with corresponding ID around selected text area. Thats not like the "SurroundWith"-Operation which comes (out-of-the-box) with Oxygen XML Editor. With this operation, it is possible to surround an text area with two different XML elements, which have an additional ID - beside the ID from the index entry - to reference to each other. Example:

<index spanTo="#gfq_j3f_ng" indexName="places" corresp="#p12345">
<term>Name of index entry</term></index> Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam<anchor type="indexedarea" xml:id="gfq_j3f_ng"/>
Parameter Description
URL URL of the central index xml file, e.g.: http://user:passwort@example.edu/places.xml
node XPath expression to the selectable elements, e.g.: //place
expression The phrase displayed in the select list (strings are noted in "", attributes start with @, elements with /, kindelements with // and XPath expressions with .), e.g.: /name+", "+/country+" "+/shortdescription
id ID of elements in the XML document to reference to each other (Note that ist not the ID of the index entry!)
element The element to be inserted in the xml document at the [SELECTION], e.g.: "<index xmlns='http://www.tei-c.org/ns/1.0' spanTo='$[ID]' indexName='places' corresp='" + @id + "'><term xmlns='http://www.tei-c.org/ns/1.0'>" + /name + "</term></index>$[SELECTION]<anchor xmlns='http://www.tei-c.org/ns/1.0' xml:id='$[ID]' />"

Insert Link Operation

org.bbaw.telota.ediarum.InsertLinkOperation

Opens a dialogue that displays the possible link targets in the currently in Oxygen XML opened XML files. Inserts a XML element with an corresponding filepath and ID.

Parameter Description
root Path to database, etwa: /exist/webdav/db/data/
xpath XPath expression to the XML element that will be linked, e.g.: //anchor
id-attribute Name of the attribute of the linked element, that carries the ID, e.g.: xml:id
id start prefix Prefix of the ID of the start element that will be linked, e.g.: start_
id stop prefix Prefix of the ID of the end element that will be linked, e.g.: stop_
element The element that will be inserted; the variables $FILEPATH, $FILE_ID, $STARTPREFIX, $STOPPREFIX, $ID can be used, e.g.:
altern. element The element that will be inserte if the target ist a whole file; the variables $FILEPATH, $FILE_ID can be used, e.g.: <ref xmlns='http://www.tei-c.org/ns/1.0' target='$FILEPATH'/>

Surround With Elements Operation

org.bbaw.telota.ediarum.SurroundWithElementsOperation

Inserts before and after the selection differents elements in the XML document.

Parameter Description
id ID that will be used multiple times in the inserted elements
elements The elements before and after the $[SELECTION]; the ID will bei inserted with the variable $[ID] eingefügt

Multiple Actions Operation

org.bbaw.telota.ediarum.MultipleActionsOperation

Defines multiple actions, which will be executed automatically one after another.

Parameter Description
first action action-ID of the first action
second action action-ID of the second action
third action action-ID of the third action
fourth action action-ID of the fourth action
fifth action action-ID of the fifth action

Execute Command

org.bbaw.telota.ediarum.ExecuteCommandOperation

Execute an external program.

Parameter Description
Command Command that will be executed

Open URL Operation

org.bbaw.telota.ediarum.OpenURLOperation

Opens a file in an external program (with the system standard program for this type of file)

Parameter Description
URL URL of the file

Credits

Developed by Martin Fechner, Berlin-Brandenburg Academy of Sciences and Humanities