How to import fields

This is a step by step instruction on how to import fields into SOBI2 using CSVI SOBI.

What are fields?

Fields are labels you can create yourself in SOBI2 so that the layout can be completely customized.

Where to find the fields?

The fields can be found by taking the following route: Components → Sigsiu Online Business Index 2 → Configuration → Custom Fields Manager

How to manage the fields?

This is where new fields can be added or existing ones can be modified. It is important to know that fields are build up from 2 sections:

  1. field name
  2. field data

Field name

The field name is unique. For each language you can have a translation stored, this is called the language_langkey. The language_langkey is the field name and is the same for every language in the system.

Language

To know to which language the language_langkey belongs we need to specify the language_sobi2lang. This makes a unique combination. There can always only be 1 set of language_langkey and language_sobi2lang. The name of the language can be found the Language Manager.

Label

To localize the field name, it can be assigned a label this is called the language_langvalue. When choosing the language set, the associated language_langvalue will be retrieved and shown.

Section

Each field is put into a section, currently there are only 2 sections to choose from:

  • emails (will be dealt with in another tutorial)
  • fields

The section is identified as language_sobi2lang, standard this is always fields.

Field data

The field data contains all the characteristics that can be specified when editing or adding a new field. This is explained in the How to import field details? tutorial.

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

language_langkeylanguage_langvaluelanguage_sobi2sectionlanguage_sobi2lang

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 a field already exists it is updated, otherwise created. A new field date of birth will be added. Important to know is that each field must always start with field_. The new field to create will be field_date_of_birth.

language_langkeylanguage_langvaluelanguage_sobi2sectionlanguage_sobi2lang
field_date_of_birthDate of birthfieldsenglish

The third row

Assume the system has another language, Dutch. A field for this language must be created also.

language_langkeylanguage_langvaluelanguage_sobi2sectionlanguage_sobi2lang
field_date_of_birthDate of birthfieldsenglish
field_date_of_birthGeboortedatumfieldsdutch

The fourth row and so on

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

language_langkeylanguage_langvaluelanguage_sobi2sectionlanguage_sobi2lang
field_date_of_birthDate of birthfieldsenglish
field_date_of_birthGeboortedatumfieldsdutch
field_place_of_birthPlace of birthfieldsenglish
field_place_of_birthGeboorteplaatsfieldsdutch

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 fieldimport.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. The recommended values are:

  • Field delimiter: ^
  • Text delimiter: ~

Click on OK and the file is saved.

Importing the import 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 1. Field 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 1. Field 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 fields are now shown in the Custom Fields Manager in SOBI2.

This concludes the tutorial on how to import fields.

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