public class NSDLCollectionWriter extends MetadataWriter
NOTE: A NSDL collection is different from the representation of a DLESE/NCS collection in the NDR. A NCS collection consists of only a MetadataProvider, Aggregator and item-level Metadata objects. If we are creating an NSDL collection for an EXISTING NCS collection we need to do some additional operations, which are NOT YET IMPLEMENTED:
collectionConfig, dcsDataRecord, docReader, finalAndValid, itemRecord, mdReader, nsdlItemId, recId, rm, servletContext, xmlConversionService
Constructor and Description |
---|
NSDLCollectionWriter(javax.servlet.ServletContext servletContext)
Constructor for the NSDLCollectionWriter object
|
Modifier and Type | Method and Description |
---|---|
protected NdrRequest |
addMetadataRequest(NdrRequest ndrRequest,
java.lang.String resHandle)
Adds a feature to the MetadataRequest attribute of the NSDLCollectionWriter
object
|
protected java.util.List |
getMetadataForRelationsToAdd(java.lang.String resourceHandle)
Gets the metadataForRelationsToAdd attribute of the NSDLCollectionWriter
object.
|
protected MetadataReader |
getMetadataReader()
Gets the metadataReader attribute of the NSDLCollectionWriter object
|
protected org.dom4j.Element |
getNCSCollectionConfig()
Returns the collection_config data_stream from the collection MDP if
possible.
|
protected java.lang.String |
getNCSCollectionNativeFormat()
For Collections whose items are managed by this NCS instance, we can find
the itemFormat by inspecting the "collection_config" stream of the
Collection MetadataProvider object.
|
protected NdrRequest |
modifyMetadataRequest(NdrRequest ndrRequest,
java.lang.String resHandle,
org.dom4j.Element nsdl_dc_stream)
Description of the Method
|
SyncReportEntry |
write(java.lang.String recId,
DcsDataRecord dcsDataRecord)
Convenience write method that doesn't require ncs_collect metadata to be
supplied (this will be obtained from index in the callee).
|
SyncReportEntry |
write(java.lang.String recId,
java.lang.String recordXml,
DcsDataRecord dcsDataRecord)
Creates or updates collection-level NDR Objects necessary to define a NSDL
collection in the NDR, including collection-level metadata object,
collection resource, and collection aggregator.
|
getCollectionConfig, getItemRecord, getMetaDataFramework, getResourceHandle, getResourceUrl, getServletContextAttribute, getValueOrNull, getWriteRequest, init, setServletContext
public NSDLCollectionWriter(javax.servlet.ServletContext servletContext) throws java.lang.Exception
servletContext
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic SyncReportEntry write(java.lang.String recId, DcsDataRecord dcsDataRecord) throws java.lang.Exception
write
in class MetadataWriter
recId
- NOT YET DOCUMENTEDdcsDataRecord
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic SyncReportEntry write(java.lang.String recId, java.lang.String recordXml, DcsDataRecord dcsDataRecord) throws java.lang.Exception
NOTE: if the NCSL collection already exists, then there is a possibility that the collection's resource URL has been modified. For this reason, we have to locate the collection definition objects in the NDR by other means than the resource URL ...
write
in class MetadataWriter
recId
- record id, used to obtain collection metadata from
index if necessaryrecordXml
- collection metadata as String (optionally provided)dcsDataRecord
- auxillary information about the collection metadata
recordjava.lang.Exception
- NOT YET DOCUMENTEDprotected java.util.List getMetadataForRelationsToAdd(java.lang.String resourceHandle)
resourceHandle
- Description of the Parameterprotected NdrRequest addMetadataRequest(NdrRequest ndrRequest, java.lang.String resHandle) throws java.lang.Exception
addMetadataRequest
in class MetadataWriter
ndrRequest
- The feature to be added to the MetadataRequest
attributeresHandle
- The feature to be added to the MetadataRequest
attributejava.lang.Exception
- Description of the Exceptionprotected NdrRequest modifyMetadataRequest(NdrRequest ndrRequest, java.lang.String resHandle, org.dom4j.Element nsdl_dc_stream) throws java.lang.Exception
modifyMetadataRequest
in class MetadataWriter
ndrRequest
- Description of the ParameterresHandle
- Description of the Parameternsdl_dc_stream
- Description of the Parameterjava.lang.Exception
- Description of the Exceptionprotected MetadataReader getMetadataReader() throws java.lang.Exception
getMetadataReader
in class MetadataWriter
java.lang.Exception
- NOT YET DOCUMENTEDprotected org.dom4j.Element getNCSCollectionConfig()
protected java.lang.String getNCSCollectionNativeFormat()