mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
mass commit of broken code for identifiers. Fixes coming up over the next couple of weeks.
git-svn-id: http://scm.dspace.org/svn/repo/trunk@2583 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -39,15 +39,6 @@
|
||||
*/
|
||||
package org.dspace.content;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
@@ -65,9 +56,8 @@ import org.dspace.content.dao.CommunityDAO;
|
||||
import org.dspace.content.dao.CommunityDAOFactory;
|
||||
import org.dspace.content.dao.ItemDAO;
|
||||
import org.dspace.content.dao.ItemDAOFactory;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
import org.dspace.core.ArchiveManager;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
@@ -76,6 +66,20 @@ import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.dao.EPersonDAO;
|
||||
import org.dspace.eperson.dao.EPersonDAOFactory;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ExternalIdentifierMint;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
import org.dspace.uri.UnsupportedIdentifierException;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Class representing an item in DSpace. Note that everything is held in memory
|
||||
@@ -226,13 +230,86 @@ public class Item extends DSpaceObject
|
||||
return metadata;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Identifier Methods
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void setIdentifier(ObjectIdentifier oid)
|
||||
{
|
||||
// enxsure the identifier is localised to the item
|
||||
oid.setResourceTypeID(this.getType());
|
||||
oid.setResourceID(this.getID());
|
||||
|
||||
// FIXME: this can clearly result in duplicate fields, and once the principal is sound then we
|
||||
// need to come back and tidy this up
|
||||
|
||||
// store the canonical form of the identifier
|
||||
DCValue dcv = ConfigurationManager.getMetadataProperty("identifier.metadata.canonical-field.internal");
|
||||
if (dcv != null)
|
||||
{
|
||||
this.addMetadata(dcv.schema, dcv.element, dcv.qualifier, null, oid.getCanonicalForm());
|
||||
}
|
||||
|
||||
// now, should we store the full form
|
||||
if (ConfigurationManager.getBooleanProperty("identifier.metadata.store-url.internal"))
|
||||
{
|
||||
DCValue dc = ConfigurationManager.getMetadataProperty("identifier.metadata.url-field.internal");
|
||||
if (dc != null)
|
||||
{
|
||||
this.addMetadata(dc.schema, dc.element, dc.qualifier, null, IdentifierFactory.getURL(oid).toString());
|
||||
}
|
||||
}
|
||||
|
||||
// now let the superclass do its thing
|
||||
super.setIdentifier(oid);
|
||||
}
|
||||
|
||||
public void addExternalIdentifier(ExternalIdentifier identifier)
|
||||
throws UnsupportedIdentifierException
|
||||
{
|
||||
// FIXME: this can clearly result in duplicate fields, and once the principal is sound then we
|
||||
// need to come back and tidy this up
|
||||
|
||||
// store the canonical form of the identifier
|
||||
DCValue dcv = ExternalIdentifierMint.getCanonicalField(identifier.getType());
|
||||
if (dcv != null)
|
||||
{
|
||||
this.addMetadata(dcv.schema, dcv.element, dcv.qualifier, null, identifier.getCanonicalForm());
|
||||
}
|
||||
|
||||
// now, store the full form
|
||||
DCValue dc = ExternalIdentifierMint.getURLField(identifier.getType());
|
||||
if (dc != null)
|
||||
{
|
||||
this.addMetadata(dc.schema, dc.element, dc.qualifier, null, IdentifierFactory.getURL(identifier).toString());
|
||||
}
|
||||
|
||||
// now let the superclass do its thing
|
||||
super.addExternalIdentifier(identifier);
|
||||
}
|
||||
|
||||
public void setExternalIdentifiers(List<ExternalIdentifier> identifiers)
|
||||
throws UnsupportedIdentifierException
|
||||
{
|
||||
for (ExternalIdentifier eid : identifiers)
|
||||
{
|
||||
// store the canonical form of the identifier
|
||||
DCValue dcv = ExternalIdentifierMint.getCanonicalField(eid.getType());
|
||||
this.addMetadata(dcv.schema, dcv.element, dcv.qualifier, null, eid.getCanonicalForm());
|
||||
|
||||
// now, store the full form
|
||||
DCValue dc = ExternalIdentifierMint.getURLField(eid.getType());
|
||||
this.addMetadata(dc.schema, dc.element, dc.qualifier, null, IdentifierFactory.getURL(eid).toString());
|
||||
}
|
||||
|
||||
// now let the superclass do its thing
|
||||
super.setExternalIdentifiers(identifiers);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// End of Identifier Methods
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void setMetadata(List<DCValue> metadata)
|
||||
{
|
||||
this.metadata = metadata;
|
||||
|
@@ -264,8 +264,7 @@ public class ItemDAOCore extends ItemDAO
|
||||
schema = msDAO.retrieve(MetadataSchema.DC_SCHEMA_ID);
|
||||
}
|
||||
|
||||
field = mfDAO.retrieve(
|
||||
schema.getID(), memValue.element, memValue.qualifier);
|
||||
field = mfDAO.retrieve(schema.getID(), memValue.element, memValue.qualifier);
|
||||
|
||||
// Work out the place number for ordering
|
||||
int current = 0;
|
||||
|
@@ -496,8 +496,6 @@ public abstract class ArchiveManager
|
||||
*/
|
||||
private static void printExternalIdentifiers(Item item)
|
||||
{
|
||||
System.out.println("one pi: " + item.getExternalIdentifier().getCanonicalForm());
|
||||
System.out.println(item.getExternalIdentifiers().toString());
|
||||
for (ExternalIdentifier id : item.getExternalIdentifiers())
|
||||
{
|
||||
System.out.println(id.getCanonicalForm());
|
||||
|
@@ -39,13 +39,17 @@
|
||||
*/
|
||||
package org.dspace.core;
|
||||
|
||||
import org.apache.log4j.Category;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.helpers.OptionConverter;
|
||||
import org.dspace.content.DCValue;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
@@ -54,13 +58,6 @@ import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.log4j.Category;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.helpers.OptionConverter;
|
||||
|
||||
/**
|
||||
* Class for reading the DSpace system configuration. The main configuration is
|
||||
* read in as properties from a standard properties file. Email templates and
|
||||
@@ -250,6 +247,41 @@ public class ConfigurationManager
|
||||
}
|
||||
}
|
||||
|
||||
public static DCValue getMetadataProperty(String property)
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
loadConfig(null);
|
||||
}
|
||||
|
||||
String stringValue = properties.getProperty(property);
|
||||
|
||||
if (stringValue != null)
|
||||
{
|
||||
stringValue = stringValue.trim();
|
||||
String[] bits = stringValue.split("\\.");
|
||||
DCValue dcv = new DCValue();
|
||||
for (int i = 0; i < 3 && i < bits.length; i++)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
dcv.schema = bits[i];
|
||||
break;
|
||||
case 1:
|
||||
dcv.element = bits[i];
|
||||
break;
|
||||
case 2:
|
||||
dcv.qualifier = bits[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dcv;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of all the keys in the DSpace configuration
|
||||
*
|
||||
|
@@ -141,37 +141,6 @@ public abstract class ExternalIdentifier implements ResolvableIdentifier
|
||||
return type.getNamespace() + "/" + this.value;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public URL getURL()
|
||||
{
|
||||
/*
|
||||
try
|
||||
{
|
||||
String base = ConfigurationManager.getProperty("dspace.url");
|
||||
String urlForm = this.getURLForm();
|
||||
|
||||
if (base == null || "".equals(base))
|
||||
{
|
||||
throw new RuntimeException("No configuration, or configuration invalid for dspace.url");
|
||||
}
|
||||
|
||||
if (urlForm == null)
|
||||
{
|
||||
throw new RuntimeException("Unable to assign URL: no ExternalIdentifier available");
|
||||
}
|
||||
|
||||
String url = base + "/resource/" + urlForm;
|
||||
|
||||
return new URL(url);
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
log.error("caught exception: ", e);
|
||||
throw new RuntimeException(e);
|
||||
}*/
|
||||
return IdentifierFactory.getURL(this);
|
||||
}
|
||||
|
||||
public URI getURI()
|
||||
{
|
||||
try
|
||||
|
@@ -35,7 +35,9 @@
|
||||
*/
|
||||
package org.dspace.uri;
|
||||
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.PluginManager;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
@@ -132,4 +134,18 @@ public class ExternalIdentifierMint
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static DCValue getCanonicalField(ExternalIdentifierType type)
|
||||
{
|
||||
String cfg = "identifier.metadata.canonical-field." + type.getNamespace();
|
||||
DCValue dcv = ConfigurationManager.getMetadataProperty(cfg);
|
||||
return dcv;
|
||||
}
|
||||
|
||||
public static DCValue getURLField(ExternalIdentifierType type)
|
||||
{
|
||||
String cfg = "identifier.metadata.url-field." + type.getNamespace();
|
||||
DCValue dcv = ConfigurationManager.getMetadataProperty(cfg);
|
||||
return dcv;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package org.dspace.uri.dao;
|
||||
|
||||
public class ExternalIdentifierStorageException extends Exception
|
||||
{
|
||||
public ExternalIdentifierStorageException()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public ExternalIdentifierStorageException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ExternalIdentifierStorageException(String message, Throwable cause)
|
||||
{
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public ExternalIdentifierStorageException(Throwable cause)
|
||||
{
|
||||
super(cause);
|
||||
}
|
||||
}
|
@@ -638,6 +638,7 @@ public class WorkflowManager
|
||||
// Here, we try to get an external identifier for the item to send
|
||||
// in the notification email. If no external identifier exists, we
|
||||
// just send the "local" item URL.
|
||||
/*
|
||||
ExternalIdentifier identifier = i.getExternalIdentifier();
|
||||
String uri = "";
|
||||
if (identifier != null)
|
||||
@@ -647,7 +648,8 @@ public class WorkflowManager
|
||||
else
|
||||
{
|
||||
uri = IdentifierFactory.getURL(i).toString();
|
||||
}
|
||||
}*/
|
||||
String uri = IdentifierFactory.getURL(i).toString();
|
||||
|
||||
// Get title
|
||||
DCValue[] titles = i.getDC("title", null, Item.ANY);
|
||||
|
@@ -15,23 +15,35 @@ Built on Oct 05, 2005 (05:23:37 EDT)-->
|
||||
</schema>
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="propfindRequest">
|
||||
<wsdl:message name="propfindResponse">
|
||||
|
||||
<wsdl:part name="propfindReturn" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="LNIRemoteException">
|
||||
|
||||
<wsdl:part name="fault" type="impl:LNIRemoteException"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="proppatchRequest">
|
||||
|
||||
<wsdl:part name="uri" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="doc" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="depth" type="xsd:int"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:part name="types" type="xsd:string"/>
|
||||
<wsdl:message name="copyResponse">
|
||||
|
||||
<wsdl:part name="copyReturn" type="xsd:int"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="lookupRequest">
|
||||
<wsdl:message name="proppatchResponse">
|
||||
|
||||
<wsdl:part name="handle" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="bitstreamPid" type="xsd:string"/>
|
||||
<wsdl:part name="proppatchReturn" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
@@ -41,12 +53,6 @@ Built on Oct 05, 2005 (05:23:37 EDT)-->
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="propfindResponse">
|
||||
|
||||
<wsdl:part name="propfindReturn" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="copyRequest">
|
||||
|
||||
<wsdl:part name="source" type="xsd:string"/>
|
||||
@@ -61,30 +67,24 @@ Built on Oct 05, 2005 (05:23:37 EDT)-->
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="LNIRemoteException">
|
||||
<wsdl:message name="lookupRequest">
|
||||
|
||||
<wsdl:part name="fault" type="impl:LNIRemoteException"/>
|
||||
<wsdl:part name="handle" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="bitstreamPid" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="copyResponse">
|
||||
|
||||
<wsdl:part name="copyReturn" type="xsd:int"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="proppatchResponse">
|
||||
|
||||
<wsdl:part name="proppatchReturn" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="proppatchRequest">
|
||||
<wsdl:message name="propfindRequest">
|
||||
|
||||
<wsdl:part name="uri" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="doc" type="xsd:string"/>
|
||||
|
||||
<wsdl:part name="depth" type="xsd:int"/>
|
||||
|
||||
<wsdl:part name="types" type="xsd:string"/>
|
||||
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="LNISoapServlet">
|
||||
|
@@ -67,6 +67,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.PluginManager;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.jdom.Element;
|
||||
|
||||
|
||||
@@ -508,7 +509,7 @@ class DAVCollection extends DAVDSpaceObject
|
||||
Item ni = wfi.getItem();
|
||||
|
||||
// FIXME: I'm not sure this is what we want
|
||||
String handle = ni.getExternalIdentifier().getCanonicalForm();
|
||||
String handle = IdentifierFactory.getCanonicalForm(ni);
|
||||
// String handle = HandleManager.findHandle(this.context, ni);
|
||||
|
||||
String end = (handle != null) ? DAVDSpaceObject
|
||||
|
@@ -40,9 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.aspect.administrative;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
@@ -54,12 +51,14 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@@ -93,10 +92,13 @@ public class FlowAuthorizationUtils {
|
||||
//Check whether it's a handle or internal id (by check ing if it has a slash in the string)
|
||||
if (identifier.contains("/")) {
|
||||
// DSpaceObject dso = HandleManager.resolveToObject(context, identifier);
|
||||
/*
|
||||
ExternalIdentifierDAO identifierDAO =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(identifier);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, identifier);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
if (dso != null && dso.getType() == Constants.ITEM) {
|
||||
result.setParameter("itemID", dso.getID());
|
||||
|
@@ -58,7 +58,8 @@ import org.dspace.content.FormatIdentifier;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.MetadataField;
|
||||
import org.dspace.content.MetadataSchema;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.Constants;
|
||||
@@ -109,8 +110,11 @@ public class FlowItemUtils
|
||||
if (identifier.contains("/"))
|
||||
{
|
||||
// DSpaceObject dso = HandleManager.resolveToObject(context, identifier);
|
||||
/*
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(identifier);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, identifier);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
if (dso != null && dso.getType() == Constants.ITEM)
|
||||
{
|
||||
|
@@ -40,14 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.aspect.administrative;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
@@ -77,8 +69,6 @@ import org.dspace.browse.BrowseException;
|
||||
import org.dspace.browse.BrowseIndex;
|
||||
import org.dspace.browse.BrowseInfo;
|
||||
import org.dspace.browse.BrowserScope;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DCDate;
|
||||
@@ -86,8 +76,19 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Implements all the browse functionality (browse by title, subject, authors,
|
||||
* etc.) The types of browse available are configurable by the implementor. See
|
||||
@@ -171,7 +172,7 @@ public class WithdrawnItems extends AbstractDSpaceTransformer implements
|
||||
{
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
|
@@ -39,9 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.authorization;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
@@ -60,6 +57,10 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Alexey Maslov
|
||||
@@ -125,13 +126,13 @@ public class EditContainerPolicies extends AbstractDSpaceTransformer
|
||||
if (containerType == Constants.COLLECTION)
|
||||
{
|
||||
Collection col = Collection.find(context, containerID);
|
||||
main.setHead(T_main_head_collection.parameterize(col.getMetadata("name"),col.getExternalIdentifier().getCanonicalForm(),col.getID()));
|
||||
main.setHead(T_main_head_collection.parameterize(col.getMetadata("name"), IdentifierFactory.getCanonicalForm(col),col.getID()));
|
||||
policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, col);
|
||||
}
|
||||
else
|
||||
{
|
||||
Community com = Community.find(context, containerID);
|
||||
main.setHead(T_main_head_community.parameterize(com.getMetadata("name"),com.getExternalIdentifier().getCanonicalForm(),com.getID()));
|
||||
main.setHead(T_main_head_community.parameterize(com.getMetadata("name"),IdentifierFactory.getCanonicalForm(com),com.getID()));
|
||||
policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, com);
|
||||
}
|
||||
|
||||
|
@@ -39,9 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.authorization;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
@@ -61,6 +58,10 @@ import org.dspace.content.Bundle;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Alexey Maslov
|
||||
@@ -146,7 +147,7 @@ public class EditItemPolicies extends AbstractDSpaceTransformer
|
||||
|
||||
// DIVISION: main
|
||||
Division main = body.addInteractiveDivision("edit-item-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
|
||||
main.setHead(T_main_head.parameterize(item.getExternalIdentifier().getCanonicalForm(),item.getID()));
|
||||
main.setHead(T_main_head.parameterize(IdentifierFactory.getCanonicalForm(item),item.getID()));
|
||||
main.addPara().addHighlight("italic").addContent(T_main_para1);
|
||||
main.addPara().addHighlight("italic").addContent(T_main_para2);
|
||||
|
||||
|
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.community;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
@@ -56,6 +54,9 @@ import org.dspace.app.xmlui.wing.element.TextArea;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Presents the user (in this case an administrator over the community) with the
|
||||
@@ -106,7 +107,7 @@ public class EditCommunityMetadataForm extends AbstractDSpaceTransformer
|
||||
|
||||
// DIVISION: main
|
||||
Division main = body.addInteractiveDivision("community-metadata-edit",contextPath+"/admin/community",Division.METHOD_MULTIPART,"primary administrative community");
|
||||
main.setHead(T_main_head.parameterize(thisCommunity.getExternalIdentifier().getCanonicalForm()));
|
||||
main.setHead(T_main_head.parameterize(IdentifierFactory.getCanonicalForm(thisCommunity)));
|
||||
|
||||
if (AuthorizeManager.isAdmin(context))
|
||||
{
|
||||
|
@@ -39,12 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.group;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
import org.dspace.app.xmlui.aspect.administrative.FlowGroupUtils;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
@@ -62,6 +56,13 @@ import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
* Present the user with the group's current state. The user may select to
|
||||
@@ -288,10 +289,9 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
||||
{
|
||||
Para para = main.addPara();
|
||||
para.addContent(T_collection_para);
|
||||
para.addXref(contextPath+"/handle/"+collection.getExternalIdentifier().getCanonicalForm(), collection.getMetadata("name"));
|
||||
para.addXref(IdentifierFactory.getURL(collection).toString(), collection.getMetadata("name"));
|
||||
}
|
||||
|
||||
|
||||
// DIVISION: group-actions
|
||||
Division actions = main.addDivision("group-edit-actions");
|
||||
Para groupName = actions.addPara();
|
||||
@@ -498,7 +498,7 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
||||
|
||||
Highlight highlight = cell.addHighlight("fade");
|
||||
highlight.addContent("[");
|
||||
highlight.addXref(contextPath+"/handle/"+collection.getExternalIdentifier().getCanonicalForm(), T_groups_collection_link);
|
||||
highlight.addXref(IdentifierFactory.getURL(collection).toString(), T_groups_collection_link);
|
||||
highlight.addContent("]");
|
||||
}
|
||||
}
|
||||
|
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.group;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.aspect.administrative.FlowGroupUtils;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
@@ -57,6 +55,9 @@ import org.dspace.app.xmlui.wing.element.Table;
|
||||
import org.dspace.app.xmlui.wing.element.Text;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Manage groups page is the entry point for group management. From here the user
|
||||
@@ -265,7 +266,7 @@ public class ManageGroupsMain extends AbstractDSpaceTransformer
|
||||
Highlight highlight = cell.addHighlight("fade");
|
||||
|
||||
highlight.addContent("[");
|
||||
highlight.addXref(contextPath+"/handle/"+collection.getExternalIdentifier().getCanonicalForm(), T_collection_link);
|
||||
highlight.addXref(IdentifierFactory.getURL(collection).toString(), T_collection_link);
|
||||
highlight.addContent("]");
|
||||
}
|
||||
}
|
||||
|
@@ -39,10 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.item;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
@@ -55,6 +51,11 @@ import org.dspace.app.xmlui.wing.element.Row;
|
||||
import org.dspace.app.xmlui.wing.element.Table;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +115,7 @@ public class ConfirmItemForm extends AbstractDSpaceTransformer {
|
||||
|
||||
// DIVISION: Main
|
||||
Division main = body.addInteractiveDivision("confirm-item", contextPath+"/admin/item", Division.METHOD_POST,"primary administrative item");
|
||||
main.setHead(T_head1.parameterize(item.getExternalIdentifier().getCanonicalForm()));
|
||||
main.setHead(T_head1.parameterize(IdentifierFactory.getCanonicalForm(item)));
|
||||
|
||||
// PARA: descriptive instructions
|
||||
if("delete".equals(confirm))
|
||||
|
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.administrative.item;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
@@ -53,6 +51,9 @@ import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Display basic meta-meta information about the item and allow the user to change
|
||||
@@ -146,7 +147,7 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
|
||||
|
||||
itemInfo.addLabel(T_label_handle);
|
||||
// itemInfo.addItem(item.getHandle()==null?"None":item.getHandle());
|
||||
itemInfo.addItem(item.getExternalIdentifier()==null?"None":item.getExternalIdentifier().getCanonicalForm());
|
||||
itemInfo.addItem(IdentifierFactory.getCanonicalForm(item));
|
||||
|
||||
itemInfo.addLabel(T_label_modified);
|
||||
itemInfo.addItem(item.getLastModified().toString());
|
||||
@@ -161,6 +162,7 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
|
||||
|
||||
itemInfo.addLabel(T_label_page);
|
||||
// if(item.getHandle()==null){
|
||||
/*
|
||||
if(item.getExternalIdentifier()==null){
|
||||
itemInfo.addItem(T_na);
|
||||
}
|
||||
@@ -168,6 +170,9 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
|
||||
// itemInfo.addItem().addXref(ConfigurationManager.getProperty("dspace.url") + "/handle/" + item.getHandle(),ConfigurationManager.getProperty("dspace.url") + "/handle/" + item.getHandle());
|
||||
itemInfo.addItem().addXref(ConfigurationManager.getProperty("dspace.url") + "/handle/" + item.getExternalIdentifier().getCanonicalForm(),ConfigurationManager.getProperty("dspace.url") + "/handle/" + item.getExternalIdentifier().getCanonicalForm());
|
||||
}
|
||||
*/
|
||||
String url = IdentifierFactory.getURL(item).toString();
|
||||
itemInfo.addItem().addXref(url, url);
|
||||
|
||||
itemInfo.addLabel(T_label_auth);
|
||||
addAdministratorOnlyButton(itemInfo.addItem(), "submit_authorization", T_submit_authorizations);
|
||||
|
@@ -59,6 +59,7 @@ import org.dspace.content.DCValue;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.ItemIterator;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -147,7 +148,7 @@ public class BrowseItemForm extends AbstractDSpaceTransformer {
|
||||
if (dcTitles != null && dcTitles.length >= 1)
|
||||
title = dcTitles[0].value;
|
||||
|
||||
String url = contextPath+"/handle/"+item.getExternalIdentifier().getCanonicalForm();
|
||||
String url = IdentifierFactory.getURL(item).toString();
|
||||
|
||||
Row row = table.addRow();
|
||||
|
||||
|
@@ -57,7 +57,8 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.search.DSQuery;
|
||||
@@ -140,7 +141,7 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
||||
if (dcTitles != null && dcTitles.length >= 1)
|
||||
title = dcTitles[0].value;
|
||||
|
||||
String url = contextPath+"/handle/"+item.getExternalIdentifier().getCanonicalForm();
|
||||
String url = IdentifierFactory.getURL(item).toString();
|
||||
|
||||
Row row = table.addRow();
|
||||
|
||||
@@ -191,9 +192,12 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
||||
for (String uri : uris)
|
||||
{
|
||||
// DSpaceObject resultDSO = HandleManager.resolveToObject(context, handle);
|
||||
/*
|
||||
ExternalIdentifier identifier = identifierDAO.retrieve(uri);
|
||||
DSpaceObject resultDSO =
|
||||
identifier.getObjectIdentifier().getObject(context);
|
||||
identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
|
||||
if (resultDSO instanceof Item)
|
||||
{
|
||||
|
@@ -44,7 +44,6 @@ import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
@@ -70,7 +69,8 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.Context;
|
||||
@@ -155,7 +155,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// What scope the search is at
|
||||
DSpaceObject scope = getScope();
|
||||
if (scope != null)
|
||||
key += "-" + scope.getExternalIdentifier().getCanonicalForm();
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(scope);
|
||||
|
||||
// The actualy search query.
|
||||
key += "-" + getQuery();
|
||||
@@ -200,9 +200,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
{
|
||||
// DSpaceObject resultDSO = HandleManager.resolveToObject(
|
||||
// context, handle);
|
||||
/*
|
||||
ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
DSpaceObject resultDSO =
|
||||
identifier.getObjectIdentifier().getObject(context);
|
||||
identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
validity.add(resultDSO);
|
||||
}
|
||||
|
||||
@@ -300,9 +303,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
{
|
||||
// DSpaceObject resultDSO = HandleManager.resolveToObject(
|
||||
// context, handle);
|
||||
/*
|
||||
ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
DSpaceObject resultDSO =
|
||||
identifier.getObjectIdentifier().getObject(context);
|
||||
identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
|
||||
if (resultDSO instanceof Community
|
||||
|| resultDSO instanceof Collection)
|
||||
@@ -330,10 +336,13 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
{
|
||||
// DSpaceObject resultDSO = HandleManager.resolveToObject(
|
||||
// context, handle);
|
||||
/*
|
||||
ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
DSpaceObject resultDSO =
|
||||
identifier.getObjectIdentifier().getObject(context);
|
||||
identifier.getObjectIdentifier().getObject(context);*/
|
||||
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
if (resultDSO instanceof Item)
|
||||
{
|
||||
if (referenceSet == null) {
|
||||
@@ -384,7 +393,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
scope.setOptionSelected("/");
|
||||
for (Community community : Community.findAll(context))
|
||||
{
|
||||
scope.addOption(community.getExternalIdentifier().getCanonicalForm(),community.getMetadata("name"));
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
else if (scopeDSO instanceof Community)
|
||||
@@ -393,12 +402,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// within
|
||||
Community community = (Community) scopeDSO;
|
||||
scope.addOption("/",T_all_of_dspace);
|
||||
scope.addOption(community.getExternalIdentifier().getCanonicalForm(),community.getMetadata("name"));
|
||||
scope.setOptionSelected(community.getExternalIdentifier().getCanonicalForm());
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierFactory.getCanonicalForm(community));
|
||||
|
||||
for (Collection collection : community.getCollections())
|
||||
{
|
||||
scope.addOption(collection.getExternalIdentifier().getCanonicalForm(),collection.getMetadata("name"));
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
else if (scopeDSO instanceof Collection)
|
||||
@@ -406,14 +415,14 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// The scope is a collection, display all parent collections.
|
||||
Collection collection = (Collection) scopeDSO;
|
||||
scope.addOption("/",T_all_of_dspace);
|
||||
scope.addOption(collection.getExternalIdentifier().getCanonicalForm(),collection.getMetadata("name"));
|
||||
scope.setOptionSelected(collection.getExternalIdentifier().getCanonicalForm());
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierFactory.getCanonicalForm(collection));
|
||||
|
||||
Community[] communities = collection.getCommunities()[0]
|
||||
.getAllParents();
|
||||
for (Community community : communities)
|
||||
{
|
||||
scope.addOption(community.getExternalIdentifier().getCanonicalForm(),community.getMetadata("name"));
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,8 +508,11 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
{
|
||||
// Get the search scope from the location parameter
|
||||
// dso = HandleManager.resolveToObject(context, scopeString);
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, scopeString);
|
||||
dso = ri.getObject(context);
|
||||
/*
|
||||
ExternalIdentifier identifier = dao.retrieve(scopeString);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);*/
|
||||
}
|
||||
|
||||
return dso;
|
||||
|
@@ -71,6 +71,7 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -130,7 +131,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
if (dso == null)
|
||||
return "0";
|
||||
|
||||
return HashUtil.hash(dso.getExternalIdentifier().getCanonicalForm());
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -218,7 +219,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
String feedFormat = parts[0].trim()+"+xml";
|
||||
|
||||
String feedURL = contextPath+"/feed/"+collection.getExternalIdentifier().getCanonicalForm()+"/"+format.trim();
|
||||
String feedURL = IdentifierFactory.getURL(collection).toString() + "/"+format.trim();
|
||||
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
|
||||
}
|
||||
}
|
||||
@@ -248,7 +249,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
// Search query
|
||||
Division query = search.addInteractiveDivision("collection-search",
|
||||
contextPath + "/handle/" + collection.getExternalIdentifier().getCanonicalForm() + "/search",
|
||||
IdentifierFactory.getURL(collection).toString() + "/search",
|
||||
Division.METHOD_POST, "secondary search");
|
||||
|
||||
Para para = query.addPara("search-query", null);
|
||||
@@ -263,7 +264,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
List browse = browseDiv.addList("collection-browse", List.TYPE_SIMPLE,
|
||||
"collection-browse");
|
||||
browse.setHead(T_head_browse);
|
||||
String url = contextPath + "/handle/" + collection.getExternalIdentifier().getCanonicalForm();
|
||||
String url = IdentifierFactory.getURL(collection).toString();
|
||||
browse.addItemXref(url + "/browse-title",T_browse_titles);
|
||||
browse.addItemXref(url + "/browse-author",T_browse_authors);
|
||||
browse.addItemXref(url + "/browse-date",T_browse_dates);
|
||||
|
@@ -39,13 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.artifactbrowser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.ProcessingException;
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
@@ -59,19 +52,26 @@ import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.app.xmlui.wing.element.Reference;
|
||||
import org.dspace.app.xmlui.wing.element.PageMeta;
|
||||
import org.dspace.app.xmlui.wing.element.Reference;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* Display a list of Communities and collections.
|
||||
*
|
||||
@@ -297,7 +297,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
else if (dso instanceof Collection)
|
||||
name = ((Collection) dso).getMetadata("name");
|
||||
|
||||
String url = contextPath + "/handle/"+dso.getExternalIdentifier().getCanonicalForm();
|
||||
String url = IdentifierFactory.getURL(dso).toString();
|
||||
list.addItem().addHighlight("bold").addXref(url, name);
|
||||
|
||||
List subList = null;
|
||||
@@ -311,7 +311,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
for (TreeNode collectionNode : collectionNodes)
|
||||
{
|
||||
String collectionName = ((Collection) collectionNode.getDSO()).getMetadata("name");
|
||||
String collectionUrl = contextPath + "/handle/"+collectionNode.getDSO().getExternalIdentifier().getCanonicalForm();
|
||||
String collectionUrl = IdentifierFactory.getURL(collectionNode.getDSO()).toString();
|
||||
subList.addItemXref(collectionUrl, collectionName);
|
||||
}
|
||||
}
|
||||
|
@@ -39,10 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.artifactbrowser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
import org.apache.cocoon.util.HashUtil;
|
||||
import org.apache.excalibur.source.SourceValidity;
|
||||
@@ -56,11 +52,11 @@ import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.app.xmlui.wing.element.Reference;
|
||||
import org.dspace.app.xmlui.wing.element.PageMeta;
|
||||
import org.dspace.app.xmlui.wing.element.Para;
|
||||
import org.dspace.app.xmlui.wing.element.Reference;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.browse.BrowseEngine;
|
||||
import org.dspace.browse.BrowseException;
|
||||
@@ -73,8 +69,13 @@ import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Display a single community. This includes a full text search, browse by list,
|
||||
* community display and a list of recent submissions.
|
||||
@@ -137,7 +138,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
if (dso == null)
|
||||
return "0"; // no item, something is wrong
|
||||
|
||||
return HashUtil.hash(dso.getExternalIdentifier().getCanonicalForm());
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -234,7 +235,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
|
||||
String feedFormat = parts[0].trim()+"+xml";
|
||||
|
||||
String feedURL = contextPath+"/feed/"+community.getExternalIdentifier().getCanonicalForm()+"/"+format.trim();
|
||||
String feedURL = IdentifierFactory.getURL(community).toString() +"/"+format.trim();
|
||||
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
|
||||
}
|
||||
}
|
||||
@@ -268,7 +269,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
|
||||
// Search query
|
||||
Division query = search.addInteractiveDivision("community-search",
|
||||
contextPath + "/handle/" + community.getExternalIdentifier().getCanonicalForm() + "/search",
|
||||
IdentifierFactory.getURL(community).toString() + "/search",
|
||||
Division.METHOD_POST, "secondary search");
|
||||
|
||||
Para para = query.addPara("search-query", null);
|
||||
@@ -283,7 +284,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
List browse = browseDiv.addList("community-browse", List.TYPE_SIMPLE,
|
||||
"community-browse");
|
||||
browse.setHead(T_head_browse);
|
||||
String url = contextPath + "/handle/" + community.getExternalIdentifier().getCanonicalForm();
|
||||
String url = IdentifierFactory.getURL(community).toString();
|
||||
browse.addItemXref(url + "/browse-title",T_browse_titles);
|
||||
browse.addItemXref(url + "/browse-author",T_browse_authors);
|
||||
browse.addItemXref(url + "/browse-date",T_browse_dates);
|
||||
|
@@ -89,6 +89,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -174,7 +175,7 @@ public class ConfigurableBrowse extends AbstractDSpaceTransformer implements
|
||||
{
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
|
@@ -39,11 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.artifactbrowser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
@@ -57,16 +52,22 @@ import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.PageMeta;
|
||||
import org.dspace.app.xmlui.wing.element.Para;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Display a single item.
|
||||
*
|
||||
@@ -104,7 +105,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (dso == null)
|
||||
return "0"; // no item, something is wrong.
|
||||
|
||||
return HashUtil.hash(dso.getExternalIdentifier().getCanonicalForm() + "full:" + showFullItem(objectModel));
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso) + "full:" + showFullItem(objectModel));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -158,7 +159,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (title != null)
|
||||
pageMeta.addMetadata("title").addContent(title);
|
||||
else
|
||||
pageMeta.addMetadata("title").addContent(item.getExternalIdentifier().getCanonicalForm());
|
||||
pageMeta.addMetadata("title").addContent(IdentifierFactory.getCanonicalForm(item));
|
||||
|
||||
pageMeta.addTrailLink(contextPath + "/",T_dspace_home);
|
||||
HandleUtil.buildHandleTrail(item,pageMeta,contextPath);
|
||||
@@ -183,19 +184,18 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (title != null)
|
||||
division.setHead(title);
|
||||
else
|
||||
division.setHead(item.getExternalIdentifier().getCanonicalForm());
|
||||
division.setHead(IdentifierFactory.getCanonicalForm(item));
|
||||
|
||||
Para showfullPara = division.addPara(null, "item-view-toggle item-view-toggle-top");
|
||||
|
||||
if (showFullItem(objectModel))
|
||||
{
|
||||
String link = contextPath + "/handle/" + item.getExternalIdentifier().getCanonicalForm();
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
showfullPara.addXref(link).addContent(T_show_simple);
|
||||
}
|
||||
else
|
||||
{
|
||||
String link = contextPath + "/handle/" + item.getExternalIdentifier().getCanonicalForm()
|
||||
+ "?show=full";
|
||||
String link = IdentifierFactory.getURL(item).toString() + "?show=full";
|
||||
showfullPara.addXref(link).addContent(T_show_full);
|
||||
}
|
||||
|
||||
@@ -225,13 +225,12 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
if (showFullItem(objectModel))
|
||||
{
|
||||
String link = contextPath + "/handle/" + item.getExternalIdentifier().getCanonicalForm();
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
showfullPara.addXref(link).addContent(T_show_simple);
|
||||
}
|
||||
else
|
||||
{
|
||||
String link = contextPath + "/handle/" + item.getExternalIdentifier().getCanonicalForm()
|
||||
+ "?show=full";
|
||||
String link = IdentifierFactory.getURL(item).toString() + "?show=full";
|
||||
showfullPara.addXref(link).addContent(T_show_full);
|
||||
}
|
||||
}
|
||||
|
@@ -39,12 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.artifactbrowser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
@@ -66,8 +60,15 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This transform applys the basic navigational links that should be available
|
||||
* on all pages generated by DSpace.
|
||||
@@ -115,7 +116,7 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
@@ -192,7 +193,7 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
}
|
||||
|
||||
// Add the configured browse lists for scoped browsing
|
||||
String handle = dso.getExternalIdentifier().getCanonicalForm();
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
addBrowseOptions(browseContext, contextPath + "/handle/" + handle + "/browse");
|
||||
}
|
||||
}
|
||||
@@ -229,14 +230,14 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
{
|
||||
if (dso instanceof Item)
|
||||
{
|
||||
pageMeta.addMetadata("focus","object").addContent(dso.getExternalIdentifier().getCanonicalForm());
|
||||
pageMeta.addMetadata("focus","object").addContent(IdentifierFactory.getCanonicalForm(dso));
|
||||
this.getObjectManager().manageObject(dso);
|
||||
dso = ((Item) dso).getOwningCollection();
|
||||
}
|
||||
|
||||
if (dso instanceof Collection || dso instanceof Community)
|
||||
{
|
||||
pageMeta.addMetadata("focus","container").addContent(dso.getExternalIdentifier().getCanonicalForm());
|
||||
pageMeta.addMetadata("focus","container").addContent(IdentifierFactory.getCanonicalForm(dso));
|
||||
this.getObjectManager().manageObject(dso);
|
||||
}
|
||||
}
|
||||
|
@@ -39,14 +39,11 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.artifactbrowser;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.utils.HandleUtil;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -57,8 +54,12 @@ import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Display an item restricted message.
|
||||
*
|
||||
@@ -125,7 +126,7 @@ public class RestrictedItem extends AbstractDSpaceTransformer //implements Cache
|
||||
}
|
||||
else
|
||||
{
|
||||
String handle = dso.getExternalIdentifier().getCanonicalForm();
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
type = "item";
|
||||
if (handle == null || "".equals(handle))
|
||||
{
|
||||
|
@@ -121,7 +121,6 @@ public class HandleMatcher extends AbstractLogEnabled implements Matcher
|
||||
|
||||
while (current != null)
|
||||
{
|
||||
|
||||
// Check if the current object has the handle we are looking for.
|
||||
if (current.getExternalIdentifier().getCanonicalForm().equals(handle))
|
||||
return current;
|
||||
|
@@ -39,10 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||
import org.apache.cocoon.util.HashUtil;
|
||||
import org.apache.excalibur.source.SourceValidity;
|
||||
@@ -58,8 +54,13 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Add a single link to the display item page that allows
|
||||
* the user to submit a new item to this collection.
|
||||
@@ -89,7 +90,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
if (dso == null)
|
||||
return "0";
|
||||
|
||||
return HashUtil.hash(dso.getExternalIdentifier().getCanonicalForm());
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -163,7 +164,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
Division home = body.addDivision("collection-home","primary repository collection");
|
||||
Division viewer = home.addDivision("collection-view","secondary");
|
||||
String submitURL = contextPath + "/handle/" + collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String submitURL = IdentifierFactory.getURL(collection) + "/submit";
|
||||
viewer.addPara().addXref(submitURL,"Submit a new item to this collection");
|
||||
|
||||
}
|
||||
|
@@ -40,14 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.aspect.submission;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.apache.cocoon.environment.http.HttpEnvironment;
|
||||
@@ -57,8 +49,8 @@ import org.dspace.app.util.SubmissionConfig;
|
||||
import org.dspace.app.util.SubmissionConfigReader;
|
||||
import org.dspace.app.util.SubmissionInfo;
|
||||
import org.dspace.app.util.SubmissionStepConfig;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
@@ -67,9 +59,17 @@ import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.submit.AbstractProcessingStep;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is a utility class to aid in the submission flow scripts.
|
||||
* Since data validation is cumbersome inside a flow script this
|
||||
@@ -451,7 +451,7 @@ public class FlowUtils {
|
||||
//Load the Submission Process for the collection this WSI is associated with
|
||||
Collection c = wsi.getCollection();
|
||||
SubmissionConfigReader subConfigReader = new SubmissionConfigReader();
|
||||
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c.getExternalIdentifier().getCanonicalForm(), false);
|
||||
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(IdentifierFactory.getCanonicalForm(c), false);
|
||||
|
||||
// Set the "stage_reached" column on the workspace item
|
||||
// to the LAST page of the LAST step in the submission process
|
||||
|
@@ -39,9 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
@@ -62,10 +59,14 @@ import org.dspace.content.SupervisedItem;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* @author Scott Phillips
|
||||
*/
|
||||
@@ -245,7 +246,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
for (WorkflowItem owned : ownedItems)
|
||||
{
|
||||
int workflowItemID = owned.getID();
|
||||
String url = contextPath+"/handle/"+owned.getCollection().getExternalIdentifier().getCanonicalForm()+"/workflow?workflowID="+workflowItemID;
|
||||
String url = IdentifierFactory.getURL(owned.getCollection()).toString()+"/workflow?workflowID="+workflowItemID;
|
||||
DCValue[] titles = owned.getItem().getDC("title", null, Item.ANY);
|
||||
String collectionName = owned.getCollection().getMetadata("name");
|
||||
EPerson submitter = owned.getSubmitter();
|
||||
@@ -308,7 +309,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
for (WorkflowItem pooled : pooledItems)
|
||||
{
|
||||
int workflowItemID = pooled.getID();
|
||||
String url = contextPath+"/handle/"+pooled.getCollection().getExternalIdentifier().getCanonicalForm()+"/workflow?workflowID="+workflowItemID;
|
||||
String url = IdentifierFactory.getURL(pooled.getCollection()).toString()+"/workflow?workflowID="+workflowItemID;
|
||||
DCValue[] titles = pooled.getItem().getDC("title", null, Item.ANY);
|
||||
String collectionName = pooled.getCollection().getMetadata("name");
|
||||
EPerson submitter = pooled.getSubmitter();
|
||||
|
@@ -39,13 +39,10 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -56,8 +53,12 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.license.CreativeCommons;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is an optional page of the item submission processes. The Creative
|
||||
* Commons license may be added to an item in addition to the standard distribution
|
||||
@@ -112,7 +113,7 @@ public class CCLicenseStep extends AbstractSubmissionStep
|
||||
// Build the url to and from creative commons
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
boolean https = request.isSecure();
|
||||
|
@@ -39,21 +39,13 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.dspace.app.util.DCInput;
|
||||
import org.dspace.app.util.DCInputSet;
|
||||
import org.dspace.app.util.DCInputsReader;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.aspect.submission.FlowUtils;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -73,10 +65,15 @@ import org.dspace.content.DCPersonName;
|
||||
import org.dspace.content.DCSeriesNumber;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.Item;
|
||||
|
||||
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* This is a step of the item submission processes. The describe step queries
|
||||
* the user for various metadata items about the item. For the most part all the
|
||||
@@ -171,13 +168,13 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
// Obtain the inputs (i.e. metadata fields we are going to display)
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
DCInputSet inputSet = null;
|
||||
DCInput[] inputs = {};
|
||||
try
|
||||
{
|
||||
inputSet = getInputsReader().getInputs(submission.getCollection().getExternalIdentifier().getCanonicalForm());
|
||||
inputSet = getInputsReader().getInputs(IdentifierFactory.getCanonicalForm(submission.getCollection()));
|
||||
inputs = inputSet.getPageRows(getPage()-1, submission.hasMultipleTitles(), submission.isPublishedBefore());
|
||||
}
|
||||
catch (ServletException se)
|
||||
@@ -317,7 +314,7 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
DCInputSet inputSet = null;
|
||||
try
|
||||
{
|
||||
inputSet = getInputsReader().getInputs(submission.getCollection().getExternalIdentifier().getCanonicalForm());
|
||||
inputSet = getInputsReader().getInputs(IdentifierFactory.getCanonicalForm(submission.getCollection()));
|
||||
}
|
||||
catch (ServletException se)
|
||||
{
|
||||
|
@@ -39,15 +39,11 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.ProcessingException;
|
||||
import org.apache.cocoon.environment.SourceResolver;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -60,8 +56,13 @@ import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.BitstreamFormat;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.FormatIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is a sub step of the Upload step during item submission. This
|
||||
* page allows the user to edit metadata about a bitstream (aka file)
|
||||
@@ -139,7 +140,7 @@ public class EditFileStep extends AbstractStep
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
// Get the bitstream and all the various formats
|
||||
BitstreamFormat currentFormat = bitstream.getFormat();
|
||||
|
@@ -39,11 +39,8 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -54,8 +51,12 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is the first official step of the item submission processes. This
|
||||
* step will ask the user two questions which will direct whether future
|
||||
@@ -123,7 +124,7 @@ public class InitialQuestionsStep extends AbstractSubmissionStep
|
||||
// Get any metadata that may be removed by unselecting one of these options.
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
DCValue[] titles = item.getDC("title", "alternative", Item.ANY);
|
||||
|
||||
|
@@ -39,15 +39,11 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.ProcessingException;
|
||||
import org.apache.cocoon.environment.SourceResolver;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -57,8 +53,13 @@ import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.license.CreativeCommons;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is the last step of the item submission processes. During this
|
||||
* step the user must agree to the collection's standard distribution
|
||||
@@ -146,7 +147,7 @@ public class LicenseStep extends AbstractSubmissionStep
|
||||
|
||||
// Get the full text for the actuial licese
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String licenseText = collection.getLicense();
|
||||
|
||||
Division div = body.addInteractiveDivision("submit-license",actionURL, Division.METHOD_POST,"primary submission");
|
||||
|
@@ -39,24 +39,25 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This step is used when the a user clicks an unfinished submission
|
||||
* from the submissions page. Here we present the full item and then
|
||||
@@ -94,7 +95,7 @@ public class ResumeStep extends AbstractStep
|
||||
// Get any metadata that may be removed by unselecting one of these options.
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String showfull = request.getParameter("showfull");
|
||||
|
@@ -39,21 +39,16 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.ProcessingException;
|
||||
import org.apache.cocoon.environment.SourceResolver;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.util.SubmissionConfig;
|
||||
import org.dspace.app.util.SubmissionStepConfig;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.aspect.submission.FlowUtils;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -62,8 +57,14 @@ import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.submit.step.UploadStep;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* This is a step of the item submission processes. This is where the user
|
||||
* reviews everything they have entered about the item up to this point.
|
||||
@@ -137,7 +138,7 @@ public class ReviewStep extends AbstractSubmissionStep
|
||||
{
|
||||
// Get actionable URL
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
SubmissionConfig subConfig = submissionInfo.getSubmissionConfig();
|
||||
|
||||
|
@@ -39,12 +39,8 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -52,8 +48,12 @@ import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is sort-of a step of the submission processes (not
|
||||
* an official "step", since it does not extend AbstractSubmissionStep).
|
||||
@@ -96,7 +96,7 @@ public class SaveOrRemoveStep extends AbstractStep
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
|
||||
Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission");
|
||||
div.setHead(T_submission_head);
|
||||
|
@@ -56,9 +56,8 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.core.Constants;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
@@ -106,14 +105,16 @@ public class SelectCollectionStep extends AbstractSubmissionStep
|
||||
{
|
||||
Collection[] collections; // List of possible collections.
|
||||
// DSpaceObject dso = HandleManager.resolveToObject(context, handle);
|
||||
/*
|
||||
ExternalIdentifierDAO identifierDAO =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(handle);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(handle);*/
|
||||
ResolvableIdentifier eid = IdentifierFactory.resolve(context, handle);
|
||||
|
||||
DSpaceObject dso = null;
|
||||
if (eid != null)
|
||||
{
|
||||
dso = eid.getObjectIdentifier().getObject(context);
|
||||
dso = eid.getObject(context);
|
||||
}
|
||||
|
||||
if (dso != null && dso instanceof Community)
|
||||
@@ -142,7 +143,7 @@ public class SelectCollectionStep extends AbstractSubmissionStep
|
||||
String name = collection.getMetadata("name");
|
||||
if (name.length() > 50)
|
||||
name = name.substring(0, 47) + "...";
|
||||
select.addOption(collection.getExternalIdentifier().getCanonicalForm(),name);
|
||||
select.addOption(IdentifierFactory.getCanonicalForm(collection),name);
|
||||
}
|
||||
|
||||
Button submit = list.addItem().addButton("submit");
|
||||
|
@@ -39,16 +39,12 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.submit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.avalon.framework.parameters.Parameters;
|
||||
import org.apache.cocoon.ProcessingException;
|
||||
import org.apache.cocoon.environment.SourceResolver;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractSubmissionStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
@@ -67,9 +63,14 @@ import org.dspace.content.BitstreamFormat;
|
||||
import org.dspace.content.Bundle;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is a step of the item submission processes. The upload
|
||||
* stages allows the user to upload files into the submission. The
|
||||
@@ -185,7 +186,7 @@ public class UploadStep extends AbstractSubmissionStep
|
||||
// Get a list of all files in the original bundle
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/submit";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
boolean workflow = submission instanceof WorkflowItem;
|
||||
Bundle[] bundles = item.getBundles("ORIGINAL");
|
||||
Bitstream[] bitstreams = new Bitstream[0];
|
||||
|
@@ -39,9 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.workflow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
@@ -56,10 +53,14 @@ import org.dspace.app.xmlui.wing.element.Table;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
*
|
||||
* This step displays a workfrow item to the user and and presents several
|
||||
@@ -133,7 +134,7 @@ public class PerformTaskStep extends AbstractStep
|
||||
// Get any metadata that may be removed by unselecting one of these options.
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/workflow";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/workflow";
|
||||
int state = ((WorkflowItem) submission).getState();
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
@@ -39,25 +39,26 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.aspect.submission.workflow;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.aspect.submission.AbstractStep;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.app.xmlui.wing.element.Body;
|
||||
import org.dspace.app.xmlui.wing.element.Division;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.List;
|
||||
import org.dspace.app.xmlui.wing.element.ReferenceSet;
|
||||
import org.dspace.app.xmlui.wing.element.TextArea;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This step is used when the user has selected to
|
||||
* reject the item. Here they are asked to enter
|
||||
@@ -96,7 +97,7 @@ public class RejectTaskStep extends AbstractStep
|
||||
{
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = contextPath + "/handle/"+collection.getExternalIdentifier().getCanonicalForm() + "/workflow";
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/workflow";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String showfull = request.getParameter("showfull");
|
||||
|
@@ -68,6 +68,8 @@ import org.dspace.content.Bundle;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
@@ -221,10 +223,14 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
||||
else if (handle != null)
|
||||
{
|
||||
// Reference by an item's handle.
|
||||
/*
|
||||
ExternalIdentifierDAO identifierDAO =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(handle);
|
||||
dso = eid.getObjectIdentifier().getObject(context);
|
||||
dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, handle);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
if (dso instanceof Item && sequence > -1)
|
||||
{
|
||||
@@ -253,11 +259,11 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
||||
String redictURL = request.getContextPath() + "/handle/";
|
||||
if (item!=null){
|
||||
// redictURL += item.getHandle();
|
||||
redictURL += item.getExternalIdentifier().getCanonicalForm();
|
||||
redictURL += IdentifierFactory.getCanonicalForm(item);
|
||||
}
|
||||
else if(dso!=null){
|
||||
// redictURL += dso.getHandle();
|
||||
redictURL += dso.getExternalIdentifier().getCanonicalForm();
|
||||
redictURL += IdentifierFactory.getCanonicalForm(dso);
|
||||
}
|
||||
redictURL += "/restricted-resource?bitstreamId=" + bitstream.getID();
|
||||
|
||||
|
@@ -40,14 +40,11 @@
|
||||
|
||||
package org.dspace.app.xmlui.cocoon;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Image;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import com.sun.syndication.io.WireFeedOutput;
|
||||
import org.apache.avalon.excalibur.pool.Recyclable;
|
||||
import org.apache.avalon.framework.configuration.Configurable;
|
||||
import org.apache.avalon.framework.configuration.Configuration;
|
||||
@@ -70,7 +67,6 @@ import org.dspace.browse.BrowseEngine;
|
||||
import org.dspace.browse.BrowseException;
|
||||
import org.dspace.browse.BrowseIndex;
|
||||
import org.dspace.browse.BrowserScope;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
@@ -78,23 +74,26 @@ import org.dspace.content.DCDate;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Image;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import com.sun.syndication.io.WireFeedOutput;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -190,10 +189,13 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
if (uri != null)
|
||||
{
|
||||
// dso = HandleManager.resolveToObject(context, handle);
|
||||
/*
|
||||
ExternalIdentifierDAO dao =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
dso = ri.getObject(context);
|
||||
}
|
||||
|
||||
validity.add(dso);
|
||||
@@ -258,10 +260,13 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
if (uri != null)
|
||||
{
|
||||
// dso = HandleManager.resolveToObject(context, handle);
|
||||
/*
|
||||
ExternalIdentifierDAO dao =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
if (dso == null)
|
||||
{
|
||||
@@ -588,6 +593,10 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
{
|
||||
log.error("Caught browse exception", bex);
|
||||
}
|
||||
catch (SortException sex) // apparently it's contageous
|
||||
{
|
||||
log.error("Caught sort exception", sex);
|
||||
}
|
||||
return this.recentSubmissionItems;
|
||||
}
|
||||
|
||||
@@ -615,9 +624,9 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
return url;
|
||||
}
|
||||
|
||||
if (ConfigurationManager.getBooleanProperty("webui.feed.localresolve")
|
||||
|| dso.getExternalIdentifier() == null)
|
||||
if (ConfigurationManager.getBooleanProperty("webui.feed.localresolve"))
|
||||
{
|
||||
/*
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
||||
String url = (request.isSecure()) ? "https://" : "http://";
|
||||
@@ -626,10 +635,12 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
url += request.getContextPath();
|
||||
url += "/handle/" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
return url;
|
||||
*/
|
||||
return IdentifierFactory.getLocalURL(dso).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return dso.getExternalIdentifier().getURI().toString();
|
||||
return IdentifierFactory.getURL(dso).toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -59,9 +59,8 @@ import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -172,10 +171,13 @@ public class DSpaceMETSGenerator extends AbstractGenerator
|
||||
// Specified using a regular handle.
|
||||
// DSpaceObject dso = HandleManager.resolveToObject(context, handle);
|
||||
// FIXME: This could be totally broken, I have no idea
|
||||
/*
|
||||
ExternalIdentifierDAO identifierDAO =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(uri);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
// Handles can be either items or containers.
|
||||
if (dso instanceof Item)
|
||||
|
@@ -40,12 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.objectmanager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.app.util.Util;
|
||||
import org.dspace.app.xmlui.wing.AttributeMap;
|
||||
import org.dspace.app.xmlui.wing.Namespace;
|
||||
@@ -56,12 +50,19 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.content.crosswalk.DisseminationCrosswalk;
|
||||
import org.dspace.core.PluginManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.ext.LexicalHandler;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
import org.xml.sax.helpers.NamespaceSupport;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* This is the abstract adapter containing all the common elements between
|
||||
@@ -398,6 +399,7 @@ public abstract class AbstractAdapter
|
||||
// be null if a handle has not yet been assigned. In this case refrence the
|
||||
// item its internal id. In the last case where the bitstream is not associated
|
||||
// with an item (such as a community logo) then refrence the bitstreamID directly.
|
||||
/*
|
||||
String identifier = null;
|
||||
if (item != null && item.getExternalIdentifier().getCanonicalForm() != null)
|
||||
identifier = "handle/"+item.getExternalIdentifier().getCanonicalForm();
|
||||
@@ -408,6 +410,8 @@ public abstract class AbstractAdapter
|
||||
|
||||
|
||||
String url = contextPath + "/bitstream/"+identifier+"/";
|
||||
*/
|
||||
String url = contextPath + IdentifierFactory.getURL(bitstream).toString();
|
||||
|
||||
// If we can put the pretty name of the bitstream on the end of the URL
|
||||
try
|
||||
|
@@ -40,10 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.objectmanager;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.wing.AttributeMap;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -54,6 +50,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.content.crosswalk.DisseminationCrosswalk;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
@@ -61,6 +58,10 @@ import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.SAXOutputter;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is an adapter which translates DSpace containers
|
||||
* (communities & collections) into METS documents. This adapter follows
|
||||
@@ -123,9 +124,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSOBJID()
|
||||
{
|
||||
if (dso.getExternalIdentifier() != null)
|
||||
return contextPath+"/handle/" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
return null;
|
||||
return IdentifierFactory.getURL(dso).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,15 +140,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSID()
|
||||
{
|
||||
if (dso.getExternalIdentifier().getCanonicalForm() == null)
|
||||
{
|
||||
if (dso instanceof Collection)
|
||||
return "collection:"+dso.getID();
|
||||
else
|
||||
return "community:"+dso.getID();
|
||||
}
|
||||
else
|
||||
return dso.getExternalIdentifier().getCanonicalForm();
|
||||
return IdentifierFactory.getCanonicalForm(dso);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +261,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
String description_abstract = collection.getMetadata("short_description");
|
||||
String description_table = collection.getMetadata("side_bar_text");
|
||||
// FIXME: Oh, so broken.
|
||||
String identifier_uri = "http://hdl.handle.net/" + collection.getExternalIdentifier().getValue();
|
||||
String identifier_uri = IdentifierFactory.getURL(collection).toString();
|
||||
String provenance = collection.getMetadata("provenance_description");
|
||||
String rights = collection.getMetadata("copyright_text");
|
||||
String rights_license = collection.getMetadata("license");
|
||||
@@ -293,7 +284,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
String description_abstract = community.getMetadata("short_description");
|
||||
String description_table = community.getMetadata("side_bar_text");
|
||||
// FIXME: Oh, so broken.
|
||||
String identifier_uri = "http://hdl.handle.net/" + community.getExternalIdentifier().getValue();
|
||||
String identifier_uri = IdentifierFactory.getURL(community).toString();
|
||||
String rights = community.getMetadata("copyright_text");
|
||||
String title = community.getMetadata("name");
|
||||
|
||||
|
@@ -40,10 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.objectmanager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.app.xmlui.wing.ObjectManager;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
import org.dspace.content.Collection;
|
||||
@@ -51,6 +47,11 @@ import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -112,7 +113,8 @@ public class DSpaceObjectManager implements ObjectManager
|
||||
if (object instanceof DSpaceObject)
|
||||
{
|
||||
DSpaceObject dso = (DSpaceObject) object;
|
||||
String handle = dso.getExternalIdentifier().getCanonicalForm();
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
// String handle = dso.getExternalIdentifier().getCanonicalForm();
|
||||
|
||||
// If the object has a handle then refrence it by it's handle.
|
||||
if (handle != null)
|
||||
|
@@ -50,6 +50,7 @@ import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.content.crosswalk.DisseminationCrosswalk;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.output.SAXOutputter;
|
||||
@@ -60,7 +61,6 @@ import org.xml.sax.helpers.XMLReaderFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -138,9 +138,7 @@ public class ItemAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSOBJID()
|
||||
{
|
||||
if (item.getExternalIdentifier().getCanonicalForm() != null)
|
||||
return contextPath+"/handle/" + item.getExternalIdentifier().getCanonicalForm();
|
||||
return null;
|
||||
return IdentifierFactory.getURL(item).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,10 +154,7 @@ public class ItemAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSID()
|
||||
{
|
||||
if (item.getExternalIdentifier().getCanonicalForm() == null)
|
||||
return "item:"+item.getID();
|
||||
else
|
||||
return item.getExternalIdentifier().getCanonicalForm();
|
||||
return IdentifierFactory.getCanonicalForm(item);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
package org.dspace.app.xmlui.objectmanager;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.app.xmlui.wing.AttributeMap;
|
||||
import org.dspace.app.xmlui.wing.Namespace;
|
||||
import org.dspace.app.xmlui.wing.WingException;
|
||||
@@ -50,8 +48,11 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is an an adapter which translates a DSpace repository into a METS
|
||||
* document. Unfortunitaly there is no real definition of what this is. So
|
||||
@@ -323,7 +324,7 @@ public class RepositoryAdapter extends AbstractAdapter
|
||||
attributesXLINK.setNamespace(XLINK);
|
||||
|
||||
attributes.put("LOCTYPE", "URL");
|
||||
attributesXLINK.put("href", "/metadata/handle/"+ dso.getExternalIdentifier().getCanonicalForm() +"/mets.xml");
|
||||
attributesXLINK.put("href", "/metadata/handle/"+ IdentifierFactory.getCanonicalForm(dso) +"/mets.xml"); // FIXME this isn't right
|
||||
startElement(METS,"mptr",attributes,attributesXLINK);
|
||||
endElement(METS,"mptr");
|
||||
|
||||
|
@@ -40,9 +40,6 @@
|
||||
|
||||
package org.dspace.app.xmlui.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.cocoon.util.HashUtil;
|
||||
import org.apache.excalibur.source.SourceValidity;
|
||||
import org.dspace.content.Bitstream;
|
||||
@@ -54,6 +51,10 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* This is a validity object specificaly implemented for the caching
|
||||
@@ -262,7 +263,8 @@ public class DSpaceValidity implements SourceValidity
|
||||
Community community = (Community) dso;
|
||||
|
||||
validityKey.append("Community:");
|
||||
validityKey.append(community.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(community));
|
||||
// validityKey.append(community.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(community.getMetadata("introductory_text"));
|
||||
validityKey.append(community.getMetadata("short_description"));
|
||||
validityKey.append(community.getMetadata("side_bar_text"));
|
||||
@@ -278,7 +280,8 @@ public class DSpaceValidity implements SourceValidity
|
||||
Collection collection = (Collection) dso;
|
||||
|
||||
validityKey.append("Collection:");
|
||||
validityKey.append(collection.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(collection));
|
||||
// validityKey.append(collection.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(collection.getMetadata("introductory_text"));
|
||||
validityKey.append(collection.getMetadata("short_description"));
|
||||
validityKey.append(collection.getMetadata("side_bar_text"));
|
||||
@@ -296,7 +299,8 @@ public class DSpaceValidity implements SourceValidity
|
||||
Item item = (Item) dso;
|
||||
|
||||
validityKey.append("Item:");
|
||||
validityKey.append(item.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(item));
|
||||
//validityKey.append(item.getExternalIdentifier().getCanonicalForm());
|
||||
// Include all metadata values in the validity key.
|
||||
DCValue[] dcvs = item.getDC(Item.ANY,Item.ANY,Item.ANY);
|
||||
for (DCValue dcv : dcvs)
|
||||
|
@@ -53,9 +53,8 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
|
||||
@@ -112,10 +111,13 @@ public class HandleUtil
|
||||
|
||||
Context context = ContextUtil.obtainContext(objectModel);
|
||||
// dso = HandleManager.resolveToObject(context, handle);
|
||||
/*
|
||||
ExternalIdentifierDAO dao =
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier identifier = dao.retrieve(handle);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);
|
||||
dso = identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, handle);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
request.setAttribute(DSPACE_OBJECT, dso);
|
||||
}
|
||||
|
@@ -256,6 +256,39 @@ plugin.sequence.org.dspace.uri.IdentifierResolver = \
|
||||
#
|
||||
identifier.url-scheme = hdl
|
||||
|
||||
# where should we store the actual uuid of the item?
|
||||
#
|
||||
indentifier.metadata.canonical-field.internal = dc.identifier.uuid
|
||||
|
||||
# Should we store the full resolvable url of the item in the repository in
|
||||
# its metadata? Since the local service URL may not be persistent, this may
|
||||
# not be appropriate, but if no external resolving service is available and
|
||||
# you make a commitment to always resolving this url, or updating it for
|
||||
# each item if it changes, then this can safely be set to true
|
||||
#
|
||||
identifier.metadata.store-url.internal = false
|
||||
|
||||
# If we are storing the full resolvable url of the item, where should we put it?
|
||||
#
|
||||
identifier.metadata.url-field.internal = dc.identifier.url
|
||||
|
||||
# Equivalent settings for external identifiers.
|
||||
#
|
||||
# Where should we store the canonical and url forms of the external identifiers
|
||||
# associated with the item
|
||||
#
|
||||
# The form of these declarations is as follows, in order to work with the plugin
|
||||
# framework for external identifiers:
|
||||
#
|
||||
# identifier.metadata.canonical-field.[identifier namespace] = [metadata field]
|
||||
# identifier.metadata.url-field.[identifier namespace] = [metadata field]
|
||||
#
|
||||
# you should include additonal configuration for every external identifier
|
||||
# plugin added
|
||||
#
|
||||
identifier.metadata.canonical-field.hdl = dc.identifier.hdl
|
||||
identifier.metadata.url-field.hdl = dc.identifier.url
|
||||
|
||||
##### Handle settings ######
|
||||
|
||||
# CNRI Handle prefix
|
||||
|
Reference in New Issue
Block a user