.. _hierarchy:

Settings hierarchy
==================

Introduction
------------

GeoNetwork stores many options and information inside the Settings table.
Information is grouped into hierarchies where each node has a key/value pair and can
have many children. Each key is limited to 32 characters while each value is limited
to 250. The 2 top level hierarchies are system and harvesting.

In the following sections, the indentation is used to show hierarchies. Names in
bold represent keys with the value’s datatype in parenthesis. An
*italic* font is used to indicate basic types (string, integer,
boolean) while normal font with a | is used to represent a set of allowed values.
Regarding the boolean type, value can be only true or false. A missing datatype
means that the value of the node is not used. Square brackets indicate cardinality.
If they are missing, a cardinality of \[1..1] should be considered.

The system hierarchy
--------------------

- site: Contains information about the site

  - name (*string*): Name used to present this
    site to other sites. Used to fill comboboxes or lists.
  - organisation (*string*): Name of the
    organization/company/institute that is running GeoNetwork
  - siteId (*string*): A UUID that uniquely
    identifies the site. It is generated by the installer.

- platform: Contains information about the current version

  - version (*string*): GeoNetwork’s version in
    the X.Y.Z format
  - subVersion (*string*): A small description
    about the version, like ’alpha-1’, ’beta’ etc...

- server: Used when it is necessary to build absolute URLs to the
  GeoNetwork server. This is the case, for example, when creating links inside
  a metadata or when providing CSW capabilities.

  - host (*string*): Main HTTP server’s address
  - port (*integer*): Main HTTP server’s port (can
    be empty)

- Intranet: specify the network of the Intranet

  - network (*string*): Network’s address
  - netmask (*string*): Network’s netmask

- z3950: A container for Z39.50 server parameters

  - enable (*boolean*): If true, GeoNetwork will
    start the Z30.50 server
  - port (*integer*): The port opened by
    GeoNetwork to listen to Z39.50 requests. Usually is 2100.

- proxy: This container specify proxy configuration to use

  - use (*boolean*): If true, GeoNetwork will use
    the given proxy for outgoing connections
  - host (*string*): Proxy’s host
  - port (*integer*): Proxy’s port
  - username (*string*): Proxy’s credentials.
  - password (*string*): Proxy’s
    credentials.

- feedback: Feedback is sent with proper web form or when downloading a
  resource.

  - email (*string*): email address of a
    GeoNetwork administrator or someone else
  - mailServer: This container represents the mail server that will
    be used to send email

    - host (*string*): Address of the SMTP
      server to use
    - port (*string*): SMTP port to
      use

- removedMetadata: This container contains settings about removed metadata.

  - dir: This folder will contain removed metadata in MEF format. It
    gets populated when the user deletes a metadata using the web
    interface.

- LDAP: Parameters for LDAP authentication

  - use (*boolean*)
  - host (*string*)
  - port (*integer*)
  - defaultProfile (*string*): Default
    GeoNetwork’s profile to use when the profile user attribute does not
    exist.
  - login

    - userDN (*string*)
    - password (*string*)

  - distinguishedNames

    - base (*string*)
    - users (*string*)

  - userAttribs: A container for user attributes present into the
    LDAP directory that must be retrieved and used to create the user in
    GeoNetwork.

    - name (*string*)
    - password (*string*)
    - profile (*string*)

Harvesting nodes
----------------

The second top level hierarchy is harvesting. All nodes added using the web
interface are stored here. Each child has node in its key and its value can be
GeoNetwork, WebDAV, CSW or another depending on the node type.

All harvesting nodes share a common setting structure, which is used by the
harvesting engine to retrieve these common parameters. This imply that any new
harvesting type must honour this structure, which is the following:

- site: A container for site information.

  - name (*string*): Node name as shown in the
    harvesting list.
  - UUID (*string*): A unique identifier assigned
    by the system when the harvesting node is created.
  - useAccount (*boolean*): Indicates if the
    harvester has to authenticate to access the data.

    - username (*string*):
    - password (*string*):

- options:

  - every (*integer*): Timeout, in minutes,
    between 2 consecutive harvesting.
  - oneRunOnly (*boolean*): If true, the harvester
    will harvest one time from this node and then it will set the status
    to inactive.
  - status (*active|inactive*): Indicates if the harvesting from this
    node is stopped (inactive) or if the harvester is waiting until the
    timeout comes.

- privileges \[0..1]: This is a container for privileges to assign to each
  imported metadata

  - group (*integer*) \[0..n]: Indicate a local
    group. The node’s value is its local identifier. There can be
    several group nodes each with its set of privileges.

    - operation (*integer*) \[0..n]:
      Privilege to assign to the group. The node’s value is the
      numeric id of the operation like 0=view, 1=download, 2=edit
      etc...

- categories \[0..1]: This is a container for categories to assign to each
  imported metadata

  - category (*integer*) \[0..n]: Indicate a local
    category and the node’s value is its local identifier.

- info: Just a container for some information about harvesting from this
  node.

  - lastRun (*string*): If not empty, tells when
    the harvester harvested from this node. The value is the current
    time in milliseconds since 1 January, 1970.

Privileges and categories nodes can or cannot be present depending on the
harvesting type. In the following structures, this common structure is not shown.
Only extra information specific to the harvesting type is described.

Nodes of type GeoNetwork
````````````````````````

This is the native harvesting supported by GeoNetwork 2.1 and above.

- site: Contains host and account information

  - host (*string*)
  - port (*integer*)
  - servlet (*string*)

- search \[0..n]: Contains the search parameters. If this element is
  missing, an unconstrained search will be performed.

  - freeText (*string*)
  - title (*string*)
  - abstract (*string*)
  - keywords (*string*)
  - digital (*boolean*)
  - hardcopy (*boolean*)
  - source (*string*)

- groupsCopyPolicy \[0..n]: Represents a copy policy for a remote group.
  It is used to maintain remote privileges on harvested metadata.

  - name (*string*): Internal name (not
    localised) of a remote group.
  - policy (*string*): Copy policy. For the
    group all, policies are: copy, copyToIntranet. For all other
    groups, policies are: copy, createAndCopy. The Intranet group is
    not considered.

Nodes of type GeoNetwork20
``````````````````````````

This type allows harvesting from older GeoNetwork 2.0.x nodes.

- site: Contains host and account information

  - host (*string*)
  - port (*integer*)
  - servlet (*string*)

- search \[0..n]: Contains the search parameters. If this element is
  missing no harvesting will be performed but the host’s parameters will
  be used to connect to the remote node.

  - freeText (*string*)
  - title (*string*)
  - abstract (*string*)
  - keywords (*string*)
  - digital (*boolean*)
  - hardcopy (*boolean*)
  - siteId (*string*)

Nodes of type WebDAV
````````````````````

This harvesting type is capable of connecting to a web server which is WebDAV
enabled.

- Site: Contains the URL to connect to and account information

  - URL (*string*): URL to connect to. Must be
    well formed, starting with ``http://``, ``file://`` or a supported
    protocol.
  - Icon (*string*): This is the icon that
    will be used as the metadata source’s logo. The image is taken
    from the images/harvesting folder and copied to the images/logos
    folder.

- options

  - Recurse (*boolean*): Indicates if the
    remote folder must be recursively scanned for metadata.
  - Validate (*boolean*): If set, the
    harvester will validate the metadata against its schema and the
    metadata will be harvested only if it is valid.

Nodes of type CSW
`````````````````

This type of harvesting is capable of querying a Catalogue Services for the
Web (CSW) server and retrieving all found metadata.

- site

  - capabUrl (*string*): URL of the
    capabilities file that will be used to retrieve the operations
    address.
  - icon (*string*): This is the icon that
    will be used as the metadata source’s logo. The image is taken
    from the images/harvesting folder and copied to the images/logos
    folder.

- search \[0..n]: Contains search parameters. If this element is
  missing, an unconstrained search will be performed.

  - freeText (*string*)
  - title (*string*)
  - abstract (*string*)
  - subject (*string*)