At the center of CTI is data handling, whether it is generic data or files containing code, data, results. The following section presents how to add a file into CTI, how to download, and update a file. CTS, the web interface, also handles CSV differently, automatically integrating and allowing user viewing. Finally, the section shows how CTI handles codelets, a group of files representing a small program or part of an application.
Adding a File
In order to add a file, the import_files plugin is used. The first element to decide is where to import the file.
To import a file, click on the "Files" item on the top menu. The side menu will update. Expand on the "Add" category of the side menu and choose "Import a file".
The file form
An import file form appears, which can be completed by choosing the repository, the displayed name, and the file. Once completed, the user can click on Add to finally upload the file. The different form elements are:
Whether the user wishes to add a local directory
Note: this directory must be on the machine where CTI is installed, not on the machine the user is viewing CTS from
The file to import which can be local or from the user's machine
After the file is imported, CTS provides information about the file entry:
The file viewer
For this example, a simple text file containing a few lines has been imported. Because of that, the viewer will be able to display the contents of the file, like shown in the previous illustration.
Using the command-line, a user can add a file to a repository. The command is cti file, and help can be obtained by performing:
Once the data is found, the user can either use the UID or the alias via the cti rm command:
$ cti rm entry NAS-SER_SP_scr_Codelet309_2012_10_03_11:59:54 Are you sure to delete this entry? (Y/N)? y Done!
You can even remove a set of entries with the following command:
$ cti process run_command 'cti,rm,entry,<UID>,--force=1' '*' my_rep codelet_group
It will extract all the "codelet_group" entries from "my_rep" repository, and run the command "cti rm entry" by replacing <UID> with the extracted entries. For more information, read carefully the documentation about the "run_command" command of the process plugin.
Adding a CSV
First CSV Schema
The first time a user adds a new type of a Comma Separated Value (CSV) file, he must create a CSV schema. A CSV schema is a definition of the CSV file, meaning the number of columns and their names. Currently CTI accepts CSV files that have the first row as column names and the following rows are content.
Under CTS, to create a new schema, use the file link: create a schema from CSV.
The schema form
The form contains the table alias which is used as the name of the schema for subsequent CSV file insertions, the destination repository, and finally the actual CSV template file. Once filled and the button add pressed, the user should see the following screenshot:
Note: CTI does not support spaces in the table alias.
Via the command-line, importing a CSV schema is performed via the database plugin with the from_csv action:
$ cti database from_csv mySchema myRep /tmp/example.csv Created new database schema <mySchema>. Hint: to get instructions, type $ cti mySchema help
Adding a File
Once the CSV schema exists in the CTI repository, the user can add CSV files.
Adding a CSV file is possible using the "Import a CSV file" link from the "Files" main menu. Once the user is in section, the first step is to click on the import a CSV file link.
The CSV form
The form contains the the destination repository, the schema that is to be used, and finally the actual CSV file. The schema to be used is the same name provided during the schema creation. Once it is done, the user should see:
When clicking on the link, the user obtains a visual view of the CSV file and a download link to the CSV.
The CSV viewer
The user can also click on the column names to reorder the CSV for that column. However, for any spreadsheet operation, download the CSV and use an actual spreadsheet.
The CSV viewer
To import a CSV file via the command-line, the user must use the import_csv plugin. It is possible to use the help command to see how the plugin works:
$ cti import_csv helpCommands available for this plugin: $ cti import_csv directory schema_uid directory [separator] [format] $ cti import_csv init schema_uid file [command] [output_parameter] [additional_parameters] [separator] [format] $ cti import_csv help COMMAND_NAME
Therefore, in the previous example, if the user wishes to now insert the example.csv in the repository, the following command is required:
Once the CSV file is imported, the user can perform queries on it. Since the CSV file has been converted into the CTI internal format, it is considered like a common CTI entry. The query plugin can be used to extract the data from the repository. For more information, read the query's plugin documentation.
The File Management section presents how to add files, CSV files, and codelets via the CTS webservice or the CTI command-line. Data being the centerpiece of the framework, the insertion of data has been simplified for the user.