Newsroom Planner
3.0.1
3.0.1
  • What is Newsroom Planner?
  • User guide
    • Top menu
    • Events
      • Create an Event
      • Edit Event
    • Planning Cards
      • Create Planning Card
      • Edit Planning Card
    • Assignment
      • Create Assignment
        • Article assignment
        • Photo assignment
          • Manage linked photos
        • Other types of assignment
      • Edit assignment
        • Article size
      • E-mail notification
    • Hotkeys
    • Action widget
  • My assignment
    • Setting for My assignment
  • The list of my assignments
  • Text assignment
    • Edit article on assignment
    • Change article size
    • Create new article on the assignment
    • Duplicate the article
    • Use linked photos in the article
    • Create article when there is no assignment created
  • Photo assignment
    • Upload photos
    • Link photos
    • Manage linked photos
  • Set the assignment as done
  • Create new assignment
  • Admin guide
    • Settings
      • Customization
        • Cards
        • Columns
        • My assignment (Single view)
        • Event details
        • Planning details
        • Assignment details
          • Type of assignment
        • Article size
        • Create article modal
          • Channels
        • New article portal
        • Planning and assignment portal
      • Configuration
      • Templates
    • Changelog
    • Requirements
    • E-mail notification
    • Integrate with NRP
    • Develop with NRP
    • Migration
  • Developer guide
    • Link to plugin-development documentation
Powered by GitBook
On this page
  • What is Full-Package?
  • How can i create a Full-Package?

Was this helpful?

  1. Admin guide

Develop with NRP

PreviousIntegrate with NRPNextMigration

Last updated 5 years ago

Was this helpful?

NRP provides an action to create what we call a Full-Package that can be used in any other plugin.

What is Full-Package?

A Full-Package is a full NRP items linked together:

  • PlanningItem

  • ⮑ Assignment

  • ⮑ Article

How can i create a Full-Package?

NRP uses to expose its function to create a Full-Package

In your plugin you can ask Dashboard to give you the action and utilise it in your plugin.

First thing you need to do is to require an action from your plugin so you can map it later in to the action from NRP.

Follow the steps in .

After you register your required action you need to map the NRP action to your plugin in order to use it

example

In your plugin register function:

import { register } from 'Dashboard'

register({
    application: Application,

    requirements: {
        actions: [
            {
                id: 'NRP_CREATE_FULL_PACKAGE',
                name: 'Create a full NRP pacakge.',
                description: 'Action to handle creating a full package from NRP.'
            }
        ]
    }
})

Map NRP action to your plugin

In Dashboard go to store and click on your plugin after you install it and then click on Mappings

From there you should see your required action:

By clicking on Select action, you should see all the available actions from all the installed plugins, including the NRP action.

By selecting the correct option and clicking on save, your plugin now has the create full package method, and it's ready to be used.

Make sure that you have NRP plugin installed and configured and active in your Dashboard so you can see the option in Select action

Use create full package in your plugin

After we registered the required action and mapped it to the correct on from NRP, we can use it in plugin

example

import {
    useRef
} from 'react'

import {
    useAction,
    getMappedId
} from 'Dashboard'

const MyComponent = () => {
    const createFullPackageAction = useRef(
        useAction(
            getMappedId('@plugin_bundle', 'action', 'NRP_CREATE_FULL_PACKAGE')
        )
    )

    const handleCreateFullPackage = () => {
        createFullPackageAction.current({
            headline: 'My package headline!',
            startDate: '2020-02-26T15:14:28.708Z',
            assigneeInfo: {
                name: 'Author name', // the Author concept name.
                uuid: 'b25b129e-5951-4d03-8739-7bd3714b95fb' // the Author concept uuid.
            }
        }).then(results => {
            console.log('Successfully created a full package with NRP:', results)
        }).catch(error => {
            console.log('Error while creating a full package with NRP:', error)
        })
    }

    return (
        <div>
            <button onClick={handleCreateFullPackage}>
                Create a full package with NRP
            </button>
        </div>
    )
}

If the request went fine you should see the results from the action looks like:

Params tabel

Create full package action is a function returning a promise which resolves with the full package items info and rejects if something went wrong, and it accepts one argument type object with the following keys:

Key

Type

Required

Description

headline

String

x

Headline for all the package items: PlanningItem, Assignment and Article

startDate

String

x

Start date for all the package items in ISO format

assigneeInfo

Object

x

An object contains the assignee info: uuid and name to link it to the Assignment and the Article

See how to utilise Dashboard actions in your plugin

Dashboard Actions
Plugin Mappings
Require an Action
here