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

Quick Search    Search Deep

com.RuntimeCollective.bboard.bean
Class BoardLink  view BoardLink download BoardLink.java

java.lang.Object
  extended bycom.RuntimeCollective.content.bean.SimpleContent
      extended bycom.RuntimeCollective.content.bean.Link
          extended bycom.RuntimeCollective.bboard.bean.BoardLink
All Implemented Interfaces:
com.RuntimeCollective.content.bean.Content, com.RuntimeCollective.webapps.bean.Duplicable, com.RuntimeCollective.webapps.bean.EntityBean, java.io.Serializable

public class BoardLink
extends com.RuntimeCollective.content.bean.Link

The BoardLink class implements the abstract Link class, by linking to a Board.

NB: Saving a BoardLink doesn't save its Board, as that could provoke some infinite loop. So take care of saving the destination first.

If you want to be spared the hassle of writing JSPs for the creation of your BoardLink objects, do have a look at the pages written for the Sussex Enterprise project. You can find them by checking out the relevent project: "cvs co rsework", then look in rsework/web/admin.

The pages are called addBoardLinkXXX.jsp. They should be pretty self-explanatory. The rsework/struts-config.xml file is also worth checking, for the action mappings etc.

And while you're at it, why not vanilla them and copy them to bboard/web/admin ...

You can also check the Sussex Enterprise staging server (ask Fabrice, JoeH or Sophie).

Version:
$Id: BoardLink.java,v 1.12 2003/09/30 15:12:43 joe Exp $

Field Summary
protected  int BoardId
          Does this BoardLink link to a Board, and then which one ?
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
static java.lang.String HTTP
           
static java.lang.String PAGEROOT
           
static java.lang.String VIEWBOARD
           
static java.lang.String VIEWBOARDPATHPARAM
           
 
Fields inherited from class com.RuntimeCollective.content.bean.Link
AHREF, CLOSE_TAG, END_QUOTE, END_TAG, ExplanatoryText, FOLLOW_LINK, IsTrackable, LinkText, NEW_TARGET, NumberOfHits, OpenInNewWindow, 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
BoardLink()
          Construct a new blank BoardLink, giving it a new unique ID.
BoardLink(int id)
          Get a BoardLink from the database, given an id.
 
Method Summary
 void delete()
          Delete this BoardLink from the database.
 Board getBoard()
          Get the Board
 int getBoardId()
          Get the Board Id.
 java.lang.String getLinkText()
          Get the LinkText: for a BoardLink, this uses the Board's Name or SectionName.
 java.net.URL getLinkURL()
          Get the LinkURL: a link to viewPage or previewPage For plain users, you should check if the link is displayable before calling this.
 boolean getOpenInNewWindow()
          Get the OpenInNewWindow: redefine to take into account the template of the Board
 boolean isDisplayable()
          Is this link displayable, ie is it valid ?
 void save()
          Save this BoardLink to the database.
 void setBoard(Board board)
          Set the Board
 
Methods inherited from class com.RuntimeCollective.content.bean.Link
addHit, getDescription, getExplanatoryText, getIsTrackable, getLinkCloseTag, getLinkOpenTag, getNumberOfHits, getTitle, isTrackable, setExplanatoryText, setIsTrackable, setLinkText, setNumberOfHits, setOpenInNewWindow, viewFormat
 
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

HTTP

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

PAGEROOT

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

VIEWBOARD

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

VIEWBOARDPATHPARAM

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

BoardId

protected int BoardId
Does this BoardLink link to a Board, and then which one ?

Constructor Detail

BoardLink

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


BoardLink

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

Method Detail

save

public void save()
Save this BoardLink to the database.


delete

public void delete()
Delete this BoardLink from the database.


isDisplayable

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


getLinkURL

public java.net.URL getLinkURL()
Get the LinkURL: a link to viewPage or previewPage For plain users, you should check if the link is displayable before calling this.


getLinkText

public java.lang.String getLinkText()
Get the LinkText: for a BoardLink, this uses the Board's Name or SectionName.


getOpenInNewWindow

public boolean getOpenInNewWindow()
Get the OpenInNewWindow: redefine to take into account the template of the Board


setBoard

public void setBoard(Board board)
Set the Board


getBoard

public Board getBoard()
Get the Board


getBoardId

public int getBoardId()
Get the Board Id. This is necessary when deleting a Board.