About Document Models

A Document Model is a document which can be used as a template for future documents. You must specify if you are creating a Model at the time of creation.

Document Models differ from normal documents only in that they are ignored by Mooffanka’s search engine. Otherwise they may be edited, published and deleted as any other document.


When and why to load from a model?

Models should be used as a jumping off point. Often, different pages of a website have a similar look and feel. While the content of these pages can either be similar or even radically different, it can be useful to start work from a model instead of from a blank page.

Creating a document from a model in no way inhibits the way a document can be handled. For this reason, it is not a good idea to use document models in place of document types. You may be tempted to do so since a document model can be quickly and easily produced by anyone who is authorized to create documents, while document types need to be defined by a programmer who knows XSLT. However, document models will offer you no guarantee that the information contained in a document model will be maintained once the user begins to modify the document, nor does the model necessarily contain formatted data.

This becomes especially important in sites which allow it's visitors to use sWord.

For example, assume you have a site which allows registered users to maintain a personal page. Suppose the personal page contains the user's name, email, a photo and some text.

  • If you want to give your users a ready to use template so that they don't find themselves face to face with a blank page, you can create a document from a model for them, then let them edit it from there. Most users will probably leave the template as is and just "fill in the blanks", other users may decide to delete everything and start over from scratch. Using a model will not impede this.

  • If, however, you want to be able to collect data about your users, if you want them to have to respect the format they are given, if you want to be able to search personal pages by email or by name, then you must use a Document type. A model is not sufficient in this case.


What is the relationship between a document and the model it was loaded from?

The document is a copy of the model. Once created, there ceases to be any relationship between the two.

For example, assume you have a document model which contains the text My name is Bob. Suppose you create a Document "Bob's Page" and you load the contents from the model. At the time of creation the document and it's model are identical.

  • If you edit the text in the model to read My name is Jim, this will have no effect on the document "Bob's Page" which will continue to read My name is Bob.
  • If you delete the model, this will have no effect on the document "Bob's Page".
  • If you edit the text in the new document to read My name is Bob and I have brown eyes, this will have no effect on the Model.
  • If you delete the document "Bob's Page", this will have no effect on the model.


Create a New Model

In order to use a document as a model, you must designate it as such in the New Document screen.

You may not transform a normal document into a model, nor vice versa. This must be defined at the time of creation.


Create a Document from a Model

You may create a document based on a model, via the New Document screen.


Editing a Document Model

You may edit a Model at any time.

This will have no effect whatsoever on any documents that you may have previously created from that model.

Only new documents loaded from the edited Model will reflect the changes made.


Delete a Document Model

You may delete a Model at any time.

This will have no effect whatsoever on any documents that you may have previously created from that model.


Publish a Document Model

In order for users other than yourself to be able to use the Model you have created, you must publish it.