com.mentata.sg8
Class SG8HTMLBlockAttribute

java.lang.Object
  extended bycom.mentata.l3d.L3DAttribute
      extended bycom.mentata.sg8.SG8StringAttribute
          extended bycom.mentata.sg8.SG8HTMLBlockAttribute
All Implemented Interfaces:
Comparator, SG8Attribute

public class SG8HTMLBlockAttribute
extends SG8StringAttribute

An attribute representing a block of HTML for use with SG8 objects. The values for this attribute type each represent a fragment of HTML with an H3 heading line and a paragraph body. Instances generate and process update form elements that allow separate modification of the heading and body text.

Since:
0.7
Author:
Jon Roberts

Field Summary
 
Fields inherited from interface com.mentata.sg8.SG8Attribute
TEXT_RESOURCES
 
Constructor Summary
SG8HTMLBlockAttribute()
          Creates an empty HTML block attribute.
SG8HTMLBlockAttribute(int rows)
          Creates an empty HTML block attribute with the given number of rows.
 
Method Summary
 String getUpdateHTML()
          Returns HTML form elements for modifying the attribute.
 boolean processUpdateHTML(HttpServletRequest req)
          Reads and processes attribute changes from relevant HTML request form parameters.
 
Methods inherited from class com.mentata.sg8.SG8StringAttribute
getHTMLValues, getHyperlink, getSeparator, getSG8Object, isAugmenting, isHTMLExceeded, setAugmenting, setHTMLThreshold, setSeparator
 
Methods inherited from class com.mentata.l3d.L3DAttribute
addValue, compare, getAttribute, getBind, getContext, getLabel, getLengthThreshold, getName, getObject, getObject, getPrerequisites, getShortValues, getSize, getThreshold, getValues, initialize, isBound, isExceeded, isGenerated, isLengthExceeded, isMultivalue, isRequired, removeValue, same, setGenerated, setLabel, setLengthThreshold, setPrerequisites, setThreshold, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SG8HTMLBlockAttribute

public SG8HTMLBlockAttribute()
Creates an empty HTML block attribute.


SG8HTMLBlockAttribute

public SG8HTMLBlockAttribute(int rows)
Creates an empty HTML block attribute with the given number of rows.

Parameters:
rows - the number of rows in the textarea used for editing the body
Method Detail

getUpdateHTML

public String getUpdateHTML()
                     throws SG8Exception
Returns HTML form elements for modifying the attribute.

Specified by:
getUpdateHTML in interface SG8Attribute
Overrides:
getUpdateHTML in class SG8StringAttribute
Returns:
the HTML modification form elements
Throws:
SG8Exception - if the attribute is generated

processUpdateHTML

public boolean processUpdateHTML(HttpServletRequest req)
                          throws SG8Exception
Reads and processes attribute changes from relevant HTML request form parameters.

Specified by:
processUpdateHTML in interface SG8Attribute
Overrides:
processUpdateHTML in class SG8StringAttribute
Parameters:
req - a servlet request
Returns:
whether the attribute values changed
Throws:
SG8Exception - if form values are inappropriate or the attribute is generated