org.dspace.app.xmlui.wing.element
Class PageMeta

java.lang.Object
  extended by org.dspace.app.xmlui.wing.element.AbstractWingElement
      extended by org.dspace.app.xmlui.wing.element.PageMeta
All Implemented Interfaces:
MetadataElement, WingElement, WingMergeableElement

public class PageMeta
extends AbstractWingElement
implements WingMergeableElement, MetadataElement

A class representing a set of metadata about the page being generated.

Author:
Scott Phillips

Field Summary
static String E_PAGE_META
          Name of the pageMeta element
 
Fields inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
context
 
Fields inherited from interface org.dspace.app.xmlui.wing.element.MetadataElement
A_REPOSITORY_IDENTIFIER
 
Constructor Summary
protected PageMeta(WingContext context)
          Construct a new pageMeta
 
Method Summary
 Metadata addMetadata(String element)
          Add metadata about this page.
 Metadata addMetadata(String element, String qualifier)
          Add metadata about this page.
 Metadata addMetadata(String element, String qualifier, String language)
          Add metadata about this page.
 Metadata addMetadata(String element, String qualifier, String language, boolean allowMultiple)
          Add metadata about this page.
 Trail addTrail()
          Add a new trail to the page without a link or render attribute.
 Trail addTrail(String target, String rend)
          Add a new trail to the page.
 void addTrailLink(String target, Message message)
          Add a new trail link to the page.
 void addTrailLink(String target, String characters)
          Add a new trail link to the page.
 void dispose()
          dispose
 Attributes merge(Attributes attributes)
          Inform this element that it is being merged with an existing element.
 WingMergeableElement mergeChild(String namespace, String localName, String qName, Attributes attributes)
          Since metadata can not be merged there are no mergeable children.
 boolean mergeEqual(String namespace, String localName, String qName, Attributes attributes)
          Determine if the given SAX event is a PageMeta element.
 void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, NamespaceSupport namespaces)
          Translate this element into SAX events.
 
Methods inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E_PAGE_META

public static final String E_PAGE_META
Name of the pageMeta element

See Also:
Constant Field Values
Constructor Detail

PageMeta

protected PageMeta(WingContext context)
            throws WingException
Construct a new pageMeta

Parameters:
context - (Required) The context this element is contained in, such as where to route SAX events and what i18n catalogue to use.
Throws:
WingException
Method Detail

addMetadata

public Metadata addMetadata(String element,
                            String qualifier,
                            String language,
                            boolean allowMultiple)
                     throws WingException
Add metadata about this page.

Parameters:
element - (Required) The metadata element.
qualifier - (May be null) The metadata qualifier.
language - (May be null) The metadata language
allowMultiple - (Required) determine if multiple metadata elements with the same element, qualifier and language are allowed.
Returns:
A new metadata
Throws:
WingException

addMetadata

public Metadata addMetadata(String element,
                            String qualifier,
                            String language)
                     throws WingException
Add metadata about this page.

Parameters:
element - (Required) The metadata element.
qualifier - (May be null) The metadata qualifier.
language - (May be null) The metadata language
Returns:
A new metadata
Throws:
WingException

addMetadata

public Metadata addMetadata(String element,
                            String qualifier)
                     throws WingException
Add metadata about this page.

Parameters:
element - (Required) The metadata element.
qualifier - (May be null) The metadata qualifier.
Returns:
A new metadata
Throws:
WingException

addMetadata

public Metadata addMetadata(String element)
                     throws WingException
Add metadata about this page.

Parameters:
element - (Required) The metadata element.
Returns:
A new metadata
Throws:
WingException

addTrail

public Trail addTrail(String target,
                      String rend)
               throws WingException
Add a new trail to the page.

Parameters:
target - (May be null) Target URL for this trail item.
rend - (May be null) Special rendering instructions
Returns:
a new trail
Throws:
WingException

addTrail

public Trail addTrail()
               throws WingException
Add a new trail to the page without a link or render attribute.

Returns:
a new trail
Throws:
WingException

addTrailLink

public void addTrailLink(String target,
                         String characters)
                  throws WingException
Add a new trail link to the page.

Parameters:
target - (May be null) The Target URL for this trail item.
characters - (May be null) The textual contents of this trail item.
Throws:
WingException

addTrailLink

public void addTrailLink(String target,
                         Message message)
                  throws WingException
Add a new trail link to the page.

Parameters:
target - (May be null) The Target URL for this trail item.
message - (Required) The textual contents of this trail item to be translated
Throws:
WingException

mergeEqual

public boolean mergeEqual(String namespace,
                          String localName,
                          String qName,
                          Attributes attributes)
                   throws SAXException,
                          WingException
Determine if the given SAX event is a PageMeta element.

Specified by:
mergeEqual in interface WingMergeableElement
Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element
qName - The qualified name for this element
attributes - The element's attributes
Returns:
True if this WingElement is equivalent to the given SAX Event.
Throws:
SAXException
WingException

mergeChild

public WingMergeableElement mergeChild(String namespace,
                                       String localName,
                                       String qName,
                                       Attributes attributes)
                                throws SAXException,
                                       WingException
Since metadata can not be merged there are no mergeable children. This just return's null.

Specified by:
mergeChild in interface WingMergeableElement
Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element *
qName - The qualified name for this element
attributes - The element's attributes
Returns:
The child element
Throws:
SAXException
WingException

merge

public Attributes merge(Attributes attributes)
                 throws SAXException,
                        WingException
Inform this element that it is being merged with an existing element.

Specified by:
merge in interface WingMergeableElement
Returns:
The attributes for this merged element
Throws:
SAXException
WingException

toSAX

public void toSAX(ContentHandler contentHandler,
                  LexicalHandler lexicalHandler,
                  NamespaceSupport namespaces)
           throws SAXException
Translate this element into SAX events.

Specified by:
toSAX in interface WingElement
Parameters:
contentHandler - (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.
Throws:
SAXException

dispose

public void dispose()
dispose

Specified by:
dispose in interface WingElement
Overrides:
dispose in class AbstractWingElement


Copyright © 2012 DuraSpace. All Rights Reserved.