org.jasig.portal
Class ChannelDefinition

java.lang.Object
  extended by org.jasig.portal.ChannelDefinition
All Implemented Interfaces:
IBasicEntity

public class ChannelDefinition
extends java.lang.Object
implements IBasicEntity

Describes a published channel.

Version:
$Revision: 1.33 $ $Date: 2005/05/19 17:01:36 $
Author:
George Lindholm, ITServices, UBC

Field Summary
private  java.util.Date chanApvlDt
           
private  int chanApvlId
           
private  java.lang.String chanClass
           
private  java.lang.String chanDesc
           
private  java.util.Hashtable chanDescs
           
private  boolean chanEditable
           
private  java.lang.String chanFName
           
private  boolean chanHasAbout
           
private  boolean chanHasHelp
           
private  boolean chanIsSecure
           
private  java.lang.String chanLocale
           
private  java.lang.String chanName
           
private  java.util.Hashtable chanNames
           
private  java.util.Date chanPublDt
           
private  int chanPupblUsrId
           
private  int chanTimeout
           
private  java.lang.String chanTitle
           
private  java.util.Hashtable chanTitles
           
private  int chanTypeId
           
private  int id
           
private static org.apache.commons.logging.Log log
           
private  java.util.Map parameters
           
 
Constructor Summary
ChannelDefinition(int id)
          Constructs a channel definition.
 
Method Summary
 void addParameter(ChannelParameter parameter)
          Adds a parameter to this channel definition
 void addParameter(java.lang.String name, java.lang.String value, java.lang.String override)
          Adds a parameter to this channel definition
private  void addParameters(org.w3c.dom.Document doc, org.w3c.dom.Element channel)
           
 void clearParameters()
           
 java.util.Date getApprovalDate()
           
 int getApproverId()
           
private  org.w3c.dom.Element getBase(org.w3c.dom.Document doc, java.lang.String idTag, java.lang.String chanClassArg, boolean editable, boolean hasHelp, boolean hasAbout)
          Get an Element expressing the minimum attributes necessary to represent a channel.
 java.lang.String getDescription()
           
 java.lang.String getDescription(java.lang.String locale)
           
 org.w3c.dom.Element getDocument(org.w3c.dom.Document doc, java.lang.String idTag)
          return an xml representation of this channel
 org.w3c.dom.Element getDocument(org.w3c.dom.Document doc, java.lang.String idTag, java.lang.String statusMsg, int errorId)
          Display a message where this channel should be
 EntityIdentifier getEntityIdentifier()
          Implementation required by IBasicEntity interface.
 java.lang.String getFName()
           
 int getId()
           
 java.lang.String getJavaClass()
           
 java.lang.String getLocale()
           
 java.lang.String getName()
           
 java.lang.String getName(java.lang.String locale)
           
 ChannelParameter[] getParameters()
           
 java.util.Date getPublishDate()
           
 int getPublisherId()
           
 int getTimeout()
           
 java.lang.String getTitle()
           
 java.lang.String getTitle(java.lang.String locale)
           
 int getTypeId()
           
 boolean hasAbout()
           
 boolean hasHelp()
           
 boolean isEditable()
           
 boolean isPortlet()
          Returns true if this channel definition defines a portlet.
 boolean isSecure()
           
private  org.w3c.dom.Element nodeParameter(org.w3c.dom.Document doc, java.lang.String name, int value)
           
private  org.w3c.dom.Element nodeParameter(org.w3c.dom.Document doc, java.lang.String name, java.lang.String value)
           
 void putChanDescs(java.lang.String locale, java.lang.String chanDesc)
           
 void putChanNames(java.lang.String locale, java.lang.String chanName)
           
 void putChanTitles(java.lang.String locale, java.lang.String chanTitle)
           
 boolean refreshMe()
          Is it time to reload me from the data store
 void removeParameter(ChannelParameter parameter)
          Removes a parameter from this channel definition
 void removeParameter(java.lang.String name)
          Removes a parameter from this channel definition
 void replaceParameters(ChannelParameter[] parameters)
           
 void setApprovalDate(java.util.Date approvalDate)
           
 void setApproverId(int approvalId)
           
 void setDescription(java.lang.String descr)
           
 void setEditable(boolean editable)
           
 void setFName(java.lang.String fname)
           
 void setHasAbout(boolean hasAbout)
           
 void setHasHelp(boolean hasHelp)
           
 void setIsSecure(boolean isSecure)
           
 void setJavaClass(java.lang.String javaClass)
           
 void setLocale(java.lang.String locale)
           
 void setName(java.lang.String name)
           
 void setParameters(ChannelParameter[] parameters)
           
 void setPublishDate(java.util.Date publishDate)
           
 void setPublisherId(int publisherId)
           
 void setTimeout(int timeout)
           
 void setTitle(java.lang.String title)
           
 void setTypeId(int typeId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

id

private int id

chanFName

private java.lang.String chanFName

chanName

private java.lang.String chanName

chanDesc

private java.lang.String chanDesc

chanTitle

private java.lang.String chanTitle

chanClass

private java.lang.String chanClass

chanTimeout

private int chanTimeout

chanTypeId

private int chanTypeId

chanPupblUsrId

private int chanPupblUsrId

chanApvlId

private int chanApvlId

chanPublDt

private java.util.Date chanPublDt

chanApvlDt

private java.util.Date chanApvlDt

chanEditable

private boolean chanEditable

chanHasHelp

private boolean chanHasHelp

chanHasAbout

private boolean chanHasAbout

chanIsSecure

private boolean chanIsSecure

parameters

private java.util.Map parameters

chanLocale

private java.lang.String chanLocale

chanDescs

private java.util.Hashtable chanDescs

chanTitles

private java.util.Hashtable chanTitles

chanNames

private java.util.Hashtable chanNames
Constructor Detail

ChannelDefinition

public ChannelDefinition(int id)
Constructs a channel definition.

Parameters:
id - the channel definition ID
Method Detail

getId

public int getId()

getFName

public java.lang.String getFName()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

getTitle

public java.lang.String getTitle()

getJavaClass

public java.lang.String getJavaClass()

getTimeout

public int getTimeout()

getTypeId

public int getTypeId()

getPublisherId

public int getPublisherId()

getApproverId

public int getApproverId()

getPublishDate

public java.util.Date getPublishDate()

getApprovalDate

public java.util.Date getApprovalDate()

isEditable

public boolean isEditable()

hasHelp

public boolean hasHelp()

hasAbout

public boolean hasAbout()

isSecure

public boolean isSecure()

isPortlet

public boolean isPortlet()
Returns true if this channel definition defines a portlet. Returns false if this channel definition does not define a portlet or whether this channel definition defines a portlet or not cannot be determined because this definition's channel class is not set or cannot be loaded.

Returns:
true if we know we're a portlet, false otherwise

getParameters

public ChannelParameter[] getParameters()

getLocale

public java.lang.String getLocale()

getName

public java.lang.String getName(java.lang.String locale)

getDescription

public java.lang.String getDescription(java.lang.String locale)

getTitle

public java.lang.String getTitle(java.lang.String locale)

setFName

public void setFName(java.lang.String fname)

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String descr)

setTitle

public void setTitle(java.lang.String title)

setJavaClass

public void setJavaClass(java.lang.String javaClass)

setTimeout

public void setTimeout(int timeout)

setTypeId

public void setTypeId(int typeId)

setPublisherId

public void setPublisherId(int publisherId)

setApproverId

public void setApproverId(int approvalId)

setPublishDate

public void setPublishDate(java.util.Date publishDate)

setApprovalDate

public void setApprovalDate(java.util.Date approvalDate)

setEditable

public void setEditable(boolean editable)

setHasHelp

public void setHasHelp(boolean hasHelp)

setHasAbout

public void setHasAbout(boolean hasAbout)

setIsSecure

public void setIsSecure(boolean isSecure)

setLocale

public void setLocale(java.lang.String locale)

clearParameters

public void clearParameters()

setParameters

public void setParameters(ChannelParameter[] parameters)

replaceParameters

public void replaceParameters(ChannelParameter[] parameters)

putChanTitles

public void putChanTitles(java.lang.String locale,
                          java.lang.String chanTitle)

putChanNames

public void putChanNames(java.lang.String locale,
                         java.lang.String chanName)

putChanDescs

public void putChanDescs(java.lang.String locale,
                         java.lang.String chanDesc)

getEntityIdentifier

public EntityIdentifier getEntityIdentifier()
Implementation required by IBasicEntity interface.

Specified by:
getEntityIdentifier in interface IBasicEntity
Returns:
EntityIdentifier

addParameter

public void addParameter(ChannelParameter parameter)
Adds a parameter to this channel definition

Parameters:
parameter - the channel parameter to add

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value,
                         java.lang.String override)
Adds a parameter to this channel definition

Parameters:
name - the channel parameter name
value - the channel parameter value
override - the channel parameter override setting

removeParameter

public void removeParameter(ChannelParameter parameter)
Removes a parameter from this channel definition

Parameters:
parameter - the channel parameter to remove

removeParameter

public void removeParameter(java.lang.String name)
Removes a parameter from this channel definition

Parameters:
name - the parameter name

getBase

private org.w3c.dom.Element getBase(org.w3c.dom.Document doc,
                                    java.lang.String idTag,
                                    java.lang.String chanClassArg,
                                    boolean editable,
                                    boolean hasHelp,
                                    boolean hasAbout)
Get an Element expressing the minimum attributes necessary to represent a channel.

Parameters:
doc - Document that will be the owner of the Element returned
idTag - Value of the identifier for the channel
chanClassArg - fully qualified class name of the channel
editable - true if the channel handles the Edit event
hasHelp - true if the channel handles the Help event
hasAbout - true if the channel handles the About event
Returns:
Element representing the channel

nodeParameter

private final org.w3c.dom.Element nodeParameter(org.w3c.dom.Document doc,
                                                java.lang.String name,
                                                int value)

nodeParameter

private final org.w3c.dom.Element nodeParameter(org.w3c.dom.Document doc,
                                                java.lang.String name,
                                                java.lang.String value)

addParameters

private final void addParameters(org.w3c.dom.Document doc,
                                 org.w3c.dom.Element channel)

getDocument

public org.w3c.dom.Element getDocument(org.w3c.dom.Document doc,
                                       java.lang.String idTag,
                                       java.lang.String statusMsg,
                                       int errorId)
Display a message where this channel should be


getDocument

public org.w3c.dom.Element getDocument(org.w3c.dom.Document doc,
                                       java.lang.String idTag)
return an xml representation of this channel


refreshMe

public boolean refreshMe()
Is it time to reload me from the data store