WhatIsAClass

Last modified by Sergiu Dumitriu on 2013/08/14

Question What is a Class ?
Answer For the purposes of most people using XWiki, we can define a class by saying that a class is used to create forms that users can fill out to create pages or documents in your wiki.

In order to create a class, you must find the page in your wiki that ends with XWiki/XWikiClasses, for example:

http://www.xwiki.com/xwiki/bin/view/XWiki/XWikiClasses (Note: It appears you can now reach the class editor through the "more actions" option.)

Once you have chosen the name of your class, you will be asked to edit it and declare/create the properties (that will be used as fields to enter information in the form), giving information such as

  • name (of the field)
  • type of field
  • parameters of the field (such as the size of the edit box when the field is edited or the date format)
Once you have defined the class, or the fields that will be used to structure your form, you can then begin to create instances of the class, or objects, by entering data corresponding to the fields of the class. These objects will become documents or pages in your wiki.

But before you can create objects (documents) for your class, you need to create

  • a Class Template (a document template, or sample object, that will be used to create each new document)
  • a Class Sheet which is a separate script (in a separate document) included in the Template
After the Class Template has been created, you will need to select "edit objects" from the "more actions" menu, and then select the class from which you wish to add an object in the drop down menu on the right. This will likely be the same class that you are creating. You will be give a form to fill out (one instance/object of the class you selected). This will serve as the template everytime someone creates a new document using the form.

The Template and the Sheet work together to do the same thing, but are kept in separate documents so that the Sheet script can be modified to change the way data is displayed for every object/document.

Actually, a document is not the same thing as an object. Rather, it contains the object. Documents can contain more than one object.

The following helper pages on XWiki.com once moved to your wiki can help you create classes, sheets and templates more easily:

Actually what you are asking for is available on the XWiki.XWikiClasses page that should be in your default wiki..

If these pages are missing you can copy-paste them from XWiki.com:

Tags:
Created by Ludovic Dubost on 2005/11/02
   

Get Connected