[ 
http://jira.dspace.org/jira/browse/DS-598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Donohue updated DS-598:
---------------------------

    Fix Version/s: 1.7.0
         Assignee: Richard Rodgers

This issue was discussed in DSpace Developers Meeting on 01 Sept 2010.

Decided that this should be scheduled for 1.7.0.  Richard Rodgers volunteered 
to do testing/reviewing of Graham's suggested patch.

[20:10] <tdonohue> DS-598 : SWORD will only accept deposits on the URL 
configured in dspace.cfg http://jira.dspace.org/jira/browse/DS-598
[20:11] <tdonohue> Any volunteer to review Graham's code for DS-598? Or should 
I assign to our local SWORD expert (stuart) and hope he has time :)
[20:11] <richardrodgers> Seems OK - we have a new 1.7 SWORD things we want in - 
so assign to me
[20:11] <richardrodgers> new -> few
[20:11] <tdonohue> ok, DS-598: assign to richardrodgers for 1.7

> SWORD will only accept deposits on the URL configured in dspace.cfg
> -------------------------------------------------------------------
>
>                 Key: DS-598
>                 URL: http://jira.dspace.org/jira/browse/DS-598
>             Project: DSpace 1.x
>          Issue Type: Bug
>          Components: DSpace API
>            Reporter: Graham Triggs
>            Assignee: Richard Rodgers
>             Fix For: 1.7.0
>
>
> SWORDURLManager.getDSpaceObject() calls getBaseDepositUrl() to get the base 
> url to strip from the deposit location, in order to retrieve the handle.
> If the deposit is attempted on any url that is not either exactly as 
> configured, or exactly the same length as the url generated from the 
> dspace.url configuration, then the SWORD service will throw an exception 
> saying "The deposit URL does not resolve to a valid deposit target" (as the 
> retrieved handle will not actually be a valid handle).
> Alternate version of method:
>       public DSpaceObject getDSpaceObject(Context context, String location)
>               throws DSpaceSWORDException, SWORDErrorException
>       {
>               try
>               {
>                       URL baseUrl    = new URL(this.getBaseDepositUrl());
>                       URL depositUrl = new URL(location);
>                       
>                       String basePath    = baseUrl.getPath();
>                       String depositPath = depositUrl.getPath();
>                       
>                       if (basePath.length() == depositPath.length())
>                       {
>                               throw new 
> SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL, "The deposit URL is 
> incomplete");
>                       }
>                       String handle = 
> depositPath.substring(basePath.length());
>                       if (handle.startsWith("/"))
>                       {
>                               handle = handle.substring(1);
>                       }
>                       if ("".equals(handle))
>                       {
>                               throw new 
> SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL, "The deposit URL is 
> incomplete");
>                       }
>                       DSpaceObject dso = 
> HandleManager.resolveToObject(context, handle);
>                       if (!(dso instanceof Collection) && !(dso instanceof 
> Item))
>                       {
>                               throw new 
> SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL, "The deposit URL does not 
> resolve to a valid deposit target");
>                       }
>                       return dso;
>               }
>               catch (SQLException e)
>               {
>                       // log.error("Caught exception:", e);
>                       throw new DSpaceSWORDException("There was a problem 
> resolving the collection", e);
>               } catch (MalformedURLException e) {
>                       throw new 
> SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL, "The deposit URL is 
> incomplete");
>               }
>       }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to