TC2.29 - Sharing Snap4City Applications based on NodeRED

 

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

 

 


Case 1: share a Snap4City IOT application via clipboard.

  1. 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.

 

  1. 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;
  2. set your preference for exporting the code (Selected nodes, current flow, all flows) and press the Export to clipboard button;
  3. Paste the clipboard in a text editor and save the file.
  4. 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

  1. 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)
     
  1. Go to https://www.snap4city.org and login in your area
  2. On the left column main menu click on IOT Applications
  3. Open the IOT Application to be exported on the Resource Manager
  4. 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
     

     
  5. Fill all the information for your flow and press “Save S4C” to export a copy of the flow to later sharing/downloading

     
  6. 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.
  1. Go to https://www.snap4city.org and login in your area
  2. On the left column main menu click on IOT Applications
  3. Open the IOT Application where to import the IOT application
  4. On the node-Red menu click on Import -> Import S4C
  5. Only public IOT applications is shown in the list.
     

     
  6. The following image show the same IOT applications loaded in the Resource Manager that are listed into the Import process of the IOT application.
  7. Click the name of the IOT application to be imported and confirm by clicking the Import red button.
  8. The flow is copied into the IOT application.