Class NSDLCollectionWriter
java.lang.Object
org.dlese.dpc.schemedit.ndr.writer.MetadataWriter
org.dlese.dpc.schemedit.ndr.writer.NSDLCollectionWriter
Creates or updates the NDR Objects necessary to create a NSDL collection in
the NDR, namely the collection Metadata Record, Collection Resource,
Collection Aggregator, and Collection MetadataProvider.
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:
- connect the existing MetadataProvider object to the newly created Collection Aggregator
- add a "memberOf" relation to each resource object that points to the Collection Aggregator.
- Author:
- Jonathan Ostwald
-
Field Summary
Fields inherited from class org.dlese.dpc.schemedit.ndr.writer.MetadataWriter
collectionConfig, dcsDataRecord, docReader, finalAndValid, itemRecord, mdReader, nsdlItemId, recId, rm, servletContext, xmlConversionService -
Constructor Summary
ConstructorsConstructorDescriptionNSDLCollectionWriter(ServletContext servletContext) Constructor for the NSDLCollectionWriter object -
Method Summary
Modifier and TypeMethodDescriptionprotected NdrRequestaddMetadataRequest(NdrRequest ndrRequest, String resHandle) Adds a feature to the MetadataRequest attribute of the NSDLCollectionWriter objectprotected ListgetMetadataForRelationsToAdd(String resourceHandle) Gets the metadataForRelationsToAdd attribute of the NSDLCollectionWriter object.protected MetadataReaderGets the metadataReader attribute of the NSDLCollectionWriter objectprotected org.dom4j.ElementReturns the collection_config data_stream from the collection MDP if possible.protected StringFor 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 NdrRequestmodifyMetadataRequest(NdrRequest ndrRequest, String resHandle, org.dom4j.Element nsdl_dc_stream) Description of the Methodwrite(String recId, 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.write(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).Methods inherited from class org.dlese.dpc.schemedit.ndr.writer.MetadataWriter
getCollectionConfig, getItemRecord, getMetaDataFramework, getResourceHandle, getResourceUrl, getServletContextAttribute, getValueOrNull, getWriteRequest, init, setServletContext
-
Constructor Details
-
NSDLCollectionWriter
Constructor for the NSDLCollectionWriter object- Parameters:
servletContext- NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-
-
Method Details
-
write
Convenience write method that doesn't require ncs_collect metadata to be supplied (this will be obtained from index in the callee).- Overrides:
writein classMetadataWriter- Parameters:
recId- NOT YET DOCUMENTEDdcsDataRecord- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
write
public SyncReportEntry write(String recId, String recordXml, DcsDataRecord dcsDataRecord) throws Exception 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.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 ...
- Overrides:
writein classMetadataWriter- Parameters:
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 record- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
getMetadataForRelationsToAdd
Gets the metadataForRelationsToAdd attribute of the NSDLCollectionWriter object. To the "metadataFor" relation created by MetadataWriter we add a "meatadataFor" relation to the collection resource.- Parameters:
resourceHandle- Description of the Parameter- Returns:
- The metadataForRelationsToAdd value
-
addMetadataRequest
Adds a feature to the MetadataRequest attribute of the NSDLCollectionWriter object- Overrides:
addMetadataRequestin classMetadataWriter- Parameters:
ndrRequest- The feature to be added to the MetadataRequest attributeresHandle- The feature to be added to the MetadataRequest attribute- Returns:
- Description of the Return Value
- Throws:
Exception- Description of the Exception
-
modifyMetadataRequest
protected NdrRequest modifyMetadataRequest(NdrRequest ndrRequest, String resHandle, org.dom4j.Element nsdl_dc_stream) throws Exception Description of the Method- Overrides:
modifyMetadataRequestin classMetadataWriter- Parameters:
ndrRequest- Description of the ParameterresHandle- Description of the Parameternsdl_dc_stream- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
Exception- Description of the Exception
-
getMetadataReader
Gets the metadataReader attribute of the NSDLCollectionWriter object- Overrides:
getMetadataReaderin classMetadataWriter- Returns:
- The metadataReader value
- Throws:
Exception- NOT YET DOCUMENTED
-
getNCSCollectionConfig
protected org.dom4j.Element getNCSCollectionConfig()Returns the collection_config data_stream from the collection MDP if possible. Used to test whether the NSDL Collection governs a collection whose items are managed in the NCS.- Returns:
- The the collection_config data stream from the collection mdpReader
-
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.- Returns:
- The nCSCollectionNativeFormat value
-