edu.ucsb.nceas.morpho.datapackage
Class EML2Beta6DataPackage

java.lang.Object
  extended byedu.ucsb.nceas.morpho.datapackage.MetadataObject
      extended byedu.ucsb.nceas.morpho.datapackage.AbstractDataPackage
          extended byedu.ucsb.nceas.morpho.datapackage.EML2Beta6DataPackage
All Implemented Interfaces:
XMLFactoryInterface

public class EML2Beta6DataPackage
extends AbstractDataPackage

class that represents a data package. This class is abstract. Specific datapackages e.g. eml2, beta6., etc extend this abstact class


Field Summary
 
Fields inherited from class edu.ucsb.nceas.morpho.datapackage.AbstractDataPackage
BOTH, config, dataPkgFile, entityArray, fileSysDataStore, id, initialId, LOCAL, location, METACAT, metacatDataStore
 
Fields inherited from class edu.ucsb.nceas.morpho.datapackage.MetadataObject
doc, grammar, grammarType, metadataNode, metadataPathNode, root
 
Constructor Summary
EML2Beta6DataPackage()
           
 
Method Summary
 AbstractDataPackage download(java.lang.String id)
          Copies the AbstractDataPackage with the indicated id from metacat to the local file store
 void exportToEml2(java.lang.String path)
          transforms a package to eml2; first exports the metadata
 java.lang.String getAccessFileId(java.lang.String id)
          get the id of the access doc for the indicated id
 java.util.Vector getAllIdentifiers()
          returns a vector containing a distinct set of all of the file ids that make up this package
 org.w3c.dom.Node getReferencedNode(org.w3c.dom.Node node)
          This method follows the pointer stored in 'references' node to return the DOM node referred to by 'references' This is really specific to eml2; thus just returns input
 org.w3c.dom.Node getSubtreeAtReference(java.lang.String refID)
          returns cloned root Node of subtree identified by the passed unique String refID; returns null if not found
 org.w3c.dom.Node getSubtreeAtReferenceNoClone(java.lang.String refID)
          returns pointer to root Node of subtree identified by the passed unique String refID; returns null if not found
 java.util.List getSubtreesThatReference(java.lang.String refID)
          returns a List of pointers to subtrees that reference (the subtree identified by) the passed refID.
 boolean ignoreConsecutiveDelimiters(int entityIndex, int physicalIndex)
          returns boolean indicating whether repeated delimiters should be ignored
 void load(java.lang.String location, java.lang.String identifier, Morpho morpho)
          This abstract method loads a datapackage from metacat or the local file system based on an identifier.
 org.w3c.dom.Node replaceSubtreeAtReference(java.lang.String refID, org.w3c.dom.Node newSubtreeRoot)
          replaces subtree identified by the passed unique String refID; returns null if not found.
 void serialize(java.lang.String location)
          This abstract method turns the datapackage into a form (e.g.
 AbstractDataPackage upload(java.lang.String id, boolean updatePackageIds)
          Copies the AbstractDataPackage with the indicated id from the local file store to Metacat
 
Methods inherited from class edu.ucsb.nceas.morpho.datapackage.AbstractDataPackage
addAttributeForImport, addEntity, addNewUnit, appendAdditionalMetadata, clearAllAttributeImports, delete, deleteAllEntities, deleteAllSubtrees, deleteAttribute, deleteEntity, deleteSubtree, export, exportDataFiles, exportToZip, getAccessionNumber, getAttributeArray, getAttributeCountForAnEntity, getAttributeDataType, getAttributeID, getAttributeImportCount, getAttributeIndex, getAttributeName, getAttributeUnit, getAuthor, getCompressionMethod, getCoverageNode, getCurrentImportAttributeName, getCurrentImportEntityName, getCurrentImportMap, getCurrentImportScale, getCurrentImportXPath, getDistributionArray, getDistributionInlineData, getDistributionUrl, getEncodingMethod, getEntityArray, getEntityCount, getEntityDescription, getEntityID, getEntityIndex, getEntityName, getEntityNumRecords, getFileWithID, getGeographicNodeList, getIDsForNodesWithName, getInitialId, getKeywords, getLastImportedAttributes, getLastImportedDataSet, getLastImportedEntity, getLocation, getNewUniqueReferenceID, getOriginalEntityArray, getPackageId, getPhysicalArray, getPhysicalFieldDelimiter, getPhysicalFormat, getPhysicalName, getPhysicalNumberHeaderLines, getPhysicalSize, getSecondImportMap, getSubtree, getSubtreeNoClone, getSubtrees, getTaxonomicNodeList, getTemporalNodeList, getTitle, getUnitDictionaryCustomUnitTypes, getUnitDictionaryUnitsOfType, insertAttribute, insertCoverage, insertEntity, insertObjectIntoArray, insertSubtree, isCurrentImportNewTable, isNewCustomUnit, loadCustomUnits, openAsDom, openAsReader, removeAttributeForImport, removeGeographicNodes, removeTaxonomicNodes, removeTemporalNodes, replaceSubtree, serializeData, setAccessionNumber, setDistributionUrl, setEntityID, setEntityNumRecords, setInitialId, setLastImportedAttributes, setLastImportedDataSet, setLastImportedEntity, setLocation, setOriginalEntityArray, setPhysicalFieldDelimiter, setPhysicalSize, showPackageSummary, subtreeExists
 
Methods inherited from class edu.ucsb.nceas.morpho.datapackage.MetadataObject
getGenericValue, getMetadataNode, getMetadataPath, getXPathValue, main, setGenericValue, setMetadataNode, setMetadataPath, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EML2Beta6DataPackage

public EML2Beta6DataPackage()
Method Detail

serialize

public void serialize(java.lang.String location)
               throws MetacatUploadException
Description copied from class: AbstractDataPackage
This abstract method turns the datapackage into a form (e.g. string) that can be saved in the file system or metacat. Actual implementation is done in classes specific to grammar

Specified by:
serialize in class AbstractDataPackage
Parameters:
location - String
Returns:
true if there is no indicated problem; false, otherwise
Throws:
MetacatUploadException

load

public void load(java.lang.String location,
                 java.lang.String identifier,
                 Morpho morpho)
Description copied from class: AbstractDataPackage
This abstract method loads a datapackage from metacat or the local file system based on an identifier. Basic action is to create a DOM and assign it to the underlying MetadataObject. Actual implementation is done in classes specific to grammar

Specified by:
load in class AbstractDataPackage
Parameters:
location - String
identifier - String
morpho - Morpho

upload

public AbstractDataPackage upload(java.lang.String id,
                                  boolean updatePackageIds)
                           throws MetacatUploadException
Description copied from class: AbstractDataPackage
Copies the AbstractDataPackage with the indicated id from the local file store to Metacat

Specified by:
upload in class AbstractDataPackage
Parameters:
id - String
Returns:
AbstractDataPackage
Throws:
MetacatUploadException

download

public AbstractDataPackage download(java.lang.String id)
Description copied from class: AbstractDataPackage
Copies the AbstractDataPackage with the indicated id from metacat to the local file store

Specified by:
download in class AbstractDataPackage
Parameters:
id - String
Returns:
AbstractDataPackage

exportToEml2

public void exportToEml2(java.lang.String path)
transforms a package to eml2; first exports the metadata

Parameters:
path - the path to which this package should be exported.

getAllIdentifiers

public java.util.Vector getAllIdentifiers()
returns a vector containing a distinct set of all of the file ids that make up this package

Returns:
Vector

getAccessFileId

public java.lang.String getAccessFileId(java.lang.String id)
get the id of the access doc for the indicated id

Parameters:
id - String
Returns:
String

getReferencedNode

public org.w3c.dom.Node getReferencedNode(org.w3c.dom.Node node)
This method follows the pointer stored in 'references' node to return the DOM node referred to by 'references' This is really specific to eml2; thus just returns input

Parameters:
node - Node
Returns:
Node

getSubtreeAtReference

public org.w3c.dom.Node getSubtreeAtReference(java.lang.String refID)
returns cloned root Node of subtree identified by the passed unique String refID; returns null if not found

Specified by:
getSubtreeAtReference in class AbstractDataPackage
Parameters:
refID - unique String refID
Returns:
cloned root Node of subtree, or null if refID not found

getSubtreeAtReferenceNoClone

public org.w3c.dom.Node getSubtreeAtReferenceNoClone(java.lang.String refID)
returns pointer to root Node of subtree identified by the passed unique String refID; returns null if not found

Specified by:
getSubtreeAtReferenceNoClone in class AbstractDataPackage
Parameters:
refID - unique String refID
Returns:
pointer to root Node of subtree, or null if refID not found

ignoreConsecutiveDelimiters

public boolean ignoreConsecutiveDelimiters(int entityIndex,
                                           int physicalIndex)
Description copied from class: AbstractDataPackage
returns boolean indicating whether repeated delimiters should be ignored

Specified by:
ignoreConsecutiveDelimiters in class AbstractDataPackage

replaceSubtreeAtReference

public org.w3c.dom.Node replaceSubtreeAtReference(java.lang.String refID,
                                                  org.w3c.dom.Node newSubtreeRoot)
replaces subtree identified by the passed unique String refID; returns null if not found. Note that the new subtree will be given the same refID as the subtree it replaces, even if the newSubtreeRoot node has a different id set

Specified by:
replaceSubtreeAtReference in class AbstractDataPackage
Parameters:
refID - unique String refID. Note that the new subtree will be given the same refID as the subtree it replaces, even if the newSubtreeRoot node has a different id set
newSubtreeRoot - Node
Returns:
root Node of new subtree, or null if refID not found

getSubtreesThatReference

public java.util.List getSubtreesThatReference(java.lang.String refID)
returns a List of pointers to subtrees that reference (the subtree identified by) the passed refID. More formally, returns a List of pointers to subtree root Nodes, where each subtree root Node contains a "references" child-node, and the content String of the references child-node matches the unique String refID passed to this method; returns an empty List if none found. Should never return null;

Specified by:
getSubtreesThatReference in class AbstractDataPackage
Parameters:
refID - unique String refID
Returns:
List of pointers to subtrees that reference the subtree identified by the passed refID. Returns an empty List if none found. Should never return null;


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.