public class Division extends AbstractWingElement implements StructuralElement, WingMergeableElement
The div element represents a major section of content and can contain a wide
variety of other elements to present that content to the user. It can contain
TEI style paragraphs, tables, and lists, as well as references to artifact
information stored in artifactMeta. The div element is also recursive,
allowing it to be further divided into other divs.
| Modifier and Type | Field and Description |
|---|---|
static String |
A_ACTION
The name of the action attribute
|
static String |
A_BEHAVIOR
The name of the method attribute
|
static String |
A_BEHVIOR_SENSITIVE_FIELDS
The name of the continuation name attribute.
|
static String |
A_CURRENT_PAGE
The name of the current page attribute
|
static String |
A_FIRST_ITEM_INDEX
The name of the first item index attribute
|
static String |
A_INTERACTIVE
The name of the interactive attribute
|
static String |
A_ITEMS_TOTAL
The name of the items total attribute
|
static String |
A_LAST_ITEM_INDEX
The name of the last item index attribute
|
static String |
A_METHOD
The name of the method attribute
|
static String |
A_NEXT_PAGE
The name of the next page attribute
|
static String |
A_PAGE_URL_MASK
The name of the page url mask attribute
|
static String |
A_PAGES_TOTAL
The name of the pages total attribute
|
static String |
A_PAGINATION
The name of the pagination attribute
|
static String |
A_PREVIOUS_PAGE
The name of the previous page attribute
|
static String |
E_DIVISION
The name of the division element
|
static String |
METHOD_GET
The possible interactive division methods: get, post, or multipart.
|
static String |
METHOD_MULTIPART |
static String |
METHOD_POST |
static String[] |
METHODS
The possible interactive division methods names collected into one array
|
static String |
PAGINATION_MASKED |
static String |
PAGINATION_SIMPLE
The possible pagination types: simple and masked
|
static String[] |
PAGINATION_TYPES
The possible pagination division types collected into one array
|
contextA_ID, A_NAME, A_RENDER| Modifier | Constructor and Description |
|---|---|
protected |
Division(WingContext context,
String name,
String rend)
Construct a non-interactive division.
|
protected |
Division(WingContext context,
String name,
String action,
String method,
String rend)
Construct an interactive division.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBehaviorSensitiveField(String fieldName)
Add to the list of behavior sensitive fields, these fields should be
updated each time a request partial page is submitted.
|
Division |
addDivision(String name)
Add a sub division for further logical grouping of content.
|
Division |
addDivision(String name,
String rend)
Add a sub division for further logical grouping of content.
|
Hidden |
addHidden(String name)
Add a hidden field to the division, this is a common operation that is
not directly supported by DRI.
|
Division |
addInteractiveDivision(String name,
String action,
String method)
Add an interactive sub division for further logical grouping of content
without specifying special rendering instructions.
|
Division |
addInteractiveDivision(String name,
String action,
String method,
String rend)
Add an interactive sub division for further logical grouping of content.
|
List |
addList(String name)
Append a list to the division.
|
List |
addList(String name,
String type)
Append a list to the division.
|
List |
addList(String name,
String type,
String rend)
append a list to the division.
|
Para |
addPara()
Append an unnamed paragraph to the division
|
void |
addPara(Message message)
Append a paragraph to the division and set the content of the paragraph.
|
void |
addPara(String characters)
Append a paragraph to the division and set the content of the paragraph.
|
Para |
addPara(String name,
String rend)
Append a paragraph to the division
|
ReferenceSet |
addReferenceSet(String name,
String type)
Add a reference set for metadata references.
|
ReferenceSet |
addReferenceSet(String name,
String type,
String orderBy,
String rend)
Add a reference set for metadata references.
|
void |
addSimpleHTMLFragment(boolean blankLines,
String HTML)
Add a section of translated HTML to the DRI document.
|
Table |
addTable(String name,
int rows,
int cols)
Append a table to the division.
|
Table |
addTable(String name,
int rows,
int cols,
String rend)
Append a table to the division.
|
void |
dispose()
dispose
|
void |
enableAJAX()
Enable AJAX behaviors on this interactive division.
|
Attributes |
merge(Attributes attributes)
Notify this element that it is being merged.
|
WingMergeableElement |
mergeChild(String namespace,
String localName,
String qName,
Attributes attributes)
Merge the given sub-domain of metadata elements.
|
boolean |
mergeEqual(String namespace,
String localName,
String qName,
Attributes attributes)
Determine if the given SAX event is the same division element.
|
Head |
setHead()
Set the head element which is the label associated with this division.
|
void |
setHead(Message message)
Set the head element which is the label associated with this division.
|
void |
setHead(String characters)
Set the head element which is the label associated with this division.
|
void |
setMaskedPagination(int itemsTotal,
int firstItemIndex,
int lastItemIndex,
int currentPage,
int pagesTotal,
String pageURLMask)
Make this div paginated ( a div that spans multiple pages ) using the
masked page paradigm.
|
void |
setSimplePagination(int itemsTotal,
int firstItemIndex,
int lastItemIndex,
String previousPage,
String nextPage)
Make this div paginated ( a div that spans multiple pages ) using the
simple page paradigm.
|
void |
toSAX(ContentHandler contentHandler,
LexicalHandler lexicalHandler,
org.xml.sax.helpers.NamespaceSupport namespaces)
Translate this division to SAX
|
endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElementpublic static final String E_DIVISION
public static final String A_INTERACTIVE
public static final String A_ACTION
public static final String A_METHOD
public static final String A_BEHAVIOR
public static final String A_BEHVIOR_SENSITIVE_FIELDS
public static final String A_PAGINATION
public static final String A_PREVIOUS_PAGE
public static final String A_NEXT_PAGE
public static final String A_ITEMS_TOTAL
public static final String A_FIRST_ITEM_INDEX
public static final String A_LAST_ITEM_INDEX
public static final String A_CURRENT_PAGE
public static final String A_PAGES_TOTAL
public static final String A_PAGE_URL_MASK
public static final String METHOD_GET
public static final String METHOD_POST
public static final String METHOD_MULTIPART
public static final String[] METHODS
public static final String PAGINATION_SIMPLE
public static final String PAGINATION_MASKED
public static final String[] PAGINATION_TYPES
protected Division(WingContext context, String name, String rend) throws WingException
context - (Required) The context this element is contained in, such as
where to route SAX events and what i18n catalogue to use.name - (Required) a local identifier used to differentiate the
element from its siblings.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.protected Division(WingContext context, String name, String action, String method, String rend) throws WingException
context - (Required) The context this element is contained in, such as
where to route SAX events and what i18n catalogue to use.name - (Required) a local identifier used to differentiate the
element from its siblings.action - (Required) The form action attribute determines where the form
information should be sent for processing.method - (Required) Accepted values are "get", "post", and "multipart".
Determines the method used to pass gathered field values to
the handler specified by the action attribute. The multipart
method should be used if there are any file fields used within
the division.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public void enableAJAX()
public void addBehaviorSensitiveField(String fieldName) throws WingException
fieldName - (Required) The name of a single field (with no spaces).WingException - passed through.public void setSimplePagination(int itemsTotal,
int firstItemIndex,
int lastItemIndex,
String previousPage,
String nextPage)
itemsTotal - (Required) How many items exist across all paginated divs.firstItemIndex - (Required) The index of the first item included in this div.lastItemIndex - (Required) The index of the last item included in this div.previousPage - (May be null) The URL of the previous page of the div, if it
exists.nextPage - (May be null) The URL of the previous page of the div, if it
exists.public void setMaskedPagination(int itemsTotal,
int firstItemIndex,
int lastItemIndex,
int currentPage,
int pagesTotal,
String pageURLMask)
itemsTotal - (Required) How many items exist across all paginated divs.firstItemIndex - (Required) The index of the first item included in this div.lastItemIndex - (Required) The index of the last item included in this div.currentPage - (Required) The index of the page currently displayed for this
div.pagesTotal - (Required) How many pages the paginated div spans.pageURLMask - (Required) The mask of a URL to a particular within the
paginated set. Number of the destination page should replace
the {pageNum} string in the URL mask to generate a full URL to
that page.public Head setHead() throws WingException
WingException - passed through.public void setHead(String characters) throws WingException
characters - (May be null) Unprocessed characters to be includedWingException - passed through.public void setHead(Message message) throws WingException
message - (Required) A key into the i18n catalogue for translation into
the user's preferred language.WingException - passed through.public Division addDivision(String name, String rend) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public Division addDivision(String name) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.WingException - passed through.public Division addInteractiveDivision(String name, String action, String method, String rend) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.action - (Required) The form action attribute determines where the form
information should be sent for processing.method - (Required) Accepted values are "get", "post", and "multipart".
Determines the method used to pass gathered field values to
the handler specified by the action attribute. The multipart
method should be used if there are any file fields used within
the division.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public Division addInteractiveDivision(String name, String action, String method) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.action - (Required) The form action attribute determines where the form
information should be sent for processing.method - (Required) Accepted values are "get", "post", and "multipart".
Determines the method used to pass gathered field values to
the handler specified by the action attribute. The multipart
method should be used if there are any file fields used within
the division.WingException - passed through.public Para addPara(String name, String rend) throws WingException
name - (May be null) a local identifier used to differentiate the
element from its siblings.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public Para addPara() throws WingException
WingException - passed through.public void addPara(String characters) throws WingException
characters - (May be null) Untranslated character data to be included as
the contents of this para.WingException - passed through.public void addPara(Message message) throws WingException
message - (Required) Key to the i18n catalogue to translate the content
into the language preferred by the user.WingException - passed throughpublic List addList(String name, String type, String rend) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.type - (May be null) an optional attribute to explicitly specify the
type of list. In the absence of this attribute, the type of a
list will be inferred from the presence and content of labels
on its items. Accepted values are found at
List.TYPESrend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public List addList(String name, String type) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.type - (May be null) an optional attribute to explicitly specify the
type of list. In the absence of this attribute, the type of a
list will be inferred from the presence and content of labels
on its items. Accepted values are found at
List.TYPESWingException - passed through.public List addList(String name) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.WingException - passed through.public Table addTable(String name, int rows, int cols, String rend) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.rows - (Required) The number of rows in the table.cols - (Required) The number of columns in the table.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public Table addTable(String name, int rows, int cols) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.rows - (Required) The number of rows in the table.cols - (Required) The number of columns in the table.WingException - passed through.public ReferenceSet addReferenceSet(String name, String type, String orderBy, String rend) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.type - (Required) The include type, see IncludeSet.TYPESorderBy - (May be null) An statement of ordering within the include set.rend - (May be null) a rendering hint used to override the default
display of the element.WingException - passed through.public ReferenceSet addReferenceSet(String name, String type) throws WingException
name - (Required) a local identifier used to differentiate the
element from its siblings.type - (Required) The include type, see IncludeSet.TYPESWingException - passed through.public Hidden addHidden(String name) throws WingException
name - (Required) The hidden fields name.WingException - passed through.public void addSimpleHTMLFragment(boolean blankLines,
String HTML)
throws WingException
Depending on the given HTML this may result in multiple paragraphs being opened and several bold tags being included.
blankLines - (Required) Treat blank lines as paragraphs delimiters.HTML - (Required) The HTML contentWingException - passed through.public boolean mergeEqual(String namespace, String localName, String qName, Attributes attributes) throws SAXException, WingException
mergeEqual in interface WingMergeableElementnamespace - The element's name spacelocalName - The local, unqualified, name for this elementqName - The qualified name for this elementattributes - The element's attributesSAXException - whenever.WingException - whenever.public WingMergeableElement mergeChild(String namespace, String localName, String qName, Attributes attributes) throws SAXException, WingException
mergeChild in interface WingMergeableElementnamespace - The element's name spacelocalName - The local, unqualified, name for this element *qName - The qualified name for this elementattributes - The element's attributesSAXException - whenever.WingException - whenever.public Attributes merge(Attributes attributes) throws SAXException, WingException
merge in interface WingMergeableElementattributes - attributes.SAXException - whenever.WingException - whenever.public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, org.xml.sax.helpers.NamespaceSupport namespaces) throws SAXException
toSAX in interface WingElementcontentHandler - (Required) The registered contentHandler where SAX events
should be routed, too.lexicalHandler - (Required) The registered lexicalHandler where lexical
events (such as CDATA, DTD, etc) should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.SAXException - on error.public void dispose()
dispose in interface WingElementdispose in class AbstractWingElementCopyright © 2016 DuraSpace. All rights reserved.