Developer's Guide
Accessor Development Kit (ADK) Guide
This guide is intended to help a developer to extend the GI-cat architecture with a new customized accessor.
For example if you have metadata stored on a custom database and wish to make it available through GI-cat.
The ADK is a package (jar) that contains the core classes and interfaces on which all other accessors are based. Specific accessors (e.g. WMS, WFS, ...) are in fact subclass of the abstract class
"Accessor" that is included in the ADK.
The rules
The rules to implement a new accessor are:
- Create the new accessor class by extending the class "Accessor"
- Put in the classpath a file called conf/accessorBindings.properties. This file will contain a string like the following: [New accessor type]=[New accessor class qualified name], needed to support the pluggable extension system and put the new accessor in the system (e.g. the WMS accessor: WMS=it.cnr.imaa.essi.sdi.accessor.WMSAccessor).
- Implement the Accessor interfaces (see below).
The new accessor may
implement the Java interfaces (a more detailed description can be found
in this document) :
- IDiscovery to discover resources metadata, either by means of catalog browsing or through a query operation.
- IAccess to get binary datablock associated to a resource or a resource preview.
- ISession to abort a running query or to get feedback on a query status.
Discovery interface operations
| GetResource | Retrieve the resource with the given id |
| GetRootResource | Retrieve the catalog root resource |
| GetContent | Browse the children resources of a resource |
| Query | To perform a query on the catalog |
Access interface operations
| GetAccessParameters | Retrieve the XForms fields needed by GI-cat to access a given resource |
| GetDataURL | Gets the URL to use for subsequent data access |
| GetData | Gets the binary data block associated to a resource |
| GetPreview | Gets a preview of the given resource |
Session interface operations
| Close/Cancel | To terminate a previous query operation |
| Status | To retrieve feedback on a previous request |
Step-by-step example
This section will guide you in the creation and integration of a new customized accessor into GI-cat.
To create the new accessor, you must implement the corresponding class following the above rules. Here we provide an
exampleAccessor implementation to be taken as an example during the development. This accessor discovers a single example resource and gives a sample preview.
Install GI-cat
Install the latest stable version of GI-cat with the automatic package installer. Download it from the
download page
Since now on we will refer to GI-cat installation directory as to [GI-cat HomeDir]
Compile the new Accessor
After installing GI-cat and implementing your customized accessor, you
will have to compile the new classess, create a jar with the new
package and add it to the GI-cat classpath. Then the automatic plugin
mechanism will recognize the accessor in the framework.
To understand the necessary steps try first to integrate this example
accessor. Download the
exampleAccessor package?. Unzip, the file and copy the directory (with all of its content) to the GI-cat lib directory . An "exampleAccessor" directory will be created and inside of it the sources of the new accessor are present.
Go to the GI-cat lib directory
$ cd [GI-cat HomeDir]/webapps/gi-cat-[version]/WEB-INF/lib/
run the following command (Linux, Mac OS X; if you use a Windows system replace the ":" with ";") (This requires to have Java v.1.6 last update pre installed on your system)
$ javac -classpath FastInfoset-1.2.3.jar:XmlSchema-1.4.5.jar:activation-1.1.jar:ant-1.7.0.jar:ant-launcher-1.7.0.jar:antlr-2.7.6.jar:aopalliance-1.0.jar:asm-2.2.3.jar:axiom-api-1.2.7.jar:axiom-impl-1.2.7.jar:axis2-1.4.jar:backport-util-concurrent-3.1.jar:bcel-5.1.jar:bcprov-jdk15-140.jar:commons-beanutils-1.7.0.jar:commons-beanutils-core-1.8.0.jar:commons-codec-1.2.jar:commons-collections-3.2.1.jar:commons-configuration-1.6.jar:commons-digester-1.8.jar:commons-discovery-0.2.jar:commons-httpclient-3.1.jar:commons-lang-2.4.jar:commons-logging-1.0.4.jar:commons-pool-1.2.jar:cxf-api-2.2.1.jar:cxf-common-schemas-2.2.1.jar:cxf-common-utilities-2.2.1.jar:cxf-rt-bindings-soap-2.2.1.jar:cxf-rt-bindings-xml-2.2.1.jar:cxf-rt-core-2.2.1.jar:cxf-rt-databinding-jaxb-2.2.1.jar:cxf-rt-frontend-jaxws-2.2.1.jar:cxf-rt-frontend-simple-2.2.1.jar:cxf-rt-transports-http-2.2.1.jar:cxf-rt-ws-addr-2.2.1.jar:cxf-rt-ws-security-2.2.1.jar:cxf-tools-common-2.2.1.jar:dom4j-1.6.1.jar:exist-1.2.jar:exist-modules-1.2.jar:ezmorph-1.0.6.jar:filter-v_1_0_0-schema-1.0.0.jar:geoapi-2.3-M1.jar:geoapi-pending-2.3-M1.jar:geronimo-activation_1.1_spec-1.0.2.jar:geronimo-annotation_1.0_spec-1.1.1.jar:geronimo-javamail_1.4_spec-1.6.jar:geronimo-jaxws_2.1_spec-1.0.jar:geronimo-stax-api_1.0_spec-1.0.1.jar:geronimo-ws-metadata_2.0_spec-1.1.2.jar:gml-v_2_1_2-schema-1.0.0.jar:gml-v_3_1_1-schema-0.1.jar:gt-api-2.6.0.jar:gt-main-2.6.0.jar:gt-metadata-2.6.0.jar:gt-referencing-2.6.0.jar:jaxb-api-2.1.jar:jaxb-impl-2.1.9.jar:jaxen-1.1.1.jar:jcl-over-slf4j-1.5.8.jar:jdom-1.0.jar:jgroups-all-2.2.9.1.jar:json-lib-2.2.3-jdk15.jar:jsr-275-1.0-beta-2.jar:jsyntaxpane-0.9.5-b29.jar:jta-1.0.1B.jar:jts-1.10.jar:lablib-jaxb-1.2.8.jar:lablib-nxd-1.2.3.jar:lablib-opensearch-1.0.jar:lablib-publisher-server-1.0.3.jar:lablib-utils-2.6.jar:lablib-xforms-2.1.5.jar:lablib-xml-1.5.jar:log4j-1.2.14.jar:mail-1.4.1.jar:neethi-2.0.4.jar:ogc-csw-2.0.2-2.0.1.jar:ogc-csw-2.0.2-apiso-1.0.0-2.0.1.jar:ogc-csw-2.0.2-ebrim-1.0-2.0.1.jar:ogc-filter-1.1.0-2.0.1.jar:ogc-gml-3.2.0-2.0.1.jar:ogc-org-purl-dc-1-2.0.1.jar:ogc-ows-1.0.0-1.1.0.jar:ogc-ows-1.1.0-1.1.3.jar:ogc-services-2.0.jar:ogc-wcs-1.1.0-1.0.3.jar:ows-v_1_0_0-schema-1.0.0.jar:quartz-1.5.1.jar:regexp-1.3.jar:saaj-api-1.3.jar:saaj-impl-1.3.2.jar:saxon-8.7.jar:saxon-dom-8.7.jar:sdi-accessor-cdi-2.1.5.jar:sdi-accessor-cswcore-2.1.5.jar:sdi-accessor-cswebrim-2.1.5.jar:sdi-accessor-cswebrim-cim-2.1.5.jar:sdi-accessor-cswebrim-eo-2.1.5.jar:sdi-accessor-cswiso-2.1.5.jar:sdi-accessor-download-2.1.5.jar:sdi-accessor-gbif-2.1.5.jar:sdi-accessor-gi-cat-2.1.5.jar:sdi-accessor-nxd-2.1.5.jar:sdi-accessor-opensearch-2.1.5.jar:sdi-accessor-thredds-2.1.5.jar:sdi-accessor-wcs-2.1.5.jar:sdi-accessor-wfs-2.1.5.jar:sdi-accessor-wms-2.1.5.jar:sdi-adk-4.0.4.jar:sdi-atom-rss-mapper-4.0.4.jar:sdi-chain-4.0.4.jar:sdi-core-mapper-4.0.4.jar:sdi-datamodel_6-4.0.4.jar:sdi-dclite4g-mapper-4.0.4.jar:sdi-eo-cim-mapper-4.0.4.jar:sdi-messages_6-4.0.4.jar:sdi-profiler-cswcore-1.1.7.jar:sdi-profiler-cswebrim-1.1.7.jar:sdi-profiler-cswebrim-cim-1.1.7.jar:sdi-profiler-cswebrim-eo-1.1.7.jar:sdi-profiler-cswiso-1.1.7.jar:sdi-profiler-genesi-dr-1.1.7.jar:sdi-profiler-gi-cat-1.1.7.jar:serializer-2.7.1.jar:slf4j-api-1.5.8.jar:slf4j-log4j12-1.5.8.jar:spring-beans-2.5.5.jar:spring-context-2.5.5.jar:spring-core-2.5.5.jar:spring-web-2.5.5.jar:stax-api-1.0-2.jar:sunxacml-1.2.jar:thredds-datamodel-1.0.2-1.2.jar:vecmath-1.3.2.jar:wcs-1.1.0-response-reader-1.0.5.jar:wcs-v_1_0_0-schema-0.1.jar:wfs-v_1_0_0-schema-1.0.0.jar:woden-api-1.0M8.jar:wsdl4j-1.6.1.jar:wss4j-1.5.7.jar:wstx-asl-3.2.8.jar:xalan-2.7.1.jar:xercesImpl-2.6.2.jar:xml-apis-1.3.04.jar:xml-resolver-1.2.jar:xmlParserAPIs-2.6.2.jar:xmldb-api-1.4.2.jar:xmlrpc-1.2-b1.jar:xmlsec-1.4.2.jar:xom-1.1.jar exampleAccessor/it/cnr/imaa/essi/sdi/accessor/ExampleAccessor.java
At this point you should have compiled your custom accessor.
Create a JAR with the new Accessor package
Enter the exampleAccessor directory
$ cd [GI-cat HomeDir]/webapps/gi-cat-[version]/WEB-INF/lib/exampleAccessor
Run the following command (you must have administrator permission)
$ jar cvf exampleAccessor.jar *
You should have the
exampleAccessor.jar file in the current directory ([GI-cat HomeDir]/webapps/gi-cat-[version]/WEB-INF/lib/exampleAccessor)
Add the JAR to GI-cat classpath
Copy the created jar to the GI-cat lib directory (you must have administrator permission)
$ cp exampleAccessor.jar ../
Now, you can re-start GI-cat.
Test the Example Accessor
To check you have correctly plugged the new accessor, configure GI-cat adding a new resource of type
EXAMPLE
Open
GI-conf and press the
Edit federated resources button
To add a new resource press the
Add button
Source Code
If you are interested in the source code or want let us know about your custom accessor, please
contact us. You are encouraged to provide some information/background of your project (we like to know developers who are interested in GI-cat and perhaps having their achievements listed under the
success stories section!).