Esri Geoportal Server
1.0

com.esri.gpt.catalog.schema
Class Section

java.lang.Object
  extended by com.esri.gpt.catalog.schema.Component
      extended by com.esri.gpt.catalog.schema.UiComponent
          extended by com.esri.gpt.catalog.schema.Section

public class Section
extends UiComponent

Section component associated with a metadata schema.

The component is configured from a node with a schema configuration XML document.

A section contains a label and a collection of parameters. The parameters will appear within the user interface in the order in which they appear within the schema configuration XML.

Example:
<section key="description">
</section>


Field Summary
static String OBLIGATION_EXCLUSIVE
          Mutually exclusive section = "exclusive"
static String OBLIGATION_MANDATORY
          Mandatory section = "mandatory" (this is the default)
static String OBLIGATION_OPTIONAL
          Optional section = "optional"
 
Constructor Summary
Section()
          Default constructor.
Section(Section objectToDuplicate)
          Construct by duplicating an existing object.
 
Method Summary
 boolean appendDetailComponents(Schema schema, UiContext context, UIComponent parentComponent)
          Appends Faces display components for this section of the metadata details page.
 void appendEditorComponents(Schema schema, UiContext context, UIComponent parentComponent)
          Appends Faces editing components for this section of the metadata editor
 void configure(CfgContext context, Node node, NamedNodeMap attributes)
          Configures the object based upon a node loaded from a schema configuration XML.
 Section duplicate()
          Produces a deep clone of the object.
 void echo(StringBuffer sb)
          Appends property information for the component to a StringBuffer.
 void evaluate(Schema schema, Document dom, XPath xpath)
          Evaluates a section based upon the supplied metadata document.
 void forceOpen(UIComponent editorForm)
          Force a section open within the editor.
 String getDelete()
          Gets the XPath expression used to select nodes for deletion when an optional section has not been filled (i.e.
 String getFacesId()
          Gets the Faces ID for the section.
 Label getLabel()
          Gets the label component.
 String getObligation()
          Gets the obligation for this section.
 boolean getOpen()
          Gets the open status.
 Parameters getParameters()
          Gets the parameters for the schema.
 Section getParent()
          Gets the parent section.
 Sections getSections()
          Gets the sub-sections for this section.
 String getSelect()
          Gets the XPath selection expression for selecting the section.
 boolean getUseSelectForDelete()
          Gets the status indicating if the selection expression should be used to select nodes for deletion when an optional section has not been filled (i.e.
 boolean getVisibleOnDetails()
          Gets the status indicating if the section should be displayed on the view details page.
 List<Parameter> selectParameters(Predicate predicate)
          Selects all parameters conforming to the condiditions defined by predicate.
 void setDelete(String expression)
          Sets the XPath expression used to select nodes for deletion when an optional section has not been filled (i.e.
 void setLabel(Label label)
          Sets the label component.
 void setObligation(String obligation)
          Sets the obligation for this section.
 void setOpen(boolean open)
          Sets the open status.
protected  void setParameters(Parameters parameters)
          Sets the parameters for the schema.
protected  void setParent(Section parent)
          Sets the parent section.
protected  void setSections(Sections sections)
          Sets the sub-sections for this section.
 void setSelect(String expression)
          Sets the XPath selection expression for selecting the section.
 void setUseSelectForDelete(boolean useSelectForDelete)
          Sets the status indicating if the selection expression should be used to select nodes for deletion when an optional section has not been filled (i.e.
 void setVisibleOnDetails(boolean visible)
          Sets the status indicating if the section should be displayed on the view details page.
 void unBind(Schema schema, UiContext context, UIComponent editorForm)
          Triggered on the save event from the metadata editor.
 void update(Document dom, XPath xpath)
          Updates the metadata document template based upon entered parameter value(s).
 void validate(Schema schema)
          Validates a section.
 
Methods inherited from class com.esri.gpt.catalog.schema.UiComponent
getStyleClass, makeBR, makeNBSP, setStyleClass
 
Methods inherited from class com.esri.gpt.catalog.schema.Component
getKey, setKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OBLIGATION_EXCLUSIVE

public static final String OBLIGATION_EXCLUSIVE
Mutually exclusive section = "exclusive"

See Also:
Constant Field Values

OBLIGATION_MANDATORY

public static final String OBLIGATION_MANDATORY
Mandatory section = "mandatory" (this is the default)

See Also:
Constant Field Values

OBLIGATION_OPTIONAL

public static final String OBLIGATION_OPTIONAL
Optional section = "optional"

See Also:
Constant Field Values
Constructor Detail

Section

public Section()
Default constructor.


Section

public Section(Section objectToDuplicate)
Construct by duplicating an existing object.

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getDelete

public String getDelete()
Gets the XPath expression used to select nodes for deletion when an optional section has not been filled (i.e. not checked within the editor).

Returns:
the delete expression

setDelete

public void setDelete(String expression)
Sets the XPath expression used to select nodes for deletion when an optional section has not been filled (i.e. not checked within the editor).


getFacesId

public String getFacesId()
Gets the Faces ID for the section.
The Faces ID is based upon the section key.
All "." characters are replaced with "_".

Returns:
the Faces ID

getLabel

public Label getLabel()
Gets the label component.

Returns:
the label component

setLabel

public void setLabel(Label label)
Sets the label component.

Parameters:
label - the label component

getObligation

public String getObligation()
Gets the obligation for this section.

Returns:
the obligation

setObligation

public void setObligation(String obligation)
Sets the obligation for this section.

Parameters:
obligation - the obligation

getOpen

public boolean getOpen()
Gets the open status.

Returns:
true if the section is open

setOpen

public void setOpen(boolean open)
Sets the open status.

Parameters:
open - true if the section is open

getParameters

public Parameters getParameters()
Gets the parameters for the schema.

Returns:
the schema parameters

setParameters

protected void setParameters(Parameters parameters)
Sets the parameters for the schema.

Parameters:
parameters - the schema parameters

getParent

public Section getParent()
Gets the parent section.

Returns:
the parent section (null for a top level section)

setParent

protected void setParent(Section parent)
Sets the parent section.


getSections

public Sections getSections()
Gets the sub-sections for this section.

Returns:
the sub-sections

setSections

protected void setSections(Sections sections)
Sets the sub-sections for this section.

Parameters:
sections - the sub-sections

getSelect

public String getSelect()
Gets the XPath selection expression for selecting the section.

Returns:
the selection expression

setSelect

public void setSelect(String expression)
Sets the XPath selection expression for selecting the section.

Parameters:
expression - the selection expression

getUseSelectForDelete

public boolean getUseSelectForDelete()
Gets the status indicating if the selection expression should be used to select nodes for deletion when an optional section has not been filled (i.e. not checked within the editor).

Returns:
true if the selection expression should be used for deletion

setUseSelectForDelete

public void setUseSelectForDelete(boolean useSelectForDelete)
Sets the status indicating if the selection expression should be used to select nodes for deletion when an optional section has not been filled (i.e. not checked within the editor).

Parameters:
useSelectForDelete - true if the selection expression should be used for deletion

getVisibleOnDetails

public boolean getVisibleOnDetails()
Gets the status indicating if the section should be displayed on the view details page.

Returns:
true if the section should be displayed on the view details page

setVisibleOnDetails

public void setVisibleOnDetails(boolean visible)
Sets the status indicating if the section should be displayed on the view details page.

Parameters:
visible - true if the section should be displayed on the view details page

appendDetailComponents

public boolean appendDetailComponents(Schema schema,
                                      UiContext context,
                                      UIComponent parentComponent)
Appends Faces display components for this section of the metadata details page.

Parameters:
schema - the parent schema
context - the UI context
parentComponent - the parent component for this section

appendEditorComponents

public void appendEditorComponents(Schema schema,
                                   UiContext context,
                                   UIComponent parentComponent)
Appends Faces editing components for this section of the metadata editor

Parameters:
schema - the parent schema
context - the UI context
parentComponent - the parent component for this section

configure

public void configure(CfgContext context,
                      Node node,
                      NamedNodeMap attributes)
Configures the object based upon a node loaded from a schema configuration XML.
The super.configure method should be invoked prior to any sub-class configuration.

The following attributes are configured:
key open obligation select delete visibleOnDetails

The following child nodes are configured:
label parameter[] section[]

Overrides:
configure in class UiComponent
Parameters:
context - the configuration context
node - the configuration node
attributes - the attributes of the configuration node

duplicate

public Section duplicate()
Produces a deep clone of the object.
The duplication constructor is invoked.
return new Section(this);

Specified by:
duplicate in class Component

echo

public void echo(StringBuffer sb)
Appends property information for the component to a StringBuffer.
The method is intended to support "FINEST" logging.
super.echo should be invoked prior appending any local information.

Overrides:
echo in class UiComponent
Parameters:
sb - the StringBuffer to use when appending information

evaluate

public void evaluate(Schema schema,
                     Document dom,
                     XPath xpath)
              throws XPathExpressionException
Evaluates a section based upon the supplied metadata document.

The default behavior is to invoke the "evaluate" method for each parameter within the section as well as each sub-section.

Parameters:
schema - the schema being evaluated
dom - the metadata document
xpath - an XPath object configured with an appropriate Namespace context for the schema
Throws:
XPathExpressionException - if an evaluation expression fails

forceOpen

public void forceOpen(UIComponent editorForm)
Force a section open within the editor.

Parameters:
editorForm - the Faces HtmlForm for the metadata editor

unBind

public void unBind(Schema schema,
                   UiContext context,
                   UIComponent editorForm)
            throws SchemaException
Triggered on the save event from the metadata editor.

The default behavior is to invoke the "unBind" method for the each parameter as well as each sub-section.

Parameters:
schema - the active schema
context - the UI context
editorForm - the Faces HtmlForm for the metadata editor
Throws:
SchemaException - if an associated Faces UIComponent cannot be located

update

public void update(Document dom,
                   XPath xpath)
            throws XPathExpressionException,
                   SchemaException
Updates the metadata document template based upon entered parameter value(s).

The default behavior is to invoke the "update" method for each parameter within the section as well as each sub-section.

Parameters:
dom - the metadata document template for the schema
xpath - an XPath object configured with an appropriate Namespace context for the schema
Throws:
XPathExpressionException - if an expression fails
SchemaException - if the update fails

validate

public void validate(Schema schema)
Validates a section.

The default behavior is to invoke the "validate" method for each parameter within the section as well as each sub-section.

Encountered errors should be appended to the schema.getValidationErrors() collection.

Parameter values associated with meaning should be used to populate schema.getMeaning() values.

Parameters:
schema - the schema being validated

selectParameters

public List<Parameter> selectParameters(Predicate predicate)
Selects all parameters conforming to the condiditions defined by predicate.

Parameters:
predicate - predicate
Returns:
list of selected parameters

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.