public final class Resource extends AbstractBaseComponent
In DDMS | 2.0 | 3.0 | 3.1 | 4.0.1/4.1 | 5.0 |
When generating HTML/JSON/Text output for a Resource, additional tags are generated listing the version of DDMSence used to create the record (to help identify formatting bugs), and the version of DDMS. These lines are not required (and may be removed). For example:
ddms.generator: DDMSence 1.0.0
ddms.version: 3.0
<meta name="ddms.generator" content="DDMSence 1.0.0" />
<meta name="ddms.version" content="3.0" />
History |
---|
Starting in DDMS 3.0, resources have additional ISM attributes which did not exist in 2.0. However, the 2.0 schema still allows "any" attributes on the Resource, so the 3.0 attribute values will be loaded if present. Starting in DDMS 3.0, the ISM attributes explicitly defined in the schema should appear in the SecurityAttributes, not the ExtensibleAttributes. Attempts to load them as ExtensibleAttributes will throw an InvalidDDMSException. In DDMS 2.0, there are no ISM attributes explicitly defined in the schema, so you can load them in any way you want. It is recommended that you load them as SecurityAttributes anyhow, for consistency with newer DDMS resources. Please see the "Power Tips" on the Extensible Layer (on the DDMSence home page) for details. The names of this component was made lowercase in DDMS 4.0.1. |
Nested Elements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Validation Rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Modifier and Type | Class and Description |
---|---|
static class |
Resource.Builder
Builder for this DDMS component.
|
Modifier and Type | Field and Description |
---|---|
static String |
COMPLIES_WITH_NAME
The attribute name for the compliesWith attribute
|
protected static String |
CREATE_DATE_NAME
The attribute name for create date
|
static String |
DES_VERSION_NAME
The attribute name for DES version
|
static Set<String> |
NON_EXTENSIBLE_NAMES
A set of all Resource attribute names which should not be converted into ExtensibleAttributes
|
protected static String |
RESOURCE_ELEMENT_NAME
The attribute name for resource element flag
|
OUTPUT_TEMPLATES
Constructor and Description |
---|
Resource(nu.xom.Element element)
Constructor for creating a component from a XOM Element
|
Resource(List<IDDMSComponent> topLevelComponents,
Boolean resourceElement,
String createDate,
Integer ismDESVersion,
SecurityAttributes securityAttributes,
ExtensibleAttributes extensibleAttributes)
Constructor for creating a DDMS 3.0 Resource from raw data.
|
Resource(List<IDDMSComponent> topLevelComponents,
Boolean resourceElement,
String createDate,
List<String> compliesWiths,
Integer ismDESVersion,
Integer ntkDESVersion,
SecurityAttributes securityAttributes,
NoticeAttributes noticeAttributes,
ExtensibleAttributes extensibleAttributes)
Constructor for creating a DDMS resource of any version from raw data.
|
Resource(List<IDDMSComponent> topLevelComponents,
Boolean resourceElement,
String createDate,
List<String> compliesWiths,
Integer ismDESVersion,
SecurityAttributes securityAttributes,
ExtensibleAttributes extensibleAttributes)
Constructor for creating a DDMS 3.1 Resource from raw data.
|
Resource(List<IDDMSComponent> topLevelComponents,
ExtensibleAttributes extensibleAttributes)
Constructor for creating a DDMS 2.0 Resource from raw data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Test for logical equality.
|
List<String> |
getCompliesWiths()
Accessor for the ISM compliesWith attribute.
|
List<Contributor> |
getContributors()
Accessor for a list of all Contributor entities
|
javax.xml.datatype.XMLGregorianCalendar |
getCreateDate()
Accessor for the createDate date.
|
List<Creator> |
getCreators()
Accessor for a list of all Creator entities
|
Dates |
getDates()
Accessor for the dates component.
|
Description |
getDescription()
Accessor for the description component
|
ExtensibleAttributes |
getExtensibleAttributes()
Accessor for the extensible attributes.
|
List<ExtensibleElement> |
getExtensibleElements()
Accessor for the extensible layer elements.
|
Format |
getFormat()
Accessor for the Format component.
|
List<GeospatialCoverage> |
getGeospatialCoverages()
Accessor for the geospatialCoverage components
|
String |
getHTMLTextOutput(OutputFormat format,
String prefix,
String suffix)
Renders this component as HTML or Text, with an optional prefix to nest it.
|
List<Identifier> |
getIdentifiers()
Accessor for the identifier components.
|
Integer |
getIsmDESVersion()
Accessor for the ISM DESVersion attribute.
|
com.google.gson.JsonObject |
getJSONObject()
Renders this component as a JSON object, which can either be converted to a JSON string or inserted into the
parent JSON object.
|
List<Language> |
getLanguages()
Accessor for the language components
|
MetacardInfo |
getMetacardInfo()
Accessor for the MetacardInfo component
|
static String |
getName(DDMSVersion version)
Accessor for the element name of this component, based on the version of DDMS used
|
protected List<IDDMSComponent> |
getNestedComponents()
Accessor for a collection of nested components.
|
NoticeAttributes |
getNoticeAttributes()
Accessor for the Notice Attributes.
|
Integer |
getNtkDESVersion()
Accessor for the NTK DESVersion attribute.
|
List<PointOfContact> |
getPointOfContacts()
Accessor for a list of all PointOfContact entities
|
List<Publisher> |
getPublishers()
Accessor for a list of all Publisher entities
|
List<RelatedResource> |
getRelatedResources()
Accessor for the RelatedResource components
|
ResourceManagement |
getResourceManagement()
Accessor for the ResourceManagement component.
|
Rights |
getRights()
Accessor for the rights component.
|
Security |
getSecurity()
Accessor for the security component.
|
SecurityAttributes |
getSecurityAttributes()
Accessor for the Security Attributes.
|
List<Source> |
getSources()
Accessor for the source components
|
List<SubjectCoverage> |
getSubjectCoverages()
Accessor for the subjectCoverage component
|
List<Subtitle> |
getSubtitles()
Accessor for the subtitle components
|
List<TemporalCoverage> |
getTemporalCoverages()
Accessor for the temporalCoverage components
|
List<Title> |
getTitles()
Accessor for the title components.
|
List<IDDMSComponent> |
getTopLevelComponents()
Accessor for an ordered list of the components in this Resource.
|
List<Type> |
getTypes()
Accessor for the type components
|
List<VirtualCoverage> |
getVirtualCoverages()
Accessor for the virtualCoverage components
|
int |
hashCode()
Returns a hashcode for the component.
|
Boolean |
isResourceElement()
Accessor for the resourceElement attribute.
|
protected void |
validate()
Base case for validation.
|
protected void |
validateWarnings()
Base case for warnings.
|
List<ValidationMessage> |
validateWithSchematron(File schematronFile)
Performs a Schematron validation of the DDMS Resource, via the ISO Schematron skeleton stylesheets for XSLT1
or XSLT2 processors.
|
addDdms40Warning, addJson, addJson, addJson, addJson, addWarning, addWarnings, buildHTMLTextOutput, buildHTMLTextOutput, buildIndex, buildPrefix, getAttributeValue, getAttributeValue, getChild, getChildTextAsDouble, getDDMSVersion, getLocatorSuffix, getName, getNamespace, getPrefix, getQualifiedName, getValidationWarnings, getXOMElement, getXOMElementCopy, requireAtLeastVersion, requireAtMostVersion, setXOMElement, toHTML, toJSON, toString, toText, toXML
protected static final String RESOURCE_ELEMENT_NAME
protected static final String CREATE_DATE_NAME
public static final String COMPLIES_WITH_NAME
public static final String DES_VERSION_NAME
public static final Set<String> NON_EXTENSIBLE_NAMES
public Resource(nu.xom.Element element) throws InvalidDDMSException
Starting in DDMS 3.0, resources have additional ISM attributes which did not exist in 2.0. However, the 2.0 schema still allows "any" attributes on the Resource, so the 3.0 attribute values will be loaded if present.
element
- the XOM element representing thisInvalidDDMSException
- if any required information is missing or malformedpublic Resource(List<IDDMSComponent> topLevelComponents, ExtensibleAttributes extensibleAttributes) throws InvalidDDMSException
This helper constructor merely calls the fully-parameterized version. Attempts to use it with DDMS 3.0 (or higher) components will fail, because some required attributes are missing.
topLevelComponents
- a list of top level componentsextensibleAttributes
- any extensible attributesInvalidDDMSException
public Resource(List<IDDMSComponent> topLevelComponents, Boolean resourceElement, String createDate, Integer ismDESVersion, SecurityAttributes securityAttributes, ExtensibleAttributes extensibleAttributes) throws InvalidDDMSException
This helper constructor merely calls the fully-parameterized version. Attempts to use it with DDMS 3.1 (or higher) components will fail, because some required attributes are missing.
topLevelComponents
- a list of top level componentsresourceElement
- value of the resourceElement attributecreateDate
- the create date as an xs:date (YYYY-MM-DD)ismDESVersion
- the DES Version as an IntegersecurityAttributes
- any security attributesextensibleAttributes
- any extensible attributesInvalidDDMSException
- if any required information is missing or malformed, or if one of the components
does not belong at the top-level of the Resource.public Resource(List<IDDMSComponent> topLevelComponents, Boolean resourceElement, String createDate, List<String> compliesWiths, Integer ismDESVersion, SecurityAttributes securityAttributes, ExtensibleAttributes extensibleAttributes) throws InvalidDDMSException
This helper constructor merely calls the fully-parameterized version. Attempts to use it with DDMS 4.0.1 (or higher) components will fail, because some required attributes are missing.
topLevelComponents
- a list of top level componentsresourceElement
- value of the resourceElement attributecreateDate
- the create date as an xs:date (YYYY-MM-DD)compliesWiths
- shows what rulesets this resource complies withismDESVersion
- the DES Version as an IntegersecurityAttributes
- any security attributesextensibleAttributes
- any extensible attributesInvalidDDMSException
- if any required information is missing or malformed, or if one of the components
does not belong at the top-level of the Resource.public Resource(List<IDDMSComponent> topLevelComponents, Boolean resourceElement, String createDate, List<String> compliesWiths, Integer ismDESVersion, Integer ntkDESVersion, SecurityAttributes securityAttributes, NoticeAttributes noticeAttributes, ExtensibleAttributes extensibleAttributes) throws InvalidDDMSException
The other data-driven constructors call this one.
Passing the top-level components in as a list is a compromise between a constructor with over twenty parameters, and the added complexity of a step-by-step factory/builder approach. If any component is not a top-level component, an InvalidDDMSException will be thrown.
The order of different types of components does not matter here (a security component could be the first component in the list). However, if multiple instances of the same component type exist in the list (such as multiple identifier components), those components will be stored and output in the order of the list. If only 1 instance can be supported, the last one in the list will be the one used.
Starting in DDMS 3.0, resources have additional ISM attributes which did not exist in 2.0. However, the 2.0 schema still allows "any" attributes on the Resource, so the attribute values will be loaded if present.
topLevelComponents
- a list of top level componentsresourceElement
- value of the resourceElement attributecreateDate
- the create date as an xs:date (YYYY-MM-DD)compliesWiths
- shows what rule sets this resource complies withismDESVersion
- the DES Version as an IntegerntkDESVersion
- the DES Version as an IntegersecurityAttributes
- any security attributesnoticeAttributes
- any notice attributesextensibleAttributes
- any extensible attributesInvalidDDMSException
- if any required information is missing or malformed, or if one of the components
does not belong at the top-level of the Resource.public List<ValidationMessage> validateWithSchematron(File schematronFile) throws nu.xom.xslt.XSLException, IOException
The informational results of this validation are returned to the caller in a list of ValidationMessages of type "Warning" for reports and "Error" for failed asserts. These messages do NOT affect the validity of the underlying object model. The locator on the ValidationMessage will be the location attribute from the successful-report or failed-assert element.
Details about ISO Schematron can be found at: http://www.schematron.com/
schematronFile
- the file containing the ISO Schematron constraints. This file is transformed with the ISO
Schematron skeleton files.nu.xom.xslt.XSLException
- if there are XSL problems transforming with stylesheetsIOException
- if there are problems reading or parsing the Schematron fileprotected void validate() throws InvalidDDMSException
AbstractBaseComponent
validate
in class AbstractBaseComponent
InvalidDDMSException
AbstractBaseComponent.validate()
protected void validateWarnings()
AbstractBaseComponent
validateWarnings
in class AbstractBaseComponent
AbstractBaseComponent.validateWarnings()
public com.google.gson.JsonObject getJSONObject()
AbstractBaseComponent
getJSONObject
in class AbstractBaseComponent
AbstractBaseComponent.getJSONObject()
public String getHTMLTextOutput(OutputFormat format, String prefix, String suffix)
AbstractBaseComponent
I consider this to be an internal method, that unfortunately must be marked as public to allow cross-package access when generating output. Use toHTML() and toText() as the formal, public methods to generate output.
getHTMLTextOutput
in class AbstractBaseComponent
format
- the desired format of this outputprefix
- an optional prefix to put on each name.suffix
- an optional suffix to append to each name, such as an index.AbstractBaseComponent.getHTMLTextOutput(OutputFormat, String, String)
public boolean equals(Object obj)
AbstractBaseComponent
The base case tests against the name value and namespaceURI, as well as any child components classified as "nested components" and any security attributes. Extending classes may require additional rules for equality. This case automatically includes any nested components or security attributes.
equals
in class AbstractBaseComponent
Object.equals(Object)
public int hashCode()
AbstractBaseComponent
This automatically includes any nested components or security attributes.
hashCode
in class AbstractBaseComponent
Object.hashCode()
public static String getName(DDMSVersion version)
version
- the DDMSVersionpublic MetacardInfo getMetacardInfo()
public List<Identifier> getIdentifiers()
public List<Title> getTitles()
public List<Subtitle> getSubtitles()
public Description getDescription()
public List<Language> getLanguages()
public Dates getDates()
public Rights getRights()
public List<Source> getSources()
public List<Type> getTypes()
public List<Creator> getCreators()
public List<Publisher> getPublishers()
public List<Contributor> getContributors()
public List<PointOfContact> getPointOfContacts()
public Format getFormat()
public List<SubjectCoverage> getSubjectCoverages()
public List<VirtualCoverage> getVirtualCoverages()
public List<TemporalCoverage> getTemporalCoverages()
public List<GeospatialCoverage> getGeospatialCoverages()
public List<RelatedResource> getRelatedResources()
public ResourceManagement getResourceManagement()
public Security getSecurity()
public List<ExtensibleElement> getExtensibleElements()
public Boolean isResourceElement()
public javax.xml.datatype.XMLGregorianCalendar getCreateDate()
public List<String> getCompliesWiths()
public Integer getIsmDESVersion()
public Integer getNtkDESVersion()
public List<IDDMSComponent> getTopLevelComponents()
protected List<IDDMSComponent> getNestedComponents()
AbstractBaseComponent
getNestedComponents
in class AbstractBaseComponent
AbstractBaseComponent.getNestedComponents()
public SecurityAttributes getSecurityAttributes()
getSecurityAttributes
in interface IDDMSComponent
getSecurityAttributes
in class AbstractBaseComponent
public NoticeAttributes getNoticeAttributes()
public ExtensibleAttributes getExtensibleAttributes()
Copyright 2010 - 2019 by Brian Uri!
Generated on 09/15/2016 12:36 PM
https://ddmsence.urizone.net/