We have recently upgraded to 15.2 and our custom html portlets not working in any browser content.Can you please suggest me whether we have some checks on it.
thanks in advance
Can you give more context on what is not working and moreover with HTML portlet there are certain changes. Have a look at this guide
Looking forward to hear more from you on this
thanks for the update.
To give you more on the context.
I have couple of custom html portlets created. When i click on a link these portlets should open. In these portlets i have some static data showing up
ideally it should take the below code and show me the portlet configured.
var currentURL = window.location.toString(); var endpoint = currentURL.substr(0, currentURL.indexOf("/niku")) + "/niku/xog"; var sessionCookie = getCookie('sessionId'); //alert("sessionCookie" + sessionCookie); // XML to fetch the token for The loggedIN User and for Project var xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quer="http://www.niku.com/xog/Query">'+ '<soapenv:Header>'+ '<quer:Auth>'+ '<quer:SessionID>'+sessionCookie+'</quer:SessionID>'+ '</quer:Auth>'+ '</soapenv:Header>'+ '<soapenv:Body>'+ '<quer:Query>'+ '<quer:Code>charter_fancy_portlet_query</quer:Code>'+ '<quer:Filter>'+ //'<quer:param_token>'+sessionCookie+'</quer:param_token>'+ '<quer:param_code>'+project+'</quer:param_code>'+ '</quer:Filter>'+ '</quer:Query>'+ '</soapenv:Body>'+ '</soapenv:Envelope>'; xmlhttp.open("POST", endpoint, true); //alert('InputXML'+xml); xmlhttp.send(xml);
.But in my scenario in 15.2 when i click on the links it is checking for this portlet in the local /temp/location for the where it is not able to find it and not opening the portlet.
Ideally with the above code it should pick up as below. But something is missing. I tested it in Firefox these are the screenshots.
with IE i am getting the download page for the portlets. some different behavior with browsers
You wont be able to use Windows.location and that cookie is not a static data, its dynamic and changes with each login. The documentation i provided states that.
So any alternate method to try upon.
I still have custom portlets working on 15.3 which use the sessionId with a couple of web service calls to render a user specific UI.
I would expect that you are not getting the sessionId via your getCookie function.
I switched methods of getting the sessionId based on Chris Wuenstel reply in:
You may run into risk of vulnerability if you disable HTTPONLY session cookie
We are OnDemand and have no access to the CSA to change the session cookie protection. I also agree that is would be a bad idea to disable HTTPONLY session cookie.
I was referring to not using cookies to get the session as it is available on the window global object which was pointed out by Chris Wuenstel.
thank you for the update.
var preUrl="http://"+window.location.hostname+"/niku/nu#";var preUrl1="http://"+window.location.hostname+"/niku/app?";
This no longer supported. What could be the alternate solution for getting the current URL.
This still works for me.
There also seems to be differences between "window.location.hostname" and "window.location.host".
Retrieving data ...