About

Record Store plugin can be used to persistently store, update, retrieve and e-mail meta-searched records. It allows building UI component that require the records to be persistent, including: user-managed record lists ("record basket"), record sharing (e.g via e-mail) and record "tagging".

Protocol

Assuming the plugin has been mapped to the store chain (see configuration) it is invoked with:

  GET /service-proxy/?command=store

If mapping was successful you will see an error indicating that mandatory request parameters (specific to the plugin) are missing.

Request parameters

action

Specifies the action performed by the plugin. Depending on the value of this parameter, additional parameters may need to be specified.

Possible values include:

  • create - persistently stores a record supplied in the POST request body (soon functionality to store plugin via 'rec-id' from the active Pazpar2 session). The input is an XML document that contains standard Pazpar2 cluster record (see Pazpar2 documentation)

    Example:

      POST /service-proxy/?command=store&action=create

    In response, status document containing id element with a local id of the stored record is returned.

  • read - retrieves record from the persistent store Required parameters: id - local id of the persisted record (soon retrieval by Pazpar2 'recid')

    Example:

      GET /service-proxy/?command=store&action=read&id=99
  • delete - deletes record from the persistent store Required parameters: id - local id of the persisted record (soon deletion by Pazpar2 'recid')

    Example:

      GET /service-proxy/?command=store&action=delete&id=99
  • list - list all records in the persistent store Optional parameters: start and max to indicate the range of record listing.

    Example:

      GET /service-proxy/?command=store&action=list&start=0&max=100
  • email - e-mails the record in the persistent store as an attachment Required parameters: id - local id of the persisted record, to recipient e-mail address (can be an array parameter)

    Example:

      GET /service-proxy/?command=store&action=email&id=99&to=me@server.com

id

Required along with read> and delete action parameters, the local record identifier in the record store

to

Only used in the email action, can be repeated multiple times. Recipient e-mail address.

start, max

Allows to specify the range of records in the list action.

Configuration

Registration

This plug-in is configured in service-proxy.properties or equivalent as follows:

  plugins.store  = com.indexdata.masterkey.store.RecordStorePlugin

Chain mapping

Example:

  chains.store = store

Properties

MAIL_SMTP_HOST

Mail server host (for email action).

Mandatory in email action.

Example:

  store.MAIL_SMTP_HOST = smtp.someserver.com

MAIL_SMTP_USER

Mail server user name (for email action).

Mandatory in email action.

Example:

  store.MAIL_SMTP_USER = username

MAIL_SMTP_PASSWORD

Mail server password (for email action).

Mandatory in email action.

Example:

  store.MAIL_SMTP_PASSWORD = somepass

MAIL_FROM

Sender (from) name (for email action).

Mandatory in email action.

Example:

  store.MAIL_FROM = Index Data

MAIL_SUBJECT

Subject line of the sent e-mail (for email action).

Mandatory in email action.

Example:

  store.MAIL_SUBJECT = Greetings from MasterKey

MAIL_BODY

Plain text body of the sent e-mail (for email action).

Mandatory in email action.

Example:

  store.MAIL_BODY = Hi, This is an e-mail sent form MasterKey