cancel
Showing results for 
Search instead for 
Did you mean: 

Share in an Iframe

gbreen
Champ in-the-making
Champ in-the-making
Hi Everyone,

Hoping someone might have some insight into this. I would like to load share into an iframe on a different domain.  It works and I can login… The problem is that I cannot get the “document library" to work. I thought maybe it’s a crossdomain.xml thing. I created the Root folder in  webapps and added a crossdomain.xml however still not working.

Any thought please.
7 REPLIES 7

norgan
Champ in-the-making
Champ in-the-making
Hi,
please forgive me asking, but you did test it running share in a normal screen with the same softwarestack on the client ? I mention that because especially the doclib sometimes as some strange behaviour with Firefox in certain situations.

The reason was never found out, AFAIK, but it is clear, that it is a client problem, since multiple persons had the problem , e.g. on share.alfresco.com Thats where you could also go to verify, that it is not your client computer causing the problem.

Regards, Norgan

gbreen
Champ in-the-making
Champ in-the-making
Hi thanks for the reply!  I do have it working fine outside of the iframe. Any other thoughts tips please.

Also I created a iframe on the location of share and it worked fine. 

example:
localhost:8080\iframe.html   (works)
externalwebsite.com\iframe.html   (does not work)

norgan
Champ in-the-making
Champ in-the-making
Hmm ..
did you check the security settings in the browser ? iframes are run inside the browser, the server should not know about that. Or did I miss something here ?

Norgan

gbreen
Champ in-the-making
Champ in-the-making
I decided to go another way. I could not get the I frame to work. Thanks for the reply(s) thought. below is what i did.


$username ="youruser";
$password ="yourpass";
—–
<div id="loginform" name="loginform" style="display:none;">
      <form id="wl_login2" name="wl_login2" action="http://your_url.com:8080/share/login"  method="post" target="mywindow" >
         <input type="hidden" name="username" value="<? echo $username ?>"/>
         <input type="hidden" name="password" value="<? echo $password ?>" />
          <input type="submit" id="btn-login" class="login-button" />
      </form>      
</div>
—–
<Script Language="JavaScript">
function loadAlfresco() {
   // first lets logout so there are no errors
   var load = window.open("http://your_url.com:8080/share/logout','mywindow");
   //now lets send the login from the form
   document.wl_login2.submit();
}
</Script>
—–
<a href="javascript:loadAlfresco()">Open Window</a>

mikeh
Star Contributor
Star Contributor
There will have been a cross-domain Ajax security issue because your iframe domain is different to the page's domain. This is deliberate behaviour in all browsers, rather than an Alfresco limitation.

To solve it, you would have had to made the domain names match to a certain level (I think subdomains are ok security-wise).

Thanks,
Mike

cybertoast
Champ in-the-making
Champ in-the-making
I ran into this problem with all iFrame's - subdomain, same-domain, whatever. It turns out to because of a line in share/js/alfresco.js:

Alfresco.util.getQueryStringParameters = function(url)
{
    var i, len, idx, queryString, params, tokens, name, value, objParams;
    url = url || top.location.href;

The problem is that in an iFrame top is not available, so this should be:

    url = url || window.location.href;

Hope this helps someone.

simonium
Champ in-the-making
Champ in-the-making
Hi Cybertoast,  I know it was some ago, but I was just wondering if you eventually got Share to work in an iFrame after the adjustment you described?  Was it successful? Thanks.