OBEROn SDK

com.oberon.ooql.sdk
Class Feature

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

public class Feature
extends AdminBase
implements java.io.Serializable

Feature Admin Object: defines a property for an administrative object or a link between two admin objects.

Version:
5.0
See Also:
Serialized Form

Field Summary
 boolean reverse
          Invert the to side object with the from side object
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Feature()
           
Feature(java.lang.String name)
           
 
Method Summary
 java.lang.String asString(java.lang.String indent)
          Return the Feature object properties as a formatted String
static java.lang.String covertType(java.lang.String adminType)
          Convert the administrative object type from OOQL format to class name format
 void create(boolean force, Framework framework)
          Create a new Feature object on the database
 void create(Framework framework)
          Create a new Feature object on the database
 void destroy(Framework framework)
          Remove the Feature object from the database
 boolean equals(Feature feature)
          Compare this Feature with another
 void fromXML(org.jdom.Element rootElement)
          Load the Command object properties from XML element tree
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this Feature object with the settled properties
 java.lang.String getFor()
          Return the target administrative object name
 java.lang.String getForType(boolean lowerCase)
          Return the target administrative object type
 java.lang.String getFrom()
          Return the from side administrative object name
 int getFromId()
          Return the from side administrative object internal ID
 java.lang.String getFromType(boolean lowerCase)
          Return the from side administrative object type
 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 Feature object by its OOQL identifier
 java.lang.String getRemoveCommand()
          Return the OOQL command to delete this Feature object
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this Feature object with the modified properties.
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          [inherited but NOT USED]
 java.lang.String getTo()
          Return the to side administrative object name
 int getToId()
          Return the to side administrative object internal ID
 java.lang.String getToType(boolean lowerCase)
          Return the to side administrative object type
 java.lang.String getValue()
          Get the Feature value
static int indexOf(java.util.Vector<Feature> features, Feature feature)
          Search a Feature into a Vector of Features
 boolean isForSigleObject()
          Return true when the Feature involves a single administrative object
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Feature object: connect the memory instance with the database instance
static Feature open(java.lang.String name, java.lang.String fromType, java.lang.String fromName, java.lang.String toType, java.lang.String toName, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the object and read its properties from the database or retrieve them from memory
 void setBetween(int fromID, int toID)
          Set the administrative objects linked with this Feature by their internal ID
 void setBetween(java.lang.String fromType, java.lang.String fromName, java.lang.String toType, java.lang.String toName)
          Set the administrative objects linked with this Feature
 void setFor(java.lang.String adminType, java.lang.String adminName)
          Set the target administrative object
 void setFrom(java.lang.String adminType, java.lang.String adminName)
          Set the from side administrative object linked with this Feature
 void setTo(java.lang.String adminType, java.lang.String adminName)
          Set the to side administrative object linked with this Feature
 void setValue(java.lang.String value)
          Set the Feature value
 void show(Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the Feature object properties
 java.lang.String toString()
          Return the Feature object properties as a single String
 java.lang.String toString(Framework framework)
          Return the Feature object properties as a single String
 java.lang.String toString(java.lang.String indent)
          Return the Feature object basic properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Feature object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Feature object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void write(boolean force, Framework framework)
          Update the Feature object to the database
 void write(Framework framework)
          Update the Feature 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, 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

reverse

public boolean reverse
Invert the to side object with the from side object

Constructor Detail

Feature

public Feature()

Feature

public Feature(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 Feature open(java.lang.String name,
                           java.lang.String fromType,
                           java.lang.String fromName,
                           java.lang.String toType,
                           java.lang.String toName,
                           Framework framework,
                           java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                    throws OberonException
Open the object and read its properties from the database or retrieve them from memory

Parameters:
name - the Feature name
fromType - the from side administrative type (OOQL format)
fromName - the from side administrative object name
toType - the to side administrative type (OOQL format)
toName - the to side administrative 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 Feature 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 Feature 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 Feature 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 Feature 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 Feature 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

show

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

Overrides:
show in class AdminBase
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()

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

isForSigleObject

public boolean isForSigleObject()
Return true when the Feature involves a single administrative object


setFor

public void setFor(java.lang.String adminType,
                   java.lang.String adminName)
Set the target administrative object

Parameters:
adminType - the administrative type (OOQL format)
adminName - the administrative object name

getFor

public java.lang.String getFor()
Return the target administrative object name


getForType

public java.lang.String getForType(boolean lowerCase)
Return the target administrative object type

Parameters:
lowerCase - true to convert as lowercase

setBetween

public void setBetween(java.lang.String fromType,
                       java.lang.String fromName,
                       java.lang.String toType,
                       java.lang.String toName)
Set the administrative objects linked with this Feature

Parameters:
fromType - the from side administrative type (OOQL format)
fromName - the from side administrative object name
toType - the to side administrative type (OOQL format)
toName - the to side administrative object name

setBetween

public void setBetween(int fromID,
                       int toID)
Set the administrative objects linked with this Feature by their internal ID

Parameters:
fromID - the from side administrative object internal ID
toID - the to side administrative object internal ID

setFrom

public void setFrom(java.lang.String adminType,
                    java.lang.String adminName)
Set the from side administrative object linked with this Feature

Parameters:
adminType - the administrative type (OOQL format)
adminName - the administrative object name

setTo

public void setTo(java.lang.String adminType,
                  java.lang.String adminName)
Set the to side administrative object linked with this Feature

Parameters:
adminType - the administrative type (OOQL format)
adminName - the administrative object name

getFrom

public java.lang.String getFrom()
Return the from side administrative object name


getFromType

public java.lang.String getFromType(boolean lowerCase)
Return the from side administrative object type

Parameters:
lowerCase - true to convert as lowercase

getFromId

public int getFromId()
Return the from side administrative object internal ID


getTo

public java.lang.String getTo()
Return the to side administrative object name


getToType

public java.lang.String getToType(boolean lowerCase)
Return the to side administrative object type

Parameters:
lowerCase - true to convert as lowercase

getToId

public int getToId()
Return the to side administrative object internal ID


setValue

public void setValue(java.lang.String value)
Set the Feature value


getValue

public java.lang.String getValue()
Get the Feature value


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

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: value , to.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)
[inherited but NOT USED]

Specified by:
getTargetNames in class OBBase

covertType

public static java.lang.String covertType(java.lang.String adminType)
Convert the administrative object type from OOQL format to class name format


equals

public boolean equals(Feature feature)
Compare this Feature with another

Returns:
true if the name, the "from" and the "to" objects are the same

indexOf

public static int indexOf(java.util.Vector<Feature> features,
                          Feature feature)
Search a Feature into a Vector of Features

Returns:
the vector position if found; -1 otherwise uses the equals(Feature) comparison criteria

toString

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

Parameters:
indent - indentation string

asString

public java.lang.String asString(java.lang.String indent)
Return the Feature object properties as a formatted String

Parameters:
indent - indentation string
Returns:
formatted string:

<feature-name> {for <admin-type>[<admin-name>]=<feature-value>}

<feature-name> {from <admin-type>[<admin-name>]
to <admin-type>[<admin-name>]=<feature-value>}

toString

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

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

toString

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

Overrides:
toString in class AdminBase

toXML

public org.jdom.Element toXML(Framework framework)
Return the Feature 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 Feature 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
See Also:
toXML(Framework)

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the Command 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 Feature 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 Feature 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

getRemoveCommand

public java.lang.String getRemoveCommand()
Return the OOQL command to delete this Feature object


OBEROn SDK

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