|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.ndr.writer.MetadataWriter
public class MetadataWriter
Class responsible for writing Metadata records to the NDR as Metadata Objects.
Field Summary | |
---|---|
protected CollectionConfig |
collectionConfig
NOT YET DOCUMENTED |
protected DcsDataRecord |
dcsDataRecord
NOT YET DOCUMENTED |
protected XMLDocReader |
docReader
NOT YET DOCUMENTED |
protected boolean |
finalAndValid
Description of the Field |
protected Document |
itemRecord
NOT YET DOCUMENTED |
protected MetadataReader |
mdReader
NOT YET DOCUMENTED |
protected String |
nsdlItemId
|
protected String |
recId
NOT YET DOCUMENTED |
protected RepositoryManager |
rm
NOT YET DOCUMENTED |
protected ServletContext |
servletContext
NOT YET DOCUMENTED |
protected XMLConversionService |
xmlConversionService
NOT YET DOCUMENTED |
Constructor Summary | |
---|---|
MetadataWriter()
Constructor for the MetadataWriter object |
|
MetadataWriter(ServletContext servletContext)
Constructor for the MetadataWriter object |
Method Summary | |
---|---|
protected NdrRequest |
addMetadataRequest(NdrRequest ndrRequest,
String resHandle)
Augment provided NdrRequest to form an "addMetadataRequest" request to create a new NDR object. |
protected CollectionConfig |
getCollectionConfig(String collection)
Gets the collectionConfig attribute of the RepositoryWriterPlugin object |
protected Document |
getItemRecord(String recordXml)
Gets the metadata record as a dom4j.Document, converting from recordXml if it is provided, or obtaining from the index (via docReader) otherwise. |
protected MetaDataFramework |
getMetaDataFramework(String xmlFormat)
Gets the metaDataFramework attribute of the MetadataWriter object |
protected MetadataReader |
getMetadataReader()
Gets the metadataReader attribute of the MetadataWriter object |
protected String |
getResourceHandle(String resourceUrl)
Obtain a resource handle from the NDR for the provided resourceURL. |
protected String |
getResourceUrl(Document itemRecord)
Get and validate the URL using the urlPath configured for this framework (NOTE: url path must be configured for the framework of the record to be written). |
protected Object |
getServletContextAttribute(String attrName)
Gets the requiredContextAttributeValue attribute of the MetadataWriterPlugin object |
protected String |
getValueOrNull(String s)
Gets the valueOrNull attribute of the MetadataWriter object |
protected NdrRequest |
getWriteRequest(String resourceUrl,
String resHandle)
Returns NdrRequest to write metadata to NDR, either as a new metadata object or by updating an existing object. |
protected void |
init(String recordXml)
Initialize required values and services for the MetadataWriter. |
protected NdrRequest |
modifyMetadataRequest(NdrRequest ndrRequest,
String resHandle,
Element nsdl_dc_stream)
Augment provided NdrRequest to form a "modifyMetadataRequest" request for updating an existing metadata object in the NDR. |
void |
setServletContext(ServletContext servletContext)
Sets the servletContext attribute of the MetadataWriter object |
SyncReportEntry |
write(String recId,
DcsDataRecord dcsDataRecord)
Convenience method to write the metadata record identified by recId along with dcsDataRecord, to the NDR. |
SyncReportEntry |
write(String recId,
String recordXml,
DcsDataRecord dcsDataRecord)
Writes metadata record to NDR using provided "recordXml" metadata if provided, or metadata obtained from from the index if recordXml is null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ServletContext servletContext
protected MetadataReader mdReader
protected RepositoryManager rm
protected String recId
protected XMLDocReader docReader
protected DcsDataRecord dcsDataRecord
protected CollectionConfig collectionConfig
protected XMLConversionService xmlConversionService
protected Document itemRecord
protected boolean finalAndValid
protected String nsdlItemId
Constructor Detail |
---|
public MetadataWriter()
public MetadataWriter(ServletContext servletContext) throws Exception
servletContext
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDMethod Detail |
---|
public void setServletContext(ServletContext servletContext)
servletContext
- The new servletContext valueprotected void init(String recordXml) throws Exception
RepositoryManager, docReader, itemRecord, xmlConversionService, collectionConfig.
recordXml
- metadata, can be null.
Exception
- NOT YET DOCUMENTEDpublic SyncReportEntry write(String recId, DcsDataRecord dcsDataRecord) throws Exception
This method is called from OUTSIDE the metadata editor (e.g., Sync), when there is not access to the actual XML of the record.
recId
- NOT YET DOCUMENTEDdcsDataRecord
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic SyncReportEntry write(String recId, String recordXml, DcsDataRecord dcsDataRecord) throws Exception
recId
- recordId, used to obtain metadata from index if
necessaryrecordXml
- metadata as String (optionally provided)dcsDataRecord
- auxillary information about the metadata record
Exception
- NOT YET DOCUMENTEDprotected NdrRequest getWriteRequest(String resourceUrl, String resHandle) throws Exception
resHandle
- resource object handleresourceUrl
- NOT YET DOCUMENTED
Exception
- if unable to build ndr requestprotected NdrRequest addMetadataRequest(NdrRequest ndrRequest, String resHandle) throws Exception
resHandle
- resource object handlendrRequest
- The feature to be added to the Metadata attribute
Exception
- if unable to build ndr requestprotected NdrRequest modifyMetadataRequest(NdrRequest ndrRequest, String resHandle, Element nsdl_dc_stream) throws Exception
Collection-level objects (AggHandle and MdpHandle) are non-null only if the metadata is a NSDL collection record (i.e., ncs_collect format).
resHandle
- resource object handlendrRequest
- NOT YET DOCUMENTEDnsdl_dc_stream
- NOT YET DOCUMENTED
Exception
- if unable to build ndr requestprotected MetadataReader getMetadataReader() throws Exception
Exception
- NOT YET DOCUMENTEDprotected String getResourceHandle(String resourceUrl) throws Exception
resourceUrl
- url for the resorce to be found or created
Exception
- if a collection aggregator is not found, or if the
resource cannot be created or modified.protected Document getItemRecord(String recordXml) throws Exception
recordXml
- metadata record as XML String
Exception
- if provided recordXml is not well-formed.protected String getValueOrNull(String s)
s
- Description of the Parameter
protected String getResourceUrl(Document itemRecord) throws Exception
itemRecord
- NOT YET DOCUMENTED
Exception
- if resourceUrl cannot be obtainedprotected Object getServletContextAttribute(String attrName) throws Exception
attrName
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDprotected CollectionConfig getCollectionConfig(String collection) throws Exception
collection
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDprotected MetaDataFramework getMetaDataFramework(String xmlFormat) throws Exception
xmlFormat
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTED
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |