public final class Resource extends AbstractBaseComponent
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.
When generating HTML/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" />
The name of this component was changed from "Resource" to "resource" in DDMS 4.0.1.
| Nested Elements |
|---|
ddms:metacardInfo: (exactly 1 required, starting in DDMS 4.0.1), implemented as a MetacardInfoddms:identifier: (1-many required), implemented as an Identifierddms:title: (1-many required), implemented as a Titleddms:subtitle: (0-many optional), implemented as a Subtitleddms:description: (0-1 optional), implemented as a Descriptionddms:language: (0-many optional), implemented as a Languageddms:dates: (0-1 optional), implemented as a Datesddms:rights: (0-1 optional), implemented as a Rightsddms:source: (0-many optional), implemented as a Sourceddms:type: (0-many optional), implemented as a Typeddms:contributor: (0-many optional), implemented as a Contributorddms:creator: (0-many optional), implemented as a Creatorddms:pointOfContact: (0-many optional), implemented as a PointOfContactddms:publisher: (0-many optional), implemented as a Publisherddms:format: (0-1 optional), implemented as a Formatddms:subjectCoverage: (1-many required, starting in DDMS 4.0.1), implemented as a SubjectCoverageddms:virtualCoverage: (0-many optional), implemented as a VirtualCoverageddms:temporalCoverage: (0-many optional), implemented as a TemporalCoverageddms:geospatialCoverage: (0-many optional), implemented as a GeospatialCoverageddms:relatedResource: (0-many optional), implemented as a RelatedResourceddms:resourceManagement: (0-1 optional, starting in DDMS 4.0.1), implemented as a ResourceManagementddms:security: (exactly 1 required), implemented as a SecurityExtensible Layer: (0-many optional), implemented as a ExtensibleElement |
| Attributes |
|---|
|
ISM:resourceElement: Identifies whether this tag sets the classification for the xml file as a whole
(required, starting in DDMS 3.0) ISM:createDate: Specifies the creation or latest modification date (YYYY-MM-DD) (required, starting in DDMS 3.0) ISM:DESVersion: Specifies the version of the Data Encoding Specification used for the security markings on this record. (required, starting in DDMS 3.0) ntk:DESVersion: Specifies the version of the Data Encoding Specification used for Need-To-Know markings on this record. (required, starting in DDMS 4.0.1 with a fixed value) SecurityAttributes: The classification and ownerProducer attributes are required. (starting in DDMS
3.0)NoticeAttributes: (optional, starting in DDMS 4.0.1)ExtensibleAttributes: (optional)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. |
| 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
|
| 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 (0-many)
|
javax.xml.datatype.XMLGregorianCalendar |
getCreateDate()
Accessor for the createDate date (optional).
|
List<Creator> |
getCreators()
Accessor for a list of all Creator entities (0-many)
|
Dates |
getDates()
Accessor for the dates component (0-1).
|
Description |
getDescription()
Accessor for the description component (0-1)
|
ExtensibleAttributes |
getExtensibleAttributes()
Accessor for the extensible attributes.
|
List<ExtensibleElement> |
getExtensibleElements()
Accessor for the extensible layer elements (0-many in 3.0, 0-1 in 2.0).
|
Format |
getFormat()
Accessor for the Format component (0-1).
|
List<GeospatialCoverage> |
getGeospatialCoverages()
Accessor for the geospatialCoverage components (0-many)
|
List<Identifier> |
getIdentifiers()
Accessor for the identifier components.
|
Integer |
getIsmDESVersion()
Accessor for the ISM DESVersion attribute.
|
List<Language> |
getLanguages()
Accessor for the language components (0-many)
|
MetacardInfo |
getMetacardInfo()
Accessor for the MetacardInfo component (exactly 1)
|
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.
|
String |
getOutput(boolean isHTML,
String prefix,
String suffix)
Renders this component as HTML or Text, with an optional prefix to nest it.
|
List<PointOfContact> |
getPointOfContacts()
Accessor for a list of all PointOfContact entities (0-many)
|
List<Publisher> |
getPublishers()
Accessor for a list of all Publisher entities (0-many)
|
List<RelatedResource> |
getRelatedResources()
Accessor for the RelatedResource components (0-many)
|
ResourceManagement |
getResourceManagement()
Accessor for the ResourceManagement component (0-1).
|
Rights |
getRights()
Accessor for the rights component (0-1).
|
Security |
getSecurity()
Accessor for the security component (exactly 1).
|
SecurityAttributes |
getSecurityAttributes()
Accessor for the Security Attributes.
|
List<Source> |
getSources()
Accessor for the source components (0-many)
|
List<SubjectCoverage> |
getSubjectCoverages()
Accessor for the subjectCoverage component (1-many)
|
List<Subtitle> |
getSubtitles()
Accessor for the subtitle components (0-many)
|
List<TemporalCoverage> |
getTemporalCoverages()
Accessor for the temporalCoverage components (0-many)
|
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 (0-many)
|
List<VirtualCoverage> |
getVirtualCoverages()
Accessor for the virtualCoverage components (0-many)
|
int |
hashCode()
Returns a hashcode for the component.
|
Boolean |
isResourceElement()
Accessor for the resourceElement attribute.
|
protected void |
validate()
Validates the component.
|
protected void |
validateWarnings()
Validates any conditions that might result in a warning.
|
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, addWarning, addWarnings, buildIndex, buildOutput, buildOutput, buildPrefix, getAttributeValue, getAttributeValue, getChild, getChildTextAsDouble, getDDMSVersion, getLocatorSuffix, getName, getNamespace, getPrefix, getQualifiedName, getStringAsDouble, getValidationWarnings, getXOMElement, getXOMElementCopy, requireVersion, setXOMElement, toHTML, toString, toText, toXMLprotected 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 attributes (optional)InvalidDDMSExceptionpublic 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 attribute (required, starting in DDMS 3.0)createDate - the create date as an xs:date (YYYY-MM-DD) (required, starting in DDMS 3.0)ismDESVersion - the DES Version as an Integer (required, starting in DDMS 3.0)securityAttributes - any security attributes (classification and ownerProducer are required, starting in
DDMS 3.0)extensibleAttributes - any extensible attributes (optional)InvalidDDMSException - 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 attribute (required, starting in DDMS 3.0)createDate - the create date as an xs:date (YYYY-MM-DD) (required, starting in DDMS 3.0)compliesWiths - shows what ISM rulesets this resource complies with (optional, starting in DDMS 3.1)ismDESVersion - the DES Version as an Integer (required, starting in DDMS 3.0)securityAttributes - any security attributes (classification and ownerProducer are required, starting in
DDMS 3.0)extensibleAttributes - any extensible attributes (optional)InvalidDDMSException - 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 attribute (required, starting in DDMS 3.0)createDate - the create date as an xs:date (YYYY-MM-DD) (required, starting in DDMS 3.0)compliesWiths - shows what ISM rule sets this resource complies with (optional, starting in DDMS 3.1)ismDESVersion - the DES Version as an Integer (required, starting in DDMS 3.0)ntkDESVersion - the DES Version as an Integer (required, starting in DDMS 4.0.1)securityAttributes - any security attributes (classification and ownerProducer are required, starting in
DDMS 3.0)noticeAttributes - any notice attributes (optional, starting in DDMS 4.0.1)extensibleAttributes - any extensible attributes (optional)InvalidDDMSException - 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
| Rules |
|---|
|
|
validate in class AbstractBaseComponentInvalidDDMSException - if any required information is missing or malformedAbstractBaseComponent.validate()protected void validateWarnings()
| Rules |
|---|
|
|
validateWarnings in class AbstractBaseComponentpublic String getOutput(boolean isHTML,
String prefix,
String suffix)
AbstractBaseComponentgetOutput in class AbstractBaseComponentisHTML - true for HTML, false for Text.prefix - an optional prefix to put on each name.suffix - an optional suffix to append to each name, such as an index.AbstractBaseComponent.getOutput(boolean, String, String)public boolean equals(Object obj)
AbstractBaseComponentThe 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 AbstractBaseComponentObject.equals(Object)public int hashCode()
AbstractBaseComponentThis automatically includes any nested components or security attributes.
hashCode in class AbstractBaseComponentObject.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()
AbstractBaseComponentgetNestedComponents in class AbstractBaseComponentAbstractBaseComponent.getNestedComponents()public SecurityAttributes getSecurityAttributes()
getSecurityAttributes in interface IDDMSComponentgetSecurityAttributes in class AbstractBaseComponentpublic NoticeAttributes getNoticeAttributes()
public ExtensibleAttributes getExtensibleAttributes()
Copyright 2010 - 2013 by Brian Uri!
Generated on 12/15/2013 10:22 AM
http://ddmsence.urizone.net/