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, but each to them must have at least one. 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 describe it. 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. A template is therefore never in the STATE "published", but always in "intermediate", (see FedoraTransactionsReplacement). 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 possible template object
    1. Select the collection
    2. Find all templates in this collection
    3. Narrow the list to all templates that have a "doms-relations:isTemplateFor" relation to a acceptable content model
  2. Have the user select one of the found templates
  3. Load the object from Fedora and change it to a normal data object
    1. Generate a new PID for the object
    2. Replate all "doms-relations:isTemplateFor" relations with "fedora-model:hasModel" relations.
    3. Set the state to "draft"
    4. 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.