org.dspace.content.packager
Class OCWIMSCPIngester

java.lang.Object
  extended by org.dspace.content.packager.AbstractIMSCPIngester
      extended by org.dspace.content.packager.OCWIMSCPIngester
All Implemented Interfaces:
PackageIngester

public class OCWIMSCPIngester
extends AbstractIMSCPIngester

Ingester for MIT OpenCourseware (OCW)/CWSpace profile of the IMS Content Package spec, or IMSCP.

For more information about IMSCP, see IMS Global Learning Consortium, http://www.imsglobal.org/content/packaging/

Configuration keys: 1. Plugin name of LOM ingest crosswalk cwspace.crosswalk.ingest.lom = e.g. cwspace.crosswalk.ingest.lom = OCW-LOM 2. URL of CC license to apply to ingested OCW courses cwspace.ocw.creativecommons.url = "http:..." e.g. cwspace.ocw.creativecommons.url = http://creativecommons.org/licenses/by-nc-sa/2.5/

Version:
$Revision$
Author:
Larry Stone
See Also:
AbstractIMSCPIngester

Constructor Summary
OCWIMSCPIngester()
           
 
Method Summary
 void addLicense(Context context, Collection collection, Item item, IMSCPManifest manifest, String license)
          Add license(s) to Item based on contents of METS and other policies.
 void checkPackageFiles(Set packageFiles, Set missingFiles, IMSCPManifest manifest)
          Hook for subclass to modify the test of the package's integrity, and add other tests.
 void crosswalk(Context context, Item item, IMSCPManifest manifest, boolean validate)
          Crosswalk item's descriptive (and other Item-level) metadata from the manifest.
 void finishItem(Context context, Item item, Collection collection)
          Hook for final "finishing" operations on the new Item.
 Class getManifestClass()
          Returns specific subclass of manifest for this profile.
 
Methods inherited from class org.dspace.content.packager.AbstractIMSCPIngester
ingest, replace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCWIMSCPIngester

public OCWIMSCPIngester()
Method Detail

getManifestClass

public Class getManifestClass()
Returns specific subclass of manifest for this profile.

Specified by:
getManifestClass in class AbstractIMSCPIngester
Returns:
the class object.

checkPackageFiles

public void checkPackageFiles(Set packageFiles,
                              Set missingFiles,
                              IMSCPManifest manifest)
                       throws PackageValidationException,
                              CrosswalkException
Hook for subclass to modify the test of the package's integrity, and add other tests. E.g. evaluate a PGP signature of the manifest in a separate file.

The packageFiles contains "extra" files that were in the package but were not referenced by the METS manifest (either as content or metadata (mdRefs)). The implementation of this method should look for any "extra" files uses (e.g. a checksum or cryptographic signature for the manifest itself) and remove them from the Set.

The missingFiles set is for any files referenced by the manifest but not found in the package. The implementation can check it for "false positives", or add other missing files it knows of.

If either of the Sets missingFiles or packageFiles is not empty, the ingest will fail.

Specified by:
checkPackageFiles in class AbstractIMSCPIngester
Parameters:
packageFiles - files in package but not referenced by METS
missingFiles - files referenced by manifest but not in package
Throws:
PackageValidationException
CrosswalkException

crosswalk

public void crosswalk(Context context,
                      Item item,
                      IMSCPManifest manifest,
                      boolean validate)
               throws PackageException,
                      CrosswalkException,
                      AuthorizeException,
                      SQLException,
                      IOException
Crosswalk item's descriptive (and other Item-level) metadata from the manifest. The element at /manifest/metadata/adlcp:location contains a URI pointing to a file in the package which contains a LOM document that applies to the entire course. Read this and pass it to the configured crosswalk plugin. That is the sole source of Item-level descriptive metadata.

Specified by:
crosswalk in class AbstractIMSCPIngester
Throws:
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

addLicense

public void addLicense(Context context,
                       Collection collection,
                       Item item,
                       IMSCPManifest manifest,
                       String license)
                throws PackageException,
                       CrosswalkException,
                       AuthorizeException,
                       SQLException,
                       IOException
Add license(s) to Item based on contents of METS and other policies. The implementation of this method controls exactly what licenses are added to the new item, including the DSpace deposit license. It is given the collection (which is the source of a default deposit license), an optional user-supplied deposit license (in the form of a String), and the IMSCP manifest.

In this implementation we simply add the default deposit license. OCW content is available under a specific Creative Commons license, so if the URL for that license is configured, set that using the DSpace Creative Commons licensing mechanism.

Specified by:
addLicense in class AbstractIMSCPIngester
Parameters:
context - the DSpace context
collection - DSpace Collection to which the item is being submitted.
license - optional user-supplied Deposit License text (may be null)
Throws:
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

finishItem

public void finishItem(Context context,
                       Item item,
                       Collection collection)
                throws PackageException,
                       CrosswalkException,
                       AuthorizeException,
                       SQLException,
                       IOException
Hook for final "finishing" operations on the new Item. This method is called when the new Item is otherwise complete and ready to be returned. The implementation should use this opportunity to make whatever final checks and modifications are necessary.

Set the primary bitstream, so when this item appears in the DSpace Web UI, it will have a link to the single course home page instead of appearing as a confusing list of dozens of separate content files. This also ensures the HTML is rendered through the "html" servlet, which is the only way to get relative references to links and stylesheets, etc. to work in the DSpace Web UI. It is an error if the Item cannot be supplied with a primary bitstream, because of the aforementioned rendering problems.

Specified by:
finishItem in class AbstractIMSCPIngester
Parameters:
context - the DSpace context
item - the item object.
collection - the parent collection to-be
Throws:
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException


Copyright © 2010 The DSpace Foundation. All Rights Reserved.