Newsroom Planner
6.0.0
6.0.0
  • What is Newsroom Planner?
  • User guide
    • Overview
    • Top menu
      • Template
    • Calendar view
      • Filtering
      • Cards in calendar columns
    • Search
    • Events
      • Create an event
      • Edit event
    • Planning
      • Create a planning
      • Edit a plan
    • Assignment
      • Create assignment
        • Text assignment
        • Photo assignment
          • Manage linked photos
        • Other types of assignments
      • Edit assignment
        • Article size
      • E-mail notification
    • Hotkeys
    • Action widget
    • Copying
  • My assignment
  • The list of my assignments
  • Text assignment
    • Edit article on assignment
    • Create new article on the assignment
    • Link an article to the assignment
    • Change article size
    • Make a copy of an article
    • Use linked photos in the article
    • Create article when there is no assignment created
  • Photo assignment
    • Upload photos
    • Link photos
    • Unlink photos
    • Manage linked photos
  • Set the assignment as done
  • Create new assignment
  • Opening plan/assignment
  • Copy a plan
  • Admin guide
    • Settings
      • Customization
        • Cards
        • Columns
        • Single view (My assignment)
        • Advanced concept settings
        • Loadable components
          • Event
          • Planning
          • Assignment
            • Type of assignment
          • Full package
          • Tags
      • Configuration
        • Types
        • Sortings
        • Filters
        • Property mappings
        • Properties to fetch
        • Queries & Suggestions
        • Providers
        • Map options
        • Writer
        • Email service
        • Debug
      • Templates
    • My assignment Workspace setting
    • Changelog
    • Requirements
    • E-mail notification
    • Integrate with Newsroom Planner
    • Develop with NRP
    • Migration
      • 5.x âž¡ 6.x
      • 5.0.x âž¡ 5.1.x
      • 4.x âž¡ 5.x
        • Cleanup
      • 3.x âž¡ 4.x
        • Templates
      • 2.x âž¡ 3.x
      • 1.x âž¡ 2.x
    • Concept relations
  • 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 Newsroom PlannerNextMigration

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