com.mentata.sg8
Class SG8DnAttribute

java.lang.Object
  extended bycom.mentata.l3d.L3DAttribute
      extended bycom.mentata.l3d.L3DDnAttribute
          extended bycom.mentata.sg8.SG8DnAttribute
All Implemented Interfaces:
Comparator, SG8Attribute
Direct Known Subclasses:
SG8DnSubsetAttribute, SG8FilterAttribute, SG8NestAttribute, SG8ReverseDnAttribute

public class SG8DnAttribute
extends L3DDnAttribute
implements SG8Attribute

A distinguished name attribute for use with SG8 objects. This attribute type translates dn values into SG8 hyperlinks to entries of the defined target object for HTML output. Its standard update form elements allow the deletion of values. New values can be added from there through a separate linking process unique to SG8DnAttributes.

Since:
0.7
Author:
Jon Roberts

Field Summary
 
Fields inherited from interface com.mentata.sg8.SG8Attribute
TEXT_RESOURCES
 
Constructor Summary
SG8DnAttribute()
          Constructs an empty dn attribute without a target.
SG8DnAttribute(String target)
          Constructs an empty dn attribute with a named target object.
 
Method Summary
 String[] getHTMLValues()
          Returns the attribute values as HTML hyperlinks to associated entries.
 String getHyperlink()
          Returns an SG8 gateway hyperlink for displaying the attribute.
 String[] getMailTo()
          Returns a list of destination email addresses representing the attribute values.
 String getSeparator()
          Returns a separator string to display between values in HTML output.
protected  SG8Object getSG8Object()
          Returns an empty instance of the containing SG8 object for this attribute.
protected  SG8Object getSG8Target()
          Returns an empty instance of the target SG8 object for this attribute.
 String getUpdateHTML()
          Returns HTML form elements for removing values and a link for adding new ones.
 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.
 
Methods inherited from class com.mentata.l3d.L3DDnAttribute
getShortValues, getTargetObject, initialize, isLengthExceeded, same
 
Methods inherited from class com.mentata.l3d.L3DAttribute
addValue, compare, getAttribute, getBind, getContext, getLabel, getLengthThreshold, getName, getObject, getObject, getPrerequisites, getSize, getThreshold, getValues, isBound, isExceeded, isGenerated, isMultivalue, isRequired, removeValue, 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

SG8DnAttribute

public SG8DnAttribute()
Constructs an empty dn attribute without a target.


SG8DnAttribute

public SG8DnAttribute(String target)
Constructs an empty dn attribute with a named target object.

Parameters:
target - the target SG8 object name
Method Detail

getSG8Object

protected SG8Object getSG8Object()
                          throws SG8Exception
Returns an empty instance of the containing SG8 object for this attribute.

Returns:
the containing SG8 object
Throws:
SG8Exception - if the containing object is improperly defined

getSG8Target

protected SG8Object getSG8Target()
                          throws SG8Exception
Returns an empty instance of the target SG8 object for this attribute.

Returns:
the target SG8 object
Throws:
SG8Exception - if the target object is improperly defined

setHTMLThreshold

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

Specified by:
setHTMLThreshold in interface SG8Attribute
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.

Specified by:
isHTMLExceeded in interface SG8Attribute
Returns:
whether the attribute exceeds the HTML threshold

getHyperlink

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

Specified by:
getHyperlink in interface SG8Attribute
Returns:
the hyperlink HTML
Throws:
SG8Exception

setSeparator

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

Specified by:
setSeparator in interface SG8Attribute
Parameters:
separator - a string to display between values

getSeparator

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

Specified by:
getSeparator in interface SG8Attribute
Returns:
the separator string

setAugmenting

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

Specified by:
setAugmenting in interface SG8Attribute

isAugmenting

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

Specified by:
isAugmenting in interface SG8Attribute
Returns:
whether the attribute only accepts additional values

getHTMLValues

public String[] getHTMLValues()
                       throws SG8Exception
Returns the attribute values as HTML hyperlinks to associated entries.

Specified by:
getHTMLValues in interface SG8Attribute
Returns:
the HTML hyperlinks
Throws:
SG8Exception - if a value cannot be populated

getUpdateHTML

public String getUpdateHTML()
                     throws SG8Exception
Returns HTML form elements for removing values and a link for adding new ones.

Specified by:
getUpdateHTML in interface SG8Attribute
Returns:
the HTML modification form elements
Throws:
SG8Exception - if the attribute is generated or a value cannot be populated

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
Parameters:
req - a servlet request
Returns:
whether the attribute values changed
Throws:
SG8Exception - if form values are inappropriate or the attribute is generated

getMailTo

public String[] getMailTo()
                   throws SG8Exception
Returns a list of destination email addresses representing the attribute values.

Returns:
the email addresses corresponding to values
Throws:
SG8Exception - if the addresses cannot be determined