Esri Geoportal Server
1.0

com.esri.gpt.catalog.schema
Class Schema

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

public class Schema
extends Component

Defines a metadata schema.


Constructor Summary
Schema()
          Default constructor.
Schema(Schema objectToDuplicate)
          Construct by duplicating an existing object.
 
Method Summary
 void appendDetailSections(UiContext context, UIComponent sectionsComponent)
          Appends all sections of the schema to the sections component of the metadata details page.
 void appendEditorSections(UiContext context, UIComponent sectionsComponent)
          Appends all sections of the schema to the metadata editor sections component.
 void configure(CfgContext context, Node node, NamedNodeMap attributes)
          Configures the object based upon a node loaded from a schema configuration XML.
 Schema duplicate()
          Produces a deep clone of the object.
 void echo(StringBuffer sb)
          Appends property information for the component to a StringBuffer.
 void ensureMinimals()
          Ensures the the minimal components of a schema.
 void evaluate(Document dom)
          Evaluates a schema based upon the supplied metadata document.
 String getActiveDocumentXml()
          Gets the XML associated with the metadata document that was most recently evaluated for this schema.
 String getCswBriefXslt()
          Gets the XSLT (file path) for generating the brief CSW response (optional).
 String getCswOutputSchema()
          Gets the CSW output schema (namespace) associated with the document.
 String getCswSummaryXslt()
          Gets the XSLT (file path) for generating the summary CSW response (optional).
 String getDetailsXslt()
          Gets the XSLT (file path) for displaying metadata details (as HTML).
 boolean getEditable()
          Gets the editable status.
 Indexables getIndexables()
          Gets the indexable properties.
 Interrogation getInterrogation()
          Gets the interrogation component.
 Label getLabel()
          Gets the label component.
 Meaning getMeaning()
          Gets the meaning component for the schema.
 Namespaces getNamespaces()
          Gets the namespaces for the schema.
protected  PropertyMeanings getPropertyMeanings()
          Gets the configured property meanings.
 Sections getSections()
          Gets the sections for the schema.
 String getTemplateFile()
          Gets the template file path.
 String getToEsriXslt()
          Gets the XSLT (file path) for translating to an ESRI format.
 ValidationErrors getValidationErrors()
          Gets the validation errors.
 String getXsdLocation()
          Gets the location of the XML Schema definition file for the metadata standard.
 Interrogation interrogate(Document dom)
          Interrogates a schema based upon the supplied metadata document.
 Document loadTemplate()
          Loads the template for this schema.
 List<Parameter> selectParameters(Predicate predicate)
          Selects all parameters conforming to the condiditions defined by predicate.
 void setActiveDocumentXml(String xml)
          Sets the XML associated with the metadata document that was most recently evaluated for this schema.
 void setCswBriefXslt(String xslt)
          Sets the XSLT (file path) for generating the brief CSW response (optional).
 void setCswOutputSchema(String namespace)
          Sets the CSW output schema (namespace) associated with the document.
 void setCswSummaryXslt(String xslt)
          Sets the XSLT (file path) for generating the summary CSW response (optional).
 void setDetailsXslt(String xslt)
          Sets the XSLT (file path) for displaying metadata details (as HTML).
 void setEditable(boolean editable)
          Sets the editable status.
 void setIndexables(Indexables indexables)
          Sets the indexable properties.
protected  void setInterrogation(Interrogation interrogation)
          Sets the interrogation component.
protected  void setLabel(Label label)
          Sets the label component.
protected  void setNamespaces(Namespaces namespaces)
          Sets the namespaces for the schema.
protected  void setPropertyMeanings(PropertyMeanings meanings)
          Sets the configured property meanings.
protected  void setSections(Sections sections)
          Sets the sections for the schema.
 void setTemplateFile(String templateFile)
          Sets the template file path.
 void setToEsriXslt(String xslt)
          Sets the XSLT (file path) for translating to an ESRI format.
protected  void setValidationErrors(ValidationErrors errors)
          Sets the validation errors.
 void setXsdLocation(String url)
          Sets the location of the XML Schema definition file for the metadata standard.
 void unBind(UiContext context, UIComponent editorForm)
          Triggered on the save event from the metadata editor.
 void update(Document dom)
          Updates the metadata document template based upon entered parameter value(s).
 void validate()
          Validates the schema.
 
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
 

Constructor Detail

Schema

public Schema()
Default constructor.


Schema

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

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getActiveDocumentXml

public String getActiveDocumentXml()
Gets the XML associated with the metadata document that was most recently evaluated for this schema.

Returns:
the XML

setActiveDocumentXml

public void setActiveDocumentXml(String xml)
Sets the XML associated with the metadata document that was most recently evaluated for this schema.

Parameters:
xml - the XML

getCswBriefXslt

public String getCswBriefXslt()
Gets the XSLT (file path) for generating the brief CSW response (optional).
Only applies if the document can generate non Dublin Core responses.

Returns:
the file path to the brief XSLT

setCswBriefXslt

public void setCswBriefXslt(String xslt)
Sets the XSLT (file path) for generating the brief CSW response (optional).
Only applies if the document can generate non Dublin Core responses.

Parameters:
xslt - the file path to the brief XSLT

getCswOutputSchema

public String getCswOutputSchema()
Gets the CSW output schema (namespace) associated with the document.
Only applies if the document can generate non Dublin Core responses.

Returns:
the CSW output schema

setCswOutputSchema

public void setCswOutputSchema(String namespace)
Sets the CSW output schema (namespace) associated with the document.
Only applies if the document can generate non Dublin Core responses.

Parameters:
namespace - the CSW output schema

getCswSummaryXslt

public String getCswSummaryXslt()
Gets the XSLT (file path) for generating the summary CSW response (optional).
Only applies if the document can generate non Dublin Core responses.

Returns:
the file path to the summary XSLT

setCswSummaryXslt

public void setCswSummaryXslt(String xslt)
Sets the XSLT (file path) for generating the summary CSW response (optional).
Only applies if the document can generate non Dublin Core responses.

Parameters:
xslt - the file path to the summary XSLT

getDetailsXslt

public String getDetailsXslt()
Gets the XSLT (file path) for displaying metadata details (as HTML).

Returns:
the file path to the details XSLT

setDetailsXslt

public void setDetailsXslt(String xslt)
Sets the XSLT (file path) for displaying metadata details (as HTML).

Parameters:
xslt - the file path to the details XSLT

getEditable

public boolean getEditable()
Gets the editable status.

Returns:
true if this schema is editable within the metadata editor

setEditable

public void setEditable(boolean editable)
Sets the editable status.

Parameters:
editable - true if this schema is editable within the metadata editor

getIndexables

public Indexables getIndexables()
Gets the indexable properties.

Returns:
the indexable properties

setIndexables

public void setIndexables(Indexables indexables)
Sets the indexable properties.

Parameters:
indexables - the indexable properties

getInterrogation

public Interrogation getInterrogation()
Gets the interrogation component.

Returns:
the interrogation component

setInterrogation

protected void setInterrogation(Interrogation interrogation)
Sets the interrogation component.

Parameters:
interrogation - the interrogation component

getLabel

public Label getLabel()
Gets the label component.

Returns:
the label component

setLabel

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

Parameters:
label - the label component

getMeaning

public Meaning getMeaning()
Gets the meaning component for the schema.

Returns:
the meaning component

getNamespaces

public Namespaces getNamespaces()
Gets the namespaces for the schema.

Returns:
the schema namespaces

setNamespaces

protected void setNamespaces(Namespaces namespaces)
Sets the namespaces for the schema.

Parameters:
namespaces - the schema namespaces

getPropertyMeanings

protected PropertyMeanings getPropertyMeanings()
Gets the configured property meanings.

Returns:
the property meanings

setPropertyMeanings

protected void setPropertyMeanings(PropertyMeanings meanings)
Sets the configured property meanings.

Parameters:
meanings - the property meanings

getSections

public Sections getSections()
Gets the sections for the schema.

Returns:
the schema sections

setSections

protected void setSections(Sections sections)
Sets the sections for the schema.

Parameters:
sections - the schema sections

getTemplateFile

public String getTemplateFile()
Gets the template file path.

The template is an XML file used for the creation and editing of metadata documents for this schema.

Returns:
the template file

setTemplateFile

public void setTemplateFile(String templateFile)
Sets the template file path.

The template is an XML file used for the creation and editing of metadata documents for this schema.

Parameters:
templateFile - the template file

getToEsriXslt

public String getToEsriXslt()
Gets the XSLT (file path) for translating to an ESRI format.

When a schema is neither FGDC or EsriIso, the document must be translated to an ESRI format enclosed as a binary node prior to publishing to the ArcIMS metdata server.

Returns:
the file path to the XSLT

setToEsriXslt

public void setToEsriXslt(String xslt)
Sets the XSLT (file path) for translating to an ESRI format.

When a schema is neither FGDC or EsriIso, the document must be translated to an ESRI format enclosed as a binary node prior to publishing to the ArcIMS metdata server.

Parameters:
xslt - the file path to the XSLT

getValidationErrors

public ValidationErrors getValidationErrors()
Gets the validation errors.

Returns:
the schema sections

setValidationErrors

protected void setValidationErrors(ValidationErrors errors)
Sets the validation errors.

Parameters:
errors - validation errors

getXsdLocation

public String getXsdLocation()
Gets the location of the XML Schema definition file for the metadata standard.

Not all metadata standards will have an XSD. If supplied, the metadata document will be validated against the XSD pror to publication.

Returns:
the XSD location (URL)

setXsdLocation

public void setXsdLocation(String url)
Sets the location of the XML Schema definition file for the metadata standard.

Not all metadata standards will have an XSD. If supplied, the metadata document will be validated against the XSD pror to publication.

Parameters:
url - the XSD location (URL)

appendDetailSections

public void appendDetailSections(UiContext context,
                                 UIComponent sectionsComponent)
Appends all sections of the schema to the sections component of the metadata details page.

Parameters:
context - the UI context
sectionsComponent - the sections component of the metadata details page

appendEditorSections

public void appendEditorSections(UiContext context,
                                 UIComponent sectionsComponent)
Appends all sections of the schema to the metadata editor sections component.

Parameters:
context - the UI context
sectionsComponent - the sections component of the metadata editor

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 editable templateFile detailsXslt cswOutputSchema cswBriefXslt cswSummaryXslt xsdLocation

The following child nodes are configured:
label namespace[] interrogation section[]

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

duplicate

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

Specified by:
duplicate in class Component

ensureMinimals

public void ensureMinimals()
Ensures the the minimal components of a schema.

The schema should have been evaluated at some point prior to executing this method.
At the moment, this method doesn't throw exceptions. An empty title is set to "Untitled", an invalid envelope is set to the extent of the world.


evaluate

public void evaluate(Document dom)
              throws XPathExpressionException
Evaluates a schema based upon the supplied metadata document.

The default behavior is to invoke the "evaluate" method for each section within the schema.

Parameters:
dom - the metadata document
Throws:
XPathExpressionException - if an evaluation expression fails

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

interrogate

public Interrogation interrogate(Document dom)
                          throws XPathExpressionException
Interrogates a schema based upon the supplied metadata document.

The default behavior is to invoke the "interrogate" method on the Interrogation object associated with the schema.

Parameters:
dom - the metadata document
Returns:
the interrogation object
Throws:
XPathExpressionException - if an evaluation expression fails

loadTemplate

public Document loadTemplate()
                      throws ParserConfigurationException,
                             SAXException,
                             IOException
Loads the template for this schema.

Returns:
the XML document
Throws:
ParserConfigurationException - if a configuration exception occurs
SAXException - if an exception occurs during XML parsing
IOException - if an i/o exception occurs

update

public void update(Document dom)
            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 section within the schema.

Parameters:
dom - the metadata document template for the schema
Throws:
XPathExpressionException - if an expression fails
SchemaException - if the update fails

unBind

public void unBind(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 section.

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

validate

public void validate()
              throws ValidationException
Validates the schema.

The default behavior is to invoke the "validate" method for each section within the schema.

Throws:
ValidationException - if errors occur during validation

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.