HOWTO Add new catalog formats - GeoscienceAustralia/earthsci GitHub Wiki

This page describes how to add new catalog formats to add support for additional data sources.

  1. Create a new plugin with a suitable name
  2. Add dependencies to the following plugins (plus any others you may need):
  • au.gov.ga.earthsci.common
  • au.gov.ga.earthsci.core
  • au.gov.ga.earthsci.intent
  • au.gov.ga.earthsci.catalog
  1. If you need to define a custom content type for your catalog format, create a new extension using the extension point org.eclipse.core.contenttype.contentTypes.
  2. Create a new extension using the extension point au.gov.ga.earthsci.intent.filters. Create a new filter child element with a return-type child element of ICatalogTreeNode, and filtering according to your catalog format's content type and/or URI parts.
  3. Create an IIntentHandler implementation for handling the intent, and use that as the extension's filter element's class property.
  4. Create one or more ICatalogTreeNode implementations (usually they can extend AbstractCatalogTreeNode). These represent a catalog tree node read from your catalog format. These should be implementations of ILazyTreeNode if any loading or retrieval is required to load its children.
  5. Make your IIntentHandler implementation create one of these nodes and return it back to the callback object.

Directory catalog example

See the au.gov.ga.earthsci.catalog.directory plugin for an example implementation of the above instructions. This catalog searches a directory for any sub-directories or any files that could possibly be layers, and shows these results as children.

The intent filter doesn't use a content type, as the content type for directories is undefined. It instead filters on the URI, ensuring a scheme of "file" and a path of "*/" (any path that ends with a slash).

Also see the au.gov.ga.earthsci.catalog.dataset plugin for an example implementation that reads the catalog from an XML document, using the XML Intent Filter.