# Portal Push

Portlets can be automatically updated by using the Portal Push functionality. If an updated is done in one portlet, a push event can trigger updates to connected portlets. A portal push rest connector must be configured to access this functionality.

## Studio - Workflow

1. Create a table element with two columns (use the exact column names):
   * PortletInternalName
   * Action
2. In the PortletInternalName column enter the internal names of the portlets that are to be refreshed
3. In the Action column enter REFRESH
4. Create a Machine step to trigger the push event, using the PortalPush connector.

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tmzSmjOvJRKD-MNhY%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush1.jpg?alt=media\&token=c5a2cc43-e5c8-4772-8bdb-18d95ac3ae42)

## Create PortalPush Rest Connector

1\. Log on to Flow Studio, go to Environment - Connectors and click Add

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tn3dGBSomM1cLwJ9T%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush2.jpg?alt=media\&token=5dda478c-95ba-445f-bc44-6af7df562c80)

2\. Set up:

* Name = The name of the connector
* Type = Rest Service
* Base address = XX (in example: <http://localhost/Trunk.NovaCura.Portal.Web/api>)
* Encoding for url parameters = Unicode (UTF-8)
* Cache metadata = No
* Save

3\. Click on REST connector project - EDIT\
4\. Set up:

* Connector name = XX (in example: DefaultConnectorName)
* Connector description = the description of the connector
* Base path = XX (in example: <http://localhost/Trunk.NovaCura.Portal.Web/api)\\>
  &#x20;Click Create/update connector button

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnXWAjzBCcVtUU9Xr%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush3.jpg?alt=media\&token=99497d31-dd39-4694-9caf-2b3f4b08c044)

\
&#x20;5\. Click Save button in top right corner.

* Click on REST connector project - EDIT again
* Click on Models in the navigator tree
* Click on NEW FROM JSON<br>

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnbRaiNEbeCtGd3G-%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush4.jpg?alt=media\&token=b91b11c8-edd1-4b18-99d6-43b069df6fa6)

6\. Use following JSON to generate required models:

```
    {
        "PushEventModels": [
            {"PortletInternalName":"pptbl1","Action":"REFRESH"},
            {"PortletInternalName":"pprv1","Action":"REFRESH"}
        ]
    }
```

You can change one of the new created model name from NEWMODEL to for example PUSHMODEL

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnfa3do3oBdJ6c-Bl%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush5.jpg?alt=media\&token=c907be49-f93e-4fbc-81c1-67be53562da3)

7\. Click on DefaultConnectorName and ADD in Operations to create operation. When the requested parameters have been entered click OK.

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnigYhigu6nWTtRSs%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush6.jpg?alt=media\&token=20a1f7fe-68c4-4afb-ae50-5e8902a1b361)

8\. Click on Parameters and NEW BODY

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnn6hea35JvxIbIuC%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush7.jpg?alt=media\&token=cef6d425-1086-4874-9f4a-2d3bfa86dd80)

9\. Enter Body data, click OK and then Create/update connector

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnqixMMb4to72EuDV%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush8.jpg?alt=media\&token=35fadbb4-3032-4267-b7a4-bfa4812048ea)

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tntkXD7sy5aSWBQWg%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush9.jpg?alt=media\&token=87ff3c41-0e4d-405d-8992-96c716b26bc3)

\
10\. If asked for content type for rest requests, select *Set content-type to application/json* and click ok

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-tnwv3GAX1oT0eg0Im%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush10.jpg?alt=media\&token=f4946cb8-b846-4d7d-a702-9785325b0944)

11\. Save the connector

![](https://543770944-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tm54S6VFd3rqE-MvU%2F-M-to-Ldab6cGHV3aLz5%2Fhelp_root_clients_portal_portaloptions_portalpush_portalpush11.jpg?alt=media\&token=ef7eab56-1724-4cc0-a89e-2fd8aecb3fe0)
