[DS-941] Marker ticket for splitting up the dspace.cfg: SWORDv2 now updated to use config/modules/swordv2-server.cfg

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6616 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2011-08-28 08:24:17 +00:00
parent 95de92e02c
commit 6c1b67dd22
18 changed files with 187 additions and 231 deletions

View File

@@ -77,7 +77,7 @@ public abstract class AbstractSwordContentIngester implements SwordContentIngest
protected void setUpdatedDate(Item item, VerboseDescription verboseDescription)
throws DSpaceSwordException
{
String field = ConfigurationManager.getProperty("sword2.updated.field");
String field = ConfigurationManager.getProperty("swordv2-manager", "updated.field");
if (field == null || "".equals(field))
{
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
@@ -110,7 +110,7 @@ public abstract class AbstractSwordContentIngester implements SwordContentIngest
return;
}
String field = ConfigurationManager.getProperty("sword2.slug.field");
String field = ConfigurationManager.getProperty("swordv2-server", "slug.field");
if (field == null || "".equals(field))
{
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");

View File

@@ -23,9 +23,9 @@ public class AtomStatementDisseminator extends GenericStatementDisseminator impl
SwordUrlManager urlManager = new SwordUrlManager(new SwordConfigurationDSpace(), context);
String feedUri = urlManager.getAtomStatementUri(item);
String authorField = ConfigurationManager.getProperty("sword2.author.field");
String titleField = ConfigurationManager.getProperty("sword2.title.field");
String updatedField = ConfigurationManager.getProperty("sword2.updated.field");
String authorField = ConfigurationManager.getProperty("swordv2-server", "author.field");
String titleField = ConfigurationManager.getProperty("swordv2-server", "title.field");
String updatedField = ConfigurationManager.getProperty("swordv2-server", "updated.field");
String author = this.stringMetadata(item, authorField);
String title = this.stringMetadata(item, titleField);

View File

@@ -78,7 +78,7 @@ public class CollectionListManagerDSpace extends DSpaceSwordAPI implements Colle
{
Entry entry = feed.addEntry();
entry.setId(urlManager.getEditIRI(item).toString());
String title = this.stringMetadata(item, ConfigurationManager.getProperty("sword2.title.field"));
String title = this.stringMetadata(item, ConfigurationManager.getProperty("swordv2-server", "title.field"));
title = title == null? "Untitled" : title;
entry.setTitle(title);
entry.addLink(urlManager.getContentUrl(item).toString(), "edit-media");

View File

@@ -256,7 +256,7 @@ public class DSpaceSwordAPI
boolean ignoreAuth = context.ignoreAuthorization();
context.setIgnoreAuthorization(true);
String bundleName = ConfigurationManager.getProperty("sword2.bundle.name");
String bundleName = ConfigurationManager.getProperty("swordv2-server", "bundle.name");
if (bundleName == null || "".equals(bundleName))
{
bundleName = "SWORD";

View File

@@ -49,7 +49,7 @@ public abstract class GenericStatementDisseminator implements SwordStatementDiss
{
// an original deposit is everything in the SWORD bundle
List<OriginalDeposit> originalDeposits = new ArrayList<OriginalDeposit>();
String swordBundle = ConfigurationManager.getProperty("sword2.bundle.name");
String swordBundle = ConfigurationManager.getProperty("swordv2-server", "bundle.name");
if (swordBundle == null)
{
swordBundle = "SWORD";

View File

@@ -15,7 +15,6 @@ import org.dspace.content.Item;
import org.dspace.core.ConfigurationManager;
import org.dspace.core.Context;
import org.apache.log4j.Logger;
import org.dspace.core.PluginManager;
import org.swordapp.server.DepositReceipt;
import org.swordapp.server.SwordError;
import org.swordapp.server.SwordServerException;
@@ -289,7 +288,7 @@ public class ReceiptGenerator
*/
protected void addLastUpdatedDate(DepositResult result, DepositReceipt receipt)
{
String config = ConfigurationManager.getProperty("sword2.updated.field");
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
DCValue[] dcv = result.getItem().getMetadata(config);
if (dcv != null && dcv.length == 1)
{
@@ -309,7 +308,7 @@ public class ReceiptGenerator
protected void addLastUpdatedDate(Item item, DepositReceipt receipt)
{
String config = ConfigurationManager.getProperty("sword2.updated.field");
String config = ConfigurationManager.getProperty("swordv2-server", "updated.field");
DCValue[] dcv = item.getMetadata(config);
if (dcv != null && dcv.length == 1)
{

View File

@@ -113,7 +113,7 @@ public class ServiceDocumentManagerDSpace implements ServiceDocumentManager
workspace.setTitle(ws);
// next thing to do is determine whether the default is communities or collections
boolean swordCommunities = ConfigurationManager.getBooleanProperty("sword2.expose-communities");
boolean swordCommunities = ConfigurationManager.getBooleanProperty("swordv2-server", "expose-communities");
if (swordCommunities)
{

View File

@@ -38,13 +38,13 @@ public class SimpleDCEntryIngester implements SwordEntryIngester
{
// we should load our DC map from configuration
this.dcMap = new HashMap<String, String>();
Properties props = ConfigurationManager.getProperties();
Properties props = ConfigurationManager.getProperties("swordv2-server");
for (Object key : props.keySet())
{
String keyString = (String) key;
if (keyString.startsWith("sword2.simpledc."))
if (keyString.startsWith("simpledc."))
{
String k = keyString.substring("sword2.simpledc.".length());
String k = keyString.substring("simpledc.".length());
String v = (String) props.get(key);
this.dcMap.put(k, v);
}
@@ -274,7 +274,7 @@ public class SimpleDCEntryIngester implements SwordEntryIngester
protected void setUpdatedDate(Item item, VerboseDescription verboseDescription)
throws DSpaceSwordException
{
String field = ConfigurationManager.getProperty("sword2.updated.field");
String field = ConfigurationManager.getProperty("swordv2-server", "updated.field");
if (field == null || "".equals(field))
{
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
@@ -307,7 +307,7 @@ public class SimpleDCEntryIngester implements SwordEntryIngester
return;
}
String field = ConfigurationManager.getProperty("sword2.slug.field");
String field = ConfigurationManager.getProperty("swordv2-server", "slug.field");
if (field == null || "".equals(field))
{
throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");

View File

@@ -277,7 +277,7 @@ public class SwordAuthenticator
}
// first find out if we support on-behalf-of deposit
boolean mediated = ConfigurationManager.getBooleanProperty("sword.on-behalf-of.enable");
boolean mediated = ConfigurationManager.getBooleanProperty("swordv2-server", "on-behalf-of.enable");
if (!mediated && obo != null)
{
// user is trying to do a mediated deposit on a repository which does not support it

View File

@@ -64,33 +64,33 @@ public class SwordConfigurationDSpace implements SwordConfiguration
public SwordConfigurationDSpace()
{
// set the max upload size
int mus = ConfigurationManager.getIntProperty("sword2.max-upload-size");
int mus = ConfigurationManager.getIntProperty("swordv2-server", "max-upload-size");
if (mus > 0)
{
this.maxUploadSize = mus;
}
// set the mediation value
this.mediated = ConfigurationManager.getBooleanProperty("sword2.on-behalf-of.enable");
this.mediated = ConfigurationManager.getBooleanProperty("swordv2-server", "on-behalf-of.enable");
// find out if we keep the original as bitstream
this.keepOriginal = ConfigurationManager.getBooleanProperty("sword2.keep-original-package");
this.keepOriginal = ConfigurationManager.getBooleanProperty("swordv2-server", "keep-original-package");
// get the sword bundle
String bundle = ConfigurationManager.getProperty("sword2.bundle.name");
String bundle = ConfigurationManager.getProperty("swordv2-server", "bundle.name");
if (bundle != null && "".equals(bundle))
{
this.swordBundle = bundle;
}
// find out if we keep the package as a file in specified directory
this.keepPackageOnFailedIngest = ConfigurationManager.getBooleanProperty("sword2.keep-package-on-fail", false);
this.keepPackageOnFailedIngest = ConfigurationManager.getBooleanProperty("swordv2-server", "keep-package-on-fail", false);
// get directory path and name
this.failedPackageDir = ConfigurationManager.getProperty("sword2.failed-package.dir");
this.failedPackageDir = ConfigurationManager.getProperty("swordv2-server", "failed-package.dir");
// Get the accepted formats
String acceptsProperty = ConfigurationManager.getProperty("sword2.accepts");
String acceptsProperty = ConfigurationManager.getProperty("swordv2-server", "accepts");
swordaccepts = new ArrayList<String>();
if (acceptsProperty == null)
{
@@ -102,10 +102,10 @@ public class SwordConfigurationDSpace implements SwordConfiguration
}
// find out if community deposit is allowed
this.allowCommunityDeposit = ConfigurationManager.getBooleanProperty("sword2.allow-community-deposit");
this.allowCommunityDeposit = ConfigurationManager.getBooleanProperty("swordv2-server", "allow-community-deposit");
// find out if we keep the package as a file in specified directory
this.entryFirst = ConfigurationManager.getBooleanProperty("sword2.multipart.entry-first", false);
this.entryFirst = ConfigurationManager.getBooleanProperty("swordv2-server", "multipart.entry-first", false);
}
@@ -113,9 +113,17 @@ public class SwordConfigurationDSpace implements SwordConfiguration
// Utilities
///////////////////////////////////////////////////////////////////////////////////
public String getStringProperty(String propName, String defaultValue, String[] allowedValues)
public String getStringProperty(String module, String propName, String defaultValue, String[] allowedValues)
{
String cfg = ConfigurationManager.getProperty(propName);
String cfg;
if (module == null)
{
cfg = ConfigurationManager.getProperty(propName);
}
else
{
cfg = ConfigurationManager.getProperty(module, propName);
}
if (cfg == null || "".equals(cfg))
{
return defaultValue;
@@ -142,9 +150,9 @@ public class SwordConfigurationDSpace implements SwordConfiguration
return defaultValue;
}
public String getStringProperty(String propName, String defaultValue)
public String getStringProperty(String module, String propName, String defaultValue)
{
return this.getStringProperty(propName, defaultValue, null);
return this.getStringProperty(module, propName, defaultValue, null);
}
///////////////////////////////////////////////////////////////////////////////////
@@ -170,22 +178,22 @@ public class SwordConfigurationDSpace implements SwordConfiguration
public String generator()
{
return this.getStringProperty("sword2.generator.url", DSpaceUriRegistry.DSPACE_SWORD_NS);
return this.getStringProperty("swordv2-server", "generator.url", DSpaceUriRegistry.DSPACE_SWORD_NS);
}
public String generatorVersion()
{
return this.getStringProperty("sword2.generator.version", "2.0");
return this.getStringProperty("swordv2-server", "generator.version", "2.0");
}
public String administratorEmail()
{
return this.getStringProperty("mail.admin", null);
return this.getStringProperty(null, "mail.admin", null);
}
public String getAuthType()
{
return this.getStringProperty("sword2.auth-type", "Basic", new String[] { "Basic", "None" } );
return this.getStringProperty("swordv2-server", "auth-type", "Basic", new String[] { "Basic", "None" } );
}
public boolean storeAndCheckBinary()
@@ -195,7 +203,7 @@ public class SwordConfigurationDSpace implements SwordConfiguration
public String getTempDirectory()
{
return this.getStringProperty("sword2.upload.tempdir", null);
return this.getStringProperty("swordv2-server", "upload.tempdir", null);
}
///////////////////////////////////////////////////////////////////////////////////
@@ -210,12 +218,12 @@ public class SwordConfigurationDSpace implements SwordConfiguration
public List<String> getDisseminatePackaging()
{
List<String> dps = new ArrayList<String>();
Properties props = ConfigurationManager.getProperties();
Properties props = ConfigurationManager.getProperties("swordv2-server");
Set keyset = props.keySet();
for (Object keyObj : keyset)
{
// start by getting anything that starts with sword.disseminate-packging.
String sw = "sword2.disseminate-packaging.";
String sw = "disseminate-packaging.";
if (!(keyObj instanceof String))
{
@@ -454,18 +462,18 @@ public class SwordConfigurationDSpace implements SwordConfiguration
*/
public List<String> getAcceptPackaging(Collection col)
{
// sword2.accept-packaging.METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
// sword2.accept-packaging.[handle].METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
// accept-packaging.METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
// accept-packaging.[handle].METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
String handle = col.getHandle();
List<String> aps = new ArrayList<String>();
// build the holding maps of identifiers
Properties props = ConfigurationManager.getProperties();
Properties props = ConfigurationManager.getProperties("swordv2-server");
Set keyset = props.keySet();
for (Object keyObj : keyset)
{
// start by getting anything that starts with sword.accept-packging.collection.
String sw = "sword2.accept-packaging.collection.";
// start by getting anything that starts with sword.accept-packaging.collection.
String sw = "accept-packaging.collection.";
if (!(keyObj instanceof String))
{
@@ -513,12 +521,12 @@ public class SwordConfigurationDSpace implements SwordConfiguration
List<String> aps = new ArrayList<String>();
// build the holding maps of identifiers
Properties props = ConfigurationManager.getProperties();
Properties props = ConfigurationManager.getProperties("swordv2-server");
Set keyset = props.keySet();
for (Object keyObj : keyset)
{
// start by getting anything that starts with sword.accept-packging.collection.
String sw = "sword2.accept-packaging.item.";
String sw = "accept-packaging.item.";
if (!(keyObj instanceof String))
{
@@ -599,11 +607,11 @@ public class SwordConfigurationDSpace implements SwordConfiguration
public String getStateUri(String state)
{
return ConfigurationManager.getProperty("sword2.state." + state + ".uri");
return ConfigurationManager.getProperty("swordv2-server", "state." + state + ".uri");
}
public String getStateDescription(String state)
{
return ConfigurationManager.getProperty("sword2.state." + state + ".description");
return ConfigurationManager.getProperty("swordv2-server", "state." + state + ".description");
}
}

View File

@@ -32,7 +32,7 @@ public class SwordDisseminatorFactory
{
format = format.replace(";", "_"); // clean up the string for the plugin manager
format = format.replace("=", "_"); // clean up the string for the plugin manager
disseminator = (SwordContentDisseminator) PluginManager.getNamedPlugin(SwordContentDisseminator.class, format);
disseminator = (SwordContentDisseminator) PluginManager.getNamedPlugin("swordv2-server", SwordContentDisseminator.class, format);
if (disseminator == null)
{
continue;
@@ -63,7 +63,7 @@ public class SwordDisseminatorFactory
{
acceptPackaging = acceptPackaging.replace(";", "_"); // clean up the string for the plugin manager
acceptPackaging = acceptPackaging.replace("=", "_"); // clean up the string for the plugin manager
disseminator = (SwordContentDisseminator) PluginManager.getNamedPlugin(SwordContentDisseminator.class, acceptPackaging);
disseminator = (SwordContentDisseminator) PluginManager.getNamedPlugin("swordv2-server", SwordContentDisseminator.class, acceptPackaging);
if (disseminator != null)
{
if (accept != null)
@@ -115,7 +115,7 @@ public class SwordDisseminatorFactory
{
format = format.replace(";", "_"); // clean up the string for the plugin manager
format = format.replace("=", "_"); // clean up the string for the plugin manager
disseminator = (SwordStatementDisseminator) PluginManager.getNamedPlugin(SwordStatementDisseminator.class, format);
disseminator = (SwordStatementDisseminator) PluginManager.getNamedPlugin("swordv2-server", SwordStatementDisseminator.class, format);
if (disseminator != null)
{
break;
@@ -135,7 +135,7 @@ public class SwordDisseminatorFactory
public static SwordEntryDisseminator getEntryInstance()
throws DSpaceSwordException, SwordError
{
SwordEntryDisseminator disseminator = (SwordEntryDisseminator) PluginManager.getSinglePlugin(SwordEntryDisseminator.class);
SwordEntryDisseminator disseminator = (SwordEntryDisseminator) PluginManager.getSinglePlugin("swordv2-server", SwordEntryDisseminator.class);
if (disseminator == null)
{
throw new SwordError(DSpaceUriRegistry.REPOSITORY_ERROR, "No disseminator configured for handling sword entry documents");

View File

@@ -46,7 +46,7 @@ public class SwordIngesterFactory
SwordContentIngester ingester = null;
// first look to see if there's an intester for the content type
ingester = (SwordContentIngester) PluginManager.getNamedPlugin(SwordContentIngester.class, deposit.getMimeType());
ingester = (SwordContentIngester) PluginManager.getNamedPlugin("swordv2-server", SwordContentIngester.class, deposit.getMimeType());
if (ingester != null)
{
return ingester;
@@ -54,7 +54,7 @@ public class SwordIngesterFactory
// if no ingester, then
// look to see if there's an ingester for the package format
ingester = (SwordContentIngester) PluginManager.getNamedPlugin(SwordContentIngester.class, deposit.getPackaging());
ingester = (SwordContentIngester) PluginManager.getNamedPlugin("swordv2-server", SwordContentIngester.class, deposit.getPackaging());
if (ingester == null)
{
throw new SwordError(UriRegistry.ERROR_CONTENT, "No ingester configured for this package type");
@@ -65,7 +65,7 @@ public class SwordIngesterFactory
public static SwordEntryIngester getEntryInstance(Context context, Deposit deposit, DSpaceObject dso)
throws DSpaceSwordException, SwordError
{
SwordEntryIngester ingester = (SwordEntryIngester) PluginManager.getSinglePlugin(SwordEntryIngester.class);
SwordEntryIngester ingester = (SwordEntryIngester) PluginManager.getSinglePlugin("swordv2-server", SwordEntryIngester.class);
if (ingester == null)
{
throw new SwordError(UriRegistry.ERROR_CONTENT, "No ingester configured for handling sword entry documents");

View File

@@ -59,14 +59,14 @@ public class SwordMETSContentIngester extends AbstractSwordContentIngester
File depositFile = deposit.getFile();
// load the plugin manager for the required configuration
String cfg = ConfigurationManager.getProperty("sword2.mets-ingester.package-ingester");
String cfg = ConfigurationManager.getProperty("swordv2-server", "mets-ingester.package-ingester");
if (cfg == null || "".equals(cfg))
{
cfg = "METS"; // default to METS
}
verboseDescription.append("Using package manifest format: " + cfg);
PackageIngester pi = (PackageIngester) PluginManager.getNamedPlugin(PackageIngester.class, cfg);
PackageIngester pi = (PackageIngester)PluginManager.getNamedPlugin("swordv2-server", PackageIngester.class, cfg);
verboseDescription.append("Loaded package ingester: " + pi.getClass().getName());
// the licence is either in the zip or the mets manifest. Either way
@@ -79,7 +79,7 @@ public class SwordMETSContentIngester extends AbstractSwordContentIngester
params.setWorkflowEnabled(true);
// Should restore mode be enabled, i.e. keep existing handle?
if (ConfigurationManager.getBooleanProperty("sword2.restore-mode.enable",false))
if (ConfigurationManager.getBooleanProperty("swordv2-server", "restore-mode.enable",false))
params.setRestoreModeEnabled(true);
// ingest the item from the temp file

View File

@@ -80,7 +80,7 @@ public class SwordUrlManager
public String getSwordBaseUrl()
throws DSpaceSwordException
{
String sUrl = ConfigurationManager.getProperty("sword2.url");
String sUrl = ConfigurationManager.getProperty("swordv2-server", "url");
if (sUrl == null || "".equals(sUrl))
{
String dspaceUrl = ConfigurationManager.getProperty("dspace.baseUrl");
@@ -313,20 +313,20 @@ public class SwordUrlManager
public String getBaseServiceDocumentUrl()
throws DSpaceSwordException
{
String sdUrl = ConfigurationManager.getProperty("sword2.servicedocument.url");
String sdUrl = ConfigurationManager.getProperty("swordv2-server", "servicedocument.url");
if (sdUrl == null || "".equals(sdUrl))
{
String dspaceUrl = ConfigurationManager.getProperty("dspace.baseUrl");
if (dspaceUrl == null || "".equals(dspaceUrl))
{
throw new DSpaceSwordException("Unable to construct service document urls, due to missing/invalid " +
"config in sword2.servicedocument.url and/or dspace.baseUrl");
"config in swordv2-server.cfg servicedocument.url and/or dspace.baseUrl");
}
try
{
URL url = new URL(dspaceUrl);
sdUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), "/sword2/servicedocument").toString();
sdUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), "/swordv2/servicedocument").toString();
}
catch (MalformedURLException e)
{
@@ -356,20 +356,20 @@ public class SwordUrlManager
public String getBaseCollectionUrl()
throws DSpaceSwordException
{
String depositUrl = ConfigurationManager.getProperty("sword2.collection.url");
String depositUrl = ConfigurationManager.getProperty("swordv2-server", "collection.url");
if (depositUrl == null || "".equals(depositUrl))
{
String dspaceUrl = ConfigurationManager.getProperty("dspace.baseUrl");
if (dspaceUrl == null || "".equals(dspaceUrl))
{
throw new DSpaceSwordException("Unable to construct deposit urls, due to missing/invalid config in " +
"sword2.deposit.url and/or dspace.baseUrl");
"swordv2-server.cfg deposit.url and/or dspace.baseUrl");
}
try
{
URL url = new URL(dspaceUrl);
depositUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), "/sword2/collection").toString();
depositUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), "/swordv2/collection").toString();
}
catch (MalformedURLException e)
{

View File

@@ -23,7 +23,7 @@ public class VersionManager
public void emptyBundle(Item item, String name)
throws SQLException, AuthorizeException, IOException
{
boolean keep = ConfigurationManager.getBooleanProperty("sword2.versions.keep");
boolean keep = ConfigurationManager.getBooleanProperty("swordv2-server", "versions.keep");
Bundle[] bundles = item.getBundles(name);
for (Bundle b : bundles)
{
@@ -34,7 +34,7 @@ public class VersionManager
public void emptyBundle(Item item, Bundle source)
throws SQLException, AuthorizeException, IOException
{
boolean keep = ConfigurationManager.getBooleanProperty("sword2.versions.keep");
boolean keep = ConfigurationManager.getBooleanProperty("swordv2-server", "versions.keep");
this.emptyBundle(item, source, keep);
}
@@ -55,7 +55,7 @@ public class VersionManager
public void removeBitstream(Item item, Bitstream bitstream)
throws SQLException, AuthorizeException, IOException
{
boolean keep = ConfigurationManager.getBooleanProperty("sword2.versions.keep");
boolean keep = ConfigurationManager.getBooleanProperty("swordv2-server", "versions.keep");
this.removeBitstream(item, bitstream, keep);
}
@@ -81,7 +81,7 @@ public class VersionManager
public Bundle archiveBitstream(Item item, Bitstream bitstream)
throws SQLException, AuthorizeException, IOException
{
String swordBundle = ConfigurationManager.getProperty("sword2.bundle.name");
String swordBundle = ConfigurationManager.getProperty("swordv2-server", "bundle.name");
if (swordBundle == null)
{
swordBundle = "SWORD";

View File

@@ -7,15 +7,19 @@
*/
package org.dspace.sword2;
import org.apache.log4j.Logger;
import org.dspace.core.PluginManager;
import org.swordapp.server.SwordError;
public class WorkflowManagerFactory
{
/** logger */
private static Logger log = Logger.getLogger(WorkflowManagerFactory.class);
public static WorkflowManager getInstance()
throws DSpaceSwordException, SwordError
{
WorkflowManager manager = (WorkflowManager) PluginManager.getSinglePlugin(WorkflowManager.class);
WorkflowManager manager = (WorkflowManager) PluginManager.getSinglePlugin("swordv2-server", WorkflowManager.class);
if (manager == null)
{
throw new SwordError(DSpaceUriRegistry.REPOSITORY_ERROR, "No workflow manager configured");

View File

@@ -172,7 +172,7 @@ public class WorkflowTools
WorkspaceItem wsi = this.getWorkspaceItem(context, item);
// kick off the workflow
boolean notify = ConfigurationManager.getBooleanProperty("sword2.workflow.notify");
boolean notify = ConfigurationManager.getBooleanProperty("swordv2-server", "workflow.notify");
if (notify)
{
WorkflowManager.start(context, wsi);

View File

@@ -1,65 +1,65 @@
#---------------------------------------------------------------#
#--------------SWORD 2.0 SPECIFIC CONFIGURATIONS----------------#
#-------------------SWORD 2.0 CONFIGURATIONS-------------------#
#---------------------------------------------------------------#
# These configs are only used by the SWORD 2.0 interface #
#---------------------------------------------------------------#
# the base url of the sword 2.0 system
#
# the default if {dspace.url}/sword2
# the default if {dspace.url}/swordv2
#
#sword2.url = http://www.myu.ac.uk/sword2
#url = http://www.myu.ac.uk/swordv2
# The base URL of the SWORD collection. This is the URL from
# which DSpace will construct the deposit location urls for
# collections.
#
# The default is {dspace.url}/sword2/collection
# The default is {dspace.url}/swordv2/collection
#
# In the event that you are not deploying DSpace as the ROOT
# application in the servlet container, this will generate
# incorrect URLs, and you should override the functionality
# by specifying in full as below:
#
# sword2.collection.url = http://www.myu.ac.uk/sword2/collection
# collection.url = http://www.myu.ac.uk/swordv2/collection
# The base URL of the SWORD service document. This is the
# URL from which DSpace will construct the service document
# location urls for the site, and for individual collections
#
# The default is {dspace.url}/sword2/servicedocument
# The default is {dspace.url}/swordv2/servicedocument
#
# In the event that you are not deploying DSpace as the ROOT
# application in the servlet container, this will generate
# incorrect URLs, and you should override the functionality
# by specifying in full as below:
#
# sword2.servicedocument.url = http://www.myu.ac.uk/sword2/servicedocument
# servicedocument.url = http://www.myu.ac.uk/swordv2/servicedocument
# The accept packaging properties, along with their associated
# quality values where appropriate.
#
# Global settings; these will be used on all DSpace collections
#
sword2.accept-packaging.collection.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
sword2.accept-packaging.collection.SimpleZip = http://purl.org/net/sword/package/SimpleZip
sword2.accept-packaging.collection.Binary = http://purl.org/net/sword/package/Binary
accept-packaging.collection.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
accept-packaging.collection.SimpleZip = http://purl.org/net/sword/package/SimpleZip
accept-packaging.collection.Binary = http://purl.org/net/sword/package/Binary
# The accept packaging properties for items. This is used to determine
# which package types are acceptable to deposit into an existing item,
# either adding to or replacing the media resource
#
sword2.accept-packaging.item.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
sword2.accept-packaging.item.SimpleZip = http://purl.org/net/sword/package/SimpleZip
sword2.accept-packaging.item.Binary = http://purl.org/net/sword/package/Binary
accept-packaging.item.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
accept-packaging.item.SimpleZip = http://purl.org/net/sword/package/SimpleZip
accept-packaging.item.Binary = http://purl.org/net/sword/package/Binary
# A comma separated list of MIME types that SWORD will accept
sword2.accepts = application/zip, image/jpeg
accepts = application/zip, image/jpeg
# Collection Specific settings: these will be used on the collections
# with the given handles
#
#sword2.accept-packaging.collection.[handle].METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
#accept-packaging.collection.[handle].METSDSpaceSIP = http://purl.org/net/sword-types/METSDSpaceSIP
# Should the server offer as the default the list of all Communities
# to a Service Document request. If false, the server will offer
@@ -70,7 +70,7 @@ sword2.accepts = application/zip, image/jpeg
# deposit targets, and the client will need to request the list of
# Collections in the target before deposit can continue
#
sword2.expose-communities = false
expose-communities = false
# The maximum upload size of a package through the sword interface,
# in bytes
@@ -80,7 +80,7 @@ sword2.expose-communities = false
# for an individual file upload through the user interface. If not
# set, or set to 0, the sword service will default to no limit.
#
sword2.max-upload-size = 0
max-upload-size = 0
# Should DSpace store a copy of the original sword deposit package?
#
@@ -90,18 +90,18 @@ sword2.max-upload-size = 0
# recoverable in their original form. It is strongly recommended,
# therefore, to leave this option turned on
#
sword2.keep-original-package = true
keep-original-package = true
# The bundle name that SWORD should store incoming packages under if
# sword.keep-original-package is set to true. The default is "SWORD"
# if not value is set
#
# sword2.bundle.name = SWORD
# bundle.name = SWORD
# In the event of package ingest failure, provide an option to store
# the package on the file system. The default is false.
#sword2.keep-package-on-fail=false
#sword2.failed-package.dir=${dspace.baseUrl}/upload
#keep-package-on-fail=false
#failed-package.dir=http://localhost:8080/upload
# Should we support mediated deposit via sword? Enabled, this will
# allow users to deposit content packages on behalf of other users.
@@ -109,7 +109,7 @@ sword2.keep-original-package = true
# See the SWORD specification for a detailed explanation of deposit
# On-Behalf-Of another user
#
sword2.on-behalf-of.enable = true
on-behalf-of.enable = true
# The URL which identifies the sword software which provides
# the sword interface. This is the URL which DSpace will use
@@ -117,38 +117,38 @@ sword2.on-behalf-of.enable = true
#
# The default is:
#
# http://www.dspace.org/ns/sword/1.3.1
# http://www.dspace.org/ns/sword/2.0/
#
# If you have modified your sword software, you should change
# this URI to identify your own version. If you are using the
# standard dspace-sword module you will not, in general, need
# to change this setting
#
# sword2.generator.url = http://www.dspace.org/ns/sword/2.0/
# generator.url = http://www.dspace.org/ns/sword/2.0/
sword2.auth-type = Basic
auth-type = Basic
sword2.generator.version = 2.0
generator.version = 2.0
sword2.allow-community-deposit = false
allow-community-deposit = false
sword2.upload.tempdir = ${dspace.dir}/upload
upload.tempdir = /dspace/upload
# The metadata field in which to store the updated date for
# items deposited via SWORD.
#
sword2.updated.field = dc.date.updated
updated.field = dc.date.updated
# The metadata field in which to store the value of the slug
# header if it is supplied
#
sword2.slug.field = dc.identifier.slug
slug.field = dc.identifier.slug
sword2.author.field = dc.contributor.author
sword2.title.field = dc.title
author.field = dc.contributor.author
title.field = dc.title
sword2.disseminate-packaging.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
sword2.disseminate-packaging.SimpleZip = http://purl.org/net/sword/package/SimpleZip
disseminate-packaging.METSDSpaceSIP = http://purl.org/net/sword/package/METSDSpaceSIP
disseminate-packaging.SimpleZip = http://purl.org/net/sword/package/SimpleZip
# Configure the plugins to process incoming packages. The form of this
# configuration is as per the Plugin Manager's Named Plugin documentation:
@@ -208,72 +208,72 @@ plugin.single.org.dspace.sword2.WorkflowManager = \
#
# The default is METS
#
# sword2.mets-ingester.package-ingester = METS
# mets-ingester.package-ingester = METS
# Should the sword server enable restore-mode when ingesting new
# packages. If this is enabled the item will be treated as a
# previously deleted item from the repository. If the item had
# previously been assigned a handle then that same handle will be
# restored to activity.
sword2.restore-mode.enable = false
restore-mode.enable = false
# metadata field mapping for SimpleDCEntryIngester
#
sword2.simpledc.abstract = dc.description.abstract
sword2.simpledc.accessRights = dc.rights
#sword2.simpledc.accrualMethod = dc.????
#sword2.simpledc.accrualPeriodicity = dc.????
#sword2.simpledc.accrualPolicy = dc.????
sword2.simpledc.alternative = dc.title.alternative
#sword2.simpledc.audience = dc.???
sword2.simpledc.available = dc.date.available
sword2.simpledc.bibliographicCitation = dc.identifier.citation
#sword2.simpledc.conformsTo = dc.????
sword2.simpledc.contributor = dc.contributor
sword2.simpledc.coverage = dc.coverage
sword2.simpledc.created = dc.date.created
sword2.simpledc.creator = dc.contributor.author
sword2.simpledc.date = dc.date
sword2.simpledc.dateAccepted = dc.date.accepted
sword2.simpledc.dateCopyrighted = dc.date.???
sword2.simpledc.dateSubmitted = dc.date.submitted
sword2.simpledc.description = dc.description
#sword2.simpledc.educationLevel = dc.???
sword2.simpledc.extent = dc.format.extent
sword2.simpledc.format = dc.format
#sword2.simpledc.hasFormat = dc.????
#sword2.simpledc.hasPart = dc.???
#sword2.simpledc.hasVersion = dc.???
sword2.simpledc.identifier = dc.identifier
#sword2.simpledc.instructionalMethod = dc.???
#sword2.simpledc.isFormatOf = dc.???
sword2.simpledc.isPartOf = dc.relation.ispartof
sword2.simpledc.isReferencedBy = dc.relation.isreferencedby
sword2.simpledc.isReplacedBy = dc.relation.isreplacedby
sword2.simpledc.isRequiredBy = dc.relation.isrequiredby
sword2.simpledc.issued = dc.date.issued
#sword2.simpledc.isVersionOf = dc.????
sword2.simpledc.language = dc.language
#sword2.simpledc.license = dc.????
#sword2.simpledc.mediator = dc.????
sword2.simpledc.medium = dc.format.medium
sword2.simpledc.modified = dc.date.modified
sword2.simpledc.provenance = dc.description.provenance
sword2.simpledc.publisher = dc.publisher
sword2.simpledc.references = dc.relation.references
sword2.simpledc.relation = dc.relation
sword2.simpledc.replaces = dc.relation.replaces
sword2.simpledc.requires = dc.relation.requires
sword2.simpledc.rights = dc.rights
sword2.simpledc.rightsHolder = dc.rights
sword2.simpledc.source = dc.source
sword2.simpledc.spatial = dc.coverage.spatial
sword2.simpledc.subject = dc.subject
#sword2.simpledc.tableOfContents = dc.????
sword2.simpledc.temporal = dc.coverage.temporal
sword2.simpledc.title = dc.title
sword2.simpledc.type = dc.type
#sword2.simpledc.valid = dc.????
simpledc.abstract = dc.description.abstract
simpledc.accessRights = dc.rights
#simpledc.accrualMethod = dc.????
#simpledc.accrualPeriodicity = dc.????
#simpledc.accrualPolicy = dc.????
simpledc.alternative = dc.title.alternative
#simpledc.audience = dc.???
simpledc.available = dc.date.available
simpledc.bibliographicCitation = dc.identifier.citation
#simpledc.conformsTo = dc.????
simpledc.contributor = dc.contributor
simpledc.coverage = dc.coverage
simpledc.created = dc.date.created
simpledc.creator = dc.contributor.author
simpledc.date = dc.date
simpledc.dateAccepted = dc.date.accepted
simpledc.dateCopyrighted = dc.date.???
simpledc.dateSubmitted = dc.date.submitted
simpledc.description = dc.description
#simpledc.educationLevel = dc.???
simpledc.extent = dc.format.extent
simpledc.format = dc.format
#simpledc.hasFormat = dc.????
#simpledc.hasPart = dc.???
#simpledc.hasVersion = dc.???
simpledc.identifier = dc.identifier
#simpledc.instructionalMethod = dc.???
#simpledc.isFormatOf = dc.???
simpledc.isPartOf = dc.relation.ispartof
simpledc.isReferencedBy = dc.relation.isreferencedby
simpledc.isReplacedBy = dc.relation.isreplacedby
simpledc.isRequiredBy = dc.relation.isrequiredby
simpledc.issued = dc.date.issued
#simpledc.isVersionOf = dc.????
simpledc.language = dc.language
#simpledc.license = dc.????
#simpledc.mediator = dc.????
simpledc.medium = dc.format.medium
simpledc.modified = dc.date.modified
simpledc.provenance = dc.description.provenance
simpledc.publisher = dc.publisher
simpledc.references = dc.relation.references
simpledc.relation = dc.relation
simpledc.replaces = dc.relation.replaces
simpledc.requires = dc.relation.requires
simpledc.rights = dc.rights
simpledc.rightsHolder = dc.rights
simpledc.source = dc.source
simpledc.spatial = dc.coverage.spatial
simpledc.subject = dc.subject
#simpledc.tableOfContents = dc.????
simpledc.temporal = dc.coverage.temporal
simpledc.title = dc.title
simpledc.type = dc.type
#simpledc.valid = dc.????
# order of precedence for importing multipart content. if entry-first then
@@ -283,79 +283,24 @@ sword2.simpledc.type = dc.type
# the specific behaviour of the package ingester selected
#
# Defaults to false
sword2.multipart.entry-first = false
multipart.entry-first = false
# if the workflow gets started, should there be a notification
# email sent
#
sword2.workflow.notify = true
workflow.notify = true
# when content is replaced, should the old version of the content be kept? This
# creates a copy of the ORIGINAL bundle with the name V_YYYY-MM-DD.X where YYYY-MM-DD
# is the date the copy was created, and X is an integer from 0 upwards.
#
sword2.versions.keep = true
sword2.state.workspace.uri = ${dspace.url}/state/inprogress
sword2.state.workspace.description = The item is in the user workspace
sword2.state.workflow.uri = ${dspace.url}/state/inreview
sword2.state.workflow.description = The item is undergoing review prior to acceptance to the archive
sword2.state.archive.uri = ${dspace.url}/state/archived
sword2.state.archive.description = The item has been archived
sword2.state.withdrawn.uri = ${dspace.url}/state/withdrawn
sword2.state.withdrawn.description = The item has been withdrawn from the item and is no longer available
########################################################################################################################
# tell the SWORD METS implementation which package ingester to use
# to install deposited content. This should refer to one of the
# classes configured for:
#
# plugin.named.org.dspace.content.packager.PackageIngester
#
# The value of sword.mets-ingester.package-ingester tells the
# system which named plugin for this interface should be used
# to ingest SWORD METS packages
#
# The default is METS
#
# sword.mets-ingester.package-ingester = METS
# Define the metadata type EPDCX (EPrints DC XML)
# to be handled by the SWORD crosswalk configuration
#
mets.default.ingest.crosswalk.EPDCX = SWORD
# define the stylesheet which will be used by the self-named
# XSLTIngestionCrosswalk class when asked to load the SWORD
# configuration (as specified above). This will use the
# specified stylesheet to crosswalk the incoming SWAP metadata
# to the DIM format for ingestion
#
crosswalk.submission.SWORD.stylesheet = crosswalks/sword-swap-ingest.xsl
# The base URL of the SWORD media links. This is the URL
# which DSpace will use to construct the media link urls
# for items which are deposited via sword
#
# The default is {dspace.url}/sword/media-link
#
# In the event that you are not deploying DSpace as the ROOT
# application in the servlet container, this will generate
# incorrect URLs, and you should override the functionality
# by specifying in full as below:
#
# sword.media-link.url = http://www.myu.ac.uk/sword/media-link
# Should the sword server enable restore-mode when ingesting new
# packages. If this is enabled the item will be treated as a
# previously deleted item from the repository. If the item had
# previously been assigned a handle then that same handle will be
# restored to activity.
sword.restore-mode.enable = false
versions.keep = true
state.workspace.uri = http://localhost:8080/xmlui/state/inprogress
state.workspace.description = The item is in the user workspace
state.workflow.uri = http://localhost:8080/xmlui/state/inreview
state.workflow.description = The item is undergoing review prior to acceptance to the archive
state.archive.uri = http://localhost:8080/xmlui/state/archived
state.archive.description = The item has been archived
state.withdrawn.uri = http://localhost:8080/xmlui/state/withdrawn
state.withdrawn.description = The item has been withdrawn from the item and is no longer available