6.8 Importing Previously Assigned Metadata

This section details the process for importing previously assigned metadata, and how to install parsers to handle various metadata types.

Contents
Simple instructions
  While adding files
Advanced instructions
  New parsers
Problems and solutions
  "What if I accidentally import information to the wrong element?"
Simple Instructions:

If metadata has been previously assigned to a certain file, and that metadata is in a form recognized by the Librarian Interface, the metadata will be imported when you add the file. This sometimes happens without any user intervention. However, if the Librarian Interface does not know how to map previously assigned metadata onto the metadata sets available in the collection, it prompts the user on how to do so.

The prompt contains brief instructions on what must be done. Below the instruction box are three text fields. The first shows the name of the metadata element that the Librarian Interface is importing, just as it appears in whatever source file the Librarian Interface has found. This field cannot be edited or changed. The second control allows you to choose what metadata set this element should map to, and contains all the sets available in the collection. The third control allows you to choose which metadata element the original element should map to if you intend to merge elements.

When this display is created the Librarian Interface makes an educated guess about which element and set should be chosen. For instance, if the element being imported were called 'Publisher' and there existed only one element within the available sets called 'dls.Publisher', then the Librarian Interface would guess the metadata set to be the Development Library Subset (dls) and the element to be Publisher. However this doesn't always work as intended, so be sure to check the fields before committing any changes.

The actions allowed are: [A]dd, [M]erge or [I]gnore. The add button allows you to add a new element to the chosen metadata set with the name as given in the original. This control is only enabled if there is no element of the same name within the chosen set. Merging maps the original element to the element chosen by the user. Finally, ignore skips importing any metadata which has an element as named in the original element field.

Once you have advised the Librarian Interface how to import a certain piece of metadata from a certain source location, it retains this information for the lifetime of the collection.

Advanced Instructions:

When attempting to find metadata, the Librarian Interface consults a series of dynamically loaded metadata file parsers for information about where to find metadata and how to read it once it is found. For instance, the directory '\classes\org\greenstone\gatherer\msm\parsers' contains a file named 'GreenstoneMetadataParser.class'. This, and the other files starting with the same name, instructs the Librarian Interface how to read Greenstone metadata files, or metadata.xml files. Any new parser must implement the org.greenstone.gatherer.msm.MetadataParser interface. If this is done it is simply a matter of placing the file in the directory named above and restarting the Librarian Interface. Thus you are able to parse metadata from any source you have installed a parser for.

Problems And Solutions:

"What if I accidentally import information to the wrong element?"

Currently the solution is the edit the profile.xml file located in the collection's metadata directory, to remove any erroneous entries. Once this is done, remove the files affected then re-import them. Eventually an 'import profile' editor will be included with the option of re-importing metadata.