This tutorial explains how to generate new empty CMFiles from your own xml schemas as templates for the PyWrapper. Therefore you will need a valid XML schema file to process. If you just want to try this feature, you can use this simple example schema: musiclib.xsd.
If you want to create an extension for ABCD please read this tutorial: http://ww3.bgbm.org/abcddocs/DesignAbcdExtensions
Schema Requirements
Not all xml schemas will work with the pywrapper. Please make sure your xml schema confirms to the following restrictions:
Be sure that your schema is valid, for example trying it with XML Spy or using a free online validator.
- Make sure you have a targetnamespace defined! The wrapper needs this to identify your schema.
- Every concept (tree leaf element orattribute in the schema) that you want to make available for mapping must have a simple data type defined.
- Avoid recursive structures (global elements or complex types calling itself at some point, e.g. Person/Parent/Person/Parent/Person...)in your schema. They cannot be translated into a CMF!
CMF Generation Steps
- In order to process the schema, it currently needs to be available via a public URL.
Please move your schema to a webserver so you can reach it via http, e.g. http://rs.tdwg.org/dwc/tdwg_dw_record_tapir.xsd
Go to the utilities page of your installation and follow the link "Generate a new CMF..." or visit the BGBM installation at http://ww3.bgbm.org/biocase/utilities/process_schema.html
- In this page enter the URL of your schema and press "Parse" leaving the default options. If you happen to run into errors, change the dropdowns to "false" and "info" or "debugging" and Parse again.
- The xml generated is already your new CMF.
- Save it (dont copy paste from your browser window) and put it into the CMF templates folder of the BPS2: INSTALLDIR/configuration/templates/cmf. The filename will have to start with "cmf_" and use ".xml" as its suffix.
- Before you can try out your new CMF, you will have to edit it manually with a text editor a little bit:
Just after the settings section you will find the empty <recordIdentifier /> tag. Please fill it with the xpath to an element of your schema, which you consider to be a "record" - The entity which is used for counting and paging. In the example music library schema an artists album is considered as a record, so the xpath is "/AudioCollection/Album" and the CMF should look like this:
... </settings> <recordIdentifier>/AudioCollection/Album</recordIdentifier> <dataElement name="AudioCollection" ... > ...
Now you are ready to use the configtool to map your database to this new CMF!
Using the Configtool
The new CMF is now available as another template within the configtool. You can use it now like all the other CMFs. There is only one difference - you will not be able to use the concept retrieval interface unless you have updated its index database which is described below.
To see your concepts in the configtools mapping page, please use the "Show all concepts" box and press refresh!
Updating the Concept Retrieval Index Database
You will have to run the tools script makeGrove.py for this. More explanations will come soon!