wiki:CustomFormatting

Version 8 (modified by jesseeichar, 13 years ago) ( diff )

--

Custom Metadata Display

Date 2012/04/19
Contact(s) Jesse Eichar
Last edited
Status draft
Assigned to release 2.8
Resources R&D Camptocamp
Code https://github.com/camptocamp/geocat/compare/formatter
Ticket #875

Overview

Provide a service for viewing metadata documents with a custom XSL which is identified via the URL, instead of the normal Geonetwork metadata.show. In addition provide administration tools for managing the XSL files.

Proposal Type

  • Type: New Service
  • App: GeoNetwork
  • Module:

  • Email discussions:
  • IRC discussions:

Voting History

  • None as yet

Motivations

Certain Geonetwork installations are used by several districts for similar purposes but occasionally the districts would like the ability to have links to metadata documents that have custom formatting and branding. A service which can be used to format a metadata according to a custom XSL could be useful in the following use-cases:

  • Embed the metadata into other sites
  • Share metadata through some sort of distribution channel that should have a certain type of branding
  • provide a lightweight CSW based search client which displays the metadata with the custom/branded formatting

Proposal

Several new services would be added to the org.fao.geonet.services.metadata.format package:

  • Format - Obtain the metadata, localization files, etc... and execute the xsl transform.
    • Format will have two services mapped to it (html and xml), with respective content types
    • Format services will be accessible by all users
  • RegisterXsl - Service for uploading an xsl file or zip file, it will require admin access
  • DownloadXsl - Service for downloading the zip file containing the XSL and associated resources, it will require admin access
  • RemoveXsl - Service for deleting an xsl file and related resources, it will require admin access

There will be an Administration User interface for managing the Format bundles files. Using the Administration user interface the administrator (and only administrator) can upload either a single xsl file which is the formatter/transformer, or a zip file that contains a file called view.xsl and other resources required by the view.xsl.

The view.xsl will have the format (using the service metadata.formatter.xml?debug=true&id=<id>&xslid=<xslID> will show untransformed xml that can be used by transform):

/root
  / <metadata>
  / schemas
    ....
  / strings
    ....
  / url
  / viewURL
  / viewStrings

The schemas will have schema labels, codelists etc... (localised) and strings will be the normal localized strings as well.

If the uploaded zip file has a loc directory the files in loc/???/*.xml will be added to the xml under the viewStrings.

The viewURL will be a path for loading resources like images and css files.

Backwards Compatibility Issues

No compatibility issues

Risks

Nothing notable

Participants

  • As above
Note: See TracWiki for help on using the wiki.