0.2.3 • Published 8 years ago

arkivo-sufia v0.2.3

Weekly downloads
2
License
AGPL-3.0
Repository
github
Last release
8 years ago

arkivo-sufia

Build Status Coverage Status

A Zotero/Arkivo plugin to connect to Project Hydra services

Quickstart

Install arkivo-sufia and (optionally) hiredis with NPM:

$ npm install arkivo-sufia hiredis

Add a configuration file, e.g., config/default.json:

{
  "arkivo": {
    "plugins": [ "arkivo-sufia" ],
    "controller": {
      "delay": 5000,
      "attempts": 5
    }
  }
}

You can also configure the plugin's default settings in your config file:

{
  "arkivo": {
    "plugins": [ "arkivo-sufia" ],

    "sufia": {
      "base": "http://localhost:3000",

      "create": "/api/items",
      "update": "/api/items/:id",
      "delete": "/api/items/:id",

      "mimetypes" [
        "application/pdf"
      ]
    }
  }
}

For more configuration options, please consult Arkivo's documentation.

Now you start your Arkivo service:

$ $(npm bin)/arkivo up

To ensure that the Sufia plugin has been loaded, you can check the output of:

$ $(npm bin)/arkivo-plugins list

To enable debug output, set the DEBUG environment variable to 'arkivo:*' or 'arkivo:*,zotero:*'.

Subscriptions

JSON API

You can create subscriptions using Arkivo's JSON API. For example, consider the following POST to http://localhost:8888/api/subscription:

{
  "url": "/users/<zotero-user>/collections/<collection>/items",
  "key": "<zotero-api-key>",
  "plugins": [
    {
      "name": "sufia",
      "options": {
        "token": "<sufia-access-token>"
      }
    }
  ]
}

Note that you can additionaly pass a base URL for each subscription; this allows you to pin individual subscriptions to Sufia hosts other than the default one.

Command line

Alternatively, use the command line to add you subscriptions (and issue a sync request if Arkivo is already running):

$ $(npm bin)/arkivo /users/<zotero-user>/collections/<collection>/items \
  -K <zotero-api-key> \
  -P sufia:\"token\":\"<sufia-access-token>\"

$ $(npm bin)/arkivo sync -d
0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago