Texxml data sources: accessing a local EMu system

Web Maps' default Fetcher is called DefaultTexxml.php and it sources data from a local EMu system. It is located in:

~web/webservices/portal/CLIENT/fetchers/DefaultTexxml.php

Note: Replace CLIENT with the back-end client name of your EMu implementation. For example, CLIENT would be replaced by am for the Australian Museum, nhm for the Natural History Museum, dpiq for Department of Primary Industry Queensland, etc.

Typically, enabling this Fetcher only requires minor edits of DefaultTexxml.php:

  1. Set enabled to true.
  2. Set the appropriate value for hostname. This is the name of the EMu server.

    Note: In many cases the EMu host will not be the web server host.

DefaultTexxml.php also specifies which fields are searched in the data source, the label that is displayed on screen, and any example values. In the example below, six "concepts" are specified: Summary, Latitude, Longitude, Genus, Family and Species. Each of these is associated with a field in EMu that is searched to return data that is then displayed on a map. This screenshot shows the Search page configured for searching the six fields:

Mapper

The fields searched (their labels and which field they are associated with in EMu) are specified using the setKnownConcept method, the format for which is:

setKnownConcept(Concept,DataSourceField,[ExampleValue,[type]])

In this example, the six concepts are specified and associated with EMu fields:

$this->setKnownConcept("Summary","SummaryData");

$this->setKnownConcept("Latitude","LatCentroidLatitude0");

$this->setKnownConcept("Longitude","LatCentroidLongitude0");

$this->setKnownConcept("Genus","ClaGenus");

$this->setKnownConcept("Family","ClaFamily");

$this->setKnownConcept("Species","ClaSpecies");

The following steps are optional customizations of the DefaultTexxml Fetcher:

  1. Specify example query terms.

    To create example or suggested test query terms add a third argument to the setknownConcept method. These terms will be displayed when the DefaultTexxml checkbox is ticked and the Fill With Example Values button is then selected.

    For example:

    $this->setKnownConcept("Genus","ClaGenus","Acacia");

    This will set an example value of Acacia to be used for Genus:

    Mapper

    Example value(s) can be useful for providing a quick test / trial query.

  2. Override user search terms.

    It is possible to hard wire search terms. This will overwrite any search terms entered by users in a particular field (for example, you could restrict the Fetcher to find records only where Family = Eptatretidae, whatever a user might enter in the Family search field).

    For each override add a addAHardWiredRestriction method. Place it immediately after the setKnownConcept method and before the closing bracket:

    function DefaultTexxmlFetcher($instanceDir='',$backendType='',$webRoot='',$webDirName='',$debugOn=true)

    {

    $this->{get_parent_class(__CLASS__)}($instanceDir,$backendType,$webRoot,$webDirName,$debugOn);

    //Syntax:

    // setKnownConcept(Concept,DataSourceField,[ExampleValue,[type]])

    $this->setKnownConcept("Summary","SummaryData");

    $this->setKnownConcept("Latitude","LatCentroidLatitude0");

    $this->setKnownConcept("Longitude","LatCentroidLongitude0");

    $this->setKnownConcept("Genus","ClaGenus");

    $this->setKnownConcept("Family","ClaFamily");

    $this->setKnownConcept("Species","ClaSpecies"); }

    $this->addAHardWiredRestriction("ClaGenus = 'Acacia'");

    }