You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(7) |
Feb
(36) |
Mar
(3) |
Apr
(28) |
May
(9) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
(5) |
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bil...@us...> - 2010-01-22 16:25:56
|
Revision: 876 http://echodep.svn.sourceforge.net/echodep/?rev=876&view=rev Author: bill_ingram Date: 2010-01-22 16:25:50 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Documentation images and CSS that never made it up to the code repository. Modified Paths: -------------- trunk/doc/style/hs-doc.css Added Paths: ----------- trunk/doc/images/get.jpg trunk/doc/images/migrate.jpg trunk/doc/images/put.jpg trunk/doc/images/sword.jpg Added: trunk/doc/images/get.jpg =================================================================== (Binary files differ) Property changes on: trunk/doc/images/get.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/doc/images/migrate.jpg =================================================================== (Binary files differ) Property changes on: trunk/doc/images/migrate.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/doc/images/put.jpg =================================================================== (Binary files differ) Property changes on: trunk/doc/images/put.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/doc/images/sword.jpg =================================================================== (Binary files differ) Property changes on: trunk/doc/images/sword.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/doc/style/hs-doc.css =================================================================== --- trunk/doc/style/hs-doc.css 2010-01-22 16:23:25 UTC (rev 875) +++ trunk/doc/style/hs-doc.css 2010-01-22 16:25:50 UTC (rev 876) @@ -1,54 +1,68 @@ -body { - background-color:#9DB9C9; - font-family: sans-serif; - line-height: 1.5em; - margin: 0 0 0 0; - padding: 0 0 0 0; -} - -#main { - width: 85%; - min-width: 550px; - margin: 0 auto 0 auto; - padding: 10px; - border-left: 1px solid #335E96; - border-right: 1px solid #335E96; - background-color: #FFFFFF; -} - -#head { - font-size: .75em; - line-height: 1.3em; - width: 85%; - min-width: 550px; - margin: 0 auto 0 auto; - padding: 10px; - border-left: 1px solid #335E96; - border-right: 1px solid #335E96; - color: #5F626B; - background-color: #FFFFFF; -} - -#foot { - font-size: .75em; - line-height: 1.3em; - width: 85%; - min-width: 550px; - margin: 0 auto 0 auto; - padding: 10px; - border: 1px solid #335E96; - background-color: #DBE1F7; - color: #5F626B; -} - -#foot a{ - color: #46484F; - font-weight: bold; -} - - -img { border: 0; } -h1 { color: #335E97; } -h2 { background-color: #ABA07D; color: #FFFFFF; padding: 3px;} -h3 { color: #403C2F; } +body { + background-color:#9DB9C9; + font-family: sans-serif; + line-height: 1.5em; + + margin: 0 0 0 0; + padding: 10px 0 0 0; +} + +#main { + width: 85%; + min-width: 550px; + margin: 0 auto 0 auto; + padding: 10px; + border-left: 1px solid #335E96; + border-right: 1px solid #335E96; + background-color: #FFFFFF; +} + +#head { + font-size: .75em; + line-height: 1.3em; + width: 85%; + min-width: 550px; + margin: 0 auto 0 auto; + padding: 10px; + border-left: 1px solid #335E96; + border-right: 1px solid #335E96; + border-top: 1px solid #335E96; + color: #5F626B; + background-color: #FFFFFF; +} + +#foot { + font-size: .75em; + line-height: 1.3em; + width: 85%; + min-width: 550px; + margin: 0 auto 0 auto; + padding: 10px; + border: 1px solid #335E96; + background-color: #DBE1F7; + color: #5F626B; +} + +#foot a{ + color: #46484F; + font-weight: bold; +} + + +img { + border: 0; + + +} + +img.screen{ + border: 0; + width: 60%; + height: 60%; +} + + +h1 { color: #335E97; } +h2 { background-color: #7F909B; color: #FFFFFF; padding: 3px;} +h3 { color: #000000; } code { background-color: #D9DFFF; color: black; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2010-01-22 16:23:37
|
Revision: 875 http://echodep.svn.sourceforge.net/echodep/?rev=875&view=rev Author: bill_ingram Date: 2010-01-22 16:23:25 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Updated the "tar-all" build target to omit the NetBeans project directory. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-01-04 17:09:40 UTC (rev 874) +++ trunk/build.xml 2010-01-22 16:23:25 UTC (rev 875) @@ -587,8 +587,8 @@ <!-- ============================================================= --> <target name="tar_all"> - <tar destfile="../echodep-hands-0.6.tar.gz" compression="gzip" > - <tarfileset dir="." excludes=".project, .classpath" prefix="echodep/" /> + <tar destfile="../echodep-hands-0.8.tar.gz" compression="gzip" > + <tarfileset dir="." excludes=".project, .classpath, nbproject/**" prefix="echodep/" /> </tar> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2010-01-04 17:09:52
|
Revision: 874 http://echodep.svn.sourceforge.net/echodep/?rev=874&view=rev Author: bill_ingram Date: 2010-01-04 17:09:40 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Tagging version 0.7 Added Paths: ----------- tags/version-0.7/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2010-01-04 17:07:40
|
Revision: 873 http://echodep.svn.sourceforge.net/echodep/?rev=873&view=rev Author: bill_ingram Date: 2010-01-04 17:07:25 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Updated documentation Modified Paths: -------------- trunk/doc/index.html trunk/doc/installation.html trunk/doc/usage.html Added Paths: ----------- trunk/doc/about.html trunk/doc/contact.html trunk/doc/documentation.html trunk/doc/download.html trunk/doc/javadoc/ trunk/doc/javadoc/constant-values.html trunk/doc/javadoc/edu/ trunk/doc/javadoc/edu/uiuc/ trunk/doc/javadoc/edu/uiuc/ndiipp/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/Auth.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/ConfigHandler.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/HttpAuth.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/LrcrudService.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/Test.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.CreateResponse.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.DeleteResponse.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.LrcrudResponse.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.RetrieveResponse.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.UpdateResponse.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClientAuthenticator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClientException.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/console/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/console/LRCRUDSConsole.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/console/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/console/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/console/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DSpaceService.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DspaceAuth.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/LoadDSpaceConfig.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DSpaceService.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DspaceAuth.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/LoadDSpaceConfig.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraAuth.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraExport.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraGetNextPID.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraIngest.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraService.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/HttpFileDownloader.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/lrcrud/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/DirectoryPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Dspace2HubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Eprints2HubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Fedora2HubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackagerFactory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Hub2DspacePackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Hub2EprintsPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/Hub2SwordPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/OCAPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/PackagerException.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/TestDspace2HubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/ToHubPackager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/ToHubPackagerFactory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/packager/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSAppender.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfileException.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfileFactory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSValidator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSWebProfile.ArcFileDecomposition.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSWebProfile.WebCaptureDivision.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSWebProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSWebValidator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.AMD_SECTION.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.DMDSecStatus.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISAgentType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISEventType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISIdentifierType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISLinkingAgentRole.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISObjectCategory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PREMISSwType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.PackageType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.StructMapType.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.TechMDStatus.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/TestHaSMETSProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/TestHaSMETSWebProfile.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/XmlErrorRenderer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/profile/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/AIFFTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/ASCIISpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/ASCIITransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/BaseApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/BytestreamTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/GIFSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/GIFTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/HSJhoveApp.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/HTMLSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/HTMLTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JPGSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JPGTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveGenerator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveNamespaceContext.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveRawGenerator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveResult.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveTransformerFactory.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/JhoveValidator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/PDFBaseApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/PDFTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/PremisIDGenerator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/SpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TIFFSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TIFFTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDAugmenter.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDInvestigator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TrivialPremisIDGenerator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/UTFSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/UTFTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/WAVSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/WAVTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/XMLSpecificApplicator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/XMLTransformer.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/jhove/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/utils/package-tree.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/ trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/ConsoleAuthenticator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/FlexibleLayout.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/GUIAuthenticator.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/JTextPaneAppender.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/PackageSubmission.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/SWORDUtils.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManager.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/package-frame.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/package-summary.html trunk/doc/javadoc/edu/uiuc/ndiipp/hubandspoke/workflow/package-tree.html trunk/doc/javadoc/index-all.html trunk/doc/javadoc/overview-frame.html trunk/doc/javadoc/overview-tree.html trunk/doc/javadoc/package-list trunk/doc/javadoc/resources/ trunk/doc/javadoc/resources/inherit.gif trunk/doc/javadoc/serialized-form.html trunk/doc/mets.html trunk/doc/resources.html trunk/doc/usecommand.html Removed Paths: ------------- trunk/doc/extending.html Added: trunk/doc/about.html =================================================================== --- trunk/doc/about.html (rev 0) +++ trunk/doc/about.html 2010-01-04 17:07:25 UTC (rev 873) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> +<title>UIUC Echodep Hub and Spoke About</title> +</head> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<div id="main"> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>About</h1> +<p>The Hub and Spoke Framework Tool Suite (HandS) was developed as part of the ECHO DEPository. ECHO DEPository a five-year (2004-2009) digital preservation research and development project at the University of Illinois at Urbana-Champaign, funded by the Library of Congress under their National Digital Information Infrastructure and Preservation Program (NDIIPP). Among the core activities in ECHO DEPository Phase I was repository evaluation, in which several open-source repository software applications were installed, configured, tested, and evaluated for insight into the real-world problems of archiving digital content. A key outcome of HandS in Phase I was a set of software scripts and programs, known as the Hub and Spoke Framework Tool Suite, for facilitating interoperability between repositories.</p> +<p>The Hub and Spoke Framework Tool Suite was designed not only to provide basic interoperability between repositories, but we are looking forward to using the architecture as a unifying platform for preservation. The architecture currently consists of several parts. Probably the most important being the METS profile which remains mostly neutral regarding content files and structure but defines a minimum level of descriptive (MODS) and administrative (PREMIS) metadata with a strong emphasis on preservation, particularly technical data and provenance. </p> +<p>A second key part of the architecture are the spokes. These are a RESTful Web Service which we call the Lightweight Repository CRUD Service (LRCRUDS). CRUD being Create, Retrieve, Update, and Delete from the relational database lexicon. This service would map URIs to local identifiers and use the HTTP methods PUT, GET, POST, and DELETE to handle packages being submitted or disseminated from a particular repository. Packages would be shipped over the network as ZIP archives containing a standard header, METS file, and content files in a format suitable for import into the repository. An instance of this service would be created for each repository participating in the HandS.</p> +<p>The third critical part of the architecture is the Hub. The Hub performs the transformations required to convert from and to the METS profile, and it manages the generation and validation of technical and provenance metadata. Initially the Hub is simply a staging area as packages are moved about. However, the ultimate goal is to develop the Hub into a trusted preservation archive capable of handling submissions from various other repositories and also disseminating packages to those repositories, as well as handling all the other required functions of a trusted digital repository.</p> + + + + +</div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> +</body> +</html> \ No newline at end of file Added: trunk/doc/contact.html =================================================================== --- trunk/doc/contact.html (rev 0) +++ trunk/doc/contact.html 2010-01-04 17:07:25 UTC (rev 873) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> +<title>UIUC Echodep Hub and Spoke Contact</title> +</head> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<div id="main"> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>Contact</h1> + + +<p>Tom Habing, Research Programer, by email at thabing[at]illinois[dot]edu, or by phone at 217-244-4425</p> + + + + +</div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> +</body> +</html> \ No newline at end of file Added: trunk/doc/documentation.html =================================================================== --- trunk/doc/documentation.html (rev 0) +++ trunk/doc/documentation.html 2010-01-04 17:07:25 UTC (rev 873) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> +<title>UIUC Echodep Hub and Spoke Documentation</title> +</head> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<div id="main"> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>Documentation</h1> + +<ul> + <li><a href="installation.html">Installation</a></li> + <li><a href="usage.html">Using the tools - GUI </a></li> + <li><a href="usecommand.html">Using the tools - Command Line</a></li> + <li><a href="javadoc/index.html">Javadoc</a></li> + <li><a href="http://sourceforge.net/projects/echodep/">Download from Sourceforge</a></li> +</ul> + + + +</div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> +</body> +</html> \ No newline at end of file Added: trunk/doc/download.html =================================================================== --- trunk/doc/download.html (rev 0) +++ trunk/doc/download.html 2010-01-04 17:07:25 UTC (rev 873) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> +<title>UIUC Echodep Hub and Spoke Download</title> +</head> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<div id="main"> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>Download</h1> +<p>All components of the Hub and Spoke Framework Tool Suite can be found in the binary distribution in the downloads section of our SourceForge page: <a href=http://sourceforge.net/project/showfiles.php?group_id=174054">SourceForge</a></p> +<p>Installation instructions can be found here: <a href="installation.html">Installation</a> + + + + +</div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> +</body> +</html> \ No newline at end of file Deleted: trunk/doc/extending.html =================================================================== --- trunk/doc/extending.html 2009-11-17 20:37:38 UTC (rev 872) +++ trunk/doc/extending.html 2010-01-04 17:07:25 UTC (rev 873) @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> -<link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> -<title>Extending the Hub and Spoke Toolset</title> -</head> -<body> -<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> -<div id="main"> -<h1>Extending the Hub and Spoke Toolset</h1> -</div> -<div id="foot"> - <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> - <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> - <div style="float:left;"> - <strong>The ECHO DEPository</strong><br/> - An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> - <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> | <a href="http://www.oclc.org/">OCLC</a> - </div> - <br style="clear: both;"/> -</div> -</body> -</html> \ No newline at end of file Modified: trunk/doc/index.html =================================================================== --- trunk/doc/index.html 2009-11-17 20:37:38 UTC (rev 872) +++ trunk/doc/index.html 2010-01-04 17:07:25 UTC (rev 873) @@ -2,32 +2,30 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> <title>UIUC Echodep Hub and Spoke Documentation</title> </head> -<body> -<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> <div id="main"> -<h1>Documentation</h1> -<p>What would you like to know about?</p> -<ul> - <li><a href="installation.html">Installation</a></li> - <li><a href="usage.html">Using the tools</a></li> - <li><a href="extending.html">Extending the toolset and writing your own spokes</a></li> - <li><a href="javadoc/index.html">Javadoc</a></li> - <li><a href="http://sourceforge.net/projects/echodep/">Download from Sourceforge</a></li> -</ul> -</div> -<div id="foot"> - <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> - <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> - <div style="float:left;"> - <strong>The ECHO DEPository</strong><br/> - An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> - <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> | <a href="http://www.oclc.org/">OCLC</a> - </div> - <br style="clear: both;"/> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>UIUC Echodep Hub and Spoke Framework Tool Suite</h1> +<p>The Hub and Spoke (HandS) tool suite was built to help curators of digital objects manage content in multiple repository systems while preserving valuable preservation metadata. Implementing METS and PREMIS, HandS provides a standards-based method for packaging content that allows digital objects to be moved between repositories more easily while supporting the collection of technical and provenance information crucial for long-term preservation.</p> + + + </div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> </body> </html> \ No newline at end of file Modified: trunk/doc/installation.html =================================================================== --- trunk/doc/installation.html 2009-11-17 20:37:38 UTC (rev 872) +++ trunk/doc/installation.html 2010-01-04 17:07:25 UTC (rev 873) @@ -2,131 +2,294 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" href="style/hs-doc.css" type="text/css" /> -<title>Echodep Hub and Spoke Tool Suite Documentation</title> +<title>Echodep Hub and Spoke Tool Suite Installation</title> </head> -<body> -<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> +<body> +<div id="head"><a href="index.html"><img src="images/hshead.png"></img></a></div> <div id="main"> -<h1>Installation</h1> - -<p>The Hub and Spoke Tool Suite consists of a number of components that can be used individually or in tandem -to help enable digital-repository interoperability. At minimum you will need <a href="http://java.sun.com/">Sun Java</a> 1.5 SDK or later, but -certain components may require other applications be installed. If you are building from source or installing the LRCRUD service -<a href="http://ant.apache.org/">Apache Ant</a> (tested version 1.6.5) is required.</p> - -<p>Throughout this document we will use the following convention to refer to the location where -this distribution was unpacked: [<em>install-dir</em>].</p> - -<div id="nav"><a href="#hsc">Hub and Spoke Core</a> | <a href="#lrc">LRCRUD Web Service</a> | <a href="#val">Profile Validator</a></div> - -<h2><a name="hsc">Hub and Spoke Core</a></h2> - -<p>These components are responsible for transforming, validating, and creating EchoDep artifacts.</p> - -<p>You can find the binary distribution of these core tools in the -<a href="http://sourceforge.net/project/showfiles.php?group_id=174054">downloads section of our SourceForge page.</a> -This is simply a pre-compiled version of the core tools...which is the result of running <code>ant build_has</code> -in [<em>install-dir</em>] of your local machine. It is recommended that you build the -<strong>hubandspoke.tar.gz</strong> package yourself.</p> - -After obtaining <strong>hubandspoke.tar.gz</strong>: -<ul> - <li>Create a directory that will serve as <em>[HS_HOME]</em> <br /> - <ul> - <li>make sure the path to <em>[HS_HOME]</em> does not contain any spaces</li> - </ul> - </li> - <li>unpack <strong>hubandspoke.tar.gz</strong> into <em>[HS_HOME]</em></li> - <li>Edit <em>[HS_HOME]</em>/config/jhove.conf - <ul> - <li>edit the <tempDirectory> element appropriate to your local system</li> - </ul> - </li> - <li>Edit <em>[HS_HOME]</em>/config/log4j.properties - <ul> - <li>Edit the <code>log4j.appender.rfa.File</code> property to point to <em>[HS_HOME]</em>/log/hands.log, - or the log file of your choice (the named file must exist). </li> - </ul> - </li> -</ul> - - -<h2><a name="lrc">LRCRUD Web Service</a></h2> - -<p>The Lightweight Repository Create Retrieve Update Delete service can be installed on the -server where your repository is running to handle ingestion of Hub and Spoke packages into said repository. -This is a REST style web service and is described by a general <a href="http://dli.grainger.uiuc.edu/echodep/HnS/LRCRUDS.htm">specification</a>. -Currently, we have a working LRCRUD service implementation for DSpace, EPrints, and Fedora. -</p> - -<h3>Prerequisites</h3> - -<p>LRCRUD was developed, tested, and depends on the following software:</p> -<ul> - <li><a href="http://java.sun.com/">Sun Java</a> 1.5 SDK or later</li> - <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later</li> - <li><a href="http://tomcat.apache.org/">Apache Tomcat</a> 5.5 or later</li> -</ul> -<p>Ensure these components are installed before installing LRCRUD.</p> -<p>It is best to run installation tasks as your local system's Tomcat user. -If this is not possible, ensure that the temp directory is writable by the Tomcat user.</p> - -<h3>Installing the DSpace Service</h3> -<ul> - <li>navigate to [<em>install-dir</em>]</li> - <li>Edit [<em>install-dir</em>]/lrcrud/cfg/lrcrud.cfg and set the - properties as they relate to your local system.</li> - <li>Compile and Build: <code>ant build_dspace_lrcrud</code></li> - <li>Copy the generated file <strong>dspace-lrcrud.war</strong> - to the <strong>webapps</strong> directory of your Tomcat installation.</li> - <li>Depending on your settings, you may need to restart Tomcat.</li> -</ul> -<p><strong>NOTE:</strong> By default, the base URL of the service will be -http://my.server.edu:8080/dspace-lrcrud. If you would like to change this, or any other -defaults of the Tomcat configuration, you must modify the <strong>web.xml</strong> in the WEB-INF -folder created for this project in your Tomcat webapps directory.</p> -<p>You can test the service by visiting the base URL in a web browser. If successfully installed, you will -be prompted by your browser for your DSpace username and password.</p> -<p><strong>NOTE:</strong> This service uses Basic Authentication which sends passwords in the clear. It is advised to -use this service with HTTPS.</p> - -<h3>Installing the Fedora Service</h3> -<ul> - <li>navigate to [<em>install-dir</em>]</li> - <li>Edit [<em>install-dir</em>]/lrcrud/cfg/lrcrud.cfg and set the - properties as they relate to your local system.</li> - <li>Compile and Build: <code>ant build_fedora_lrcrud</code></li> - <li>Copy the generated file <strong>fedora-lrcrud.war</strong> - to the <strong>webapps</strong> directory of your Tomcat installation.</li> - <li>Depending on your settings, you may need to restart Tomcat.</li> -</ul> -<p><strong>NOTE:</strong> See the notes for DSpace, above, substituting - <em>fedora-lrcrud</em> for <em>dspace-lrcrud</em>. </p> - -<h2><a name="val">Validator</a></h2> -<p>This web application was developed to facilitate testing and validating EchoDep METS -files by our project partners. This is not a part of the main tools package, is not -officially maintained or supported, and should be used -with caution.</p> -<p><strong>To install the Profile Validator:</strong></p> -<ul> - <li>navigate to [<em>install-dir</em>]</li> - <li>run <code>ant build_validator</code></li> - <li>copy the generated <strong>hubvalidator.war</strong> file to your Tomcat webapps directory</li> -</ul> -<p>You should then be able to access the service at http://my.server.edu:8080/hubvalidator.</p> -</div> -<div id="foot"> - <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> - <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> - <div style="float:left;"> - <strong>The ECHO DEPository</strong><br/> - An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> - <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> | <a href="http://www.oclc.org/">OCLC</a> - </div> - <br style="clear: both;"/> +<div id="nav"><a href="index.html">Home</a> | <a href="about.html">About</a> | <a href="download.html">Download</a> | <a href="documentation.html">Documentation</a> | <a href="mets.html">METS Profiles</a> | <a href="resources.html">Resources</a> | <a href="contact.html">Contact</a></div> + +<h1>Installation</h1> + + <h2>Preface</h2> + + <p>The Hub and Spoke Tool Suite consists of a number of components that can be used individually or in tandem to help enable digital-repository interoperability. The binary distribution on <a href="http://sourceforge.net/project/showfiles.php?group_id=174054">SourceForge</a> includes the Hub and Spoke Client Applications and LRCRUD service for D-space, Fedora, and ePrints. Included in the package is also a METS Profile Validator. It however is not part of the main tools package and is not offically maintained or supported.</p> + + <h3>Prerequisites</h3> + + <p>At minimum you will need <a href="http://java.sun.com/">Sun Java</a> 1.6 SDK or later, but + certain components may require other applications be installed. If you are building from source or installing the LRCRUD service + <a href="http://ant.apache.org/">Apache Ant</a> (tested version 1.6.5) is required.</p> + + <h3>Document Conventions</h3> + <p>Throughout this document we will use the following convention to refer to the location where + this distribution was unpacked: <em>[install-dir]</em>.</p> + + <h3>Installation Navigation</h3> + + <div id="nav"><a href="#hsc">Hub and Spoke Client Applications</a> | <a href="#dspace">Dspace LRCRUD</a> | <a href="#fedora">Fedora LRCRUD</a> | <a href="#eprints">EPrints LRCRUD</a> | <a href="#val">Profile Validator</a></div> + + + + <h2><a name="hsc">Hub and Spoke Client Applications</a></h2> + + <h3>Overview</h3> + <p>These components are responsible for transforming, validating, and creating EchoDep artifacts.</p> + + <h3>Prerequisites</h3> + <ul> + <li><a href="http://java.sun.com/">Sun Java</a> 1.6 SDK or later</li> + <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later</li> + </ul> + + <h3>Download</h3> + <p>You can find the binary distribution of these core tools in the + <a href="http://sourceforge.net/project/showfiles.php?group_id=174054">downloads section of our SourceForge page.</a> + </p> + + <h3>Install</h3> + After obtaining <strong>hubandspoke.tar.gz</strong>: + <ul> + <li>Extract files into <em>[install-dir]</em>. A directory 'echodep' will be created. <br /> + <ul> + <li>make sure the path to <em>[install-dir]</em> does not contain any spaces</li> + </ul> + </li> + <li>Edit <em>[install-dir]</em>/echodep/hubandspoke/config/hands.properties + <ul> + <li>edit 'hands.home' appropriate to your local system</li> + <li>edit 'hands.temp' appropriate to your local system</li> + </ul> + </li> + <li>Navigate to <em>[install-dir]</em>/echodep</li> + <li>Use command <code>ant build_hands_client</code> to install Hub and Spoke Client Applications</li> + </ul> + + + <h3>Using Hub and Spoke Client Applications</h3> + + <ul> + <li>To get to the user interface run the script from <em>[install-dir]</em>/echodep/hubandspoke/bin/workflowmangergui</li> + <li>For more instruction on the user interface see: <a href="usage.html">Using the tools - GUI</a></li> + <li>To use the command line interface see further instruction at: <a href="usecommand.html">Using the tools - Command Line</a></li> + </ul> + + + <h2><a name="dspace">DSpace LRCRUD Web Service</a></h2> + + + <h3>Overview</h3> + <p>The Lightweight Repository Create Retrieve Update Delete service can be installed on the + server where your repository is running to handle ingestion of Hub and Spoke packages into said repository. + This is a REST style web service and is described by a general <a href="http://dli.grainger.uiuc.edu/echodep/HnS/LRCRUDS.htm">specification</a>. + + </p> + + <h3>Prerequisites</h3> + + <p>LRCRUD was developed, tested, and depends on the following software:</p> + <ul> + <li><a href="http://java.sun.com/">Sun Java</a> 1.6 SDK or later</li> + <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later</li> + <li><a href="http://tomcat.apache.org/">Apache Tomcat</a> 5.5 or later</li> + </ul> + <p>Ensure these components are installed before installing LRCRUD.</p> + <p>It is best to run installation tasks as your local system's Tomcat user. + If this is not possible, ensure that the temp directory is writable by the Tomcat user.</p> + + + <h3>Installing the DSpace Service</h3> + <ul> + <li>navigate to <em>[install-dir]</em></li> + <li>Edit <em>[install-dir]</em>/lrcrud/cfg/lrcrud.cfg and set the + properties as they relate to your local system.</li> + <li>Compile and Build: <code>ant build_dspace_lrcrud</code></li> + <li>Copy the generated file <strong>dspace-lrcrud.war</strong> + to the <strong>webapps</strong> directory of your Tomcat installation.</li> + <li>Depending on your settings, you may need to restart Tomcat.</li> + </ul> + <p><strong>NOTE:</strong> By default, the base URL of the service will be + http://my.server.edu:8080/dspace-lrcrud. If you would like to change this, or any other + defaults of the Tomcat configuration, you must modify the <strong>web.xml</strong> in the WEB-INF + folder created for this project in your Tomcat webapps directory.</p> + <p>You can test the service by visiting the base URL in a web browser. If successfully installed, you will + be prompted by your browser for your DSpace username and password.</p> + <p><strong>NOTE:</strong> This service uses Basic Authentication which sends passwords as clear text. It is advised to + use this service with HTTPS.</p> + + + <h3>Using Hub and Spoke DSpace LRCRUD</h3> + + <ul> + <li>To get to the user interface run the script from <em>[install-dir]</em>/echodep/hubandspoke/bin/workflowmangergui</li> + <li>For more instruction on the user interface see: <a href="usage.html">Using the tools - GUI</a></li> + <li>To use the command line interface see further instruction at: <a href="usecommand.html">Using the tools - Command Line</a></li> + </ul> + + <h2><a name="fedora">Fedora LRCRUD Web Service</a></h2> + + + <h3>Overview</h3> + <p>The Lightweight Repository Create Retrieve Update Delete service can be installed on the + server where your repository is running to handle ingestion of Hub and Spoke packages into said repository. + This is a REST style web service and is described by a general <a href="http://dli.grainger.uiuc.edu/echodep/HnS/LRCRUDS.htm">specification</a>. + + </p> + + <h3>Prerequisites</h3> + + <p>LRCRUD was developed, tested, and depends on the following software:</p> + <ul> + <li><a href="http://java.sun.com/">Sun Java</a> 1.6 SDK or later</li> + <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later</li> + <li><a href="http://tomcat.apache.org/">Apache Tomcat</a> 5.5 or later</li> + </ul> + <p>Ensure these components are installed before installing LRCRUD.</p> + <p>It is best to run installation tasks as your local system's Tomcat user. + If this is not possible, ensure that the temp directory is writable by the Tomcat user.</p> + + + <h3>Installing the Fedora Service</h3> + <ul> + <li>navigate to <em>[install-dir]</em></li> + <li>Edit <em>[install-dir]</em>/lrcrud/cfg/lrcrud.cfg and set the + properties as they relate to your local system.</li> + <li>Compile and Build: <code>ant build_fedora_lrcrud</code></li> + <li>Copy the generated file <strong>fedora-lrcrud.war</strong> + to the <strong>webapps</strong> directory of your Tomcat installation.</li> + <li>Depending on your settings, you may need to restart Tomcat.</li> + </ul> + <p><strong>NOTE:</strong> By default, the base URL of the service will be + http://my.server.edu:8080/fedora-lrcrud. If you would like to change this, or any other + defaults of the Tomcat configuration, you must modify the <strong>web.xml</strong> in the WEB-INF + folder created for this project in your Tomcat webapps directory.</p> + <p>You can test the service by visiting the base URL in a web browser. If successfully installed, you will + be prompted by your browser for your Fedora username and password.</p> + <p><strong>NOTE:</strong> This service uses Basic Authentication which sends passwords in the clear. It is advised to + use this service with HTTPS.</p> + + + <h3>Using Hub and Spoke Fedora LRCRUD</h3> + + <ul> + <li>To get to the user interface run the script from <em>[install-dir]</em>/echodep/hubandspoke/bin/workflowmangergui</li> + <li>For more instruction on the user interface see: <a href="usage.html">Using the tools - GUI</a></li> + <li>To use the command line interface see further instruction at: <a href="usecommand.html">Using the tools - Command Line</a></li> + </ul> + + + + <h2><a name="eprints">EPrints LRCRUD Web Service</a></h2> + + + <h3>Overview</h3> + <p>The Lightweight Repository Create Retrieve Update Delete service can be installed on the + server where your repository is running to handle ingestion of Hub and Spoke packages into said repository. + This is a REST style web service and is described by a general <a href="http://dli.grainger.uiuc.edu/echodep/HnS/LRCRUDS.htm">specification</a>. + + </p> + + <h3>Prerequisites</h3> + + <p>LRCRUD was developed, tested, and depends on the following software:</p> + <ul> + <li>EPrints 3.0 RC 1 or later</li> + <li>Apache HTTP Server 2.0 or later</li> + <li>Perl 5.8.7 or later</li> + <li>Mod_perl 2.0.2 or later</li> + + </ul> + <p>Ensure these components are installed before installing LRCRUD.</p> + + <p>The EPrints LRCRUD service uses the following Perl Packages and all dependencies that are not already installed on your machine (from CPAN) : + <br><strong>Note:</strong> Don't worry. You will be able to determine what Perl packages above are not installed via the EPrints LRCRUD service installation process as instructed below.</p> + + <ul> + <li>REST::Application</li> + <li>MIME::Base64</li> + <li>Config::IniFiles</li> + <li>Carp</li> + <li>Archive::Zip</li> + <li>IO::String</li> + <li>Cwd</li> + <li>Digest::MD5</li> + <li>DBI</li> + <li>Tie-IxHash</li> + <li>Getopt::Long</li> + <li>Term::ReadKey</li> + <li>LWP::UserAgent</li> + <li>LWP::Debug</li> + <li>HTTP::Request</li> + <li>HTTP::Headers</li> + </ul> + + <p>It is best to run installation tasks as a local user and using the sudo command when necessary (e.g., when reloading Apache 2).</p> + + + <h3>Installing the EPrints Service</h3> + <ul> + <li>Navigate to [eprints_lrcrud_install_dir] and copy eprints_lrcrud.tar.gz into this directory.</li> + <li>Run: tar xzvf eprints_lrcrud.tar.gz</li> + <li>Go to [eprints_lrcrud_install_dir] /install directory.</li> + <li>Run perl whatPerlPackagesAreInstalled.pl and install any Perl packages that are missing.</li> + <li>Run perl eprints_set_configure_ini.pl to create all LRCRUD-related configuration files.</li> + <li>Go to [eprints_lrcrud_install_dir] /toEprints/Import directory.</li> + <li>Compare these files to the files in the [base_eprints]/perl_lib/EPrints/Plugin/Import directory. If the same files already exist in that directory, save the originals (in the EPrints Import directory) by adding an .org suffix. Then, copy the files from the [eprints_lrcrud_install_dir] /toEprints/Import directory into the EPrints Import directory.</li> + <li>Go to [eprints_lrcrud_install_dir] /toApache directory.</li> + <li>Append the contents of the generated file eprints_append to the eprints file in the sites_available directory of your Apache 2 installation.</li> + <li>Reload Apache2.</li> + </ul> + + <p>You can test this service by going into the [eprints_lrcrud_install_dir] /test directory and running some scripts there. The main script is a command-line script that tests any lrcrud service. It's called eprints_lrcrud_test.pl.</p> + + + <p><strong>NOTE:</strong> By default, the base URL of the service will be + http://my.server.edu:8080/eprints-lrcrud. If you would like to change this, or any other + defaults of the Tomcat configuration, you must modify the <strong>web.xml</strong> in the WEB-INF + folder created for this project in your Tomcat webapps directory.</p> + <p>You can test the service by visiting the base URL in a web browser. If successfully installed, you will + be prompted by your browser for your EPrints username and password.</p> + <p><strong>NOTE:</strong> This service uses Basic Authentication which sends passwords in the clear. It is advised to + use this service with HTTPS.</p> + + <h3>Using Hub and Spoke EPrints LRCRUD</h3> + + <ul> + <li>To get to the user interface run the script from <em>[install-dir]</em>/echodep/hubandspoke/bin/workflowmangergui</li> + <li>To use the command line interface see further instruction at: <a href="usage.html">Using the tools</a></li> + </ul> + + <h2><a name="val">Validator</a></h2> + + <p>This web application was developed to facilitate testing and validating EchoDep METS + files by our project partners. This is not a part of the main tools package, is not + officially maintained or supported, and should be used + with caution.</p> + + <p><strong>To install the Profile Validator:</strong></p> + <ul> + <li>navigate to <em>[install-dir]</em></li> + <li>run <code>ant build_validator</code></li> + <li>copy the generated <strong>hubvalidator.war</strong> file to your Tomcat webapps directory</li> + </ul> + <p>You should then be able to access the service at http://my.server.edu:8080/hubvalidator.</p> + + + + + </div> +<div id="foot"> + <div style="float:right;"> <a href="http://www.uiuc.edu"><img src="images/blockI.gif"/></a> + <a href="http://library.uiuc.edu"><img src="images/flip-no-shadow-small.png"/></a></div> + <div style="float:left;"> + <strong>The ECHO DEPository</strong><br/> + An <a href="http://www.digitalpreservation.gov/">NDIIPP</a> partner project<br/> + <a href="http://www.uiuc.edu">University of Illinois</a> | <a href="http://www.loc.gov">Library of Congress</a> + </div> + <br style="clear: both;"/> +</div> </body> </html> \ No newline at end of file Added: trunk/doc/javadoc/constant-values.html =================================================================== --- trunk/doc/javadoc/constant-values.html (rev 0) +++ trunk/doc/javadoc/constant-values.html 2010-01-04 17:07:25 UTC (rev 873) @@ -0,0 +1,316 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0_17) on Mon Jan 04 11:02:19 CST 2010 --> +<TITLE> +Constant Field Values (NDIIPP Hub and Spoke Source Javadoc) +</TITLE> + +<META NAME="date" CONTENT="2010-01-04"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Constant Field Values (NDIIPP Hub and Spoke Source Javadoc)"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> + <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H1> +Constant Field Values</H1> +</CENTER> +<HR SIZE="4" NOSHADE> +<B>Contents</B><UL> +<LI><A HREF="#edu.uiuc">edu.uiuc.*</A> +</UL> + +<A NAME="edu.uiuc"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left"><FONT SIZE="+2"> +edu.uiuc.*</FONT></TH> +</TR> +</TABLE> + +<P> + +<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left" COLSPAN="3">edu.uiuc.ndiipp.hubandspoke.packager.<A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Dspace2HubPackager.html" title="class in edu.uiuc.ndiipp.hubandspoke.packager">Dspace2HubPackager</A></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.packager.Dspace2HubPackager.DS_PREMIS_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Dspace2HubPackager.html#DS_PREMIS_NS">DS_PREMIS_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/standards/premis"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.packager.Dspace2HubPackager.DSPACE_METS_FILE_NAME"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Dspace2HubPackager.html#DSPACE_METS_FILE_NAME">DSPACE_METS_FILE_NAME</A></CODE></TD> +<TD ALIGN="right"><CODE>"mets.xml"</CODE></TD> +</TR> +</FONT></TD> +</TR> +</TABLE> + +<P> + +<P> + +<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left" COLSPAN="3">edu.uiuc.ndiipp.hubandspoke.packager.<A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Eprints2HubPackager.html" title="class in edu.uiuc.ndiipp.hubandspoke.packager">Eprints2HubPackager</A></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.packager.Eprints2HubPackager.EP_PREMIS_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Eprints2HubPackager.html#EP_PREMIS_NS">EP_PREMIS_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/standards/premis"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.packager.Eprints2HubPackager.EPRINTS_FILE_NAME"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/packager/Eprints2HubPackager.html#EPRINTS_FILE_NAME">EPRINTS_FILE_NAME</A></CODE></TD> +<TD ALIGN="right"><CODE>"eprints.xml"</CODE></TD> +</TR> +</FONT></TD> +</TR> +</TABLE> + +<P> + +<P> + +<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left" COLSPAN="3">edu.uiuc.ndiipp.hubandspoke.profile.<A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html" title="class in edu.uiuc.ndiipp.hubandspoke.profile">METSProfile</A></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.AMD_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#AMD_NS">AMD_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/AMD/"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.DATESTAMP_TOLERANCE_SECONDS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>protected static final int</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#DATESTAMP_TOLERANCE_SECONDS">DATESTAMP_TOLERANCE_SECONDS</A></CODE></TD> +<TD ALIGN="right"><CODE>120</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.JHOVE_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#JHOVE_NS">JHOVE_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://hul.harvard.edu/ois/xml/ns/jhove"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.METS_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#METS_NS">METS_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/METS/"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.MIME_FREQ_THRESHOLD"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>protected static final int</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#MIME_FREQ_THRESHOLD">MIME_FREQ_THRESHOLD</A></CODE></TD> +<TD ALIGN="right"><CODE>75</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.MIX_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#MIX_NS">MIX_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/mix/"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.MODS_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<CODE>public static final java.lang.String</CODE></FONT></TD> +<TD ALIGN="left"><CODE><A HREF="edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.html#MODS_NS">MODS_NS</A></CODE></TD> +<TD ALIGN="right"><CODE>"http://www.loc.gov/mods/v3"</CODE></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<A NAME="edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.PREMIS_NS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> +<C... [truncated message content] |
From: <bil...@us...> - 2009-11-17 20:37:53
|
Revision: 872 http://echodep.svn.sourceforge.net/echodep/?rev=872&view=rev Author: bill_ingram Date: 2009-11-17 20:37:38 +0000 (Tue, 17 Nov 2009) Log Message: ----------- Fixed Bagit packager; documented @author tags Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDAugmenter.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-11-17 20:25:24 UTC (rev 871) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-11-17 20:37:38 UTC (rev 872) @@ -68,6 +68,7 @@ import edu.uiuc.ndiipp.hubandspoke.utils.HaSZipUtils; import gov.loc.mets.MetsFileType; import gov.loc.mets.MetsDivType.Mptr; +import java.net.URI; /** * @@ -151,7 +152,7 @@ FileInputStream fis = new FileInputStream(f); logger.info("Reading file: " + f.getName()); - ze = new ZipEntry(name + File.separator + "data" + File.separator + f.getName()); + ze = new ZipEntry(name + File.separator + "data" + File.separator + mft.getFLocatArray(0).getHref()); zos.putNextEntry(ze); len = 0; @@ -161,7 +162,7 @@ } zos.closeEntry(); - manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + f.getName() + NL); + manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + mft.getFLocatArray(0).getHref() + NL); } // finally add the mastermets file Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-11-17 20:25:24 UTC (rev 871) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-11-17 20:37:38 UTC (rev 872) @@ -82,6 +82,7 @@ /** * @author Bill Ingram + * @author Matt Cordial * */ public class Hub2FedoraPackager extends FromHubPackager { Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java 2009-11-17 20:25:24 UTC (rev 871) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java 2009-11-17 20:37:38 UTC (rev 872) @@ -74,6 +74,7 @@ /** * * @author Bill Ingram + * @author thabing * */ public class HaSMasterMETSProfileFactory { Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-11-17 20:25:24 UTC (rev 871) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-11-17 20:37:38 UTC (rev 872) @@ -106,6 +106,7 @@ /** * Generic METS profile class + * @author thabing * @author Bill Ingram * */ Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDAugmenter.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDAugmenter.java 2009-11-17 20:25:24 UTC (rev 871) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/utils/jhove/TechMDAugmenter.java 2009-11-17 20:37:38 UTC (rev 872) @@ -78,6 +78,7 @@ * HaSMETSProfile. * * @author Bill Ingram + * @author Howard Ding * */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-11-17 20:25:39
|
Revision: 871 http://echodep.svn.sourceforge.net/echodep/?rev=871&view=rev Author: bill_ingram Date: 2009-11-17 20:25:24 +0000 (Tue, 17 Nov 2009) Log Message: ----------- Minor changes Modified Paths: -------------- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/HttpAuth.java trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DspaceAuth.java trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DSpaceService.java trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DspaceAuth.java trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraAuth.java trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraExport.java Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/HttpAuth.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/HttpAuth.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/HttpAuth.java 2009-11-17 20:25:24 UTC (rev 871) @@ -55,6 +55,7 @@ /** * Implementation of Auth to supply the functionality of collecting the username and password via HTTP Basic Auth * @author Matt Cordial + * @author Bill Ingram * @see edu.uiuc.ndiipp.hubandspoke.lrcrud.Auth * */ Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DspaceAuth.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DspaceAuth.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace/DspaceAuth.java 2009-11-17 20:25:24 UTC (rev 871) @@ -59,6 +59,7 @@ * Extension of HttpAuth to handle DSpace specific authentication. * * @author Matt Cordial + * @author Bill Ingram * */ public class DspaceAuth extends HttpAuth implements Auth { Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DSpaceService.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DSpaceService.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DSpaceService.java 2009-11-17 20:25:24 UTC (rev 871) @@ -103,6 +103,7 @@ * specific to DSpace * * @author Matt Cordial + * @author Bill Ingram */ public class DSpaceService extends edu.uiuc.ndiipp.hubandspoke.lrcrud.LrcrudService implements Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DspaceAuth.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DspaceAuth.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/dspace15/DspaceAuth.java 2009-11-17 20:25:24 UTC (rev 871) @@ -58,6 +58,7 @@ /** * Extension of HttpAuth to handle DSpace specific authentication. * @author Matt Cordial + * @author Bill Ingram * */ public class DspaceAuth extends HttpAuth implements Auth { Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraAuth.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraAuth.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraAuth.java 2009-11-17 20:25:24 UTC (rev 871) @@ -64,6 +64,7 @@ * authentication call. * * @author Jingjin Yu + * @author Bill Ingram * */ public class FedoraAuth extends HttpAuth { Modified: trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraExport.java =================================================================== --- trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraExport.java 2009-09-04 18:43:19 UTC (rev 870) +++ trunk/lrcrud/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/fedora/FedoraExport.java 2009-11-17 20:25:24 UTC (rev 871) @@ -90,8 +90,9 @@ * * As of now, the temporary files and the zip package are not automatically * removed after being requested. - * + * * @author Jingjin Yu + * @author Bill Ingram * */ public class FedoraExport { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-09-04 18:43:26
|
Revision: 870 http://echodep.svn.sourceforge.net/echodep/?rev=870&view=rev Author: bill_ingram Date: 2009-09-04 18:43:19 +0000 (Fri, 04 Sep 2009) Log Message: ----------- Minor adjustment in writing to manifest Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 18:37:28 UTC (rev 869) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 18:43:19 UTC (rev 870) @@ -139,7 +139,7 @@ } zos.closeEntry(); - manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + f.getName() + NL); + manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + "metadata" + File.separator + f.getName() + NL); } // add all the content files @@ -179,7 +179,7 @@ } zos.closeEntry(); - manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + f.getName() + NL); + manifest.append(summer.getHexEncodedSHA1() + " " + "data" + File.separator + "metadata" + File.separator + f.getName() + NL); // add manifest.txt to the zip bais = new ByteArrayInputStream(manifest.toString().getBytes("UTF-8")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-09-04 18:37:42
|
Revision: 869 http://echodep.svn.sourceforge.net/echodep/?rev=869&view=rev Author: bill_ingram Date: 2009-09-04 18:37:28 +0000 (Fri, 04 Sep 2009) Log Message: ----------- More logging Modified Paths: -------------- trunk/hubandspoke/config/log4j.properties trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java Modified: trunk/hubandspoke/config/log4j.properties =================================================================== --- trunk/hubandspoke/config/log4j.properties 2009-09-04 18:13:47 UTC (rev 868) +++ trunk/hubandspoke/config/log4j.properties 2009-09-04 18:37:28 UTC (rev 869) @@ -4,7 +4,7 @@ # It is edited automatically by the build script # so your changes may be overwritten. -log4j.rootLogger=DEBUG, rfa +log4j.rootLogger=DEBUG, rfa, ca log4j.logger.console=DEBUG, ca log4j.appender.ca=org.apache.log4j.ConsoleAppender Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java 2009-09-04 18:13:47 UTC (rev 868) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java 2009-09-04 18:37:28 UTC (rev 869) @@ -257,8 +257,10 @@ throws PackagerException { try { - log.info("Creating a Hub package from scratch"); + log.info("Creating a Hub package from scratch..."); + log.info("Creating METS files..."); + // since we're starting from scratch, clean up any old echodepmets files File m_file = new File(itemdir.getAbsolutePath() + File.separator + @@ -301,6 +303,7 @@ echodepmets.setLabelFromPrimaryDmdSec(); // add techMD + log.info("Adding technical metadata..."); TechMDAugmenter.addJhoveToProfile(echodepmets); // save echodepmets @@ -312,10 +315,12 @@ // save mastermets mm.save(mm_file.getAbsolutePath()); + log.info("Hub Package created!"); + return mm; } catch (HaSMETSProfileException e) { - throw new PackagerException("Problem creating Hub package" + throw new PackagerException("Problem creating Hub package: " + e.getMessage()); } } @@ -398,6 +403,7 @@ protected static void addPrimaryMetadata(File metadata, HaSMETSProfile echodepmets) throws PackagerException { + log.info("Adding primary metadata..."); ModsModsDocument mods; try { // load the MODS Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 18:13:47 UTC (rev 868) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 18:37:28 UTC (rev 869) @@ -88,6 +88,7 @@ */ public static void createBagitPackage(HaSMasterMETSProfile mastermets, String zip_path, String name) throws PackagerException { try { + logger.info("Creating Bagit Archive..."); File zipFile = new File(zip_path + ".zip"); if (zipFile.exists()) { zipFile.delete(); @@ -126,7 +127,7 @@ for (Mptr mptr : mastermets.getAllMptrs()) { File f = new File(mastermets.getBaseURI().resolve(mptr.getHref())); FileInputStream fis = new FileInputStream(f); - logger.info("Processing file: " + f.getName()); + logger.info("Reading file: " + f.getName()); ze = new ZipEntry(name + File.separator + "data" + File.separator + "metadata" + File.separator + f.getName()); zos.putNextEntry(ze); @@ -148,7 +149,7 @@ for (MetsFileType mft : echodepmets.getAllFiles()) { File f = new File(echodepmets.getBaseURI().resolve(mft.getFLocatArray(0).getHref())); FileInputStream fis = new FileInputStream(f); - logger.info("Processing file: " + f.getName()); + logger.info("Reading file: " + f.getName()); ze = new ZipEntry(name + File.separator + "data" + File.separator + f.getName()); zos.putNextEntry(ze); @@ -166,7 +167,7 @@ // finally add the mastermets file File f = new File(mastermets.getBaseURI()); FileInputStream fis = new FileInputStream(f); - logger.info("Processing file: " + f.getName()); + logger.info("Reading file: " + f.getName()); ze = new ZipEntry(name + File.separator + "data" + File.separator + "metadata" + File.separator + f.getName()); zos.putNextEntry(ze); @@ -199,6 +200,8 @@ zos.close(); fos.close(); + logger.info("Bagit creation complete! See " + zipFile.getAbsolutePath()); + } catch (IOException e) { e.printStackTrace(); throw new PackagerException(e.getMessage()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-09-04 18:14:00
|
Revision: 868 http://echodep.svn.sourceforge.net/echodep/?rev=868&view=rev Author: bill_ingram Date: 2009-09-04 18:13:47 +0000 (Fri, 04 Sep 2009) Log Message: ----------- Correctly configures Log4j properties Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java Property Changed: ---------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java 2009-09-04 17:11:26 UTC (rev 867) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java 2009-09-04 18:13:47 UTC (rev 868) @@ -1,9 +1,9 @@ /** * GenericPackager.java * - * $Revision: $ + * $Revision$ * - * $Date: $ + * $Date$ * * Copyright (c) 2009, University Library, University of Illinois at * Urbana-Champaign. All rights reserved. @@ -50,7 +50,7 @@ import java.util.zip.ZipFile; import org.apache.commons.cli.*; -import org.apache.log4j.Logger; +import org.apache.log4j.*; import org.apache.xmlbeans.XmlObject; import org.safehaus.uuid.UUID; import org.safehaus.uuid.UUIDGenerator; @@ -80,11 +80,14 @@ */ public class GenericPackager extends ToHubPackager { - private static Logger log = Logger.getLogger(GenericPackager.class.getName()); + private static Logger log = Logger.getLogger(GenericPackager.class); + private String logconfig = System.getenv("HS_HOME") + File.separator + + "config" + File.separator + "log4j.properties"; protected static Options opts = new Options(); public GenericPackager() { super(); + PropertyConfigurator.configure(logconfig); } /** Property changes on: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 17:11:26 UTC (rev 867) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 18:13:47 UTC (rev 868) @@ -59,7 +59,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; -import org.apache.log4j.Logger; +import org.apache.log4j.*; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfile; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileException; @@ -76,7 +76,7 @@ */ public class Hub2BagitPackager { - private static Logger logger = Logger.getLogger(Hub2BagitPackager.class.getName()); + private static Logger logger = Logger.getLogger(Hub2BagitPackager.class); /** * Takes an HandS Hub Package and creates a bagit archive This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-09-04 17:11:32
|
Revision: 867 http://echodep.svn.sourceforge.net/echodep/?rev=867&view=rev Author: bill_ingram Date: 2009-09-04 17:11:26 +0000 (Fri, 04 Sep 2009) Log Message: ----------- Updates SWORD libraries Added Paths: ----------- trunk/lib/sword-common-1.1.jar Removed Paths: ------------- trunk/lib/swordclient.jar trunk/lib/swordcommon.jar Added: trunk/lib/sword-common-1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/sword-common-1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/lib/swordclient.jar =================================================================== (Binary files differ) Deleted: trunk/lib/swordcommon.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-09-04 16:57:53
|
Revision: 866 http://echodep.svn.sourceforge.net/echodep/?rev=866&view=rev Author: bill_ingram Date: 2009-09-04 16:57:38 +0000 (Fri, 04 Sep 2009) Log Message: ----------- PackABag: Introduces a new packager, called the GenericPackager, which takes a directory of files and creates a Hub Packager. If a MODS file is declared, it will be used for descriptive metadata; if not, a minimal MODS will be created. The GenericPackager includes an optional argument for outputting the Package in Bagit format. Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfile.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java Added Paths: ----------- trunk/hubandspoke/bin/packabag trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java Added: trunk/hubandspoke/bin/packabag =================================================================== --- trunk/hubandspoke/bin/packabag (rev 0) +++ trunk/hubandspoke/bin/packabag 2009-09-04 16:57:38 UTC (rev 866) @@ -0,0 +1,19 @@ +#! /bin/sh + +cd .. +HS_HOME=`pwd` +export HS_HOME +CP=${HS_HOME}/build +for jar in $(ls ${HS_HOME}/lib/*.jar) +do + CP=$CP:$jar +done + + +SAVED_JAVA_OPTS=$JAVA_OPTS +JAVA_OPTS="-Xms64m -Xmx384m -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl" + + +java $JAVA_OPTS -classpath $CP edu.uiuc.ndiipp.hubandspoke.packager.GenericPackager "$@" + +export JAVA_OPTS=SAVED_JAVA_OPTS \ No newline at end of file Property changes on: trunk/hubandspoke/bin/packabag ___________________________________________________________________ Added: svn:executable + * Added: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java (rev 0) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/GenericPackager.java 2009-09-04 16:57:38 UTC (rev 866) @@ -0,0 +1,535 @@ +/** + * GenericPackager.java + * + * $Revision: $ + * + * $Date: $ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + +package edu.uiuc.ndiipp.hubandspoke.packager; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.logging.Level; +import java.util.zip.ZipFile; + +import org.apache.commons.cli.*; +import org.apache.log4j.Logger; +import org.apache.xmlbeans.XmlObject; +import org.safehaus.uuid.UUID; +import org.safehaus.uuid.UUIDGenerator; +import org.w3c.dom.Node; + +import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfile; +import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileException; +import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileFactory; +import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfile; +import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfileFactory; +import edu.uiuc.ndiipp.hubandspoke.profile.METSProfile.PackageType; +import edu.uiuc.ndiipp.hubandspoke.utils.HaSConstants; +import edu.uiuc.ndiipp.hubandspoke.utils.jhove.TechMDAugmenter; +import edu.uiuc.ndiipp.hubandspoke.packager.Hub2BagitPackager; +import gov.loc.mets.MetsFileType; +import gov.loc.mets.MetsMdSecType; +import gov.loc.mets.MetsDivType.Mptr; +import gov.loc.mods.ModsModsDocument; +import gov.loc.mods.ModsTitleInfoType; +import org.apache.xmlbeans.XmlString; + +/** + * Walks a supplied directory and creates an EchoDep Hub compliant information + * package from the contents. + * + * @author Bill Ingram + */ +public class GenericPackager extends ToHubPackager { + + private static Logger log = Logger.getLogger(GenericPackager.class.getName()); + protected static Options opts = new Options(); + + public GenericPackager() { + super(); + } + + /** + * Command line interface... + * + */ + public static void main(String[] args) { + try { + GenericPackager gp = new GenericPackager(); + CommandLine cmd = gp.buildCmdLine(args); + // automatically generate the help statement + HelpFormatter formatter = new HelpFormatter(); + + File itemdir; + File metadata; + + HaSMasterMETSProfile mm = null; + + // if the help flag is set or no parameters are supplied print help + if (cmd.getOptions().length == 0 || cmd.hasOption("h")) { + usage(formatter, opts, null); + return; + } + + if (cmd.hasOption("d")) { + itemdir = new File(cmd.getOptionValue("d")); + if (!itemdir.isDirectory()) { + usage(formatter, opts, itemdir.getAbsolutePath() + + " is not a directory. Please supply a directory"); + return; + } + } else { + usage(formatter, opts, "Directory(-d) is a required parameter."); + return; + } + + if (cmd.hasOption("m")) { + System.out.println(); + metadata = new File(cmd.getOptionValue("m")); + if (!metadata.isFile()) { + usage( + formatter, + opts, + metadata.getAbsolutePath() + + " is not a file. Please supply the path to the MODS metadata."); + return; + } + } else { + metadata = null; + } + + if (cmd.hasOption("i")) { + HaSMETSProfile.PREMISIdentifierType type; + if (cmd.hasOption("t")) { + String t = cmd.getOptionValue("t"); + if (t.equalsIgnoreCase("ark")) { + type = HaSMETSProfile.PREMISIdentifierType.ARK; + } else if (t.equalsIgnoreCase("urn")) { + type = HaSMETSProfile.PREMISIdentifierType.URN; + } else if (t.equalsIgnoreCase("url")) { + type = HaSMETSProfile.PREMISIdentifierType.URL; + } else if (t.equalsIgnoreCase("purl")) { + type = HaSMETSProfile.PREMISIdentifierType.PURL; + } else if (t.equalsIgnoreCase("handle")) { + type = HaSMETSProfile.PREMISIdentifierType.HANDLE; + } else if (t.equalsIgnoreCase("doi")) { + type = HaSMETSProfile.PREMISIdentifierType.DOI; + } else { + type = HaSMETSProfile.PREMISIdentifierType.LOCAL; + } + } else { + type = HaSMETSProfile.PREMISIdentifierType.LOCAL; + } + + mm = gp.createHubPackage(itemdir, metadata, cmd.getOptionValue("i"), type); + + } else { + mm = gp.createHubPackage(itemdir, metadata); + } + + if (cmd.hasOption("b")) { + System.out.println(); + + Hub2BagitPackager.createBagitPackage(mm, itemdir.getAbsolutePath(), + itemdir.getName()); + } + + + } catch (ParseException e) { + System.err + .println("Whoops! There was a problem interpereting your input: " + + e.getMessage()); + } catch (PackagerException e) { + System.err + .println("Whoops! There was a problem creating the Hub Package: " + + e.getMessage()); + } + } + + @SuppressWarnings("static-access") + protected CommandLine buildCmdLine(String[] args) throws ParseException { + + Option dir = OptionBuilder + .withArgName("directory") + .hasArg() + .withDescription( + "REQUIRED - directory containing the files from which to create Hub package") + .create("d"); + + Option meta = OptionBuilder + .withArgName("file") + .hasArg() + .withDescription( + "OPTIONAL - file containing the Aquifer MODS metadata describing the item being packaged. If not supplied, a minimal MODS will be created.") + .create("m"); + + Option id = OptionBuilder + .withArgName("id") + .hasArg() + .withDescription( + "OPTIONAL - Identifier of the item. If not supplied, a UUID will be created for the item.") + .create("i"); + + Option idtype = OptionBuilder + .withArgName("idtype") + .hasArg() + .withDescription( + "OPTIONAL - Indicator of which identifier scheme is used. Recognized values are: LOCAL, ARK, URN, URL, PURL, HANDLE, DOI.") + .create("t"); + + Option bagit = OptionBuilder + .withArgName("bagit") + .hasArg(false) + .withDescription( + "OPTIONAL - Save package in Bagit format?") + .create("b"); + + opts.addOption(dir); + opts.addOption(meta); + opts.addOption(id); + opts.addOption(idtype); + opts.addOption(bagit); + opts.addOption("h", "help", false, "prints this help list"); + + CommandLineParser parser = new PosixParser(); + return parser.parse(opts, args); + } + + /** + * Creates the Hub package from scratch + * + * @param itemdir + * -- File representing the path to the items + * @param metadata + * -- File representing the path to the MODS metadata for the + * item + * @param id + * -- Identifier of the item. If not supplied, a UUID will be + * created for the item. + * @param idtype + * -- Indicator of which identifier scheme is used. + * @return HaSMasterMETSProfile object + * @throws PackagerException + */ + public HaSMasterMETSProfile createHubPackage(File itemdir, File metadata, + String id, HaSMETSProfile.PREMISIdentifierType idtype) + throws PackagerException { + try { + + log.info("Creating a Hub package from scratch"); + + // since we're starting from scratch, clean up any old echodepmets files + File m_file = new File(itemdir.getAbsolutePath() + + File.separator + + HaSConstants.METS_FILE_NAME_PREFIX + "0.xml"); + + File mm_file = new File(itemdir.getAbsolutePath() + + File.separator + + HaSConstants.MASTER_METS_FILE_NAME); + + if (m_file.exists()) m_file.delete(); + if (mm_file.exists()) mm_file.delete(); + + // create a new HaSMasterMETSProfile instance + HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance(); + + // create a new HaSMETSProfile instance + HaSMETSProfile echodepmets = HaSMETSProfileFactory + .newHaSMETSProfile(HaSMETSProfile.PackageType.SIP); + + // set the base URI on the objects + echodepmets.setBaseURI(m_file.toURI()); + + // set the id + setOBJID(id, idtype, echodepmets); + + // add the MODS as the primary DMD + if (metadata != null) { + addPrimaryMetadata(metadata, echodepmets); + } else { + setTitle("Generic Hub and Spoke Package", echodepmets); + } + + // make the metadata conform + echodepmets.convertPrimaryDmdSecToAquifer(); + + // create the new FileSec + createFileSec(itemdir, echodepmets); + + // extract a Label for the METS file from the MODS title element + echodepmets.setLabelFromPrimaryDmdSec(); + + // add techMD + TechMDAugmenter.addJhoveToProfile(echodepmets); + + // save echodepmets + echodepmets.save(); + + // save and add to mastermets + mm.addMptr(echodepmets.getBaseURI()); + + // save mastermets + mm.save(mm_file.getAbsolutePath()); + + return mm; + + } catch (HaSMETSProfileException e) { + throw new PackagerException("Problem creating Hub package" + + e.getMessage()); + } + } + + /** + * Overload to allow internal generation of an identifier + * + * @param itemdir + * -- File representing the path to the items + * @param metadata + * -- File representing the path to the MODS metadata for the + * item + * @return - HaSMasterMETSProfile object + * @throws PackagerException + */ + public HaSMasterMETSProfile createHubPackage(File itemdir, File metadata) + throws PackagerException { + return createHubPackage(itemdir, metadata, null, null); + } + + /** + * Builds the FileSec from the supplied directry. + * + * @param dir + * -- directory containing the items + * @param echodepmets + * -- HaSMETSProfile to put the FileSec into + * @throws HaSMETSProfileException + */ + protected void createFileSec(File dir, HaSMETSProfile echodepmets) + throws HaSMETSProfileException { + log.info("Creating a new FileSec"); + + File[] contents = dir.listFiles(); + + for (int i = 0; i < contents.length; i++) { + File file = contents[i]; + if (file.isDirectory()) { + if (!containsMETS(file, HaSConstants.METS_FILE_NAME)) { + createFileSec(file, echodepmets); + } + } else { + // add the file to the HaSProfile + log.info("Adding " + file.getName() + " to METS."); + MetsFileType echodepfile = echodepmets.addFile(file); + echodepmets.getPrimaryStructMap().getDiv().addNewFptr() + .setFILEID(echodepfile.getID()); + } + + } + } + + /** + * Prints hints on how to use the program from the command line. + * + * @param formatter + * -- CommonsCLI help formatter + * @param opts + * -- CommonsCLI options + * @param message + * -- what you want to tell the user + */ + protected static void usage(HelpFormatter formatter, Options opts, + String message) { + if (message != null) { + System.out.println(message); + } + formatter.printHelp("packager", opts); + } + + /** + * Replaces the boilerplate MODS created by the constructor with the + * supplied MODS and sets it as the primary metadata. + * + * @param metadata + * -- Aquifer MODS metadata for the item + * @param echodepmets + * @throws PackagerException + */ + protected static void addPrimaryMetadata(File metadata, + HaSMETSProfile echodepmets) throws PackagerException { + + ModsModsDocument mods; + try { + // load the MODS + mods = ModsModsDocument.Factory.parse(metadata); + // remove the xmlData section and replace it with the extracted + // dspace MODS + Node xmlData = echodepmets.getMetsDocument().getMets() + .getDmdSecArray()[0].getMdWrap().getXmlData().getDomNode(); + xmlData.removeChild(xmlData.getFirstChild()); + Node mod = xmlData.getOwnerDocument().importNode( + mods.getMods().getDomNode(), true); + xmlData.appendChild(mod); + } catch (Exception e) { + throw new PackagerException("Problem creating Hub package" + + e.getMessage()); + } + + } + + + /** + * Sets the title of the HaSMETSProfile - to be used *only* when there + * is no metadata. + * + * @param title + * @param echodepmets + * @throws PackagerException + * + */ + protected void setTitle(String title, HaSMETSProfile echodepmets) + throws PackagerException{ + if (title == null) return; + try { + MetsMdSecType priDMD = echodepmets.getPrimaryDmdSec(); + ModsModsDocument mods = (ModsModsDocument) echodepmets.getMDSecXmlObject(priDMD); + + mods.getMods().getTitleInfoArray(0).removeTitle(0); + XmlString tt = mods.getMods().getTitleInfoArray(0).insertNewTitle(0); + tt.setStringValue(title); + + // remove the xmlData section and replace it with the fixed MODS + Node xmlData = echodepmets.getMetsDocument().getMets() + .getDmdSecArray()[0].getMdWrap().getXmlData().getDomNode(); + xmlData.removeChild(xmlData.getFirstChild()); + Node mod = xmlData.getOwnerDocument().importNode( + mods.getMods().getDomNode(), true); + xmlData.appendChild(mod); + + } catch (HaSMETSProfileException e) { + throw new PackagerException("Problem creating Hub package" + + e.getMessage()); + } + + } + + /** + * Sets the OBJID of the HaSMETSProfile and cleans up some of the + * boilerplate created by the constructor. + * + * @param id + * -- Identifier of the item. If not supplied, a UUID will be + * created for the item. + * @param type + * -- Indicator of which identifier scheme is used. + * @param echodepmets + * @throws PackagerException + */ + protected String setOBJID(String id, + HaSMETSProfile.PREMISIdentifierType type, HaSMETSProfile echodepmets) + throws PackagerException { + try { + + if (id == null) { + UUID uuid = UUIDGenerator.getInstance() + .generateRandomBasedUUID(); + id = uuid.toString(); + type = HaSMETSProfile.PREMISIdentifierType.LOCAL; + } + + echodepmets.setNewPrimaryID(id, type); + + // remove the boilerplate ID values + XmlObject objs[] = echodepmets.getMetsDocument().selectPath( + "declare namespace m='" + HaSMETSProfile.METS_NS + + "'; //m:altRecordID[.='[IDENTIFIER]']"); + + for (int i = 0; i < objs.length; i++) { + XmlObject object = objs[i]; + object.getDomNode().getParentNode().removeChild( + object.getDomNode()); + } + + MetsMdSecType prim = echodepmets.getPrimaryRepresentation(); + XmlObject idents[] = prim + .selectPath("declare namespace p='" + + HaSMETSProfile.PREMIS_NS + + "'; //p:objectIdentifier[p:objectIdentifierValue[.='[IDENTIFIER]']]"); + for (int i = 0; i < idents.length; i++) { + XmlObject ident = idents[i]; + ident.getDomNode().getParentNode().removeChild( + ident.getDomNode()); + } + return id; + + } catch (Exception e) { + throw new PackagerException( + "Problem setting the OBJID of the echodepmets.xml file" + + e.getMessage()); + } + + } + + /** + * Checks to see if the named METS file exists in a particular location. + * + * @param dir + * @param metsname + * @return true if found false otherwise + */ + protected static boolean containsMETS(File dir, String metsname) { + File mets = new File(dir.getAbsolutePath() + File.separatorChar + + metsname); + if (mets.exists()) { + return true; + } else { + return false; + } + + } + + @Override + public boolean createHubPackage(ZipFile zip, String unzippath, + String hubpath) throws PackagerException, HaSMETSProfileException { + // for now this is not implemented...because this class should go away. + return false; + } + +} Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-07-16 18:24:38 UTC (rev 865) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2BagitPackager.java 2009-09-04 16:57:38 UTC (rev 866) @@ -76,7 +76,7 @@ */ public class Hub2BagitPackager { - private static Logger logger = Logger.getLogger("bagit"); + private static Logger logger = Logger.getLogger(Hub2BagitPackager.class.getName()); /** * Takes an HandS Hub Package and creates a bagit archive @@ -128,7 +128,7 @@ FileInputStream fis = new FileInputStream(f); logger.info("Processing file: " + f.getName()); - ze = new ZipEntry(name + File.separator + "data" + File.separator + f.getName()); + ze = new ZipEntry(name + File.separator + "data" + File.separator + "metadata" + File.separator + f.getName()); zos.putNextEntry(ze); len = 0; @@ -168,7 +168,7 @@ FileInputStream fis = new FileInputStream(f); logger.info("Processing file: " + f.getName()); - ze = new ZipEntry(name + File.separator + "data" + File.separator + f.getName()); + ze = new ZipEntry(name + File.separator + "data" + File.separator + "metadata" + File.separator + f.getName()); zos.putNextEntry(ze); len = 0; @@ -194,60 +194,6 @@ } zos.closeEntry(); - // set up calendar - Calendar lastModified = Calendar.getInstance(); - // lastModified.setTimeInMillis(d.lastModified()); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - - // add "package-info.txt" to the zip - StringBuffer pinfo = new StringBuffer(); - - pinfo.append("Source-Organization: Grainger Engineering Library Information Center, University of Illinois, Urbana-Champaign"); - pinfo.append(NL); - pinfo.append("Organization-Address: 1301 W. Springfield Ave, Urbana, IL 61801"); - pinfo.append(NL); - pinfo.append("Contact-Name: Bill Ingram"); - pinfo.append(NL); - pinfo.append("Contact-Phone: +1 217-244-7809"); - pinfo.append(NL); - pinfo.append("Contact-Email: win...@ui..."); - pinfo.append(NL); - pinfo.append("External-Description: \"" + title - + "\" -- digital preservation package exported via the ECHO DEPository Project Hub and Spoke Tool Suite"); - pinfo.append(NL); - pinfo.append("Packing-Date: " + sdf.format(lastModified.getTime())); - pinfo.append(NL); - pinfo.append("External-Identifier: " + name); - pinfo.append(NL); - pinfo.append("Package-Size: {pack-size} MB"); - pinfo.append(NL); - - String pinfo_str = pinfo.toString(); - - bais = new ByteArrayInputStream(pinfo_str.getBytes("UTF-8")); - - // get the size - buf = new byte[1024 * 4]; - len = 0; - while ((len = bais.read(buf)) > 0) { - packagesize += len; - } - - packagesize = Math.round(((packagesize) / 1048576.0) * 1000.0) / 1000.0; - - pinfo_str = pinfo_str.replace("{pack-size}", Double.toString(packagesize)); - bais = new ByteArrayInputStream(pinfo_str.getBytes("UTF-8")); - - ze = new ZipEntry(name + File.separator + "package-info.txt"); - zos.putNextEntry(ze); - - buf = new byte[1024 * 4]; - len = 0; - while ((len = bais.read(buf)) > 0) { - zos.write(buf, 0, len); - } - zos.closeEntry(); - // clean up chkStrm.close(); zos.close(); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfile.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfile.java 2009-07-16 18:24:38 UTC (rev 865) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMETSProfile.java 2009-09-04 16:57:38 UTC (rev 866) @@ -346,6 +346,7 @@ ModsLanguageType langT = recInfo.addNewLanguageOfCataloging(); ModsLanguageType.LanguageTerm langTerm = langT.addNewLanguageTerm(); langTerm.setAuthority(ModsLanguageType.LanguageTerm.Authority.RFC_3066); + langTerm.setType(ModsCodeOrText.CODE); langTerm.setStringValue("en"); ModsUrlType murl = mloc.addNewUrl(); murl.setStringValue(location); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-07-16 18:24:38 UTC (rev 865) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-09-04 16:57:38 UTC (rev 866) @@ -1136,7 +1136,7 @@ // if file has FLocat children, add their href attributes as identifiers MetsFileType.FLocat flocat[] = ft.getFLocatArray(); - for (int k = 0; k < flocat.length; k++) { + for (int k = 1; k < flocat.length; k++) { PremisObjectDocument.Object.ObjectIdentifier pObjId2 = pObj .addNewObjectIdentifier(); pObjId2.setObjectIdentifierValue(flocat[k].getHref()); @@ -1319,6 +1319,7 @@ } sha1 = summer.getHexEncodedSHA1(); md5 = summer.getHexEncodedMD5(); + baseURI = f.toURI(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-07-16 18:24:49
|
Revision: 865 http://echodep.svn.sourceforge.net/echodep/?rev=865&view=rev Author: bill_ingram Date: 2009-07-16 18:24:38 +0000 (Thu, 16 Jul 2009) Log Message: ----------- Changes made to work with the new version of SWORD (1.1) Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/SWORDUtils.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/SWORDUtils.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/SWORDUtils.java 2009-07-16 17:51:47 UTC (rev 864) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/SWORDUtils.java 2009-07-16 18:24:38 UTC (rev 865) @@ -48,13 +48,13 @@ import org.purl.sword.base.Service; import org.purl.sword.base.ServiceDocument; import org.purl.sword.base.Workspace; -import org.w3.atom.Author; -import org.w3.atom.Content; -import org.w3.atom.Contributor; -import org.w3.atom.Generator; -import org.w3.atom.Link; -import org.w3.atom.Source; -import org.w3.atom.TextConstruct; +import org.purl.sword.atom.Author; +import org.purl.sword.atom.Content; +import org.purl.sword.atom.Contributor; +import org.purl.sword.atom.Generator; +import org.purl.sword.atom.Link; +import org.purl.sword.atom.Source; +import org.purl.sword.atom.TextConstruct; /** @@ -182,7 +182,7 @@ buffer.append("<table border=\"1\" width=\"100%\">"); buffer.append("<tr bgcolor=\"#69a5c8;\"><td colspan=\"2\"><font size=\"+2\">Service Summary</font></td></tr>"); - addTableRow(buffer, "Service Level", service.getComplianceLevel()); + addTableRow(buffer, "SWORD Version", service.getVersion()); addTableRow(buffer, "NoOp Support ", service.isNoOp()); addTableRow(buffer, "Verbose Support ", service.isVerbose()); @@ -249,9 +249,9 @@ addTableRow(buffer, "Collection title", collection.getTitle()); addTableRow(buffer, "Abstract", collection.getAbstract()); addTableRow(buffer, "Collection Policy", collection.getCollectionPolicy()); - addTableRow(buffer, "Namespace", collection.getFormatNamespace()); addTableRow(buffer, "Treatment", collection.getTreatment()); addTableRow(buffer, "Mediation", collection.getMediation()); + addTableRow(buffer, "Nested Service Document", collection.getService()); String[] accepts = collection.getAccepts(); @@ -353,28 +353,21 @@ addTableRow(buffer, "Contributors", contributorString.toString()); // process source - Source source = entry.getSource(); - String sourceString = ""; - if( source != null ) + String sourceString=""; + Generator generator = entry.getGenerator(); + if( generator != null ) { - Generator generator = source.getGenerator(); - if( generator != null ) - { - sourceString += "Content: '" + generator.getContent() + "' <br>'"; - sourceString += "Version: '" + generator.getVersion() + "' <br>'"; - sourceString += "Uri: '" + generator.getUri() + "' <br>'"; - } - else - { - sourceString += "No generator defined."; - } + sourceString += "Content: '" + generator.getContent() + "' <br>'"; + sourceString += "Version: '" + generator.getVersion() + "' <br>'"; + sourceString += "Uri: '" + generator.getUri() + "'"; } else { - sourceString = "Not defined"; + sourceString += "No generator defined."; } - addTableRow(buffer, "Source", sourceString); + addTableRow(buffer, "Generator", sourceString); + // process treatment addTableRow(buffer, "Treatment", entry.getTreatment()); @@ -385,9 +378,12 @@ addTableRow(buffer, "NoOp", entry.isNoOp()); // process formatNamespace - addTableRow(buffer, "Format Namespace", entry.getFormatNamespace()); + addTableRow(buffer, "Packaging", entry.getPackaging()); + // process userAgent + addTableRow(buffer, "User Agent", entry.getUserAgent()); + buffer.append("</table>"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-07-16 17:52:06
|
Revision: 864 http://echodep.svn.sourceforge.net/echodep/?rev=864&view=rev Author: bill_ingram Date: 2009-07-16 17:51:47 +0000 (Thu, 16 Jul 2009) Log Message: ----------- Sword packaging namespace for METS changed. Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form 2009-06-17 18:10:23 UTC (rev 863) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form 2009-07-16 17:51:47 UTC (rev 864) @@ -290,7 +290,7 @@ <Component id="getBagitLabel" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="getHandleTextField" alignment="0" min="-2" pref="203" max="-2" attributes="0"/> </Group> - <EmptySpace pref="28" max="32767" attributes="0"/> + <EmptySpace pref="27" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -342,7 +342,7 @@ <Component id="getCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="getSubmitButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="132" max="32767" attributes="0"/> + <EmptySpace pref="82" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -511,7 +511,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane2" alignment="0" pref="369" max="32767" attributes="0"/> + <Component id="jScrollPane2" alignment="0" pref="362" max="32767" attributes="0"/> <Component id="getLogLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -524,7 +524,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="getLogLabel" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane2" pref="528" max="32767" attributes="0"/> + <Component id="jScrollPane2" pref="519" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -873,7 +873,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" pref="370" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" pref="362" max="32767" attributes="0"/> <Component id="putLogLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -886,7 +886,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="putLogLabel" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane1" pref="530" max="32767" attributes="0"/> + <Component id="jScrollPane1" pref="519" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1091,7 +1091,7 @@ <Component id="migrateCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="migrateSubmitButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="35" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1311,7 +1311,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane3" alignment="0" pref="369" max="32767" attributes="0"/> + <Component id="jScrollPane3" alignment="0" pref="362" max="32767" attributes="0"/> <Component id="migrateLogLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -1324,7 +1324,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="migrateLogLabel" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane3" pref="528" max="32767" attributes="0"/> + <Component id="jScrollPane3" pref="519" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1403,7 +1403,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="swordServiceTreeScrollPane" alignment="0" pref="279" max="32767" attributes="0"/> + <Component id="swordServiceTreeScrollPane" alignment="0" pref="276" max="32767" attributes="0"/> <Component id="swordGetServiceDocButton" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -1416,7 +1416,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="swordGetServiceDocButton" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="swordServiceTreeScrollPane" pref="146" max="32767" attributes="0"/> + <Component id="swordServiceTreeScrollPane" pref="141" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1470,7 +1470,7 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="swordServiceEditorScrollPane" pref="175" max="32767" attributes="0"/> + <Component id="swordServiceEditorScrollPane" pref="176" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> @@ -1567,23 +1567,18 @@ <EmptySpace max="-2" attributes="0"/> <Component id="swordSubmitButton" min="-2" max="-2" attributes="0"/> </Group> - <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="swordCollectionLocationComboBox" alignment="0" pref="366" max="32767" attributes="1"/> - <Group type="102" alignment="1" attributes="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="swordPackageSourceLabel" min="-2" max="-2" attributes="0"/> - <Component id="swordPackageSourceTextField" pref="281" max="32767" attributes="1"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="swordPackageSourceBrowseButton" min="-2" max="-2" attributes="1"/> - </Group> + <Component id="swordCollectionLocationComboBox" alignment="0" pref="366" max="32767" attributes="1"/> + <Group type="102" alignment="1" attributes="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="swordPackageSourceLabel" min="-2" max="-2" attributes="0"/> + <Component id="swordPackageSourceTextField" pref="281" max="32767" attributes="1"/> </Group> <EmptySpace max="-2" attributes="0"/> + <Component id="swordPackageSourceBrowseButton" min="-2" max="-2" attributes="1"/> </Group> </Group> </Group> - <EmptySpace pref="24" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1639,7 +1634,7 @@ <Component id="swordCancelButton" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="swordSubmitButton" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="56" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -1824,7 +1819,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane4" alignment="0" pref="366" max="32767" attributes="0"/> + <Component id="jScrollPane4" alignment="0" pref="362" max="32767" attributes="0"/> <Component id="swordLogLabel" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> @@ -1837,7 +1832,7 @@ <EmptySpace max="-2" attributes="0"/> <Component id="swordLogLabel" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane4" pref="322" max="32767" attributes="0"/> + <Component id="jScrollPane4" pref="313" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/> </Group> </Group> Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-06-17 18:10:23 UTC (rev 863) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-07-16 17:51:47 UTC (rev 864) @@ -130,7 +130,7 @@ private static final long serialVersionUID = 1L; static Logger logger = Logger.getLogger(WorkflowManagerGUI.class); - private String logconfig = System.getenv("HS_HOME") + File.separator + + private String logconfig = "/home/wingram2/NetBeansProjects/hands-source/hubandspoke" + File.separator + "config" + File.separator + "log4j.properties"; private File tempdir; private Client sword = null; @@ -3001,7 +3001,7 @@ PostMessage pm = new PostMessage(); pm.setDestination(location); pm.setFiletype("application/zip"); - pm.setFormatNamespace("http://www.loc.gov/METS"); + pm.setFormatNamespace("http://purl.org/net/sword-types/METSDSpaceSIP"); if (swordMD5CheckBox.isSelected()) { pm.setUseMD5(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-06-17 18:11:30
|
Revision: 863 http://echodep.svn.sourceforge.net/echodep/?rev=863&view=rev Author: bill_ingram Date: 2009-06-17 18:10:23 +0000 (Wed, 17 Jun 2009) Log Message: ----------- Exception handling: Changed the packagers so that they will throw exceptions if they are caught within (i.e., they will relay the exception). Ditto for for the PackageDissemination and PackageSubmission workers. Now, the only class that actually catches an exception and deals with it is the WorkflowManger. That way, the queue of packages to be disseminated/submitted is not interuppted by a packager exception -- it will still go on to the next package. Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2DspacePackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2SwordPackager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageSubmission.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManager.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackager.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/FromHubPackager.java 2009-06-17 18:10:23 UTC (rev 863) @@ -65,7 +65,7 @@ echodepmets = mastermets.getMostRecentEchoDepMETS(); } catch (HaSMETSProfileException e1) { e1.printStackTrace(); - throw new PackagerException("Error retrieving most recent echodep mets from mastermets."); + throw new PackagerException("Cannot add files to zip. Error retrieving most recent echodep mets from mastermets."); } MetsFileType[] files = echodepmets.getAllFiles(); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2DspacePackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2DspacePackager.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2DspacePackager.java 2009-06-17 18:10:23 UTC (rev 863) @@ -250,8 +250,9 @@ log.error("Output directory not found."); throw new PackagerException("Output directory not found.", e); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); + log.error("IO Error in create repository package."); + throw new PackagerException("IO Error in create repository package.", e); } addFilesToZip(mastermets, zip); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-06-17 18:10:23 UTC (rev 863) @@ -144,8 +144,9 @@ log.error("Output directory not found."); throw new PackagerException("Output directory not found.", e); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); + log.error("IO Error in create repository package."); + throw new PackagerException("IO Error in create repository package.", e); } addFilesToZip(mastermets, zip); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2SwordPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2SwordPackager.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2SwordPackager.java 2009-06-17 18:10:23 UTC (rev 863) @@ -137,8 +137,9 @@ log.error("Output directory not found."); throw new PackagerException("Output directory not found.", e); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); + log.error("IO Error in create repository package."); + throw new PackagerException("IO Error in create repository package.", e); } addFilesToZip(mastermets, zip); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java 2009-06-17 18:10:23 UTC (rev 863) @@ -117,116 +117,105 @@ */ public String disseminatePackage(LrcrudClient crud_client, String item_id, String diss_dest, String packager_class_name, boolean overwrite, - boolean bagit) throws LrcrudClientException { - try { - item_id = item_id.trim(); - logger.info("Retrieving package " + item_id); - RetrieveResponse rr = crud_client.retrieve(item_id); + boolean bagit) throws LrcrudClientException, IOException, + PackagerException, HaSMETSProfileException { - logger.info("Saving export zip file"); - String fixed_item_id = item_id; - fixed_item_id = fixed_item_id.replaceAll("/", "_"); - fixed_item_id = fixed_item_id.replaceAll(":", "_"); + item_id = item_id.trim(); + logger.info("Retrieving package " + item_id); + RetrieveResponse rr = crud_client.retrieve(item_id); - File dest_dir = new File(diss_dest + File.separator + fixed_item_id); - logger.info("Creating destination directory: " + dest_dir. - getAbsolutePath()); + logger.info("Saving export zip file"); + String fixed_item_id = item_id; + fixed_item_id = fixed_item_id.replaceAll("/", "_"); + fixed_item_id = fixed_item_id.replaceAll(":", "_"); - if (dest_dir.exists() && !overwrite) { - boolean good_answer = false; - while (!good_answer) { - logger.warn( - "Directory already exists. Replace it? yes / no / yes for all (y/n/a)"); - BufferedReader cin = new BufferedReader( - new InputStreamReader(System.in)); - String ans = cin.readLine().toLowerCase(); - if (ans.startsWith("n")) { - good_answer = true; - logger.info("Package '" + item_id + "' was skipped\r\n"); - return null; + File dest_dir = new File(diss_dest + File.separator + fixed_item_id); + logger.info("Creating destination directory: " + dest_dir. + getAbsolutePath()); + + if (dest_dir.exists() && !overwrite) { + boolean good_answer = false; + while (!good_answer) { + logger.warn( + "Directory already exists. Replace it? yes / no / yes for all (y/n/a)"); + BufferedReader cin = new BufferedReader( + new InputStreamReader(System.in)); + String ans = cin.readLine().toLowerCase(); + if (ans.startsWith("n")) { + good_answer = true; + logger.info("Package '" + item_id + "' was skipped\r\n"); + return null; + } + if (ans.startsWith("a")) { + good_answer = true; + overwrite = true; + HaSFileUtils.deleteDirectory(dest_dir); + } + if (ans.startsWith("y")) { + good_answer = true; + if (!HaSFileUtils.deleteDirectory(dest_dir)) { + logger.error("Delete failed!"); } - if (ans.startsWith("a")) { - good_answer = true; - overwrite = true; - HaSFileUtils.deleteDirectory(dest_dir); - } - if (ans.startsWith("y")) { - good_answer = true; - if (!HaSFileUtils.deleteDirectory(dest_dir)) { - logger.error("Delete failed!"); - } - } } } - if (dest_dir.exists() && overwrite) { - if (!HaSFileUtils.deleteDirectory(dest_dir)) { - logger.error("Directory overwrite failed for " + dest_dir. - getAbsolutePath()); - } - } - boolean made = dest_dir.mkdirs(); - if (!made) { - logger.error("Error creating directory at " + dest_dir. + } + if (dest_dir.exists() && overwrite) { + if (!HaSFileUtils.deleteDirectory(dest_dir)) { + logger.error("Directory overwrite failed for " + dest_dir. getAbsolutePath()); - logger.info("Package '" + item_id + "' was skipped\r\n"); - return null; } + } + boolean made = dest_dir.mkdirs(); + if (!made) { + logger.error("Error creating directory at " + dest_dir. + getAbsolutePath()); + logger.info("Package '" + item_id + "' was skipped\r\n"); + return null; + } - File zip_loc = - new File(dest_dir.getAbsolutePath() + File.separator + - fixed_item_id + ".zip"); - rr.save(zip_loc.getAbsolutePath()); - ZipFile zip = new ZipFile(zip_loc.getAbsolutePath()); + File zip_loc = + new File(dest_dir.getAbsolutePath() + File.separator + + fixed_item_id + ".zip"); + rr.save(zip_loc.getAbsolutePath()); + ZipFile zip = new ZipFile(zip_loc.getAbsolutePath()); - logger.info("Creating Packager"); - ToHubPackagerFactory tpf = new ToHubPackagerFactory(); - ToHubPackager packager = - tpf.createToHubPackager(packager_class_name); + logger.info("Creating Packager"); + ToHubPackagerFactory tpf = new ToHubPackagerFactory(); + ToHubPackager packager = + tpf.createToHubPackager(packager_class_name); - logger.info("Packaging files"); - boolean ok = packager.createHubPackage(zip, - dest_dir.getAbsolutePath(), null); + logger.info("Packaging files"); + boolean ok = packager.createHubPackage(zip, + dest_dir.getAbsolutePath(), null); - logger.info("Deleting temporary files"); - zip.close(); - boolean success = zip_loc.delete(); - if (!success) { - logger.warn("Delete failed!"); - } + logger.info("Deleting temporary files"); + zip.close(); + boolean success = zip_loc.delete(); + if (!success) { + logger.warn("Delete failed!"); + } - if (ok) { - if (bagit) { - logger.info("Creating Bagit archive"); - HaSMasterMETSProfile mastermets = - HaSMasterMETSProfileFactory.newInstance(new File(dest_dir.getPath() + File.separator + - HaSConstants.MASTER_METS_FILE_NAME)); + if (ok) { + if (bagit) { + logger.info("Creating Bagit archive"); + HaSMasterMETSProfile mastermets = + HaSMasterMETSProfileFactory.newInstance(new File(dest_dir.getPath() + File.separator + + HaSConstants.MASTER_METS_FILE_NAME)); - logger.info("Generating JHOVE metadata"); - HaSMETSProfile echodepmets = mastermets. - getMostRecentEchoDepMETS(); - TechMDAugmenter.addJhoveToProfile(echodepmets); - Hub2BagitPackager.createBagitPackage(mastermets, dest_dir. - getAbsolutePath(), - dest_dir.getName()); - } + logger.info("Generating JHOVE metadata"); + HaSMETSProfile echodepmets = + mastermets.getMostRecentEchoDepMETS(); + TechMDAugmenter.addJhoveToProfile(echodepmets); + Hub2BagitPackager.createBagitPackage(mastermets, dest_dir. + getAbsolutePath(), + dest_dir.getName()); } - logger.info("Done!\r\n"); - - return dest_dir.getPath() + File.separator + - HaSConstants.MASTER_METS_FILE_NAME; - - } catch (IOException e) { - logger.error(e); - e.printStackTrace(); - } catch (PackagerException e) { - logger.error(e); - e.printStackTrace(); - } catch (HaSMETSProfileException e) { - logger.error(e); - e.printStackTrace(); } + logger.info("Done!\r\n"); - return null; + return dest_dir.getPath() + File.separator + + HaSConstants.MASTER_METS_FILE_NAME; + } } Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageSubmission.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageSubmission.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageSubmission.java 2009-06-17 18:10:23 UTC (rev 863) @@ -44,12 +44,6 @@ package edu.uiuc.ndiipp.hubandspoke.workflow; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.zip.ZipFile; import org.apache.log4j.Logger; @@ -62,14 +56,11 @@ import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfile; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileException; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfile; -import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfileFactory; -import edu.uiuc.ndiipp.hubandspoke.utils.HaSConstants; -import edu.uiuc.ndiipp.hubandspoke.utils.HaSFileUtils; import edu.uiuc.ndiipp.hubandspoke.utils.jhove.TechMDAugmenter; import org.purl.sword.base.DepositResponse; -import org.purl.sword.base.SWORDEntry; import org.purl.sword.client.Client; import org.purl.sword.client.PostMessage; +import org.purl.sword.client.SWORDClientException; import org.purl.sword.client.Status; /** @@ -114,167 +105,149 @@ * Augments profile with JHOVE generated TechMD, creates repository package * zip file, and submits package to the repository. * - * @param mets_path - * -- absolute path to an EchoDep METS file + * @param mastermets + * -- absolute path to an EchoDep Master METS file * @param crud_client * -- Lrcrud client * @param handle * -- location within the repository * @param zip_dest * -- local destination directory for zipfile + * @param packager_class_name + * @param keep_zips + * @throws PackagerException + * @throws HaSMETSProfileException + * @throws LrcrudClientException */ public void submitPackage(HaSMasterMETSProfile mastermets, LrcrudClient crud_client, String handle, String zip_dest, String packager_class_name, - boolean keep_zips) { + boolean keep_zips) throws PackagerException, HaSMETSProfileException, + LrcrudClientException { - try { + // logger.info("Creating repository package"); + FromHubPackagerFactory fpf = new FromHubPackagerFactory(); + FromHubPackager packager = fpf.createFromHubPackager( + packager_class_name); - // logger.info("Creating repository package"); - FromHubPackagerFactory fpf = new FromHubPackagerFactory(); - FromHubPackager packager = fpf.createFromHubPackager( - packager_class_name); + logger.info("Generating JHOVE metadata"); + HaSMETSProfile echodepmets = mastermets.getMostRecentEchoDepMETS(); + if (TechMDAugmenter.addJhoveToProfile(echodepmets)) { - logger.info("Generating JHOVE metadata"); - HaSMETSProfile echodepmets = mastermets.getMostRecentEchoDepMETS(); - if (TechMDAugmenter.addJhoveToProfile(echodepmets)) { + logger.info("Packaging files"); + File pack = packager.createRepositoryPackage(mastermets, + zip_dest, handle); - logger.info("Packaging files"); - File pack = packager.createRepositoryPackage(mastermets, - zip_dest, handle); - - logger.info("Updating repository package"); - // skip packages over 100MB - if ((pack.length() / 1048576) < 100) { - LrcrudClient.UpdateResponse ur = crud_client.update( - handle, pack); - if (ur.getStatusCode() == 404) { - logger.warn( - "Error sending package; will try again in three seconds"); - try { - Thread.sleep(3000); - } catch (InterruptedException e) { - logger.error(e.toString()); - } - ur = crud_client.update(handle, pack); + logger.info("Updating repository package"); + // skip packages over 100MB + if ((pack.length() / 1048576) < 100) { + LrcrudClient.UpdateResponse ur = crud_client.update( + handle, pack); + if (ur.getStatusCode() == 404) { + logger.warn( + "Error sending package; will try again in three seconds"); + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + logger.error(e.toString()); } - if (ur.getStatusCode() >= 200 && ur.getStatusCode() <= 204) { - logger.info(ur.getStatusCode() + ": " + - ur.getStatusMessage()); - logger.info("ID: " + ur.getUrl()); - } else { - logger.error(ur.getStatusCode() + " " + ur. - getStatusMessage()); - } - - } else { - logger.warn("Package " + mastermets.getBaseURI().toString() + - " is too large and will not be sent.\r\n"); - - // delete the stub - // TODO: Make sure delete is working - //crud_client.delete(responseID); + ur = crud_client.update(handle, pack); } - - if (keep_zips) { - logger.info("Local SIP stored at " + pack.getAbsolutePath() + - "\r\n"); + if (ur.getStatusCode() >= 200 && ur.getStatusCode() <= 204) { + logger.info(ur.getStatusCode() + ": " + + ur.getStatusMessage()); + logger.info("ID: " + ur.getUrl()); } else { - boolean got_it = pack.delete(); - if (!got_it) { - logger.warn("Delete failed!"); - } else { - logger.info("Done!\r\n"); - } + logger.error(ur.getStatusCode() + " " + + ur.getStatusMessage()); } } else { - logger.warn("Profile " + mastermets.getBaseURI().toString() + - " contains missing files. Package skipped.\r\n"); + logger.warn("Package " + mastermets.getBaseURI().toString() + + " is too large and will not be sent.\r\n"); + + // delete the stub + // TODO: Make sure delete is working + //crud_client.delete(responseID); } - } catch (HaSMETSProfileException e) { - logger.error("HaSMETSProfileException: " + e.getMessage()); - e.printStackTrace(); - } catch (PackagerException e) { - logger.error("HaSPackagerException: " + e.getMessage()); - e.printStackTrace(); - } catch (Exception e) { - logger.error("Exception: " + e.getMessage()); - e.printStackTrace(); + if (keep_zips) { + logger.info("Local SIP stored at " + pack.getAbsolutePath() + + "\r\n"); + } else { + boolean got_it = pack.delete(); + if (!got_it) { + logger.warn("Delete failed!"); + } else { + logger.info("Done!\r\n"); + } + } + + } else { + logger.warn("Profile " + mastermets.getBaseURI().toString() + + " contains missing files. Package skipped.\r\n"); } } public void submitPackage(HaSMasterMETSProfile mastermets, Client sword_client, PostMessage message, String zip_dest, String packager_class_name, - boolean keep_zips) { + boolean keep_zips) throws PackagerException, HaSMETSProfileException, + SWORDClientException { - try { - // logger.info("Creating repository package"); - FromHubPackagerFactory fpf = new FromHubPackagerFactory(); - FromHubPackager packager = fpf.createFromHubPackager( - packager_class_name); + // logger.info("Creating repository package"); + FromHubPackagerFactory fpf = new FromHubPackagerFactory(); + FromHubPackager packager = fpf.createFromHubPackager( + packager_class_name); - logger.info("Generating JHOVE metadata"); - HaSMETSProfile echodepmets = mastermets.getMostRecentEchoDepMETS(); - if (TechMDAugmenter.addJhoveToProfile(echodepmets)) { + logger.info("Generating JHOVE metadata"); + HaSMETSProfile echodepmets = mastermets.getMostRecentEchoDepMETS(); + if (TechMDAugmenter.addJhoveToProfile(echodepmets)) { - logger.info("Packaging files"); - String handle = echodepmets.getMetsDocument().getMets().getID(); - File pack = packager.createRepositoryPackage(mastermets, - zip_dest, handle); + logger.info("Packaging files"); + String handle = echodepmets.getMetsDocument().getMets().getID(); + File pack = packager.createRepositoryPackage(mastermets, + zip_dest, handle); - logger.info("Updating repository package"); - // skip packages over 100MB - if ((pack.length() / 1048576) < 100) { - message.setFilepath(pack.getAbsolutePath()); - message.setFiletype("application/zip"); + logger.info("Updating repository package"); + // skip packages over 100MB + if ((pack.length() / 1048576) < 100) { + message.setFilepath(pack.getAbsolutePath()); + message.setFiletype("application/zip"); - DepositResponse dr = sword_client.postFile(message); - Status status = sword_client.getStatus(); - if (status.getCode() >= 200 && status.getCode() <= 204) { - logger.info(dr.marshall()); - logger.info(status.getCode() + ": " + - status.getMessage()); + DepositResponse dr = sword_client.postFile(message); + Status status = sword_client.getStatus(); + if (status.getCode() >= 200 && status.getCode() <= 204) { + logger.info(dr.marshall()); + logger.info(status.getCode() + ": " + + status.getMessage()); - logger.info("ID: " + dr.getEntry().getId()); - } else { - logger.error(status.getCode() + " " + - status.getMessage()); - } - + logger.info("ID: " + dr.getEntry().getId()); } else { - logger.warn("Package " + mastermets.getBaseURI().toString() + - " is too large and will not be sent.\r\n"); + logger.error(status.getCode() + " " + + status.getMessage()); } - if (keep_zips) { - logger.info("Local SIP stored at " + pack.getAbsolutePath() + - "\r\n"); - } else { - boolean got_it = pack.delete(); - if (!got_it) { - logger.warn("Delete failed!"); - } else { - logger.info("Done!\r\n"); - } - } + } else { + logger.warn("Package " + mastermets.getBaseURI().toString() + + " is too large and will not be sent.\r\n"); + } + if (keep_zips) { + logger.info("Local SIP stored at " + pack.getAbsolutePath() + + "\r\n"); } else { - logger.warn("Profile " + mastermets.getBaseURI().toString() + - " contains missing files. Package skipped.\r\n"); + boolean got_it = pack.delete(); + if (!got_it) { + logger.warn("Delete failed!"); + } else { + logger.info("Done!\r\n"); + } } - } catch (HaSMETSProfileException e) { - logger.error("HaSMETSProfileException: " + e.getMessage()); - e.printStackTrace(); - } catch (PackagerException e) { - logger.error("HaSPackagerException: " + e.getMessage()); - e.printStackTrace(); - } catch (Exception e) { - logger.error("Exception: " + e.getMessage()); - e.printStackTrace(); + } else { + logger.warn("Profile " + mastermets.getBaseURI().toString() + + " contains missing files. Package skipped.\r\n"); } } } Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManager.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManager.java 2009-06-17 18:10:23 UTC (rev 863) @@ -57,6 +57,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Stack; +import java.util.logging.Level; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -185,541 +186,557 @@ System.exit(0); } - /** - * Processes command-line arguments for dissemination - * - * @param args - */ - private void process_dissemination(String[] args) { - String crud_url; - String diss_type; - String dest_path; - String packager_class_name; - boolean bagit = false; + /** + * Processes command-line arguments for dissemination + * + * @param args + */ + private void process_dissemination(String[] args) { + String crud_url; + String diss_type; + String dest_path; + String packager_class_name; + boolean bagit = false; - Stack<String> id_stack = new Stack<String>(); + Stack<String> id_stack = new Stack<String>(); - try { + try { - /* Set up CLI options */ + /* Set up CLI options */ - Options opts = new Options(); + Options opts = new Options(); - opts.addOption("t", "type", true, "with -i, type: ITEM or LIST"); - opts - .addOption( - "i", - "ID", - true, - "with -t, ID or handle of the package to export, or name of a text file listing IDs to export"); - opts.addOption("u", "URL", true, "URL of the LRCRUD service"); - opts - .addOption( - "p", - "packager", - true, - "class name of the Packager to use " - + "(must implement edu.uiuc.ndiipp.hubandspoke.packager.ToHubPackager)"); - opts.addOption("d", "dest", true, - "destination path to where you want packages disseminated"); + opts.addOption("t", "type", true, "with -i, type: ITEM or LIST"); + opts.addOption( + "i", + "ID", + true, + "with -t, ID or handle of the package to export, or name of a text file listing IDs to export"); + opts.addOption("u", "URL", true, "URL of the LRCRUD service"); + opts.addOption( + "p", + "packager", + true, + "class name of the Packager to use " + + "(must implement edu.uiuc.ndiipp.hubandspoke.packager.ToHubPackager)"); + opts.addOption("d", "dest", true, + "destination path to where you want packages disseminated"); - opts.addOption("b", "bagit", false, "export in bagit format"); + opts.addOption("b", "bagit", false, "export in bagit format"); - opts.addOption("h", "help", false, "prints this help list"); + opts.addOption("h", "help", false, "prints this help list"); - CommandLineParser parser = new PosixParser(); - CommandLine cmd = parser.parse(opts, args); + CommandLineParser parser = new PosixParser(); + CommandLine cmd = parser.parse(opts, args); - - /* Help Formatter */ - // automatically generate the help statement - HelpFormatter formatter = new HelpFormatter(); + /* Help Formatter */ - // if the help flag is set or no parameters are supplied print help - if (cmd.getOptions().length == 0 || cmd.hasOption("h")) { - usage(formatter, opts, "GET", null); - return; - } + // automatically generate the help statement + HelpFormatter formatter = new HelpFormatter(); + // if the help flag is set or no parameters are supplied print help + if (cmd.getOptions().length == 0 || cmd.hasOption("h")) { + usage(formatter, opts, "GET", null); + return; + } - - /* LRCRUD Client */ - if (cmd.hasOption("u") && cmd.getOptionValue("u").length() > 0) { - crud_url = cmd.getOptionValue("u"); - try { - URL crud = new URL(crud_url); - } catch (MalformedURLException e) { - usage(formatter, opts, "GET", cmd.getOptionValue("u") - + " is not a valid URL. Please supply a URL"); - return; - } - } else { - usage(formatter, opts, "GET", - "\"crudURL\" (-u) is a REQUIRED parameter"); - return; - } + /* LRCRUD Client */ - - /* Export Source Type (Item/List) */ + if (cmd.hasOption("u") && cmd.getOptionValue("u").length() > 0) { + crud_url = cmd.getOptionValue("u"); + try { + URL crud = new URL(crud_url); + } catch (MalformedURLException e) { + usage(formatter, opts, "GET", cmd.getOptionValue("u") + + " is not a valid URL. Please supply a URL"); + return; + } + } else { + usage(formatter, opts, "GET", + "\"crudURL\" (-u) is a REQUIRED parameter"); + return; + } - if (cmd.hasOption("t") && cmd.getOptionValue("t").length() > 0) { - if (cmd.getOptionValue("t").compareToIgnoreCase("LIST") == 0) { - diss_type = "LIST"; - } else if (cmd.getOptionValue("t").compareToIgnoreCase("ITEM") == 0) { - diss_type = "ITEM"; - } else { - usage(formatter, opts, "GET", - "\"type\" (-t) must be either ITEM or LIST"); - return; - } - } else { - usage(formatter, opts, "GET", - "\"type\" (-t) is a REQUIRED parameter"); - return; - } - - /* Item ID(s) */ + /* Export Source Type (Item/List) */ - if (cmd.hasOption("i") && cmd.getOptionValue("i").length() > 0) { - if (diss_type.compareToIgnoreCase("ITEM") == 0) { - id_stack.push(cmd.getOptionValue("i")); - } else if (diss_type.compareToIgnoreCase("LIST") == 0) { - File item_list = new File(cmd.getOptionValue("i")); - BufferedReader input = null; - try { - input = new BufferedReader(new FileReader(item_list)); - String line = null; - while ((line = input.readLine()) != null) { - if (line.charAt(0) != '\'') { - // comment out a line with single quote - logger.debug("Adding file " + line); - id_stack.push(line); - } - } - } catch (FileNotFoundException e) { - usage(formatter, opts, "GET", "File not found: " - + item_list.getAbsolutePath()); - return; - } catch (IOException e) { - usage(formatter, opts, "GET", "Error opening file: " - + item_list.getAbsolutePath()); - return; - } - try { - if (input != null) { - input.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } else { - usage(formatter, opts, "GET", - "\"ID\" (-i) is a REQUIRED parameter."); - return; - } + if (cmd.hasOption("t") && cmd.getOptionValue("t").length() > 0) { + if (cmd.getOptionValue("t").compareToIgnoreCase("LIST") == 0) { + diss_type = "LIST"; + } else if (cmd.getOptionValue("t").compareToIgnoreCase("ITEM") == + 0) { + diss_type = "ITEM"; + } else { + usage(formatter, opts, "GET", + "\"type\" (-t) must be either ITEM or LIST"); + return; + } + } else { + usage(formatter, opts, "GET", + "\"type\" (-t) is a REQUIRED parameter"); + return; + } - - /* Packager Class */ - if (cmd.hasOption("p")) { - packager_class_name = cmd.getOptionValue("p"); - } else { - usage(formatter, opts, "GET", - "\"packager\" (-p) is a required parameter."); - return; + /* Item ID(s) */ + + if (cmd.hasOption("i") && cmd.getOptionValue("i").length() > 0) { + if (diss_type.compareToIgnoreCase("ITEM") == 0) { + id_stack.push(cmd.getOptionValue("i")); + } else if (diss_type.compareToIgnoreCase("LIST") == 0) { + File item_list = new File(cmd.getOptionValue("i")); + BufferedReader input = null; + try { + input = new BufferedReader(new FileReader(item_list)); + String line = null; + while ((line = input.readLine()) != null) { + if (line.charAt(0) != '\'') { + // comment out a line with single quote + logger.debug("Adding file " + line); + id_stack.push(line); + } } + } catch (FileNotFoundException e) { + usage(formatter, opts, "GET", "File not found: " + + item_list.getAbsolutePath()); + return; + } catch (IOException e) { + usage(formatter, opts, "GET", "Error opening file: " + + item_list.getAbsolutePath()); + return; + } + try { + if (input != null) { + input.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } else { + usage(formatter, opts, "GET", + "\"ID\" (-i) is a REQUIRED parameter."); + return; + } - - /* Export destination */ - if (cmd.hasOption("d")) { - dest_path = cmd.getOptionValue("d"); - File dest_loc = new File(dest_path); - if (!dest_loc.isDirectory()) { - usage(formatter, opts, "GET", dest_loc.getAbsolutePath() - + " is not a directory. Please supply a directory"); - return; - } - } else { - usage(formatter, opts, "GET", - "\"dest\" (-d) is a REQUIRED parameter."); - return; - } + /* Packager Class */ + if (cmd.hasOption("p")) { + packager_class_name = cmd.getOptionValue("p"); + } else { + usage(formatter, opts, "GET", + "\"packager\" (-p) is a required parameter."); + return; + } - /* Export to Bagit */ - if (cmd.hasOption("b")) { - bagit = true; - } + /* Export destination */ - /* Disseminate Package */ + if (cmd.hasOption("d")) { + dest_path = cmd.getOptionValue("d"); + File dest_loc = new File(dest_path); + if (!dest_loc.isDirectory()) { + usage(formatter, opts, "GET", dest_loc.getAbsolutePath() + + " is not a directory. Please supply a directory"); + return; + } + } else { + usage(formatter, opts, "GET", + "\"dest\" (-d) is a REQUIRED parameter."); + return; + } - try { - ConsoleAuthenticator auth = new ConsoleAuthenticator(); - LrcrudClient client = new LrcrudClient(crud_url, auth); - boolean replace_dups = false; - PackageDissemination pd = new PackageDissemination(logger); + /* Export to Bagit */ - while (!id_stack.isEmpty()) { - logger.info("Processing item " + id_stack.peek() + "..."); + if (cmd.hasOption("b")) { + bagit = true; + } - pd.disseminatePackage(client, id_stack.pop(), dest_path, - packager_class_name, replace_dups, bagit); - } - } catch (LrcrudClientException e) { - logger.error(e); - // e.printStackTrace(); - } - } catch (IllegalArgumentException e) { - logger.error(e); - // e.printStackTrace(); - } catch (ParseException e) { - logger.error(e); - // e.printStackTrace(); + /* Disseminate Package */ + + ConsoleAuthenticator auth = new ConsoleAuthenticator(); + LrcrudClient client = null; + try { + client = + new LrcrudClient(crud_url, auth); + } catch (LrcrudClientException ex) { + java.util.logging.Logger.getLogger( + WorkflowManager.class.getName()). + log(Level.SEVERE, null, ex); + } + boolean replace_dups = false; + + PackageDissemination pd = new PackageDissemination(logger); + + try { + while (!id_stack.isEmpty()) { + logger.info("Processing item " + id_stack.peek() + "..."); + + pd.disseminatePackage(client, id_stack.pop(), dest_path, + packager_class_name, replace_dups, bagit); } - logger.removeAllAppenders(); + } catch (IOException e) { + logger.error(e); + } catch (PackagerException e) { + logger.error(e); + } catch (HaSMETSProfileException e) { + logger.error(e); + } catch (LrcrudClientException e) { + logger.error(e); + // e.printStackTrace(); + } + + } catch (IllegalArgumentException e) { + logger.error(e); + // e.printStackTrace(); + } catch (ParseException e) { + logger.error(e); + // e.printStackTrace(); } + logger.removeAllAppenders(); + } - /** - * Processes command-line arguments for submission - * - * @param args - */ - private void process_submission(String[] args) { - String crud_url; - LrcrudClient client = null; - String coll_id; - String zip_dest; - String packager_class_name; - boolean keep_zip = false; - - Stack<File> fileStack = new Stack<File>(); - Stack<File> dirStack = new Stack<File>(); - Stack<HaSMasterMETSProfile> mets_stack = new Stack<HaSMasterMETSProfile>(); + /** + * Processes command-line arguments for submission + * + * @param args + */ + private void process_submission(String[] args) { + String crud_url; + LrcrudClient client = null; + String coll_id; + String zip_dest; + String packager_class_name; + boolean keep_zip = false; - try { + Stack<File> fileStack = new Stack<File>(); + Stack<File> dirStack = new Stack<File>(); + Stack<HaSMasterMETSProfile> mets_stack = + new Stack<HaSMasterMETSProfile>(); + try { - /* Set up CLI options */ - Options opts = new Options(); + /* Set up CLI options */ - opts - .addOption( - "s", - "source", - true, - "source of item(s) to submit: " - + "(source may be a single METS file, a text file listing METS file locations, or " - + "a directory to begin recursively searching for METS files)"); - opts.addOption("u", "URL", true, "URL of the LRCRUD service"); - opts.addOption("i", "ID", true, - "destination collection ID or handle"); - opts - .addOption( - "p", - "packager", - true, - "class name of the Packager to use " - + "(must implement edu.uiuc.ndiipp.hubandspoke.packager.FromHubPackager)"); - opts.addOption("k", "keep", false, - "keep a local copy of the packaged SIP(s)"); - opts - .addOption("z", "zip", true, - "with -k, local destination path to store the SIP zip file(s)"); + Options opts = new Options(); - opts.addOption("h", "help", false, "prints this help list"); + opts.addOption( + "s", + "source", + true, + "source of item(s) to submit: " + + "(source may be a single METS file, a text file listing METS file locations, or " + + "a directory to begin recursively searching for METS files)"); + opts.addOption("u", "URL", true, "URL of the LRCRUD service"); + opts.addOption("i", "ID", true, + "destination collection ID or handle"); + opts.addOption( + "p", + "packager", + true, + "class name of the Packager to use " + + "(must implement edu.uiuc.ndiipp.hubandspoke.packager.FromHubPackager)"); + opts.addOption("k", "keep", false, + "keep a local copy of the packaged SIP(s)"); + opts.addOption("z", "zip", true, + "with -k, local destination path to store the SIP zip file(s)"); - CommandLineParser parser = new PosixParser(); - CommandLine cmd = parser.parse(opts, args); - + opts.addOption("h", "help", false, "prints this help list"); + CommandLineParser parser = new PosixParser(); + CommandLine cmd = parser.parse(opts, args); - /* Help Formatter */ - // automatically generate the help statement - HelpFormatter formatter = new HelpFormatter(); - // if the help flag is set or no parameters are supplied print help - if (cmd.getOptions().length == 0 || cmd.hasOption("h")) { - usage(formatter, opts, "PUT", null); - return; - } - + /* Help Formatter */ + // automatically generate the help statement + HelpFormatter formatter = new HelpFormatter(); - /* LRCRUD Client */ + // if the help flag is set or no parameters are supplied print help + if (cmd.getOptions().length == 0 || cmd.hasOption("h")) { + usage(formatter, opts, "PUT", null); + return; + } - if (cmd.hasOption("u") && cmd.getOptionValue("u").length() > 0) { - crud_url = cmd.getOptionValue("u"); - try { - URL crud = new URL(crud_url); - } catch (MalformedURLException e) { - usage(formatter, opts, "PUT", cmd.getOptionValue("u") - + " is not a valid URL. Please supply a URL"); - return; - } - try { - client = new LrcrudClient(crud_url, new ConsoleAuthenticator()); - } catch (LrcrudClientException e) { - logger.error(e); - // e.printStackTrace(); - } + /* LRCRUD Client */ - } else { - usage(formatter, opts, "PUT", - "\"url\" (-u) is a REQUIRED parameter"); - return; - } + if (cmd.hasOption("u") && cmd.getOptionValue("u").length() > 0) { + crud_url = cmd.getOptionValue("u"); + try { + URL crud = new URL(crud_url); + } catch (MalformedURLException e) { + usage(formatter, opts, "PUT", cmd.getOptionValue("u") + + " is not a valid URL. Please supply a URL"); + return; + } + try { + client = new LrcrudClient(crud_url, + new ConsoleAuthenticator()); + } catch (LrcrudClientException e) { + logger.error(e); + // e.printStackTrace(); + } - /* Collection ID */ + } else { + usage(formatter, opts, "PUT", + "\"url\" (-u) is a REQUIRED parameter"); + return; + } - if (cmd.hasOption("i") && cmd.getOptionValue("i").length() > 0) { - coll_id = cmd.getOptionValue("i"); - } else { - usage(formatter, opts, "PUT", - "\"ID\" (-i) is a REQUIRED parameter."); - return; - } + /* Collection ID */ - /* Package Source */ + if (cmd.hasOption("i") && cmd.getOptionValue("i").length() > 0) { + coll_id = cmd.getOptionValue("i"); + } else { + usage(formatter, opts, "PUT", + "\"ID\" (-i) is a REQUIRED parameter."); + return; + } - if (cmd.hasOption("s") && cmd.getOptionValue("s").length() > 0) { - - File start_loc = new File(cmd.getOptionValue("s")); - int count = 0; - - if (!start_loc.isDirectory()) { - if (start_loc.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || start_loc.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0 - || start_loc.getName().endsWith(".zip")) { - - // push it on the file stack - fileStack.push(start_loc); - - } else { - // it must be a text file - BufferedReader input = null; - try { - input = new BufferedReader(new FileReader(start_loc)); - String line = null; - - // read the file line-by-line - while ((line = input.readLine()) != null) { - - if (line.charAt(0) != '\'') { // skip lines beginning with a single quote - - File nextFile = new File(line.toString()); - - if (!nextFile.exists()) { - logger - .error("File processing error: " - + line.toString() - + " does not exist."); - } - else if (!nextFile.isAbsolute()) { - logger - .error("File processing error: " - + line.toString() - + " is not an absolute filename."); - } - else if (nextFile.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || nextFile.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0 - || nextFile.getName().endsWith(".zip")) { - // push it on the file stack - fileStack.push(nextFile); - } - else { - logger - .error("File processing error: " - + "cannot create a Hub package at " - + nextFile.getPath() - + "."); - } - } - } - } catch (FileNotFoundException e) { - usage(formatter, opts, "PUT", "File not found: " - + start_loc.getAbsolutePath()); - return; - } catch (IOException e) { - usage(formatter, opts, "PUT", - "Error opening file: " - + start_loc.getAbsolutePath()); - return; - } - try { - if (input != null) { - input.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } else { - // it's a directory to crawl - dirStack.push(start_loc); + /* Package Source */ - while (!dirStack.isEmpty()) { - File[] filesAndDirs = dirStack.pop().listFiles(); - for (File file : filesAndDirs) { - if (file.isDirectory()) { - dirStack.push(file); - } - if (file.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || file.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0 - || file.getName().endsWith(".zip")) { - - // push it on the file stack - fileStack.push(file); - } - } - } + if (cmd.hasOption("s") && cmd.getOptionValue("s").length() > 0) { + + File start_loc = new File(cmd.getOptionValue("s")); + int count = 0; + + if (!start_loc.isDirectory()) { + if (start_loc.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || start_loc.getName(). + compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == + 0 || start_loc.getName().endsWith(".zip")) { + + // push it on the file stack + fileStack.push(start_loc); + + } else { + // it must be a text file + BufferedReader input = null; + try { + input = + new BufferedReader(new FileReader(start_loc)); + String line = null; + + // read the file line-by-line + while ((line = input.readLine()) != null) { + + if (line.charAt(0) != '\'') { // skip lines beginning with a single quote + + File nextFile = new File(line.toString()); + + if (!nextFile.exists()) { + logger.error("File processing error: " + + line.toString() + + " does not exist."); + } else if (!nextFile.isAbsolute()) { + logger.error("File processing error: " + + line.toString() + + " is not an absolute filename."); + } else if (nextFile.getName(). + compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == + 0 || nextFile.getName(). + compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0 || nextFile.getName(). + endsWith(".zip")) { + + // push it on the file stack + fileStack.push(nextFile); + } else { + logger.error("File processing error: " + + "cannot create a Hub package at " + + nextFile.getPath() + "."); + } } - - // go through the file stack, create Hub packages, push mastermets onto the mets stack - while(!fileStack.isEmpty()) { - File f = fileStack.pop(); - - if (f.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || f.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0) { - - // it's a mets file, so create hub package and push the master mets - try { - // first, move the package to a temp directory - File working_dir = new File(tempdir, f.getParentFile().getName()); - HaSFileUtils.copyDirectory(f.getParentFile(), working_dir); - - HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance(working_dir); - if (mm != null) { - mets_stack.push(mm); - count++; - } - } catch (HaSMETSProfileException e) { - logger - .error("Error creating Hub package for: " - + f.getName()); - } catch (IOException e) { - logger - .error("Error creating Hub package for: " - + f.getName()); - } - } - else if (f.getName().endsWith(".zip")) { - - // it's a zip file, so create hub package and push the master mets - try { - HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance( - new ZipFile(f), tempdir, true); - if (mm != null) { - mets_stack.push(mm); - count++; - } - } catch (ZipException e) { - logger - .error("Error creating Hub package for: " - + f.getName()); - } catch (HaSMETSProfileException e) { - logger - .error("Error creating Hub package for: " - + f.getName()); - } catch (IOException e) { - logger - .error("Error creating Hub package for: " - + f.getName()); - } - } - } - logger.info("Found " + count + " items to submit"); - - } else { - usage(formatter, opts, "PUT", - "\"source\" (-s) is a REQUIRED parameter."); - return; + } + } catch (FileNotFoundException e) { + usage(formatter, opts, "PUT", "File not found: " + + start_loc.getAbsolutePath()); + return; + } catch (IOException e) { + usage(formatter, opts, "PUT", + "Error opening file: " + start_loc. + getAbsolutePath()); + return; } + try { + if (input != null) { + input.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } else { + // it's a directory to crawl + dirStack.push(start_loc); + while (!dirStack.isEmpty()) { + File[] filesAndDirs = dirStack.pop().listFiles(); + for (File file : filesAndDirs) { + if (file.isDirectory()) { + dirStack.push(file); + } + if (file.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || file.getName(). + compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0 || file. + getName().endsWith(".zip")) { - /* Packager Class */ - - if (cmd.hasOption("p") && cmd.getOptionValue("p").length() > 0) { - packager_class_name = cmd.getOptionValue("p"); - } else { - usage(formatter, opts, "PUT", - "\"packager\" (-p) is a required parameter."); - return; + // push it on the file stack + fileStack.push(file); + } } + } + } + // go through the file stack, create Hub packages, push mastermets onto the mets stack + while (!fileStack.isEmpty()) { + File f = fileStack.pop(); + if (f.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || f. + getName().compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0) { - /* Keep Zips? */ + // it's a mets file, so create hub package and push the master mets + try { + // first, move the package to a temp directory + File working_dir = new File(tempdir, f.getParentFile(). + getName()); + HaSFileUtils.copyDirectory(f.getParentFile(), + working_dir); - if (cmd.hasOption("k")) { - keep_zip = true; + HaSMasterMETSProfile mm = + HaSMasterMETSProfileFactory.newInstance( + working_dir); + if (mm != null) { + mets_stack.push(mm); + count++; + } + } catch (HaSMETSProfileException e) { + logger.error("Error creating Hub package for: " + f. + getName()); + } catch (IOException e) { + logger.error("Error creating Hub package for: " + f. + getName()); } + } else if (f.getName().endsWith(".zip")) { - if (cmd.hasOption("z") && cmd.getOptionValue("z").length() > 0) { - zip_dest = cmd.getOptionValue("z"); - File zip_loc = new File(zip_dest); - if (!zip_loc.isDirectory()) { - usage(formatter, opts, "PUT", zip_loc.getAbsolutePath() - + " is not a directory. Please supply a directory"); - return; - } - } else { - zip_dest = null; + // it's a zip file, so create hub package and push the master mets + try { + HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance( + new ZipFile(f), tempdir, true); + if (mm != null) { + mets_stack.push(mm); + count++; + } + } catch (ZipException e) { + logger.error("Error creating Hub package for: " + f. + getName()); + } catch (HaSMETSProfileException e) { + logger.error("Error creating Hub package for: " + f. + getName()); + } catch (IOException e) { + logger.error("Error creating Hub package for: " + f. + getName()); } + } + } + logger.info("Found " + count + " items to submit"); + } else { + usage(formatter, opts, "PUT", + "\"source\" (-s) is a REQUIRED parameter."); + return; + } - /* Submit Package */ - PackageSubmission ps = new PackageSubmission(logger); + /* Packager Class */ - while (!mets_stack.isEmpty()) { - logger.info("Processing " + mets_stack.peek() + "..."); + if (cmd.hasOption("p") && cmd.getOptionValue("p").length() > 0) { + packager_class_name = cmd.getOptionValue("p"); + } else { + usage(formatter, opts, "PUT", + "\"packager\" (-p) is a required parameter."); + return; + } - try { - String handle = ps.postPackage(client, coll_id); - ps.submitPackage(mets_stack.pop(), client, handle, - zip_dest, packager_class_name, keep_zip); - } catch (LrcrudClientException e) { - logger.error(e); - e.printStackTrace(); - } - } + /* Keep Zips? */ - } catch (IllegalArgumentException e) { - logger.error(e); - // e.printStackTrace(); - } catch (ParseException e) { - logger.error(e); - // e.printStackTrace(); + if (cmd.hasOption("k")) { + keep_zip = true; + } + + if (cmd.hasOption("z") && cmd.getOptionValue("z").length() > 0) { + zip_dest = cmd.getOptionValue("z"); + File zip_loc = new File(zip_dest); + if (!zip_loc.isDirectory()) { + usage(formatter, opts, "PUT", zip_loc.getAbsolutePath() + + " is not a directory. Please supply a directory"); + return; } - logger.removeAllAppenders(); + } else { + zip_dest = null; + } + + + + /* Submit Package */ + + PackageSubmission ps = new PackageSubmission(logger); + + while (!mets_stack.isEmpty()) { + logger.info("Processing " + mets_stack.peek() + "..."); + + try { + String handle = ps.postPackage(client, coll_id); + + ps.submitPackage(mets_stack.pop(), client, handle, + zip_dest, packager_class_name, keep_zip); + + } catch (PackagerException e) { + logger.error(e); + } catch (HaSMETSProfileException e) { + logger.error(e); + } catch (LrcrudClientException e) { + logger.error(e); + } + } + + } catch (IllegalArgumentException e) { + logger.error(e); + // e.printStackTrace(); + } catch (ParseException e) { + logger.error(e); + // e.printStackTrace(); } + logger.removeAllAppenders(); + } } Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-27 20:15:06 UTC (rev 862) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-06-17 18:10:23 UTC (rev 863) @@ -60,6 +60,7 @@ import java.util.Iterator; import java.util.List; import java.util.Stack; +import java.util.logging.Level; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -103,6 +104,7 @@ import edu.uiuc.ndiipp.hubandspoke.lrcrud.client.LrcrudClient; import edu.uiuc.ndiipp.hubandspoke.lrcrud.client.LrcrudClientException; +import edu.uiuc.ndiipp.hubandspoke.packager.PackagerException; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMETSProfileException; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfile; import edu.uiuc.ndiipp.hubandspoke.profile.HaSMasterMETSProfileFactory; @@ -184,7 +186,7 @@ } @Override - protected Void doInBackground() throws Exception { + protected Void doInBackground() { JTextPaneAppender putAppender = new JTextPaneAppender( putLogTextPane); logger.addAppender(putAppender); @@ -505,6 +507,14 @@ ps.submitPackage(mets_stack.pop(), client, handle, zip_dest, packager_class_name, keep_zip); + } catch (PackagerException e) { + logger.error(e); + logger.removeAppender(putAppender); + return null; + } catch (HaSMETSProfileException e) { + logger.error(e); + logger.removeAppender(putAppender); + return null; } catch (LrcrudClientException e) { JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + client.getBaseURL(). toString()); @@ -588,14 +598,14 @@ SwingWorker worker = new SwingWorker<Void, Void>() { - @Override - protected void done() { - setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); - getSubmitButton.setEnabled(true); - } + @Override + protected void done() { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + getSubmitButton.setEnabled(true); + } @Override - protected Void doInBackground() throws Exception { + protected Void doInBackground() { JTextPaneAppender getAppender = new JTextPaneAppender( getLogTextPane); logger.addAppender(getAppender); @@ -620,6 +630,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply an LRCRUD URL"); + logger.removeAppender(getAppender); return null; } @@ -629,6 +640,7 @@ } catch (MalformedURLException e) { JOptionPane.showMessageDialog(null, "LRCRUD URL is not well formed"); + logger.removeAppender(getAppender); return null; } @@ -638,7 +650,8 @@ } catch (LrcrudClientException e) { logger.error(e); - // e.printStackTrace(); + logger.removeAppender(getAppender); + return null; } @@ -659,6 +672,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply an Item ID for Item Export"); + logger.removeAppender(getAppender); return null; } } else if (diss_type.compareToIgnoreCase("LIST") == 0) { @@ -679,10 +693,12 @@ } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "File not found"); + logger.removeAppender(getAppender); return null; } catch (IOException e) { JOptionPane.showMessageDialog(null, "Error opening list file"); + logger.removeAppender(getAppender); return null; } try { @@ -695,6 +711,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply a List Location for List Export"); + logger.removeAppender(getAppender); return null; } } @@ -710,6 +727,7 @@ } else { JOptionPane.showMessageDialog(null, "You must select a packager class"); + logger.removeAppender(getAppender); return null; } @@ -723,11 +741,13 @@ JOptionPane.showMessageDialog(null, dest_loc. getAbsolutePath() + " is not a directory. Please supply a directory"); + logger.removeAppender(getAppender); return null; } } else { JOptionPane.showMessageDialog(null, "You must select an export destination"); + logger.removeAppender(getAppender); return null; } @@ -757,6 +777,18 @@ toString()); logger.removeAppender(getAppender); return null; + } catch (IOException e) { + logger.error(e); + logger.removeAppender(getAppender); + return null; + } catch (PackagerException e) { + logger.error(e); + logger.removeAppender(getAppender); + return null; + } catch (HaSMETSProfileException e) { + logger.error(e); + logger.removeAppender(getAppender); + return null; } } @@ -851,7 +883,7 @@ } @Override - protected Void doInBackground() throws Exception { + protected Void doInBackground() { JTextPaneAppender migrateAppender = new JTextPaneAppender( migrateLogTextPane); logger.addAppender(migrateAppender); @@ -882,6 +914,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply an LRCRUD URL"); + logger.removeAppender(migrateAppender); return null; } @@ -891,6 +924,7 @@ } catch (MalformedURLException e) { JOptionPane.showMessageDialog(null, "LRCRUD URL is not well formed"); + logger.removeAppender(migrateAppender); return null; } @@ -920,10 +954,12 @@ } else { JOptionPane.showMessageDialog(null, "You must supply an Item ID for Item Export"); + logger.removeAppender(migrateAppender); return null; } } else if (get_diss_type.compareToIgnoreCase("LIST") == 0) { - if (migrateFromListLocationTextField.getText().compareTo("") != 0) { + if (migrateFromListLocationTextField.getText().compareTo("") != + 0) { File item_list = new File( migrateFromListLocationTextField.getText()); BufferedReader input = null; @@ -940,10 +976,12 @@ } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "File not found"); + logger.removeAppender(migrateAppender); return null; } catch (IOException e) { JOptionPane.showMessageDialog(null, "Error opening list file"); + logger.removeAppender(migrateAppender); return null; } try { @@ -956,6 +994,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply a List Location for List Export"); + logger.removeAppender(migrateAppender); return null; } } @@ -970,6 +1009,7 @@ } else { JOptionPane.showMessageDialog(null, "You must select a packager class"); + logger.removeAppender(migrateAppender); return null; } @@ -989,10 +1029,22 @@ String mm_path = ""; try { - mm_path = pd.disseminatePackage(get_client, - id_stack.pop(), - get_dest_path, + mm_path = + pd.disseminatePackage(get_client, + id_stack.pop(), get_dest_path, get_packager_class_name, replace_dups, false); + } catch (IOException e) { + logger.error(e); + logger.removeAppender(migrateAppender); + return null; + } catch (PackagerException e) { + logger.error(e); + logger.removeAppender(migrateAppender); + return null; + } catch (HaSMETSProfileException e) { + logger.error(e); + logger.removeAppender(migrateAppender); + return null; } catch (LrcrudClientException e) { JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + get_client.getBaseURL(). toString()); @@ -1034,6 +1086,7 @@ } else { JOptionPane.showMessageDialog(null, "You must supply an LRCRUD URL"); + logger.removeAppender(migrateAppender); return null; } @@ -1043,6 +1096,7 @@ } catch (MalformedURLException e) { ... [truncated message content] |
From: <bil...@us...> - 2009-05-27 20:15:49
|
Revision: 862 http://echodep.svn.sourceforge.net/echodep/?rev=862&view=rev Author: bill_ingram Date: 2009-05-27 20:15:06 +0000 (Wed, 27 May 2009) Log Message: ----------- Bug Fix: Better catching of filenotfound exception for bad flocat references. When running a batch, we'll skip this package, but keep moving on to the next. Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java 2009-05-27 19:17:13 UTC (rev 861) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/HaSMasterMETSProfileFactory.java 2009-05-27 20:15:06 UTC (rev 862) @@ -381,7 +381,7 @@ HaSMETSProfile.PackageType.SIP); mets = mastermets.getMostRecentEchoDepMETS(); if (!metsfile.delete()) { - logger.warn("Could not delete old echodep mets."); + //logger.warn("Could not delete old echodep mets."); } } catch (PackagerException e) { // e.printStackTrace(); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-05-27 19:17:13 UTC (rev 861) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-05-27 20:15:06 UTC (rev 862) @@ -1116,7 +1116,8 @@ File f = new File(this.baseURI.resolve(ft.getFLocatArray(0).getHref())); if(!f.exists()){ - throw new HaSMETSProfileException("File not found: " + f.getPath()); + throw new HaSMETSProfileException("File not found: " + + ft.getFLocatArray(0).getHref()); } PremisObjectDocument pDocObj = createPremisObject(f, idType, idVal); PremisObjectDocument.Object pObj = pDocObj.getObject(); Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-27 19:17:13 UTC (rev 861) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-27 20:15:06 UTC (rev 862) @@ -175,293 +175,351 @@ */ private void putSubmitButtonActionPerformed(ActionEvent evt) { - SwingWorker worker = new SwingWorker<Void, Void>() { + SwingWorker worker = new SwingWorker<Void, Void>() { - @Override - protected void done() { - setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); - putSubmitButton.setEnabled(true); - } + @Override + protected void done() { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + putSubmitButton.setEnabled(true); + } - @Override - protected Void doInBackground() throws Exception { - JTextPaneAppender putAppender = new JTextPaneAppender(putLogTextPane); - logger.addAppender(putAppender); + @Override + protected Void doInBackground() throws Exception { + JTextPaneAppender putAppender = new JTextPaneAppender( + putLogTextPane); + logger.addAppender(putAppender); - setCursor(new Cursor(Cursor.WAIT_CURSOR)); - putSubmitButton.setEnabled(false); + setCursor(new Cursor(Cursor.WAIT_CURSOR)); + putSubmitButton.setEnabled(false); - String crud_url; - LrcrudClient client = null; - String coll_id; - String source_type; - String zip_dest = tempdir.getPath(); - String packager_class_name; - boolean keep_zip = false; + String crud_url; + LrcrudClient client = null; + String coll_id; + String source_type; + String zip_dest = tempdir.getPath(); + String packager_class_name; + boolean keep_zip = false; - Stack<File> fileStack = new Stack<File>(); - Stack<File> dirStack = new Stack<File>(); - Stack<HaSMasterMETSProfile> mets_stack = new Stack<HaSMasterMETSProfile>(); + Stack<File> fileStack = new Stack<File>(); + Stack<File> dirStack = new Stack<File>(); + Stack<HaSMasterMETSProfile> mets_stack = + new Stack<HaSMasterMETSProfile>(); - /* LRCRUD Client */ + /* LRCRUD Client */ - if (putCrudTextField.getText().compareTo("") != 0) { - crud_url = putCrudTextField.getText(); - } else { - JOptionPane.showMessageDialog(null, "You must supply an LRCRUD URL"); - logger.removeAppender(putAppender); - return null; - } + if (putCrudTextField.getText().compareTo("") != 0) { + crud_url = putCrudTextField.getText(); + } else { + JOptionPane.showMessageDialog(null, + "You must supply an LRCRUD URL"); + logger.removeAppender(putAppender); + return null; + } - try { // check to see if it's a valid url - new URL(crud_url); - } catch (MalformedURLException e) { - JOptionPane.showMessageDialog(null, "LRCRUD URL is not well formed"); - logger.removeAppender(putAppender); - return null; - } + try { // check to see if it's a valid url + new URL(crud_url); + } catch (MalformedURLException e) { + JOptionPane.showMessageDialog(null, + "LRCRUD URL is not well formed"); + logger.removeAppender(putAppender); + return null; + } - try { - client = new LrcrudClient(crud_url, new GUIAuthenticator()); + try { + client = new LrcrudClient(crud_url, new GUIAuthenticator()); - } catch (LrcrudClientException e) { - logger.error(e); - // e.printStackTrace(); - } + } catch (LrcrudClientException e) { + logger.error(e); + // e.printStackTrace(); + } - /* Collection ID */ + /* Collection ID */ - if (putHandleTextField.getText().compareTo("") != 0) { - coll_id = putHandleTextField.getText(); - } else { - JOptionPane.showMessageDialog(null, "You must supply a collection ID"); - logger.removeAppender(putAppender); - return null; - } + if (putHandleTextField.getText().compareTo("") != 0) { + coll_id = putHandleTextField.getText(); + } else { + JOptionPane.showMessageDialog(null, + "You must supply a collection ID"); + logger.removeAppender(putAppender); + return null; + } - /* Source Type */ + /* Source Type */ - if (putPackageSourceTypeDirRadioButton.isSelected()) { - source_type = "DIR"; - } else if (putPackageSourceTypeListRadioButton.isSelected()) { - source_type = "LIST"; - } else if (putPackageSourceTypeZipRadioButton.isSelected()) { - source_type = "ZIP"; - } else { - source_type = "METS"; - } + if (putPackageSourceTypeDirRadioButton.isSelected()) { + source_type = "DIR"; + } else if (putPackageSourceTypeListRadioButton.isSelected()) { + source_type = "LIST"; + } else if (putPackageSourceTypeZipRadioButton.isSelected()) { + source_type = "ZIP"; + } else { + source_type = "METS"; + } - /* Package Source */ + /* Package Source */ - if (putPackageSourceTextField.getText().compareTo("") != 0) { - File start_loc = new File(putPackageSourceTextField.getText()); - int count = 0; + if (putPackageSourceTextField.getText().compareTo("") != 0) { + File start_loc = new File( + putPackageSourceTextField.getText()); + int count = 0; - if (source_type.compareToIgnoreCase("METS") == 0) { - if (!(start_loc.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 || start_loc.getName().compareToIgnoreCase( - HaSConstants.METS_FILE_NAME) == 0)) { - JOptionPane.showMessageDialog(null, "Source Location cannot be a directory if Source Type is METS"); - logger.removeAppender(putAppender); - return null; - } else { - // push it on the file stack - fileStack.push(start_loc); - } - } - if (source_type.compareToIgnoreCase("ZIP") == 0) { - if (!start_loc.getName().endsWith(".zip")) { - JOptionPane.showMessageDialog(null, "Source Location must be a zip file if Source Type is Zip file"); - logger.removeAppender(putAppender); - return null; - } else { - // push it on the file stack - fileStack.push(start_loc); - } - } - if (source_type.compareToIgnoreCase("LIST") == 0) { - if (!start_loc.getName().endsWith(".zip")) { - JOptionPane.showMessageDialog(null, "Source Location cannot be a directory if Source Type is List"); - logger.removeAppender(putAppender); - return null; - } else { - BufferedReader input = null; - try { - input = new BufferedReader(new FileReader(start_loc)); - String line = null; + if (source_type.compareToIgnoreCase("METS") == 0) { + if (!(start_loc.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || start_loc.getName(). + compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0)) { + JOptionPane.showMessageDialog(null, + "Source Location cannot be a directory if Source Type is METS"); + logger.removeAppender(putAppender); + return null; + } else { + // push it on the file stack + fileStack.push(start_loc); + } + } + if (source_type.compareToIgnoreCase("ZIP") == 0) { + if (!start_loc.getName().endsWith(".zip")) { + JOptionPane.showMessageDialog(null, + "Source Location must be a zip file if Source Type is Zip file"); + logger.removeAppender(putAppender); + return null; + } else { + // push it on the file stack + fileStack.push(start_loc); + } + } + if (source_type.compareToIgnoreCase("LIST") == 0) { + if (!start_loc.getName().endsWith(".zip")) { + JOptionPane.showMessageDialog(null, + "Source Location cannot be a directory if Source Type is List"); + logger.removeAppender(putAppender); + return null; + } else { + BufferedReader input = null; + try { + input = new BufferedReader(new FileReader( + start_loc)); + String line = null; - // read the file line-by-line - while ((line = input.readLine()) != null) { + logger.info("Reading text file..."); - if (line.charAt(0) != '\'') { - // skip lines beginning with a single - // quote + // read the file line-by-line + while ((line = input.readLine()) != null) { - File nextFile = new File(line.toString()); + if (line.charAt(0) != '\'') { + // skip lines beginning with a single + // quote - if (!nextFile.exists()) { - logger.error("File processing error: " + line.toString() + " does not exist."); - } else if (!nextFile.isAbsolute()) { - logger.error("File processing error: " + line.toString() + " is not an absolute filename."); - } else if (nextFile.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || nextFile.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0 - || nextFile.getName().endsWith(".zip")) { + File nextFile = + new File(line.toString()); - // push it on the file stack - fileStack.push(nextFile); - } else { - logger.error("File processing error: " + "cannot create a Hub package at " + nextFile.getPath() + "."); - } - } - } - } catch (FileNotFoundException e) { - JOptionPane.showMessageDialog(null, "File not found: " + start_loc.getAbsolutePath()); - logger.removeAppender(putAppender); - return null; - } catch (IOException e) { - JOptionPane.showMessageDialog(null, "Error opening file: " + start_loc.getAbsolutePath()); - logger.removeAppender(putAppender); - return null; - } - try { - if (input != null) { - input.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } + if (!nextFile.exists()) { + logger.error( + "File processing error: " + + line.toString() + + " does not exist."); + } else if (!nextFile.isAbsolute()) { + logger.error( + "File processing error: " + + line.toString() + + " is not an absolute filename."); + } else if (nextFile.getName(). + compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || nextFile.getName(). + compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == + 0 || + nextFile.getName().endsWith( + ".zip")) { + + // push it on the file stack + fileStack.push(nextFile); + } else { + logger.error( + "File processing error: " + + "cannot create a Hub package at " + nextFile.getPath() + "."); } - if (source_type.compareToIgnoreCase("DIR") == 0) { - if (!start_loc.isDirectory()) { - JOptionPane.showMessageDialog(null, "Source Location must be a directory if Source Type is Directory Crawl"); - logger.removeAppender(putAppender); - return null; - } else { - dirStack.push(start_loc); + } + } + } catch (FileNotFoundException e) { + JOptionPane.showMessageDialog(null, + "File not found: " + start_loc. + getAbsolutePath()); + logger.removeAppender(putAppender); + return null; + } catch (IOException e) { + JOptionPane.showMessageDialog(null, + "Error opening file: " + start_loc. + getAbsolutePath()); + logger.removeAppender(putAppender); + return null; + } + try { + if (input != null) { + input.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + if (source_type.compareToIgnoreCase("DIR") == 0) { + if (!start_loc.isDirectory()) { + JOptionPane.showMessageDialog(null, + "Source Location must be a directory if Source Type is Directory Crawl"); + logger.removeAppender(putAppender); + return null; + } else { + dirStack.push(start_loc); - while (!dirStack.isEmpty()) { - File[] filesAndDirs = dirStack.pop().listFiles(); - for (File file : filesAndDirs) { - if (file.isDirectory()) { - dirStack.push(file); - } - if (file.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || file.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0 || file.getName().endsWith(".zip")) { + logger.info("Crawling directory...."); - // push it on the file stack - fileStack.push(file); - } - } - } - } - } + while (!dirStack.isEmpty()) { + File[] filesAndDirs = dirStack.pop().listFiles(); + for (File file : filesAndDirs) { + if (file.isDirectory()) { + dirStack.push(file); + } + if (file.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || file.getName(). + compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0 || file.getName(). + endsWith(".zip")) { - // go through the file stack, create Hub packages, - // push mastermets onto the mets stack - while (!fileStack.isEmpty()) { - File f = fileStack.pop(); + // push it on the file stack + fileStack.push(file); + } + } + } + } + } - if (f.getName().compareToIgnoreCase(HaSConstants.MASTER_METS_FILE_NAME) == 0 - || f.getName().compareToIgnoreCase(HaSConstants.METS_FILE_NAME) == 0) { + // go through the file stack, create Hub packages, + // push mastermets onto the mets stack + while (!fileStack.isEmpty()) { + File f = fileStack.pop(); - // it's a mets file, so create hub package and push - // the - // master mets - try { - // first, move the package to a temp directory - File working_dir = new File(tempdir, f.getParentFile().getName()); - HaSFileUtils.copyDirectory(f.getParentFile(), working_dir); + if (f.getName().compareToIgnoreCase( + HaSConstants.MASTER_METS_FILE_NAME) == 0 || f. + getName().compareToIgnoreCase( + HaSConstants.METS_FILE_NAME) == 0) { - HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance(working_dir.getPath()); - if (mm != null) { - mets_stack.push(mm); - count++; - } - } catch (IOException e) { - logger.error("Error creating Hub package for: " + f.getName()); - } - } else if (f.getName().endsWith(".zip")) { + // it's a mets file, so create hub package and push + // the + // master mets + try { + // first, move the package to a temp directory + File working_dir = new File(tempdir, f. + getParentFile().getName()); + HaSFileUtils.copyDirectory(f.getParentFile(), + working_dir); - // it's a zip file, so create hub package and push - // the - // master mets - try { - HaSMasterMETSProfile mm = HaSMasterMETSProfileFactory.newInstance(new ZipFile(f), tempdir, true); - if (mm != null) { - mets_stack.push(mm); - count++; - } - } catch (ZipException e) { - logger.error("Error creating Hub package for: " + f.getName()); - } catch (HaSMETSProfileException e) { - logger.error("Error creating Hub package for: " + f.getName()); - } catch (IOException e) { - logger.error("Error creating Hub package for: " + f.getName()); - } - } - } - logger.info("Found " + count + " items to submit"); - } else { - JOptionPane.showMessageDialog(null, "You must supply a package to submit"); - logger.removeAppender(putAppender); - return null; + HaSMasterMETSProfile mm = + HaSMasterMETSProfileFactory.newInstance( + working_dir.getPath()); + if (mm != null) { + mets_stack.push(mm); + count++; } + } catch (IOException e) { + logger.error( + "Error creating Hub package for: " + f. + getName()); + } + } else if (f.getName().endsWith(".zip")) { - /* Packager Class */ - - if (putPackagerClassComboBox.getSelectedItem() != null) { - packager_class_name = putPackagerClassComboBox.getSelectedItem().toString(); - } else { - JOptionPane.showMessageDialog(null, "You must select a packager class"); - logger.removeAppender(putAppender); - return null; + // it's a zip file, so create hub package and push + // the + // master mets + try { + HaSMasterMETSProfile mm = + HaSMasterMETSProfileFactory.newInstance( + new ZipFile(f), tempdir, true); + if (mm != null) { + mets_stack.push(mm); + count++; } + } catch (ZipException e) { + logger.warn("Error creating Hub package for: " + + f.getName() + " (" + e.getMessage() + ")\n"); + } catch (HaSMETSProfileException e) { + logger.warn("Error creating Hub package for: " + + f.getName() + " (" + e.getMessage() + ")\n"); + } catch (IOException e) { + logger.warn("Error creating Hub package for: " + + f.getName() + " (" + e.getMessage() + ")\n"); + } + } + } + logger.info("Found " + count + " items to submit"); + } else { + JOptionPane.showMessageDialog(null, + "You must supply a package to submit"); + logger.removeAppender(putAppender); + return null; + } - /* Keep Zips? */ + /* Packager Class */ - if (putKeepCopyYesRadioButton.isSelected()) { - keep_zip = true; - } + if (putPackagerClassComboBox.getSelectedItem() != null) { + packager_class_name = putPackagerClassComboBox. + getSelectedItem().toString(); + } else { + JOptionPane.showMessageDialog(null, + "You must select a packager class"); + logger.removeAppender(putAppender); + return null; + } - if (keep_zip) { - if (putKeepCopyTextField.getText().compareTo("") != 0) { - zip_dest = putKeepCopyTextField.getText(); - File zip_loc = new File(zip_dest); - if (!zip_loc.isDirectory()) { - JOptionPane.showMessageDialog(null, zip_loc.getAbsolutePath() + " is not a directory. Please supply a directory"); - logger.removeAppender(putAppender); - return null; - } - } - } + /* Keep Zips? */ - /* Submit Package */ + if (putKeepCopyYesRadioButton.isSelected()) { + keep_zip = true; + } - PackageSubmission ps = new PackageSubmission(logger); + if (keep_zip) { + if (putKeepCopyTextField.getText().compareTo("") != 0) { + zip_dest = putKeepCopyTextField.getText(); + File zip_loc = new File(zip_dest); + if (!zip_loc.isDirectory()) { + JOptionPane.showMessageDialog(null, + zip_loc.getAbsolutePath() + + " is not a directory. Please supply a directory"); + logger.removeAppender(putAppender); + return null; + } + } + } - while (!mets_stack.isEmpty()) { - logger.info("Processing " + mets_stack.peek().getBaseURI().toString() + "..."); + /* Submit Package */ - try { - String handle = ps.postPackage(client, coll_id); + PackageSubmission ps = new PackageSubmission(logger); - ps.submitPackage(mets_stack.pop(), client, handle, zip_dest, packager_class_name, keep_zip); + while (!mets_stack.isEmpty()) { + logger.info("Processing " + mets_stack.peek().getBaseURI(). + toString() + "..."); - } catch (LrcrudClientException e) { - JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " - + client.getBaseURL().toString()); - logger.removeAppender(putAppender); - return null; - } - } + try { + String handle = ps.postPackage(client, coll_id); - logger.removeAppender(putAppender); - return null; - } - }; - worker.execute(); - } + ps.submitPackage(mets_stack.pop(), client, handle, + zip_dest, packager_class_name, keep_zip); + } catch (LrcrudClientException e) { + JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + client.getBaseURL(). + toString()); + logger.removeAppender(putAppender); + return null; + } + } + + logger.removeAppender(putAppender); + return null; + } + }; + worker.execute(); + } + /** * * @param evt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-27 19:17:20
|
Revision: 861 http://echodep.svn.sourceforge.net/echodep/?rev=861&view=rev Author: bill_ingram Date: 2009-05-27 19:17:13 +0000 (Wed, 27 May 2009) Log Message: ----------- Bug fix: filenotfound exception when adding PREMIS object TechMD to files that don't exist Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-05-27 16:33:13 UTC (rev 860) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/profile/METSProfile.java 2009-05-27 19:17:13 UTC (rev 861) @@ -1115,6 +1115,9 @@ MetsMdSecType.MdWrap.MDTYPE.PREMIS); File f = new File(this.baseURI.resolve(ft.getFLocatArray(0).getHref())); + if(!f.exists()){ + throw new HaSMETSProfileException("File not found: " + f.getPath()); + } PremisObjectDocument pDocObj = createPremisObject(f, idType, idVal); PremisObjectDocument.Object pObj = pDocObj.getObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-27 16:33:26
|
Revision: 860 http://echodep.svn.sourceforge.net/echodep/?rev=860&view=rev Author: bill_ingram Date: 2009-05-27 16:33:13 +0000 (Wed, 27 May 2009) Log Message: ----------- Bug Fix: Authentication: when no username/password were given, no exception was being thrown or caught. Strange results followed when calls were made on the http object. Modified Paths: -------------- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java Modified: trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java =================================================================== --- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-05-27 16:33:10 UTC (rev 859) +++ trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-05-27 16:33:13 UTC (rev 860) @@ -230,7 +230,9 @@ } //check for valid date header - if (http.getDate() == 0) { + long the_date = http.getDate(); + + if (the_date == 0) { throw new RuntimeException("The LRCRUD response is missing the Date"); } //check that Date is within one hour of actual time @@ -241,8 +243,10 @@ //if the status code is OK then check for unexpected response headers int rcode; + String rmessage; try { rcode = http.getResponseCode(); + rmessage = http.getResponseMessage(); } catch (IOException e) { throw new RuntimeException(e); } @@ -264,7 +268,10 @@ if (http.getHeaderField("Transport-Encoding") != null && http.getHeaderField("Transport-Encoding").compareToIgnoreCase("chunked") != 0) { throw new RuntimeException("The LRCRUD response has an invalid Transport-Encoding '" + http.getHeaderField("Transport-Encoding") + "'"); } - } + } else { + http.disconnect(); + throw new LrcrudClientException(rcode + ": " + rmessage); + } rr.url = uri.toString(); rr.http = http; @@ -565,6 +572,10 @@ URI thisURI = null; try { + String location = this.getLocation(); + if (location == null) { + throw new LrcrudClientException("Unauthorized"); + } locURI = new URI(this.getLocation()); thisURI = baseURL; } catch (URISyntaxException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-27 16:33:15
|
Revision: 859 http://echodep.svn.sourceforge.net/echodep/?rev=859&view=rev Author: bill_ingram Date: 2009-05-27 16:33:10 +0000 (Wed, 27 May 2009) Log Message: ----------- Bug Fix: Authentication: when no username/password were given, no exception was being thrown or caught. Strange results followed when calls were made on the http object. Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java 2009-05-26 21:44:20 UTC (rev 858) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/PackageDissemination.java 2009-05-27 16:33:10 UTC (rev 859) @@ -73,178 +73,160 @@ */ public class PackageDissemination { - // log4j logger - static Logger logger; + // log4j logger + static Logger logger; - /** - * - */ - public PackageDissemination() { - logger = Logger.getLogger("console"); - } + /** + * + */ + public PackageDissemination() { + logger = Logger.getLogger("console"); + } - /** - * - */ - public PackageDissemination(Logger log) { - logger = log; - } + /** + * + */ + public PackageDissemination(Logger log) { + logger = log; + } - /** - * @param args - */ - public static void main(String[] args) { - // TODO Auto-generated method stub + /** + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + } - } - - /** - * Retrieves package from repository; creates a directory and extracts the - * contents of the retrieved zip file; and updates or builds an EchoDep METS - * file for the exported package. - * - * @param crud_client - * -- LRCRUD client - * @param item_id - * -- Repository ID or Handle of the package to be disseminated - * @param diss_dest - * -- Destination directory for the disseminated files - * @param package_class_name - * -- ToHubPackager class - * @param overwrite - * -- Overwrite existing export directories with the same name - * - * @return path to the disseminated package's MasterMETS file - */ - public String disseminatePackage(LrcrudClient crud_client, String item_id, - String diss_dest, String packager_class_name, boolean overwrite, - boolean bagit) { - try { - item_id = item_id.trim(); - logger.info("Retrieving package " + item_id); + /** + * Retrieves package from repository; creates a directory and extracts the + * contents of the retrieved zip file; and updates or builds an EchoDep METS + * file for the exported package. + * + * @param crud_client + * -- LRCRUD client + * @param item_id + * -- Repository ID or Handle of the package to be disseminated + * @param diss_dest + * -- Destination directory for the disseminated files + * @param package_class_name + * -- ToHubPackager class + * @param overwrite + * -- Overwrite existing export directories with the same name + * + * @return path to the disseminated package's MasterMETS file + */ + public String disseminatePackage(LrcrudClient crud_client, String item_id, + String diss_dest, String packager_class_name, boolean overwrite, + boolean bagit) throws LrcrudClientException { + try { + item_id = item_id.trim(); + logger.info("Retrieving package " + item_id); + RetrieveResponse rr = crud_client.retrieve(item_id); - RetrieveResponse rr = null; - int count = 0; - boolean okay = false; - while (count < 3 && !okay) { - rr = crud_client.retrieve(item_id); - okay = (rr.getStatusCode() == HttpURLConnection.HTTP_OK); - count++; - } + logger.info("Saving export zip file"); + String fixed_item_id = item_id; + fixed_item_id = fixed_item_id.replaceAll("/", "_"); + fixed_item_id = fixed_item_id.replaceAll(":", "_"); - if (!okay) { - throw new LrcrudClientException(rr.getStatusCode() + - ": " + - rr.getUrl()); - } + File dest_dir = new File(diss_dest + File.separator + fixed_item_id); + logger.info("Creating destination directory: " + dest_dir. + getAbsolutePath()); - logger.info("Saving export zip file"); - String fixed_item_id = item_id; - fixed_item_id = fixed_item_id.replaceAll("/", "_"); - fixed_item_id = fixed_item_id.replaceAll(":", "_"); - - File dest_dir = new File(diss_dest + File.separator + fixed_item_id); - logger.info("Creating destination directory: " - + dest_dir.getAbsolutePath()); - - if (dest_dir.exists() && !overwrite) { - boolean good_answer = false; - while (!good_answer) { - logger - .warn("Directory already exists. Replace it? yes / no / yes for all (y/n/a)"); - BufferedReader cin = new BufferedReader( - new InputStreamReader(System.in)); - String ans = cin.readLine().toLowerCase(); - if (ans.startsWith("n")) { - good_answer = true; - logger - .info("Package '" + item_id - + "' was skipped\r\n"); - return null; - } - if (ans.startsWith("a")) { - good_answer = true; - overwrite = true; - HaSFileUtils.deleteDirectory(dest_dir); - } - if (ans.startsWith("y")) { - good_answer = true; - if (!HaSFileUtils.deleteDirectory(dest_dir)) { - logger.error("Delete failed!"); - } - } - } + if (dest_dir.exists() && !overwrite) { + boolean good_answer = false; + while (!good_answer) { + logger.warn( + "Directory already exists. Replace it? yes / no / yes for all (y/n/a)"); + BufferedReader cin = new BufferedReader( + new InputStreamReader(System.in)); + String ans = cin.readLine().toLowerCase(); + if (ans.startsWith("n")) { + good_answer = true; + logger.info("Package '" + item_id + "' was skipped\r\n"); + return null; + } + if (ans.startsWith("a")) { + good_answer = true; + overwrite = true; + HaSFileUtils.deleteDirectory(dest_dir); + } + if (ans.startsWith("y")) { + good_answer = true; + if (!HaSFileUtils.deleteDirectory(dest_dir)) { + logger.error("Delete failed!"); } - if (dest_dir.exists() && overwrite) { - if (!HaSFileUtils.deleteDirectory(dest_dir)) { - logger.error("Directory overwrite failed for " - + dest_dir.getAbsolutePath()); - } - } - boolean made = dest_dir.mkdirs(); - if (!made) { - logger.error("Error creating directory at " - + dest_dir.getAbsolutePath()); - logger.info("Package '" + item_id + "' was skipped\r\n"); - return null; - } + } + } + } + if (dest_dir.exists() && overwrite) { + if (!HaSFileUtils.deleteDirectory(dest_dir)) { + logger.error("Directory overwrite failed for " + dest_dir. + getAbsolutePath()); + } + } + boolean made = dest_dir.mkdirs(); + if (!made) { + logger.error("Error creating directory at " + dest_dir. + getAbsolutePath()); + logger.info("Package '" + item_id + "' was skipped\r\n"); + return null; + } - File zip_loc = new File(dest_dir.getAbsolutePath() + File.separator - + fixed_item_id + ".zip"); - rr.save(zip_loc.getAbsolutePath()); - ZipFile zip = new ZipFile(zip_loc.getAbsolutePath()); + File zip_loc = + new File(dest_dir.getAbsolutePath() + File.separator + + fixed_item_id + ".zip"); + rr.save(zip_loc.getAbsolutePath()); + ZipFile zip = new ZipFile(zip_loc.getAbsolutePath()); - logger.info("Creating Packager"); - ToHubPackagerFactory tpf = new ToHubPackagerFactory(); - ToHubPackager packager = tpf - .createToHubPackager(packager_class_name); + logger.info("Creating Packager"); + ToHubPackagerFactory tpf = new ToHubPackagerFactory(); + ToHubPackager packager = + tpf.createToHubPackager(packager_class_name); - logger.info("Packaging files"); - boolean ok = packager.createHubPackage(zip, dest_dir - .getAbsolutePath(), null); + logger.info("Packaging files"); + boolean ok = packager.createHubPackage(zip, + dest_dir.getAbsolutePath(), null); - logger.info("Deleting temporary files"); - zip.close(); - boolean success = zip_loc.delete(); - if (!success) - logger.warn("Delete failed!"); + logger.info("Deleting temporary files"); + zip.close(); + boolean success = zip_loc.delete(); + if (!success) { + logger.warn("Delete failed!"); + } - if (ok) - if (bagit) { - logger.info("Creating Bagit archive"); - HaSMasterMETSProfile mastermets = HaSMasterMETSProfileFactory - .newInstance(new File(dest_dir.getPath() - + File.separator - + HaSConstants.MASTER_METS_FILE_NAME)); + if (ok) { + if (bagit) { + logger.info("Creating Bagit archive"); + HaSMasterMETSProfile mastermets = + HaSMasterMETSProfileFactory.newInstance(new File(dest_dir.getPath() + File.separator + + HaSConstants.MASTER_METS_FILE_NAME)); - logger.info("Generating JHOVE metadata"); - HaSMETSProfile echodepmets = mastermets - .getMostRecentEchoDepMETS(); - TechMDAugmenter.addJhoveToProfile(echodepmets); - Hub2BagitPackager.createBagitPackage(mastermets, dest_dir.getAbsolutePath(), - dest_dir.getName()); - } - logger.info("Done!\r\n"); - - return dest_dir.getPath() - + File.separator - + HaSConstants.MASTER_METS_FILE_NAME; - - } catch (LrcrudClientException e) { - logger.error(e); - e.printStackTrace(); - } catch (IOException e) { - logger.error(e); - e.printStackTrace(); - } catch (PackagerException e) { - logger.error(e); - e.printStackTrace(); - } catch (HaSMETSProfileException e) { - logger.error(e); - e.printStackTrace(); + logger.info("Generating JHOVE metadata"); + HaSMETSProfile echodepmets = mastermets. + getMostRecentEchoDepMETS(); + TechMDAugmenter.addJhoveToProfile(echodepmets); + Hub2BagitPackager.createBagitPackage(mastermets, dest_dir. + getAbsolutePath(), + dest_dir.getName()); } - - return null; + } + logger.info("Done!\r\n"); + return dest_dir.getPath() + File.separator + + HaSConstants.MASTER_METS_FILE_NAME; + + } catch (IOException e) { + logger.error(e); + e.printStackTrace(); + } catch (PackagerException e) { + logger.error(e); + e.printStackTrace(); + } catch (HaSMETSProfileException e) { + logger.error(e); + e.printStackTrace(); } + + return null; + + } } Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-26 21:44:20 UTC (rev 858) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-27 16:33:10 UTC (rev 859) @@ -195,7 +195,7 @@ LrcrudClient client = null; String coll_id; String source_type; - String zip_dest = tempdir.toString(); + String zip_dest = tempdir.getPath(); String packager_class_name; boolean keep_zip = false; @@ -690,8 +690,16 @@ while (!id_stack.isEmpty()) { logger.info("Processing item " + id_stack.peek() + "..."); - pd.disseminatePackage(client, id_stack.pop(), dest_path, - packager_class_name, replace_dups, bagit); + + try { + pd.disseminatePackage(client, id_stack.pop(), dest_path, + packager_class_name, replace_dups, bagit); + } catch (LrcrudClientException e) { + JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + client.getBaseURL(). + toString()); + logger.removeAppender(getAppender); + return null; + } } logger.removeAppender(getAppender); @@ -920,12 +928,21 @@ while (!id_stack.isEmpty()) { logger.info("Processing item " + id_stack.peek() + "..."); - String mm_path = pd.disseminatePackage(get_client, id_stack. - pop(), - get_dest_path, - get_packager_class_name, replace_dups, false); + String mm_path = ""; + try { + mm_path = pd.disseminatePackage(get_client, + id_stack.pop(), + get_dest_path, + get_packager_class_name, replace_dups, false); + } catch (LrcrudClientException e) { + JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + get_client.getBaseURL(). + toString()); + logger.removeAppender(migrateAppender); + return null; + } + HaSMasterMETSProfile mm = null; try { mm = HaSMasterMETSProfileFactory.newInstance(new File( @@ -947,7 +964,7 @@ String put_crud_url; LrcrudClient put_client = null; String put_coll_id; - String put_zip_dest = ""; + String put_zip_dest = tempdir.getPath(); String put_packager_class_name; boolean put_keep_zip = false; @@ -1021,8 +1038,6 @@ " is not a directory. Please supply a directory"); return null; } - } else { - put_zip_dest = System.getProperty("java.io.tmpdir"); } } @@ -1044,8 +1059,10 @@ put_keep_zip); } catch (LrcrudClientException e) { - logger.error(e); - e.printStackTrace(); + JOptionPane.showMessageDialog(null, "Error connecting to LRCRUD service at " + put_client.getBaseURL(). + toString()); + logger.removeAppender(migrateAppender); + return null; } } @@ -2582,7 +2599,7 @@ String location; String source_type; - String zip_dest = ""; + String zip_dest = tempdir.getPath(); String packager_class_name; boolean keep_zip = false; @@ -2845,9 +2862,7 @@ " is not a directory. Please supply a directory"); return null; } - } else { - zip_dest = System.getProperty("java.io.tmpdir"); - } + } } /* Set POST options */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-26 21:44:22
|
Revision: 858 http://echodep.svn.sourceforge.net/echodep/?rev=858&view=rev Author: bill_ingram Date: 2009-05-26 21:44:20 +0000 (Tue, 26 May 2009) Log Message: ----------- formatting Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-26 21:43:06 UTC (rev 857) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.java 2009-05-26 21:44:20 UTC (rev 858) @@ -195,7 +195,7 @@ LrcrudClient client = null; String coll_id; String source_type; - String zip_dest = ""; + String zip_dest = tempdir.toString(); String packager_class_name; boolean keep_zip = false; @@ -432,8 +432,6 @@ logger.removeAppender(putAppender); return null; } - } else { - zip_dest = null; } } @@ -1898,17 +1896,16 @@ .addComponent(putKeepCopyTextField, GroupLayout.PREFERRED_SIZE, 287, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(putKeepCopyBrowseButton)) - .addGroup(putPanelLayout.createParallelGroup(Alignment.TRAILING, false) - .addComponent(putPackagerClassComboBox, Alignment.LEADING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(Alignment.LEADING, putPanelLayout.createSequentialGroup() - .addComponent(putPackageSourceTextField, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE) - .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(putPackageSourceBrowseButton))) .addGroup(putPanelLayout.createSequentialGroup() .addGap(227, 227, 227) .addComponent(putCancelButton) .addPreferredGap(ComponentPlacement.RELATED) - .addComponent(putSubmitButton))) + .addComponent(putSubmitButton)) + .addGroup(putPanelLayout.createSequentialGroup() + .addComponent(putPackageSourceTextField, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(putPackageSourceBrowseButton)) + .addComponent(putPackagerClassComboBox, GroupLayout.PREFERRED_SIZE, 346, GroupLayout.PREFERRED_SIZE)) .addGap(22, 22, 22)) ); putPanelLayout.setVerticalGroup( @@ -2328,8 +2325,8 @@ swordCollectionLocationLabel.setFont(new Font("Tahoma", 1, 11)); swordCollectionLocationLabel.setText("Collection Location URL"); + swordCollectionLocationComboBox.setFont(new Font("Tahoma", 0, 10)); - swordCollectionLocationComboBox.setFont(new Font("Tahoma", 0, 10)); // NOI18N swordPackageSourceTypeLabel.setFont(new Font("Tahoma", 1, 11)); swordPackageSourceTypeLabel.setText("Source Type"); @@ -2508,7 +2505,7 @@ .addGroup(swordPostPanelLayout.createParallelGroup(Alignment.BASELINE) .addComponent(swordCancelButton) .addComponent(swordSubmitButton)) - .addContainerGap(55, Short.MAX_VALUE)) + .addContainerGap(56, Short.MAX_VALUE)) ); swordPostPane.setLeftComponent(swordPostPanel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-26 21:43:21
|
Revision: 857 http://echodep.svn.sourceforge.net/echodep/?rev=857&view=rev Author: bill_ingram Date: 2009-05-26 21:43:06 +0000 (Tue, 26 May 2009) Log Message: ----------- formatting Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form 2009-05-26 21:42:23 UTC (rev 856) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/workflow/WorkflowManagerGUI.form 2009-05-26 21:43:06 UTC (rev 857) @@ -631,20 +631,18 @@ <EmptySpace max="-2" attributes="0"/> <Component id="putKeepCopyBrowseButton" min="-2" max="-2" attributes="0"/> </Group> - <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> - <Component id="putPackagerClassComboBox" alignment="0" max="32767" attributes="1"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="putPackageSourceTextField" min="-2" pref="286" max="-2" attributes="1"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="putPackageSourceBrowseButton" min="-2" max="-2" attributes="0"/> - </Group> - </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="227" pref="227" max="227" attributes="0"/> <Component id="putCancelButton" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="putSubmitButton" min="-2" max="-2" attributes="0"/> </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="putPackageSourceTextField" min="-2" pref="286" max="-2" attributes="1"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="putPackageSourceBrowseButton" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="putPackagerClassComboBox" alignment="0" min="-2" pref="346" max="-2" attributes="1"/> </Group> <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> </Group> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-26 21:42:50
|
Revision: 856 http://echodep.svn.sourceforge.net/echodep/?rev=856&view=rev Author: bill_ingram Date: 2009-05-26 21:42:23 +0000 (Tue, 26 May 2009) Log Message: ----------- Checking to make sure HS_HOME has been set Modified Paths: -------------- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java Modified: trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java =================================================================== --- trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-05-26 21:32:28 UTC (rev 855) +++ trunk/hubandspoke/src/edu/uiuc/ndiipp/hubandspoke/packager/Hub2FedoraPackager.java 2009-05-26 21:42:23 UTC (rev 856) @@ -149,7 +149,10 @@ } addFilesToZip(mastermets, zip); - + + if (System.getenv("HS_HOME") == null) { + throw new PackagerException("The HS_HOME environment variable is not set."); + } try { // FIXME pulling the location of the HaS installation from the // environmental variable for now This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-26 21:32:35
|
Revision: 855 http://echodep.svn.sourceforge.net/echodep/?rev=855&view=rev Author: bill_ingram Date: 2009-05-26 21:32:28 +0000 (Tue, 26 May 2009) Log Message: ----------- CreateResponse.create: uri = baseURL.resolve(location) was not properly working. Modified Paths: -------------- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java Modified: trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java =================================================================== --- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-05-26 21:10:58 UTC (rev 854) +++ trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-05-26 21:32:28 UTC (rev 855) @@ -137,7 +137,7 @@ try { //uri = new URI(URLEncoder.encode(location, "UTF-8")); - uri = new URI(location); + uri = new URI("./" + location); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); } catch (URISyntaxException ex) { @@ -194,7 +194,7 @@ try { // uri = new URI(URLEncoder.encode(identifier, "UTF-8")); - uri = new URI(identifier); + uri = new URI("./" + identifier); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); } catch (URISyntaxException ex) { @@ -300,7 +300,7 @@ try { // uri = new URI(URLEncoder.encode(identifier, "UTF-8")); - uri = new URI(identifier); + uri = new URI("./" + identifier); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); } catch (URISyntaxException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-05-26 21:11:16
|
Revision: 854 http://echodep.svn.sourceforge.net/echodep/?rev=854&view=rev Author: bill_ingram Date: 2009-05-26 21:10:58 +0000 (Tue, 26 May 2009) Log Message: ----------- formatting Modified Paths: -------------- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java Modified: trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java =================================================================== --- trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-04-27 17:13:26 UTC (rev 853) +++ trunk/lrcrud-client/src/edu/uiuc/ndiipp/hubandspoke/lrcrud/client/LrcrudClient.java 2009-05-26 21:10:58 UTC (rev 854) @@ -57,757 +57,742 @@ * */ public class LrcrudClient { - protected URI baseURL; - private String userAgent = "LrcrudClient/0.1"; + protected URI baseURL; + private String userAgent = "LrcrudClient/0.1"; + private String from = "th...@ui..."; - private String from = "th...@ui..."; + /** + * Creates a new instance of the LrcrudClient ready to communicate to the + * LRCRUD Service at the given URL. + * + * @param url an absolute URL giving the base location for the LRCRUD service + * @throws LrcrudClientException + */ + public LrcrudClient(String url) throws LrcrudClientException { + if (!url.endsWith("/")) { + url = url.concat("/"); + } + try { + baseURL = new URI(url); + } catch (URISyntaxException ex) { + throw new LrcrudClientException("The URL '" + url + "' is not a valid URI.", ex); + } - /** - * Creates a new instance of the LrcrudClient ready to communicate to the - * LRCRUD Service at the given URL. - * - * @param url an absolute URL giving the base location for the LRCRUD service - * @throws LrcrudClientException - */ - public LrcrudClient(String url) throws LrcrudClientException { - if (!url.endsWith("/")) { - url = url.concat("/"); - } - try { - baseURL = new URI(url); - } catch (URISyntaxException ex) { - throw new LrcrudClientException("The URL '" + url - + "' is not a valid URI.", ex); - } + if (baseURL.getScheme().compareToIgnoreCase("http") == 0 && baseURL.getScheme().compareToIgnoreCase("https") == 0) { + throw new LrcrudClientException(baseURL.getScheme() + " The URL '" + url + "' does not use the http or https scheme."); + } - if (baseURL.getScheme().compareToIgnoreCase("http") == 0 - && baseURL.getScheme().compareToIgnoreCase("https") == 0) { - throw new LrcrudClientException(baseURL.getScheme() + " The URL '" - + url + "' does not use the http or https scheme."); - } - - Authenticator.setDefault(null); - } + Authenticator.setDefault(null); + } - /** - * Creates a new instance of the LrcrudClient ready to communicate to the - * LRCRUD Service at the given URL. - * - * @param url an absolute URL giving the base location for the LRCRUD service - * @param uid the user id of a person authorized to use the service - * @param pw the password for the authorized user - * @throws LrcrudClientException - */ - public LrcrudClient(String url, String uid, String pw) - throws LrcrudClientException { - this(url); - Authenticator.setDefault(new LrcrudClientAuthenticator(uid,pw)); - } - - /** - * Creates a new instance of the LrcrudClient ready to communicate to the - * LRCRUD Service at the given URL. - * - * @param url an absolute URL giving the base location for the LRCRUD service - * @param auth an extension of Authenticator - * @throws LrcrudClientException - */ - public LrcrudClient(String url, Authenticator auth) - throws LrcrudClientException { - this(url); - Authenticator.setDefault(auth); - } + /** + * Creates a new instance of the LrcrudClient ready to communicate to the + * LRCRUD Service at the given URL. + * + * @param url an absolute URL giving the base location for the LRCRUD service + * @param uid the user id of a person authorized to use the service + * @param pw the password for the authorized user + * @throws LrcrudClientException + */ + public LrcrudClient(String url, String uid, String pw) + throws LrcrudClientException { + this(url); + Authenticator.setDefault(new LrcrudClientAuthenticator(uid, pw)); + } - /** - * @return the baseURL - */ - public URI getBaseURL() { - return baseURL; - } + /** + * Creates a new instance of the LrcrudClient ready to communicate to the + * LRCRUD Service at the given URL. + * + * @param url an absolute URL giving the base location for the LRCRUD service + * @param auth an extension of Authenticator + * @throws LrcrudClientException + */ + public LrcrudClient(String url, Authenticator auth) + throws LrcrudClientException { + this(url); + Authenticator.setDefault(auth); + } - /** - * Sends a request to the LRCRUD Service to create (POST) a new package - * - * @param location the location in which the new package is to be created - * @return an LrcrudClient.CreateResponse object - * @throws LrcrudClientException - */ - public CreateResponse create(String location) - throws LrcrudClientException { - HttpURLConnection http; - URI uri; - CreateResponse cr = new CreateResponse(); + /** + * @return the baseURL + */ + public URI getBaseURL() { + return baseURL; + } - try { - //uri = new URI(URLEncoder.encode(location, "UTF-8")); - //uri = new URI(location); - uri = new URI(baseURL.toString() + location.trim()); + /** + * Sends a request to the LRCRUD Service to create (POST) a new package + * + * @param location the location in which the new package is to be created + * @return an LrcrudClient.CreateResponse object + * @throws LrcrudClientException + */ + public CreateResponse create(String location) + throws LrcrudClientException { + HttpURLConnection http; + URI uri; + CreateResponse cr = new CreateResponse(); + + try { + //uri = new URI(URLEncoder.encode(location, "UTF-8")); + uri = new URI(location); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); - } catch (URISyntaxException ex) { - throw new LrcrudClientException("Identifier '" + location - + "' cannot be used in a URI.", ex); - } + } catch (URISyntaxException ex) { + throw new LrcrudClientException("Identifier '" + location + "' cannot be used in a URI.", ex); + } - uri = baseURL.resolve(uri); - try { - http = (HttpURLConnection) uri.toURL().openConnection(); - } catch (IOException ex) { - throw new LrcrudClientException("Unable to open connection to '" - + uri.toString() + "'", ex); - } + uri = baseURL.resolve(uri); + try { + http = (HttpURLConnection) uri.toURL().openConnection(); + } catch (IOException ex) { + throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", ex); + } - http.setDoInput(true); - http.setAllowUserInteraction(false); - http.setInstanceFollowRedirects(true); + http.setDoInput(true); + http.setAllowUserInteraction(false); + http.setInstanceFollowRedirects(true); - try { - http.setRequestMethod("POST"); - } catch (ProtocolException ex) { - throw new RuntimeException(ex); - } - http.setRequestProperty("User-Agent", getUserAgent()); - http.setRequestProperty("From", getFrom()); - try { - http.connect(); - } catch (IOException ex) { - http.disconnect(); - throw new LrcrudClientException("Unable to open connection to '" - + uri.toString() + "'", ex); - } - - cr.url=uri.toString(); - cr.http=http; + try { + http.setRequestMethod("POST"); + } catch (ProtocolException ex) { + throw new RuntimeException(ex); + } + http.setRequestProperty("User-Agent", getUserAgent()); + http.setRequestProperty("From", getFrom()); + try { + http.connect(); + } catch (IOException ex) { + http.disconnect(); + throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", ex); + } - http.disconnect(); + cr.url = uri.toString(); + cr.http = http; - return cr; + http.disconnect(); - } + return cr; - /** - * Sends a request to the LRCRUD service to retrieve (GET) a specific package - * - * @param identifier the identifier of the package to retrieve - * @return an LrcrudClient.RetieveResponse object - * @throws LrcrudClientException - */ - public RetrieveResponse retrieve(String identifier) - throws LrcrudClientException { - HttpURLConnection http; - URI uri; - RetrieveResponse rr = new RetrieveResponse(); - final long oneHour =3600000; - - try { + } + + /** + * Sends a request to the LRCRUD service to retrieve (GET) a specific package + * + * @param identifier the identifier of the package to retrieve + * @return an LrcrudClient.RetieveResponse object + * @throws LrcrudClientException + */ + public RetrieveResponse retrieve(String identifier) + throws LrcrudClientException { + HttpURLConnection http; + URI uri; + RetrieveResponse rr = new RetrieveResponse(); + final long oneHour = 3600000; + + try { // uri = new URI(URLEncoder.encode(identifier, "UTF-8")); - //uri = new URI(identifier); - uri = new URI(baseURL.toString() + identifier.trim()); + uri = new URI(identifier); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); - } catch (URISyntaxException ex) { - throw new LrcrudClientException("Identifier '" + identifier - + "' cannot be used in a URI.", ex); - } - - uri = baseURL.resolve(uri); - try { - http = (HttpURLConnection) uri.toURL().openConnection(); - } catch (IOException ex) { - throw new LrcrudClientException("Unable to open connection to '" - + uri.toString() + "'", ex); - } - - http.setDoInput(true); - http.setDoOutput(false); - http.setAllowUserInteraction(false); - http.setUseCaches(false); - http.setInstanceFollowRedirects(true); - - try { - http.setRequestMethod("GET"); - } catch (ProtocolException ex) { - throw new RuntimeException(ex); - } - http.setRequestProperty("User-Agent", getUserAgent()); - http.setRequestProperty("From", getFrom()); - - try { - http.connect(); - } catch (IOException ex) { - http.disconnect(); - throw new LrcrudClientException("Unable to open connection to '" - + uri.toString() + "'", ex); - } - - //check for valid date header - if (http.getDate()==0) { - throw new RuntimeException("The LRCRUD response is missing the Date"); - } - //check that Date is within one hour of actual time - //long current=(new Date()).getTime(); - //if (http.getDate()>current+oneHour || http.getDate()<current-oneHour) { - // throw new RuntimeException("The LRCRUD response Date is more than one hour off"); - //} - - //if the status code is OK then check for unexpected response headers - int rcode; - try { - rcode = http.getResponseCode(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - if (rcode==HttpURLConnection.HTTP_OK) { - //check for inconsistent headers - if (http.getContentLength()!=-1 && http.getHeaderField("Transport-Encoding")!=null) { - throw new RuntimeException("The LRCRUD response contains both Content-Length and Tranport-Encoding headers"); - } - //check for missing headers - if (http.getHeaderField("Content-MD5")==null) { - throw new RuntimeException("The LRCRUD response is missing the Content-MD5"); - } - if (http.getHeaderField("Content-Type")==null) { - throw new RuntimeException("The LRCRUD response is missing the Content-Type"); - } else if ( http.getHeaderField("Content-Type").compareToIgnoreCase("application/zip")!=0) { - throw new RuntimeException("The LRCRUD response has an invalid Content-Type '" + http.getHeaderField("Content-Type") + "'"); - } - if (http.getHeaderField("Transport-Encoding")!=null && http.getHeaderField("Transport-Encoding").compareToIgnoreCase("chunked")!=0) { - throw new RuntimeException("The LRCRUD response has an invalid Transport-Encoding '" + http.getHeaderField("Transport-Encoding") + "'"); - } - } - - rr.url=uri.toString(); - rr.http=http; - - return rr; - - } + } catch (URISyntaxException ex) { + throw new LrcrudClientException("Identifier '" + identifier + "' cannot be used in a URI.", ex); + } - /** - * Sends a request to the LRCRUD Service to update (PUT) a new package - * - * @param identifier the identifier of the package to update - * @param source the location of the zip file which is to replace the current package - * @return an LrcrudClient.UpdateResponse object - */ - public UpdateResponse update(String identifier, String source) - throws LrcrudClientException { - File f = new File(source); - return update(identifier, f); - } - - /** - * Sends a request to the LRCRUD Service to update (PUT) a new package - * - * @param identifier the identifier of the package to update - * @param f file object representing the zip package - * @return an LrcrudClient.UpdateResponse object - */ - public UpdateResponse update(String identifier, File f) - throws LrcrudClientException { - UpdateResponse ur = new UpdateResponse(); - URI uri; - - try { + uri = baseURL.resolve(uri); + try { + http = (HttpURLConnection) uri.toURL().openConnection(); + } catch (IOException ex) { + throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", ex); + } + + http.setDoInput(true); + http.setDoOutput(false); + http.setAllowUserInteraction(false); + http.setUseCaches(false); + http.setInstanceFollowRedirects(true); + + try { + http.setRequestMethod("GET"); + } catch (ProtocolException ex) { + throw new RuntimeException(ex); + } + http.setRequestProperty("User-Agent", getUserAgent()); + http.setRequestProperty("From", getFrom()); + + try { + http.connect(); + } catch (IOException ex) { + http.disconnect(); + throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", ex); + } + + //check for valid date header + if (http.getDate() == 0) { + throw new RuntimeException("The LRCRUD response is missing the Date"); + } + //check that Date is within one hour of actual time + //long current=(new Date()).getTime(); + //if (http.getDate()>current+oneHour || http.getDate()<current-oneHour) { + // throw new RuntimeException("The LRCRUD response Date is more than one hour off"); + //} + + //if the status code is OK then check for unexpected response headers + int rcode; + try { + rcode = http.getResponseCode(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + if (rcode == HttpURLConnection.HTTP_OK) { + //check for inconsistent headers + if (http.getContentLength() != -1 && http.getHeaderField("Transport-Encoding") != null) { + throw new RuntimeException("The LRCRUD response contains both Content-Length and Tranport-Encoding headers"); + } + //check for missing headers + if (http.getHeaderField("Content-MD5") == null) { + throw new RuntimeException("The LRCRUD response is missing the Content-MD5"); + } + if (http.getHeaderField("Content-Type") == null) { + throw new RuntimeException("The LRCRUD response is missing the Content-Type"); + } else if (http.getHeaderField("Content-Type").compareToIgnoreCase("application/zip") != 0) { + throw new RuntimeException("The LRCRUD response has an invalid Content-Type '" + http.getHeaderField("Content-Type") + "'"); + } + if (http.getHeaderField("Transport-Encoding") != null && http.getHeaderField("Transport-Encoding").compareToIgnoreCase("chunked") != 0) { + throw new RuntimeException("The LRCRUD response has an invalid Transport-Encoding '" + http.getHeaderField("Transport-Encoding") + "'"); + } + } + + rr.url = uri.toString(); + rr.http = http; + + return rr; + + } + + /** + * Sends a request to the LRCRUD Service to update (PUT) a new package + * + * @param identifier the identifier of the package to update + * @param source the location of the zip file which is to replace the current package + * @return an LrcrudClient.UpdateResponse object + */ + public UpdateResponse update(String identifier, String source) + throws LrcrudClientException { + File f = new File(source); + return update(identifier, f); + } + + /** + * Sends a request to the LRCRUD Service to update (PUT) a new package + * + * @param identifier the identifier of the package to update + * @param f file object representing the zip package + * @return an LrcrudClient.UpdateResponse object + */ + public UpdateResponse update(String identifier, File f) + throws LrcrudClientException { + UpdateResponse ur = new UpdateResponse(); + URI uri; + + try { // uri = new URI(URLEncoder.encode(identifier, "UTF-8")); - uri = new URI(baseURL.toString() + identifier); + uri = new URI(identifier); // } catch (UnsupportedEncodingException ex) { // throw new RuntimeException(ex); - } catch (URISyntaxException ex) { - throw new LrcrudClientException("Identifier '" + identifier + "' cannot be used in a URI.", ex); - } - - uri = baseURL.resolve(uri); - - HaSChecksummer summer = new HaSChecksummer(); - - //To calc the MD5 must read through input stream completely - DataInputStream dis; - try { - dis = new DataInputStream(new CheckedInputStream(new FileInputStream(f), summer)); - } catch (FileNotFoundException e) { - throw new LrcrudClientException("Unable to open file '" + f.getPath() + "'", e); - } - - try { - while(dis.read()!=-1); - dis.close(); - } catch (IOException e1) { - throw new LrcrudClientException("Unable to read file '" + f.getPath() + "'", e1); - } - - String digest = summer.getBase64EncodedMD5(); - - //now reopen the input stream to send across the net - FileInputStream fis = null; - try { - fis =new FileInputStream(f); - } catch (FileNotFoundException e1) { - e1.printStackTrace(); - throw new LrcrudClientException("Unable to open file '" + f.getPath() + "'", e1); - } - - //establish URLConnection - HttpURLConnection http; - try { - http = (HttpURLConnection) uri.toURL().openConnection(); - } catch (MalformedURLException e) { - e.printStackTrace(); - throw new LrcrudClientException("URL '" + uri.toString() + "' is malformed", e); - } catch (IOException e) { - e.printStackTrace(); - throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", e); - } - - //Automatic authentication using the Authenticator class does not - //work when chunked encoding is used - //http.setChunkedStreamingMode(4 * 1024); - http.setDoOutput(true); - http.setDoInput(true); - http.setInstanceFollowRedirects(true); - - try { - http.setRequestMethod("PUT"); - } catch (ProtocolException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - - http.setRequestProperty("User-Agent", getUserAgent()); - http.setRequestProperty("From", getFrom()); - - //do not set content-length if using chunked encoding - http.setRequestProperty("Content-Length", Long.toString(f.length())); - //http.setRequestProperty("Transfer-Encoding", "chunked"); - - http.setRequestProperty("Connection", "close"); - http.setRequestProperty("Content-Type", "application/zip"); - http.setRequestProperty("Content-MD5", digest); - http.setRequestProperty("Last-Modified", HaSDateFormatter.formatDateForHTTP(new Date(f.lastModified()))); - - //send it down the wire - OutputStream out; - try { - out= http.getOutputStream(); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - - byte[] buf = new byte[4 * 1024]; - int bytesRead; - - try { - while ((bytesRead = fis.read(buf)) != -1) { - out.write(buf, 0, bytesRead); - out.flush(); - } - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - - try { - out.close(); - fis.close(); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - - ur.url=uri.toString(); - ur.http=http; - - - http.disconnect(); - - return ur; - } + } catch (URISyntaxException ex) { + throw new LrcrudClientException("Identifier '" + identifier + "' cannot be used in a URI.", ex); + } - /** - * Sends a request to the LRCRUD Service to delete (DELETE) a package - * - * @param identifier the identifier of the package to deleted - * @return an LrcrudClient.DeleteResponse object - */ - public DeleteResponse delete(String identifier) { - DeleteResponse dr = new DeleteResponse(); + uri = baseURL.resolve(uri); - return dr; - } + HaSChecksummer summer = new HaSChecksummer(); - /** - * Returns the value used for the From HTTP request header - * - * @return the value to be used with the HTTP From request header - */ - public String getFrom() { - return from; - } + //To calc the MD5 must read through input stream completely + DataInputStream dis; + try { + dis = new DataInputStream(new CheckedInputStream(new FileInputStream(f), summer)); + } catch (FileNotFoundException e) { + throw new LrcrudClientException("Unable to open file '" + f.getPath() + "'", e); + } - /** - * Returns the value used for the User-Agent request header - * - * @return the value to be used with the HTTP User-Agent request header - */ - public String getUserAgent() { - return userAgent; - } + try { + while (dis.read() != -1); + dis.close(); + } catch (IOException e1) { + throw new LrcrudClientException("Unable to read file '" + f.getPath() + "'", e1); + } - /** - * Sets the value used for the HTTP From request header. - * - * @param from the value to be used for the HTTP From request header. - */ - public void setFrom(String from) { - this.from = from; - } + String digest = summer.getBase64EncodedMD5(); - /** - * Sets the value used for the HTTP User-Agent request header. - * - * @param userAgent the value to be used with the HTTP User-Agent request header - */ - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } + //now reopen the input stream to send across the net + FileInputStream fis = null; + try { + fis = new FileInputStream(f); + } catch (FileNotFoundException e1) { + e1.printStackTrace(); + throw new LrcrudClientException("Unable to open file '" + f.getPath() + "'", e1); + } - /** - * This class represents a response returned by the LRCRUD service. This class is used - * as the base class for all the responses to specific requests. - * - * @author thabing - * - */ - public class LrcrudResponse { - - protected HttpURLConnection http=null; - protected String url; - - /** - * Make sure the http connection is disconnected is closed before this object is disposed. - * - * @throws Throwable - */ - protected void finalizer() throws Throwable { - super.finalize(); - //make sure the httpurlconection is disconnected to free resources - if (http != null) { - http.disconnect(); - http=null; - } - } - + //establish URLConnection + HttpURLConnection http; + try { + http = (HttpURLConnection) uri.toURL().openConnection(); + } catch (MalformedURLException e) { + e.printStackTrace(); + throw new LrcrudClientException("URL '" + uri.toString() + "' is malformed", e); + } catch (IOException e) { + e.printStackTrace(); + throw new LrcrudClientException("Unable to open connection to '" + uri.toString() + "'", e); + } - /** - * Returns the value of the HTTP Date response header - * - * @return the value of the HTTP Date response header - */ - public Date getDate() { - return new Date(http.getDate()); - } + //Automatic authentication using the Authenticator class does not + //work when chunked encoding is used + //http.setChunkedStreamingMode(4 * 1024); + http.setDoOutput(true); + http.setDoInput(true); + http.setInstanceFollowRedirects(true); - /** - * Returns the value of the HTTP Server response header - * - * @return the value of the HTTP Server response header - */ - public String getServer() { - return http.getHeaderField("Server"); - } + try { + http.setRequestMethod("PUT"); + } catch (ProtocolException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } - /** - * Returns the HTTP status code returned with the response or zero - * - * @return the HTTP status code returned with the response - * if the status code is not available return 0; - */ - public int getStatusCode() { - int code; - try { - code=http.getResponseCode(); - } catch (IOException ex) { - code=0; - } - return code; - } + http.setRequestProperty("User-Agent", getUserAgent()); + http.setRequestProperty("From", getFrom()); - /** - * Returns the HTTP status message returned with the response or null - * - * @return the HTTP status message returned with the response - * if the status message is not available return null - */ - public String getStatusMessage() { - String msg; - try { - msg=http.getResponseMessage(); - } catch (IOException ex) { - msg=null; - } - return msg; - } + //do not set content-length if using chunked encoding + http.setRequestProperty("Content-Length", Long.toString(f.length())); + //http.setRequestProperty("Transfer-Encoding", "chunked"); - /** - * Returns the absolute URL used by the original request - * - * @return the absolute URL used by the original request - */ - public String getUrl() { - return url; - } + http.setRequestProperty("Connection", "close"); + http.setRequestProperty("Content-Type", "application/zip"); + http.setRequestProperty("Content-MD5", digest); + http.setRequestProperty("Last-Modified", HaSDateFormatter.formatDateForHTTP(new Date(f.lastModified()))); - } + //send it down the wire + OutputStream out; + try { + out = http.getOutputStream(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } - /** - * This class represents the response an LRCRUD Create request - * - * @author thabing - * - */ - public class CreateResponse extends LrcrudResponse { + byte[] buf = new byte[4 * 1024]; + int bytesRead; - public String getLocation() { - return http.getHeaderField("Location"); - } - - public String getIdentifier() throws LrcrudClientException{ - URI locURI=null; - URI thisURI=null; - - try { - locURI = new URI(this.getLocation()); - thisURI = baseURL; - } catch (URISyntaxException e) { - throw new LrcrudClientException("The Location URL '" + this.getLocation() - + "' is not a valid URI.", e); - } - - URI relURI=thisURI.relativize(locURI); - - return relURI.toString(); - - } - } + try { + while ((bytesRead = fis.read(buf)) != -1) { + out.write(buf, 0, bytesRead); + out.flush(); + } + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } - /** - * This class represents the response an LRCRUD Retrieve request - * The zip file is available as a stream. The zip stream - * can be either written to a file, all the contents - * extracted to a directory, or the retrieved as - * ZipInputStream object - * - * @author thabing - * - */ - public class RetrieveResponse extends LrcrudResponse { + try { + out.close(); + fis.close(); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } - private String md5String=null; - private boolean eos =false; + ur.url = uri.toString(); + ur.http = http; - /** - * Returns the value of the HTTP Last-Modified response header - * - * @return the value of the HTTP Last-Modified response header - */ - public Date getLastModified() { - return new Date(http.getLastModified()); - } + http.disconnect(); - /** - * Extract all the files in the zip to a folder - * - * @param folder the path to folder to which to extract the files - * - * @return the number of files which have been extracted - */ - public long extractAll(String folder) - throws LrcrudClientException { - - if (eos==true) throw new LrcrudClientException("The file has already been saved or extracted."); + return ur; + } - InputStream inpStrm=null; - try { - inpStrm = http.getInputStream(); - } catch (IOException e1) { - throw new RuntimeException(e1); - } - - File baseFldr = new File(folder); - if (!baseFldr.isDirectory()){ - throw new LrcrudClientException("The path '" + folder + "' is not a valid directory"); - } - - HaSChecksummer summer = new HaSChecksummer(); - CheckedInputStream cs = new CheckedInputStream(inpStrm, summer); + /** + * Sends a request to the LRCRUD Service to delete (DELETE) a package + * + * @param identifier the identifier of the package to deleted + * @return an LrcrudClient.DeleteResponse object + */ + public DeleteResponse delete(String identifier) { + DeleteResponse dr = new DeleteResponse(); - ZipInputStream zin = new ZipInputStream(cs); - ZipEntry zen; - - byte[] buf = new byte[4 * 1024]; - int bytesRead; - long fileCnt=0; - try { - while ((zen=zin.getNextEntry())!=null) { - File fl = new File(baseFldr,zen.getName()); - FileOutputStream fout = new FileOutputStream(fl); - - while ((bytesRead = zin.read(buf)) != -1) { - fout.write(buf, 0, bytesRead); - fout.flush(); - } - fout.close(); - //set the last modified of the file to match the value in the zip - if (zen.getTime()!=-1) fl.setLastModified(zen.getTime()); - fileCnt++; - } - } catch (IOException e) { - throw new RuntimeException(e); - } - - try { - zin.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - md5String=summer.getBase64EncodedMD5(); - eos=true; + return dr; + } - if (this.getActualMD5Checksum().compareTo(this.getMD5Checksum())!=0) { - throw new LrcrudClientException("The Content-MD5 header does not match the actual MD5 checksum"); - } - - //there is no way to determine the actual file length, so cannot compare to Content-Length header - - inpStrm=null; - return fileCnt; - } + /** + * Returns the value used for the From HTTP request header + * + * @return the value to be used with the HTTP From request header + */ + public String getFrom() { + return from; + } - /** - * Save the zip file to disk - * - * @param filename the path and name to which to save the file - * @throws LrcrudClientException - */ - public void save(String filename) - throws LrcrudClientException { - - if (eos==true) throw new LrcrudClientException("The file has already been saved or extracted."); - - InputStream inpStrm = null; - - try { - inpStrm=http.getInputStream(); - } catch (IOException e1) { - throw new RuntimeException(e1); - } - HaSChecksummer summer = new HaSChecksummer(); - CheckedInputStream cs = new CheckedInputStream(inpStrm, summer); + /** + * Returns the value used for the User-Agent request header + * + * @return the value to be used with the HTTP User-Agent request header + */ + public String getUserAgent() { + return userAgent; + } - FileOutputStream fout=null; - try { - fout= new FileOutputStream(filename); - } catch (FileNotFoundException e) { - throw new LrcrudClientException("Unable to open file '" + - filename + "'",e); - } - byte[] buf = new byte[4 * 1024]; - int bytesRead; - long totalBytes=0; - try { - while ((bytesRead = cs.read(buf)) != -1) { - totalBytes=totalBytes+bytesRead; - fout.write(buf, 0, bytesRead); - fout.flush(); - } - fout.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - try { - cs.close(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - md5String = summer.getBase64EncodedMD5(); - eos=true; - - if (this.getActualMD5Checksum().compareTo(this.getMD5Checksum())!=0) { - throw new LrcrudClientException("The Content-MD5 header does not match the actual MD5 checksum"); - } - - if (http.getContentLength()!=-1 && http.getContentLength()!=totalBytes) { - throw new LrcrudClientException("The Content-Length header does not match the actual file length"); - } - - inpStrm=null; - } + /** + * Sets the value used for the HTTP From request header. + * + * @param from the value to be used for the HTTP From request header. + */ + public void setFrom(String from) { + this.from = from; + } - /** - * Returns the actual value MD5 from the derived from the filestream. The - * MD5 is only available after the zip has been saved or its files extracted - * attempts to return this value prior to this point will return a null; - * - * @return the value of the MD5 or null if the MD5 is not yet available - */ - public String getActualMD5Checksum() { - if (eos) { - return md5String; - } else { - return null; - } - } - - public String getActualMD5ChecksumHex() { - if (eos) { - byte md5[]= Base64.decodeBase64(md5String.getBytes()); - return new String(Hex.encodeHex(md5)); - } else { - return null; - } - } - - /** - * Returns the value of the HTTP Content-MD5 response header - * TODO: Accomodate the possibility that this is in a trailer - * - * @return the value of the HTTP Content-MD5 response header - */ - public String getMD5Checksum() { - return http.getHeaderField("Content-MD5"); - } - public String getMD5ChecksumHex() { - byte md5[]= Base64.decodeBase64(getMD5Checksum().getBytes()); - return new String(Hex.encodeHex(md5)); - } + /** + * Sets the value used for the HTTP User-Agent request header. + * + * @param userAgent the value to be used with the HTTP User-Agent request header + */ + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } - } + /** + * This class represents a response returned by the LRCRUD service. This class is used + * as the base class for all the responses to specific requests. + * + * @author thabing + * + */ + public class LrcrudResponse { - /** - * This class represents the response an LRCRUD Update request - * - * @author thabing - * - */ - public class UpdateResponse extends LrcrudResponse { + protected HttpURLConnection http = null; + protected String url; - } + /** + * Make sure the http connection is disconnected is closed before this object is disposed. + * + * @throws Throwable + */ + protected void finalizer() throws Throwable { + super.finalize(); + //make sure the httpurlconection is disconnected to free resources + if (http != null) { + http.disconnect(); + http = null; + } + } - /** - * This class represents the response an LRCRUD Delete request - * - * @author thabing - * - */ - public class DeleteResponse extends LrcrudResponse { + /** + * Returns the value of the HTTP Date response header + * + * @return the value of the HTTP Date response header + */ + public Date getDate() { + return new Date(http.getDate()); + } - } + /** + * Returns the value of the HTTP Server response header + * + * @return the value of the HTTP Server response header + */ + public String getServer() { + return http.getHeaderField("Server"); + } + /** + * Returns the HTTP status code returned with the response or zero + * + * @return the HTTP status code returned with the response + * if the status code is not available return 0; + */ + public int getStatusCode() { + int code; + try { + code = http.getResponseCode(); + } catch (IOException ex) { + code = 0; + } + return code; + } + + /** + * Returns the HTTP status message returned with the response or null + * + * @return the HTTP status message returned with the response + * if the status message is not available return null + */ + public String getStatusMessage() { + String msg; + try { + msg = http.getResponseMessage(); + } catch (IOException ex) { + msg = null; + } + return msg; + } + + /** + * Returns the absolute URL used by the original request + * + * @return the absolute URL used by the original request + */ + public String getUrl() { + return url; + } + } + + /** + * This class represents the response an LRCRUD Create request + * + * @author thabing + * + */ + public class CreateResponse extends LrcrudResponse { + + public String getLocation() { + return http.getHeaderField("Location"); + } + + public String getIdentifier() throws LrcrudClientException { + URI locURI = null; + URI thisURI = null; + + try { + locURI = new URI(this.getLocation()); + thisURI = baseURL; + } catch (URISyntaxException e) { + throw new LrcrudClientException("The Location URL '" + this.getLocation() + "' is not a valid URI.", e); + } + + URI relURI = thisURI.relativize(locURI); + + return relURI.toString(); + + } + } + + /** + * This class represents the response an LRCRUD Retrieve request + * The zip file is available as a stream. The zip stream + * can be either written to a file, all the contents + * extracted to a directory, or the retrieved as + * ZipInputStream object + * + * @author thabing + * + */ + public class RetrieveResponse extends LrcrudResponse { + + private String md5String = null; + private boolean eos = false; + + /** + * Returns the value of the HTTP Last-Modified response header + * + * @return the value of the HTTP Last-Modified response header + */ + public Date getLastModified() { + return new Date(http.getLastModified()); + } + + /** + * Extract all the files in the zip to a folder + * + * @param folder the path to folder to which to extract the files + * + * @return the number of files which have been extracted + */ + public long extractAll(String folder) + throws LrcrudClientException { + + if (eos == true) { + throw new LrcrudClientException("The file has already been saved or extracted."); + } + InputStream inpStrm = null; + try { + inpStrm = http.getInputStream(); + } catch (IOException e1) { + throw new RuntimeException(e1); + } + + File baseFldr = new File(folder); + if (!baseFldr.isDirectory()) { + throw new LrcrudClientException("The path '" + folder + "' is not a valid directory"); + } + + HaSChecksummer summer = new HaSChecksummer(); + CheckedInputStream cs = new CheckedInputStream(inpStrm, summer); + + ZipInputStream zin = new ZipInputStream(cs); + ZipEntry zen; + + byte[] buf = new byte[4 * 1024]; + int bytesRead; + long fileCnt = 0; + try { + while ((zen = zin.getNextEntry()) != null) { + File fl = new File(baseFldr, zen.getName()); + FileOutputStream fout = new FileOutputStream(fl); + + while ((bytesRead = zin.read(buf)) != -1) { + fout.write(buf, 0, bytesRead); + fout.flush(); + } + fout.close(); + //set the last modified of the file to match the value in the zip + if (zen.getTime() != -1) { + fl.setLastModified(zen.getTime()); + } + fileCnt++; + } + } catch (IOException e) { + throw new RuntimeException(e); + } + + try { + zin.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + md5String = summer.getBase64EncodedMD5(); + eos = true; + + if (this.getActualMD5Checksum().compareTo(this.getMD5Checksum()) != 0) { + throw new LrcrudClientException("The Content-MD5 header does not match the actual MD5 checksum"); + } + + //there is no way to determine the actual file length, so cannot compare to Content-Length header + + inpStrm = null; + return fileCnt; + } + + /** + * Save the zip file to disk + * + * @param filename the path and name to which to save the file + * @throws LrcrudClientException + */ + public void save(String filename) + throws LrcrudClientException { + + if (eos == true) { + throw new LrcrudClientException("The file has already been saved or extracted."); + } + InputStream inpStrm = null; + + try { + inpStrm = http.getInputStream(); + } catch (IOException e1) { + throw new RuntimeException(e1); + } + HaSChecksummer summer = new HaSChecksummer(); + CheckedInputStream cs = new CheckedInputStream(inpStrm, summer); + + FileOutputStream fout = null; + try { + fout = new FileOutputStream(filename); + } catch (FileNotFoundException e) { + throw new LrcrudClientException("Unable to open file '" + + filename + "'", e); + } + byte[] buf = new byte[4 * 1024]; + int bytesRead; + long totalBytes = 0; + try { + while ((bytesRead = cs.read(buf)) != -1) { + totalBytes = totalBytes + bytesRead; + fout.write(buf, 0, bytesRead); + fout.flush(); + } + fout.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + try { + cs.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + md5String = summer.getBase64EncodedMD5(); + eos = true; + + if (this.getActualMD5Checksum().compareTo(this.getMD5Checksum()) != 0) { + throw new LrcrudClientException("The Content-MD5 header does not match the actual MD5 checksum"); + } + + if (http.getContentLength() != -1 && http.getContentLength() != totalBytes) { + throw new LrcrudClientException("The Content-Length header does not match the actual file length"); + } + + inpStrm = null; + } + + /** + * Returns the actual value MD5 from the derived from the filestream. The + * MD5 is only available after the zip has been saved or its files extracted + * attempts to return this value prior to this point will return a null; + * + * @return the value of the MD5 or null if the MD5 is not yet available + */ + public String getActualMD5Checksum() { + if (eos) { + return md5String; + } else { + return null; + } + } + + public String getActualMD5ChecksumHex() { + if (eos) { + byte md5[] = Base64.decodeBase64(md5String.getBytes()); + return new String(Hex.encodeHex(md5)); + } else { + return null; + } + } + + /** + * Returns the value of the HTTP Content-MD5 response header + * TODO: Accomodate the possibility that this is in a trailer + * + * @return the value of the HTTP Content-MD5 response header + */ + public String getMD5Checksum() { + return http.getHeaderField("Content-MD5"); + } + + public String getMD5ChecksumHex() { + byte md5[] = Base64.decodeBase64(getMD5Checksum().getBytes()); + return new String(Hex.encodeHex(md5)); + } + } + + /** + * This class represents the response an LRCRUD Update request + * + * @author thabing + * + */ + public class UpdateResponse extends LrcrudResponse { + } + + /** + * This class represents the response an LRCRUD Delete request + * + * @author thabing + * + */ + public class DeleteResponse extends LrcrudResponse { + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-04-27 17:13:35
|
Revision: 853 http://echodep.svn.sourceforge.net/echodep/?rev=853&view=rev Author: bill_ingram Date: 2009-04-27 17:13:26 +0000 (Mon, 27 Apr 2009) Log Message: ----------- Added license statement and svn keywords Modified Paths: -------------- trunk/build.xml Property Changed: ---------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-04-27 16:57:17 UTC (rev 852) +++ trunk/build.xml 2009-04-27 17:13:26 UTC (rev 853) @@ -1,8 +1,40 @@ <?xml version="1.0" encoding="UTF-8"?> - <!-- - - TODO: Copyright/License statement - --> + - Copyright (c) 2009, University Library, University of Illinois at + - Urbana-Champaign. All rights reserved. + - + - Developed by: The Hub and Spoke Project Group + - University of Illinois Urbana-Champaign Library + - http://dli.grainger.uiuc.edu/echodep/hands/ + - + - Permission is hereby granted, free of charge, to any person obtaining a + - copy of this software and associated documentation files (the + - "Software"), to deal with the Software without restriction, including + - without limitation the rights to use, copy, modify, merge, publish, + - distribute, sublicense, and/or sell copies of the Software, and to + - permit persons to whom the Software is furnished to do so, subject to + - the following conditions: + - + - - Redistributions of source code must retain the above copyright notice, + - this list of conditions and the following disclaimers. + - + - - Redistributions in binary form must reproduce the above copyright + - notice, this list of conditions and the following disclaimers in the + - documentation and/or other materials provided with the distribution. + - + - - Neither the names of The Hub and Spoke Project Group, University of + - Illinois Urbana-Champaign Library, nor the names of its contributors may + - be used to endorse or promote products derived from this Software + - without specific prior written permission. + - + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + - IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + - SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + --> <!-- - Hub and Spoke build file @@ -157,25 +189,8 @@ </echo> </target> - <target name="help"> - <echo> -======================================================================== -Please specify a target to run: + <target name="help" depends="usage" /> -NOTE: Before building any targets, make sure you have approptriately - set the necessary configuration files. For more information - please review the installation instructions. - -Usage examples: - % ant build_hands_client - % ant build_dspace_lrcrud - % ant build_fedora_lrcrud - % ant build_eprints_lrcrud - % ant clean_all -======================================================================== - </echo> - </target> - <!-- ============================================================= --> <!-- VALIDATOR TARGETS --> Property changes on: trunk/build.xml ___________________________________________________________________ Modified: svn:keywords - LastChangedDate LastChangedRevision LastChangedBy + LastChangedDate LastChangedRevision LastChangedBy HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bil...@us...> - 2009-04-27 16:57:27
|
Revision: 852 http://echodep.svn.sourceforge.net/echodep/?rev=852&view=rev Author: bill_ingram Date: 2009-04-27 16:57:17 +0000 (Mon, 27 Apr 2009) Log Message: ----------- Added license statement and svn keywords Modified Paths: -------------- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java Property Changed: ---------------- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,10 +1,46 @@ -/* - * $LastChangedBy: cordial $ - * $LastChangedDate: 2007-04-13 17:11:11 -0500 (Fri, 13 Apr 2007) $ - * $LastChangedRevision: 295 $ - * $HeadURL: https://echodep.svn.sourceforge.net/svnroot/echodep/trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java $ +/** + * HaSChecksummer.java * - * */ + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + package edu.uiuc.ndiipp.hubandspoke.utils; import java.security.MessageDigest; Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSChecksummer.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,3 +1,46 @@ +/** + * HaSConstants.java + * + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + package edu.uiuc.ndiipp.hubandspoke.utils; public class HaSConstants { Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSConstants.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,10 +1,46 @@ -/* - * $LastChangedBy: bill_ingram $ - * $LastChangedDate: 2007-09-06 16:03:31 -0500 (Thu, 06 Sep 2007) $ - * $LastChangedRevision: 491 $ - * $HeadURL: https://echodep.svn.sourceforge.net/svnroot/echodep/trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/DateFormatter.java $ +/** + * DateFormatter.java * - * */ + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + package edu.uiuc.ndiipp.hubandspoke.utils; import java.text.SimpleDateFormat; Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSDateFormatter.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,5 +1,44 @@ -/* - * +/** + * HaSFileUtils.java + * + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ package edu.uiuc.ndiipp.hubandspoke.utils; Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSFileUtils.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,6 +1,46 @@ /** + * HaSNamespaceContext.java * + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ + package edu.uiuc.ndiipp.hubandspoke.utils; import java.util.Iterator; Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSNamespaceContext.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL Modified: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java =================================================================== --- trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java 2009-04-27 16:54:39 UTC (rev 851) +++ trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java 2009-04-27 16:57:17 UTC (rev 852) @@ -1,3 +1,46 @@ +/** + * HaSZipUtils.java + * + * $Revision$ + * + * $Date$ + * + * Copyright (c) 2009, University Library, University of Illinois at + * Urbana-Champaign. All rights reserved. + * + * Developed by: The Hub and Spoke Project Group + * University of Illinois Urbana-Champaign Library + * http://dli.grainger.uiuc.edu/echodep/hands/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal with the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimers. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimers in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the names of The Hub and Spoke Project Group, University of + * Illinois Urbana-Champaign Library, nor the names of its contributors may + * be used to endorse or promote products derived from this Software + * without specific prior written permission. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + */ + package edu.uiuc.ndiipp.hubandspoke.utils; import java.io.BufferedInputStream; Property changes on: trunk/utils/src/edu/uiuc/ndiipp/hubandspoke/utils/HaSZipUtils.java ___________________________________________________________________ Added: svn:keywords + LastChangedDate LastChangedRevision LastChangedBy HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |