net.datacrow.core.modules.xml
Class XmlModule

java.lang.Object
  extended by net.datacrow.core.modules.xml.XmlObject
      extended by net.datacrow.core.modules.xml.XmlModule

public class XmlModule
extends XmlObject

A XML representation of a module.

Author:
Robert Jan van der Waals

Constructor Summary
XmlModule()
          Creates an empty instance.
XmlModule(byte[] xml)
          Creates a new instance.
XmlModule(XmlModule template)
          Create a new module based on the provided existing XML module.
 
Method Summary
 boolean canBeLend()
          Tells if items belonging to this module can be lend.
 int getChildIndex()
          Retrieves the child module index.
 int getDefaultSortFieldIdx()
          The field to be sorted / ordered on by default.
 java.lang.String getDescription()
          The description for this module.
 int getDisplayIndex()
          The position of this module as displayed in the module bar.
 org.w3c.dom.Document getDocument()
          The XML document.
 java.util.Collection<XmlField> getFields()
          Retrieves the XML field definitions.
 byte[] getIcon16()
          The small icon bytes.
 java.lang.String getIcon16Filename()
          Retrieves the small icon file name.
 byte[] getIcon32()
          The large icon bytes.
 java.lang.String getIcon32Filename()
          Retrieves the large icon file name.
 java.lang.Class getImporter()
          Retrieves the file importer class.
 int getIndex()
          The unique index of the module.
 java.lang.String getJarFilename()
          Retrieves the JAR filename in which this module is / will be stored.
 javax.swing.KeyStroke getKeyStroke()
          The key combination associated with this module.
 java.lang.String getLabel()
          The display label.
 java.lang.Class getModuleClass()
          The module class.
 java.lang.String getName()
          The internal name.
 int getNameFieldIdx()
          Retrieves the index for the field which holds the name of an item.
 java.lang.Class getObjectClass()
          Returns the items object class.
 java.lang.String getObjectName()
          System name for items belonging to this module.
 java.lang.String getObjectNamePlural()
          System plural name for items belonging to this module.
 int getParentIndex()
          The parent module index.
 java.lang.String getProductVersion()
          Retrieves the Data Crow version number for which this module has been created.
 java.lang.Class getSynchronizer()
          The synchronize class (or mass update).
 java.lang.String getTableName()
          The database table name.
 java.lang.String getTableNameShort()
          The database table short name.
 boolean hasDependingModules()
          Indicates if other modules are depending on this module.
 boolean hasInsertView()
          Indicates if the module support insert views.
 boolean hasSearchView()
          Indicates if the module support search views.
 boolean isChanged()
          Indicates if customizations have been made.
 boolean isContainerManaged()
          Indicates if items belonging to this module can be part of a container.
 boolean isEnabled()
          Is the module enabled?
 boolean isFileBacked()
          Indicates if items belonging to this module are file based.
 boolean isServingMultipleModules()
          Indicates if multiple modules are using this module.
 void setCanBeLend(boolean canBeLend)
          Indicate if items belonging to this module can be lend.
 void setChildIndex(int childIndex)
          Indicate which module is the child for this module.
 void setContainerManaged(boolean isContainerManaged)
          Indicate if items belonging to this module can be part of a container.
 void setDefaultSortFieldIdx(int defaultSortFieldIdx)
          Set the default field to sort / order on.
 void setDescription(java.lang.String description)
          Set the description for this module.
 void setDisplayIndex(int displayIndex)
          Set the module bar position for this module.
 void setDocument(org.w3c.dom.Document document)
          Set the XML document.
 void setEnabled(boolean enabled)
          Mark the field as enabled.
 void setFields(java.util.Collection<XmlField> fields)
          Set the XML field definitions.
 void setFileBacked(boolean isFileBacked)
          Indicate if items belonging to this module are file based.
 void setHasDependingModules(boolean hasDependingModules)
          Indicate if other modules are depending on this module.
 void setHasInsertView(boolean hasInsertView)
          Indicate if the insert view is supported.
 void setHasSearchView(boolean hasSearchView)
          Indicate if the search view is supported.
 void setIcon16(byte[] b)
          Set the small icon bytes.
 void setIcon16Filename(java.lang.String icon16Filename)
          Sets the small icon filename.
 void setIcon32(byte[] b)
          Set the large icon bytes.
 void setIcon32Filename(java.lang.String icon32Filename)
          Sets the large icon filename.
 void setImporter(java.lang.Class importer)
          Sets the file imported class.
 void setIndex(int index)
          Set the unique index for this module.
 void setKeyStroke(javax.swing.KeyStroke keyStroke)
          Set the key combination to activate this module.
 void setLabel(java.lang.String label)
          Sets the display label.
 void setModuleClass(java.lang.Class moduleClass)
          Set the module class.
 void setName(java.lang.String name)
          The system name of this module.
 void setNameFieldIdx(int nameFieldIdx)
          Indicate which field holds the name of an item.
 void setObject(java.lang.Class object)
          Sets the object class.
 void setObjectName(java.lang.String objectName)
          Sets the system name for items belonging to this module.
 void setObjectNamePlural(java.lang.String objectNamePlural)
          Sets the system plural name for items belonging to this module.
 void setParentIndex(int parentIndex)
          Indicate which module is the parent of this module.
 void setProductVersion(java.lang.String productVersion)
          Sets the Data Crow version number for which this module has been created.
 void setServingMultipleModules(boolean isServingMultipleModules)
          Indicate if multiple modules are using this module.
 void setSynchronizer(java.lang.Class synchronizer)
          Set the synchronize class (or mass update).
 void setTableName(java.lang.String tableName)
          Sets the database table name.
 void setTableNameShort(java.lang.String tableNameShort)
          Sets the database table short name.
 
Methods inherited from class net.datacrow.core.modules.xml.XmlObject
getClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlModule

public XmlModule()
Creates an empty instance.


XmlModule

public XmlModule(XmlModule template)
Create a new module based on the provided existing XML module.

Parameters:
template -

XmlModule

public XmlModule(byte[] xml)
          throws InvalidModuleXmlException,
                 ModuleUpgradeException
Creates a new instance.

Parameters:
xml - The XML file byte content
Throws:
InvalidModuleXmlException
ModuleUpgradeException
Method Detail

isChanged

public boolean isChanged()
Indicates if customizations have been made.


canBeLend

public boolean canBeLend()
Tells if items belonging to this module can be lend.


getChildIndex

public int getChildIndex()
Retrieves the child module index.

Returns:
The index or -1.

getDescription

public java.lang.String getDescription()
The description for this module.


getDocument

public org.w3c.dom.Document getDocument()
The XML document.


isEnabled

public boolean isEnabled()
Is the module enabled?


getFields

public java.util.Collection<XmlField> getFields()
Retrieves the XML field definitions.


hasInsertView

public boolean hasInsertView()
Indicates if the module support insert views.


hasSearchView

public boolean hasSearchView()
Indicates if the module support search views.


getImporter

public java.lang.Class getImporter()
Retrieves the file importer class.

See Also:
FileImporter

getIndex

public int getIndex()
The unique index of the module.


getKeyStroke

public javax.swing.KeyStroke getKeyStroke()
The key combination associated with this module.


getLabel

public java.lang.String getLabel()
The display label.


getName

public java.lang.String getName()
The internal name.


getObjectClass

public java.lang.Class getObjectClass()
Returns the items object class.


getObjectName

public java.lang.String getObjectName()
System name for items belonging to this module.


getObjectNamePlural

public java.lang.String getObjectNamePlural()
System plural name for items belonging to this module.


getModuleClass

public java.lang.Class getModuleClass()
The module class.


getSynchronizer

public java.lang.Class getSynchronizer()
The synchronize class (or mass update).

Returns:
The class or null.
See Also:
DefaultSynchronizer

getTableName

public java.lang.String getTableName()
The database table name.


getTableNameShort

public java.lang.String getTableNameShort()
The database table short name.


hasDependingModules

public boolean hasDependingModules()
Indicates if other modules are depending on this module.


getDisplayIndex

public int getDisplayIndex()
The position of this module as displayed in the module bar.


getDefaultSortFieldIdx

public int getDefaultSortFieldIdx()
The field to be sorted / ordered on by default.


getParentIndex

public int getParentIndex()
The parent module index.

Returns:
The index or -1.

getNameFieldIdx

public int getNameFieldIdx()
Retrieves the index for the field which holds the name of an item.


setCanBeLend

public void setCanBeLend(boolean canBeLend)
Indicate if items belonging to this module can be lend.

Parameters:
canBeLend -

setChildIndex

public void setChildIndex(int childIndex)
Indicate which module is the child for this module.

Parameters:
childIndex - The module index of the child.

setDefaultSortFieldIdx

public void setDefaultSortFieldIdx(int defaultSortFieldIdx)
Set the default field to sort / order on.

Parameters:
defaultSortFieldIdx - The field index.

setDescription

public void setDescription(java.lang.String description)
Set the description for this module.

Parameters:
description -

setDisplayIndex

public void setDisplayIndex(int displayIndex)
Set the module bar position for this module.

Parameters:
displayIndex -

setDocument

public void setDocument(org.w3c.dom.Document document)
Set the XML document.

Parameters:
document -

setEnabled

public void setEnabled(boolean enabled)
Mark the field as enabled.

Parameters:
enabled -

setFields

public void setFields(java.util.Collection<XmlField> fields)
Set the XML field definitions.

Parameters:
fields -

setHasDependingModules

public void setHasDependingModules(boolean hasDependingModules)
Indicate if other modules are depending on this module.

Parameters:
hasDependingModules -

setHasInsertView

public void setHasInsertView(boolean hasInsertView)
Indicate if the insert view is supported.

Parameters:
hasInsertView -

setHasSearchView

public void setHasSearchView(boolean hasSearchView)
Indicate if the search view is supported.

Parameters:
hasSearchView -

setImporter

public void setImporter(java.lang.Class importer)
Sets the file imported class.

Parameters:
importer -

setIndex

public void setIndex(int index)
Set the unique index for this module.

Parameters:
index -

setKeyStroke

public void setKeyStroke(javax.swing.KeyStroke keyStroke)
Set the key combination to activate this module.

Parameters:
keyStroke -

setLabel

public void setLabel(java.lang.String label)
Sets the display label.

Parameters:
label -

setModuleClass

public void setModuleClass(java.lang.Class moduleClass)
Set the module class.

Parameters:
moduleClass -

setName

public void setName(java.lang.String name)
The system name of this module.

Parameters:
name -

setNameFieldIdx

public void setNameFieldIdx(int nameFieldIdx)
Indicate which field holds the name of an item.

Parameters:
nameFieldIdx - The field index.

setObject

public void setObject(java.lang.Class object)
Sets the object class.

Parameters:
object -

setObjectName

public void setObjectName(java.lang.String objectName)
Sets the system name for items belonging to this module.

Parameters:
objectName -

setObjectNamePlural

public void setObjectNamePlural(java.lang.String objectNamePlural)
Sets the system plural name for items belonging to this module.

Parameters:
objectNamePlural -

setParentIndex

public void setParentIndex(int parentIndex)
Indicate which module is the parent of this module.

Parameters:
parentIndex - The module index.

setSynchronizer

public void setSynchronizer(java.lang.Class synchronizer)
Set the synchronize class (or mass update).

Parameters:
synchronizer -

setTableName

public void setTableName(java.lang.String tableName)
Sets the database table name.

Parameters:
tableName -

setTableNameShort

public void setTableNameShort(java.lang.String tableNameShort)
Sets the database table short name.

Parameters:
tableNameShort -

getIcon16Filename

public java.lang.String getIcon16Filename()
Retrieves the small icon file name.


setIcon16Filename

public void setIcon16Filename(java.lang.String icon16Filename)
Sets the small icon filename.

Parameters:
icon16Filename -

getIcon32Filename

public java.lang.String getIcon32Filename()
Retrieves the large icon file name.


setIcon32Filename

public void setIcon32Filename(java.lang.String icon32Filename)
Sets the large icon filename.

Parameters:
icon32Filename -

isFileBacked

public boolean isFileBacked()
Indicates if items belonging to this module are file based.


setFileBacked

public void setFileBacked(boolean isFileBacked)
Indicate if items belonging to this module are file based.

Parameters:
isFileBacked -

isContainerManaged

public boolean isContainerManaged()
Indicates if items belonging to this module can be part of a container.


setContainerManaged

public void setContainerManaged(boolean isContainerManaged)
Indicate if items belonging to this module can be part of a container.

Parameters:
isContainerManaged -

isServingMultipleModules

public boolean isServingMultipleModules()
Indicates if multiple modules are using this module.


setServingMultipleModules

public void setServingMultipleModules(boolean isServingMultipleModules)
Indicate if multiple modules are using this module.

Parameters:
isServingMultipleModules -

getJarFilename

public java.lang.String getJarFilename()
Retrieves the JAR filename in which this module is / will be stored.


getIcon16

public byte[] getIcon16()
The small icon bytes.


getIcon32

public byte[] getIcon32()
The large icon bytes.


setIcon16

public void setIcon16(byte[] b)
Set the small icon bytes.

Parameters:
b - The icon.

setIcon32

public void setIcon32(byte[] b)
Set the large icon bytes.

Parameters:
b - The icon.

getProductVersion

public java.lang.String getProductVersion()
Retrieves the Data Crow version number for which this module has been created.


setProductVersion

public void setProductVersion(java.lang.String productVersion)
Sets the Data Crow version number for which this module has been created.