VdexReload 1.1.3 API

uk.ac.reload.editor.metadata
Class Metadata

java.lang.Object
  extended byuk.ac.reload.moonunit.dom.ReloadDocument
      extended byuk.ac.reload.moonunit.dom.ReloadSchemaDocument
          extended byuk.ac.reload.editor.metadata.Metadata
All Implemented Interfaces:
AbstractMetadata
Direct Known Subclasses:
VocabularyMetadata

public class Metadata
extends ReloadSchemaDocument
implements AbstractMetadata

The Metadata Class


Nested Class Summary
 
Nested classes inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
ReloadSchemaDocument.UndoableAddAction, ReloadSchemaDocument.UndoableCopyAction, ReloadSchemaDocument.UndoableCutAction, ReloadSchemaDocument.UndoableDeleteAction, ReloadSchemaDocument.UndoableMoveAction, ReloadSchemaDocument.UndoablePasteAction
 
Field Summary
protected  boolean _isStandalone
          Whether we are a standalone file or attached
 
Fields inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
_controller, _undoHandler
 
Fields inherited from class uk.ac.reload.moonunit.dom.ReloadDocument
_dirty, _doc, _file
 
Constructor Summary
Metadata(boolean isStandalone)
          Constructor for blank MD
Metadata(org.jdom.Element mdElement, MetadataSchemaController schemaController)
          Constructor for a non-standalone MD that has existing MD Element
Metadata(java.io.File file, org.jdom.Document doc, MetadataSchemaController schemaController)
          Constructor for a Standalone MD File that exists
 
Method Summary
 boolean canCopyElement(org.jdom.Element element)
          Whether we can copy and element or not
 boolean canCutElement(org.jdom.Element element, ReloadSchemaElement schemaElement)
          Whether we can cut an element or not
 boolean canPasteFromClipboard(org.jdom.Element element)
          Whether we can paste an element or not
 void exportMetadata(java.io.File file)
          Export the MD from a CP or Vocabulary node to a standalone file
 java.lang.String[] getComments()
          Get the comments to add to the XML document
 org.jdom.Namespace getSchemaNamespace()
          Get the appropriate Namespace
 org.jdom.Namespace getSchemaNamespaceEmbedded()
          Get the embedded Namespace
 org.jdom.Namespace getSchemaNamespaceStandalone()
          Get the standalone Namespace
 java.lang.String getTargetRootElementName()
          Get the Target Root element name
 void importMetadata(org.jdom.Document doc, MetadataSchemaController controller)
          Set the Metadata to an Imported Metadata Document
 boolean isStandalone()
          Return whether we are a standalone file
 void newDocument(MetadataSchemaController controller)
          Setup the JDOM Document with Namespaces and root element
 
Methods inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
addAttribute, addComments, addElement, addElementAtIndex, addElementBySchema, addElementBySchemaUndoable, addElementUndoable, addElementUnique, addReloadDocumentListener, canAddElement, canDeleteElement, canMoveElementDown, canMoveElementUp, changedElement, copyElementUndoable, cutElementUndoable, deleteElementUndoable, destroy, fireDocumentSaved, fireElementAdded, fireElementChanged, fireElementRemoved, getElement, getElement, getElements, getElements, getIndexOfElement, getInsertPositionOfAttribute, getInsertPositionOfElement, getReloadSchemaController, getTargetNamespace, getUndoHandler, isAllowedChild, moveElementDown, moveElementUndoable, moveElementUp, pasteElementUndoable, removeElement, removeReloadDocumentListener, saveDocument, setReloadSchemaController, setUndoHandler
 
Methods inherited from class uk.ac.reload.moonunit.dom.ReloadDocument
getDocument, getFile, getRootElement, isDirty, isDocumentNamespace, isMemberOfSameDocument, loadDocument, saveAsDocument, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isStandalone

protected boolean _isStandalone
Whether we are a standalone file or attached

Constructor Detail

Metadata

public Metadata(boolean isStandalone)
Constructor for blank MD

Parameters:
isStandalone - whether we are standalone file or attached

Metadata

public Metadata(java.io.File file,
                org.jdom.Document doc,
                MetadataSchemaController schemaController)
Constructor for a Standalone MD File that exists

Parameters:
file - the XML file doc the JDOM document of the XML file schemaController the ReloadSchemaController corresponding to the schema of the XML file

Metadata

public Metadata(org.jdom.Element mdElement,
                MetadataSchemaController schemaController)
Constructor for a non-standalone MD that has existing MD Element

Parameters:
mdElement - the metadata element
schemaController - the ReloadSchemaController corresponding to the schema of the XML file
Method Detail

newDocument

public void newDocument(MetadataSchemaController controller)
Setup the JDOM Document with Namespaces and root element

Parameters:
controller - the MetadataSchemaController used for obtaining the ReloadSchema

getTargetRootElementName

public java.lang.String getTargetRootElementName()
Description copied from class: ReloadSchemaDocument
Get the Target Root element name

Specified by:
getTargetRootElementName in class ReloadSchemaDocument
Returns:
the Root element name

getComments

public java.lang.String[] getComments()
Description copied from class: ReloadSchemaDocument
Get the comments to add to the XML document

Specified by:
getComments in class ReloadSchemaDocument
Returns:
the Comments to add to the XML Document

importMetadata

public void importMetadata(org.jdom.Document doc,
                           MetadataSchemaController controller)
                    throws ReloadEditorException
Set the Metadata to an Imported Metadata Document

Parameters:
doc - the imported metadata document controller the MetadataSchemaController
Throws:
ReloadEditorException

exportMetadata

public void exportMetadata(java.io.File file)
                    throws ReloadEditorException
Export the MD from a CP or Vocabulary node to a standalone file

Parameters:
file - the metadata XML file
Throws:
ReloadEditorException

isStandalone

public boolean isStandalone()
Return whether we are a standalone file

Returns:
true if we are standalone, false otherwise

getSchemaNamespace

public org.jdom.Namespace getSchemaNamespace()
Get the appropriate Namespace

Overrides:
getSchemaNamespace in class ReloadSchemaDocument
Returns:
the appropriate schema namespace

getSchemaNamespaceStandalone

public org.jdom.Namespace getSchemaNamespaceStandalone()
Get the standalone Namespace

Returns:
the standalone schema namespace

getSchemaNamespaceEmbedded

public org.jdom.Namespace getSchemaNamespaceEmbedded()
Get the embedded Namespace

Returns:
the embedded schema namespace

canCopyElement

public boolean canCopyElement(org.jdom.Element element)
Whether we can copy and element or not

Overrides:
canCopyElement in class ReloadSchemaDocument
Parameters:
element - the element concerned
Returns:
true if we can copy the given element, false otherwise

canCutElement

public boolean canCutElement(org.jdom.Element element,
                             ReloadSchemaElement schemaElement)
Whether we can cut an element or not

Overrides:
canCutElement in class ReloadSchemaDocument
Parameters:
element - the element concerned
schemaElement - the ReloadSchemaElement
Returns:
true if we can cut the given element, false otherwise

canPasteFromClipboard

public boolean canPasteFromClipboard(org.jdom.Element element)
Whether we can paste an element or not

Overrides:
canPasteFromClipboard in class ReloadSchemaDocument
Parameters:
element - the element concerned
Returns:
true if we can paste the given element, false otherwise

VdexReload 1.1.3 API