Package org.dlese.dpc.xml.maps
Class DleseXMLReader
java.lang.Object
org.dlese.dpc.xml.maps.DleseXMLReader
- All Implemented Interfaces:
XMLMap
This class provides mapping between DLESE metadata values and the
corresponding XML metadata record.
The accessor methods act as an interface with the XMLNode and XMLRecord classes. The XML processing details are handled by those classes,
but the one requirement of this class is to have knowledge of the paths
structure. Paths are used as keys into the XMLRecord map.
- Version:
- 0.9b, 05/20/02
- Author:
- Dave Deniman
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor is restricted to assure that a file directory is provided on object creation.DleseXMLReader(File xmlfile) DleseXMLReader(String filepath) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Releases all resources and calls finalize method.protected StringRetrieves the date the catalog record was created.protected ListRetrieves the list of lifecycle contributors to a resource from the current record.protected ListRetrieves the list of intended audiences for a resource from the current record.protected StringgetComment(String key, String identifier) Retrieves a specific comment from the XML node identified by the key.protected StringRetreives the copright information of a resource from the current record.protected StringgetCost()Retrieves the cost information of a resource from the current record.protected StringRetrieves the date the catalog record was created.protected StringRetreives the description of a resource from the current record.protected ListRetrieves the list of geography standards defined for the current resource.protected ListRetrieves the list of georeferences for a resource from the current record.protected StringgetID()Retrieves the record ID from XML file.protected StringRetrieves the additional information from the footnote comment of the current record.Gets a message describing the initialization error or empty string if no error occured.getKeys()Retrieves a list the keys contained in the map.protected ListGets the keywords attribute of the DleseXMLReader objectprotected ListRetrieves the list of lifecycle contributors to a resource from the current record.protected ListRetrieves the list of metadata contributors for a resource from the current record.protected StringGets the otherTechnicalInfo attribute of the DleseXMLReader objectprotected ListRetrieves the list of lifecycle contributors to a resource from the current record.protected ListRetrieves the list of learning resource types for a resource from the current record.protected StringRetrieves the URL of the reource this record catalogs.protected ListRetrieves the list of intended audiences for a resource from the current record.protected StringgetStringValue(String key) Retrieves text content from the XML node identified by the key.protected ListRetrieves the list of subjects specified for a resource from the current record.protected ListGets the technicalFormats attribute of the DleseXMLReader objectprotected ListRetrieves the list of technical requirements for a resource from the current record.protected StringgetTitle()Retreives the resource title from the current record.protected ListgetURLs()Retrieves the list of subjects specified for a resource from the current record.Getter method to retrieve a specific metadata value.Retrieves the list of metadata values held in the map.booleaninit()Creates XMLRecord and intializes local map.protected voidinsertToList(List list, Object o) Simple insertion routine for constructing an ordered list of Objectsprotected voidinsertToList(List list, String s) Simple insertion sort for building a sorted list of Strings.voidsetMap()After successful initialization, this method creates the map of actual name:value pairs defined within this specific XMLMap instance.voidSetter method for setting a specific metadata value.
-
Field Details
-
isValid
protected boolean isValidboolean value indicates success of initialization -
xmlFile
source XML file -
xmlRecord
convenience abstraction of the XML DOM -
map
mapping of user-defined names to metadata values
-
-
Constructor Details
-
DleseXMLReader
protected DleseXMLReader()Default constructor is restricted to assure that a file directory is provided on object creation. -
DleseXMLReader
- Parameters:
xmlfile-
-
DleseXMLReader
- Parameters:
filepath- A qualified filepath to a well-formed XML file.
-
-
Method Details
-
init
public boolean init()Creates XMLRecord and intializes local map. If an error occurs then an error message may be obtained by immediately calling the getInitErrorMsg() method. -
getInitErrorMsg
Gets a message describing the initialization error or empty string if no error occured.- Returns:
- The initErrorMsg value
-
destroy
public void destroy()Releases all resources and calls finalize method. -
getValue
Getter method to retrieve a specific metadata value. -
setValue
Setter method for setting a specific metadata value. -
setMap
public void setMap()After successful initialization, this method creates the map of actual name:value pairs defined within this specific XMLMap instance. -
getKeys
Retrieves a list the keys contained in the map. -
getValues
Retrieves the list of metadata values held in the map. -
getComment
Retrieves a specific comment from the XML node identified by the key. The comment is specified using an identifier, which may be any portion of the actual comment, or a label which is stored as part of the comment.- Parameters:
key- The path for the desired node.identifier- A string used to identify the specific comment.- Returns:
- The specificied comment.
-
getID
Retrieves the record ID from XML file.- Returns:
- id ID of record.
-
getResourceURL
Retrieves the URL of the reource this record catalogs.- Returns:
- The resource URL, as a string.
-
getCreatedDate
Retrieves the date the catalog record was created.- Returns:
- The catalog record creation date, as a string.
-
getAccessionedDate
Retrieves the date the catalog record was created.- Returns:
- The catalog record creation date, as a string.
-
getInformation
Retrieves the additional information from the footnote comment of the current record.- Returns:
- The footnote comment.
-
getTitle
Retreives the resource title from the current record.- Returns:
- The resource title.
-
getDescription
Retreives the description of a resource from the current record.- Returns:
- The description as a string.
-
getCost
Retrieves the cost information of a resource from the current record.- Returns:
- Cost information as a string.
-
getCopyright
Retreives the copright information of a resource from the current record.- Returns:
- Copyright information as a string.
-
getOtherTechnicalInfo
Gets the otherTechnicalInfo attribute of the DleseXMLReader object- Returns:
- The otherTechnicalInfo value
-
getAudiences
Retrieves the list of intended audiences for a resource from the current record.- Returns:
Listof strings of intended audiences.
-
getTechnicalFormats
Gets the technicalFormats attribute of the DleseXMLReader object- Returns:
- The technicalFormats value
-
getSubjects
Retrieves the list of subjects specified for a resource from the current record.- Returns:
Listof strings of specified subjects.
-
getURLs
Retrieves the list of subjects specified for a resource from the current record.- Returns:
Listof strings of specified subjects.
-
getTechnicalReqs
Retrieves the list of technical requirements for a resource from the current record.- Returns:
ListofMeccaMain.TechnicalReqobjects.
-
getResourceTypes
Retrieves the list of learning resource types for a resource from the current record.- Returns:
ListofDleseRecord.ResourceTypeobjects.
-
getMetametadataContributors
Retrieves the list of metadata contributors for a resource from the current record.- Returns:
ListofDleseRecord.Contributorobjects identifying the metadata contributors.
-
getLifecycleContributors
Retrieves the list of lifecycle contributors to a resource from the current record.- Returns:
ListofDleseRecord.Contributorobjects identifying the lifecycle contributors.
-
getAnnotations
Retrieves the list of lifecycle contributors to a resource from the current record.- Returns:
ListofDleseRecord.Contributorobjects identifying the lifecycle contributors.
-
getRelations
Retrieves the list of lifecycle contributors to a resource from the current record.- Returns:
ListofDleseRecord.Contributorobjects identifying the lifecycle contributors.
-
getGeoReferences
Retrieves the list of georeferences for a resource from the current record.- Returns:
ListofDleseRecord.Contributorobjects identifying the lifecycle contributors.
-
getKeywords
Gets the keywords attribute of the DleseXMLReader object- Returns:
- The keywords value
-
getGeographyStds
Retrieves the list of geography standards defined for the current resource.- Returns:
Listof strings of intended audiences.
-
getScienceStds
Retrieves the list of intended audiences for a resource from the current record.- Returns:
Listof strings of intended audiences.
-
getStringValue
Retrieves text content from the XML node identified by the key.- Parameters:
key- The path for the desired node.- Returns:
- The text content of the XML node, or an empty string if the node does not exist.
-
insertToList
Simple insertion sort for building a sorted list of Strings.- Parameters:
list-Listto add an item to.s-Stringto add to the list.
-
insertToList
Simple insertion routine for constructing an ordered list of Objects- Parameters:
list-Listto add an item to.o-Objectto add to the list.
-