If the user has followed the manual in order, CTI is installed and a user is created. It is now time to import some data into the repositories and perform basic manipulation on the data. The current section presents the existing repositories after a fresh installation, how to manipulate them, browse through, and also add or move data around.
A repository in CTI contains data or plugins. The following section presents how to manipulate and browse through repositories. After a fresh installation, there are only one existing common repository and a set of demo local repositories. However, there are three different repository levels explained in the following sub-sections.
The common repository exists in the installation folder of CTI. The common repository contains the essential plugins for CTI and base data. For example, the user's login created during the first section resides in the common repository.
Local repositories are created by the user on the local machine. They are created in a given repository in the same manner as a code versionning repository. For CTI, the creation is simply performed by the command:
$ cti repository init my_repository
Under the hood, the command creates a .ctr folder that will contain any information added by the user. "my_repository" is the repository name.
Viewing the Repositories
To view a repository, there are two techniques: CTS (web interface) and command-line. The following section shows both techniques.
To view a repository, you must first use the "Repositories" link in the top-menu.
The resulting display is this:
The list of local repositories
As shown on the left-menu, two categories of repositories exists: local and common. It is also shown that after a fresh installation, the list of local repositories contains demo repositories.
After a local repository is created, the user can browse the repository like any other repository.
By clicking on "Common repository" then on the "Plugins" item on the side menu, you can see the list of plugins. It should resemble something like the following image:
The list of plugins in the common repository
Each row is a specific plugin and contains a name or alias, a category, a description and two actions: one to add data using a plugin and the other to delete the plugin. Clicking on a plugin's name or alias will open the viewer. For example, the import_csv plugin provides the following information:
The plugin viewer
To list the local repositories:
$ cti list local_repositories Local repositories NAS-SER_SP_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_SP_src/.ctr Last access : 2012/11/29 11/01/34 NAS-SER_BT_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_BT_src/.ctr Last access : 2012/11/29 11/01/19 NAS-SER_CG_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_CG_src/.ctr Last access : 2012/11/29 11/01/26 NAS-SER_EP_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_EP_src/.ctr Last access : 2012/11/29 11/01/26 NAS-SER_FT_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_FT_src/.ctr Last access : 2012/11/29 11/01/27 NAS-SER_IS_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_IS_src/.ctr Last access : 2012/11/29 11/01/28 NAS-SER_LU_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_LU_src/.ctr Last access : 2012/11/29 11/01/28 NAS-SER_MG_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_MG_src/.ctr Last access : 2012/11/29 11/01/33
To list the data via the command-line:
$ cti list data common
The previous command lists the data in the common repository.
To list the plugin via the command-line:
$ cti list plugins common
"common" is not mandatory: the default parameter used will be "all".
For a full documentation of the cti list, use the help command:
$ cti --help list
It is often useful to backup a repository or move it around.
Download a Repository
Via CTS, the repository is easy to download via the Download button. With the command-line, downloading a repository is possible via the repository command. CTI provides the repository as a zipped folder containing the data and the plugins.
$ cti repository archive common common.zip
Importing a Repository
After a full re-installation (not an update) of CTI, it is necessary to inform CTI of old local repositories. The command import provides the repository integration. If the user created a CTI local repository in the folder test2, the command imports the repository automatically:
$ cd test2 $ cti repository import my_rep Successfully imported current directory (UID = e5107456-b518-41b2-9461-63e72c34bff4)! Re-indexing..."my_rep" is the new repository alias.
Moving Data Around
If a user wants to move data between repositories, there is a web interface and a command-line solution. Moving data can consist of displacing plugins or real data.
The first thing to do is to view the data that needs to be moved:
The data viewer
To move the data, click on the "Move to repository" button at the top of the view. This will make a frame appear under the buttons.
The move button
The user can select a repository using the drop-down list, then click the "Move" button to validate.
After the validation, a confirmation screen will be displayed.
The confirmation screen
The methodology is the same: select the data, decide the destination, move the data. Since CTI uses aliases or UIDs, the user must know one or the other. Second, the destination repository must be defined. Last, the full command is set up via the move plugin:
$ cti move common myData
The previous command moves the data myData to the common repository. If successful, the user sees the following message:
$ cti move common MULTIARRAY UID=ac538f75-8dd2-4eaa-8776-20ae2e4ee260 - Moved
If a user wishes to move to local repository, the first step is to find the UID of the repository:
$ cti list local_repositories Local repositories NAS-SER_SP_src : /home/users/ftalbart/cti/repo_demo/NAS-SER_SP_src/.ctr Last access : 2012/11/29 11/01/34
$ cti move local NAS-SER_SP_src makefile UID=21586bcb-9968-4321-9082-2bd805fbe411 - Moved
The use of the key word local is to define that the move is towards a local repository.
The previous section presented what CTI considers as a repository: something that contains plugins or data. It explained the hierarchy of repositories, from the local to the common. Finally, it was explained how to move elements from one repository to another. The next section presents how to add files into a repository via CTS or via the command-line.