# Develop with NRP

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
* &#x20;   ⮑ Assignment
* &#x20;       ⮑ Article

### How can i create a Full-Package?

NRP uses [Dashboard Actions](https://docs.infomaker.io/dashboard-plugin/agent/actions) 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 [Plugin Mappings](https://docs.infomaker.io/dashboard-plugin/mappings) to the action from NRP.

Follow the steps in [Require an Action](https://docs.infomaker.io/dashboard-plugin/register/requirements#actions).

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:

```jsx
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:

![](https://content.gitbook.com/content/roDqvLkN3ow1Tz27WnxP/blobs/Qf16OE130DuVMUJEkAiK/Screenshot%202020-02-26%20at%2015.55.13.png)

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

![](https://content.gitbook.com/content/roDqvLkN3ow1Tz27WnxP/blobs/BhTK3Dicf1U3OJwFb8Pt/Screenshot%202020-02-26%20at%2015.55.44.png)

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.

{% hint style="info" %}
Make sure that you have NRP plugin installed and configured and active in your Dashboard so you can see the option in **Select action**
{% endhint %}

#### 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

> **See how to utilise Dashboard actions in your plugin** [**here**](https://docs.infomaker.io/dashboard-plugin/mappings#getmappedid)

**example**

```jsx
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:

![](https://content.gitbook.com/content/roDqvLkN3ow1Tz27WnxP/blobs/Vs3vx351SQZ7B1zMdI0n/Screenshot%202020-02-26%20at%2016.34.02.png)

#### 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 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.navigaglobal.com/newsroom-planner/admin-guide/develop-with-nrp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
