OBEROn SDK

com.oberon.ooql.sdk
Class Class

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
          extended by com.oberon.ooql.sdk.Class
All Implemented Interfaces:
java.io.Serializable

public class Class
extends AdminBase
implements java.io.Serializable

Class Admin Object: defines an OBEROn object [ObjectObj] type.

Version:
5.0
See Also:
Serialized Form

Field Summary
static int ABSTRACT_OPTION
          The Abstract flag index inside the Option Set
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Class()
           
Class(java.lang.String name)
           
 
Method Summary
 void addField(java.lang.String fieldName)
          Add a Field to this Class; overrides the super-Class Field with the same name if present
 void addMethod(java.lang.String programName)
          Add a method (Program) to this Class; overrides the super-Class method with the same name if present
 void addTrigger(Trigger trigger)
          Add a Trigger to this Class; overrides the super-Class Trigger for the same events if present
 java.lang.String compareUpdate(Class refClass, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this Class object and let it become equals to another reference object.
 void create(boolean force, Framework framework)
          Create a new Class object on the database
 void create(Framework framework)
          Create a new Class object on the database
 void destroy(Framework framework)
          Remove the Class object from the database
 void fromXML(org.jdom.Element rootElement)
          Load the Class object properties from XML element tree
 java.util.Vector<java.lang.String> getAutoNumbers(Framework framework)
          Return the list of AutoNumbers defined for this Class
 java.lang.String getAutoNumbersAsString(java.lang.String delim, Framework framework)
          Return the list of AutoNumber defined for this Class, as a String
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this Class object with the settled properties
 java.lang.String getDefaultForm(boolean top)
          Get the default Form to create/edit ObjectObjs of this Class type.
 java.util.Vector<java.lang.String> getFields()
          Return a full list of Fields for this Class; inherited Fields are included
 java.lang.String getFieldsAsString(java.lang.String delim)
          Return the full list of Fields for this Class, as a String
 java.util.Vector<java.lang.String> getLifecycles(Framework framework)
          Return the list of Lifecycles allowed for this Class
 java.lang.String getLifecyclesAsString(java.lang.String delim, Framework framework)
          Return the list of Lifecycles allowed for this Class, as a String
 java.util.Vector<java.lang.String> getLinkTypes(Framework framework)
          Return the list of LinkTypes allowed for this Class
 java.lang.String getLinkTypesAsString(java.lang.String delim, Framework framework)
          Return the list of LinkTypes allowed for this Class, as a String
 java.util.Vector<java.lang.String> getMethods()
          Return a full list of methods for this Class; inherited methods are included
 java.lang.String getMethodsAsString(java.lang.String delim)
          Return the full list of methods for this Class, as a String
 java.lang.String getOwnDefaultForm()
          Get the default Form to create/edit ObjectObjs of this Class type.
 java.util.Vector<java.lang.String> getOwnFields()
          Return the list of own Fields for this Class; inherited Fields are excluded
 java.lang.String getOwnFieldsAsString(java.lang.String delim)
          Return the list of own Fields, as a String
 java.util.Vector<java.lang.String> getOwnMethods()
          Return the list of own methods defined for this Class; inherited methods are excluded
 java.lang.String getOwnMethodsAsString(java.lang.String delim)
          Return the list of own methods, as a String
 java.util.Vector<java.lang.String> getOwnSubClasses(Framework framework)
          Return the list of sub-Classes directly derived from this Class
 java.lang.String getOwnSubClassesAsString(java.lang.String delim, Framework framework)
          Return the list of sub-Classes directly derived from this Class, as a String
 java.util.Vector<Trigger> getOwnTriggers()
          Return the list of own Triggers defined for this Class; inherited Triggers are excluded
 java.lang.String getOwnTriggersAsString(java.lang.String delim)
          Return the list of own Program-Triggers, as a String
 java.lang.String getOwnWorkflowAsString(java.lang.String delim)
          Return the full list of own Workflow-Triggers, as a String
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
          Get a property for this Class object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this Class object with the modified properties.
 java.util.Vector<java.lang.String> getSubClasses(Framework framework)
          Return the full list of sub-Classes derived from this Class
 java.lang.String getSubClassesAsString(java.lang.String delim, Framework framework)
          Return the full list of sub-Classes derived from this Class, as a String
 java.lang.String getSuperClass()
          Get the super-Class name for this Class.
 java.util.Vector<java.lang.String> getSuperClasses()
          Get the super-Classes for this Class.
 Class getSuperClassObj()
          Get the super-Class administrative object for this Class.
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 Trigger getTriggerByEvent(java.lang.String event)
          Get the Program-Trigger for a specific event
 java.util.Vector<Trigger> getTriggers()
          Return a full list of Triggers for this Class; inherited Triggers are included
 java.lang.String getTriggersAsString(java.lang.String delim)
          Return the full list of Program-Triggers, as a String
 java.lang.String getWorkflowAsString(java.lang.String delim)
          Return the full list of Workflow-Triggers, as a String
 Trigger getWorkflowByEvent(java.lang.String event)
          Get the Workflow-Trigger for a specific event
 boolean isAbstract()
          Check if the Class is abstract.
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Class object: connect the memory instance with the database instance
static Class open(java.lang.String name, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open an administrative object and read properties from the database or retrieve them from memory
 void removeField(java.lang.String fieldName)
          Remove a Field from this Class; values for all instantiated ObjectObjs will be lost
 void removeMethod(java.lang.String programName)
          Remove method (Program) from this Class
 void removeTrigger(Trigger trigger)
          Remove a Trigger from this Class
 void setAbstract(boolean abstractFlag)
          Set the abstract flag for this Class.
 void setDefaultForm(java.lang.String defaultForm)
          Set the default Form to create/edit ObjectObjs of this Class type.
 void setSuperClass(java.lang.String className)
          Set a super-Class for this Class.
 void setSuperClassObj(Class classObj)
          Set a super-Class for this Class.
 void setTriggers(java.util.Vector<Trigger> triggers)
          Set Triggers for this Class; overrides the super-Class Triggers for the same events if present
 java.lang.String toString()
          Return the Class object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the Class object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Class object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Class object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateFields(java.util.Vector<java.lang.String> fields)
          Update the fields on the basis of a given list
 void updateMethods(java.util.Vector<java.lang.String> methods)
          Update the methods on the basis of a given list
 void updateTriggers(java.util.Vector<Trigger> triggers)
          Update the triggers on the basis of a given list
 void write(boolean force, Framework framework)
          Update the Class object to the database
 void write(Framework framework)
          Update the Class object to the database
 
Methods inherited from class com.oberon.ooql.sdk.AdminBase
addFeature, changedApplication, checkChangeName, checkCounters, checkCounters, getAdminType, getApplication, getCommonProperty, getCommonTargetNames, getCounters, getCreateBasicCommand, getCreateCommand, getCrtDate, getDescription, getEditBasicCommand, getFeature, getFeatures, getFeaturesAsString, getImage, getImage, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, getPlainFeatures, getSaveCommand, getSVNRevision, getXMLFeatureList, hasImage, isHidden, setApplication, setCounters, setCrtDate, setDescription, setHidden, setImage, setImageData, setImageFile, setModDate, setModUser, setName, setSVNRevision, show, show, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ABSTRACT_OPTION

public static final int ABSTRACT_OPTION
The Abstract flag index inside the Option Set

See Also:
Constant Field Values
Constructor Detail

Class

public Class()

Class

public Class(java.lang.String name)
      throws OberonException
Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static Class open(java.lang.String name,
                         Framework framework,
                         java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                  throws OberonException
Open an administrative object and read properties from the database or retrieve them from memory

Parameters:
name - the object name
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(Framework framework,
                 java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          throws OberonException
Open the Class object: connect the memory instance with the database instance

Specified by:
link in class AdminBase
Parameters:
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create a new Class object on the database

Specified by:
create in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

create

public void create(boolean force,
                   Framework framework)
            throws OberonException
Create a new Class object on the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

write

public void write(Framework framework)
           throws OberonException
Update the Class object to the database

Specified by:
write in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(boolean force,
                  Framework framework)
           throws OberonException
Update the Class object to the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

unlink

public void unlink(Framework framework)
            throws OberonException
Close the object: disconnect the memory instance from the database instance

Specified by:
unlink in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the Class object from the database

Specified by:
destroy in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

setSuperClass

public void setSuperClass(java.lang.String className)
Set a super-Class for this Class. OBEROn allows class extension: when a Class is derived from another it recursively inherits all its properties: fields, methods, triggers, lifecycles etc. Properties defined for this Class override the super-Class properties with the same name.

Parameters:
className - the super-Class name

setSuperClassObj

public void setSuperClassObj(Class classObj)
Set a super-Class for this Class. OBEROn allows class extension: when a Class is derived from another it recursively inherits all its properties: fields, methods, triggers, lifecycles etc. Properties defined for this Class override the super-Class properties with the same name.

Parameters:
classObj - the super-Class administrative object

getSuperClass

public java.lang.String getSuperClass()
Get the super-Class name for this Class.

Returns:
the super-Class name

getSuperClassObj

public Class getSuperClassObj()
Get the super-Class administrative object for this Class.

Returns:
the super-Class administrative object

getSuperClasses

public java.util.Vector<java.lang.String> getSuperClasses()
Get the super-Classes for this Class. Reports the Class hierarchy.

Returns:
Vector of super-Class names

setAbstract

public void setAbstract(boolean abstractFlag)
Set the abstract flag for this Class. When a Class is abstract it cannot be instantiated.

Parameters:
abstractFlag - true to define the Class as abstract

isAbstract

public boolean isAbstract()
Check if the Class is abstract.

Returns:
the abstract flag

addField

public void addField(java.lang.String fieldName)
Add a Field to this Class; overrides the super-Class Field with the same name if present

Parameters:
fieldName - the name of the Field to add

removeField

public void removeField(java.lang.String fieldName)
Remove a Field from this Class; values for all instantiated ObjectObjs will be lost

Parameters:
fieldName - the name of the Field to remove

updateFields

public void updateFields(java.util.Vector<java.lang.String> fields)
Update the fields on the basis of a given list

Parameters:
fields - list of Field's names
Since:
4.0

getOwnFields

public java.util.Vector<java.lang.String> getOwnFields()
Return the list of own Fields for this Class; inherited Fields are excluded

Returns:
Vector of Field names

getOwnFieldsAsString

public java.lang.String getOwnFieldsAsString(java.lang.String delim)
Return the list of own Fields, as a String

Parameters:
delim - the separator item
Returns:
list of Field names separated by the delim characters

getFields

public java.util.Vector<java.lang.String> getFields()
Return a full list of Fields for this Class; inherited Fields are included

Returns:
Vector of Field names

getFieldsAsString

public java.lang.String getFieldsAsString(java.lang.String delim)
Return the full list of Fields for this Class, as a String

Parameters:
delim - the separator item
Returns:
list of Field names separated by the delim characters

addMethod

public void addMethod(java.lang.String programName)
Add a method (Program) to this Class; overrides the super-Class method with the same name if present

Parameters:
programName - the name of the Program to add as a Class method
See Also:
Program

removeMethod

public void removeMethod(java.lang.String programName)
Remove method (Program) from this Class

Parameters:
programName - the name of the Program to remove

updateMethods

public void updateMethods(java.util.Vector<java.lang.String> methods)
Update the methods on the basis of a given list

Parameters:
methods - list of Program's names
Since:
4.0

getOwnMethods

public java.util.Vector<java.lang.String> getOwnMethods()
Return the list of own methods defined for this Class; inherited methods are excluded

Returns:
Vector of method (Program) names

getOwnMethodsAsString

public java.lang.String getOwnMethodsAsString(java.lang.String delim)
Return the list of own methods, as a String

Parameters:
delim - the separator item
Returns:
list of method (Program) names separated by the delim characters

getMethods

public java.util.Vector<java.lang.String> getMethods()
Return a full list of methods for this Class; inherited methods are included

Returns:
Vector of method (Program) names

getMethodsAsString

public java.lang.String getMethodsAsString(java.lang.String delim)
Return the full list of methods for this Class, as a String

Parameters:
delim - the separator item
Returns:
list of method (Program) names separated by the delim characters

setDefaultForm

public void setDefaultForm(java.lang.String defaultForm)
Set the default Form to create/edit ObjectObjs of this Class type.

Parameters:
defaultForm - the default create/edit Form

getOwnDefaultForm

public java.lang.String getOwnDefaultForm()
Get the default Form to create/edit ObjectObjs of this Class type.


getDefaultForm

public java.lang.String getDefaultForm(boolean top)
Get the default Form to create/edit ObjectObjs of this Class type.


setTriggers

public void setTriggers(java.util.Vector<Trigger> triggers)
Set Triggers for this Class; overrides the super-Class Triggers for the same events if present

Parameters:
triggers - a vector of Triggers

addTrigger

public void addTrigger(Trigger trigger)
                throws OberonException
Add a Trigger to this Class; overrides the super-Class Trigger for the same events if present

Parameters:
trigger - the Trigger to add
Throws:
OberonException

removeTrigger

public void removeTrigger(Trigger trigger)
Remove a Trigger from this Class

Parameters:
trigger - the Trigger to remove

updateTriggers

public void updateTriggers(java.util.Vector<Trigger> triggers)
                    throws OberonException
Update the triggers on the basis of a given list

Parameters:
triggers - list of Triggers
Throws:
OberonException
Since:
4.0

getOwnTriggers

public java.util.Vector<Trigger> getOwnTriggers()
Return the list of own Triggers defined for this Class; inherited Triggers are excluded

Returns:
Vector of Triggers

getOwnTriggersAsString

public java.lang.String getOwnTriggersAsString(java.lang.String delim)
Return the list of own Program-Triggers, as a String

Parameters:
delim - the separator item
Returns:
list of Triggers separated by the delim characters
See Also:
Trigger.asString()

getOwnWorkflowAsString

public java.lang.String getOwnWorkflowAsString(java.lang.String delim)
Return the full list of own Workflow-Triggers, as a String

Parameters:
delim - the separator item
Returns:
list of Triggers separated by the delim characters
Since:
2.1
See Also:
Trigger.asString()

getTriggers

public java.util.Vector<Trigger> getTriggers()
Return a full list of Triggers for this Class; inherited Triggers are included

Returns:
Vector of Triggers

getTriggersAsString

public java.lang.String getTriggersAsString(java.lang.String delim)
Return the full list of Program-Triggers, as a String

Parameters:
delim - the separator item
Returns:
list of Triggers separated by the delim characters
See Also:
Trigger.asString()

getWorkflowAsString

public java.lang.String getWorkflowAsString(java.lang.String delim)
Return the full list of Workflow-Triggers, as a String

Parameters:
delim - the separator item
Returns:
list of Triggers separated by the delim characters
Since:
2.1
See Also:
Trigger.asString()

getTriggerByEvent

public Trigger getTriggerByEvent(java.lang.String event)
Get the Program-Trigger for a specific event

Parameters:
event - the event name as defined by the OOQL syntax ( example: edit.check )
Returns:
the event Trigger or null if the event is not associated to a Trigger

getWorkflowByEvent

public Trigger getWorkflowByEvent(java.lang.String event)
Get the Workflow-Trigger for a specific event

Parameters:
event - the event name as defined by the OOQL syntax ( example: edit )
Returns:
the event Trigger or null if the event is not associated to a Trigger
Since:
2.1

getSubClasses

public java.util.Vector<java.lang.String> getSubClasses(Framework framework)
Return the full list of sub-Classes derived from this Class

Parameters:
framework - the current framework
Returns:
vector of Class names

getSubClassesAsString

public java.lang.String getSubClassesAsString(java.lang.String delim,
                                              Framework framework)
Return the full list of sub-Classes derived from this Class, as a String

Parameters:
delim - the separator item
framework - the current framework
Returns:
list of Class names separated by the delim characters

getOwnSubClasses

public java.util.Vector<java.lang.String> getOwnSubClasses(Framework framework)
Return the list of sub-Classes directly derived from this Class

Parameters:
framework - the current framework
Returns:
vector of Class names

getOwnSubClassesAsString

public java.lang.String getOwnSubClassesAsString(java.lang.String delim,
                                                 Framework framework)
Return the list of sub-Classes directly derived from this Class, as a String

Parameters:
delim - the separator item
framework - the current framework
Returns:
list of Class names separated by the delim characters

getLifecycles

public java.util.Vector<java.lang.String> getLifecycles(Framework framework)
Return the list of Lifecycles allowed for this Class

Parameters:
framework - the current framework
Returns:
vector of Lifecycles names

getLifecyclesAsString

public java.lang.String getLifecyclesAsString(java.lang.String delim,
                                              Framework framework)
Return the list of Lifecycles allowed for this Class, as a String

Parameters:
delim - the separator item
framework - the current framework
Returns:
list of Lifecycles separated by the delim characters

getLinkTypes

public java.util.Vector<java.lang.String> getLinkTypes(Framework framework)
Return the list of LinkTypes allowed for this Class

Parameters:
framework - the current framework
Returns:
vector of LinkTypes names

getLinkTypesAsString

public java.lang.String getLinkTypesAsString(java.lang.String delim,
                                             Framework framework)
Return the list of LinkTypes allowed for this Class, as a String

Parameters:
delim - the separator item
framework - the current framework
Returns:
list of LinkTypes separated by the delim characters

getAutoNumbers

public java.util.Vector<java.lang.String> getAutoNumbers(Framework framework)
Return the list of AutoNumbers defined for this Class

Parameters:
framework - the current framework
Returns:
vector of AutoNumbers names

getAutoNumbersAsString

public java.lang.String getAutoNumbersAsString(java.lang.String delim,
                                               Framework framework)
Return the list of AutoNumber defined for this Class, as a String

Parameters:
delim - the separator item
framework - the current framework
Returns:
list of AutoNumbers separated by the delim characters

getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String token,
                                    Framework framework)
Get a property for this Class object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: abstract , superclass ...)
filterArgs - extra arguments used to compute properties
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector

Specified by:
getTargetNames in class OBBase
Parameters:
composedName - OOQL property identifier/name (example: field, superclass, program[create.action] .. )
filterArgs - extra arguments used to compute properties
framework - the current framework
Returns:
a Vector of target names, used to extract their (sub)properties values

toString

public java.lang.String toString()
Return the Class object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the Class object extended properties as a single String

Overrides:
toString in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(Framework framework)
Return the Class object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the Class object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the Class object properties from XML element tree

Overrides:
fromXML in class AdminBase

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this Class object with the settled properties

Specified by:
getCreateCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this Class object with the modified properties.
If the object is new, it returns the create command.

Specified by:
getSaveCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

compareUpdate

public java.lang.String compareUpdate(Class refClass,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this Class object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refClass - the reference Class object
checkImage - if true compare also the image icon
overwrite - if true update the database object instance
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException
See Also:
fromXML(Element)

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.