OBEROn SDK

com.oberon.ooql.sdk
Class AdminBase

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Assignment, AutoNumber, Class, Command, Feature, Field, FileType, Form, Graph, Lifecycle, LinkType, LocalArea, Mail, Menu, MetricSystem, ObjectGroup, ObjectSpace, Program, Query, Team, UnitMeasure, User, View, WebService, Workflow

public abstract class AdminBase
extends OBBase
implements java.io.Serializable

A base class for Admin Objects. This class provides the common basic features for all the OBEROn administrative objects

Version:
5.0
See Also:
Serialized Form

Field Summary
 java.util.BitSet bsOptions
          Set for object options
static int HIDDEN_OPTION
          The Hidden flag index inside the Option Set
 
Method Summary
 void addFeature(Feature feature)
          Add a Feature to the administrative object
 boolean changedApplication()
          Check if the element has changed the application Menu
 java.lang.String checkChangeName()
          Check if the object name was changed
 boolean checkCounters(java.util.Hashtable<java.lang.String,java.lang.Integer> hDBCounters)
          Compares the administrative object synch counters; [INTERNAL USAGE]
 boolean checkCounters(java.lang.String sCounters)
          Compares the administrative object synch counters; [INTERNAL USAGE]
abstract  void create(Framework framework)
          Create a new object on the database
abstract  void destroy(Framework framework)
          Remove the object from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the administrative object basic properties from XML element tree
 java.lang.String getAdminType()
          Get the administrative object Type
 java.lang.String getApplication()
          Get the application Menu name.
 java.lang.String getCommonProperty(java.lang.String propertyName, java.lang.String token, Framework framework)
          Get a (basic) property for the administrative object by its OOQL identifier
 java.util.Vector<java.lang.String> getCommonTargetNames(java.lang.String composedName, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 java.util.Hashtable<java.lang.String,java.lang.Integer> getCounters()
          Get administrative object synch counters; [INTERNAL USAGE]
This is used to check if the object instance is synchronized with the database
 java.lang.String getCreateBasicCommand(java.lang.String options)
          Return the OOQL command to create the administrative object with the settled basic properties
 java.lang.String getCreateCommand()
          Return the OOQL command to create the object with the settled properties
abstract  java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create the object with the settled properties
 java.lang.String getCrtDate()
          Return the administrative object creation date
 java.lang.String getDescription()
          Get the administrative object Description
 java.lang.String getEditBasicCommand(java.lang.String propertyName)
          Return the OOQL command to edit a given administrative object basic property
 Feature getFeature(java.lang.String featureName, Framework framework)
          Return a specific Feature associated to the administrative object
 java.util.Vector<Feature> getFeatures(Framework framework)
          Return the Features associated to the administrative object
 java.lang.String getFeaturesAsString(java.lang.String delim, java.lang.String indent, Framework framework)
          Return the Features associated to the administrative object as single String
 byte[] getImage()
          Return the administrative object icon
static byte[] getImage(int adminId)
          Return a administrative object icon
static byte[] getImage(java.lang.String adminType, java.lang.String name)
          Return a administrative object icon
 java.lang.String getImageData()
          Return the administrative object icon codified as base64 string data
 java.lang.String getImageFile()
          Return the administrative object icon file path.
 java.lang.String getModDate()
          Return the administrative object last modification date
 java.lang.String getModUser()
          Return the administrative object modification User
 java.lang.String getName()
          Get the administrative object Name
 java.lang.String getOldName()
          Get the original administrative object Name keep the value read from DB
 java.util.Vector<java.lang.String> getPlainFeatures(Framework framework)
          Return the Features associated to the administrative object
 java.lang.String getSaveCommand()
          Return the OOQL command to update the object with the modified properties.
abstract  java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update the object with the modified properties.
 long getSVNRevision()
          Return the administrative object SVN revision
 org.jdom.Element getXMLFeatureList(Framework framework)
          Return the Features as XML element tree
 boolean hasImage()
          Test if the administrative object has an image icon
 boolean isHidden()
          Return if the administrative object is or not hidden
abstract  void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the object: connect the memory instance with the database instance
 void setApplication(java.lang.String menuName)
          Set the application Menu name.
 void setCounters(java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Set administrative object synch counters; [INTERNAL USAGE]
 void setCrtDate(java.lang.String date)
          Set the administrative object creation date; [INTERNAL USAGE]
 void setDescription(java.lang.String description)
          Set the administrative object Description
 void setHidden(boolean hidden)
          Set the administrative object Hidden flag;
Hidden objects are filtered when an admin query is performed
 void setImage(byte[] image)
          Set the administrative object icon;
 void setImageData(java.lang.String base64ImageData)
          Set the administrative object icon from a base64 string data;
 void setImageFile(java.lang.String fileName)
          Set the administrative object icon importing it from a file;
 void setModDate(java.lang.String date)
          Set the administrative object modification date; [INTERNAL USAGE]
 void setModUser(java.lang.String userName)
          Set the administrative object modification User; [INTERNAL USAGE]
 void setName(java.lang.String name)
          Set the administrative object Name
 void setSVNRevision(long revision)
          Set the administrative object SVN revision;
 void show(Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the admin object properties
static void show(java.lang.String type, java.lang.String name, Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the properties for the given administrative object
 org.jdom.Element toCommonXML(boolean getImage, boolean fullDump, Framework framework)
          Return the administrative object basic properties as XML element tree
 java.lang.String toString()
          Return the administrative object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the administrative object basic properties as a single String
abstract  org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the object properties as XML element tree
abstract  org.jdom.Element toXML(Framework framework)
          Return the object properties as XML element tree
 org.jdom.Element toXML(java.lang.String adminType, boolean getImage, boolean fullDump, Framework framework)
          Return the administrative object basic properties as XML element tree
abstract  void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
abstract  void write(Framework framework)
          Update the object to the database
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, getProperty, getTargetNames, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HIDDEN_OPTION

public static final int HIDDEN_OPTION
The Hidden flag index inside the Option Set

See Also:
Constant Field Values

bsOptions

public java.util.BitSet bsOptions
Set for object options

Method Detail

create

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

Throws:
OberonException

link

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

Throws:
OberonException

write

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

Throws:
OberonException

destroy

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

Throws:
OberonException

unlink

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

Throws:
OberonException

getAdminType

public java.lang.String getAdminType()
Get the administrative object Type


setName

public void setName(java.lang.String name)
             throws OberonException
Set the administrative object Name

Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains the pipe '|' character

getOldName

public java.lang.String getOldName()
Get the original administrative object Name keep the value read from DB

Returns:
the original name of the administrative object

getName

public java.lang.String getName()
Get the administrative object Name

Specified by:
getName in class OBBase
Returns:
the name of the administrative object

checkChangeName

public java.lang.String checkChangeName()
Check if the object name was changed

Returns:
the old name if changed or empty string otherwise
Since:
4.0

setDescription

public void setDescription(java.lang.String description)
Set the administrative object Description

Parameters:
description - the description to set for the administrative object

getDescription

public java.lang.String getDescription()
Get the administrative object Description

Returns:
the description of the administrative object

setHidden

public void setHidden(boolean hidden)
Set the administrative object Hidden flag;
Hidden objects are filtered when an admin query is performed

Parameters:
hidden - the hidden flag
See Also:
Framework.setFilterHidden(boolean)

isHidden

public boolean isHidden()
Return if the administrative object is or not hidden

Returns:
the hidden flag for the administrative object

setImage

public void setImage(byte[] image)
Set the administrative object icon;

Parameters:
image - the image data

getImage

public byte[] getImage()
Return the administrative object icon

Returns:
the image data

setImageFile

public void setImageFile(java.lang.String fileName)
Set the administrative object icon importing it from a file;

Parameters:
fileName - the image file absolute path

getImageFile

public java.lang.String getImageFile()
Return the administrative object icon file path. The path is not stored on DB

Returns:
the image file absolute path previously settled
See Also:
setImageFile(String)

setImageData

public void setImageData(java.lang.String base64ImageData)
Set the administrative object icon from a base64 string data;

Parameters:
base64ImageData - the base64 image data

getImageData

public java.lang.String getImageData()
Return the administrative object icon codified as base64 string data

Returns:
the base64 string representing the image data

hasImage

public boolean hasImage()
Test if the administrative object has an image icon


getImage

public static byte[] getImage(java.lang.String adminType,
                              java.lang.String name)
                       throws OberonException
Return a administrative object icon

Parameters:
adminType - the administrative object type (ex.: class , field , lifecycle ... )
name - the object name
Returns:
the image data
Throws:
OberonException

getImage

public static byte[] getImage(int adminId)
                       throws OberonException
Return a administrative object icon

Parameters:
adminId - the administrative object Id
Returns:
the image data
Throws:
OberonException

setModDate

public void setModDate(java.lang.String date)
Set the administrative object modification date; [INTERNAL USAGE]

Parameters:
date - the modification date

getModDate

public java.lang.String getModDate()
Return the administrative object last modification date

Returns:
the last modification date

setCrtDate

public void setCrtDate(java.lang.String date)
Set the administrative object creation date; [INTERNAL USAGE]

Parameters:
date - the creation date

getCrtDate

public java.lang.String getCrtDate()
Return the administrative object creation date

Returns:
the creation date

setModUser

public void setModUser(java.lang.String userName)
Set the administrative object modification User; [INTERNAL USAGE]

Parameters:
userName - the User name who performed the last operation on the object

getModUser

public java.lang.String getModUser()
Return the administrative object modification User

Returns:
the User name who performed the last operation on the object

setSVNRevision

public void setSVNRevision(long revision)
Set the administrative object SVN revision;

Parameters:
revision - the SVN revision

getSVNRevision

public long getSVNRevision()
Return the administrative object SVN revision

Returns:
the local SVN revision

setApplication

public void setApplication(java.lang.String menuName)
Set the application Menu name. Create association between the administrative object and a specific application.

Parameters:
menuName - the application main Menu name
Since:
2.2_01

getApplication

public java.lang.String getApplication()
Get the application Menu name.

Since:
2.2_01

changedApplication

public boolean changedApplication()
Check if the element has changed the application Menu

Since:
2.2_01

getFeatures

public java.util.Vector<Feature> getFeatures(Framework framework)
Return the Features associated to the administrative object

Parameters:
framework - the current framework
Returns:
a Vector of Feature objects

getPlainFeatures

public java.util.Vector<java.lang.String> getPlainFeatures(Framework framework)
Return the Features associated to the administrative object

Parameters:
framework - the current framework
Returns:
a Vector of String(s) formatted as:
<feature name>|<admin object type>|<admin object name>
OR
<feature name>|<from admin object type>|<from admin object name>|<to admin object type>|<to admin object name>

getFeaturesAsString

public java.lang.String getFeaturesAsString(java.lang.String delim,
                                            java.lang.String indent,
                                            Framework framework)
Return the Features associated to the administrative object as single String

Parameters:
delim - item separator
indent - item indent characters
framework - the current framework
Returns:
a Vector of Feature objects

getFeature

public Feature getFeature(java.lang.String featureName,
                          Framework framework)
Return a specific Feature associated to the administrative object

Parameters:
featureName - the Feature name
framework - the current framework
Since:
2.5

addFeature

public void addFeature(Feature feature)
                throws OberonException
Add a Feature to the administrative object

Parameters:
feature - the Feature object to add
Throws:
OberonException - when the feature name contains invalid characters

show

public static void show(java.lang.String type,
                        java.lang.String name,
                        Selector selector,
                        java.io.DataOutputStream outStream,
                        Framework framework)
                 throws java.io.IOException,
                        OberonException
Show the properties for the given administrative object

Parameters:
type - the type of the object
name - the name of the object
selector - selection parameters (if null return all the object properties)
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
Since:
4.0
See Also:
Framework.getResult()

show

public void show(Selector selector,
                 java.io.DataOutputStream outStream,
                 Framework framework)
          throws java.io.IOException,
                 OberonException
Show the admin object properties

Parameters:
selector - selection parameters (if null return all the object properties)
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
See Also:
Framework.getResult()

toXML

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

Parameters:
framework - the current framework

toXML

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

Parameters:
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

setCounters

public void setCounters(java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Set administrative object synch counters; [INTERNAL USAGE]

Parameters:
counters - hash table with counter values

getCounters

public java.util.Hashtable<java.lang.String,java.lang.Integer> getCounters()
Get administrative object synch counters; [INTERNAL USAGE]
This is used to check if the object instance is synchronized with the database

Returns:
hash table with counter values

checkCounters

public boolean checkCounters(java.util.Hashtable<java.lang.String,java.lang.Integer> hDBCounters)
Compares the administrative object synch counters; [INTERNAL USAGE]

Returns:
false if the object instance is obsolete

checkCounters

public boolean checkCounters(java.lang.String sCounters)
Compares the administrative object synch counters; [INTERNAL USAGE]

Returns:
false if the object instance is obsolete

getCommonProperty

public java.lang.String getCommonProperty(java.lang.String propertyName,
                                          java.lang.String token,
                                          Framework framework)
Get a (basic) property for the administrative object by its OOQL identifier

Parameters:
propertyName - OOQL property identifier/name (example: id , name , moddate , description ...)
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getCommonTargetNames

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

Parameters:
composedName - OOQL property identifier/name (example: feature , feature[name] .. )
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 administrative object basic properties as a single String

Overrides:
toString in class java.lang.Object

toString

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

Parameters:
framework - the current framework

getXMLFeatureList

public org.jdom.Element getXMLFeatureList(Framework framework)
Return the Features as XML element tree


toXML

public org.jdom.Element toXML(java.lang.String adminType,
                              boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the administrative object basic properties as XML element tree

Parameters:
adminType - the object admin type
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

toCommonXML

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

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 administrative object basic properties from XML element tree


getCreateCommand

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


getCreateCommand

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

Parameters:
force - if true append the "force" options at the end

getSaveCommand

public java.lang.String getSaveCommand()
Return the OOQL command to update the object with the modified properties.


getSaveCommand

public abstract java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update the object with the modified properties.

Parameters:
force - if true append the "force" options at the end

getCreateBasicCommand

public java.lang.String getCreateBasicCommand(java.lang.String options)
Return the OOQL command to create the administrative object with the settled basic properties

Parameters:
options - usually empty: "" - used only for particular type of administrative objects
example: for a Field object it's something like "type integer"

getEditBasicCommand

public java.lang.String getEditBasicCommand(java.lang.String propertyName)
Return the OOQL command to edit a given administrative object basic property

Parameters:
propertyName - the name of the property (example: name, description , ....)

OBEROn SDK

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