Difference between revisions of "V2/CMS Tutorial/User Tools/Creating Content/Import/CSV"

From Senfi Docs
Jump to: navigation, search
Line 11: Line 11:
 
* External event sources, and corresponding Tag system.
 
* External event sources, and corresponding Tag system.
  
=== How to Import CSV ===  
+
== How to Import CSV ==
 
[[File:CSV_Import_Steps1-5.png|thumb|center|700px|Steps 1 to 5 to import assets into Senfi via CSV|link=]]
 
[[File:CSV_Import_Steps1-5.png|thumb|center|700px|Steps 1 to 5 to import assets into Senfi via CSV|link=]]
 
# Go to "Import" tab
 
# Go to "Import" tab
Line 25: Line 25:
 
# If there is an error still remained when you click "IMPORT", the warning message will display and the assets with an error will be ignored if ignored the warning message.
 
# If there is an error still remained when you click "IMPORT", the warning message will display and the assets with an error will be ignored if ignored the warning message.
  
=== CSV File Specifications ===
+
== CSV File Specifications ==
 
The supported CSV format is RFC 4180, UTF-8. Saving as CSV from Excel should be compatible for most Excel versions. For the purposes of this guide, we will be using Excel as the CSV editor.
 
The supported CSV format is RFC 4180, UTF-8. Saving as CSV from Excel should be compatible for most Excel versions. For the purposes of this guide, we will be using Excel as the CSV editor.
  
Line 40: Line 40:
 
Each subsequent row (2nd row onwards) in the CSV file is an Asset to be imported.  
 
Each subsequent row (2nd row onwards) in the CSV file is an Asset to be imported.  
  
==== Headers ====
+
=== Headers ===
===== Required Columns =====
+
==== Required Columns ====
 
The following headers must be in every imported CSV file, with valid values provided for each row. They are required to create an Asset.
 
The following headers must be in every imported CSV file, with valid values provided for each row. They are required to create an Asset.
 
* Name
 
* Name
Line 47: Line 47:
 
* Site ID
 
* Site ID
  
===== Optional Columns =====
+
==== Optional Columns ====
 
The following headers are optional. They provide more information about the Assets to be imported.
 
The following headers are optional. They provide more information about the Assets to be imported.
 
* Description
 
* Description
Line 58: Line 58:
 
** a comma separated list of "Zone ID"s that the asset at.
 
** a comma separated list of "Zone ID"s that the asset at.
  
===== Lift related Columns =====
+
==== Lift related Columns ====
 
If there are Lift assets, the following headers must exist to provide lift related information.
 
If there are Lift assets, the following headers must exist to provide lift related information.
 
* Stops
 
* Stops
Line 64: Line 64:
 
** E.g: [1b0dd17a-2785-4771-88ce-7158e7081d05,68caa9f0-32ed-44d1-94cc-9ddc768314d8]
 
** E.g: [1b0dd17a-2785-4771-88ce-7158e7081d05,68caa9f0-32ed-44d1-94cc-9ddc768314d8]
  
===== Attribute Columns =====
+
==== Attribute Columns ====
 
To import Attribute information, add a header for each attribute, using the following format:
 
To import Attribute information, add a header for each attribute, using the following format:
 
* [Attribute] <attribute_name>
 
* [Attribute] <attribute_name>
Line 70: Line 70:
 
If an Asset does not have an attribute, leave the column blank for that row.
 
If an Asset does not have an attribute, leave the column blank for that row.
  
===== Measurement Columns =====
+
==== Measurement Columns ====
 
To import measurement's tag information, add a header for each measurement's tag_field with the following format:
 
To import measurement's tag information, add a header for each measurement's tag_field with the following format:
 
* [Measurement] <measurement_code>.<tag_field>
 
* [Measurement] <measurement_code>.<tag_field>
 
If an Asset does not have the measurement, leave the column blank for that row.
 
If an Asset does not have the measurement, leave the column blank for that row.
  
===== Event Columns =====
+
==== Event Columns ====
 
To import event's tag information, add a header for each event's tag_field with the following format:
 
To import event's tag information, add a header for each event's tag_field with the following format:
 
* [Event] <event_def_id>.<tag_field>
 
* [Event] <event_def_id>.<tag_field>
 
If an Asset does not have the event, leave the column blank for that row.
 
If an Asset does not have the event, leave the column blank for that row.
  
===== Relationship Columns =====
+
==== Relationship Columns ====
 
To import asset relationship, add a header for each relationship type (hasPart|controls|feeds|serves|monitors) with the following format:
 
To import asset relationship, add a header for each relationship type (hasPart|controls|feeds|serves|monitors) with the following format:
 
* [Relationship] <type>
 
* [Relationship] <type>
Line 86: Line 86:
 
The column value is a comma separated list of "Asset ID"s that the asset have the relationship with.
 
The column value is a comma separated list of "Asset ID"s that the asset have the relationship with.
  
===== Stream Columns =====
+
==== Stream Columns ====
 
To add Video Streams to imported Asset, add the following header.
 
To add Video Streams to imported Asset, add the following header.
 
* Stream
 
* Stream
 
The header can appear multiple times in the header row, as many as is required.
 
The header can appear multiple times in the header row, as many as is required.
  
===== Iframe Columns =====
+
==== Iframe Columns ====
 
To add Iframe to imported Asset, add the following header.
 
To add Iframe to imported Asset, add the following header.
 
* Iframe
 
* Iframe
 
The header can appear multiple times in the header row, as many as is required.
 
The header can appear multiple times in the header row, as many as is required.
  
=== How to obtain relevant IDs ===
+
== How to obtain relevant IDs ==
==== Site ID ====
+
=== Site ID ===
 
Site ID can be obtained from CMS -> Site Page -> Site tab as shown below.
 
Site ID can be obtained from CMS -> Site Page -> Site tab as shown below.
 
[[File:Obtain_site_id.png|250px|center|link=]]
 
[[File:Obtain_site_id.png|250px|center|link=]]
  
==== Asset ID ====
+
=== Asset ID ===
 
Asset ID can be obtained in CMS -> Asset page -> Asset tab as shown below.
 
Asset ID can be obtained in CMS -> Asset page -> Asset tab as shown below.
  
 
[[File:Asset_screenshot.jpg|200px|center|link=]]
 
[[File:Asset_screenshot.jpg|200px|center|link=]]
  
==== Zone ID ====
+
=== Zone ID ===
 
Zone ID can be obtained in CMS -> Site page -> edit Site -> Zone tab as shown below.
 
Zone ID can be obtained in CMS -> Site page -> edit Site -> Zone tab as shown below.
  
 
[[File:Zone_id_screenshot.jpg|600px|center|link=]]
 
[[File:Zone_id_screenshot.jpg|600px|center|link=]]
  
==== Stream ID ====
+
=== Stream ID ===
 
Video Stream ID can be obtained in CMS -> Video page -> Video Stream tab
 
Video Stream ID can be obtained in CMS -> Video page -> Video Stream tab
  
Line 117: Line 117:
 
[[File:obtain_stream_id.png|600px|center|link=]]
 
[[File:obtain_stream_id.png|600px|center|link=]]
  
==== Event Def ID ====
+
=== Event Def ID ===
 
Event Def ID can be obtained from CMS -> Automation Page -> Event tab as shown below.
 
Event Def ID can be obtained from CMS -> Automation Page -> Event tab as shown below.
 
[[File:Obtain_event_id.png|200px|center|link=]]
 
[[File:Obtain_event_id.png|200px|center|link=]]

Revision as of 13:10, 27 June 2023

Importing CSV

Senfi allows you to create Assets by importing necessary information from a CSV file. The following section will detail the process to do so, and the specifications of the CSV file.

Prerequisite knowledge:

  • Senfi concepts related to Asset
  • Senfi concepts related to Lift & Movable Asset
  • Senfi concepts related to Asset Relationship
  • Zone & Level Zone concepts
  • Measurement concepts, and corresponding Tag system.
  • External event sources, and corresponding Tag system.

How to Import CSV

Steps 1 to 5 to import assets into Senfi via CSV
  1. Go to "Import" tab
  2. Select "CSV" tab
  3. Select "IMPORT" tab
  4. Choose the .CSV file to be uploaded.
  5. Click "NEXT"
    Preview of assets to be imported into Senfi via CSV Schema
  6. Verify the information of the assets to be imported. Ensure all information is correct before proceeding with the actual import.
    1. You can click on each asset row to view more information for individual asset.
    2. You can click on "BACK" to return to previous page if there is any information you wish to change.
    3. If there is an error with an asset, an Alert icon.png alert will appear beside the asset information.
  7. Once all information is verified to be correct, click "IMPORT" to finish importing the CSV.
  8. If there is an error still remained when you click "IMPORT", the warning message will display and the assets with an error will be ignored if ignored the warning message.

CSV File Specifications

The supported CSV format is RFC 4180, UTF-8. Saving as CSV from Excel should be compatible for most Excel versions. For the purposes of this guide, we will be using Excel as the CSV editor.

The imported CSV is split into 2 parts.

  • Header
  • Rows

The first row of the CSV file is the header row. The header row identifies the data contained within each column. The value of the header cell tells Senfi what to do with the column's data. For example, a column with header "Name" tells Senfi to assign the value of that column to the Name of each Asset.

The value of each header cell must equal to senfi-defined values, or conform to senfi-defined format, which will be outlined in the Headers section below. Any columns with non-conforming headers will be ignored.

Import csv header row.png

Each subsequent row (2nd row onwards) in the CSV file is an Asset to be imported.

Headers

Required Columns

The following headers must be in every imported CSV file, with valid values provided for each row. They are required to create an Asset.

  • Name
  • Is Virtual
  • Site ID

Optional Columns

The following headers are optional. They provide more information about the Assets to be imported.

  • Description
  • Location X
  • Location Y
  • Location Z
  • Is Movable
  • Is Lift
  • Zones
    • a comma separated list of "Zone ID"s that the asset at.

Lift related Columns

If there are Lift assets, the following headers must exist to provide lift related information.

  • Stops
    • a comma separated list of "Level ID"s that the lift stops at.
    • E.g: [1b0dd17a-2785-4771-88ce-7158e7081d05,68caa9f0-32ed-44d1-94cc-9ddc768314d8]

Attribute Columns

To import Attribute information, add a header for each attribute, using the following format:

  • [Attribute] <attribute_name>

If an Asset does not have an attribute, leave the column blank for that row.

Measurement Columns

To import measurement's tag information, add a header for each measurement's tag_field with the following format:

  • [Measurement] <measurement_code>.<tag_field>

If an Asset does not have the measurement, leave the column blank for that row.

Event Columns

To import event's tag information, add a header for each event's tag_field with the following format:

  • [Event] <event_def_id>.<tag_field>

If an Asset does not have the event, leave the column blank for that row.

Relationship Columns

To import asset relationship, add a header for each relationship type (hasPart|controls|feeds|serves|monitors) with the following format:

  • [Relationship] <type>

If an Asset does not have this relationship type, leave the column blank for that row. The column value is a comma separated list of "Asset ID"s that the asset have the relationship with.

Stream Columns

To add Video Streams to imported Asset, add the following header.

  • Stream

The header can appear multiple times in the header row, as many as is required.

Iframe Columns

To add Iframe to imported Asset, add the following header.

  • Iframe

The header can appear multiple times in the header row, as many as is required.

How to obtain relevant IDs

Site ID

Site ID can be obtained from CMS -> Site Page -> Site tab as shown below.

Obtain site id.png

Asset ID

Asset ID can be obtained in CMS -> Asset page -> Asset tab as shown below.

Asset screenshot.jpg

Zone ID

Zone ID can be obtained in CMS -> Site page -> edit Site -> Zone tab as shown below.

Zone id screenshot.jpg

Stream ID

Video Stream ID can be obtained in CMS -> Video page -> Video Stream tab

Select the Video Adapter hosting the Video Stream. The Video Stream ID will be displayed as shown below

Obtain stream id.png

Event Def ID

Event Def ID can be obtained from CMS -> Automation Page -> Event tab as shown below.

Obtain event id.png