AnsweredAssumed Answered

Alfresco Inegration with JAVA/j2ee

Question asked by manjunathab on Dec 11, 2014
Latest reply on Dec 15, 2014 by manjunathab

var self = this;
var ticket;
var xmlHttpReq = false;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
var data = "{username:admin,password:admin}";
self.xmlHttpReq.open("POST", "http://blrkec335927d:8080/alfresco/service/api/login", true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'json');
self.xmlHttpReq.setRequestHeader('X-Alfresco-Remote-User', 'admin');
xmlHttpReq.onreadystatechange = function() {//Call a function when the state changes.
alert(xmlHttpReq.status);
if (xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200)
{
var getTicket = JSON.parse(xmlHttpReq.responseText);
ticket = (getTicket.data).ticket;
var url1 = "http://blrkec335927d:8080/alfresco/service/ui/myspaces?f=0&p=%2FCompany%20Home&alf_ticket="+ticket;
var aa='';
document.getElementById('uploaddoc').innerHTML = aa;
}
}
self.xmlHttpReq.send(data);

 

${label['ALFRESCO_DOCUMENT']}

Above code is used for integration. But while loading iframe again its asking for username and password. Please any one help me.

Outcomes