restore original changes in trunk without windows linefeeds.

git-svn-id: http://scm.dspace.org/svn/repo/trunk@2741 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2008-02-28 04:43:05 +00:00
parent f7be403683
commit a6832e521a
4 changed files with 28 additions and 22 deletions

View File

@@ -52,6 +52,7 @@ import org.dspace.app.xmlui.cocoon.DSpaceFeedGenerator;
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;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.element.Body;
@@ -128,12 +129,12 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
{
try
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (dso == null)
return "0";
return HashUtil.hash(dso.getHandle());
return HashUtil.hash(IdentifierService.getCanonicalForm(dso));
}
catch (SQLException sqle)
{
@@ -156,7 +157,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
{
try
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (dso == null)
return null;
@@ -195,7 +196,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
WingException, UIException, SQLException, IOException,
AuthorizeException
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (!(dso instanceof Collection))
return;
@@ -221,7 +222,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
String feedFormat = parts[0].trim()+"+xml";
String feedURL = contextPath+"/feed/"+format.trim()+"/"+collection.getHandle();
String feedURL = IdentifierService.getURL(collection).toString() + "/"+format.trim();
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
}
}
@@ -233,7 +234,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
public void addBody(Body body) throws SAXException, WingException,
UIException, SQLException, IOException, AuthorizeException
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (!(dso instanceof Collection))
return;
@@ -251,7 +252,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
// Search query
Division query = search.addInteractiveDivision("collection-search",
contextPath + "/handle/" + collection.getHandle() + "/search",
IdentifierService.getURL(collection).toString() + "/search",
Division.METHOD_POST, "secondary search");
Para para = query.addPara("search-query", null);
@@ -266,7 +267,7 @@ public class CollectionViewer extends AbstractDSpaceTransformer implements Cache
List browse = browseDiv.addList("collection-browse", List.TYPE_SIMPLE,
"collection-browse");
browse.setHead(T_head_browse);
String url = contextPath + "/handle/" + collection.getHandle();
String url = IdentifierService.getURL(collection).toString();
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);

View File

@@ -52,6 +52,7 @@ import org.dspace.app.xmlui.cocoon.DSpaceFeedGenerator;
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;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.element.Body;
@@ -135,12 +136,12 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
*/
public Serializable getKey() {
try {
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (dso == null)
return "0"; // no item, something is wrong
return HashUtil.hash(dso.getHandle());
return HashUtil.hash(IdentifierService.getCanonicalForm(dso));
}
catch (SQLException sqle)
{
@@ -161,7 +162,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
if (this.validity == null)
{
try {
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (dso == null)
return null;
@@ -211,7 +212,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
WingException, UIException, SQLException, IOException,
AuthorizeException
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (!(dso instanceof Community))
return;
@@ -237,7 +238,8 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
String feedFormat = parts[0].trim()+"+xml";
String feedURL = contextPath+"/feed/"+format.trim()+"/"+community.getHandle();
// theres a problem here, the url for the feed has the format further in.
String feedURL = IdentifierService.getURL(community).toString() +"/"+format.trim();
pageMeta.addMetadata("feed", feedFormat).addContent(feedURL);
}
}
@@ -251,7 +253,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
UIException, SQLException, IOException, AuthorizeException
{
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
DSpaceObject dso = URIUtil.resolve(objectModel);
if (!(dso instanceof Community))
return;
@@ -271,7 +273,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
// Search query
Division query = search.addInteractiveDivision("community-search",
contextPath + "/handle/" + community.getHandle() + "/search",
IdentifierService.getURL(community).toString() + "/search",
Division.METHOD_POST, "secondary search");
Para para = query.addPara("search-query", null);
@@ -286,7 +288,7 @@ public class CommunityViewer extends AbstractDSpaceTransformer implements Cachea
List browse = browseDiv.addList("community-browse", List.TYPE_SIMPLE,
"community-browse");
browse.setHead(T_head_browse);
String url = contextPath + "/handle/" + community.getHandle();
String url = IdentifierService.getURL(community).toString();
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);

View File

@@ -56,6 +56,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.IdentifierService;
import org.xml.sax.SAXException;
import java.io.IOException;
@@ -171,14 +172,15 @@ public class RestrictedItem extends AbstractDSpaceTransformer //implements Cache
else
{
String identifier = "unknown";
String handle = dso.getHandle();
String handle = IdentifierService.getCanonicalForm(dso);
if (handle == null || "".equals(handle))
{
identifier = "internal ID: " + dso.getID();
}
else
{
identifier = "hdl:"+handle;
identifier = handle;
}
unauthorized.setHead(T_head_item);
unauthorized.addPara(T_para_item.parameterize(identifier));

View File

@@ -66,8 +66,8 @@ import org.dspace.content.Item;
import org.dspace.content.WorkspaceItem;
import org.dspace.core.Context;
import org.dspace.core.LogManager;
import org.dspace.handle.HandleManager;
import org.dspace.submit.AbstractProcessingStep;
import org.dspace.uri.IdentifierService;
import org.dspace.workflow.WorkflowItem;
import org.dspace.workflow.WorkflowManager;
@@ -365,11 +365,12 @@ public class FlowUtils {
// See if that gave the item a Handle. If it did,
// the item made it into the archive, so we
// should display a suitable page.
String handle = HandleManager.findHandle(context, item);
// String handle = HandleManager.findHandle(context, item);
context.commit();
if (handle != null)
// if (handle != null)
if (item.isArchived())
{
return true;
}
@@ -451,7 +452,7 @@ public class FlowUtils {
//Load the Submission Process for the collection this WSI is associated with
Collection c = wsi.getCollection();
SubmissionConfigReader subConfigReader = new SubmissionConfigReader();
SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c.getHandle(), 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