I am trying to create a contact group through a zimlet... If you take a look at my code below, you can see what I'm trying to accomplish. Below my code snippet you will find a the xml packet that is getting transmitted to the server (obtained using firebug and breakpoints).
Any advise would be GREATLY appreciated!!!
-------- ZIMLET CODE --------------
// Add a new group contact object...
// set up a BatchRequest for all contacts that need to be added... (Even though in this case it is only 1)
var soapDoc = null;
soapDoc = AjxSoapDoc.create("BatchRequest", "urn:zimbra");
soapDoc.setMethodAttribute("onerror", "continue");
var createContactReq = soapDoc.set("CreateContactRequest");
createContactReq.setAttribute("xmlns", "urn:zimbraMail");
var doc = soapDoc.getDoc();
var cn = doc.createElement("cn");
createContactReq.appendChild(cn);
// add nickname
var fn = doc.createElement("a");
fn.setAttribute("n", 'nickname');
fn.appendChild(doc.createTextNode(document.getElem entById('svsuNewGroup').value));
cn.appendChild(fn);
// add type
var ln = doc.createElement("a");
ln.setAttribute("n", 'type');
ln.appendChild(doc.createTextNode('group'));
cn.appendChild(ln);
// add dlist
var dl = doc.createElement("a");
dl.setAttribute("n", 'dlist');
dl.appendChild(doc.createTextNode('teststu@svsu.ed u'));
cn.appendChild(dl);
if (soapDoc) {
// finally, send the BatchRequest to the server
var respCallback = new AjxCallback(this, this._handleResponseCreate);
appCtxt.getAppController().sendRequest({soapDoc:so apDoc, asyncMode:true, callback:respCallback});
} else {
this._questionDialog.popdown();
}
-------- XML Call ---------
<BatchRequest xmlns="urn:zimbra" onerror="continue"><CreateContactRequest xmlns=""><cn><a n="nickname">def</a><a n="type">group</a><a n="dlist">tjpatter@svsu.edu</a></cn></CreateContactRequest></BatchRequest>


LinkBack URL
About LinkBacks

.
