1.1.0 • Published 5 years ago

writer-print-plugin v1.1.0

Weekly downloads
2
License
ISC
Repository
bitbucket
Last release
5 years ago

Writer Print Plugin

Plugin configuration

{
    "id": "se.infomaker.writerprintplugin", 
    "name": "writerprintplugin",
    "url": "http://localhost:3000/index.js",
    "style": "http://localhost:3000/style.css",
    "mandatory": false,
    "enabled": true,
    "data": {
        "newspilotHostName": "newspilot.host",        
        "openContentHost": {
            "protocol": "https://",
            "hostName": "im-npdev.dev.proxy.infomaker.io",
            "port": "5555",
            "healthPath": "/health",
            "queryPath": "/search",
            "objectPath": "/objects",
            "sortingsPath": "/sortings"        
        }
    }
}

Open Content backend extra configuration

These properties has to be setup in the Open Content the Writer uses.

xpath for checking print in OC:
    /newsml:newsItem/newsml:itemMeta/newsml:itemMetaExtProperty[boolean(@creator)]/@value='x-im/print'

xpath for getting the alternate link in OC (glöm inte att sätta upp namespace för newsml och im): 
    /newsml:newsItem/newsml:itemMeta/im:links/im:link[@rel='alternate']/@uuid

Extra transformations in Transformation service

The plugin setts newspilot print properties in the newsItem. The properties can/should be used to set corresponding values in the newspilot exchange xml. These are:

        <itemMetaExtProperty type="npext:organizationId" value="1"/>
        <itemMetaExtProperty type="npext:productId" value="1"/>
        <itemMetaExtProperty type="npext:departmentId" value="1"/>
        <itemMetaExtProperty type="npext:sectionId" value="177"/>
        <itemMetaExtProperty type="npext:articleTypeId" value="134"/>
        <itemMetaExtProperty type="npext:layoutProperties" value="..."/>
        <itemMetaExtProperty type="npext:action" value="CREATE"/>
        <itemMetaExtProperty type="npext:jobId" value="15445"/>

Development

This Digital Writer plugin follows the standards set by the dw-jumpstart-plugin. Make sure you use git-flow.

There are some environment variables that has to be set (these are preferably set in a local .env file not to be included in git):

BITBUCKET_LOGIN=infomakerit
BITBUCKET_PASS=_bitnbucket_password_
BITBUCKET_USER=infomaker
BITBUCKET_REPO=writer-print-plugin
S3_BUCKET=dw-plugins-internal
S3_ACCESS_KEY=_s3_access_key_
S3_SECRET_ACCESS_KEY=_s3_secret_access_key_
S3_REGION=eu-west-1
PORT=5002
NPM_TOKEN=_npm_token_to_download_private_dependencies (newspilot-js-client).

Releases

When you are about to make a release (or a hotfix) make sure...

That you have created a version in your Issue Tracker and that your work is represented in resolved issues for the version that you want to release. That you follow git-flow, i.e. if you are about to do a "hotfix" you should be on master branch, if making a release you should be on develop. With that out of the way, follow these steps:

Depending on the type of release you are about to perform, execute npm run-script release:hotfix, npm run-script release:minor or npm run-script release:major. The script will (if everything looks fine) create a release branch in git, run test, build and validate the plugin artifacts, build the changelog and update the manifest. The scripts will also commit the updated files. Execute the "finish release" command in git-flow and push the tag (i.e. version) to develop and master. The bitbucket pipelines will upload your plugin to a S3 bucket where a lambda will validate and then publish your plugin. You should be able to see your plugin in the list here https://plugins.writer.infomaker.io/.

Use in Writer

To get link to the different versions in the Writer use: