|
OBEROn SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.oberon.ooql.sdk.OBBase com.oberon.ooql.sdk.AdminBase com.oberon.ooql.sdk.Field
public class Field
Field Admin Object: defines an OBEROn object [ObjectObj
] or Link
field.
Field Summary | |
---|---|
static java.lang.String |
ATTRSEP
The value separator for multivalue Fields |
static int |
MULTILINE_OPTION
The Multiline flag index inside the Option Set |
static int |
MULTIPLE_OPTION
The Multiple flag index inside the Option Set |
static int |
RESET_NONE
Field value is never automatically reset |
static int |
RESET_ONCLONE
Field value is reset to default value for the new copy instance |
static int |
RESET_ONCREATE
Field value is resetted to default value for all new instances |
static int |
RESET_ONREVISE
Field value is reset to default value for the new revision instance |
java.lang.String |
sDefault
|
static int |
TYPE_BOOLEAN
Boolean (true/false) type |
static int |
TYPE_DATE
Date type - the format is yyyy-MM-dd |
static int |
TYPE_DATETIME
DateTime type - the format is yyyy-MM-dd HH:mm:ss zzz |
static int |
TYPE_INTEGER
Integer type |
static int |
TYPE_length
|
static int |
TYPE_REAL
Real number type |
static int |
TYPE_STRING
String type |
static int |
TYPE_TEXT
Long Text type |
Fields inherited from class com.oberon.ooql.sdk.AdminBase |
---|
bsOptions, HIDDEN_OPTION |
Constructor Summary | |
---|---|
Field()
|
|
Field(java.lang.String name)
|
Method Summary | |
---|---|
void |
addRange(FieldRange range)
Add a Range value/interval to this Field; |
void |
addTrigger(Trigger trigger)
Add a Trigger to this Field; |
void |
addUnitMeasure(java.lang.String unitMeasureName)
Appends a new UnitMeasure to the MetricSystem |
java.lang.String |
compareUpdate(Field refField,
boolean checkImage,
boolean overwrite,
boolean force,
Framework framework)
Return/apply the OOQL command to update this Field object and let it become equals to another reference object. |
java.util.Vector<java.lang.String> |
computeProgramRanges(java.util.Vector<java.lang.Object> filterArgs,
Framework framework)
Execute the range Program to compute the Field ranges |
java.lang.String |
convertValueFromUserUnitMeasure(java.lang.String value,
Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Return the UnitMeasure for this Field on the basis of current Framework user |
java.lang.String |
convertValueToUserUnitMeasure(java.lang.String value,
Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Return the UnitMeasure for this Field on the basis of current Framework user |
void |
create(boolean force,
Framework framework)
Create a new Field object on the database |
void |
create(Framework framework)
Create a new Field object on the database |
void |
destroy(Framework framework)
Remove the Field object from the database |
void |
fromXML(org.jdom.Element rootElement)
Load the Field object properties from XML element tree |
java.util.Vector<java.lang.String> |
getAllClassIds(Framework framework)
Get the IDs of all Classes where the Field is used [INTERNAL USAGE] |
java.util.Vector<java.lang.String> |
getAllLinkTypeIds(Framework framework)
Get the IDs of all LinkTypes where the Field is used [INTERNAL USAGE] |
java.util.Vector<java.lang.String> |
getClasses(Framework framework)
Return the list of Classes where this Field is used |
java.lang.String |
getClassesAsString(java.lang.String delim,
Framework framework)
Return the list of Classes where this Field is used, as a String |
java.lang.String |
getCreateCommand(boolean force)
Return the OOQL command to create this Field object with the settled properties |
java.lang.String |
getDefault()
Get the Field default value |
java.util.Vector<java.lang.String> |
getLinkTypes(Framework framework)
Return the list of LinkTypes where this Field is used |
java.lang.String |
getLinkTypesAsString(java.lang.String delim,
Framework framework)
Return the list of LinkTypes where this Field is used, 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 Field object by its OOQL identifier |
java.lang.String |
getRangeProgram()
Get the range Program |
java.util.Vector<FieldRange> |
getRanges()
Return the range values/intervals defined for this Field |
java.lang.String |
getRangesAsString(java.lang.String delim)
Return the range values/intervals defined for this Field, as a String |
java.util.Vector<java.lang.String> |
getRangeValues()
Return the range values defined for this Field |
int |
getReset()
Get the Reset option |
java.lang.String |
getResetAsString(int reset)
Convert the reset behavior to OOQL string |
java.lang.String |
getSaveCommand(boolean force)
Return the OOQL command to update this Field 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 |
Trigger |
getTriggerByEvent(java.lang.String event)
Get the Program-Trigger for a specific event |
java.util.Vector<Trigger> |
getTriggers()
Return the list of own Triggers defined for this Field |
java.lang.String |
getTriggersAsString(java.lang.String delim)
Return the list of Program-Triggers, as a String |
int |
getType()
Get the Field type |
java.lang.String |
getTypeAsString()
Get the Field type in OOQL format |
static int |
getTypeFromString(java.lang.String fieldType)
Convert Field type from OOQL format |
java.util.Vector<java.lang.String> |
getUnitMeasures()
Return the list of UnitMeasures for this MetricSystem |
java.lang.String |
getUnitMeasuresAsString(java.lang.String delim)
Return the list of UnitMeasure, as a String |
int |
getUnitMeasureType()
Get the Unit Measure type. |
UnitMeasure |
getUserUnitMeasure(Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Return the UnitMeasure for this Field on the basic of current Framework user |
java.lang.String |
getUserUnitMeasureName(Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Return the UnitMeasure name for this Field on the basis of current Framework user |
java.lang.String |
getUserUnitMeasureSymbol(Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Return the UnitMeasure symbol for this Field on the basis of current Framework user |
java.lang.String |
getWorkflowAsString(java.lang.String delim)
Return the list of Workflow-Triggers, as a String |
Trigger |
getWorkflowByEvent(java.lang.String event)
Get the Workflow-Trigger for a specific event |
boolean |
isDefaultValue(java.lang.String value)
Check if a value is equal to the Field default value |
boolean |
isMultiline()
Check if the Field is multiline. |
boolean |
isMultipleValues()
Check if the Field is multiple values. |
static boolean |
isValidDate(java.lang.String date)
Check if a date is correctly formatted |
static boolean |
isValidDateTime(java.lang.String date)
Check if a date-time is correctly formatted |
boolean |
isValidMultiValue(java.lang.String value)
Check if a multivalue is valid for this Field (check the field type and the value ranges for each value). |
boolean |
isValidValue(java.lang.String value)
Check if a value is valid for this Field (check the field type and the value ranges). |
void |
link(Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Open the Field object: connect the memory instance with the database instance |
static Field |
open(java.lang.String name,
Framework framework)
Open an administrative object and read properties from the database or retrieve them from memory cache |
static Field |
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 cache |
org.jdom.Element |
rangesToXML(java.lang.String rangeId,
java.util.Vector<java.lang.Object> filterArgs,
Framework framework)
Return the Field-Ranges as XML element tree |
void |
removeRange(FieldRange range)
Remove a Range value/interval from this Field |
void |
removeTrigger(Trigger trigger)
Remove a Trigger from this Field |
void |
removeUnitMeasure(java.lang.String unitMeasureName)
Remove a UnitMeasure from the MetricSystem |
void |
setDefault(java.lang.String defaultValue)
Set the Field default value. |
void |
setDefaultAsToday()
Set the Field default value for dates as today. |
void |
setMultiline(boolean multiline)
Set the multiline flag for this Field. |
void |
setMultipleValues(boolean multiple)
Set the multiple value flag for this Field. |
void |
setName(java.lang.String name)
Set the administrative object Name |
void |
setRangeProgram(java.lang.String programName)
Set a method to generate range values |
void |
setReset(int reset)
Set the Reset option |
void |
setReset(java.lang.String reset)
Set the Reset option |
void |
setTriggers(java.util.Vector<Trigger> triggers)
Set Triggers for this Field; |
void |
setType(int type)
Set the Field type. |
void |
setUnitMeasureType(int umtype)
Set the Unit Measure type. |
java.lang.String |
toString()
Return the Field object basic properties as a single String |
java.lang.String |
toString(Framework framework)
Return the Field object extended properties as a single String |
org.jdom.Element |
toXML(boolean getImage,
boolean fullDump,
Framework framework)
Return the Field object properties as XML element tree |
org.jdom.Element |
toXML(Framework framework)
Return the Field object properties as XML element tree |
void |
unlink(Framework framework)
Close the object: disconnect the memory instance from the database instance |
void |
updateRanges(java.util.Vector<FieldRange> ranges)
Update the ranges 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 |
updateUnitMeasures(java.util.Vector<java.lang.String> unitMeasures)
Update the unit measures on the basis of a given list |
void |
write(boolean force,
Framework framework)
Update the Field object to the database |
void |
write(Framework framework)
Update the Field object to the database |
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 |
---|
public static final java.lang.String ATTRSEP
public static final int MULTIPLE_OPTION
public static final int MULTILINE_OPTION
public static final int TYPE_STRING
public static final int TYPE_INTEGER
public static final int TYPE_REAL
public static final int TYPE_BOOLEAN
public static final int TYPE_DATE
public static final int TYPE_TEXT
public static final int TYPE_DATETIME
public static final int TYPE_length
public static final int RESET_NONE
public static final int RESET_ONCREATE
public static final int RESET_ONREVISE
public static final int RESET_ONCLONE
public java.lang.String sDefault
Constructor Detail |
---|
public Field()
public Field(java.lang.String name) throws OberonException
name
- the name of the administrative object
OberonException
- if the name contains invalid charactersMethod Detail |
---|
public void setName(java.lang.String name) throws OberonException
AdminBase
setName
in class AdminBase
name
- the name of the administrative object
OberonException
- if the name contains the pipe '|' characterpublic static Field open(java.lang.String name, Framework framework) throws OberonException
name
- the object nameframework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic static Field open(java.lang.String name, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters) throws OberonException
name
- the object nameframework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)
OberonException
- usually due to DB SQL exceptionspublic void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters) throws OberonException
link
in class AdminBase
framework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)
OberonException
- usually due to DB SQL exceptionspublic void create(Framework framework) throws OberonException
create
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void create(boolean force, Framework framework) throws OberonException
force
- if true ignores optional featuresframework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void write(Framework framework) throws OberonException
write
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void write(boolean force, Framework framework) throws OberonException
force
- if true ignores optional featuresframework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void unlink(Framework framework) throws OberonException
unlink
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic void destroy(Framework framework) throws OberonException
destroy
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void setType(int type)
type
- the Field typepublic int getType()
public java.lang.String getTypeAsString()
public static int getTypeFromString(java.lang.String fieldType)
public void setUnitMeasureType(int umtype)
umtype
- the Unit Measure typepublic int getUnitMeasureType()
public void setDefault(java.lang.String defaultValue) throws OberonException
defaultValue
- the default value
OberonException
- if the value is not compatible with the Field typepublic void setDefaultAsToday() throws OberonException
OberonException
- if the value is not compatible with the Field typepublic java.lang.String getDefault()
public boolean isDefaultValue(java.lang.String value)
value
- the comparison valuepublic void setReset(int reset)
reset
- the reset constant ( RESET_NONE
/ RESET_ONCREATE
/ RESET_ONREVISE
/ RESET_ONCLONE
)public int getReset()
setReset(int)
public java.lang.String getResetAsString(int reset)
public void setReset(java.lang.String reset)
reset
- the OOQL reset behavior string ( none / oncreate / onrevise / onclone )public void setMultipleValues(boolean multiple)
multiple
- true to define the Field as multiple valuespublic boolean isMultipleValues()
public void setMultiline(boolean multiline)
multiline
- true to define the Field as multilinepublic boolean isMultiline()
public void setRangeProgram(java.lang.String programName)
programName
- the Program
namepublic java.lang.String getRangeProgram()
Program
namepublic java.util.Vector<java.lang.String> computeProgramRanges(java.util.Vector<java.lang.Object> filterArgs, Framework framework)
filterArgs
- extra argumentsframework
- the current framework
public void addUnitMeasure(java.lang.String unitMeasureName)
unitMeasureName
- the name of the UnitMeasure
to addpublic void removeUnitMeasure(java.lang.String unitMeasureName)
unitMeasureName
- the name of the UnitMeasure
to addpublic void updateUnitMeasures(java.util.Vector<java.lang.String> unitMeasures)
unitMeasures
- list of UnitMeasure
's namespublic java.util.Vector<java.lang.String> getUnitMeasures()
UnitMeasure
namespublic java.lang.String getUnitMeasuresAsString(java.lang.String delim)
delim
- the separator item
UnitMeasure
names separated by the delim characterspublic java.lang.String getUserUnitMeasureName(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
framework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)public java.lang.String getUserUnitMeasureSymbol(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
framework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)public UnitMeasure getUserUnitMeasure(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
framework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)public java.lang.String convertValueToUserUnitMeasure(java.lang.String value, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
value
- the value to convertframework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)public java.lang.String convertValueFromUserUnitMeasure(java.lang.String value, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
value
- the value to convertframework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)public static boolean isValidDate(java.lang.String date)
date
- the date to checkpublic static boolean isValidDateTime(java.lang.String date)
date
- the date-time to checkpublic boolean isValidValue(java.lang.String value)
value
- the value to checkpublic boolean isValidMultiValue(java.lang.String value)
value
- the multi-value to checkpublic void addRange(FieldRange range) throws OberonException
range
- the range to add
OberonException
public void removeRange(FieldRange range)
range
- the range to removepublic void updateRanges(java.util.Vector<FieldRange> ranges) throws OberonException
ranges
- list of FieldRange
s
OberonException
public java.util.Vector<FieldRange> getRanges()
FieldRange
spublic java.util.Vector<java.lang.String> getRangeValues()
public java.lang.String getRangesAsString(java.lang.String delim)
delim
- the separator item
FieldRange.toString()
public void setTriggers(java.util.Vector<Trigger> triggers)
triggers
- a vector of Trigger
spublic void addTrigger(Trigger trigger) throws OberonException
trigger
- the Trigger to add
OberonException
public void removeTrigger(Trigger trigger)
trigger
- the Trigger to removepublic void updateTriggers(java.util.Vector<Trigger> triggers) throws OberonException
triggers
- list of Trigger
s
OberonException
public java.util.Vector<Trigger> getTriggers()
Trigger
spublic java.lang.String getTriggersAsString(java.lang.String delim)
delim
- the separator item
Trigger
s separated by the delim charactersTrigger.asString()
public java.lang.String getWorkflowAsString(java.lang.String delim)
delim
- the separator item
Trigger
s separated by the delim charactersTrigger.asString()
public Trigger getTriggerByEvent(java.lang.String event)
event
- the event name as defined by the OOQL syntax ( example: edit.check )
Trigger
or null if the event is not associated to a Triggerpublic Trigger getWorkflowByEvent(java.lang.String event)
event
- the event name as defined by the OOQL syntax ( example: edit )
Trigger
or null if the event is not associated to a Triggerpublic java.util.Vector<java.lang.String> getClasses(Framework framework)
framework
- the current framework
Class
es namespublic java.lang.String getClassesAsString(java.lang.String delim, Framework framework)
delim
- the separator itemframework
- the current framework
Class
es separated by the delim characterspublic java.util.Vector<java.lang.String> getAllClassIds(Framework framework)
public java.util.Vector<java.lang.String> getLinkTypes(Framework framework)
framework
- the current framework
LinkType
s namespublic java.lang.String getLinkTypesAsString(java.lang.String delim, Framework framework)
delim
- the separator itemframework
- the current framework
LinkType
s separated by the delim characterspublic java.util.Vector<java.lang.String> getAllLinkTypeIds(Framework framework)
public java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
getProperty
in class OBBase
propertyName
- OOQL property identifier/name (example: type , default ...)filterArgs
- extra arguments used to compute propertiestoken
- separator token for complex propertiesframework
- the current framework
public java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
getTargetNames
in class OBBase
composedName
- OOQL property identifier/name (example: class, program[edit.action] .. )filterArgs
- extra arguments used to compute propertiesframework
- the current framework
public java.lang.String toString()
toString
in class AdminBase
public java.lang.String toString(Framework framework)
toString
in class AdminBase
framework
- the current frameworkpublic org.jdom.Element rangesToXML(java.lang.String rangeId, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
rangeId
- the range number or "program" (-1: return all ranges)filterArgs
- extra arguments used to compute the Field rangesframework
- the current frameworkpublic org.jdom.Element toXML(Framework framework)
toXML
in class AdminBase
framework
- the current frameworkpublic org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
toXML
in class AdminBase
getImage
- true to include "imagedata" element with the base64 encoded image datafullDump
- true to include detailed informationframework
- the current frameworkpublic void fromXML(org.jdom.Element rootElement)
fromXML
in class AdminBase
public java.lang.String getCreateCommand(boolean force)
getCreateCommand
in class AdminBase
force
- if true append the "force" options at the endpublic java.lang.String getSaveCommand(boolean force)
getSaveCommand
in class AdminBase
force
- if true append the "force" options at the endpublic java.lang.String compareUpdate(Field refField, boolean checkImage, boolean overwrite, boolean force, Framework framework) throws OberonException
refField
- the reference Field objectcheckImage
- if true compare also the image iconoverwrite
- if true update the database object instanceforce
- if true ignores optional propertiesframework
- the current framework
OberonException
fromXML(Element)
|
OBEROn SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |