VdexReload 1.1.3 API

uk.ac.reload.moonunit.schema
Class ReloadSchemaController

java.lang.Object
  extended byuk.ac.reload.moonunit.schema.ReloadSchemaController
Direct Known Subclasses:
LDEditorSchemaController, ReloadEditorSchemaController

public abstract class ReloadSchemaController
extends java.lang.Object

The Schema Controller - this controls access to helper and vocabulary files as well as various default values.


Field Summary
protected  ReloadSchema _reloadSchema
          The Schema that will be our template
protected  java.io.File _schemaFile
          The Schema File
protected  ReloadSchemaHelper _schemaHelper
          The Schema Helper that we will query
protected  java.lang.String _version
          The version String
protected  ReloadVocabulary _vocab
          The Reload Schema Vocabulary
 
Constructor Summary
ReloadSchemaController()
          Default Constructor
ReloadSchemaController(java.io.File fileSchema, java.io.File fileHelper, java.io.File fileVocab)
          Constructor
 
Method Summary
 java.lang.String getDefaultValue(ReloadSchemaNode schemaNode)
          Get the default value of a ReloadSchemaNode
 java.lang.String getElementFriendlyName(DomPath domPath)
          Get a friendly name for a schema element
 java.lang.String getElementHelperValue(DomPath domPath, java.lang.String helperKey)
          Get a Helper value for a given key
 java.lang.String getElementTip(DomPath domPath)
          Get an element tip
 java.lang.String getFacetValue(ReloadSchemaNode schemaNode, java.lang.String facetName)
          Get a Facet value of an Element or attribute.
 ReloadSchema getReloadSchema()
          Return the ReloadSchema connected with this Controller
 ReloadSchemaNode getReloadSchemaNode(DomPath domPath)
          For each JDOM Path there is a corresponding ReloadSchemaNode.
abstract  java.lang.String getRootElementName()
          Get the root element name
 java.io.File getSchemaFile()
          Get the Schema File for this Schema
 ReloadSchemaHelper getSchemaHelper()
          Get the Schema Helper
 java.lang.String getVersion()
          Get the schema version
 ReloadVocabularyList getVocabularyList(DomPath domPath)
          Get the Vocabulary list for a given element or attribute.
 ReloadVocabularyList getVocabularyList(ReloadSchemaNode schemaNode)
          Get the Vocabulary list for a given element or attribute.
 ReloadVocabularyList getVocabularyList(ReloadSchemaNode schemaNode, ReloadDocument doc)
          Get the Vocabulary list for a given element or attribute.
 java.lang.String getWidgetType(DomPath domPath)
          Get the widget type of the element from the helper file or null if not set
 void loadSchema(java.io.File schemaFile)
          Load the Schema File
 void loadSchemaHelper(java.io.File fileHelper)
          Load the Schema Helper File
 void loadVocab(java.io.File fileVocab)
          Load the Vocabulary Helper File
 void setDefaultVocabLanguage(java.lang.String lang)
          Set the Default Language for the Language vocabulary
 void setVersion(java.lang.String version)
          Set the Version String of the Schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_version

protected java.lang.String _version
The version String


_reloadSchema

protected ReloadSchema _reloadSchema
The Schema that will be our template


_schemaFile

protected java.io.File _schemaFile
The Schema File


_schemaHelper

protected ReloadSchemaHelper _schemaHelper
The Schema Helper that we will query


_vocab

protected ReloadVocabulary _vocab
The Reload Schema Vocabulary

Constructor Detail

ReloadSchemaController

public ReloadSchemaController()
Default Constructor


ReloadSchemaController

public ReloadSchemaController(java.io.File fileSchema,
                              java.io.File fileHelper,
                              java.io.File fileVocab)
                       throws ReloadSchemaException
Constructor

Parameters:
fileSchema - the schema file
fileHelper - the schema helper file that we will query
fileVocab - the reload vocabulary file
Throws:
ReloadSchemaException
Method Detail

loadSchema

public void loadSchema(java.io.File schemaFile)
                throws ReloadSchemaException
Load the Schema File

Parameters:
schemaFile - the schema file
Throws:
ReloadSchemaException

loadSchemaHelper

public void loadSchemaHelper(java.io.File fileHelper)
                      throws ReloadSchemaException
Load the Schema Helper File

Parameters:
fileHelper - the schema helper file
Throws:
ReloadSchemaException

loadVocab

public void loadVocab(java.io.File fileVocab)
               throws ReloadSchemaException
Load the Vocabulary Helper File

Parameters:
fileVocab - the vocabulary helper file
Throws:
ReloadSchemaException

setDefaultVocabLanguage

public void setDefaultVocabLanguage(java.lang.String lang)
Set the Default Language for the Language vocabulary


getVersion

public java.lang.String getVersion()
Get the schema version

Returns:
the Version String of the Schema. This will be one of the constants in IMSDocumentHandler

setVersion

public void setVersion(java.lang.String version)
Set the Version String of the Schema. This will be one of the constants in IMSDocumentHandler

Parameters:
version - the schema version

getReloadSchemaNode

public ReloadSchemaNode getReloadSchemaNode(DomPath domPath)
For each JDOM Path there is a corresponding ReloadSchemaNode. This method finds that corresponding ReloadSchemaNode in this Schema and returns it or null if not found.

Parameters:
domPath - the Path to find the ReloadSchemaElement or ReloadSchemaAttribute
Returns:
The ReloadSchemaNode or null if not found

getElementHelperValue

public java.lang.String getElementHelperValue(DomPath domPath,
                                              java.lang.String helperKey)
Get a Helper value for a given key

Parameters:
domPath - the path to find the ReloadSchemaNode
helperKey - the helper key to get a value from the schema helper file
Returns:
a Helper value for a given key

getElementFriendlyName

public java.lang.String getElementFriendlyName(DomPath domPath)
Get a friendly name for a schema element

Parameters:
domPath - the path to find the ReloadSchemaNode
Returns:
a friendly name

getElementTip

public java.lang.String getElementTip(DomPath domPath)
Get an element tip

Parameters:
domPath - the path to find the ReloadSchemaNode
Returns:
a tip for an element

getWidgetType

public java.lang.String getWidgetType(DomPath domPath)
Get the widget type of the element from the helper file or null if not set

Parameters:
domPath - the path to find the ReloadSchemaElement
Returns:
the widget type or null if not set

getRootElementName

public abstract java.lang.String getRootElementName()
Get the root element name

Returns:
The root element name

getVocabularyList

public ReloadVocabularyList getVocabularyList(ReloadSchemaNode schemaNode)
Get the Vocabulary list for a given element or attribute. We first of all look to see if we have a Helper Vocabulary defined. If not, look for one as defined in the Schema.

Parameters:
schemaNode - The Element or Attribute for which to get the vocab list
Returns:
The Vocabulary List or null if no list present

getVocabularyList

public ReloadVocabularyList getVocabularyList(DomPath domPath)
Get the Vocabulary list for a given element or attribute. We first of all look to see if we have a Helper Vocabulary defined. If not, look for one as defined in the Schema.

Parameters:
domPath - the path of the Element or Attribute for which to get the vocab list
Returns:
The Vocabulary List or null if no list present

getVocabularyList

public ReloadVocabularyList getVocabularyList(ReloadSchemaNode schemaNode,
                                              ReloadDocument doc)
Get the Vocabulary list for a given element or attribute. We first of all look to see if we have a Helper Vocabulary defined. If not, look for one as defined in the Schema.

Parameters:
schemaNode - The Element or Attribute for which to get the vocab list
doc - the ReloadDocument instance
Returns:
The Vocabulary List or null if no list present

getDefaultValue

public java.lang.String getDefaultValue(ReloadSchemaNode schemaNode)
Get the default value of a ReloadSchemaNode

Parameters:
schemaNode - the ReloadSchemaNode concerned
Returns:
The default value or null

getFacetValue

public java.lang.String getFacetValue(ReloadSchemaNode schemaNode,
                                      java.lang.String facetName)
Get a Facet value of an Element or attribute. Will look in the Helper file first and then the Schema. The Facet has to be a valid Schema type Facet.

Parameters:
schemaNode - the ReloadSchema Element or Attribute concerned
facetName - the name of the facet for which we need a value
Returns:
a Facet value of an Element or attribute.

getReloadSchema

public ReloadSchema getReloadSchema()
Return the ReloadSchema connected with this Controller

Returns:
the ReloadSchema connected with this controller

getSchemaFile

public java.io.File getSchemaFile()
Get the Schema File for this Schema

Returns:
the Schema File for this Schema

getSchemaHelper

public ReloadSchemaHelper getSchemaHelper()
Get the Schema Helper

Returns:
The Schema Helper

VdexReload 1.1.3 API