mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Core URI system refactoring, including javadocs, better modularity, and the change of IdentifierFactory to IdentifierService, in line with other naming conventions
git-svn-id: http://scm.dspace.org/svn/repo/trunk@2597 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -65,7 +65,7 @@ import org.dspace.content.ItemIterator;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* Command-line utility for generating HTML and Sitemaps.org protocol Sitemaps.
|
||||
@@ -212,7 +212,7 @@ public class GenerateSitemaps
|
||||
|
||||
for (int i = 0; i < comms.length; i++)
|
||||
{
|
||||
String url = IdentifierFactory.getURL(comms[i]).toString();
|
||||
String url = IdentifierService.getURL(comms[i]).toString();
|
||||
|
||||
if (makeHTMLMap)
|
||||
html.addURL(url, null);
|
||||
@@ -224,7 +224,7 @@ public class GenerateSitemaps
|
||||
|
||||
for (int i = 0; i < colls.length; i++)
|
||||
{
|
||||
String url = IdentifierFactory.getURL(colls[i]).toString();
|
||||
String url = IdentifierService.getURL(colls[i]).toString();
|
||||
|
||||
if (makeHTMLMap)
|
||||
html.addURL(url, null);
|
||||
@@ -238,7 +238,7 @@ public class GenerateSitemaps
|
||||
while (allItems.hasNext())
|
||||
{
|
||||
Item i = allItems.next();
|
||||
String url = IdentifierFactory.getURL(i).toString();
|
||||
String url = IdentifierService.getURL(i).toString();
|
||||
Date lastMod = i.getLastModified();
|
||||
|
||||
if (makeHTMLMap)
|
||||
|
@@ -38,7 +38,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -113,7 +113,7 @@ public class URIDispatcher implements BitstreamDispatcher
|
||||
{
|
||||
context = new Context();
|
||||
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject dso = di.getObject(context);
|
||||
/*
|
||||
ExternalIdentifierDAO identifierDAO =
|
||||
|
@@ -68,7 +68,7 @@ import org.dspace.eperson.dao.EPersonDAOFactory;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ExternalIdentifierService;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
import org.dspace.uri.UnsupportedIdentifierException;
|
||||
|
||||
@@ -261,9 +261,9 @@ public class Item extends DSpaceObject
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("setIdentifier: schema=" + dc.schema + ",element=" + dc.element + ",qualifier="
|
||||
+ dc.qualifier + ",url=" + IdentifierFactory.getURL(oid).toString());
|
||||
+ dc.qualifier + ",url=" + IdentifierService.getURL(oid).toString());
|
||||
}
|
||||
this.addUniqueMetadata(dc.schema, dc.element, dc.qualifier, null, IdentifierFactory.getURL(oid).toString());
|
||||
this.addUniqueMetadata(dc.schema, dc.element, dc.qualifier, null, IdentifierService.getURL(oid).toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ public class Item extends DSpaceObject
|
||||
DCValue ufi = ConfigurationManager.getMetadataProperty("identifier.metadata.url-field.internal");
|
||||
if (ufi != null)
|
||||
{
|
||||
ufi.value = IdentifierFactory.getURL(oid).toString();
|
||||
ufi.value = IdentifierService.getURL(oid).toString();
|
||||
dc.add(ufi);
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ import org.dspace.eperson.dao.SubscriptionDAO;
|
||||
import org.dspace.eperson.dao.SubscriptionDAOFactory;
|
||||
import org.dspace.search.Harvest;
|
||||
import org.dspace.search.HarvestedItemInfo;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
@@ -402,7 +402,7 @@ public class SubscriptionManager
|
||||
|
||||
emailText.append("\n ").append(labels.getString(
|
||||
"org.dspace.eperson.Subscribe.id")).append(
|
||||
IdentifierFactory.getURL(identifier).toString()).append(
|
||||
IdentifierService.getURL(identifier).toString()).append(
|
||||
"\n\n");
|
||||
}
|
||||
}
|
||||
|
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* ExternalIdentifierMint.java
|
||||
*
|
||||
* Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
* Institute of Technology. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
* Massachusetts Institute of Technology nor the names of their
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
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;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Richard Jones
|
||||
*/
|
||||
public class ExternalIdentifierMint
|
||||
{
|
||||
public static List<ExternalIdentifier> mintAll(Context context, DSpaceObject dso)
|
||||
{
|
||||
List<ExternalIdentifier> eids = new ArrayList<ExternalIdentifier>();
|
||||
IdentifierAssigner[] assigners = (IdentifierAssigner[]) PluginManager.getPluginSequence(IdentifierAssigner.class);
|
||||
for (int i = 0; i < assigners.length; i++)
|
||||
{
|
||||
ExternalIdentifier eid = assigners[i].mint(context, dso);
|
||||
eids.add(eid);
|
||||
}
|
||||
return eids;
|
||||
}
|
||||
|
||||
public static ExternalIdentifierType getType(String namespace)
|
||||
{
|
||||
ExternalIdentifierType[] eits = (ExternalIdentifierType[]) PluginManager.getPluginSequence(ExternalIdentifierType.class);
|
||||
for (int i = 0; i < eits.length; i++)
|
||||
{
|
||||
if (namespace.equals(eits[i].getNamespace()))
|
||||
{
|
||||
return eits[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ExternalIdentifier get(Context context, String namespace, String value)
|
||||
{
|
||||
ExternalIdentifierType[] eits = (ExternalIdentifierType[]) PluginManager.getPluginSequence(ExternalIdentifierType.class);
|
||||
for (int i = 0; i < eits.length; i++)
|
||||
{
|
||||
if (namespace.equals(eits[i].getNamespace()))
|
||||
{
|
||||
ExternalIdentifierDAO dao = ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = dao.retrieve(eits[i], value);
|
||||
return eid;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ExternalIdentifier get(Context context, ExternalIdentifierType type, String value, ObjectIdentifier oid)
|
||||
{
|
||||
ExternalIdentifierType[] eits = (ExternalIdentifierType[]) PluginManager.getPluginSequence(ExternalIdentifierType.class);
|
||||
for (int i = 0; i < eits.length; i++)
|
||||
{
|
||||
if (type.equals(eits[i]))
|
||||
{
|
||||
ExternalIdentifier eid = type.getInstance(value, oid);
|
||||
return eid;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ExternalIdentifier parseCanonicalForm(Context context, String canonicalForm)
|
||||
{
|
||||
ExternalIdentifier[] eids = (ExternalIdentifier[]) PluginManager.getPluginSequence(ExternalIdentifier.class);
|
||||
for (int i = 0; i < eids.length; i++)
|
||||
{
|
||||
ExternalIdentifier eid = eids[i].parseCanonicalForm(canonicalForm);
|
||||
if (eid != null)
|
||||
{
|
||||
ExternalIdentifierDAO dao = ExternalIdentifierDAOFactory.getInstance(context);
|
||||
return dao.retrieve(eid.getType(), eid.getValue());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ExternalIdentifier extractURLIdentifier(Context context, String path)
|
||||
{
|
||||
IdentifierResolver[] eids = (IdentifierResolver[]) PluginManager.getPluginSequence(IdentifierResolver.class);
|
||||
for (int i = 0; i < eids.length; i++)
|
||||
{
|
||||
ExternalIdentifier eid = eids[i].extractURLIdentifier(path);
|
||||
if (eid != null)
|
||||
{
|
||||
ExternalIdentifierDAO dao = ExternalIdentifierDAOFactory.getInstance(context);
|
||||
return dao.retrieve(eid.getType(), eid.getValue());
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
@@ -36,7 +36,6 @@
|
||||
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;
|
||||
@@ -68,7 +67,7 @@ public class ExternalIdentifierService
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static List<ExternalIdentifier> mintAll(Context context, DSpaceObject dso)
|
||||
public static List<ExternalIdentifier> mintAll(Context context, Identifiable dso)
|
||||
{
|
||||
List<ExternalIdentifier> eids = new ArrayList<ExternalIdentifier>();
|
||||
IdentifierAssigner[] assigners = (IdentifierAssigner[]) PluginManager.getPluginSequence(IdentifierAssigner.class);
|
||||
|
@@ -1,26 +1,118 @@
|
||||
/*
|
||||
* Identifiable.java
|
||||
*
|
||||
* Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
* Institute of Technology. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
* Massachusetts Institute of Technology nor the names of their
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
package org.dspace.uri;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Author: Richard Jones
|
||||
* Date: Jan 9, 2008
|
||||
* Time: 9:23:39 AM
|
||||
* Interface which must be implemented by any DSpace class wishing to expose any identifier
|
||||
* functionality. Some objects may only wish to use SimpleIdentifiers, which cannot be
|
||||
* used to resolve to the object through the API. Other objects may use different
|
||||
* combinations of identifiers depending on purpose. Most likely configurations are:
|
||||
*
|
||||
* - SimpleIdentifier support only
|
||||
* - ObjectIdentifier and SimpleIdentifier support only
|
||||
* - Full Identifier support
|
||||
*
|
||||
* Implementations wishing not to support a particular identifier mechanism should implement
|
||||
* the methods associated with that mechanism to simply throw an UnsupportedIdentifierException
|
||||
*
|
||||
* @author Richard Jones
|
||||
*/
|
||||
public interface Identifiable
|
||||
{
|
||||
/**
|
||||
* Get an instance of a SimpleIdentifier which belongs to an object
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
SimpleIdentifier getSimpleIdentifier();
|
||||
|
||||
/**
|
||||
* Set the SimpleIdentifier for the object
|
||||
*
|
||||
* @param sid
|
||||
* @throws UnsupportedIdentifierException
|
||||
*/
|
||||
void setSimpleIdentifier(SimpleIdentifier sid) throws UnsupportedIdentifierException;
|
||||
|
||||
/**
|
||||
* Get an instance of the object identifier which can be used to resolve to this object
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ObjectIdentifier getIdentifier();
|
||||
|
||||
/**
|
||||
* Set the ObjectIdentifier that this object should be resolvable by. Implementations should ensure
|
||||
* that the given object identifier actually refers correctly to the object it is being set to by
|
||||
* validating or setting the relevant parameters in the passed ObjectIdentifier
|
||||
*
|
||||
* @param oid
|
||||
* @throws UnsupportedIdentifierException
|
||||
*/
|
||||
void setIdentifier(ObjectIdentifier oid) throws UnsupportedIdentifierException;
|
||||
|
||||
/**
|
||||
* Get a list of all the external identifiers associated with the item
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ExternalIdentifier> getExternalIdentifiers();
|
||||
|
||||
/**
|
||||
* Set the complete and exclusive list of external identifiers to be associated with
|
||||
* an item. This should override any previously existing list of identifiers held by the item.
|
||||
* Implementation should ensure that the given external identifier actually refers to the
|
||||
* object's ObjectIdentifier either by validation, or setting the relevant parameters in the
|
||||
* passed ExternalIdentifier
|
||||
*
|
||||
* @param eids
|
||||
* @throws UnsupportedIdentifierException
|
||||
*/
|
||||
void setExternalIdentifiers(List<ExternalIdentifier> eids) throws UnsupportedIdentifierException;
|
||||
|
||||
/**
|
||||
* Add an ExternalIdentifier to the current list of external identifiers associated with
|
||||
* the item. Implementation should ensure that any given external identifier actually refers
|
||||
* to the object's ObjectIdentifier either by validation, or setting the relevant parameters
|
||||
* in the passed ExternalIdentifier
|
||||
*
|
||||
* @param eid
|
||||
* @throws UnsupportedIdentifierException
|
||||
*/
|
||||
void addExternalIdentifier(ExternalIdentifier eid) throws UnsupportedIdentifierException;
|
||||
}
|
||||
|
@@ -39,13 +39,25 @@
|
||||
*/
|
||||
package org.dspace.uri;
|
||||
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
|
||||
/**
|
||||
* Generic Interface for external identifier mechanisms which wish to be able to assign
|
||||
* new identifiers to DSpaceObjects. The ExternalIdentifierService can load classes
|
||||
* which conform to this interface and ask them to assign identifiers through this
|
||||
* generic mechanism
|
||||
*
|
||||
* @author Richard JOnes
|
||||
*/
|
||||
public interface IdentifierAssigner<T extends ExternalIdentifier>
|
||||
{
|
||||
T mint(Context context, DSpaceObject dso);
|
||||
/**
|
||||
* Mint a new identifier for the passed DSpaceObject. The implementation should not
|
||||
* attempt to assign the identifier to the DSpaceObject.
|
||||
*
|
||||
* @param context
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
T mint(Context context, Identifiable dso);
|
||||
}
|
||||
|
302
dspace-api/src/main/java/org/dspace/uri/IdentifierService.java
Normal file
302
dspace-api/src/main/java/org/dspace/uri/IdentifierService.java
Normal file
@@ -0,0 +1,302 @@
|
||||
/*
|
||||
* IdentifierService.java
|
||||
*
|
||||
* Version: $Revision: 1727 $
|
||||
*
|
||||
* Date: $Date: 2007-01-19 10:52:10 +0000 (Fri, 19 Jan 2007) $
|
||||
*
|
||||
* Copyright (c) 2002-2005, Hewlett-Packard Company and Massachusetts
|
||||
* Institute of Technology. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Hewlett-Packard Company nor the name of the
|
||||
* Massachusetts Institute of Technology nor the names of their
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
package org.dspace.uri;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Richard Jones
|
||||
*/
|
||||
public class IdentifierService
|
||||
{
|
||||
/** log4j logger */
|
||||
private static final Logger log = Logger.getLogger(IdentifierService.class);
|
||||
|
||||
/** base of the URL path which internal identifiers will be derived from */
|
||||
private static final String RESOURCE_PATH_SEGMENT = "resource";
|
||||
|
||||
/**
|
||||
* Resolve the passed string to a ResolvableIdentifier object. This uses a number of mechanisms
|
||||
* to attempt to convert the given string into an identifier including:
|
||||
*
|
||||
* - assuming the string is of canonical form
|
||||
* - assuming the string is a url path segment which may contain additional characters
|
||||
*
|
||||
* If it succeeds in resolving to a valid identifier this is returned. If not, it returns null
|
||||
* @param context
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static ResolvableIdentifier resolve(Context context, String str)
|
||||
{
|
||||
ResolvableIdentifier dsi = null;
|
||||
|
||||
if (dsi == null)
|
||||
{
|
||||
dsi = IdentifierService.resolveAsURLSubstring(context, str);
|
||||
}
|
||||
|
||||
if (dsi == null)
|
||||
{
|
||||
dsi = IdentifierService.resolveCanonical(context, str);
|
||||
}
|
||||
|
||||
// NOTE: we could add a few more clever tricks in here when the mood takes us
|
||||
|
||||
return dsi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve to a ResolvableIdentifier the string passed in, assuming that it is a URL
|
||||
* path or fragment which may or may not contain additional characters. Unless it is known
|
||||
* for sure that the path fits this description, it is generally better to use
|
||||
*
|
||||
* <code>IdentifierService.resolve()</code>
|
||||
*
|
||||
* which calls this method among others it uses for resolution
|
||||
*
|
||||
* @param context
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
public static ResolvableIdentifier resolveAsURLSubstring(Context context, String path)
|
||||
{
|
||||
ObjectIdentifier oi = ObjectIdentifier.extractURLIdentifier(path);
|
||||
ExternalIdentifier ei = null;
|
||||
|
||||
if (oi == null)
|
||||
{
|
||||
ei = ExternalIdentifierService.extractURLIdentifier(context, path);
|
||||
}
|
||||
|
||||
if (oi == null && ei == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oi != null)
|
||||
{
|
||||
return oi;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ei;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve to a ResolvableIdentifier the string passed in, assuming that it is a correct
|
||||
* canonical form for one of the external identifier forms supported. Unless it is known
|
||||
* for sure that the canonical form is the one being used it is generally better to use
|
||||
*
|
||||
* <code>IdentifierService.resolve()</code>
|
||||
*
|
||||
* which calls this method among others it uses for resolution
|
||||
*
|
||||
* @param context
|
||||
* @param canonicalForm
|
||||
* @return
|
||||
*/
|
||||
public static ResolvableIdentifier resolveCanonical(Context context, String canonicalForm)
|
||||
{
|
||||
ObjectIdentifier oi = ObjectIdentifier.parseCanonicalForm(canonicalForm);
|
||||
ExternalIdentifier ei = null;
|
||||
|
||||
if (oi == null)
|
||||
{
|
||||
ei = ExternalIdentifierService.parseCanonicalForm(context, canonicalForm);
|
||||
}
|
||||
|
||||
if (oi == null && ei == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oi != null)
|
||||
{
|
||||
return oi;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ei;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the system preferred url for the given ResolvableIdentifier.
|
||||
*
|
||||
* @param dsi
|
||||
* @return
|
||||
*/
|
||||
public static URL getURL(ResolvableIdentifier dsi)
|
||||
{
|
||||
try
|
||||
{
|
||||
String base = ConfigurationManager.getProperty("dspace.url");
|
||||
String urlForm = dsi.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 identifier available");
|
||||
}
|
||||
|
||||
String url = base + "/" + IdentifierService.RESOURCE_PATH_SEGMENT + "/" + urlForm;
|
||||
|
||||
return new URL(url);
|
||||
}
|
||||
catch (MalformedURLException e)
|
||||
{
|
||||
log.error("caught exception: ", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the native formulation of the URL for the given DSpaceObject. This will be of the form
|
||||
*
|
||||
* <code>[dspace.url]/[RESOURCE_PATH_SEGMENT]/uuid/[uuid]</code>
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* <code>http://localhost:8080/resource/uuid/12345678-1234-1234-1234-1234-1234567891011</code>
|
||||
*
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static URL getLocalURL(Identifiable dso)
|
||||
{
|
||||
URL url = null;
|
||||
ObjectIdentifier oid = dso.getIdentifier();
|
||||
if (oid == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
url = IdentifierService.getURL(oid);
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the context path segment of the native URL for the given DSpaceObject. This will be
|
||||
* the path segment after <code>[dspace.url]</code> in <code>getURL()</code>. For example:
|
||||
*
|
||||
* <code>resource/hdl/123456789/100</code>
|
||||
*
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static String getContextPath(Identifiable dso)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierService.getPreferredIdentifier(dso);
|
||||
return IdentifierService.RESOURCE_PATH_SEGMENT + "/" + ri.getURLForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the preferred url form for the given DSpaceObject. The actual URL generated will
|
||||
* depend on which of the identifiers (both external and native) are most desireable,
|
||||
* as well as any other features of the underlying selection mechanism. The form of
|
||||
* the URLs generated cannot be assumed
|
||||
*
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static URL getURL(Identifiable dso)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierService.getPreferredIdentifier(dso);
|
||||
return IdentifierService.getURL(ri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the preferred canonical form of the identifier for the given DSpaceObject. The
|
||||
* actual identifier selected will depend on the configuration of most desireable
|
||||
* identifier and any other features of the underlying selection mechanism
|
||||
*
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static String getCanonicalForm(Identifiable dso)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierService.getPreferredIdentifier(dso);
|
||||
String cf = ri.getCanonicalForm();
|
||||
return cf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the preferred identifier for the given DSpace object. If a preferred
|
||||
* external identifier is not found then the native identifier will be used
|
||||
* by default
|
||||
*
|
||||
* @param dso
|
||||
* @return
|
||||
*/
|
||||
public static ResolvableIdentifier getPreferredIdentifier(Identifiable dso)
|
||||
{
|
||||
String ns = ConfigurationManager.getProperty("identifier.preferred-namespace");
|
||||
if (!"".equals(ns) && ns != null)
|
||||
{
|
||||
ExternalIdentifierType type = ExternalIdentifierService.getType(ns);
|
||||
List<ExternalIdentifier> eids = dso.getExternalIdentifiers();
|
||||
for (ExternalIdentifier eid : eids)
|
||||
{
|
||||
if (eid.getType().equals(type))
|
||||
{
|
||||
return eid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ObjectIdentifier oid = dso.getIdentifier();
|
||||
return oid;
|
||||
}
|
||||
}
|
@@ -48,4 +48,6 @@ public interface ResolvableIdentifier
|
||||
String getURLForm();
|
||||
|
||||
String getIdentifierType();
|
||||
|
||||
String getCanonicalForm();
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.Identifiable;
|
||||
import org.dspace.uri.IdentifierAssigner;
|
||||
import org.dspace.uri.IdentifierResolver;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
@@ -98,7 +99,7 @@ public class Handle extends ExternalIdentifier implements IdentifierAssigner<Han
|
||||
}
|
||||
|
||||
// IdentifierAssigner implementation
|
||||
public Handle mint(Context context, DSpaceObject dso)
|
||||
public Handle mint(Context context, Identifiable dso)
|
||||
{
|
||||
HandleDAO dao = HandleDAOFactory.getInstance(context);
|
||||
int next = dao.getNextHandle();
|
||||
|
@@ -61,8 +61,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.content.dao.WorkspaceItemDAO;
|
||||
import org.dspace.content.dao.WorkspaceItemDAOFactory;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.Email;
|
||||
@@ -647,9 +646,9 @@ public class WorkflowManager
|
||||
}
|
||||
else
|
||||
{
|
||||
uri = IdentifierFactory.getURL(i).toString();
|
||||
uri = IdentifierService.getURL(i).toString();
|
||||
}*/
|
||||
String uri = IdentifierFactory.getURL(i).toString();
|
||||
String uri = IdentifierService.getURL(i).toString();
|
||||
|
||||
// Get title
|
||||
DCValue[] titles = i.getDC("title", null, Item.ANY);
|
||||
|
@@ -55,7 +55,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.storage.bitstore.BitstreamStorageManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.sort.SortOption;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -362,9 +362,9 @@ public class BrowseListTag extends TagSupport
|
||||
// + items[i].getHandle() + "\">"
|
||||
// + Utils.addEntities(metadataArray[0].value)
|
||||
// + "</a>";
|
||||
// IdentifierFactory.getURL(items[i]).toString()
|
||||
// IdentifierService.getURL(items[i]).toString()
|
||||
metadata = "<a href=\""
|
||||
+ IdentifierFactory.getURL(items[i]).toString() + "\">"
|
||||
+ IdentifierService.getURL(items[i]).toString() + "\">"
|
||||
+ Utils.addEntities(metadataArray[0].value)
|
||||
+ "</a>";
|
||||
}
|
||||
@@ -768,13 +768,13 @@ public class BrowseListTag extends TagSupport
|
||||
{
|
||||
Bitstream original = thumbnail.getOriginal();
|
||||
// String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
|
||||
String link = IdentifierFactory.getURL(original).toString();
|
||||
String link = IdentifierService.getURL(original).toString();
|
||||
thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
|
||||
}
|
||||
else
|
||||
{
|
||||
// String link = hrq.getContextPath() + "/handle/" + item.getHandle();
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
String link = IdentifierService.getURL(item).toString();
|
||||
thumbFrag.append("<a href=\"" + link + "\" />");
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
package org.dspace.app.webui.jsptag;
|
||||
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
@@ -93,7 +93,7 @@ public class CollectionListTag extends TagSupport
|
||||
|
||||
HttpServletRequest hrq = (HttpServletRequest) pageContext
|
||||
.getRequest();
|
||||
out.print(IdentifierFactory.getURL(collections[i]).toString());
|
||||
out.print(IdentifierService.getURL(collections[i]).toString());
|
||||
out.print("\">");
|
||||
out.print(name);
|
||||
out.print("</a>");
|
||||
|
@@ -40,7 +40,7 @@
|
||||
package org.dspace.app.webui.jsptag;
|
||||
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
@@ -93,7 +93,7 @@ public class CommunityListTag extends TagSupport
|
||||
|
||||
HttpServletRequest hrq = (HttpServletRequest) pageContext
|
||||
.getRequest();
|
||||
out.print(IdentifierFactory.getURL(communities[i]).toString());
|
||||
out.print(IdentifierService.getURL(communities[i]).toString());
|
||||
out.print("\">");
|
||||
out.print(name);
|
||||
out.print("</a>");
|
||||
|
@@ -70,7 +70,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.storage.bitstore.BitstreamStorageManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* Tag for display a list of items
|
||||
@@ -322,7 +322,7 @@ public class ItemListTag extends TagSupport
|
||||
else if (field.equals(titleField))
|
||||
{
|
||||
metadata = "<a href=\""
|
||||
+ IdentifierFactory.getURL(items[i]).toString() + "\">"
|
||||
+ IdentifierService.getURL(items[i]).toString() + "\">"
|
||||
+ Utils.addEntities(metadataArray[0].value)
|
||||
+ "</a>";
|
||||
}
|
||||
@@ -785,7 +785,7 @@ public class ItemListTag extends TagSupport
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbLink = "<br/><a href=\"" + IdentifierFactory.getURL(item).toString();
|
||||
thumbLink = "<br/><a href=\"" + IdentifierService.getURL(item).toString();
|
||||
}
|
||||
|
||||
thumbLink = thumbLink + "\"><img src=\"" +
|
||||
|
@@ -67,7 +67,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.core.PluginManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* <P>
|
||||
@@ -555,7 +555,7 @@ public class ItemTag extends TagSupport
|
||||
for (int i = 0; i < collections.length; i++)
|
||||
{
|
||||
out.print("<a href=\"");
|
||||
out.print(IdentifierFactory.getURL(collections[i]).toString());
|
||||
out.print(IdentifierService.getURL(collections[i]).toString());
|
||||
out.print("\">");
|
||||
out.print(collections[i].getMetadata("name"));
|
||||
out.print("</a><br/>");
|
||||
@@ -592,7 +592,7 @@ public class ItemTag extends TagSupport
|
||||
else
|
||||
{
|
||||
boolean html = false;
|
||||
String uri = IdentifierFactory.getURL(item).toString();
|
||||
String uri = IdentifierService.getURL(item).toString();
|
||||
|
||||
Bitstream primaryBitstream = null;
|
||||
|
||||
@@ -719,7 +719,7 @@ public class ItemTag extends TagSupport
|
||||
// Work out what the bitstream link should be
|
||||
// (persistent ID if item has URI)
|
||||
String bsLink = "<a href=\""
|
||||
+ IdentifierFactory.getURL(bitstreams[k]).toString()
|
||||
+ IdentifierService.getURL(bitstreams[k]).toString()
|
||||
+ "\">";
|
||||
|
||||
out.print("<tr><td headers=\"t1\" class=\"standard\">");
|
||||
@@ -755,7 +755,7 @@ public class ItemTag extends TagSupport
|
||||
|
||||
if (tb != null)
|
||||
{
|
||||
String myPath = IdentifierFactory.getURL(tb).toString();
|
||||
String myPath = IdentifierService.getURL(tb).toString();
|
||||
out.print(bsLink);
|
||||
out.print("<img src=\"" + myPath + "\" ");
|
||||
out.print("alt=\"" + tAltText
|
||||
@@ -812,7 +812,7 @@ public class ItemTag extends TagSupport
|
||||
{
|
||||
out.print("<div align=\"center\" class=\"standard\">");
|
||||
out.print("<strong><a target=\"_blank\" href=\"");
|
||||
out.print(IdentifierFactory.getURL(bitstreams[k]).toString());
|
||||
out.print(IdentifierService.getURL(bitstreams[k]).toString());
|
||||
out.print("\">" +
|
||||
LocaleSupport.getLocalizedMessage(pageContext,
|
||||
"org.dspace.app.webui.jsptag.ItemTag.viewlicence")
|
||||
|
@@ -58,7 +58,7 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.app.webui.servlet.FeedServlet;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* Tag for HTML page layout ("skin").
|
||||
@@ -222,7 +222,7 @@ public class LayoutTag extends TagSupport
|
||||
for (int i = 0; i < comms.length; i++)
|
||||
{
|
||||
parents.add(comms[i].getMetadata("name"));
|
||||
parentLinks.add(IdentifierFactory.getURL(comms[i]).toString());
|
||||
parentLinks.add(IdentifierService.getURL(comms[i]).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,13 +250,13 @@ public class LayoutTag extends TagSupport
|
||||
for (int i = 0; i < comms.length; i++)
|
||||
{
|
||||
parents.add(comms[i].getMetadata("name"));
|
||||
parentLinks.add(IdentifierFactory.getURL(comms[i]).toString());
|
||||
parentLinks.add(IdentifierService.getURL(comms[i]).toString());
|
||||
}
|
||||
|
||||
if (col != null)
|
||||
{
|
||||
parents.add(col.getMetadata("name"));
|
||||
parentLinks.add(IdentifierFactory.getURL(col).toString());
|
||||
parentLinks.add(IdentifierService.getURL(col).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ import org.dspace.search.DSQuery;
|
||||
import org.dspace.search.QueryArgs;
|
||||
import org.dspace.search.QueryResults;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
|
||||
@@ -280,7 +280,7 @@ public class ControlledVocabularySearchServlet extends DSpaceServlet
|
||||
{
|
||||
String uri = (String) itemIdentifiers.get(i);
|
||||
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, uri);
|
||||
Item item = (Item) di.getObject(context);
|
||||
|
||||
resultsItems[i] = item;
|
||||
@@ -296,7 +296,7 @@ public class ControlledVocabularySearchServlet extends DSpaceServlet
|
||||
{
|
||||
String uri = (String) collectionIdentifiers.get(i);
|
||||
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, uri);
|
||||
Collection c = (Collection) di.getObject(context);
|
||||
|
||||
resultsCollections[i] = collection;
|
||||
@@ -312,7 +312,7 @@ public class ControlledVocabularySearchServlet extends DSpaceServlet
|
||||
{
|
||||
String uri = (String) communityIdentifiers.get(i);
|
||||
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, uri);
|
||||
Community c = (Community) di.getObject(context);
|
||||
|
||||
resultsCommunities[i] = c;
|
||||
|
@@ -17,7 +17,7 @@ import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.app.webui.util.JSPManager;
|
||||
import org.dspace.app.webui.util.Authenticate;
|
||||
import org.dspace.app.webui.util.UIUtil;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.plugin.CommunityHomeProcessor;
|
||||
import org.dspace.plugin.CollectionHomeProcessor;
|
||||
import org.dspace.eperson.SubscriptionManager;
|
||||
@@ -281,7 +281,7 @@ public class DSpaceObjectServlet extends DSpaceServlet
|
||||
throws ServletException, IOException, SQLException
|
||||
{
|
||||
// Handle click on a browse or search button
|
||||
if (!handleButton(request, response, IdentifierFactory.getURL(community)))
|
||||
if (!handleButton(request, response, IdentifierService.getURL(community)))
|
||||
{
|
||||
// No button pressed, display community home page
|
||||
log.info(LogManager.getHeader(context, "view_community",
|
||||
@@ -366,7 +366,7 @@ public class DSpaceObjectServlet extends DSpaceServlet
|
||||
throws ServletException, IOException, SQLException, AuthorizeException
|
||||
{
|
||||
// Handle click on a browse or search button
|
||||
if (!handleButton(request, response, IdentifierFactory.getURL(community)))
|
||||
if (!handleButton(request, response, IdentifierService.getURL(community)))
|
||||
{
|
||||
// Will need to know whether to commit to DB
|
||||
boolean updated = false;
|
||||
@@ -616,7 +616,7 @@ public class DSpaceObjectServlet extends DSpaceServlet
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
{
|
||||
Item item = (Item) items.get(i);
|
||||
urls[i] = IdentifierFactory.getURL(item).toString();
|
||||
urls[i] = IdentifierService.getURL(item).toString();
|
||||
}
|
||||
|
||||
return urls;
|
||||
|
@@ -69,7 +69,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.search.Harvest;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -192,7 +192,7 @@ public class FeedServlet extends DSpaceServlet
|
||||
if(!uri.equals(SITE_FEED_KEY))
|
||||
{
|
||||
// Determine if the URI is a valid reference
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, uri);
|
||||
//ExternalIdentifierDAO dao = ExternalIdentifierDAOFactory.getInstance(context);
|
||||
//ExternalIdentifier identifier = dao.retrieve(uri);
|
||||
//ObjectIdentifier oi = identifier.getObjectIdentifier();
|
||||
@@ -373,13 +373,13 @@ public class FeedServlet extends DSpaceServlet
|
||||
if (dso.getExternalIdentifier() != null)
|
||||
{
|
||||
objectUrl = ConfigurationManager.getBooleanProperty("webui.feed.localresolve")
|
||||
? IdentifierFactory.getURL(dso).toString()
|
||||
? IdentifierService.getURL(dso).toString()
|
||||
: dso.getExternalIdentifier().getURI().toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no external identifier is available, use the local URL
|
||||
objectUrl = IdentifierFactory.getURL(dso).toString();
|
||||
objectUrl = IdentifierService.getURL(dso).toString();
|
||||
}
|
||||
|
||||
// put in container-level data
|
||||
@@ -492,7 +492,7 @@ public class FeedServlet extends DSpaceServlet
|
||||
|
||||
//Set item URI
|
||||
String link = ConfigurationManager.getBooleanProperty("webui.feed.localresolve")
|
||||
? IdentifierFactory.getURL(dspaceItem).toString()
|
||||
? IdentifierService.getURL(dspaceItem).toString()
|
||||
: dspaceItem.getExternalIdentifier().getURI().toString();
|
||||
|
||||
rssItem.setLink(link);
|
||||
|
@@ -52,7 +52,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
|
||||
@@ -218,7 +218,7 @@ public class HTMLServlet extends DSpaceServlet
|
||||
}
|
||||
else
|
||||
{
|
||||
ResolvableIdentifier di = IdentifierFactory.resolveCanonical(context, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolveCanonical(context, uri);
|
||||
//ExternalIdentifier identifier = identifierDAO.retrieve(uri);
|
||||
//ObjectIdentifier oi = identifier.getObjectIdentifier();
|
||||
item = (Item) di.getObject(context);
|
||||
|
@@ -4,7 +4,7 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.app.webui.util.JSPManager;
|
||||
import org.apache.log4j.Logger;
|
||||
@@ -69,7 +69,7 @@ public class HandleLegacyServlet extends DSpaceServlet
|
||||
// now parse the handle in its canonical form to locate the item
|
||||
// NOTE: my god how good is the API? It's great, that's how good it is
|
||||
handle = "hdl:" + handle;
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, handle);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
// if there is no object, display the invalid id error
|
||||
|
@@ -72,7 +72,7 @@ import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.dspace.workflow.dao.WorkflowItemDAO;
|
||||
import org.dspace.workflow.dao.WorkflowItemDAOFactory;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* Servlet for constructing the components of the "My DSpace" page
|
||||
@@ -452,7 +452,7 @@ public class MyDSpaceServlet extends DSpaceServlet
|
||||
|
||||
if (item.isArchived())
|
||||
{
|
||||
String uri = IdentifierFactory.getURL(item).toString();
|
||||
String uri = IdentifierService.getURL(item).toString();
|
||||
|
||||
request.setAttribute("identifier", uri);
|
||||
JSPManager.showJSP(request, response,
|
||||
|
@@ -55,7 +55,7 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.uri.ExternalIdentifier;
|
||||
import org.dspace.uri.ExternalIdentifierService;
|
||||
import org.dspace.uri.ObjectIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class SuggestServlet extends DSpaceServlet
|
||||
if (identifier != null)
|
||||
{
|
||||
item = (Item) oi.getObject(context);
|
||||
link = IdentifierFactory.getURL(item).toString();
|
||||
link = IdentifierService.getURL(item).toString();
|
||||
request.setAttribute("link", link);
|
||||
|
||||
if (item != null)
|
||||
|
@@ -40,40 +40,19 @@
|
||||
package org.dspace.app.webui.servlet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.webui.util.Authenticate;
|
||||
import org.dspace.app.webui.util.JSPManager;
|
||||
import org.dspace.app.webui.util.UIUtil;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.core.PluginManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.SubscriptionManager;
|
||||
import org.dspace.plugin.CollectionHomeProcessor;
|
||||
import org.dspace.plugin.CommunityHomeProcessor;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author James Rutherford
|
||||
@@ -103,7 +82,7 @@ public class URIServlet extends DSpaceServlet
|
||||
String path = request.getPathInfo();
|
||||
|
||||
// get the identifier if there is one
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(context, path);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(context, path);
|
||||
|
||||
// get the object if there is one
|
||||
if (di != null)
|
||||
|
@@ -67,7 +67,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
|
||||
@@ -192,7 +192,7 @@ public class AuthorizeAdminServlet extends DSpaceServlet
|
||||
else if ((uri != null) && !uri.equals(""))
|
||||
{
|
||||
// otherwise, attempt to resolve uri
|
||||
ResolvableIdentifier di = IdentifierFactory.resolve(c, uri);
|
||||
ResolvableIdentifier di = IdentifierService.resolve(c, uri);
|
||||
DSpaceObject dso = di.getObject(c);
|
||||
|
||||
// make sure it's an item
|
||||
|
@@ -71,7 +71,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
|
||||
/**
|
||||
* Servlet for editing communities and collections, including deletion,
|
||||
@@ -259,7 +259,7 @@ public class EditCommunitiesServlet extends DSpaceServlet
|
||||
else
|
||||
// redirect to parent community page
|
||||
{
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierFactory.getURL(parents.get(0)).toString()));
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierService.getURL(parents.get(0)).toString()));
|
||||
}
|
||||
|
||||
// Show main control page
|
||||
@@ -320,7 +320,7 @@ public class EditCommunitiesServlet extends DSpaceServlet
|
||||
|
||||
if (community != null)
|
||||
{
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierFactory.getURL(community).toString()));
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierService.getURL(community).toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -329,7 +329,7 @@ public class EditCommunitiesServlet extends DSpaceServlet
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierFactory.getURL(parent).toString()));
|
||||
response.sendRedirect(response.encodeRedirectURL(IdentifierService.getURL(parent).toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.content.DCDate" %>
|
||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
<%@ page import="java.util.Set" %>
|
||||
|
||||
@@ -116,12 +116,12 @@
|
||||
if (collection != null)
|
||||
{
|
||||
// linkBase = linkBase + "handle/" + collection.getHandle() + "/";
|
||||
linkBase = IdentifierFactory.getURL(collection).toString() + "/";
|
||||
linkBase = IdentifierService.getURL(collection).toString() + "/";
|
||||
}
|
||||
if (community != null)
|
||||
{
|
||||
// linkBase = linkBase + "handle/" + community.getHandle() + "/";
|
||||
linkBase = IdentifierFactory.getURL(community).toString() + "/";
|
||||
linkBase = IdentifierService.getURL(community).toString() + "/";
|
||||
}
|
||||
|
||||
String direction = (bi.isAscending() ? "ASC" : "DESC");
|
||||
@@ -176,12 +176,12 @@
|
||||
if (collection != null)
|
||||
{
|
||||
// formaction = formaction + "handle/" + collection.getHandle() + "/";
|
||||
formaction = IdentifierFactory.getURL(collection).toString() + "/";
|
||||
formaction = IdentifierService.getURL(collection).toString() + "/";
|
||||
}
|
||||
if (community != null)
|
||||
{
|
||||
// formaction = formaction + "handle/" + community.getHandle() + "/";
|
||||
formaction = IdentifierFactory.getURL(community).toString() + "/";
|
||||
formaction = IdentifierService.getURL(community).toString() + "/";
|
||||
}
|
||||
formaction = formaction + urlFragment;
|
||||
|
||||
|
@@ -56,7 +56,7 @@
|
||||
<%@ page import="org.dspace.content.Collection" %>
|
||||
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
|
||||
<%
|
||||
@@ -93,12 +93,12 @@
|
||||
if (collection != null)
|
||||
{
|
||||
linkText = collection.getMetadata("name");
|
||||
linkBack = IdentifierFactory.getURL(collection).toString();
|
||||
linkBack = IdentifierService.getURL(collection).toString();
|
||||
}
|
||||
else if (community != null)
|
||||
{
|
||||
linkText = community.getMetadata("name");
|
||||
linkBack = IdentifierFactory.getURL(community).toString();
|
||||
linkBack = IdentifierService.getURL(community).toString();
|
||||
}
|
||||
%>
|
||||
|
||||
|
@@ -55,7 +55,7 @@
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.content.DCDate" %>
|
||||
<%@ page import="org.dspace.core.Utils" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
|
||||
<%
|
||||
@@ -102,12 +102,12 @@
|
||||
if (collection != null)
|
||||
{
|
||||
// linkBase = linkBase + "handle/" + collection.getHandle() + "/";
|
||||
linkBase = IdentifierFactory.getURL(collection).toString() + "/";
|
||||
linkBase = IdentifierService.getURL(collection).toString() + "/";
|
||||
}
|
||||
if (community != null)
|
||||
{
|
||||
// linkBase = linkBase + "handle/" + community.getHandle() + "/";
|
||||
linkBase = IdentifierFactory.getURL(community).toString() + "/";
|
||||
linkBase = IdentifierService.getURL(community).toString() + "/";
|
||||
}
|
||||
|
||||
String direction = (bi.isAscending() ? "ASC" : "DESC");
|
||||
@@ -142,12 +142,12 @@
|
||||
if (collection != null)
|
||||
{
|
||||
// formaction = formaction + "handle/" + collection.getHandle() + "/";
|
||||
formaction = IdentifierFactory.getURL(collection).toString() + "/";
|
||||
formaction = IdentifierService.getURL(collection).toString() + "/";
|
||||
}
|
||||
if (community != null)
|
||||
{
|
||||
// formaction = formaction + "handle/" + community.getHandle() + "/";
|
||||
formaction = IdentifierFactory.getURL(community).toString() + "/";
|
||||
formaction = IdentifierService.getURL(community).toString() + "/";
|
||||
}
|
||||
formaction = formaction + "browse";
|
||||
|
||||
|
@@ -74,7 +74,7 @@
|
||||
<%@ page import="org.dspace.uri.ObjectIdentifier" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
|
||||
|
||||
<%
|
||||
@@ -124,7 +124,7 @@
|
||||
}
|
||||
|
||||
String communityName = community.getMetadata("name");
|
||||
String communityLink = IdentifierFactory.getURL(community).toString();
|
||||
String communityLink = IdentifierService.getURL(community).toString();
|
||||
|
||||
Bitstream logo = collection.getLogo();
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
String key = "browse.menu." + bis[i].getName();
|
||||
%>
|
||||
<div class="browse_buttons">
|
||||
<form method="get" action="<%= IdentifierFactory.getURL(collection).toString() %>/browse">
|
||||
<form method="get" action="<%= IdentifierService.getURL(collection).toString() %>/browse">
|
||||
<input type="hidden" name="type" value="<%= bis[i].getName() %>"/>
|
||||
<%-- <input type="hidden" name="collection" value="<%= collection.getHandle() %>" /> --%>
|
||||
<input type="submit" name="submit_browse" value="<fmt:message key="<%= key %>"/>"/>
|
||||
@@ -336,7 +336,7 @@
|
||||
displayTitle = dcv[0].value;
|
||||
}
|
||||
}
|
||||
%><p class="recentItem"><a href="<%= IdentifierFactory.getURL(items[i]).toString() %>"><%= displayTitle %></a></p><%
|
||||
%><p class="recentItem"><a href="<%= IdentifierService.getURL(items[i]).toString() %>"><%= displayTitle %></a></p><%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
@@ -71,7 +71,7 @@
|
||||
<%@ page import="org.dspace.uri.ObjectIdentifier" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
|
||||
|
||||
<%
|
||||
@@ -192,7 +192,7 @@
|
||||
String key = "browse.menu." + bis[i].getName();
|
||||
%>
|
||||
<div class="browse_buttons">
|
||||
<form method="get" action="<%= IdentifierFactory.getURL(community).toString() %>/browse">
|
||||
<form method="get" action="<%= IdentifierService.getURL(community).toString() %>/browse">
|
||||
<input type="hidden" name="type" value="<%= bis[i].getName() %>"/>
|
||||
<%-- <input type="hidden" name="community" value="<%= community.getHandle() %>" /> --%>
|
||||
<input type="submit" name="submit_browse" value="<fmt:message key="<%= key %>"/>"/>
|
||||
@@ -223,7 +223,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<%= IdentifierFactory.getURL(collections[i]).toString() %>">
|
||||
<a href="<%= IdentifierService.getURL(collections[i]).toString() %>">
|
||||
<%= collections[i].getMetadata("name") %></a>
|
||||
<%
|
||||
if(ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
@@ -273,7 +273,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<%= IdentifierFactory.getURL(subcommunities[j]).toString() %>">
|
||||
<a href="<%= IdentifierService.getURL(subcommunities[j]).toString() %>">
|
||||
<%= subcommunities[j].getMetadata("name") %></a>
|
||||
<%
|
||||
if (ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
@@ -378,7 +378,7 @@
|
||||
displayTitle = dcv[0].value;
|
||||
}
|
||||
}
|
||||
%><p class="recentItem"><a href="<%= IdentifierFactory.getURL(items[i]).toString() %>"><%= displayTitle %></a></p><%
|
||||
%><p class="recentItem"><a href="<%= IdentifierService.getURL(items[i]).toString() %>"><%= displayTitle %></a></p><%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
@@ -62,7 +62,7 @@
|
||||
<%@ page import="org.dspace.content.Collection" %>
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
<%@ page import="java.io.IOException" %>
|
||||
<%@ page import="java.sql.SQLException" %>
|
||||
@@ -94,7 +94,7 @@
|
||||
{
|
||||
ItemCounter ic = new ItemCounter(UIUtil.obtainContext(request));
|
||||
out.println( "<li class=\"communityLink\">" );
|
||||
out.println( "<strong><a href=\"" + IdentifierFactory.getURL(c).toString() + "\">" + c.getMetadata("name") + "</a></strong>");
|
||||
out.println( "<strong><a href=\"" + IdentifierService.getURL(c).toString() + "\">" + c.getMetadata("name") + "</a></strong>");
|
||||
if(ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
{
|
||||
out.println(" <span class=\"communityStrength\">[" + ic.getCount(c) + "]</span>");
|
||||
@@ -108,7 +108,7 @@
|
||||
for (int j = 0; j < cols.length; j++)
|
||||
{
|
||||
out.println("<li class=\"collectionListItem\">");
|
||||
out.println("<a href=\"" + IdentifierFactory.getURL(cols[j]).toString() + "\">" + cols[j].getMetadata("name") +"</a>");
|
||||
out.println("<a href=\"" + IdentifierService.getURL(cols[j]).toString() + "\">" + cols[j].getMetadata("name") +"</a>");
|
||||
if(ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
{
|
||||
out.println(" [" + ic.getCount(cols[j]) + "]");
|
||||
@@ -210,7 +210,7 @@
|
||||
%>
|
||||
<li class="communityLink">
|
||||
<%-- HACK: <strong> tags here for broken Netscape 4.x CSS support --%>
|
||||
<strong><a href="<%= IdentifierFactory.getURL(communities[i]).toString() %>"><%= communities[i].getMetadata("name") %></a></strong>
|
||||
<strong><a href="<%= IdentifierService.getURL(communities[i]).toString() %>"><%= communities[i].getMetadata("name") %></a></strong>
|
||||
<ul>
|
||||
<%
|
||||
// Get the collections in this community from the map
|
||||
@@ -221,7 +221,7 @@
|
||||
{
|
||||
%>
|
||||
<li class="collectionListItem">
|
||||
<a href="<%= IdentifierFactory.getURL(cols[j]).toString() %>"><%= cols[j].getMetadata("name") %></a>
|
||||
<a href="<%= IdentifierService.getURL(cols[j]).toString() %>"><%= cols[j].getMetadata("name") %></a>
|
||||
<%
|
||||
if (ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
{
|
||||
@@ -246,7 +246,7 @@
|
||||
{
|
||||
%>
|
||||
<li class="communityLink">
|
||||
<a href="<%= IdentifierFactory.getURL(comms[k]).toString() %>"><%= comms[k].getMetadata("name") %></a>
|
||||
<a href="<%= IdentifierService.getURL(comms[k]).toString() %>"><%= comms[k].getMetadata("name") %></a>
|
||||
<%
|
||||
if (ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
{
|
||||
|
@@ -71,7 +71,7 @@
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.content.Item" %>
|
||||
<%@ page import="org.dspace.search.QueryResults" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
|
||||
<%
|
||||
@@ -158,11 +158,11 @@ if (collections.length > 0)
|
||||
}
|
||||
else if (collection == null)
|
||||
{
|
||||
searchScope = IdentifierFactory.getURL(community).toString();
|
||||
searchScope = IdentifierService.getURL(community).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
searchScope = IdentifierFactory.getURL(collection).toString();
|
||||
searchScope = IdentifierService.getURL(collection).toString();
|
||||
}
|
||||
|
||||
// create the URLs accessing the previous and next search result pages
|
||||
|
@@ -67,7 +67,7 @@
|
||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||
<%@ page import="org.dspace.license.CreativeCommons" %>
|
||||
<%@ page import="org.dspace.uri.ExternalIdentifier" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="org.dspace.uri.ObjectIdentifier" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
|
||||
@@ -91,14 +91,14 @@
|
||||
ObjectIdentifier oid = item.getIdentifier();
|
||||
String uri = "";
|
||||
String citationLink = "";
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
String link = IdentifierService.getURL(item).toString();
|
||||
|
||||
// CC URL & RDF
|
||||
String cc_url = CreativeCommons.getLicenseURL(item);
|
||||
String cc_rdf = CreativeCommons.getLicenseRDF(item);
|
||||
|
||||
// Full title needs to be put into a string to use as tag argument
|
||||
String cf = IdentifierFactory.getCanonicalForm(item);
|
||||
String cf = IdentifierService.getCanonicalForm(item);
|
||||
String title = "FIXME";
|
||||
DCValue[] titleValue = item.getMetadata("dc", "title", null, Item.ANY);
|
||||
if (titleValue.length != 0)
|
||||
|
@@ -56,7 +56,7 @@
|
||||
<%@ page import="org.dspace.content.Community"%>
|
||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||
<%@ page import="org.dspace.core.I18nUtil" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.core.Config" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
<%@ page import="java.util.Locale" %>
|
||||
@@ -141,7 +141,7 @@ for (int i = supportedLocales.length-1; i >= 0; i--)
|
||||
{
|
||||
%> <tr>
|
||||
<td class="standard">
|
||||
<a href="<%= IdentifierFactory.getURL(communities[i]).toString() %>"><%= communities[i].getMetadata("name") %></a>
|
||||
<a href="<%= IdentifierService.getURL(communities[i]).toString() %>"><%= communities[i].getMetadata("name") %></a>
|
||||
<%
|
||||
if (ConfigurationManager.getBooleanProperty("webui.strengths.show"))
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@
|
||||
|
||||
<%@ page import="org.dspace.content.Collection" %>
|
||||
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
|
||||
<%
|
||||
@@ -113,7 +113,7 @@
|
||||
--%>
|
||||
|
||||
<td class="<%= row %>RowOddCol">
|
||||
<a href="<%= IdentifierFactory.getURL(subscriptions[i]).toString() %>"><%= subscriptions[i].getMetadata("name") %></a>
|
||||
<a href="<%= IdentifierService.getURL(subscriptions[i]).toString() %>"><%= subscriptions[i].getMetadata("name") %></a>
|
||||
</td>
|
||||
<td class="<%= row %>RowEvenCol">
|
||||
<form method="post" action="">
|
||||
|
@@ -71,7 +71,7 @@
|
||||
<%@ page import="org.dspace.content.Community" %>
|
||||
<%@ page import="org.dspace.content.Item" %>
|
||||
<%@ page import="org.dspace.search.QueryResults" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="java.net.URLEncoder" %>
|
||||
<%@ page import="org.dspace.sort.SortOption" %>
|
||||
<%@ page import="java.util.Enumeration" %>
|
||||
@@ -113,11 +113,11 @@
|
||||
}
|
||||
else if (collection == null)
|
||||
{
|
||||
searchScope = IdentifierFactory.getURL(community).toString();
|
||||
searchScope = IdentifierService.getURL(community).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
searchScope = IdentifierFactory.getURL(collection).toString();
|
||||
searchScope = IdentifierService.getURL(collection).toString();
|
||||
}
|
||||
%>
|
||||
|
||||
|
@@ -68,7 +68,7 @@
|
||||
<%@ page import="org.dspace.content.MetadataField" %>
|
||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||
<%@ page import="org.dspace.eperson.EPerson" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierFactory" %>
|
||||
<%@ page import="org.dspace.uri.IdentifierService" %>
|
||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||
<%@ page import="java.util.HashMap" %>
|
||||
<%@ page import="java.util.Map" %>
|
||||
@@ -76,7 +76,7 @@
|
||||
<%
|
||||
Item item = (Item) request.getAttribute("item");
|
||||
String uri = item.getIdentifier().getCanonicalForm();
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
String link = IdentifierService.getURL(item).toString();
|
||||
Collection[] collections = (Collection[]) request.getAttribute("collections");
|
||||
MetadataField[] dcTypes = (MetadataField[]) request.getAttribute("dc.types");
|
||||
HashMap metadataFields = (HashMap) request.getAttribute("metadataFields");
|
||||
|
@@ -67,7 +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.dspace.uri.IdentifierService;
|
||||
import org.jdom.Element;
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ class DAVCollection extends DAVDSpaceObject
|
||||
Item ni = wfi.getItem();
|
||||
|
||||
// FIXME: I'm not sure this is what we want
|
||||
String handle = IdentifierFactory.getCanonicalForm(ni);
|
||||
String handle = IdentifierService.getCanonicalForm(ni);
|
||||
// String handle = HandleManager.findHandle(this.context, ni);
|
||||
|
||||
String end = (handle != null) ? DAVDSpaceObject
|
||||
|
@@ -49,7 +49,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.jdom.Element;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -173,7 +173,7 @@ abstract class DAVDSpaceObject extends DAVResource
|
||||
// FIXME: in reality, these aren't handles any more, they are UUIDs from the ObjectIdentifiers, but
|
||||
// it's too big a job at the moment to modify all the semantics, so I have just done so where necessary
|
||||
// DSpaceObject dso = HandleManager.resolveToObject(context, handle);
|
||||
ResolvableIdentifier dsi = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier dsi = IdentifierService.resolve(context, handle);
|
||||
DSpaceObject dso = dsi.getObject(context);
|
||||
|
||||
if (dso == null)
|
||||
|
@@ -46,7 +46,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.jdom.Element;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
@@ -210,7 +210,7 @@ class DAVLookup extends DAVResource
|
||||
}
|
||||
|
||||
// did handle lookup fail?
|
||||
ResolvableIdentifier dsi = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier dsi = IdentifierService.resolve(context, handle);
|
||||
dso = dsi.getObject(context);
|
||||
|
||||
if (dso == null)
|
||||
@@ -257,7 +257,7 @@ class DAVLookup extends DAVResource
|
||||
protected String makeURI(String handle, String bsPid) throws IOException,
|
||||
SQLException
|
||||
{
|
||||
ResolvableIdentifier dsi = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier dsi = IdentifierService.resolve(context, handle);
|
||||
DSpaceObject dso = dsi.getObject(context);
|
||||
|
||||
if (dso == null)
|
||||
|
@@ -54,7 +54,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
|
||||
import java.sql.SQLException;
|
||||
@@ -91,7 +91,7 @@ public class FlowAuthorizationUtils {
|
||||
result.setContinue(false);
|
||||
//Check whether it's a handle or internal id (by check ing if it has a slash in the string)
|
||||
if (identifier.contains("/")) {
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, identifier);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, identifier);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
if (dso != null && dso.getType() == Constants.ITEM) {
|
||||
|
@@ -59,7 +59,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.MetadataField;
|
||||
import org.dspace.content.MetadataSchema;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.core.Constants;
|
||||
@@ -113,7 +113,7 @@ public class FlowItemUtils
|
||||
/*
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(identifier);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, identifier);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, identifier);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
if (dso != null && dso.getType() == Constants.ITEM)
|
||||
|
@@ -79,7 +79,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -173,7 +173,7 @@ public class WithdrawnItems extends AbstractDSpaceTransformer implements
|
||||
{
|
||||
DSpaceObject dso = URIUtil.resolve(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
key += "-" + IdentifierService.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -126,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"), IdentifierFactory.getCanonicalForm(col),col.getID()));
|
||||
main.setHead(T_main_head_collection.parameterize(col.getMetadata("name"), IdentifierService.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"),IdentifierFactory.getCanonicalForm(com),com.getID()));
|
||||
main.setHead(T_main_head_community.parameterize(com.getMetadata("name"), IdentifierService.getCanonicalForm(com),com.getID()));
|
||||
policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, com);
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -147,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(IdentifierFactory.getCanonicalForm(item),item.getID()));
|
||||
main.setHead(T_main_head.parameterize(IdentifierService.getCanonicalForm(item),item.getID()));
|
||||
main.addPara().addHighlight("italic").addContent(T_main_para1);
|
||||
main.addPara().addHighlight("italic").addContent(T_main_para2);
|
||||
|
||||
|
@@ -54,7 +54,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
@@ -107,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(IdentifierFactory.getCanonicalForm(thisCommunity)));
|
||||
main.setHead(T_main_head.parameterize(IdentifierService.getCanonicalForm(thisCommunity)));
|
||||
|
||||
if (AuthorizeManager.isAdmin(context))
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -289,7 +289,7 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
||||
{
|
||||
Para para = main.addPara();
|
||||
para.addContent(T_collection_para);
|
||||
para.addXref(IdentifierFactory.getURL(collection).toString(), collection.getMetadata("name"));
|
||||
para.addXref(IdentifierService.getURL(collection).toString(), collection.getMetadata("name"));
|
||||
}
|
||||
|
||||
// DIVISION: group-actions
|
||||
@@ -498,7 +498,7 @@ public class EditGroupForm extends AbstractDSpaceTransformer
|
||||
|
||||
Highlight highlight = cell.addHighlight("fade");
|
||||
highlight.addContent("[");
|
||||
highlight.addXref(IdentifierFactory.getURL(collection).toString(), T_groups_collection_link);
|
||||
highlight.addXref(IdentifierService.getURL(collection).toString(), T_groups_collection_link);
|
||||
highlight.addContent("]");
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
@@ -266,7 +266,7 @@ public class ManageGroupsMain extends AbstractDSpaceTransformer
|
||||
Highlight highlight = cell.addHighlight("fade");
|
||||
|
||||
highlight.addContent("[");
|
||||
highlight.addXref(IdentifierFactory.getURL(collection).toString(), T_collection_link);
|
||||
highlight.addXref(IdentifierService.getURL(collection).toString(), T_collection_link);
|
||||
highlight.addContent("]");
|
||||
}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Arrays;
|
||||
@@ -115,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(IdentifierFactory.getCanonicalForm(item)));
|
||||
main.setHead(T_head1.parameterize(IdentifierService.getCanonicalForm(item)));
|
||||
|
||||
// PARA: descriptive instructions
|
||||
if("delete".equals(confirm))
|
||||
|
@@ -50,8 +50,7 @@ import org.dspace.app.xmlui.wing.element.PageMeta;
|
||||
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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
@@ -147,7 +146,7 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
|
||||
|
||||
itemInfo.addLabel(T_label_handle);
|
||||
// itemInfo.addItem(item.getHandle()==null?"None":item.getHandle());
|
||||
itemInfo.addItem(IdentifierFactory.getCanonicalForm(item));
|
||||
itemInfo.addItem(IdentifierService.getCanonicalForm(item));
|
||||
|
||||
itemInfo.addLabel(T_label_modified);
|
||||
itemInfo.addItem(item.getLastModified().toString());
|
||||
@@ -171,7 +170,7 @@ public class EditItemStatusForm extends AbstractDSpaceTransformer {
|
||||
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();
|
||||
String url = IdentifierService.getURL(item).toString();
|
||||
itemInfo.addItem().addXref(url, url);
|
||||
|
||||
itemInfo.addLabel(T_label_auth);
|
||||
|
@@ -59,7 +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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -148,7 +148,7 @@ public class BrowseItemForm extends AbstractDSpaceTransformer {
|
||||
if (dcTitles != null && dcTitles.length >= 1)
|
||||
title = dcTitles[0].value;
|
||||
|
||||
String url = IdentifierFactory.getURL(item).toString();
|
||||
String url = IdentifierService.getURL(item).toString();
|
||||
|
||||
Row row = table.addRow();
|
||||
|
||||
|
@@ -58,7 +58,7 @@ import org.dspace.content.DCValue;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
import org.dspace.search.DSQuery;
|
||||
@@ -141,7 +141,7 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
||||
if (dcTitles != null && dcTitles.length >= 1)
|
||||
title = dcTitles[0].value;
|
||||
|
||||
String url = IdentifierFactory.getURL(item).toString();
|
||||
String url = IdentifierService.getURL(item).toString();
|
||||
|
||||
Row row = table.addRow();
|
||||
|
||||
@@ -196,7 +196,7 @@ public class SearchItemForm extends AbstractDSpaceTransformer {
|
||||
ExternalIdentifier identifier = identifierDAO.retrieve(uri);
|
||||
DSpaceObject resultDSO =
|
||||
identifier.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
|
||||
if (resultDSO instanceof Item)
|
||||
|
@@ -46,7 +46,6 @@ import org.apache.excalibur.source.SourceValidity;
|
||||
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
|
||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||
import org.dspace.app.xmlui.utils.DSpaceValidity;
|
||||
import org.dspace.app.xmlui.utils.HandleUtil;
|
||||
import org.dspace.app.xmlui.utils.UIException;
|
||||
import org.dspace.app.xmlui.utils.URIUtil;
|
||||
import org.dspace.app.xmlui.wing.Message;
|
||||
@@ -70,7 +69,7 @@ import org.dspace.search.QueryArgs;
|
||||
import org.dspace.search.QueryResults;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAO;
|
||||
import org.dspace.uri.dao.ExternalIdentifierDAOFactory;
|
||||
@@ -156,7 +155,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// What scope the search is at
|
||||
DSpaceObject scope = getScope();
|
||||
if (scope != null)
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(scope);
|
||||
key += "-" + IdentifierService.getCanonicalForm(scope);
|
||||
|
||||
// The actualy search query.
|
||||
key += "-" + getQuery();
|
||||
@@ -199,7 +198,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// for (String handle : handles)
|
||||
for (String uri : uris)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
validity.add(resultDSO);
|
||||
}
|
||||
@@ -296,7 +295,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// for (String handle : containerHandles)
|
||||
for (String uri : containerURIs)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
|
||||
if (resultDSO instanceof Community
|
||||
@@ -323,7 +322,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// for (String handle : itemHandles)
|
||||
for (String uri : itemURIs)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject resultDSO = ri.getObject(context);
|
||||
if (resultDSO instanceof Item)
|
||||
{
|
||||
@@ -375,7 +374,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
scope.setOptionSelected("/");
|
||||
for (Community community : Community.findAll(context))
|
||||
{
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
scope.addOption(IdentifierService.getCanonicalForm(community),community.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
else if (scopeDSO instanceof Community)
|
||||
@@ -384,12 +383,12 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
// within
|
||||
Community community = (Community) scopeDSO;
|
||||
scope.addOption("/",T_all_of_dspace);
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierFactory.getCanonicalForm(community));
|
||||
scope.addOption(IdentifierService.getCanonicalForm(community),community.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierService.getCanonicalForm(community));
|
||||
|
||||
for (Collection collection : community.getCollections())
|
||||
{
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
scope.addOption(IdentifierService.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
else if (scopeDSO instanceof Collection)
|
||||
@@ -397,14 +396,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(IdentifierFactory.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierFactory.getCanonicalForm(collection));
|
||||
scope.addOption(IdentifierService.getCanonicalForm(collection),collection.getMetadata("name"));
|
||||
scope.setOptionSelected(IdentifierService.getCanonicalForm(collection));
|
||||
|
||||
Community[] communities = collection.getCommunities()[0]
|
||||
.getAllParents();
|
||||
for (Community community : communities)
|
||||
{
|
||||
scope.addOption(IdentifierFactory.getCanonicalForm(community),community.getMetadata("name"));
|
||||
scope.addOption(IdentifierService.getCanonicalForm(community),community.getMetadata("name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -490,7 +489,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer
|
||||
else
|
||||
{
|
||||
// Get the search scope from the location parameter
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, scopeString);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, scopeString);
|
||||
dso = ri.getObject(context);
|
||||
}*/
|
||||
DSpaceObject dso = URIUtil.resolve(objectModel);
|
||||
|
@@ -68,7 +68,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -132,7 +132,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
if (dso == null)
|
||||
return "0";
|
||||
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
return HashUtil.hash(IdentifierService.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
String feedFormat = parts[0].trim()+"+xml";
|
||||
|
||||
String feedURL = IdentifierFactory.getURL(collection).toString() + "/"+format.trim();
|
||||
String feedURL = IdentifierService.getURL(collection).toString() + "/"+format.trim();
|
||||
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
|
||||
// Search query
|
||||
Division query = search.addInteractiveDivision("collection-search",
|
||||
IdentifierFactory.getURL(collection).toString() + "/search",
|
||||
IdentifierService.getURL(collection).toString() + "/search",
|
||||
Division.METHOD_POST, "secondary search");
|
||||
|
||||
Para para = query.addPara("search-query", null);
|
||||
@@ -265,7 +265,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 = IdentifierFactory.getURL(collection).toString();
|
||||
String url = IdentifierService.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);
|
||||
|
@@ -62,7 +62,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -297,7 +297,7 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
|
||||
else if (dso instanceof Collection)
|
||||
name = ((Collection) dso).getMetadata("name");
|
||||
|
||||
String url = IdentifierFactory.getURL(dso).toString();
|
||||
String url = IdentifierService.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 = IdentifierFactory.getURL(collectionNode.getDSO()).toString();
|
||||
String collectionUrl = IdentifierService.getURL(collectionNode.getDSO()).toString();
|
||||
subList.addItemXref(collectionUrl, collectionName);
|
||||
}
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -139,7 +139,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
if (dso == null)
|
||||
return "0"; // no item, something is wrong
|
||||
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
return HashUtil.hash(IdentifierService.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
|
||||
String feedFormat = parts[0].trim()+"+xml";
|
||||
|
||||
String feedURL = IdentifierFactory.getURL(community).toString() +"/"+format.trim();
|
||||
String feedURL = IdentifierService.getURL(community).toString() +"/"+format.trim();
|
||||
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
|
||||
|
||||
// Search query
|
||||
Division query = search.addInteractiveDivision("community-search",
|
||||
IdentifierFactory.getURL(community).toString() + "/search",
|
||||
IdentifierService.getURL(community).toString() + "/search",
|
||||
Division.METHOD_POST, "secondary search");
|
||||
|
||||
Para para = query.addPara("search-query", null);
|
||||
@@ -285,7 +285,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 = IdentifierFactory.getURL(community).toString();
|
||||
String url = IdentifierService.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);
|
||||
|
@@ -79,7 +79,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -173,7 +173,7 @@ public class ConfigurableBrowse extends AbstractDSpaceTransformer implements
|
||||
{
|
||||
DSpaceObject dso = URIUtil.resolve(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
key += "-" + IdentifierService.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -106,7 +106,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (dso == null)
|
||||
return "0"; // no item, something is wrong.
|
||||
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso) + "full:" + showFullItem(objectModel));
|
||||
return HashUtil.hash(IdentifierService.getCanonicalForm(dso) + "full:" + showFullItem(objectModel));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (title != null)
|
||||
pageMeta.addMetadata("title").addContent(title);
|
||||
else
|
||||
pageMeta.addMetadata("title").addContent(IdentifierFactory.getCanonicalForm(item));
|
||||
pageMeta.addMetadata("title").addContent(IdentifierService.getCanonicalForm(item));
|
||||
|
||||
pageMeta.addTrailLink(contextPath + "/",T_dspace_home);
|
||||
HandleUtil.buildHandleTrail(item,pageMeta,contextPath);
|
||||
@@ -185,18 +185,18 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
if (title != null)
|
||||
division.setHead(title);
|
||||
else
|
||||
division.setHead(IdentifierFactory.getCanonicalForm(item));
|
||||
division.setHead(IdentifierService.getCanonicalForm(item));
|
||||
|
||||
Para showfullPara = division.addPara(null, "item-view-toggle item-view-toggle-top");
|
||||
|
||||
if (showFullItem(objectModel))
|
||||
{
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
String link = IdentifierService.getURL(item).toString();
|
||||
showfullPara.addXref(link).addContent(T_show_simple);
|
||||
}
|
||||
else
|
||||
{
|
||||
String link = IdentifierFactory.getURL(item).toString() + "?show=full";
|
||||
String link = IdentifierService.getURL(item).toString() + "?show=full";
|
||||
showfullPara.addXref(link).addContent(T_show_full);
|
||||
}
|
||||
|
||||
@@ -226,12 +226,12 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
if (showFullItem(objectModel))
|
||||
{
|
||||
String link = IdentifierFactory.getURL(item).toString();
|
||||
String link = IdentifierService.getURL(item).toString();
|
||||
showfullPara.addXref(link).addContent(T_show_simple);
|
||||
}
|
||||
else
|
||||
{
|
||||
String link = IdentifierFactory.getURL(item).toString() + "?show=full";
|
||||
String link = IdentifierService.getURL(item).toString() + "?show=full";
|
||||
showfullPara.addXref(link).addContent(T_show_full);
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -116,7 +116,7 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
|
||||
DSpaceObject dso = URIUtil.resolve(objectModel);
|
||||
if (dso != null)
|
||||
key += "-" + IdentifierFactory.getCanonicalForm(dso);
|
||||
key += "-" + IdentifierService.getCanonicalForm(dso);
|
||||
|
||||
return HashUtil.hash(key);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
}
|
||||
|
||||
// Add the configured browse lists for scoped browsing
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
String handle = IdentifierService.getCanonicalForm(dso);
|
||||
addBrowseOptions(browseContext, contextPath + "/handle/" + handle + "/browse");
|
||||
}
|
||||
}
|
||||
@@ -230,14 +230,14 @@ public class Navigation extends AbstractDSpaceTransformer implements CacheablePr
|
||||
{
|
||||
if (dso instanceof Item)
|
||||
{
|
||||
pageMeta.addMetadata("focus","object").addContent(IdentifierFactory.getCanonicalForm(dso));
|
||||
pageMeta.addMetadata("focus","object").addContent(IdentifierService.getCanonicalForm(dso));
|
||||
this.getObjectManager().manageObject(dso);
|
||||
dso = ((Item) dso).getOwningCollection();
|
||||
}
|
||||
|
||||
if (dso instanceof Collection || dso instanceof Community)
|
||||
{
|
||||
pageMeta.addMetadata("focus","container").addContent(IdentifierFactory.getCanonicalForm(dso));
|
||||
pageMeta.addMetadata("focus","container").addContent(IdentifierService.getCanonicalForm(dso));
|
||||
this.getObjectManager().manageObject(dso);
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -127,7 +127,7 @@ public class RestrictedItem extends AbstractDSpaceTransformer //implements Cache
|
||||
}
|
||||
else
|
||||
{
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
String handle = IdentifierService.getCanonicalForm(dso);
|
||||
type = "item";
|
||||
if (handle == null || "".equals(handle))
|
||||
{
|
||||
|
@@ -54,7 +54,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -90,7 +90,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
|
||||
if (dso == null)
|
||||
return "0";
|
||||
|
||||
return HashUtil.hash(IdentifierFactory.getCanonicalForm(dso));
|
||||
return HashUtil.hash(IdentifierService.getCanonicalForm(dso));
|
||||
}
|
||||
catch (SQLException sqle)
|
||||
{
|
||||
@@ -164,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 = IdentifierFactory.getURL(collection) + "/submit";
|
||||
String submitURL = IdentifierService.getURL(collection) + "/submit";
|
||||
viewer.addPara().addXref(submitURL,"Submit a new item to this collection");
|
||||
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ 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.uri.IdentifierService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
|
||||
@@ -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(IdentifierFactory.getCanonicalForm(c), false);
|
||||
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(IdentifierService.getCanonicalForm(c), false);
|
||||
|
||||
// Set the "stage_reached" column on the workspace item
|
||||
// to the LAST page of the LAST step in the submission process
|
||||
|
@@ -59,7 +59,7 @@ 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.uri.IdentifierService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -246,7 +246,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
for (WorkflowItem owned : ownedItems)
|
||||
{
|
||||
int workflowItemID = owned.getID();
|
||||
String url = IdentifierFactory.getURL(owned.getCollection()).toString()+"/workflow?workflowID="+workflowItemID;
|
||||
String url = IdentifierService.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();
|
||||
@@ -309,7 +309,7 @@ public class Submissions extends AbstractDSpaceTransformer
|
||||
for (WorkflowItem pooled : pooledItems)
|
||||
{
|
||||
int workflowItemID = pooled.getID();
|
||||
String url = IdentifierFactory.getURL(pooled.getCollection()).toString()+"/workflow?workflowID="+workflowItemID;
|
||||
String url = IdentifierService.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();
|
||||
|
@@ -53,7 +53,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -113,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 = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
boolean https = request.isSecure();
|
||||
|
@@ -65,7 +65,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
@@ -168,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 = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
DCInputSet inputSet = null;
|
||||
DCInput[] inputs = {};
|
||||
try
|
||||
{
|
||||
inputSet = getInputsReader().getInputs(IdentifierFactory.getCanonicalForm(submission.getCollection()));
|
||||
inputSet = getInputsReader().getInputs(IdentifierService.getCanonicalForm(submission.getCollection()));
|
||||
inputs = inputSet.getPageRows(getPage()-1, submission.hasMultipleTitles(), submission.isPublishedBefore());
|
||||
}
|
||||
catch (ServletException se)
|
||||
@@ -314,7 +314,7 @@ public class DescribeStep extends AbstractSubmissionStep
|
||||
DCInputSet inputSet = null;
|
||||
try
|
||||
{
|
||||
inputSet = getInputsReader().getInputs(IdentifierFactory.getCanonicalForm(submission.getCollection()));
|
||||
inputSet = getInputsReader().getInputs(IdentifierService.getCanonicalForm(submission.getCollection()));
|
||||
}
|
||||
catch (ServletException se)
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -140,7 +140,7 @@ public class EditFileStep extends AbstractStep
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
// Get the bitstream and all the various formats
|
||||
BitstreamFormat currentFormat = bitstream.getFormat();
|
||||
|
@@ -51,7 +51,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -124,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 = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
DCValue[] titles = item.getDC("title", "alternative", Item.ANY);
|
||||
|
||||
|
@@ -53,7 +53,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -147,7 +147,7 @@ public class LicenseStep extends AbstractSubmissionStep
|
||||
|
||||
// Get the full text for the actuial licese
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
String licenseText = collection.getLicense();
|
||||
|
||||
Division div = body.addInteractiveDivision("submit-license",actionURL, Division.METHOD_POST,"primary submission");
|
||||
|
@@ -52,7 +52,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -95,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 = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String showfull = request.getParameter("showfull");
|
||||
|
@@ -57,7 +57,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -138,7 +138,7 @@ public class ReviewStep extends AbstractSubmissionStep
|
||||
{
|
||||
// Get actionable URL
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
SubmissionConfig subConfig = submissionInfo.getSubmissionConfig();
|
||||
|
||||
|
@@ -48,7 +48,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -96,7 +96,7 @@ public class SaveOrRemoveStep extends AbstractStep
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
|
||||
Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission");
|
||||
div.setHead(T_submission_head);
|
||||
|
@@ -57,7 +57,7 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class SelectCollectionStep extends AbstractSubmissionStep
|
||||
UIException, SQLException, IOException, AuthorizeException
|
||||
{
|
||||
Collection[] collections; // List of possible collections.
|
||||
ResolvableIdentifier eid = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier eid = IdentifierService.resolve(context, handle);
|
||||
|
||||
DSpaceObject dso = null;
|
||||
if (eid != null)
|
||||
@@ -138,7 +138,7 @@ public class SelectCollectionStep extends AbstractSubmissionStep
|
||||
String name = collection.getMetadata("name");
|
||||
if (name.length() > 50)
|
||||
name = name.substring(0, 47) + "...";
|
||||
select.addOption(IdentifierFactory.getCanonicalForm(collection),name);
|
||||
select.addOption(IdentifierService.getCanonicalForm(collection),name);
|
||||
}
|
||||
|
||||
Button submit = list.addItem().addButton("submit");
|
||||
|
@@ -63,7 +63,7 @@ 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.uri.IdentifierService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
@@ -186,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 = IdentifierFactory.getURL(collection).toString() + "/submit";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/submit";
|
||||
boolean workflow = submission instanceof WorkflowItem;
|
||||
Bundle[] bundles = item.getBundles("ORIGINAL");
|
||||
Bitstream[] bitstreams = new Bitstream[0];
|
||||
|
@@ -53,7 +53,7 @@ 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.uri.IdentifierService;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.WorkflowManager;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -134,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 = IdentifierFactory.getURL(collection).toString() + "/workflow";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/workflow";
|
||||
int state = ((WorkflowItem) submission).getState();
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
|
@@ -53,7 +53,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -97,7 +97,7 @@ public class RejectTaskStep extends AbstractStep
|
||||
{
|
||||
Item item = submission.getItem();
|
||||
Collection collection = submission.getCollection();
|
||||
String actionURL = IdentifierFactory.getURL(collection).toString() + "/workflow";
|
||||
String actionURL = IdentifierService.getURL(collection).toString() + "/workflow";
|
||||
|
||||
Request request = ObjectModelHelper.getRequest(objectModel);
|
||||
String showfull = request.getParameter("showfull");
|
||||
|
@@ -67,11 +67,8 @@ import org.dspace.content.Bitstream;
|
||||
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.uri.IdentifierService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
@@ -223,7 +220,7 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
||||
else if (handle != null)
|
||||
{
|
||||
// Reference by an item's handle.
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, handle);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
if (dso instanceof Item && sequence > -1)
|
||||
@@ -253,11 +250,11 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
||||
String redictURL = request.getContextPath() + "/handle/";
|
||||
if (item!=null){
|
||||
// redictURL += item.getHandle();
|
||||
redictURL += IdentifierFactory.getCanonicalForm(item);
|
||||
redictURL += IdentifierService.getCanonicalForm(item);
|
||||
}
|
||||
else if(dso!=null){
|
||||
// redictURL += dso.getHandle();
|
||||
redictURL += IdentifierFactory.getCanonicalForm(dso);
|
||||
redictURL += IdentifierService.getCanonicalForm(dso);
|
||||
}
|
||||
redictURL += "/restricted-resource?bitstreamId=" + bitstream.getID();
|
||||
|
||||
|
@@ -79,7 +79,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.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -188,7 +188,7 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
DSpaceObject dso = null;
|
||||
if (uri != null)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
dso = ri.getObject(context);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
|
||||
if (uri != null)
|
||||
{
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
if (dso == null)
|
||||
@@ -624,11 +624,11 @@ public class DSpaceFeedGenerator extends AbstractGenerator
|
||||
url += "/handle/" + dso.getExternalIdentifier().getCanonicalForm();
|
||||
return url;
|
||||
*/
|
||||
return IdentifierFactory.getLocalURL(dso).toString();
|
||||
return IdentifierService.getLocalURL(dso).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return IdentifierFactory.getURL(dso).toString();
|
||||
return IdentifierService.getURL(dso).toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -176,7 +176,7 @@ public class DSpaceMETSGenerator extends AbstractGenerator
|
||||
ExternalIdentifierDAOFactory.getInstance(context);
|
||||
ExternalIdentifier eid = identifierDAO.retrieve(uri);
|
||||
DSpaceObject dso = eid.getObjectIdentifier().getObject(context);*/
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
DSpaceObject dso = ri.getObject(context);
|
||||
|
||||
// Handles can be either items or containers.
|
||||
|
@@ -5,7 +5,7 @@ import org.apache.cocoon.matching.modular.WildcardMatcher;
|
||||
import org.apache.cocoon.sitemap.PatternException;
|
||||
import org.dspace.app.xmlui.utils.ContextUtil;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
|
||||
import java.sql.SQLException;
|
||||
@@ -19,11 +19,10 @@ public class IdentifierMatcher extends WildcardMatcher
|
||||
{
|
||||
public Map match(String s, Map objectModel, Parameters parameters) throws PatternException
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Context context = ContextUtil.obtainContext(objectModel);
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, s);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, s);
|
||||
|
||||
// if no identifier is resolved, then return null, and a page-not-found will be shown
|
||||
if (ri == null)
|
||||
|
@@ -50,7 +50,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.ext.LexicalHandler;
|
||||
@@ -411,7 +411,7 @@ public abstract class AbstractAdapter
|
||||
|
||||
String url = contextPath + "/bitstream/"+identifier+"/";
|
||||
*/
|
||||
String url = contextPath + IdentifierFactory.getURL(bitstream).toString();
|
||||
String url = contextPath + IdentifierService.getURL(bitstream).toString();
|
||||
|
||||
// If we can put the pretty name of the bitstream on the end of the URL
|
||||
try
|
||||
|
@@ -50,7 +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.dspace.uri.IdentifierService;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
@@ -124,7 +124,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSOBJID()
|
||||
{
|
||||
return IdentifierFactory.getURL(dso).toString();
|
||||
return IdentifierService.getURL(dso).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +140,7 @@ public class ContainerAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSID()
|
||||
{
|
||||
return IdentifierFactory.getCanonicalForm(dso);
|
||||
return IdentifierService.getCanonicalForm(dso);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,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 = IdentifierFactory.getURL(collection).toString();
|
||||
String identifier_uri = IdentifierService.getURL(collection).toString();
|
||||
String provenance = collection.getMetadata("provenance_description");
|
||||
String rights = collection.getMetadata("copyright_text");
|
||||
String rights_license = collection.getMetadata("license");
|
||||
@@ -284,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 = IdentifierFactory.getURL(community).toString();
|
||||
String identifier_uri = IdentifierService.getURL(community).toString();
|
||||
String rights = community.getMetadata("copyright_text");
|
||||
String title = community.getMetadata("name");
|
||||
|
||||
|
@@ -47,7 +47,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -113,7 +113,7 @@ public class DSpaceObjectManager implements ObjectManager
|
||||
if (object instanceof DSpaceObject)
|
||||
{
|
||||
DSpaceObject dso = (DSpaceObject) object;
|
||||
String handle = IdentifierFactory.getCanonicalForm(dso);
|
||||
String handle = IdentifierService.getCanonicalForm(dso);
|
||||
// String handle = dso.getExternalIdentifier().getCanonicalForm();
|
||||
|
||||
// If the object has a handle then refrence it by it's handle.
|
||||
|
@@ -50,7 +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.dspace.uri.IdentifierService;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.output.SAXOutputter;
|
||||
@@ -138,7 +138,7 @@ public class ItemAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSOBJID()
|
||||
{
|
||||
return IdentifierFactory.getURL(item).toString();
|
||||
return IdentifierService.getURL(item).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +154,7 @@ public class ItemAdapter extends AbstractAdapter
|
||||
*/
|
||||
protected String getMETSID()
|
||||
{
|
||||
return IdentifierFactory.getCanonicalForm(item);
|
||||
return IdentifierService.getCanonicalForm(item);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -48,7 +48,7 @@ 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.dspace.uri.IdentifierService;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
@@ -324,7 +324,7 @@ public class RepositoryAdapter extends AbstractAdapter
|
||||
attributesXLINK.setNamespace(XLINK);
|
||||
|
||||
attributes.put("LOCTYPE", "URL");
|
||||
attributesXLINK.put("href", "/metadata/handle/"+ IdentifierFactory.getCanonicalForm(dso) +"/mets.xml"); // FIXME this isn't right
|
||||
attributesXLINK.put("href", "/metadata/handle/"+ IdentifierService.getCanonicalForm(dso) +"/mets.xml"); // FIXME this isn't right
|
||||
startElement(METS,"mptr",attributes,attributesXLINK);
|
||||
endElement(METS,"mptr");
|
||||
|
||||
|
@@ -51,7 +51,7 @@ 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 org.dspace.uri.IdentifierService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
@@ -263,7 +263,7 @@ public class DSpaceValidity implements SourceValidity
|
||||
Community community = (Community) dso;
|
||||
|
||||
validityKey.append("Community:");
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(community));
|
||||
validityKey.append(IdentifierService.getCanonicalForm(community));
|
||||
// validityKey.append(community.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(community.getMetadata("introductory_text"));
|
||||
validityKey.append(community.getMetadata("short_description"));
|
||||
@@ -280,7 +280,7 @@ public class DSpaceValidity implements SourceValidity
|
||||
Collection collection = (Collection) dso;
|
||||
|
||||
validityKey.append("Collection:");
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(collection));
|
||||
validityKey.append(IdentifierService.getCanonicalForm(collection));
|
||||
// validityKey.append(collection.getExternalIdentifier().getCanonicalForm());
|
||||
validityKey.append(collection.getMetadata("introductory_text"));
|
||||
validityKey.append(collection.getMetadata("short_description"));
|
||||
@@ -299,7 +299,7 @@ public class DSpaceValidity implements SourceValidity
|
||||
Item item = (Item) dso;
|
||||
|
||||
validityKey.append("Item:");
|
||||
validityKey.append(IdentifierFactory.getCanonicalForm(item));
|
||||
validityKey.append(IdentifierService.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);
|
||||
|
@@ -54,7 +54,7 @@ import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class HandleUtil
|
||||
|
||||
Context context = ContextUtil.obtainContext(objectModel);
|
||||
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, handle);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, handle);
|
||||
dso = ri.getObject(context);
|
||||
|
||||
request.setAttribute(DSPACE_OBJECT, dso);
|
||||
|
@@ -3,7 +3,7 @@ package org.dspace.app.xmlui.utils;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.uri.ResolvableIdentifier;
|
||||
import org.dspace.uri.IdentifierFactory;
|
||||
import org.dspace.uri.IdentifierService;
|
||||
import org.apache.cocoon.environment.Request;
|
||||
import org.apache.cocoon.environment.ObjectModelHelper;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class URIUtil
|
||||
{
|
||||
String uri = request.getSitemapURI();
|
||||
Context context = ContextUtil.obtainContext(objectModel);
|
||||
ResolvableIdentifier ri = IdentifierFactory.resolve(context, uri);
|
||||
ResolvableIdentifier ri = IdentifierService.resolve(context, uri);
|
||||
if (ri == null)
|
||||
{
|
||||
// FIXME: this is not right, but there's not much choice just now
|
||||
|
@@ -168,7 +168,7 @@
|
||||
<log-target id-ref="deprecation"/>
|
||||
</category>
|
||||
|
||||
<category name="sitemap" log-level="ERROR">
|
||||
<category name="sitemap" log-level="DEBUG">
|
||||
<log-target id-ref="sitemap"/>
|
||||
<log-target id-ref="error"/>
|
||||
|
||||
|
@@ -250,11 +250,13 @@ plugin.sequence.org.dspace.uri.IdentifierAssigner = \
|
||||
plugin.sequence.org.dspace.uri.IdentifierResolver = \
|
||||
org.dspace.uri.handle.Handle
|
||||
|
||||
# The URL namespace that is preferred for normal operation. This namespace
|
||||
# The identifier namespace that is preferred for normal operation. This namespace
|
||||
# will be the default used when constructing urls for navigating around the
|
||||
# system. If not specified, DSpace will use its default URL scheme
|
||||
# system, or generating canonical forms for the object.
|
||||
#
|
||||
identifier.url-scheme = hdl
|
||||
# If not specified, DSpace will use its default namespace (uuid)
|
||||
#
|
||||
identifier.preferred-namespace = hdl
|
||||
|
||||
# where should we store the actual uuid of the item?
|
||||
#
|
||||
|
Reference in New Issue
Block a user