Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.content.bean
Class Link  view Link download Link.java

java.lang.Object
  extended bycom.RuntimeCollective.content.bean.SimpleContent
      extended bycom.RuntimeCollective.content.bean.Link
All Implemented Interfaces:
Content, com.RuntimeCollective.webapps.bean.Duplicable, com.RuntimeCollective.webapps.bean.EntityBean, java.io.Serializable
Direct Known Subclasses:
ForwardLink, URLLink

public abstract class Link
extends SimpleContent

The Link abstract class describes a Link entity, obviously. To implement a new kind of Link, you will have to define: - isDisplayable: says whether the Link is ready to be displayed - getLinkURL: gives a URL representation of this Link The bias here is for HTML links: viewFormat by default only supports the following formats: - "html", - "htmlshort", where LinkText is replaced by the URL - "htmlurl", as above and the ExplanatoryText is not shown (This is why getLinkURL has to be defined). You can extend viewFormat to support any other format you want. Existing implementations include at this time: - URLLink, a Link based on a URL - ForwardLink, a Link based on a Struts forward - SiteLocationLink (part of the Sitemap module), a Link to a SiteLocation

Version:
$Id: Link.java,v 1.13 2003/10/13 15:42:42 fabrice Exp $

Field Summary
static java.lang.String AHREF
           
static java.lang.String CLOSE_TAG
           
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
static java.lang.String END_QUOTE
           
static java.lang.String END_TAG
           
protected  java.lang.String ExplanatoryText
          The ExplanatoryText
static java.lang.String FOLLOW_LINK
           
static java.lang.String HTTP
           
protected  boolean IsTrackable
          Should we track this link ?
protected  java.lang.String LinkText
          The Linktext
private static java.lang.String moreString
           
static java.lang.String NEW_TARGET
           
protected  int NumberOfHits
          How many hits on this Link
protected  boolean OpenInNewWindow
          Should this link open in a new window
static java.lang.String PAGE_ROOT
           
 
Fields inherited from class com.RuntimeCollective.content.bean.SimpleContent
Author_id, CreationDate, id, LastModifiedDate, LastModifierUser_id
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Constructor Summary
Link()
          Construct a new blank Link, giving it a new unique ID.
Link(int id)
          Get a Link from the database, given an id.
 
Method Summary
 void addHit()
          Log one more hit
 void delete()
          Delete this Link from the database.
 java.lang.String getDescription()
          Get the description Return the ExplanatoryText
 java.lang.String getExplanatoryText()
          Get the ExplanatoryText
 boolean getIsTrackable()
          Get the IsTrackable
 java.lang.String getLinkCloseTag()
          Returns simply a link close tag: </a>
 java.lang.String getLinkOpenTag()
          Get the LinkOpenTag, with trackable code and/or open in new page code You should check isDisplayable first.
 java.lang.String getLinkText()
          Get the Linktext
abstract  java.net.URL getLinkURL()
          Get the LinkURL You should check isDisplayable first.
 int getNumberOfHits()
          Get the NumberOfHits
 boolean getOpenInNewWindow()
          Get the OpenInNewWindow
 java.lang.String getTitle()
          Get the title Return the LinkText
abstract  boolean isDisplayable()
          Is this link displayable, ie is it valid ?
 boolean isTrackable()
          Get the IsTrackable
 void save()
          Save this Link to the database.
 void setExplanatoryText(java.lang.String explanatoryText)
          Set the ExplanatoryText
 void setIsTrackable(boolean isTrackable)
          Set the IsTrackable
 void setLinkText(java.lang.String linkText)
          Set the LinkText
 void setNumberOfHits(int number)
          Set the NumberOfHits
 void setOpenInNewWindow(boolean openInNewWindow)
          Set the OpenInNewWindow
 java.lang.Object viewFormat(java.lang.String format)
          Get the content in a certain format.
 
Methods inherited from class com.RuntimeCollective.content.bean.SimpleContent
customiseDuplicate, getAuthor, getCreationDate, getId, getLastModifiedDate, getLastModifierUser, makeDuplicate, makeDuplicate, setAuthor, setCreationDate, setDescription, setId, setLastModifiedDate, setLastModifierUser, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values

moreString

private static java.lang.String moreString

LinkText

protected java.lang.String LinkText
The Linktext


ExplanatoryText

protected java.lang.String ExplanatoryText
The ExplanatoryText


OpenInNewWindow

protected boolean OpenInNewWindow
Should this link open in a new window


IsTrackable

protected boolean IsTrackable
Should we track this link ?


NumberOfHits

protected int NumberOfHits
How many hits on this Link


AHREF

public static java.lang.String AHREF

HTTP

public static java.lang.String HTTP

FOLLOW_LINK

public static java.lang.String FOLLOW_LINK

END_QUOTE

public static java.lang.String END_QUOTE

NEW_TARGET

public static java.lang.String NEW_TARGET

END_TAG

public static java.lang.String END_TAG

PAGE_ROOT

public static java.lang.String PAGE_ROOT

CLOSE_TAG

public static java.lang.String CLOSE_TAG
Constructor Detail

Link

public Link()
     throws java.sql.SQLException
Construct a new blank Link, giving it a new unique ID.


Link

public Link(int id)
     throws java.sql.SQLException
Get a Link from the database, given an id.

Method Detail

save

public void save()
          throws java.sql.SQLException
Save this Link to the database.

Specified by:
save in interface com.RuntimeCollective.webapps.bean.EntityBean
Overrides:
save in class SimpleContent

delete

public void delete()
            throws java.sql.SQLException
Delete this Link from the database.

Specified by:
delete in interface com.RuntimeCollective.webapps.bean.EntityBean
Overrides:
delete in class SimpleContent

getTitle

public java.lang.String getTitle()
Get the title Return the LinkText

Specified by:
getTitle in interface Content
Overrides:
getTitle in class SimpleContent

getDescription

public java.lang.String getDescription()
Get the description Return the ExplanatoryText

Specified by:
getDescription in interface Content
Overrides:
getDescription in class SimpleContent

viewFormat

public java.lang.Object viewFormat(java.lang.String format)
Get the content in a certain format. Are supported: - "html", uses the LinkText and ExplanatoryText - "htmlshort", uses the LinkText - "htmlurl", uses the URL as LinkText

Specified by:
viewFormat in interface Content
Overrides:
viewFormat in class SimpleContent

setLinkText

public void setLinkText(java.lang.String linkText)
Set the LinkText


getLinkText

public java.lang.String getLinkText()
Get the Linktext


setExplanatoryText

public void setExplanatoryText(java.lang.String explanatoryText)
Set the ExplanatoryText


getExplanatoryText

public java.lang.String getExplanatoryText()
Get the ExplanatoryText


setOpenInNewWindow

public void setOpenInNewWindow(boolean openInNewWindow)
Set the OpenInNewWindow


getOpenInNewWindow

public boolean getOpenInNewWindow()
Get the OpenInNewWindow


setIsTrackable

public void setIsTrackable(boolean isTrackable)
Set the IsTrackable


getIsTrackable

public boolean getIsTrackable()
Get the IsTrackable


isTrackable

public boolean isTrackable()
Get the IsTrackable


setNumberOfHits

public void setNumberOfHits(int number)
Set the NumberOfHits


getNumberOfHits

public int getNumberOfHits()
Get the NumberOfHits


addHit

public void addHit()
Log one more hit


getLinkOpenTag

public java.lang.String getLinkOpenTag()
Get the LinkOpenTag, with trackable code and/or open in new page code You should check isDisplayable first.


getLinkCloseTag

public java.lang.String getLinkCloseTag()
Returns simply a link close tag: </a>


isDisplayable

public abstract boolean isDisplayable()
Is this link displayable, ie is it valid ?


getLinkURL

public abstract java.net.URL getLinkURL()
Get the LinkURL You should check isDisplayable first.