Differences between revisions 7 and 8
Revision 7 as of 2008-10-17 13:26:45
Size: 3084
Editor: abr
Comment:
Revision 8 as of 2008-10-17 13:27:50
Size: 3135
Editor: abr
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
  1. Query for all templates that has a "doms-relations:isPartOfCollection" relation to this collection, and has a "doms-relations:isTemplateFor" relation to one of the content models, or a content model that has is connected to one of those via a list of "doms-relations:extendsModel" relations.   1. Query the [:Fedora_3.0_triple_store_API: Resource index] for all templates that has a "doms-relations:isPartOfCollection" relation to this collection, and has a "doms-relations:isTemplateFor" relation to one of the content models, or a content model that has is connected to one of those via a list of "doms-relations:extendsModel" relations.

Fedora Object Templates

It is easily possible to create data objects from the definition in a content model, which was the basic strategy for the DOMS GUI. This strategy has one drawback, however. With just the information contained in the content models, almost no data can be automatically filled in. But for most data objects there is much data that could be filled automatically, based on the context. As a general solution to this problem, we introduced the concept of Object Templates (prototypes, stem-objects and so on).

A template is for all intents and purposes a normal data object. It has a special relation "doms-relations:isTemplateFor" (see DomsNameSpaces) to a content model. This marks it as a template for this content model. There can be any number of templates for each content model. Most content models will have at least one template. This one will be the blank object, i.e. the object that could be automatically created from the content model.

A template object is not guaranteed to be valid in regards to the content models that it subscribe to. It is guaranteed not to contain anything not allowed, but it might not contain everything required, as this should be filled in when the template is used. As such, the template data objects are always in the fedora state "Inactive". This prevents the validation services from marking the object as broken, and the dissemination services from publishing the object to the customers.

A template object must always be part of a collection, like ordinary data objects.

Using a template

The way to create a new object via the template goes like this:

  1. Find the template object,
    1. Select the collection and the list of acceptable content models.
    2. Query the [:Fedora_3.0_triple_store_API: Resource index] for all templates that has a "doms-relations:isPartOfCollection" relation to this collection, and has a "doms-relations:isTemplateFor" relation to one of the content models, or a content model that has is connected to one of those via a list of "doms-relations:extendsModel" relations.
  2. Have the user select one of the found templates
  3. Load the object from Fedora and change it to a normal data object like this:
    1. Generate a new PID for the object
    2. Delete all "doms-relations:isTemplateFor" relations in the object
    3. Save the new object to Fedora
  4. Open the new object in the GUI

So, the relations from the template will be copied into the new object, along with the content of any datastreams.

Abstract Content Models

Templates are meant to be the one and only way to create new objects, aside from batch ingests, import and other yet-to-be defined ways. So, for content models without templates, there are no way to make objects of this content model. Such content models are referred to as abstract content models, and many of the content models in the Base collection will be abstract.

Note, you can still create objects of other content models, that extends the abstract models. Just not of the abstract models themselves.

FedoraObjectTemplates (last edited 2010-03-17 13:12:47 by localhost)