Quick Start

DDF in 5 Minutes

This quick tutorial will demonstrate:

  • Installation
  • Catalog Capabilities: Ingest and query using every endpoint
  • Use of the Content Framework
  • Metrics Reporting

Installation

  • Install

    DDF

     by unzipping the zip file (this installation directory will henceforth be called DISTRIBUTION_INSTALL_DIR)
  • Start

    DDF

     by running the <DISTRIBUTION_INSTALL_DIR>/bin/ddf script (or ddf.bat on Windows)
  • Verify distribution is up by:
    • executing list command in command line console - all bundles should be Active (or Resolved for fragments)
    • go to http://localhost:8181/services and verify 3 REST services are available: metrics, catalog, and catalog/query

      From this services URL, click on the links to each REST service's WADL to see its interface.

      Default Catalog

      The embedded Solr Catalog Provider is installed by default out-of-the-box as of

      DDF

      2.2.0+.

      Currently all services/endpoints in

      DDF

      are REST-based. There are no SOAP endpoints.

  • In Web Admin Console at http://localhost:8181/system/console/configMgr (username:admin password:admin) configure the System Settings:
    • select Platform Global Configuration
    • enter the host and port of where distribution is running

Catalog Capabilities

  • Create an entry in the Catalog by ingesting a valid GeoJson file (attached to this page).

    This ingest can be done using:

    • a REST client, such as Google Chrome's Advanced REST Client
      OR
      by using the following curl command to POST to the Catalog REST CRUD endpoint

      Windows Example
      curl.exe -H "Content-type: application/json;id=geojson" -i -X POST -d @"C:\path\to\geojson_valid.json" http://localhost:8181/services/catalog
      *NIX Example
      curl -H "Content-type: application/json;id=geojson" -i -X POST -d @geojson_valid.json http://localhost:8181/services/catalog

      where: 

      -H adds a HTTP header. In this case Content-type header application/json;id=geojson is added to match the data being sent in the request

      -i requests that HTTP headers are displayed in the response

      -X specifies the type of HTTP operation. For this example, it is necessary to POST (ingest) data to the server.

      -d specifies the data sent in the POST request. The @ character is necessary to specify that the data is a file.

      The last parameter is the server's URL to send the data to.

      This should return a response similar to the following (the actual catalog ID in the id and Location URL fields will be different):

      Sample Response
      HTTP/1.1 201 Created
      Content-Length: 0
      Date: Mon, 22 Apr 2013 22:02:22 GMT
      id: 44dc84da101c4f9d9f751e38d9c4d97b
      Location: http://localhost:8181/services/catalog/44dc84da101c4f9d9f751e38d9c4d97b
      Server: Jetty(7.5.4.v20111024)
  • Verify the entry was successfully ingested by entering in a browser the URL returned in the POST response's HTTP header. For instance in our example, it was http://localhost:8181/services/catalog/44dc84da101c4f9d9f751e38d9c4d97b

    This should display the catalog entry in XML within the browser.

  • Verify catalog entry exists by executing a query via the OpenSearch endpoint.
  • Verify catalog entry exists by executing a query in the SearchUI (which is OpenSearch based):

Use of the Content Framework

  • Using the Content Framework's Directory Monitor, ingest a file so that it is stored in the Content repository with a Metacard created and inserted into the Catalog.
    • In the Web Admin Console, select the Configuration tab, then select the Content Directory Monitor and set the Directory Path to inbox, and click Save.
    • Copy the attached geojson_valid.json file to the <DISTRIBUTION_INSTALL_DIR>/inbox directory
    • The Content Framework will:
      • ingest the file
      • store it in the content repository at <DISTRIBUTION_INSTALL_DIR>/content/store/<GUID>/geojson_valid.json
      • lookup the GeoJson Input Transformer based on the mime type of the ingested file
      • create a Metacard based on the metadata parsed from the ingested GeoJson file
      • insert the Metacard into the Catalog using the CatalogFramework
  • Verify GeoJson file was stored using the Content REST Endpoint
    • Install the feature content-rest-endpoint using the Features tab in the Admin console
    • Send a GET command to read the content from the content repository using the Content REST Endpoint. 
      This can be done using curl command below. Note that the GUID will be different for each ingest - the GUID can be determined by going to the <DISTRIBUTION_INSTALL_DIR>/content/store directory and copying the sub-directory in this folder (there should only be one), which is the GUID.

      *NIX Example
      curl -X GET http://localhost:8181/services/content/c90147bf86294d46a9d35ebbd44992c5

      The response to the GET command will be the contents of the geojson_valid.json file originally ingested.

Metrics Reporting

  • Now that several queries have been executed, go the Metrics tab in the Admin console (http://localhost:8181/system/console/metrics)
    • Click on the PNG link for the Catalog Queries row under the column labeled 1d, which stands for one day. A graph of the catalog queries executed in the last 24 hours will be displayed.
    • Click the back button of the browser to return to the Metrics tab.
    • Click the XLS link for the Catalog Queries row under the column labeled 1d.

      Handy Tip

      Based on the browser's configuration, either the .xls file will be downloaded or automatically displayed in Excel.