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.
- Create a new plugin with a suitable name
- 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
- 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
. - Create a new extension using the extension point
au.gov.ga.earthsci.intent.filters
. Create a newfilter
child element with areturn-type
child element ofICatalogTreeNode
, and filtering according to your catalog format's content type and/or URI parts. - Create an
IIntentHandler
implementation for handling the intent, and use that as the extension's filter element's class property. - Create one or more
ICatalogTreeNode
implementations (usually they can extendAbstractCatalogTreeNode
). These represent a catalog tree node read from your catalog format. These should be implementations ofILazyTreeNode
if any loading or retrieval is required to load its children. - 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.