OBEROn SDK

com.oberon.ooql.sdk
Class ObjectGroup

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

public class ObjectGroup
extends AdminBase
implements java.io.Serializable

Object Group: represents a User facility to collect ObjectObj isntances for generic purpose

Version:
5.0
See Also:
Serialized Form

Field Summary
static java.lang.String RECENT_OG_NAME
          The ObjectGroup Name for user recent opened objects
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
ObjectGroup()
           
ObjectGroup(java.lang.String name, java.lang.String userName)
          Define a new ObjectGroup associated to a specific User
 
Method Summary
 void addFromGroup(java.lang.String objectgroup, java.lang.String userName)
          Add ObjectObj instances to this ObjectGroup belonging to another ObjectGroup
 void addFromQuery(Query query)
          Add ObjectObj instances to this ObjectGroup as result of query execution
 void addObject(java.lang.String objectID)
          Add a single ObjectObj to this ObjectGroup
 void addObject(java.lang.String objectClass, java.lang.String objectName, java.lang.String objectRevision)
          Add a single ObjectObj to this ObjectGroup
 java.lang.String compareUpdate(ObjectGroup refObjectGroup, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this ObjectGroup object and let it become equals to another reference object.
 void create(boolean overwrite, Framework framework)
          Create a new ObjectGroup object on the database
 void create(Framework framework)
          Create a new ObjectGroup object on the database
 void destroy(Framework framework)
          Remove the ObjectGroup object from the database
 void fromXML(org.jdom.Element rootElement)
          Load the ObjectGroup object properties from XML element tree
 void fromXML(org.jdom.Element rootElement, boolean getObjects)
          Load the ObjectGroup object properties from XML element tree
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this ObjectGroup with the settled properties
 java.lang.String getCreateCommand(boolean force, boolean overwrite)
          Return the OOQL command to create this ObjectGroup with the settled properties
 java.util.Vector<java.lang.Object> getObjects(Framework framework)
          Return the ObjectObj instances grouped by this ObjectGroup
 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 ObjectGroup object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this ObjectGroup object with the modified properties.
 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
 java.lang.String getUser()
          Get the User associated to this ObjectGroup
 int getUserId()
          Get the internal id of User associated to this ObjectGroup
 org.jdom.Element getXMLObjectList(Framework framework)
          Return the Object List as XML element tree
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the ObjectGroup object: connect the memory instance with the database instance
static ObjectGroup open(java.lang.String name, java.lang.String userName, Framework framework)
          Open a ObjectGroup for a given user and read its properties from the database
static ObjectGroup open(java.lang.String name, java.lang.String userName, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open a ObjectGroup for a given user and read its properties from the database
 void removeObject(java.lang.String objectID)
          Remove a single ObjectObj from this ObjectGroup
 void removeObject(java.lang.String objectClass, java.lang.String objectName, java.lang.String objectRevision)
          Remove a single ObjectObj from this ObjectGroup
 void setUser(java.lang.String userName)
          Set the User associated to this ObjectGroup
 void setUserId(int userID)
          Set the internal id of User associated to this ObjectGroup
 java.lang.String toString()
          Return the ObjectGroup object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the ObjectGroup object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the ObjectGroup object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the ObjectGroup object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateObjects(java.util.Vector<java.lang.Object> objects)
          Update the objects on the basis of a given list
 void write(Framework framework)
          Update the ObjectGroup 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

RECENT_OG_NAME

public static final java.lang.String RECENT_OG_NAME
The ObjectGroup Name for user recent opened objects

See Also:
Constant Field Values
Constructor Detail

ObjectGroup

public ObjectGroup()

ObjectGroup

public ObjectGroup(java.lang.String name,
                   java.lang.String userName)
            throws OberonException
Define a new ObjectGroup associated to a specific User

Parameters:
name - the Group name
userName - the User name
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static ObjectGroup open(java.lang.String name,
                               java.lang.String userName,
                               Framework framework)
                        throws OberonException
Open a ObjectGroup for a given user and read its properties from the database

Parameters:
name - the ObjectGroup name
userName - the User name
framework - the current framework
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 ObjectGroup 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

open

public static ObjectGroup open(java.lang.String name,
                               java.lang.String userName,
                               Framework framework,
                               java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                        throws OberonException
Open a ObjectGroup for a given user and read its properties from the database

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

create

public void create(Framework framework)
            throws OberonException
Create a new ObjectGroup 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 overwrite,
                   Framework framework)
            throws OberonException
Create a new ObjectGroup object on the database

Parameters:
overwrite - if true overwrite the group when it already exists
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(Framework framework)
           throws OberonException
Update the ObjectGroup 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

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 ObjectGroup 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

setUser

public void setUser(java.lang.String userName)
Set the User associated to this ObjectGroup


getUser

public java.lang.String getUser()
Get the User associated to this ObjectGroup


setUserId

public void setUserId(int userID)
Set the internal id of User associated to this ObjectGroup


getUserId

public int getUserId()
Get the internal id of User associated to this ObjectGroup


addFromQuery

public void addFromQuery(Query query)
Add ObjectObj instances to this ObjectGroup as result of query execution

Parameters:
query - the Query name

addFromGroup

public void addFromGroup(java.lang.String objectgroup,
                         java.lang.String userName)
                  throws OberonException
Add ObjectObj instances to this ObjectGroup belonging to another ObjectGroup

Parameters:
objectgroup - the reference ObjectGroup name
userName - the reference ObjectGroup User name
Throws:
OberonException

addObject

public void addObject(java.lang.String objectID)
Add a single ObjectObj to this ObjectGroup

Parameters:
objectID - the ObjectObj ID

addObject

public void addObject(java.lang.String objectClass,
                      java.lang.String objectName,
                      java.lang.String objectRevision)
Add a single ObjectObj to this ObjectGroup

Parameters:
objectClass - the ObjectObj's Class name
objectName - the ObjectObj's name
objectRevision - the ObjectObj's revision

removeObject

public void removeObject(java.lang.String objectID)
Remove a single ObjectObj from this ObjectGroup

Parameters:
objectID - the ObjectObj ID

removeObject

public void removeObject(java.lang.String objectClass,
                         java.lang.String objectName,
                         java.lang.String objectRevision)
Remove a single ObjectObj from this ObjectGroup

Parameters:
objectClass - the ObjectObj's Class name
objectName - the ObjectObj's name
objectRevision - the ObjectObj's revision

updateObjects

public void updateObjects(java.util.Vector<java.lang.Object> objects)
Update the objects on the basis of a given list

Parameters:
objects - list of ObjectObj's ids or array[Class,Name,Revision]
Since:
4.0

getObjects

public java.util.Vector<java.lang.Object> getObjects(Framework framework)
                                              throws OberonException
Return the ObjectObj instances grouped by this ObjectGroup

Returns:
a Vector of ObjectObj's IDs
Throws:
OberonException

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 ObjectGroup object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name
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: object .. )
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 ObjectGroup object basic properties as a single String

Overrides:
toString in class AdminBase

toString

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

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

getXMLObjectList

public org.jdom.Element getXMLObjectList(Framework framework)
Return the Object List as XML element tree


toXML

public org.jdom.Element toXML(Framework framework)
Return the ObjectGroup 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 ObjectGroup object properties as XML element tree

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

fromXML

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

Overrides:
fromXML in class AdminBase

fromXML

public void fromXML(org.jdom.Element rootElement,
                    boolean getObjects)
Load the ObjectGroup object properties from XML element tree

Parameters:
getObjects - if true export also the ObjectObj instance list

getCreateCommand

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

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

getCreateCommand

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


getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this ObjectGroup 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(ObjectGroup refObjectGroup,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this ObjectGroup object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refObjectGroup - the reference ObjectGroup 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.