wiki:WikiMarkupInMetadata

Extended Regions

Date 2012/09/14
Contact(s) Jesse Eichar
Last edited
Status Ongoing
Assigned to release 2.9.x
Resources Ifremer
Code https://github.com/jesseeichar/core-geonetwork/compare/master...feature;wiki-editing
Ticket #1163

Overview

Provide an option to enable wiki-markup text in a selected set of metadata elements.

Proposal Type

  • Type: Improvement
  • App: Geonetwork
  • Module: Web

  • Email discussions:
  • IRC discussions:
  • Related work:

Voting History

  • None as yet

Proposal

Add new setting for configuring which type of Markup to support for the installation. By default it will be none (no wiki syntax supported) but the administrator can select one of the options enabling the feature.

Once a markup type is selected then certain elements in metadata will have the element parsed by the markup parser before display. To assist the user, the editors (both old and new) will have a help tip explaining which markup is used and will provide a link to a webpage containing the syntax explanation. In the old UI the element will have a new icon beside the other element buttons (up, down, delete, add) which will show a tool tip when clicked on. The tip will contain the message and link. This give a visual clue that the element can contain markup. In the new edit UI, the tip will be in the Help panel below the other help tips for the element.

To control the fields that can have markup, a new file has been added to each schema's present xsl files and has to be imported by both the profile's metadata.xsl and metadata-view.xsl files. The new file: metadata-markup.xsl contains a template of the "permitMarkup" mode which must return true() for each element that can have markup. For iso19139 the default elements that support markup are: gmd:abstract, gmd:description, gmd:statement, gmd:purpose, gmd:supplementalInformation. In addition to the permitMarkup templates, the dumpFields configuration also has a new attribute markup which (if true) indicate that the element may contain markedup text and there for should be processed before dumping the element.

The library used for parsing markup is the org.eclipse.mylyn.wikitext library. In this library each markup language is a single strategy object that implements the MarkupLanguage interface. Several implementation are provided by the library: Confluence, Mediawiki, Textile, Trac Wiki and TWiki. At the moment it is possible to choose one of these solutions through the administration configuration interface.

Since support for a new Syntax only requires implementing a single class it is extremely easy to add a new syntax to Geonetwork. The steps for adding a new Wiki syntax are:

  • implement a new MarkupLanguage implementation
  • Edit config.xsl (the xsl for displaying the configuration page) and add a option to the wiki syntax select html element. As you will see all that is required is adding a label and the value is the package and class name of you class.
  • Edit the config.xml translation files to contain the label shown in the configuration page.

For this request several services have been updated to support wiki syntax. The main change was in the text-utilities.xsl file so that it checks to see if wiki syntax is enabled. If yes then the text will be parsed. The updated services are:

  • q
  • metadata.search
  • metadata.search.embeded
  • metadata.show
  • metadata.show.embedded
  • metadata.edit
  • metadata.edit.embedded

For controlling the output of the services there are two configuration parameters:

  • server/wiki/output - controls if wiki markup should be stripped from the metadata when the metadata is exported as raw XML
  • server/wiki/mefoutput - controls if wiki markup should be stripped from the metadata when the metadata is exported as mef files

Each of these parameters allows the markup to be stripped, kept or processed to html before exporting the metadata.

As an extra note the server/wiki/output configuration parameter also controls if harvested metadata will have the markup.

Backwards Compatibility Issues

none

Risks

Participants

  • As above
Last modified 11 years ago Last modified on Nov 29, 2012, 2:02:02 AM
Note: See TracWiki for help on using the wiki.