cancel
Showing results for 
Search instead for 
Did you mean: 

Web View Dashlet - 3.2

jtp
Champ in-the-making
Champ in-the-making
I love the web view option in Share, it's great for letting me integrate some of my other tools into one interface.  I do have one problem however.  I tried adding an https:// page to webview, and Share automatically prefixes the link with http://, so it ends up as http://https://www.mylink.com.  It looks like the script to change is C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\dashlets\webview.get.js
and the section to change is

var connector = remote.connect("http");
var re = /^http:\/\//;
if (!isDefault && !re.test(uri))
{
   uri = "http://" + uri;
}
Can anyone tell me how to modify that JS file to allow for the option of https web views?
7 REPLIES 7

zoao
Champ in-the-making
Champ in-the-making
Hello,

    i think that this work:
var connector = remote.connect("http");
var re = /^(http|https):\/\//;
if (!isDefault && !re.test(uri))
{
   uri = "http://" + uri;
}

But for me is more correct check if the string has protocol, whatever it is (http, https, ftp, file, mailto, …), in this case the expression is:
/^[A-Za-z]+:\/\//

jtp
Champ in-the-making
Champ in-the-making
Thanks for your reply.
Wouldn't you have to change this - uri = "http://" + uri; - so that it can point to the https URL when it sees https and keep with http if it sees http?  Otherwise I think it's just preventing the doubling (http://https://www.mylink.com), not allowing the https (https://www.mylink.com)

mikeh
Star Contributor
Star Contributor
It only adds the protocol prefix if the RegExp test fails.

Please raise this as a bug in JIRA - I believe we should support https (I'm not convinced of the other protocols for the WebView dashlet however).

Thanks,
Mike

jtp
Champ in-the-making
Champ in-the-making
Ah, that makes sense then.  Thanks.

jtp
Champ in-the-making
Champ in-the-making
FYI, I created a JIRA ticket back on the 9th https://issues.alfresco.com/jira/browse/ALFCOM-3189 but it hasn't been assigned yet.

jtp
Champ in-the-making
Champ in-the-making
The JIRA ticket is still in a "New" state.  Is that normal after nearly a month?

mikeh
Star Contributor
Star Contributor
Yes, if there's nobody available to assign it to.

Thanks,
Mike