Test Case Title |
TC2.29 - Sharing Snap4City Applications based on NodeRED |
Goal |
Create Snap4City Applications which can be saved and shared with other developers, that in turn can upload and install in their Application Builder environment. Sharing Snap4City applications can be saved and shared with other developed, as well as published on the Resource Manager. connection via HTTPS/HTTP |
Prerequisites |
A new Snap4City Application has been created. It can be installed, copied and past. An application or block that I have produced can be shared in several different manners with other developers and city users. The following functionalities are available only for specific Snap4city users with specific privileges. |
Expected successful result |
Save of a Snap4City Application from the editor, save on your local disk, reload in another NodeRED tools. |
Steps |
- Also IOT applications are uploaded in the Resource Manager tool
Case 1: share a Snap4City IOT application via clipboard.
- To test you can:
- Go to https://www.snap4city.org and login in your area
- On the left column main menu click on IOT Applications
- Open one of your IOT Application. The node-RED application is opened integrated in the snap4city application.
- By clicking the left button of the mouse, select the nodes to be exported and shared. A light blue square is shown during the selection.
- Click the icon on the top right to open the menu and select Export à Clipboard. A pop up window is shown as in the following image;
- set your preference for exporting the code (Selected nodes, current flow, all flows) and press the Export to clipboard button;
- Paste the clipboard in a text editor and save the file.
- The file can be sent to other users and imported in other dashboard by using the Import functionality in the menu as follow:
- Open the text file
- Select all the text
- Copy the text in the clipboard
- Open the node-RED menu and select Import à Clipboard
- A pop window is shown where to copy the text. Copy the text as current flow (the clipboard content is copied in the current flow) or new flow (the clipboard content is copied in an empty flow), and press the Import button
Case 2: Share Snap4City IOT applications via the Resource Manager (see also TC2.13)
- Go to https://www.snap4city.org and login in your area
- On the left column main menu click on IOT Applications
- Open the IOT Application to be exported on the Resource Manager
- Whenever the IOTApplication is wrote and deployed, it’s possible to export a copy (in JSON format) in a private area for later sharing/download. Please press in the right upper button Export-> Save S4C as shown below
- Fill all the information for your flow and press “Save S4C” to export a copy of the flow to later sharing/downloading
- To later access the exported flow (as a copy of your flow, not as the IOT Application itself), please click on the Resource Manager -> Resource on the left menu and you can see a copy of the flow you exported before in a JSON format. The resource it’s private but can be also made it public pressing the NO button under the Published column. It’s possible to Delete the resource pressing the button DEL and it’s possible to download it pressing the right mouse button directly on the filename and select Save target As…
The IOT Application shared in the Resource Manager tool can be imported in another IOT application.
- Go to https://www.snap4city.org and login in your area
- On the left column main menu click on IOT Applications
- Open the IOT Application where to import the IOT application
- On the node-Red menu click on Import -> Import S4C
- Only public IOT applications is shown in the list.
- The following image show the same IOT applications loaded in the Resource Manager that are listed into the Import process of the IOT application.
- Click the name of the IOT application to be imported and confirm by clicking the Import red button.
- The flow is copied into the IOT application.