com.mentata.sg8
Interface SG8Attribute

All Known Implementing Classes:
SG8DnAttribute, SG8StringAttribute

public interface SG8Attribute

L3D attributes that fulfill additional SG8 functionality. This interface is implemented by all gateway attributes, defining methods to create a hyperlink to the attribute, translate values to HTML, define a separator for between values in HTML output, maintain value count thresholds for HTML output, and express/process attribute update HTML form elements.

Since:
0.7
Author:
Jon Roberts

Field Summary
static String TEXT_RESOURCES
          Textual resources property file.
 
Method Summary
 String[] getHTMLValues()
          Returns the attribute values formatted for HTML output.
 String getHyperlink()
          Returns an SG8 gateway hyperlink for displaying the attribute.
 String getSeparator()
          Returns a separator string to display between values in HTML output.
 String getUpdateHTML()
          Returns HTML form elements for modifying the attribute.
 boolean isAugmenting()
          Indicates if the attribute only accepts additional values.
 boolean isHTMLExceeded()
          Indicates if the number of values for the attribute exceeds the maximum for HTML display.
 boolean processUpdateHTML(HttpServletRequest req)
          Reads and processes attribute changes from relevant HTML request form parameters.
 void setAugmenting()
          Configures the attribute to only accept additional values.
 void setHTMLThreshold(int threshold)
          Sets the maximum number of values to display in HTML output.
 void setSeparator(String separator)
          Sets the separator string to display between values in HTML output.
 

Field Detail

TEXT_RESOURCES

public static final String TEXT_RESOURCES
Textual resources property file.

See Also:
Constant Field Values
Method Detail

getHTMLValues

public String[] getHTMLValues()
                       throws SG8Exception
Returns the attribute values formatted for HTML output.

Returns:
the values as HTML
Throws:
SG8Exception

setHTMLThreshold

public void setHTMLThreshold(int threshold)
Sets the maximum number of values to display in HTML output.

Parameters:
threshold - a maximum number of values to display

isHTMLExceeded

public boolean isHTMLExceeded()
Indicates if the number of values for the attribute exceeds the maximum for HTML display.

Returns:
whether the attribute exceeds the HTML threshold

getHyperlink

public String getHyperlink()
                    throws SG8Exception
Returns an SG8 gateway hyperlink for displaying the attribute.

Returns:
the hyperlink HTML
Throws:
SG8Exception

setSeparator

public void setSeparator(String separator)
Sets the separator string to display between values in HTML output.

Parameters:
separator - a string to display between values

getSeparator

public String getSeparator()
Returns a separator string to display between values in HTML output.

Returns:
the separator string

setAugmenting

public void setAugmenting()
Configures the attribute to only accept additional values.


isAugmenting

public boolean isAugmenting()
Indicates if the attribute only accepts additional values.

Returns:
whether the attribute only accepts additional values

getUpdateHTML

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

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.

Parameters:
req - a servlet request
Returns:
whether the attribute values changed
Throws:
SG8Exception - if form values are inappropriate or the attribute is generated