2012-01-12 21:01:34 +01:00
|
|
|
/*
|
|
|
|
Copyright (C) 2012 Inverse inc.
|
|
|
|
|
|
|
|
This file is part of SOGo.
|
|
|
|
|
|
|
|
SOGo is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License as published by the
|
|
|
|
Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
later version.
|
|
|
|
|
|
|
|
SOGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with SOGo; see the file COPYING. If not, write to the
|
|
|
|
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/NSCalendarDate.h>
|
|
|
|
#import <Foundation/NSTimeZone.h>
|
|
|
|
|
|
|
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
|
|
|
#import <NGExtensions/NSObject+Logs.h>
|
|
|
|
|
|
|
|
#import <SOGo/NSDictionary+Utilities.h>
|
|
|
|
#import <SOGo/NSObject+Utilities.h>
|
|
|
|
#import <SOGo/NSString+Utilities.h>
|
|
|
|
|
|
|
|
#import "MSExchangeFreeBusySOAPRequest.h"
|
|
|
|
|
|
|
|
@implementation MSExchangeFreeBusySOAPRequest
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
{
|
|
|
|
if ((self = [super init]))
|
|
|
|
{
|
|
|
|
address = nil;
|
|
|
|
timeZone = [NSTimeZone timeZoneWithAbbreviation: @"GMT"];
|
|
|
|
[timeZone retain];
|
|
|
|
startDate = nil;
|
|
|
|
endDate = nil;
|
|
|
|
interval = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[address release];
|
|
|
|
[timeZone release];
|
|
|
|
[startDate release];
|
|
|
|
[endDate release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setAddress: (NSString *) newAddress
|
|
|
|
from: (NSCalendarDate *) newStartDate
|
|
|
|
to: (NSCalendarDate *) newEndDate
|
|
|
|
{
|
|
|
|
ASSIGN(address, newAddress);
|
2015-04-02 17:53:03 +02:00
|
|
|
|
|
|
|
startDate = [NSCalendarDate dateWithYear: [newStartDate yearOfCommonEra]
|
|
|
|
month: [newStartDate monthOfYear]
|
|
|
|
day: [newStartDate dayOfMonth]
|
|
|
|
hour: [newStartDate hourOfDay]
|
|
|
|
minute: [newStartDate minuteOfHour]
|
|
|
|
second: [newStartDate secondOfMinute]
|
|
|
|
timeZone: [newStartDate timeZone]];
|
|
|
|
endDate = [NSCalendarDate dateWithYear: [newEndDate yearOfCommonEra]
|
|
|
|
month: [newEndDate monthOfYear]
|
|
|
|
day: [newEndDate dayOfMonth]
|
|
|
|
hour: [newEndDate hourOfDay]
|
|
|
|
minute: [newEndDate minuteOfHour]
|
|
|
|
second: [newEndDate secondOfMinute]
|
|
|
|
timeZone: [newEndDate timeZone]];
|
2012-01-12 21:01:34 +01:00
|
|
|
|
|
|
|
[startDate setTimeZone: timeZone];
|
|
|
|
[endDate setTimeZone: timeZone];
|
2015-04-02 17:53:03 +02:00
|
|
|
|
|
|
|
[startDate retain];
|
|
|
|
[endDate retain];
|
2012-01-12 21:01:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) serverVersion
|
|
|
|
{
|
|
|
|
return @"Exchange2007_SP1";
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) address
|
|
|
|
{
|
|
|
|
return address;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) startTime
|
|
|
|
{
|
|
|
|
return [startDate descriptionWithCalendarFormat: @"%Y-%m-%dT%H:%M:%S"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) endTime
|
|
|
|
{
|
|
|
|
return [endDate descriptionWithCalendarFormat: @"%Y-%m-%dT%H:%M:%S"];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) interval
|
|
|
|
{
|
|
|
|
return [NSString stringWithFormat: @"%i", interval];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|