scone.netobjects
Class Link

java.lang.Object
  extended by scone.netobjects.TableRecord
      extended by scone.netobjects.Link
All Implemented Interfaces:
Cacheable

public class Link
extends TableRecord

a Link represents a links-set from the database

Author:
Harald Weinreich, Volkert Buchmann

Field Summary
static java.lang.String COPYRIGHT
           
protected static DBTableAdapter dbTable
           
static int DOWN
           
static int EXTERNAL
           
static int FRAGMENT
           
static int FROMCLUSTERINDEX
           
static int FROMHOME
           
protected  NetNode fromNode
           
static int INTERNAL
           
static int NOHTML
           
static int NOHTTP
           
static int QUERY
           
static int SAMECLUSTER
           
static int SAMEDOCUMENT
           
static int TOCLUSTERINDEX
           
static int TOHOME
           
protected  NetNode toNode
           
static int UP
           
 
Fields inherited from class scone.netobjects.TableRecord
ctei, date, fieldValues, hasChanged, hasRecordInDB, persistent
 
Constructor Summary
Link()
           
Link(NetNode from, NetNode to, java.lang.String fragment)
           
Link(java.sql.ResultSet results)
           
Link(java.lang.String linkId)
           
 
Method Summary
 void computeType()
          Compute link type.
 void fill(adc.parser.HtmlTag tag)
          sets the attributes to the values from a tag
 java.lang.String getAlt()
          returns the ALT parameter of a pictures inside that link
 java.lang.String getFragment()
          returns the fragment: protocol://server/path#fragment
 NetNode getFromNode()
          returns the node in which the link is defined
 java.lang.Object getKey(int KeyNo)
          returns the hashkey for this object (to be deprecated!)
 java.lang.String getLinkId()
          returns the id of this link
 java.lang.String getLinkText()
          returns the text between the opening and the closing a-tag
 java.lang.String getRel()
          returns the rel parameter
 java.lang.String getRev()
          returns the rev parameter
 java.lang.String getTarget()
          returns the target window/frame
 java.lang.String getTitle()
          returns the title parameter
 NetNode getToNode()
          returns the node to which the link is pointing
 int getType()
          returns the link type bitfield parameter
 void setAlt(java.lang.String v)
          sets the ALT parameter of a pictue inside this link
 void setLinkText(java.lang.String v)
          sets the text between the opening and the closing a-tag
 void setRel(java.lang.String v)
          sets the rel parameter
 void setRev(java.lang.String v)
          sets the rev parameter
 void setTarget(java.lang.String v)
          sets the target window/frame
 void setTitle(java.lang.String v)
          sets the title parameter
 void setType(int t)
          sets the type parameter
 void store()
          Store Link to DB
For performance reasons, links objects can be created without corresponding DB entry!
 
Methods inherited from class scone.netobjects.TableRecord
isPersistent, now, setCacheTableEntryInterface, setChanged, setPersistent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

SAMEDOCUMENT

public static final int SAMEDOCUMENT
See Also:
Constant Field Values

FRAGMENT

public static final int FRAGMENT
See Also:
Constant Field Values

QUERY

public static final int QUERY
See Also:
Constant Field Values

EXTERNAL

public static final int EXTERNAL
See Also:
Constant Field Values

INTERNAL

public static final int INTERNAL
See Also:
Constant Field Values

FROMHOME

public static final int FROMHOME
See Also:
Constant Field Values

TOHOME

public static final int TOHOME
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

SAMECLUSTER

public static final int SAMECLUSTER
See Also:
Constant Field Values

FROMCLUSTERINDEX

public static final int FROMCLUSTERINDEX
See Also:
Constant Field Values

TOCLUSTERINDEX

public static final int TOCLUSTERINDEX
See Also:
Constant Field Values

NOHTTP

public static final int NOHTTP
See Also:
Constant Field Values

NOHTML

public static final int NOHTML
See Also:
Constant Field Values

dbTable

protected static DBTableAdapter dbTable

fromNode

protected NetNode fromNode

toNode

protected NetNode toNode
Constructor Detail

Link

public Link()

Link

public Link(java.sql.ResultSet results)

Link

public Link(java.lang.String linkId)

Link

public Link(NetNode from,
            NetNode to,
            java.lang.String fragment)
Method Detail

getLinkId

public java.lang.String getLinkId()
returns the id of this link

Returns:
the id

getLinkText

public java.lang.String getLinkText()
returns the text between the opening and the closing a-tag

Returns:
the linktext

setLinkText

public void setLinkText(java.lang.String v)
sets the text between the opening and the closing a-tag

Parameters:
v - the linktext

getTarget

public java.lang.String getTarget()
returns the target window/frame

Returns:
the target

setTarget

public void setTarget(java.lang.String v)
sets the target window/frame

Parameters:
v - the target

getTitle

public java.lang.String getTitle()
returns the title parameter

Returns:
the title

setTitle

public void setTitle(java.lang.String v)
sets the title parameter

Parameters:
v - the title

getAlt

public java.lang.String getAlt()
returns the ALT parameter of a pictures inside that link

Returns:
the IMaGes ALT parameter

setAlt

public void setAlt(java.lang.String v)
sets the ALT parameter of a pictue inside this link

Parameters:
v - the IMaGes ALT parameter

getRev

public java.lang.String getRev()
returns the rev parameter

Returns:
the rev parameter

setRev

public void setRev(java.lang.String v)
sets the rev parameter

Parameters:
v - the rev parameter

getRel

public java.lang.String getRel()
returns the rel parameter

Returns:
the rel parameter

setRel

public void setRel(java.lang.String v)
sets the rel parameter

Parameters:
v - the rel parameter

getType

public int getType()
returns the link type bitfield parameter

Returns:
the typ parameter

setType

public void setType(int t)
sets the type parameter

Parameters:
t - the type parameter

getFromNode

public NetNode getFromNode()
returns the node in which the link is defined

Returns:
the defining node

getToNode

public NetNode getToNode()
returns the node to which the link is pointing

Returns:
the linked node

getFragment

public java.lang.String getFragment()
returns the fragment: protocol://server/path#fragment

Returns:
the fragment

fill

public void fill(adc.parser.HtmlTag tag)
sets the attributes to the values from a tag

Parameters:
tag - the tag

store

public void store()
Store Link to DB
For performance reasons, links objects can be created without corresponding DB entry! Therefore store can also create new DB entries.


getKey

public java.lang.Object getKey(int KeyNo)
Description copied from interface: Cacheable
returns the hashkey for this object (to be deprecated!)

Specified by:
getKey in interface Cacheable
Specified by:
getKey in class TableRecord
Parameters:
KeyNo - the number of the key to be generated
Returns:
the Key(s) corresponding to the object.

computeType

public void computeType()
Compute link type. Type information is stored in bits of an integer value. This data is provided to make access to this kind of topological information easier and faster.

bit 0: Roundtrip: Pointing to the same document.
bit 1: Fragment: Fragment defined
bit 2: Query: Query GET-parameters defined

bit 6: External Link: Pointing from one to an other site
bit 7: Sub-External: Pointign to an other site, but same top level domains.

bit 10: From Home: Coming from Homepage of server
bit 11: Home: Pointing to homepage of server

bit 14: Down: Pointing down the hierarchy of the URL - longer path name, same branch
bit 15: Up: Pointing up - shorter path name, same branch.
bit 16: Associative up -
bit 17: Assiciative down -

bit 20: Cluster: Link points to document in same path.
bit 21: From Cluster root: from collection root, page name is index.html, default.htm etc.
bit 22: To Cluster root: to collection root

bit 24: Other protocol: Link destination is not http but mail, ftp etc.
bit 25: Other Mime-Type: Destination of link is not HTML-document.