Commit 242a8577 authored by Mechtilde's avatar Mechtilde

New upstream version 3.7.0

parent ca304474
......@@ -12,12 +12,12 @@ do
case ${OPTION} in
u) echo "update"
cat defaults/preferences/update_enable.txt > defaults/preferences/update.js
zip -r exchangecalendar-$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
zip -r exchangecalendar-v$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
d) echo "no update"
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js
zip -r exchangecalendar-$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
zip -r exchangecalendar-v$version.xpi * -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
*) usage ;;
......
......@@ -332,7 +332,13 @@ exchAttachments.prototype = {
var taskTree = this._document.getElementById("calendar-task-tree");
var item = taskTree.currentTask;
var displayElement=function(id,flag) {
setBooleanAttribute(id, "hidden", !flag);
return flag;
}
if (displayElement("calendar-task-details-container", item != null) &&
displayElement("calendar-task-view-splitter", item != null)) {
if ((item.calendar) && (item.calendar.type == "exchangecalendar")) {
// calendar-task-view (hide existing attachment view)
//this.globalFunctions.LOG("exchWebService.attachments.onSelectTask: it is an Exchange task 1.");
......@@ -370,6 +376,7 @@ exchAttachments.prototype = {
catch (ex) {this.globalFunctions.LOG("exchWebService.attachments.onSelectTask: Foutje Y:");}
this.attachmentListboxVisible = false;
}
}
},
onSelect: function _onSelect(aEvent)
......
......@@ -54,7 +54,8 @@ function newOpenEventDialog(calendarItem, calendar, mode, callback, job, initial
if (mode == "new") {
calendars = calendars.filter(userCanAddItemsToCalendar);
} else { /* modify */
function calendarCanModifyItems(aCalendar) {
calendars = calendars.filter(function calendarCanModifyItems(aCalendar) {
/* If the calendar is the item calendar, we check that the item
* can be modified. If the calendar is NOT the item calendar, we
* check that the user can remove items from that calendar and
......@@ -65,8 +66,7 @@ function newOpenEventDialog(calendarItem, calendar, mode, callback, job, initial
&& userCanAddItemsToCalendar(aCalendar))
|| ((calendarItem.calendar == aCalendar)
&& userCanModifyItem(calendarItem)));
}
calendars = calendars.filter(calendarCanModifyItems);
});
}
if (mode == "new"
......
......@@ -37,6 +37,8 @@
<!DOCTYPE dialog [
<!ENTITY % eventDialogDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd">
%eventDialogDTD;
<!ENTITY % summaryDialogDTD SYSTEM "chrome://exchangecalendar/locale/calendar-summary-dialog.dtd">
%summaryDialogDTD;
]>
<?xul-overlay href="chrome://exchangecalendar/content/attachments-view.xul"?>
......@@ -45,7 +47,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<dialog id="calendar-summary-dialog" windowtype="Calendar:EventSummaryDialog"
buttons="accept,cancel" buttonlabelextra1="Forward invite"
buttons="accept,cancel" buttonlabelextra1="&forward.invite.label;"
ondialogextra1="tmpEventSummaryDialog.onForward();" persist="screenX screenY width height"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
......@@ -87,7 +89,7 @@
<box id="item-attendees" hidden="true" orient="vertical">
<spacer id="required-attendee-spacer" class="default-spacer" hidden="true"/>
<calendar-caption id="required-attendee-caption" label="Required Attendee"
<calendar-caption id="required-attendee-caption" label="&required.attendee.label;"
control="item-required-attendee-listbox" hidden="true"/>
<box orient="horizontal" id="item-required-attendee" hidden="true">
<spacer class="default-spacer"/>
......@@ -104,7 +106,7 @@
</box>
<spacer id="optional-attendee-spacer" class="default-spacer" hidden="true"/>
<calendar-caption id="optional-attendee-caption" label="Optional Attendee"
<calendar-caption id="optional-attendee-caption" label="&optional.attendee.label;"
control="item-optional-attendee-listbox" hidden="true"/>
<box orient="horizontal" id="item-optional-attendee" hidden="true">
<spacer class="default-spacer"/>
......
......@@ -18,7 +18,10 @@ Cu.import("resource://calendar/modules/calXMLUtils.jsm");
const globalFunctions = Cc["@1st-setup.nl/global/functions;1"]
.getService(Ci.mivFunctions);
const gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
function displayElement(id,flag) {
setBooleanAttribute(id, "hidden", !flag);
return flag;
}
function taskHtmlDetailsView(event){
function msgHdrToNeckoURL(aMsgHdr, gMessenger) {
......@@ -43,61 +46,62 @@ function taskHtmlDetailsView(event){
return (/^imap-message:/.test(messageUri));
}
if(event){
taskDetailsView.onSelect(event);
var item = document.getElementById("calendar-task-tree").currentTask;
if(event){
taskDetailsView.onSelect(event);
var item = document.getElementById("calendar-task-tree").currentTask;
if (displayElement("calendar-task-details-container", item != null) &&
displayElement("calendar-task-view-splitter", item != null)) {
if( item.calendar.type == "exchangecalendar" ){
//Html manipulations
var ele = document.getElementById("calendar-task-details-description");
var ele2 = document.getElementById("calendar-task-details-description2");
if( item.calendar.type == "exchangecalendar" ){
//Html manipulations
var ele = document.getElementById("calendar-task-details-description");
var ele2 = document.getElementById("calendar-task-details-description2");
//remove existing task view
//ele.parentNode.removeChild(ele);
if(item.itemClass == "IPM.Task"){
ele2.hidden = true;
ele.hidden = false;
}
else if(item.itemClass == "IPM.Note")
{
//imap://mail.internal.ericsson.com:993/fetch%3EUID%3E/INBOX%3E9459
//globalFunctions.LOG("MessageId " + item.messageId );
var queryListener = {
/* called when new items are returned by the database query or freshly indexed */
onItemsAdded : function queryListener_onItemsAdded(aItems, aCollection) {
},
/* called when items that are already in our collection get re-indexed */
onItemsModified : function queryListener_onItemsModified(aItems, aCollection) {
},
/* called when items that are in our collection are purged from the system */
onItemsRemoved : function queryListener_onItemsRemoved(aItems, aCollection) {
},
/* called when our database query completes */
onQueryCompleted : function queryListener_onQueryCompleted(aCollection) {
try {
for (var j = 0; j < aCollection.items.length; j++) {
var msgUri = aCollection.items[j].folderMessageURI;
var msgHdr = gMessenger.msgHdrFromURI(msgUri);
if(IsImapMessage(msgUri)){
var url = msgHdrToNeckoURL(msgHdr,gMessenger).spec;
showMail(url);
}
}
}
catch (e) {
dump("\nexception " +e);
}
}
};
var messageId = item.messageId.replace('<', '').replace('>', '');
if( messageId ){
var query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
query.headerMessageID(messageId);
var collection = query.getCollection(queryListener);
}
}
}
//remove existing task view
//ele.parentNode.removeChild(ele);
if(item.itemClass == "IPM.Task"){
ele2.hidden = true;
ele.hidden = false;
}
else if(item.itemClass == "IPM.Note")
{
//imap://mail.internal.ericsson.com:993/fetch%3EUID%3E/INBOX%3E9459
//globalFunctions.LOG("MessageId " + item.messageId );
var queryListener = {
/* called when new items are returned by the database query or freshly indexed */
onItemsAdded : function queryListener_onItemsAdded(aItems, aCollection) {
},
/* called when items that are already in our collection get re-indexed */
onItemsModified : function queryListener_onItemsModified(aItems, aCollection) {
},
/* called when items that are in our collection are purged from the system */
onItemsRemoved : function queryListener_onItemsRemoved(aItems, aCollection) {
},
/* called when our database query completes */
onQueryCompleted : function queryListener_onQueryCompleted(aCollection) {
try {
for (var j = 0; j < aCollection.items.length; j++) {
var msgUri = aCollection.items[j].folderMessageURI;
var msgHdr = gMessenger.msgHdrFromURI(msgUri);
if(IsImapMessage(msgUri)){
var url = msgHdrToNeckoURL(msgHdr,gMessenger).spec;
showMail(url);
}
}
}
catch (e) {
dump("\nexception " +e);
}
}
};
var messageId = item.messageId.replace('<', '').replace('>', '');
if( messageId ){
var query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
query.headerMessageID(messageId);
var collection = query.getCollection(queryListener);
}
}
}
}
}
}
\ No newline at end of file
......@@ -257,6 +257,6 @@ mailTools.prototype.onLoad = function(){
var tmpShowIconsAsInviteColumn = new showIconsAsInviteColumn();
var tmpMailTools = new mailTools(window,document);
window.addEventListener("load",tmpShowIconsAsInviteColumn.execute(),false);
window.addEventListener("load",tmpMailTools.onLoad(),false);
window.addEventListener("load",tmpShowIconsAsInviteColumn.execute(),false);
......@@ -36,7 +36,7 @@ lightningTimzone.prototype = {
this.onTimezoneChange();
},
onTimezoneChange:function _onTimezoneChange(self){
onTimezoneChange:function _onTimezoneChange(){
var oldOffset;
var currentOffset;
......
......@@ -86,7 +86,9 @@
<preference id="extensions.1st-setup.others.userAgent"
name="extensions.1st-setup.others.userAgent"
type="unichar"/>
<preference id="extensions.1st-setup.others.ntlmv1"
name="network.auth.force-generic-ntlm-v1"
type="bool"/>
</preferences>
<groupbox id="exchangeWebService_others_prefs_groupbox">
......@@ -160,6 +162,16 @@
</hbox>
</vbox>
</groupbox>
<groupbox id="exchangeWebService_others_prefs_groupbox4">
<caption label="&exchangeWebService.preference.ntlmv1.label;"/>
<vbox>
<radiogroup id="exchangeWebService_preference_others_ntlmv1"
preference="extensions.1st-setup.others.ntlmv1"
label="&exchangeWebService.preference.ntlmv1.label;">
<radio id="ntlm-true" value="true" label="&exchangeWebService.preference.ntlmv1.true.label;"/>
<radio id="ntlm-false" value="false" label="&exchangeWebService.preference.ntlmv1.false.label;" />
</radiogroup>
</vbox>
</groupbox>
</vbox>
</overlay>
......@@ -112,6 +112,8 @@ function ExchangeRequest(aArgument, aCbOk, aCbError, aListener)
this.timeZones = Cc["@1st-setup.nl/exchange/timezones;1"]
.getService(Ci.mivExchangeTimeZones);
this.xml2json = false;
}
......@@ -170,7 +172,7 @@ ExchangeRequest.prototype = {
logInfo: function _logInfo(aMsg, aLevel)
{
if (!aLevel) var aLevel = 1;
if (!aLevel) aLevel = 1;
if ((this.debug) && (aLevel <= this.debuglevel)) {
this.globalFunctions.LOG(this.uuid+": "+aMsg);
......@@ -1310,15 +1312,16 @@ ecnsIAuthPrompt2.prototype = {
this.logInfo("getPrePassword for user:"+aUsername+", server url:"+aURL);
this.username = aUsername;
this.URL = aURL;
var password;
var myAuthPrompt2 = Cc["@1st-setup.nl/exchange/authprompt2;1"].getService(Ci.mivExchangeAuthPrompt2);
if (myAuthPrompt2.getUserCanceled(this.currentUrl)) {
if (myAuthPrompt2.getUserCanceled(aURL)) {
return null;
}
var openUser = aUsername;
try {
password = myAuthPrompt2.getPassword(null, this.mArgument.user, this.currentUrl);
password = myAuthPrompt2.getPassword(null,openUser, aURL);
}
catch(err) {
}
......
......@@ -95,8 +95,6 @@ function erFindCalendarItemsRequest(aArgument, aCbOk, aCbError, aListener)
this.occurrenceIds = [];
this.ids = [];
this.itemsFound = 0;
this.offset = 0;
this.isRunning = true;
this.execute();
}
......@@ -105,7 +103,7 @@ erFindCalendarItemsRequest.prototype = {
execute: function _execute()
{
//dump("erFindCalendarItemsRequest.execute\n");
//exchWebService.commonFunctions.LOG("erFindCalendarItemsRequest.execute\n");
var root = xml2json.newJSON();
var req = xml2json.addTag(root, "FindItem", "nsMessages", null);
......@@ -154,7 +152,7 @@ erFindCalendarItemsRequest.prototype = {
this.parent.xml2json = true;
//dump("erFindCalendarItemsRequest.execute 2:"+String(this.parent.makeSoapMessage2(req))+"\n");
//exchWebService.commonFunctions.LOG("erFindCalendarItemsRequest.execute 2:"+String(this.parent.makeSoapMessage2(req))+"\n");
this.parent.sendRequest(this.parent.makeSoapMessage2(req), this.serverUrl);
req = null;
......@@ -173,7 +171,7 @@ erFindCalendarItemsRequest.prototype = {
* Occurrence for those masters that did not yet see any Exception.
*/
if (this.subject) {
dump("erFindCalendarItemsRequest.onSendOk:"+xml2json.toString(aResp)+"\n");
exchWebService.commonFunctions.LOG("erFindCalendarItemsRequest.onSendOk:"+xml2json.toString(aResp)+"\n");
}
var aError = false;
......@@ -185,85 +183,79 @@ erFindCalendarItemsRequest.prototype = {
if (rm.length > 0) {
var rootFolder = xml2json.getTag(rm[0], "m:RootFolder");
if (rootFolder) {
//this.offset = xml2json.getAttribute(rootFolder, "IndexedPagingOffset");
//exchWebService.commonFunctions.LOG(" -- Next IndexedPagingOffset:"+this.offset+".");
//dump(" -- Next IndexedPagingOffset:"+this.offset+"\n");
// Process results.
var calendarItems = xml2json.XPath(rootFolder, "/t:Items/t:CalendarItem");
this.newStartDate = null;
for (var index=0; index < calendarItems.length; index++) {
var calItem = calendarItems[index];
if (xml2json.getTagValue(calendarItems[index], "t:Start").substr(0,10) == xml2json.getTagValue(calendarItems[index], "t:End").substr(0,10)) {
var tmpDateStr = xml2json.getTagValue(calendarItems[index], "t:End");
if (xml2json.getTagValue(calItem, "t:Start").substr(0,10) == xml2json.getTagValue(calItem, "t:End").substr(0,10)) {
var tmpDateStr = xml2json.getTagValue(calItem, "t:End");
var tmpDateObj = cal.fromRFC3339(tmpDateStr, exchWebService.commonFunctions.ecTZService().UTC).getInTimezone(exchWebService.commonFunctions.ecDefaultTimeZone());
var offset = cal.createDuration();
offset.seconds = 1;
tmpDateObj.addDuration(offset);
this.newStartDate = convDate(tmpDateObj);
// dump(" && this.newStartDate:"+this.newStartDate+"\n");
// exchWebService.commonFunctions.LOG(" && this.newStartDate:"+this.newStartDate+"\n");
}
this.itemsFound++;
var uid = xml2json.getTagValue(calendarItems[index], "t:UID", "");
var uid = xml2json.getTagValue(calItem, "t:UID", "");
/*dump(" ** title:"+xml2json.getTagValue(calendarItems[index], "t:Subject", "<NOP>")+"\n");
dump(" ** Start:"+xml2json.getTagValue(calendarItems[index], "t:Start", "<NOP>")+"\n");
dump(" ** End:"+xml2json.getTagValue(calendarItems[index], "t:End", "<NOP>")+"\n");
dump(" ** CalendarItemType:"+xml2json.getTagValue(calendarItems[index], "t:CalendarItemType", "<NOP>")+"\n");*/
/*exchWebService.commonFunctions.LOG(" ** title:"+xml2json.getTagValue(calItem, "t:Subject", "<NOP>")+"\n");
exchWebService.commonFunctions.LOG(" ** Start:"+xml2json.getTagValue(calItem, "t:Start", "<NOP>")+"\n");
exchWebService.commonFunctions.LOG(" ** End:"+xml2json.getTagValue(calItem, "t:End", "<NOP>")+"\n");
exchWebService.commonFunctions.LOG(" ** CalendarItemType:"+xml2json.getTagValue(calItem, "t:CalendarItemType", "<NOP>")+"\n");*/
switch (xml2json.getTagValue(calendarItems[index], "t:CalendarItemType")) {
switch (xml2json.getTagValue(calItem, "t:CalendarItemType")) {
case "Occurrence" :
case "Exception" :
if ((this.uid) && (this.uid != uid)) { // Do not select items which do not fit the selected uid.
uid = "";
}
if (uid != "") {
this.occurrences[uid] = {Id: xml2json.getAttributeByTag(calendarItems[index], "t:ItemId","Id"),
ChangeKey: xml2json.getAttributeByTag(calendarItems[index], "t:ItemId", "ChangeKey"),
type: xml2json.getTagValue(calendarItems[index], "t:CalendarItemType"),
this.occurrences[uid] = {Id: xml2json.getAttributeByTag(calItem, "t:ItemId","Id"),
ChangeKey: xml2json.getAttributeByTag(calItem, "t:ItemId", "ChangeKey"),
type: xml2json.getTagValue(calItem, "t:CalendarItemType"),
uid: uid,
start: xml2json.getTagValue(calendarItems[index], "t:Start"),
end: xml2json.getTagValue(calendarItems[index], "t:End")};
start: xml2json.getTagValue(calItem, "t:Start"),
end: xml2json.getTagValue(calItem, "t:End")};
}
case "RecurringMaster" :
case "Single" :
this.ids.push({Id: xml2json.getAttributeByTag(calendarItems[index], "t:ItemId","Id"),
ChangeKey: xml2json.getAttributeByTag(calendarItems[index], "t:ItemId", "ChangeKey"),
type: xml2json.getTagValue(calendarItems[index], "t:CalendarItemType"),
this.ids.push({Id: xml2json.getAttributeByTag(calItem, "t:ItemId","Id"),
ChangeKey: xml2json.getAttributeByTag(calItem, "t:ItemId", "ChangeKey"),
type: xml2json.getTagValue(calItem, "t:CalendarItemType"),
uid: uid,
start: xml2json.getTagValue(calendarItems[index], "t:Start"),
end: xml2json.getTagValue(calendarItems[index], "t:End")});
start: xml2json.getTagValue(calItem, "t:Start"),
end: xml2json.getTagValue(calItem, "t:End")});
break;
default:
exchWebService.commonFunctions.LOG("UNKNOWN CalendarItemType:"+xml2json.getTagValue(calendarItems[index], "t:CalendarItemType")+"\n");
exchWebService.commonFunctions.LOG("UNKNOWN CalendarItemType:"+xml2json.getTagValue(calItem, "t:CalendarItemType")+"\n");
break;
}
}
calendarItems = null;
// if ((xml2json.getAttribute(rootFolder, "IncludesLastItemInRange") == "true") || (this.newStartDate === null) || (tmpDateObj.compare(this.rangeEnd) > 0)) {
var itemsFound = calendarItems.length;
// Return the result to be processed.
if (this.mCbOk) {
this.mCbOk(this, this.ids, this.occurrences.slice());
}
// Clear data
this.recurringMasters = [];
this.occurrences = [];
this.occurrenceIds = [];
this.ids = [];
calendarItems = null;
// Should continue or not
if ((xml2json.getAttribute(rootFolder, "IncludesLastItemInRange") == "true")) {
// We are done.
exchWebService.commonFunctions.LOG("erFindCalendarItems: retrieved:"+this.itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Includes last item in range.");
//dump("erFindCalendarItems: retrieved:"+this.itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Includes last item in range.\n\n");
exchWebService.commonFunctions.LOG("erFindCalendarItems: retrieved:"+itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Includes last item in range.");
this.isRunning = false;
}
else {
// We return the result to be processed.
exchWebService.commonFunctions.LOG("erFindCalendarItems: retrieved:"+this.itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Last item not in range so going for another run.");
//dump("erFindCalendarItems: retrieved:"+this.itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Last item not in range so going for another run.\n\n");
if (this.mCbOk) {
var occurrenceList = [];
for (var index in this.occurrences) {
occurrenceList.push(this.occurrences[index]);
}
this.mCbOk(this, this.ids, occurrenceList);
}
this.recurringMasters = [];
this.occurrences = [];
this.occurrenceIds = [];
this.ids = [];
this.execute();
exchWebService.commonFunctions.LOG("erFindCalendarItems: retrieved:"+itemsFound+" items. TotalItemsInView:"+xml2json.getAttribute(rootFolder, "TotalItemsInView")+" items. Last item not in range so going for another run.");
this.execute();
return;
}
}
......@@ -272,6 +264,9 @@ dump(" ** CalendarItemType:"+xml2json.getTagValue(calendarItems[index], "t:Cale
aError = true;
aMsg = "No RootFolder found in FindItemResponse.";
}
// Ensure data can be cleared
rootFolder = null;
}
else {
aMsg = this.parent.getSoapErrorMsg(aResp);
......@@ -291,24 +286,11 @@ dump(" ** CalendarItemType:"+xml2json.getTagValue(calendarItems[index], "t:Cale
if (aError) {
this.onSendError(aExchangeRequest, aCode, aMsg);
}
else {
if (this.mCbOk) {
var occurrenceList = [];
for (var index in this.occurrences) {
occurrenceList.push(this.occurrences[index]);
}
this.mCbOk(this, this.ids, occurrenceList);
}
this.ids = null;
this.occurrences = null;
this.isRunning = false;
}
},
onSendError: function _onSendError(aExchangeRequest, aCode, aMsg)
{
dump(" @@@ onSendError aCode:"+aCode+", aMsg:"+aMsg+" @@@\n");
exchWebService.commonFunctions.LOG(" @@@ onSendError aCode:"+aCode+", aMsg:"+aMsg+" @@@\n");
this.isRunning = false;
if (this.mCbError) {
this.mCbError(this, aCode, aMsg);
......
......@@ -38,7 +38,7 @@ function erFindContactsRequest(aArgument, aCbOk, aCbError, aListener)
var self = this;
this.parent = new ExchangeRequest(aArgument,
this.parent = new ExchangeRequest(aArgument,
function(aExchangeRequest, aResp) { self.onSendOk(aExchangeRequest, aResp);},
function(aExchangeRequest, aCode, aMsg) { self.onSendError(aExchangeRequest, aCode, aMsg);},
aListener);
......@@ -51,22 +51,36 @@ function erFindContactsRequest(aArgument, aCbOk, aCbError, aListener)
this.changeKey = aArgument.changeKey;
this.listener = aListener;
// Arrays containing results of the possible multiple requests
this.contacts = [];
this.distlists = [];
this.isRunning = true;
this.execute();
// First request is done with an offset of 0 (actually we don't know the number of contacts)
this.execute(0);
}
erFindContactsRequest.prototype = {
execute: function _execute()
execute: function _execute(offset)
{
// exchWebService.commonFunctions.LOG("erFindContactsRequest.execute\n");
//exchWebService.commonAbFunctions.logInfo("erFindContactsRequest.execute\n");
var req = exchWebService.commonFunctions.xmlToJxon('<nsMessages:FindItem xmlns:nsMessages="'+nsMessagesStr+'" xmlns:nsTypes="'+nsTypesStr+'"/>');
req.setAttribute("Traversal", "Shallow");
var itemShape = req.addChildTag("ItemShape", "nsMessages", null);
var itemShape = req.addChildTag("ItemShape", "nsMessages", null);
itemShape.addChildTag("BaseShape", "nsTypes", "IdOnly");
// The IndexedPageItemView allows to request a certain range of contacts in the address book
var view = exchWebService.commonFunctions.xmlToJxon('<nsMessages:IndexedPageItemView />');
view.setAttribute("MaxEntriesReturned","300"); // Maximum number of entries to receive
view.setAttribute("Offset", offset); // Offset from the BasePoint (Beginning or End)
view.setAttribute("BasePoint", "Beginning");
req.addChildTagObject(view);
view = null;
var additionalProperties = itemShape.addChildTag("AdditionalProperties", "nsTypes", null);
additionalProperties.addChildTag("FieldURI", "nsTypes", null).setAttribute("FieldURI", "item:Subject");
additionalProperties.addChildTag("FieldURI", "nsTypes", null).setAttribute("FieldURI", "folder:DisplayName");
......@@ -90,15 +104,15 @@ erFindContactsRequest.prototype = {
this.parent.xml2jxon = true;
//exchWebService.commonFunctions.LOG("erFindContactsRequest.execute:"+String(this.parent.makeSoapMessage(req)));
//exchWebService.commonAbFunctions.logInfo("erFindContactsRequest.execute:"+String(this.parent.makeSoapMessage(req)));
this.parent.sendRequest(this.parent.makeSoapMessage(req), this.serverUrl);
this.parent.sendRequest(this.parent.makeSoapMessage(req), this.serverUrl);
req = null;
},
onSendOk: function _onSendOk(aExchangeRequest, aResp)
{
exchWebService.commonFunctions.LOG("erFindContactsRequest.onSendOk:"+String(aResp));
exchWebService.commonAbFunctions.logInfo("erFindContactsRequest.onSendOk:"+String(aResp));
var rm = aResp.XPath("/s:Envelope/s:Body/m:FindItemResponse/m:ResponseMessages/m:FindItemResponseMessage/m:ResponseCode");
......@@ -111,38 +125,46 @@ erFindContactsRequest.prototype = {
if (responseCode == "NoError") {
var contacts = [];
var distlists = [];
var rootFolder = aResp.XPath("/s:Envelope/s:Body/m:FindItemResponse/m:ResponseMessages/m:FindItemResponseMessage/m:RootFolder");
if (rootFolder.length == 0) {
this.onSendError(aExchangeRequest, this.parent.ER_ERROR_RESPONS_NOT_VALID, "Did not find a rootfolder element.");
return;
}
// For now we do not do anything with the following two values.
var totalItemsInView = rootFolder[0].getAttribute("TotalItemsInView", 0);
var includesLastItemInRange = rootFolder[0].getAttribute("IncludesLastItemInRange", "true");
for each (var contact in rootFolder[0].XPath("/t:Items/t:Contact")) {
exchWebService.commonFunctions.LOG("erFindContactsRequest.contacts: id:"+contact.getAttributeByTag("t:ItemId", "Id")+", changekey:"+contact.getAttributeByTag("t:ItemId", "ChangeKey"));
contacts.push({Id: contact.getAttributeByTag("t:ItemId", "Id"),
exchWebService.commonAbFunctions.logInfo("erFindContactsRequest.contacts: id:"+contact.getAttributeByTag("t:ItemId", "Id")+", changekey:"+contact.getAttributeByTag("t:ItemId", "ChangeKey"));
this.contacts.push({Id: contact.getAttributeByTag("t:ItemId", "Id"),
ChangeKey: contact.getAttributeByTag("t:ItemId", "ChangeKey"),
name: contact.getTagValue("t:Subject"),
displayName: contact.getTagValue("t:DisplayName")});
}
for each (var distlist in rootFolder[0].XPath("/t:Items/t:DistributionList")) {
distlists.push({Id: distlist.getAttributeByTag("t:ItemId", "Id"),
this.distlists.push({Id: distlist.getAttributeByTag("t:ItemId", "Id"),