How to import templates

This is a step by step instruction on how to import templates using CSVI SOBI.

What are templates?

Templates are pre-defined settings that CSVI SOBI uses to import or export data. This allows for consistency and not having to choose the settings every time an import or export is done.

Where to find the templates?

The templates can be found by taking the following route: Components → CSVI SOBI → Templates

How to manage templates?

There are a number of template settings that can be imported. A complete list is available from the available fields page or the available fields per type page.

Each template setting has an equivalent on the available fields page. For example “Template name” is called template_name.

Identifying the correct template

Templates are identified by template name. The template name is needed by CSVI SOBI to know which template is being imported.

Creating the import file

To create the import file this example will use the spreadsheet program Calc by OpenOffice.org because it is very flexible with delimiters.

The first row

The first row will contain the column headers. Column headers tell the program what is going to be imported and are essentially the supported fields. Earlier in this tutorial the fields that can be used are already mentioned.

The first row will look like this

template_nametemplate_typeuse_column_headersshow_preview

Now CSVI SOBI knows what is going to be imported.

The second row

This row will contain the first real data to be imported. CSVI SOBI works from the idea that if an entry already exists it is updated, otherwise created.

template_nametemplate_typeuse_column_headersshow_preview
My entriesEntriesImportYY

The third row and so on

More rows can be added as many as there is a need for. The file can eventually look like this:

template_nametemplate_typeuse_column_headersshow_preview
My entriesEntriesImportYY
My fieldsFieldsImportYN
My field detailsFieldDetailsImportNN

After all fields have been added, the file can be saved as a CSV file.

Saving the import file

In Calc, click on File → Save as. In the dropdown box Save as type select Text CSV (.csv) and check the box before Edit filter settings. Give the file a name, for example templateimport.csv and click on Save.

First a warning will appear which can be ignored by clicking Yes. Now a dialog box appears asking what delimiters to use. These values should be different than the delimiters used in the templates that are going to be imported otherwise the layout is incorrect. The recommended values are:

  • Field delimiter: | <pipe symbol>
  • Text delimiter: <nothing>

Click on OK and the file is saved.

Importing the template file

To import the file there first needs to be a template created with settings to be used during import.

Creating the template

In the Joomla back-end click on Components → CSVI SOBI → Templates. The list of available templates will be shown. In a clean installation some sample templates will be shown. Select the 05. Template Import template and click on Edit.

The template wizard will now show up. All options have already been set. Click on General Settings to verify the same delimiters are set as used for the saved file. After all has been verified, click on Save. At the template list click on CSVI SOBI.

Doing the import

From the control panel, click on Import. On the import screen, first choose the template to use for import. Select here 05. Template Import.

The file to import can either be uploaded or read from the local file system. Click on Browse to select the file that was saved earlier.

Click on Import.

A preview of the import will be shown first if this option is enabled in the template settings. On the preview page click on Import to continue importing the file.

A result screen is now shown with the results of the import. At the bottom some debug information is printed. This is also an option in the template settings and is usually only used for troubleshooting.

Verify the import

If there were no problems during the import, the templates are now shown in the Template List in CSVI SOBI when clicking on Components → CSVI SOBI → Templates.

This concludes the tutorial on how to import templates.

 
csvisobi/tutorials/import_templates.txt · Last modified: 2008/06/09 06:38 by rolandd
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki