Commit dc65ced2 authored by Mechtilde's avatar Mechtilde

Merge branch 'upstream'

parents b6967f35 410c9278
Thunderbird Exchange based Calendar support
##Exchange EWS Provider
Thank you for checking out Ericsson's Exchange EWS Provider. Ericsson and the Ericsson QA team are grateful for the help and hard work of many [contributors][contributors] like yourself.
Ericsson's fork of
Current Release Vs. Download trend is something like [this](
Getting involved as a contributor
We love working with contributors for Exchange EWS Provider, but it does require a few skills. You will need to know some Javascript, XUL, some CSS and a basic familiarity with GitHub.
If you know some Javascript, it's worth having a look at the Object Oriented Programming to understand the basic concepts of class based coding and especially for xul window objects.
If you need to brush-up on programming, but are eager to start contributing immediately, please consider helping us find bugs in Github [Exchange EWS Provider][Exchange EWS Provider] or find bugs in the Issues tested by the [EricssonQA][EricssonQA] team. To brush up on Javascript skills before engaging with us, Dive Into Javascript [mozilla][mozilla] is an excellent resource. W3schools also has [notes on Javascript][w3schools] available through their website. The programming concepts you will need to know include functions, working with classes, and some object-oriented programming basics. To brush up on XUL, Mozilla [XUL][XUL] is an easy and simple place to learn XUL, More of XUL are dynamically configured and cross-plateform.
Special thanks to all our [contributors][contributors]
[Exchange EWS Provider]:
Questions are always welcome
While we take pains to keep our documentation updated, the best source of information is those of us who work on the project. We also have the [wiki][wiki] pages to answer your general questions about contributing to Exchange EWS Provider.
Getting set up
It's easy to get set up: just 2 pieces of software to install and in few command lines you'll be running the addon!
### Install Thunderbird
If you don't already have it installed, please install latest version
### Install Lightning
If you don't already have it installed, please install latest version
### Cloning the test repository with Git
After you have installed [Git] you will need to clone the project to your hard drive. From your workspace directory run this command which will copy (clone) the project to your hard drive
git clone --recursive git://
### Installing developement tools
You will need to install Dom Inspector, Javascript Debugger and some other development tools. Fortunately `Thunderbird addons` makes it easy to install all of these:
Now using bash we'll compile the addon we need (which are written in wiki)
cd ./exchangecalendar_master; chmod +x ./; ./;
Now you can install the Exchange EWS Provider addon
Writing Code
If you want to get involved and add more code, then there's just a few things
we'd like to ask you to do:
1. Use the similar code format for all new developement and window objects
2. Follow mozilla's simple [Coding Style Guide][Coding Style Guide] recommendations
3. Fork this project with your own GitHub account
4. Make sure all tests are passing and submit a pull request with your changes
[Coding Style Guide]:
This software is licensed under the [GNU GPL] Version 3
Readme template file courtesy: [mozwebqa-test-templates][mozwebqa-test-templates]
content exchangecalendar chrome/content/
skin exchangecalendar fugue chrome/skins/fugue/
skin exchangecalendar fugue chrome/skins/unix/
skin exchangecalendar fugue chrome/skins/win/ os=WINNT
skin exchangecalendar fugue chrome/skins/winaero/ os=WINNT osversion>=6
skin exchangecalendar fugue chrome/skins/mac/ os=Darwin
skin exchangecalendar-common fugue chrome/skins/common/
resource exchangecalendar components/
resource interfaces interfaces/
......@@ -21,14 +25,19 @@ overlay chrome://messenger/content/preferences/preferences.xul chrome://exchang
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/otherPreferences.xul
overlay chrome://calendar/content/calendar-task-view.xul chrome://exchangecalendar/content/calendar-task-view.xul
overlay chrome://communicator/content/pref/preferences.xul chrome://exchangecalendar/content/suite-overlay-preferences.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
overlay chrome://communicator/content/pref/preferences.xul chrome://exchangecalendar/content/extra-suite-preferences.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
overlay chrome://calendar/content/calendar-common-sets.xul chrome://exchangecalendar/content/calendar-common-sets.xul
overlay chrome://calendar/content/calendar-event-dialog-attendees.xul chrome://exchangecalendar/content/calendar-event-dialog-attendees.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/OutOfOfficeMenu.xul
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://exchangecalendar/content/addressingWidgetOverlay.xul
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/extra-priority-preferences.xul
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/timezonePreference.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/lightningtimezoneOverlay.xul
overlay chrome://messenger/content/preferences/preferences.xul chrome://exchangecalendar/content/extra-messenger-preferences.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/priority-display.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/invite-style.xul
overlay chrome://messenger/content/folderProps.xul chrome://exchangecalendar/content/folderPropsOverlay.xul
overlay chrome://messenger/content/messenger.xul chrome://exchangecalendar/content/rtews-overlay.xul
locale exchangecalendar nl locale/exchangecalendar/nl/
locale exchangecalendar en-US locale/exchangecalendar/en-US/
......@@ -21,7 +21,7 @@
<!DOCTYPE overlay >
<?xml-stylesheet href="chrome://exchangecalendar/content/addressingWidgetOverlay.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/addressingWidgetOverlay.css"?>
<overlay id="exchangeAddressingWidgetOverlay"
......@@ -160,9 +160,9 @@ exchAttachments.prototype = {
this.globalFunctions.LOG(" == extension:"+extension);
if (ext2file[extension]) {
item.setAttribute("image", "chrome://exchangecalendar/skin/" + ext2file[extension]);
item.setAttribute("image", "chrome://exchangecalendar-common/skin/images/" + ext2file[extension]);
} else {
item.setAttribute("image", "chrome://exchangecalendar/skin/document--exclamation.png");
item.setAttribute("image", "chrome://exchangecalendar-common/skin/images/document--exclamation.png");
// full attachment object is stored here
......@@ -251,8 +251,10 @@ exchAttachments.prototype = {
this._document.getElementById("button-url").hidden = true;
this._document.getElementById("event-toolbar").setAttribute("currentset", "button-save,button-attendees,button-privacy,button-url,exchWebService-add-attachment-button,button-delete");
this._document.getElementById("exchWebService-add-attachment-button").hidden = false;
this._document.getElementById("options-attachments-menuitem").setAttribute("label", this._document.getElementById("exchWebService-add-attachment-button").getAttribute("label"));
this._document.getElementById("options-attachments-menuitem").setAttribute("command", "exchWebService_addAttachmentDialog");
catch (ex) {this.globalFunctions.LOG(" -- Could not add exchange attachment buttons:"+ex.toString());}
......@@ -39,7 +39,7 @@
<?xml-stylesheet href="chrome://exchangecalendar/content/attachments-view.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/attachments-view.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/calendar-event-dialog.css"?>
......@@ -186,38 +186,38 @@ exchWebService_browseTreeView.prototype = {
if ( == "exchWebService_foldername") {
switch (this.folders[idx].folderClass) {
case "IPF.Appointment":
return "chrome://exchangecalendar/skin/calendar-month.png";
return "chrome://exchangecalendar-common/skin/images/calendar-month.png";
case "IPF.Note":
return "chrome://exchangecalendar/skin/mail.png";
return "chrome://exchangecalendar-common/skin/images/mail.png";
case "IPF.Contact":
return "chrome://exchangecalendar/skin/address-book.png";
return "chrome://exchangecalendar-common/skin/images/address-book.png";
case "IPF.Configuration":
return "chrome://exchangecalendar/skin/wrench-screwdriver.png";
return "chrome://exchangecalendar-common/skin/images/wrench-screwdriver.png";
case "IPF.Note.OutlookHomepage":
case "IPF.Note.SocialConnector.FeedItems":
return "chrome://exchangecalendar/skin/feed.png";
return "chrome://exchangecalendar-common/skin/images/feed.png";
case "IPF.Task":
return "chrome://exchangecalendar/skin/task.png";
return "chrome://exchangecalendar-common/skin/images/task.png";
case "IPF.StickyNote":
return "chrome://exchangecalendar/skin/sticky-notes.png";
return "chrome://exchangecalendar-common/skin/images/sticky-notes.png";
case "IPF.Journal":
return "chrome://exchangecalendar/skin/blog.png";
return "chrome://exchangecalendar-common/skin/images/blog.png";
if (this.folders[idx].isContainerOpen) {
return "chrome://exchangecalendar/skin/folder-open.png";
return "chrome://exchangecalendar-common/skin/images/folder-open.png";
return "chrome://exchangecalendar/skin/folder.png";
return "chrome://exchangecalendar-common/skin/images/folder.png";
......@@ -38,8 +38,8 @@
* ***** BEGIN LICENSE BLOCK *****/
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://exchangecalendar/content/browseFolder.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/browseFolder.css"?>
<!DOCTYPE dialog [
<!ENTITY % dtd1 SYSTEM "chrome://exchangecalendar/locale/browseFolder.dtd" > %dtd1;
......@@ -46,7 +46,7 @@
<?xml-stylesheet href="chrome://exchangecalendar/content/preferences.css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/preferences.css"?>
<overlay id="exchangeWebService_cache_preferences_overlay"
......@@ -38,7 +38,7 @@
* ***** BEGIN LICENSE BLOCK *****/
<?xml-stylesheet href="chrome://exchangecalendar/skin/calendar-calendars-list.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/calendar-calendars-list.css"?>
<!DOCTYPE overlay SYSTEM "chrome://exchangecalendar/locale/calendar-calendars-list.dtd">
......@@ -100,7 +100,7 @@ exchForewardEvent.prototype = {
var title="Forwarding Event";
var msg=aResp;
var image = "chrome://exchangecalendar/skin/notify-icon.png";
var image = "chrome://exchangecalendar-common/skin/images/notify-icon.png";
var win = Components.classes[';1'].
openWindow(null, 'chrome://global/content/alerts/alert.xul',
......@@ -41,10 +41,10 @@
<!ENTITY % eventDialogDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd"> %eventDialogDTD;
<!ENTITY % menuOverlayDTD SYSTEM "chrome://calendar/locale/menuOverlay.dtd" > %menuOverlayDTD;
<overlay id="forwardOnRightClick"
<overlay xmlns="">
<script type="application/javascript" src="chrome://exchangecalendar/content/calendar-common-sets.js" />
<script type="application/javascript" src="chrome://exchangecalendar/content/calendar-common-sets2.js" />
<commandset id="calendar_commands" commandupdater="true"
events="calendar_commands" oncommandupdate="calendarController.updateCommands()">
<command id="calendar_forward_event_command" oncommand="tmpForewardEvent.onForEve()" />
......@@ -60,5 +60,6 @@
<key id="forward-key" modifiers="control" key="f" oncommand="tmpForewardEvent.onForEve();"/>
* This file is part of Ericsson's Ews Provider.
* Ericsson's Ews Provider is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Ericsson's Ews Provider is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Ericsson's Ews Provider. If not, see <>.
var orig_openEventDialog=openEventDialog;
openEventDialog=function(calendarItem, calendar, mode, callback, job, initialDate) {
newOpenEventDialog(calendarItem, calendar, mode, callback, job, initialDate);
function newOpenEventDialog(calendarItem, calendar, mode, callback, job, initialDate) {
let dlg = cal.findItemWindow(calendarItem);
if (dlg) {
// Set up some defaults
mode = mode || "new";
calendar = calendar || getSelectedCalendar();
var calendars = getCalendarManager().getCalendars({});
calendars = calendars.filter(isCalendarWritable);
var isItemSupported;
if (isToDo(calendarItem)) {
isItemSupported = function isTodoSupported(aCalendar) {
return (aCalendar.getProperty("capabilities.tasks.supported") !== false);
} else if (isEvent(calendarItem)) {
isItemSupported = function isEventSupported(aCalendar) {
return (aCalendar.getProperty("") !== false);
// Filter out calendars that don't support the given calendar item
calendars = calendars.filter(isItemSupported);
// Filter out calendar/items that we cannot write to/modify
if (mode == "new") {
calendars = calendars.filter(userCanAddItemsToCalendar);
} else { /* modify */
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
* add items to the current one.
return (((calendarItem.calendar != aCalendar)
&& userCanDeleteItemsFromCalendar(calendarItem.calendar)
&& userCanAddItemsToCalendar(aCalendar))
|| ((calendarItem.calendar == aCalendar)
&& userCanModifyItem(calendarItem)));
calendars = calendars.filter(calendarCanModifyItems);
if (mode == "new"
&& (!isCalendarWritable(calendar)
|| !userCanAddItemsToCalendar(calendar)
|| !isItemSupported(calendar))) {
if (calendars.length < 1) {
// There are no writable calendars or no calendar supports the given
// item. Don't show the dialog.
} else {
// Pick the first calendar that supports the item and is writable
calendar = calendars[0];
if (calendarItem) {
// XXX The dialog currently uses the items calendar as a first
// choice. Since we are shortly before a release to keep
// regression risk low, explicitly set the item's calendar here.
calendarItem.calendar = calendars[0];
// Setup the window arguments
var args = new Object();
args.calendarEvent = calendarItem;
args.calendar = calendar;
args.mode = mode;
args.onOk = callback;
args.job = job;
args.initialStartDateValue = (initialDate || getDefaultStartDate());
// this will be called if file->new has been selected from within the dialog
args.onNewEvent = function(calendar) {
createEventWithDialog(calendar, null, null);
args.onNewTodo = function(calendar) {
// the dialog will reset this to auto when it is done loading.
// ask the provide if this item is an invitation. if this is the case
// we'll open the summary dialog since the user is not allowed to change
// the details of the item.
let wrappedCalendar = cal.wrapInstance(calendar, Components.interfaces.calISchedulingSupport);
let isInvitation = wrappedCalendar && wrappedCalendar.isInvitation(calendarItem);
// open the dialog modeless
let url;
if (isCalendarWritable(calendar)
&& (mode == "new"
|| (mode == "modify" && !isInvitation && userCanModifyItem((calendarItem))))) {
url = "chrome://calendar/content/calendar-event-dialog.xul";
} else {
url = "chrome://calendar/content/calendar-summary-dialog.xul";
if( calendarItem.itemClass == "IPM.Note" ) url = "chrome://exchangecalendar/content/calendar-event-dialog2.xul";
// reminder: event dialog should not be modal (cf bug 122671)
var features;
// keyword "dependent" should not be used (cf bug 752206)
if (Services.appinfo.OS == "WINNT") {
features = "chrome,titlebar,resizable";
} else if (Services.appinfo.OS == "Darwin") {
features = "chrome,titlebar,resizable,minimizable=no";
} else {
// All other targets, mostly Linux flavors using gnome.
features = "chrome,titlebar,resizable,minimizable=no,dialog=no";
openDialog(url, "_blank", features, args);
/* ***** BEGIN LICENSE BLOCK *****
* Version: GPL 3.0
* The contents of this file are subject to the General Public License
* 3.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
* -- Exchange 2007/2010 Calendar and Tasks Provider.
* -- For Thunderbird with the Lightning add-on.
* This work is a combination of the Storage calendar, part of the default Lightning add-on, and
* the "Exchange Data Provider for Lightning" add-on currently, october 2011, maintained by Simon Schubert.
* Primarily made because the "Exchange Data Provider for Lightning" add-on is a continuation
* of old code and this one is build up from the ground. It still uses some parts from the
* "Exchange Data Provider for Lightning" project.
* Author: Deepak Kumar
* email:
* This code uses parts of the Microsoft Exchange Calendar Provider code on which the
* "Exchange Data Provider for Lightning" was based.
* The Initial Developer of the Microsoft Exchange Calendar Provider Code is
* Andrea Bittau <>, University College London
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
* ***** BEGIN LICENSE BLOCK *****/
@import url(chrome://global/skin/);
attendees-list {
-moz-binding: url(chrome://exchangecalendar/content/calendar-event-dialog-attendees.xml#attendees-list);
-moz-user-focus: normal;
......@@ -36,7 +36,7 @@
* ***** BEGIN LICENSE BLOCK *****/
<?xml-stylesheet href="chrome://exchangecalendar/content/calendar-event-dialog-attendees.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/calendar-event-dialog-attendees.css"?>
<overlay id="forwardOnRightClick"
......@@ -78,7 +78,7 @@ dump(" WHAT is this:"+this._argument.calendar.type+"\n");
let listbox = this._document.getElementById("reminder-listbox");
let reminder = cal.createAlarm();
let alarmlen = getPrefSafe("calendar.alarms." + itemType + "alarmlen", 15);
let alarmlen = Preferences.get("calendar.alarms." + itemType + "alarmlen", 15);
// Default is an absolute DISPLAY alarm, |alarmlen| minutes before the event.
// If DISPLAY is not supported by the provider, then pick the provider's
......@@ -110,7 +110,7 @@ dump(" WHAT is this:"+this._argument.calendar.type+"\n");
else {
if ((this._document.getElementById("reminder-listbox").itemCount == 0) || (this._argument.calendar.type != "exchangecalendar")) {
......@@ -32,11 +32,11 @@
* ***** BEGIN LICENSE BLOCK *****/
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?>
<?xml-stylesheet href="chrome://exchangecalendar/content/itemBodyEditor.css" type="text/css"?>
<?xml-stylesheet href="chrome://exchangecalendar/content/exchWebServiceEditor.css" type="text/css"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/xul.css"?>
<?xml-stylesheet type="text/css" href="chrome://messenger/skin/messengercompose/messengercompose.css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/itemBodyEditor.css"?>
<?xml-stylesheet type="text/css" href="chrome://exchangecalendar/skin/exchWebServiceEditor.css"?>
<!DOCTYPE dialog [
<!ENTITY % eventDialogDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd">
This diff is collapsed.
......@@ -50,8 +50,11 @@ exchChangeCalendarProperties.prototype = {