Discussion:
[Dspace-tech] [SOLVED] RE: CC Licence step not completing?
Michael White
2015-08-18 09:03:43 UTC
Permalink
Hi,

Just for completeness, I have now solved the problem I was having using the CC Licence Selection step in DSpace v5.2, JSPUI using https - and I believe it was due to a minor bug in the code.
http://dspace.2283337.n4.nabble.com/CC-license-and-HTTPS-in-JSPUI-
td4674301.html reports an issue when using https that causes "mixed
content" security warnings, but it looks like the changes suggested on that
thread have been incorporated into the DSpace code now
(https://jira.duraspace.org/browse/DS-2151?) and a quick review of the
relevant code seems to confirm this. So I don't think I'm hitting this issue?
Turns out it was this issue I was suffering from and I think it is because the fix detailed in https://jira.duraspace.org/browse/DS-2151 had a small mistake in the code which I didn't spot with my initial "quick review" (that's just my take on it though, happy for others to contradict me!).

The initial problem was that the "Proceed" link that appears at the end of the CC Licence step was still using http rather than https (despite the fix detailed above) - tracking down the relevant part of the code suggested that it was not correctly stripping the protocol and replacing it with "//" (part of the fix suggested in http://dspace.2283337.n4.nabble.com/CC-license-and-HTTPS-in-JSPUI-td4674301.html).

Around line 41 in creative-commons.jsp it has:

String reqURL = request.getRequestURL().toString();
int firstIndex = reqURL.indexOf("://") + 3;
int secondIndex = reqURL.indexOf("/", firstIndex);
String baseURL = reqURL.substring(0, secondIndex) + request.getContextPath();

- which doesn't appear to strip the protocol (?) - I replaced it with the following:

String reqURL = request.getRequestURL().toString();
int firstIndex = reqURL.indexOf("://") + 3;
int secondIndex = reqURL.indexOf("/", firstIndex);
// Fixed the following to force https to prevent mixed content errors - MW: 17/8/15
String baseURL = "//" + reqURL.substring(firstIndex, secondIndex) + request.getContextPath();
//String baseURL = reqURL.substring(0, secondIndex) + request.getContextPath();

- which strips the protocol and replaces it with "//" - this seems to have resolved the problems I was experiencing - the "Proceed" link is now using https and the CC Licence selection step is now completing as expected :-).

I hope this will be helpful for any others that encounter this problem using the CC Licence Selection step with JSPUI and https.

Regards,

Mike

Michael White
eLearning Developer
Information Services

T: (01786) 466877
E: ***@stir.ac.uk
A: S8, Library, University of Stirling, Stirling, FK9 4LA
-----Original Message-----
From: Michael White
Sent: 10 August 2015 14:23
Subject: CC Licence step not completing?
Hi,
Running DSpace v5.2 with JSPUI. Configured to run over https (which may, or
may not, be behind this issue?).
I’ve just been having a play with the Creative Commons licence selection step
but it doesn’t seem to be working for me so I’m wondering if I’ve done
something wrong, or hit a known issue?
I’ve “switched on” the CC License step by uncommenting it in item-
submission.xml.
The CC licence selection step now appears as expected (in an iFrame), and I
can select radio buttons and click "Select a Licence" - the selection process
appears to work as I get a page back that shows the selected licence, but
when I click on the "proceed" link, the page just hangs and I'm not moved on
to the next step :-(
Reviewing the metadata of the record by returning to the Input Forms, I can
see that dc.rights now contains “An error occurred on the license name” and I
can see that an RDF file has been added to the "uploaded files", but this
<result>
- which certainly doesn’t seem right ☺
I've done some googling, and had a dig about in the mailing list archives and
JIRA but haven't managed to resolve this or find anything definitive.
http://dspace.2283337.n4.nabble.com/CC-license-and-HTTPS-in-JSPUI-
td4674301.html reports an issue when using https that causes "mixed
content" security warnings, but it looks like the changes suggested on that
thread have been incorporated into the DSpace code now
(https://jira.duraspace.org/browse/DS-2151?) and a quick review of the
relevant code seems to confirm this. So I don't think I'm hitting this issue?
And this JIRA also points to an issue with DSpace 5.2 and CC licences,
https://jira.duraspace.org/browse/DS-2604, but this seems to suggest that the
process completes (in terms of the record being saved and the CC logo
turning up on the item record) which is not what I'm experiencing. So I'm not
sure if I'm hitting this issue?
I also read somewhere (that I've lost now!) that the specification of a
jurisdiction value in dspace.cfg causes problems with the selection of CC v4
licences, so I have tried commenting out this option in dspace.cfg, but that
didn't seem to make any difference either.
I found this (about writing these CC selection step errors into the metadata),
too - https://jira.duraspace.org/browse/DS-1538 - but I don't think that is
behind the problem (just a consequence of it)?
So, does anyone have the CC licence selection step running on DSpace v5.2,
using JSPUI and everything over https? If so, any hints or tips on anything you
had to do to get it working?
. . . or is CC Licence selection known not to work in that configuration?
Many thanks as ever,
Mike
Michael White
eLearning Developer
Information Services
T: (01786) 466877
A: S8, Library, University of Stirling, Stirling, FK9 4LA
--
The University is ranked in the QS World Rankings of the top 5% of universities in the world (QS World University Rankings, 2014)
The University of Stirling is a charity registered in Scotland,
number SC 011159.

------------------------------------------------------------------------------
Loading...