Old Skin format for Adempiere ERP Integration

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
gazzx
Posts: 1
Joined: Mon Dec 05, 2016 4:39 pm

Old Skin format for Adempiere ERP Integration

Post by gazzx »

Dear All,
I'm newbie in zimbra and I need help to install a skin developed for old Zimbra Server released by adempiere community on Zembra Server 8.x.
The skin was developed some years ago and I read that Zimbra changed something about themes (https://wiki.zimbra.com/wiki/Creating_T ... ng_Version).
I tried to copy the theme under skins directory and add to server by zmprov command (zmprov mcf +zimbraInstalledSkin enhanced-skin).
Everything seems to be ok but when Adempiere try to call a specific URL (https://zimbra.server.local/zimbra?draftedit=305) the server return a 404 Error.
Before that call, Adempiere execute successfully the authentication phase using SOAP services provided by Zimbra.

I found the "drafedit" function under a file named skin.html included in the manifest.xml. I attach the script included in the html file:

...
<script type="text/javascript">

function urlParam( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}

function handleComposeAnswer(params,reply)
{
var msg = reply.getResponse().getResults().getFirstHit(0,0);
params["msg"]=msg;
AjxDispatcher.run("Compose", params);
}

function doEditMessage()
{
if(typeof(appCtxt)=="undefined" || appCtxt.inStartup)
{
setTimeout('doEditMessage()',100);
return;
}

var msgId = urlParam("draftedit");

if(!msgId)
return;

var params = {
action: "DRAFT",
getFirstMsg: true,
getHtml: true,
inNewWindow: false,
markRead: true
};

var searchParams = {
query: appCtxt.get(ZmSetting.INITIAL_SEARCH),
types: (AjxVector.fromArray([ZmItem.MSG])),
sortBy: ZmSearch.DATE_DESC,
offset: 0,
limit: appCtxt.get(ZmSetting.PAGE_SIZE),
getHtml: true
};

var search = new ZmSearch(searchParams);

var convParams = {
cid: "-" + msgId,
callback: (new AjxCallback(null, handleComposeAnswer, [params])),
fetchId: msgId,
markRead: true,
noTruncate: true
};

search.getConv(convParams);
}


// Mozilla and Opera 9 expose the event we could use
if (document.addEventListener)
{
document.addEventListener("DOMContentLoaded", doEditMessage, null);

// mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
document.addEventListener("load", doEditMessage, null);
}

// for Internet Explorer. readyState will not be achieved on init call
if (document.attachEvent) {
document.attachEvent("onreadystatechange", function(e) {
if (document.readyState == "complete")
{
doEditMessage();
}
});
}

</script>
...

Could you please help me?

Thanks in advanced.
GG
Post Reply