NTB Scanpix plugin

This plugin allows the user to search and download images from the Norwegian Scanpix API, allowing them to drag and drop them onto the article.

Dependency

Usage

  1. Configure plugin
  2. Search images
  3. Drag desired image thumbnail onto article
  4. Wait for download to finish
  5. Let image plugin handle upload and metadata

Plugin configuration

Add information regarding configuration of plugin here. Preferably in combination with a json-snippet (see example below).

{
  "plugins": [
    {
      "id": "io.infomaker.ntb-scanpix",
      "name": "ntb-scanpix",
      "url": "https://plugins.writer.infomaker.io/v1/infomaker/ntb-scanpix/{PLUGIN_VERSION}/index.js",
      "style": "https://plugins.writer.infomaker.io/v1/infomaker/ntb-scanpix/{PLUGIN_VERSION}/style.css",
      "enabled": true,
      "mandatory": false,
      "data": {
        "apiUrl": "https://api.scanpix.no/v2/",
        "authHeaderName": "x-append-authorization",
        "queryDefaults": {
          "subscription": "punchcard"
        },
        "largeImageWarningThresholdMB": 5,
        "translations": {
            "Showing": {
                "sv": "Visar"
            },
            "of": {
                "sv": "av"
            }
        }
      }
    }
  ]
}

Data fields

apiUrl - Scanpix API base URI.
authHeaderName - Header name where Basic auth token is set on API requests. x-append-authorization for Writer >= 5.0.0, otherwise authorization. When not set, x-append-authorization is used.
queryDefaults - Search query parameters which get overwritten by the parameters provided in the search form.
largeImageWarningThresholdMB - When set, any image that is downloaded will display a warning if its size exceeds that of the parameter in megabytes.
translations - Collection of translations to be used in the plugin.

Translations

All visible words in the search portion of the plugin can be translated, with the condition that these phrases do not contain variables. In case they do, translations must be provided for each word segment separately (see Plugin configuration Showing, of)

Output

<object id="MTczLDIzNSw3NiwxMDI" type="x-im/image" uuid="a4396669-59d6-527f-a589-47966ef4565f">
    <links>
        <link rel="self" type="x-im/image" uri="im://image/-VcSA67dN5aR9RL_vyVS9epmbkA.jpg" uuid="a4396669-59d6-527f-a589-47966ef4565f">
            <data>
                <width>3765</width>
                <height>3596</height>
                <text>Mercedes driver Lewis Hamilton of Britain celebrates his victory at the end of the Baharain Formula One Grand Prix at the Bahrain International Circuit in Sakhir, Bahrain, Sunday, March 31, 2019. (AP Photo/Luca Bruno)</text>
            </data>
            <links>
                <link rel="author" uuid="00000000-0000-0000-0000-000000000000" title="Luca Bruno" type="x-im/author"/>
            </links>
        </link>
    </links>
</object>