I know that some of you have been waiting to play with the CsvImport
plugin. It's now available in alpha for you to use and test.
The CsvImport Plugin allows you to import items from a comma separated
file (CSV). It allows you to map each of the columns in your file to
item elements, tags, or files.
Using it is pretty simple.
1. Download and install the plugin.
cd plugins
svn co
https://omeka.org/svn/plugins/CsvImport/tags/1.0-1.0alpha
CsvImport
(During installation, you need to specify the path to your php 5
executable. It will usually work by default, but some webhosts like
Dreamhost have a different path).
2. Create a CSV file where each row represents data for a single
item. The CSV file should only include information about items of the
same item type. Also, the first row should have column headers. For
multi-line data, or data with commas, you should surround the
information with double quotes.
Here's a properly formatted example file called foobar.csv
name, age, gender, quote, tags, url
"John", "27", "Male", "Gee, I really like Will's plugin.", "smart,
human, Georgia" , "
http://www.myysspace.com/pic.gif"
"Laura", "50", "Female", "Wow, I can't believe it's not butter!",
"smart, human, Alaska", "
http://www.myysspace.com/pic.gif"
One easy way of creating a CSV file is by saving an Excel Spreadsheet
as a CSV file.
3. Move the CSV files you want to import into the plugins/CsvImport/
csv_files directory on the server. You can use an SFTP client to do
this. This method allows you to ingest large files.
4. Login as an administrator, and click the CsvImport tab, and then
click the Import Items tab.
5. Select your Csv file. Optionally, select an item type and the
collection you want to import it to. Specify whether the items are
all going to be imported as public and/or featured. And if you are
importing files for items from URL data, then specify whether you want
the import process to stop if it cannot download a file. If this is
unchecked, then it will ignore download errors and keep importing
items. Click the Next button.
6. Specify how you want to map your data. Each column in your CSV
file represents a different aspect of your items, including metadata
stored in elements, tags, and files. Let us consider each one in
turn:
Elements:
You can map columns to multiple elements from multiple element sets.
In our example file, the "name" column could map to the "Title"
element of the Dublin Core element set, as well as the "Creator"
element of the Dublin Core element set. To do this, select each
element from the dropdown and then click the add button. To help you
decide, the plugin shows you an example of the data from that column.
If you change your mind, you can remove an added element by clicking
the delete graphic next to each added element.
Also you can map two columns to the same element. For example, you
could map both the "age" column and the "gender" column to the
Description element in the element set associated with the Document
item type. To gain access to this element, you would have had to
select the Document item type for this import.
Tags
In addition to elements, you can also map elements to tags. The
importer will parse comma separated tags and associate them with the
item. To do this, make sure your column data has comma separated
tags, like the example above.
Files
The plugin can also download files based on column data. To do this,
enter a single URL to a file and click the checkbox.
After you have configured your column mappings, click the Import CSV
File button.
7. Monitor your import status. Click the Status tab or reload the
Status page to check the progress of your import. After your import
has completed, you have the option of undoing your import. If you
undo your import, then all the items in that import will be deleted.
Don't worry, the system prompts you for confirmation twice to make
sure that you really want to undo the import. Finally, if you have
many undone imports, you may want to remove the history of those
undone imports, so you don't have to keep looking at them. To do this,
click the Clear History link next your import.
8. Remember this: if you decide that you want to uninstall the
plugin, it will NOT delete the items you have imported. It will
however, prevent you from undoing those imports in the future.
Have fun with the plugin and let us know if it works as specified and
how we can improve it.