mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Caldav: force context Timezone on Exchange 2010
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1914 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
41fe2465ad
commit
268a713446
@ -43,6 +43,7 @@ import java.util.zip.GZIPInputStream;
|
||||
/**
|
||||
* EWS SOAP method.
|
||||
*/
|
||||
@SuppressWarnings("Since15")
|
||||
public abstract class EWSMethod extends PostMethod {
|
||||
protected static final Logger LOGGER = Logger.getLogger(EWSMethod.class);
|
||||
|
||||
@ -83,6 +84,7 @@ public abstract class EWSMethod extends PostMethod {
|
||||
protected SearchExpression searchExpression;
|
||||
|
||||
protected String serverVersion;
|
||||
protected String timezoneContext;
|
||||
|
||||
/**
|
||||
* Build EWS method
|
||||
@ -320,11 +322,18 @@ public abstract class EWSMethod extends PostMethod {
|
||||
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" " +
|
||||
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\">" +
|
||||
"");
|
||||
writer.write("<soap:Header>");
|
||||
if (serverVersion != null) {
|
||||
writer.write("<soap:Header><t:RequestServerVersion Version=\"");
|
||||
writer.write("<t:RequestServerVersion Version=\"");
|
||||
writer.write(serverVersion);
|
||||
writer.write("\"/></soap:Header>");
|
||||
writer.write("\"/>");
|
||||
}
|
||||
if (timezoneContext != null) {
|
||||
writer.write("<t:TimeZoneContext><t:TimeZoneDefinition Id=\"");
|
||||
writer.write(timezoneContext);
|
||||
writer.write("\"/></t:TimeZoneContext>");
|
||||
}
|
||||
writer.write("</soap:Header>");
|
||||
|
||||
writer.write("<soap:Body>");
|
||||
writer.write("<m:");
|
||||
@ -426,6 +435,15 @@ public abstract class EWSMethod extends PostMethod {
|
||||
this.serverVersion = serverVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Exchange timezone context
|
||||
*
|
||||
* @param timezoneContext user timezone context
|
||||
*/
|
||||
public void setTimezoneContext(String timezoneContext) {
|
||||
this.timezoneContext = timezoneContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meeting attendee object
|
||||
*/
|
||||
|
@ -1424,6 +1424,10 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
|
||||
newItem.setFieldUpdates(updates);
|
||||
createOrUpdateItemMethod = new CreateItemMethod(MessageDisposition.SaveOnly, SendMeetingInvitations.SendToNone, getFolderId(folderPath), newItem);
|
||||
// force context Timezone on Exchange 2010
|
||||
if ("Exchange2010_SP1".equals(serverVersion) || "Exchange2010".equals(serverVersion)) {
|
||||
createOrUpdateItemMethod.setTimezoneContext(EwsExchangeSession.this.getVTimezone().getPropertyValue("TZID"));
|
||||
}
|
||||
//}
|
||||
}
|
||||
executeMethod(createOrUpdateItemMethod);
|
||||
|
Loading…
x
Reference in New Issue
Block a user