Software AG Products 10.5 | Using CentraSite | Asset Management | Managing Assets through Command Line Interface | Bulk Importing Assets
 
Bulk Importing Assets
Pre-requisites:
To bulk import assets through the CentraSite Command Line Interface, you must have the CentraSite Administrator role.
Note:
Ensure that all of the necessary JAR files are located on <CentraSiteInstall_Directory>/redist.
Required JAR files for a CSV (.csv) file:
Download OpenCSV 2.4.0 jar from the URL https://code.google.com/p/opencsv/downloads/detail?name=opencsv-2.4.jar&can=2&q= and place it in the redist folder.
Required JAR files for an Excel (.xlsx) file:
Download Apache POI 3.13 from the URL https://poi.apache.org/download.html and place the following Jar files on <CentraSiteInstall_Directory>/redist.
*poi*.jar
*poi-ooxml*.jar
*poi-ooxml-schemas*.jar
Supported data types and their format:
*String
*Boolean
*Number
*URI/URL
*Multiline String
*Classification
*IP Address
*Email
*Date/Time
*Duration
Format for data type Duration:
Example: P1Y2M3DT4H5M
Format for data type Date:
*yyyy-MM-dd
Example: 2015-12-10
Format for data type Date and Time:
*yyyy-mm-dd hh:mm:ss
Example: 2015-12-10 12:04:10
*yyyy-mm-dd hh:mm
Example: 2015-12-10 12:04
Format for data type Time:
*hh:mm:ss
Example: 12:04:10
*hh:mm
Example: 12.10
CentraSite provides a Java tool named CentraSiteAssetImporter.jar for this purpose. The tool imports multiple assets from a CSV file or an Excel file (in the .xlsx format).
*To import multiple assets
*Run the Java tool CentraSiteAssetImporter.jar.
The syntax is of the format: C:\SoftwareAG\CentraSite\utilities>CentraSiteToolbox.cmd CentraSiteAssetImporter.jar [-url <CENTRASITE-URL>] -username <USERNAME> -password <PASSWORD> [-ownername] <OWNER-NAME>) -qname <FULLY-QUALIFIED-NAME> -inputfile <FULL-PATH-TO-FILE> [-excelworksheet <EXCEL-WORKSHEET-NAME>] -namecolumn <ASSET-COLUMN-NAME> [-desccolumn <ASSET-DESC-COLUMN-NAME>]
The input parameters are:
Parameter
Description
CENTRASITE-URL
The URL of the CentraSite registry. For example, http://localhost:53307/CentraSite/CentraSite.
USERNAME
The user ID of a registered CentraSite user who has the CentraSite Administrator role. For example, Administrator.
PASSWORD
The password for the CentraSite user identified by the parameter USERNAME.
OWNER-NAME
(Optional). The domain in which the user wants to include the imported asset. If this parameter is not specified, the user identified by the parameter USERNAME will be the owner.
FULLY-QUALIFIED-NAME
The namespace of an asset type along with its schema name. For example:
{http://namespaces.DefaultOrganization.com/Schema}
FULL-PATH-TO-FILE
The absolute or relative path to the CSV or Excel file. If relative, the path should be relative to the location from where the command is executed.
EXCEL-WORKSHEET-NAME
(Applicable only to Excel). The name of the Excel worksheet which contains the details of assets to be imported into CentraSite.
ASSET-COLUMN-NAME
The name of the column or header in Excel sheet or CSV file from which a display name would be assigned to the imported asset.
ASSET-DESC-COLUMN-NAME
The name of the column or header in Excel sheet or CSV file from which a brief description would be assigned to the imported asset.
Example (all in one line):
C:\SoftwareAG\CentraSite\utilities>CentraSiteToolbox.cmd CentraSiteAssetImporter.jar -url http://localhost:53307/CentraSite/CentraSite -username Administrator -password manage -ownername sag\inosec1 -qname {http://namespaces.DefaultOrganization.com/Schema} MyAssetType -filelocation c:\repository\assetdata.xlsx -namecolumn "Interface Name" -excelworksheet Lowes.com -desccolumn "desc"