OBEROn SDK

com.oberon.ooql.sdk
Class Link

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

public class Link
extends ObjectBase
implements java.io.Serializable

Link between two OBEROn ObjectObj instances.

Version:
5.0
See Also:
Serialized Form

Field Summary
static int HIDDEN
          The hidden flag
static int INACTIVE
          The inactive flag
 
Fields inherited from class com.oberon.ooql.sdk.ObjectBase
bHasAccess, bsOptions, HIST_ADDLINK, HIST_CHANGECLASS, HIST_CHANGEHOLDER, HIST_CHANGELIFECYCLE, HIST_CHANGENAME, HIST_CHANGESPACE, HIST_CHANGETYPE, HIST_CLONE, HIST_CREATE, HIST_CUSTOM, HIST_DELEGATE, HIST_EDIT, HIST_FILEDELETE, HIST_FILEGET, HIST_FILELOCK, HIST_FILEPUT, HIST_FILERENAME, HIST_FILEUNLOCK, HIST_IGNORE, HIST_Length, HIST_LOCK, HIST_PROGRESS, HIST_REFUSE, HIST_REGRESS, HIST_REMOVELINK, HIST_REVISE, HIST_REVOKE, HIST_SETSTAGE, HIST_UNDO, HIST_UNLOCK, HIST_VALIDATE, LINK_HIST, OBJ_HIST
 
Constructor Summary
Link()
           
Link(boolean imported)
           
Link(java.lang.String linkID)
           
 
Method Summary
 java.lang.String accessToString(Framework framework)
          Get the list of framework User accesses for this Link (as String)
 java.lang.String accessToString(java.lang.String userName, Framework framework)
          Get the list of User accesses for this Link (as String)
 void clone(Framework framework)
          Create the new Link on the database (connect two ObjectObj instances) cloning it from this Link
 void create(boolean bidirectional, Framework framework)
          Create the new Link on the database (connect two ObjectObj instances)
 void create(Framework framework)
          Create the new Link on the database (connect two ObjectObj instances)
 void destroy(Framework framework)
          Remove the Link from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the Link properties from XML element tree
 int getAltId()
          Get the internal alternative ID [INTERNAL USAGE]
 java.lang.String getCreateCommand(boolean bidirectional)
          Return the OOQL command to create this ObjectObj with the settled properties
 java.lang.String getDescription()
          Get the description
 java.lang.String getFieldValue(java.lang.String fieldName, Framework framework)
          Get a Link's Field value directly from DB
 ObjectObj getFrom()
          Return the From side ObjectObj
 java.lang.String getFromClassName()
          Return the From side ObjectObj's Class name
 java.lang.String getFromHolder()
          Return the From side ObjectObj's holder
 java.lang.String getFromId()
          Return the From side ObjectObj's id
 java.lang.String getFromLifeCycle()
          Return the From side ObjectObj's Lifecycle (name)
 java.lang.String getFromName()
          Return the From side ObjectObj's name
 java.lang.String getFromRevision()
          Return the From side ObjectObj's revision
 java.lang.String getFromStage()
          Return the From side ObjectObj's Stage
 java.lang.String getLinkId()
          Deprecated. 
 java.lang.String getLinkType()
          Return the Link LinkType name
 LinkType getLinkType(Framework framework)
          Get the Link's LinkType LinkType
 java.lang.String getName()
          Link name is always empty
 java.lang.String getOldLinkType()
          Return the original Link LinkType when a change is made
 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 Link object by its OOQL identifier
 java.lang.String getSaveCommand()
          Return the OOQL command to update this Link 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 target names extracted by using an OOQL selector
 ObjectObj getTo()
          Return the To side ObjectObj
 java.lang.String getToClassName()
          Return the To side ObjectObj's Class name
 java.lang.String getToHolder()
          Return the To side ObjectObj's holder
 java.lang.String getToId()
          Return the To side ObjectObj's id
 java.lang.String getToLifeCycle()
          Return the To side ObjectObj's Lifecycle (name)
 java.lang.String getToName()
          Return the To side ObjectObj's name
 java.lang.String getToRevision()
          Return the To side ObjectObj's revision
 java.lang.String getToStage()
          Return the To side ObjectObj's Stage
 org.jdom.Element getXMLFields(Framework framework)
          Return the Link Field values as XML element tree
 org.jdom.Element getXMLFromObject(Framework framework)
          Return the Link from object as XML element tree
 org.jdom.Element getXMLToObject(Framework framework)
          Return the Link to object as XML element tree
 boolean isActive()
          Check if the Link is active
 boolean isHidden()
          Check if the Link is hidden
 boolean isImported()
          Check if the Link data are imported from Dump file
 void link(boolean fullLoad, Framework framework)
          Open the Link and read its properties from the database
 void link(Framework framework)
          Open the Link and read all properties from the database
static Link open(java.lang.String linkID, boolean fullLoad, Framework framework)
          Open a Link and read its properties from the database
static Link open(java.lang.String linkID, Framework framework)
          Open a Link and read all properties from the database
 void resetHistory()
          Force reload the Link History from DB
 void setActive(boolean active)
          Set the Link active flag
 void setAltId(int linkId)
          Set the internal alternative ID [INTERNAL USAGE]
 void setDescription(java.lang.String description)
          Set the description
 void setFrom(ObjectObj object)
          Define the From side ObjectObj
 void setFrom(java.lang.String className, java.lang.String name, java.lang.String revision)
          Define the From side ObjectObj using the Class name / name / revision
 void setFromId(java.lang.String objectID)
          Define the From side ObjectObj using its id
 void setHidden(boolean hidden)
          Set the Link hidden flag
 void setLinkType(LinkType linktype)
          Set the Link's LinkType [INTERNAL USAGE]
 void setLinkType(java.lang.String linkTypeName)
          Set the Link LinkType
 void setTo(ObjectObj object)
          Define the To side ObjectObj
 void setTo(java.lang.String className, java.lang.String name, java.lang.String revision)
          Define the To side ObjectObj using the Class name / name / revision
 void setToId(java.lang.String objectID)
          Define the To side ObjectObj using its id
 void show(Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the Link properties
 void show(Selector selector, Framework framework)
          Show the Link properties
 java.lang.String toString()
          Return the Link basic properties as String
 java.lang.String toString(Framework framework)
          Return the Link properties as a single String
 org.jdom.Element toXML(boolean getHistory, Framework framework)
          Return the Link properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Link properties as XML element tree
 void undo(Framework framework)
          Undo the last changes on field values
 void undo(int iterNum, Framework framework)
          Undo the changes on field values, till the specific number of iteration
 void unlink(Framework framework)
          Close the Link: disconnect the memory instance from the database instance
 void write(Framework framework)
          Update the Link to the database
 
Methods inherited from class com.oberon.ooql.sdk.ObjectBase
addAltHolder, addHistory, formatHistory, formatXMLHistory, getAltHolders, getAltHoldersAsString, getCrtDate, getCurrentIteration, getFieldNames, getFieldValue, getFieldValues, getHistory, getHistory, getHistoryFromXML, getHistoryOptionAsString, getHistoryOptionId, getHolder, getID, getIteration, getModDate, getOldAltHolders, getOldHolder, getSyncCounter, getXMLHistory, removeAllHistory, removeAltHolder, removeHistory, resetFieldValues, resetID, setCrtDate, setFieldValue, setFieldValue, setFieldValue, setFieldValues, setHistory, setHolder, setID, setModDate, setSyncCounter, show, updateAltHolders
 
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

HIDDEN

public static final int HIDDEN
The hidden flag

See Also:
Constant Field Values

INACTIVE

public static final int INACTIVE
The inactive flag

See Also:
Constant Field Values
Constructor Detail

Link

public Link()

Link

public Link(boolean imported)
Parameters:
imported - true if the Link data are imported from Dump file [INTERNAL USAGE]

Link

public Link(java.lang.String linkID)
Parameters:
linkID - the Link ID
Method Detail

open

public static Link open(java.lang.String linkID,
                        Framework framework)
                 throws OberonException
Open a Link and read all properties from the database

Parameters:
linkID - the Link ID
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

open

public static Link open(java.lang.String linkID,
                        boolean fullLoad,
                        Framework framework)
                 throws OberonException
Open a Link and read its properties from the database

Parameters:
linkID - the Link ID
fullLoad - if false skips the Field values
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(Framework framework)
          throws OberonException
Open the Link and read all properties from the database

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(boolean fullLoad,
                 Framework framework)
          throws OberonException
Open the Link and read its properties from the database

Parameters:
fullLoad - if false skips the Field values
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create the new Link on the database (connect two ObjectObj instances)

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions

create

public void create(boolean bidirectional,
                   Framework framework)
            throws OberonException
Create the new Link on the database (connect two ObjectObj instances)

Parameters:
bidirectional - if true create two links for both from and to versus
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions

clone

public void clone(Framework framework)
           throws OberonException
Create the new Link on the database (connect two ObjectObj instances) cloning it from this Link

Parameters:
framework - the current framework The LinkType will be the same;
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions

write

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

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions

undo

public void undo(Framework framework)
          throws OberonException
Undo the last changes on field values

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions
Since:
3.0

undo

public void undo(int iterNum,
                 Framework framework)
          throws OberonException
Undo the changes on field values, till the specific number of iteration

Parameters:
iterNum - the iteration number
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions
Since:
3.0

unlink

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

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or trigger exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the Link from the database. (disconnect ObjectObj instances)

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights or trigger exceptions

show

public void show(Selector selector,
                 Framework framework)
          throws java.io.IOException,
                 OberonException
Show the Link properties

Parameters:
selector - selection parameters (if null return all the link properties)
framework - the current framework
Throws:
java.io.IOException
OberonException
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 Link properties

Specified by:
show in class ObjectBase
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()

getName

public java.lang.String getName()
Link name is always empty

Specified by:
getName in class OBBase

setAltId

public void setAltId(int linkId)
Set the internal alternative ID [INTERNAL USAGE]


getAltId

public int getAltId()
Get the internal alternative ID [INTERNAL USAGE]


isImported

public boolean isImported()
Check if the Link data are imported from Dump file


getLinkId

@Deprecated
public java.lang.String getLinkId()
Deprecated. 


setFrom

public void setFrom(ObjectObj object)
             throws OberonException
Define the From side ObjectObj

Parameters:
object - the From side object
Throws:
OberonException
Since:
4.0

setFrom

public void setFrom(java.lang.String className,
                    java.lang.String name,
                    java.lang.String revision)
             throws OberonException
Define the From side ObjectObj using the Class name / name / revision

Parameters:
className - the ObjectObj's Class name
name - the ObjectObj's name
revision - the ObjectObj's revision
Throws:
OberonException

setFromId

public void setFromId(java.lang.String objectID)
Define the From side ObjectObj using its id

Parameters:
objectID - the ObjectObj's ID

getFrom

public ObjectObj getFrom()
Return the From side ObjectObj

Since:
4.0

getFromClassName

public java.lang.String getFromClassName()
Return the From side ObjectObj's Class name


getFromName

public java.lang.String getFromName()
Return the From side ObjectObj's name


getFromRevision

public java.lang.String getFromRevision()
Return the From side ObjectObj's revision


getFromId

public java.lang.String getFromId()
Return the From side ObjectObj's id


getFromHolder

public java.lang.String getFromHolder()
Return the From side ObjectObj's holder


getFromLifeCycle

public java.lang.String getFromLifeCycle()
Return the From side ObjectObj's Lifecycle (name)


getFromStage

public java.lang.String getFromStage()
Return the From side ObjectObj's Stage


setTo

public void setTo(ObjectObj object)
           throws OberonException
Define the To side ObjectObj

Parameters:
object - the To side object
Throws:
OberonException
Since:
4.0

setTo

public void setTo(java.lang.String className,
                  java.lang.String name,
                  java.lang.String revision)
           throws OberonException
Define the To side ObjectObj using the Class name / name / revision

Parameters:
className - the ObjectObj's Class name
name - the ObjectObj's name
revision - the ObjectObj's revision
Throws:
OberonException

setToId

public void setToId(java.lang.String objectID)
Define the To side ObjectObj using its id

Parameters:
objectID - the ObjectObj's ID

getTo

public ObjectObj getTo()
Return the To side ObjectObj

Since:
4.0

getToClassName

public java.lang.String getToClassName()
Return the To side ObjectObj's Class name


getToName

public java.lang.String getToName()
Return the To side ObjectObj's name


getToRevision

public java.lang.String getToRevision()
Return the To side ObjectObj's revision


getToId

public java.lang.String getToId()
Return the To side ObjectObj's id


getToHolder

public java.lang.String getToHolder()
Return the To side ObjectObj's holder


getToLifeCycle

public java.lang.String getToLifeCycle()
Return the To side ObjectObj's Lifecycle (name)


getToStage

public java.lang.String getToStage()
Return the To side ObjectObj's Stage


setLinkType

public void setLinkType(java.lang.String linkTypeName)
Set the Link LinkType

Parameters:
linkTypeName - the LinkType name

getOldLinkType

public java.lang.String getOldLinkType()
Return the original Link LinkType when a change is made


getLinkType

public java.lang.String getLinkType()
Return the Link LinkType name


setLinkType

public void setLinkType(LinkType linktype)
Set the Link's LinkType [INTERNAL USAGE]

Since:
4.0

getLinkType

public LinkType getLinkType(Framework framework)
                     throws OberonException
Get the Link's LinkType LinkType

Parameters:
framework - the current framework
Throws:
OberonException
Since:
4.0

setHidden

public void setHidden(boolean hidden)
Set the Link hidden flag


isHidden

public boolean isHidden()
Check if the Link is hidden


setActive

public void setActive(boolean active)
Set the Link active flag


isActive

public boolean isActive()
Check if the Link is active


getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName,
                                      Framework framework)
                               throws java.sql.SQLException,
                                      OberonException
Get a Link's Field value directly from DB

Specified by:
getFieldValue in class ObjectBase
Parameters:
fieldName - the Field name
framework - the current framework
Throws:
java.sql.SQLException
OberonException

setDescription

public void setDescription(java.lang.String description)
Description copied from class: ObjectBase
Set the description

Specified by:
setDescription in class ObjectBase

getDescription

public java.lang.String getDescription()
Description copied from class: ObjectBase
Get the description

Specified by:
getDescription in class ObjectBase

accessToString

public java.lang.String accessToString(Framework framework)
                                throws OberonException
Get the list of framework User accesses for this Link (as String)

Parameters:
framework - the current framework
Returns:
access flags in OOQL format separated with commas
Throws:
OberonException
Since:
4.0
See Also:
LinkType.hasAccess(int, Link, Framework)

accessToString

public java.lang.String accessToString(java.lang.String userName,
                                       Framework framework)
                                throws OberonException
Get the list of User accesses for this Link (as String)

Parameters:
userName - name of user to get the access
framework - the current framework
Returns:
access flags in OOQL format separated with commas
Throws:
OberonException
Since:
4.0
See Also:
LinkType.hasAccess(int, Link, String, Framework)

resetHistory

public void resetHistory()
Force reload the Link History from DB


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

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: linktype , from.id ...)
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 target names extracted by using an OOQL selector

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

getXMLFields

public org.jdom.Element getXMLFields(Framework framework)
Return the Link Field values as XML element tree

Parameters:
framework - the current framework

getXMLFromObject

public org.jdom.Element getXMLFromObject(Framework framework)
Return the Link from object as XML element tree

Parameters:
framework - the current framework

getXMLToObject

public org.jdom.Element getXMLToObject(Framework framework)
Return the Link to object as XML element tree

Parameters:
framework - the current framework

toXML

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

Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getHistory,
                              Framework framework)
Return the Link properties as XML element tree

Parameters:
getHistory - true to include the history table
framework - the current framework

fromXML

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


toString

public java.lang.String toString()
Return the Link basic properties as String

Overrides:
toString in class java.lang.Object
Since:
3.0

toString

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

Parameters:
framework - the current framework

getCreateCommand

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


getSaveCommand

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


OBEROn SDK

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