com.livis.livingtalks.model
Class BlockModel

java.lang.Object
  |
  +--com.livis.livingtalks.model.AbstractModel
        |
        +--com.livis.livingtalks.model.BlockModel
Direct Known Subclasses:
BlockWebImpl

public class BlockModel
extends AbstractModel

See Also:
Serialized Form

Field Summary
 java.lang.String authorKey
           
 java.lang.String blockType
           
 int duration
           
 java.lang.String talkList
           
 java.lang.String title
           
 
Fields inherited from class com.livis.livingtalks.model.AbstractModel
editor, key, timestamp
 
Constructor Summary
BlockModel()
           
 
Method Summary
protected  BlockModel assignBlockModel(java.lang.String key, java.lang.String editor, java.lang.String timestamp, int duration, java.lang.String blockType, java.lang.String authorKey, java.lang.String title, java.lang.String talkList)
           
 void check()
          Checks if model is logically OK.
 void checkForKeyCreation()
          Checks whether a key can be created from other model data.
 void clear()
          Set this Model to a clear state suitable for data entry into a clear form it is not recommended behaviour for a clear model to pass a subsequent check() test.
protected  java.lang.String createKey()
          Creates a key from other model data which must pass the check() test if isKeyCreatable() returns true.
 java.lang.String getAuthorKey()
           
 java.lang.String getBlockType()
           
 int getDuration()
           
 java.lang.String getDurationString()
           
 BlockModel getModel()
           
 java.lang.String getTalkList()
           
 java.util.Collection getTalks()
           
 java.lang.String getTitle()
           
 void init()
           
 boolean isKeyCreatable()
          Checks whether a key can, in theory, be created from other model data.
 void setAuthorKey(java.lang.String authorKey)
           
 void setBlockType(java.lang.String blockType)
           
 void setDuration(int minutes)
           
 void setDurationString(java.lang.String durationString)
           
 void setModel(BlockModel model)
           
 void setTalkList(java.lang.String talkList)
           
 void setTalks(java.util.Collection talks)
           
 void setTitle(java.lang.String title)
           
protected  java.util.List xmlTagPropertiesStore()
           
 
Methods inherited from class com.livis.livingtalks.model.AbstractModel
assignAbstractModel, checkForNonEmptyKey, getAutoKey, getEditor, getKey, getTimestamp, makeShort, setAutoKey, setEditor, setKey, setTimestamp, setTimestampFromDate, shallCreateKey, touch, XMLTagProperties
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

duration

public int duration

blockType

public java.lang.String blockType

authorKey

public java.lang.String authorKey

title

public java.lang.String title

talkList

public java.lang.String talkList
Constructor Detail

BlockModel

public BlockModel()
Method Detail

assignBlockModel

protected BlockModel assignBlockModel(java.lang.String key,
                                      java.lang.String editor,
                                      java.lang.String timestamp,
                                      int duration,
                                      java.lang.String blockType,
                                      java.lang.String authorKey,
                                      java.lang.String title,
                                      java.lang.String talkList)

getModel

public BlockModel getModel()

setModel

public void setModel(BlockModel model)

init

public void init()

clear

public void clear()
Description copied from class: AbstractModel
Set this Model to a clear state suitable for data entry into a clear form it is not recommended behaviour for a clear model to pass a subsequent AbstractModel.check() test.
Overrides:
clear in class AbstractModel

getDuration

public int getDuration()

setDuration

public void setDuration(int minutes)

getBlockType

public java.lang.String getBlockType()

setBlockType

public void setBlockType(java.lang.String blockType)

getAuthorKey

public java.lang.String getAuthorKey()

setAuthorKey

public void setAuthorKey(java.lang.String authorKey)

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

getTalkList

public java.lang.String getTalkList()

setTalkList

public void setTalkList(java.lang.String talkList)

getTalks

public java.util.Collection getTalks()

setTalks

public void setTalks(java.util.Collection talks)

getDurationString

public java.lang.String getDurationString()

setDurationString

public void setDurationString(java.lang.String durationString)

isKeyCreatable

public boolean isKeyCreatable()
Description copied from class: AbstractModel
Checks whether a key can, in theory, be created from other model data. This default implementation returns false. If derived classes re-implement this to return true, they should also overwrite AbstractModel.createKey() to return a suitable key and AbstractModel.checkForKeyCreation() to test whether a key is valid.
Overrides:
isKeyCreatable in class AbstractModel
Tags copied from class: AbstractModel
Returns:
true if a key can be created
See Also:
AbstractModel.createKey(), AbstractModel.checkForKeyCreation()

createKey

protected java.lang.String createKey()
Description copied from class: AbstractModel
Creates a key from other model data which must pass the AbstractModel.check() test if AbstractModel.isKeyCreatable() returns true. The generated key is returned. This default implementation always throws an exception.
Overrides:
createKey in class AbstractModel
Tags copied from class: AbstractModel
Throws:
LivingTalksException - if cannot create a key.
See Also:
AbstractModel.isKeyCreatable(), AbstractModel.check()

checkForKeyCreation

public void checkForKeyCreation()
Description copied from class: AbstractModel
Checks whether a key can be created from other model data. This method is called by AbstractModel.check() if AbstractModel.isKeyCreatable() returns true. This default implementation does nothing and should be re-implemented by derived classes in conjunction with AbstractModel.isKeyCreatable() and AbstractModel.createKey().
Overrides:
checkForKeyCreation in class AbstractModel
Tags copied from class: AbstractModel
Throws:
LivingTalksException - if a key cannot be created from other model data.
See Also:
AbstractModel.isKeyCreatable(), AbstractModel.createKey(), AbstractModel.check()

check

public void check()
Description copied from class: AbstractModel
Checks if model is logically OK. This default implementation checks for an non-empty key and -- if AbstractModel.isKeyCreatable() returns true -- whether the key can in fact be created (using AbstractModel.checkForKeyCreation()). Also, special charcters (<, >, &, ", ', \r, and \n) are removed from the key.
Overrides:
check in class AbstractModel
Tags copied from class: AbstractModel
Throws:
LivingTalksException - if model is invalid. Must not check for duplicate keys as this is checked anyway at database insertion time.
See Also:
AbstractModel.isKeyCreatable(), AbstractModel.createKey()

xmlTagPropertiesStore

protected java.util.List xmlTagPropertiesStore()
Overrides:
xmlTagPropertiesStore in class AbstractModel