Esri Geoportal Server
1.0

com.esri.gpt.catalog.schema
Class Content

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

public class Content
extends Component

Content component associated with a metadata schema.

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

Example:
<content select="/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString"/>


Field Summary
static String NODETYPE_GCOLIST
          GCO List node type = "gcoList"
static String NODETYPE_ISOCODELISTVALUE
          ISO code list value = "isoCodeListValue"

This node type is represented by a duplication of an ISO code in both a codeListValue attribute and the text node of the attributes's parent element.

static String NODETYPE_LIST
          List node type = "list"
static String NODETYPE_PAIRLEFTVALUE
          Single node type = "single" (this is the default)
static String NODETYPE_PAIRRIGHTVALUE
          Single node type = "single" (this is the default)
static String NODETYPE_SINGLE
          Single node type = "single" (this is the default)
 
Constructor Summary
Content()
          Default constructor.
Content(Content objectToDuplicate)
          Construct by duplicating an existing object.
 
Method Summary
 void clearAllValues()
          Clears single and multiple values.
 void configure(CfgContext context, Node node, NamedNodeMap attributes)
          Configures the object based upon a node loaded from a schema configuration XML.
static void deleteNodes(Document dom, XPath xpath, String expression)
          Deletes nodes from a document based upon an XPath expression.
 Content duplicate()
          Produces a deep clone of the object.
 void echo(StringBuffer sb)
          Appends property information for the component to a StringBuffer.
 void evaluate(Document dom, XPath xpath, Parameter parameter)
          Evaluates the XPath select expression associated with a parameter.
 String formatValue(Parameter parameter, String value)
          Formats a value associated with a parameter.
 Codes getCodes()
          Gets the codes for this parameter.
 String getDelete()
          Gets the XPath expression used to select nodes for deletion when an updated value is empty.
 boolean getDeleteIfEmpty()
          Indicates if the node associated with the update expression should be deleted if the updated value is empty.
 boolean getDeleteParentIfEmpty()
          Indicates if the parent node associated with the update expression should be deleted if the updated value is empty.
 ContentValues getMultipleValues()
          Gets the multiple value list.
 String getNilReasonPath()
          Gets the XPath expression used to a ISO nil-reason attribute associated with this element.
 String getNodeType()
          Gets the node type.
 String getSelect()
          Gets the XPath selection expression.
 ContentValue getSingleValue()
          Gets the single value.
 String getUpdate()
          Gets the XPath expression used to select nodes for update.
 boolean getUseSelectForUpdate()
          Gets the status indicating if the selection expression should be used for locating nodes during the update process.
 boolean isSingleValue()
          Determines if the node type is of single value.
 boolean isValueEmpty()
          Determines if the node value(s) is/are empty.
 String makeDisplayValue(MessageBroker messageBroker, Parameter parameter)
          Makes the display value for a parameter.
protected  void setCodes(Codes codes)
          Sets the codes for this parameter.
 void setDelete(String expression)
          Sets the XPath expression used to select nodes for deletion when an updated value is empty.
 void setDeleteIfEmpty(boolean deleteIfEmpty)
          Indicates if the node(s) associated with the update expression should be deleted if the updated value is empty.
 void setDeleteParentIfEmpty(boolean deleteIfEmpty)
          Indicates if the node(s) associated with the update expression should be deleted if the updated value is empty.
protected  void setMultipleValues(ContentValues values)
          Sets the multiple value list
 void setNilReasonPath(String expression)
          Sets the XPath expression used to a ISO nil-reason attribute associated with this element.
 void setNodeType(String type)
          Sets the node type.
 void setSelect(String expression)
          Sets the XPath selection expression.
protected  void setSingleValue(ContentValue value)
          Sets the single value.
 void setUpdate(String expression)
          Sets the XPath expression used to select nodes for update.
 void setUseSelectForUpdate(boolean useSelectForUpdate)
          Sets the status indicating if the selection expression should be used for locating nodes during the update process.
 String[] toValueArray()
          Generates a String array of value(s) associated with the parameter.
 void update(Document dom, XPath xpath, Parameter parameter)
          Updates the metadata document based upon entered parameter value(s).
 
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

NODETYPE_GCOLIST

public static final String NODETYPE_GCOLIST
GCO List node type = "gcoList"

See Also:
Constant Field Values

NODETYPE_ISOCODELISTVALUE

public static final String NODETYPE_ISOCODELISTVALUE
ISO code list value = "isoCodeListValue"

This node type is represented by a duplication of an ISO code in both a codeListValue attribute and the text node of the attributes's parent element.

See Also:
Constant Field Values

NODETYPE_LIST

public static final String NODETYPE_LIST
List node type = "list"

See Also:
Constant Field Values

NODETYPE_SINGLE

public static final String NODETYPE_SINGLE
Single node type = "single" (this is the default)

See Also:
Constant Field Values

NODETYPE_PAIRRIGHTVALUE

public static final String NODETYPE_PAIRRIGHTVALUE
Single node type = "single" (this is the default)

See Also:
Constant Field Values

NODETYPE_PAIRLEFTVALUE

public static final String NODETYPE_PAIRLEFTVALUE
Single node type = "single" (this is the default)

See Also:
Constant Field Values
Constructor Detail

Content

public Content()
Default constructor.


Content

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

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getCodes

public Codes getCodes()
Gets the codes for this parameter.

Returns:
the value codes

setCodes

protected void setCodes(Codes codes)
Sets the codes for this parameter.

Parameters:
codes - the value codes

getDelete

public String getDelete()
Gets the XPath expression used to select nodes for deletion when an updated value is empty.

Returns:
the delete expression

setDelete

public void setDelete(String expression)
Sets the XPath expression used to select nodes for deletion when an updated value is empty.

Parameters:
expression - the delete expression

getDeleteIfEmpty

public boolean getDeleteIfEmpty()
Indicates if the node associated with the update expression should be deleted if the updated value is empty.

Returns:
true if the node should be deleted when the updated value is empty

setDeleteIfEmpty

public void setDeleteIfEmpty(boolean deleteIfEmpty)
Indicates if the node(s) associated with the update expression should be deleted if the updated value is empty.

Parameters:
deleteIfEmpty - true if the node should be deleted when the updated value is empty

getDeleteParentIfEmpty

public boolean getDeleteParentIfEmpty()
Indicates if the parent node associated with the update expression should be deleted if the updated value is empty.

Returns:
true if the parent node should be deleted when the updated value is empty

setDeleteParentIfEmpty

public void setDeleteParentIfEmpty(boolean deleteIfEmpty)
Indicates if the node(s) associated with the update expression should be deleted if the updated value is empty.

Parameters:
deleteIfEmpty - true if the node should be deleted when the updated value is empty

getMultipleValues

public ContentValues getMultipleValues()
Gets the multiple value list.

Returns:
the multiple value list

setMultipleValues

protected void setMultipleValues(ContentValues values)
Sets the multiple value list

Parameters:
values - the multiple value list

getNilReasonPath

public String getNilReasonPath()
Gets the XPath expression used to a ISO nil-reason attribute associated with this element.

Returns:
the nil-reason expression

setNilReasonPath

public void setNilReasonPath(String expression)
Sets the XPath expression used to a ISO nil-reason attribute associated with this element.

Parameters:
expression - the nil-reason expression

getNodeType

public String getNodeType()
Gets the node type.

Returns:
the node type

setNodeType

public void setNodeType(String type)
Sets the node type.

Parameters:
type - the node type

getSelect

public String getSelect()
Gets the XPath selection expression.

Returns:
the selection expression

setSelect

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

Parameters:
expression - the selection expression

getSingleValue

public ContentValue getSingleValue()
Gets the single value.

Returns:
the single value

setSingleValue

protected void setSingleValue(ContentValue value)
Sets the single value.

Parameters:
value - the single value

getUpdate

public String getUpdate()
Gets the XPath expression used to select nodes for update.

Returns:
the update expression

setUpdate

public void setUpdate(String expression)
Sets the XPath expression used to select nodes for update.

Parameters:
expression - the update expression

getUseSelectForUpdate

public boolean getUseSelectForUpdate()
Gets the status indicating if the selection expression should be used for locating nodes during the update process.

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

setUseSelectForUpdate

public void setUseSelectForUpdate(boolean useSelectForUpdate)
Sets the status indicating if the selection expression should be used for locating nodes during the update process.

Parameters:
useSelectForUpdate - true if the selection expression should be used for update

clearAllValues

public void clearAllValues()
Clears single and multiple values.


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:
nodeType useSelectForUpdate deleteIfEmpty deleteParentIfEmpty select update delete nilReason

The following child nodes are configured:
codes

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

deleteNodes

public static void deleteNodes(Document dom,
                               XPath xpath,
                               String expression)
                        throws XPathExpressionException
Deletes nodes from a document based upon an XPath expression.

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

duplicate

public Content duplicate()
Produces a deep clone of the object.
The duplication constructor is invoked.
return new Content(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 Component
Parameters:
sb - the StringBuffer to use when appending information

evaluate

public void evaluate(Document dom,
                     XPath xpath,
                     Parameter parameter)
              throws XPathExpressionException
Evaluates the XPath select expression associated with a parameter.

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

formatValue

public String formatValue(Parameter parameter,
                          String value)
Formats a value associated with a parameter.

Currently, only Date type values are formatted.

Parameters:
parameter - the associated parameter
value - the value to format

isSingleValue

public boolean isSingleValue()
Determines if the node type is of single value.

Returns:
true if the node type is a single value type

isValueEmpty

public boolean isValueEmpty()
Determines if the node value(s) is/are empty.

Returns:
true if the node node value(s) is/are empty

makeDisplayValue

public String makeDisplayValue(MessageBroker messageBroker,
                               Parameter parameter)
Makes the display value for a parameter.

The output component is suitable for display on the metadata details page.

Parameters:
messageBroker - the message broker
parameter - the associated parameter
Returns:
the UI input component

toValueArray

public String[] toValueArray()
Generates a String array of value(s) associated with the parameter.

Returns:
the String array of values

update

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

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

Esri Geoportal Server
1.0

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