+2004-08-27 Helge Hess <helge.hess@skyrix.com>
+
+ * started implementation of contact folders (v0.9.1)
+
2004-08-26 Marcus Mueller <znek@mulle-kybernetik.com>
* Product.m: typo in comment fixed
+ (NSString *)globallyUniqueObjectId;
-/* selection */
-
-- (NSArray *)contactUIDs;
-
/* fetching */
-- (NSArray *)fetchCoreInfosFrom:(NSCalendarDate *)_startDate
- to:(NSCalendarDate *)_endDate;
-
-- (NSArray *)fetchCoreInfosFromFolder:(OCSFolder *)_folder
- from:(NSCalendarDate *)_startDate
- to:(NSCalendarDate *)_endDate;
-
-/* URL generation */
-
-- (NSString *)baseURLForContactWithUID:(NSString *)_uid inContext:(id)_ctx;
-
-/* folder management */
-
-- (id)lookupHomeFolderForUID:(NSString *)_uid inContext:(id)_ctx;
-
-- (NSArray *)lookupContactFoldersForUIDs:(NSArray *)_uids inContext:(id)_ctx;
+- (NSArray *)fetchCoreInfos;
@end
@implementation SOGoContactFolder
-static BOOL debugOn = NO;
-static NSTimeZone *MET = nil;
-
-+ (void)initialize {
- if (MET == nil) MET = [[NSTimeZone timeZoneWithAbbreviation:@"MET"] retain];
-}
+static BOOL debugOn = YES;
+ (NSString *)globallyUniqueObjectId {
/*
[super dealloc];
}
-/* selection */
-
-- (NSArray *)contactUIDs {
- NSString *s;
-
- s = [[self container] nameInContainer];
- return [s isNotNull] ? [NSArray arrayWithObjects:&s count:1] : nil;
-}
-
/* name lookup */
- (BOOL)isValidContactName:(NSString *)_key {
/* fetching */
-- (NSMutableDictionary *)fixupRecord:(NSDictionary *)_record {
- NSMutableDictionary *md;
- id tmp;
-
- md = [[_record mutableCopy] autorelease];
-#warning !! IMPLEMENT ME!
- return md;
-}
-
- (NSArray *)fixupRecords:(NSArray *)_records {
- NSMutableArray *ma;
- unsigned i, count;
-
- if (_records == nil) return nil;
- if ((count = [_records count]) == 0)
- return _records;
-
- ma = [NSMutableArray arrayWithCapacity:count];
- for (i = 0; i < count; i++) {
- id row;
-
- row = [self fixupRecord:[_records objectAtIndex:i]];
- if (row) [ma addObject:row];
- }
- return ma;
-}
-
-- (NSArray *)fetchCoreInfosFromFolder:(OCSFolder *)_folder
- from:(NSCalendarDate *)_startDate
- to:(NSCalendarDate *)_endDate
-{
-#warning !! IMPLEMENT ME!
- return nil;
-}
-
-- (NSArray *)fetchCoreInfosFrom:(NSCalendarDate *)_startDate
- to:(NSCalendarDate *)_endDate
-{
- /* this is the primary API */
- OCSFolder *folder;
-
- if ((folder = [self ocsFolder]) == nil) {
- [self logWithFormat:@"ERROR(%s): missing folder for fetch!",
- __PRETTY_FUNCTION__];
- return nil;
- }
- return [self fetchCoreInfosFromFolder:folder from:_startDate to:_endDate];
-}
-
-/* URL generation */
-
-- (NSString *)baseURLForContactWithUID:(NSString *)_uid inContext:(id)_ctx {
- NSString *url;
-
- if ([_uid length] == 0)
- return nil;
-
- url = [self baseURLInContext:_ctx];
- if (![url hasSuffix:@"/"])
- url = [url stringByAppendingString:@"/"];
- return [url stringByAppendingString:_uid];
+ return _records;
}
-/* folder management */
-
-- (id)lookupHomeFolderForUID:(NSString *)_uid inContext:(id)_ctx {
- // TODO: DUP to SOGoGroupFolder
- NSException *error = nil;
- NSArray *path;
- id ctx, result;
-
- if (![_uid isNotNull])
+- (NSArray *)fetchCoreInfos {
+ NSArray *fields, *records;
+
+ fields = [NSArray arrayWithObjects:
+ @"c_name",
+ @"sn", @"givenname", @"l",
+ @"mail", @"telephonenumber",
+ nil];
+ records = [[self ocsFolder] fetchFields:fields matchingQualifier:nil];
+ if (records == nil) {
+ [self logWithFormat:@"ERROR(%s): fetch failed!", __PRETTY_FUNCTION__];
return nil;
-
- if (_ctx == nil) _ctx = [[WOApplication application] context];
-
- /* create subcontext, so that we don't destroy our environment */
-
- if ((ctx = [_ctx createSubContext]) == nil) {
- [self logWithFormat:@"ERROR: could not create SOPE subcontext!"];
- return nil;
- }
-
- /* build path */
-
- path = _uid != nil ? [NSArray arrayWithObjects:&_uid count:1] : nil;
-
- /* traverse path */
-
- result = [[ctx application] traversePathArray:path inContext:ctx
- error:&error acquire:NO];
- if (error != nil) {
- [self logWithFormat:@"ERROR: folder lookup failed (uid=%@): %@",
- _uid, error];
- return nil;
- }
-
- [self debugWithFormat:@"Note: got folder for uid %@ path %@: %@",
- _uid, [path componentsJoinedByString:@"=>"], result];
- return result;
-}
-
-- (NSArray *)lookupContactFoldersForUIDs:(NSArray *)_uids inContext:(id)_ctx {
- /* Note: can return NSNull objects in the array! */
- NSMutableArray *folders;
- NSEnumerator *e;
- NSString *uid;
-
- if ([_uids count] == 0) return nil;
- folders = [NSMutableArray arrayWithCapacity:16];
- e = [_uids objectEnumerator];
- while ((uid = [e nextObject])) {
- id folder;
-
- folder = [self lookupHomeFolderForUID:uid inContext:nil];
- if ([folder isNotNull]) {
- folder = [folder lookupName:@"Contacts" inContext:nil acquire:NO];
- if ([folder isKindOfClass:[NSException class]])
- folder = nil;
- }
- if (![folder isNotNull])
- [self logWithFormat:@"Note: did not find folder for uid: '%@'", uid];
-
- /* Note: intentionally add 'null' folders to allow a mapping */
- [folders addObject:folder ? folder : [NSNull null]];
}
- return folders;
+ records = [self fixupRecords:records];
+ if (debugOn)
+ [self logWithFormat:@"fetched %i records: %@", [records count], records];
+ return records;
}
/* GET */
- (id)GETAction:(WOContext *)_ctx {
// TODO: I guess this should really be done by SOPE (redirect to
// default method)
+ WOResponse *r;
NSString *uri;
uri = [[_ctx request] uri];
if (![uri hasSuffix:@"/"]) uri = [uri stringByAppendingString:@"/"];
uri = [uri stringByAppendingString:@"view"];
- return [self redirectToLocation:uri];
+ r = [_ctx response];
+ [r setStatus:302 /* moved */];
+ [r setHeader:uri forKey:@"location"];
+ return r;
}
@end /* SOGoContactFolder */
/* accessors */
+/* GET */
+
+- (id)GETAction:(WOContext *)_ctx {
+ // TODO: I guess this should really be done by SOPE (redirect to
+ // default method)
+ WOResponse *r;
+ NSString *uri;
+
+ uri = [[_ctx request] uri];
+ if (![uri hasSuffix:@"/"]) uri = [uri stringByAppendingString:@"/"];
+ uri = [uri stringByAppendingString:@"view"];
+
+ r = [_ctx response];
+ [r setStatus:302 /* moved */];
+ [r setHeader:uri forKey:@"location"];
+ return r;
+}
+
@end /* SOGoContactObject */
# $Id$
-SUBMINOR_VERSION:=0
+SUBMINOR_VERSION:=1
2004-08-27 Helge Hess <helge.hess@skyrix.com>
+ * uix.css: make 'defaultfont' a generic class
+
+ * UIxPageFrame.wox: added top-level menu with links for Calendar and
+ Contacts (v0.9.18)
+
* removed old components (UIxAppFrame, Header and Navigation) (v0.9.17)
2004-08-24 Maxime Wacker <mwacker@linagora.com>
- (NSString *)calendarRootURL {
return [[self userRootURL] stringByAppendingString:@"Calendar/"];
}
+- (NSString *)contactsRootURL {
+ return [[self userRootURL] stringByAppendingString:@"Contacts/"];
+}
@end /* UIxPageFrame */
<link href="mailto:hh@skyrix.com" rev="made"/>
</head>
<body>
+ <div style="padding: 5px;">
+ <a var:href="calendarRootURL">Calendar</a> |
+ <a var:href="contactsRootURL">Addressbook</a>
+ </div>
+
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr>
+ <td class="linecolor">
+ <img rsrc:src="line_left.gif"/>
+ </td>
+ <td class="linecolor" width="100%">
+ <img rsrc:src="line_stretch.gif"/>
+ </td>
+ <td class="linecolor">
+ <img rsrc:src="line_right.gif"/>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3"/>
+ </tr>
+ </table>
<table cellpadding="5" cellspacing="0" border="0" width="100%">
<tr>
<td colspan="2">
# $Id$
-SUBMINOR_VERSION:=17
+SUBMINOR_VERSION:=18
background-color: #06348B;
}
-font.defaultfont {
+.defaultfont {
text-decoration: none;
font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
font-size: 8pt;
+2004-08-27 Helge Hess <helge.hess@skyrix.com>
+
+ * removed GET from product.plist, the SoObject directly implements GET
+ now and redirects to the view method (v0.9.3)
+
2004-08-26 Helge Hess <helge.hess@skyrix.com>
* product.plist: more fixes to product.plist (v0.9.2)
className="UIxPageFrame"
title="name"
>
+ <style>
+ table.contacttableview {
+ text-decoration: none;
+ font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+ font-size: 9pt;
+ color: #000000;
+ }
+ table.contacttableview th {
+ text-align: left;
+ }
+ </style>
+ <table id="skywintable"
+ class="wintable"
+ cellspacing="0"
+ cellpadding="5"
+ width="100%"
+ >
+ <tr>
+ <td class="wintitle">
+ <table cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td width="5"/>
+ <td class="wintitle">
+ <!-- localize me -->
+ <span class="window_label">Addressbook</span>
+ </td>
+ <td width="36" align="right" valign="center">
+ <var:component className="UIxWinClose"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td id="skywinbodycell" class="wincontent">
+ <table border="0" width="100%" cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <table border="0" cellpadding="4" width="100%" cellspacing="2">
+ <tr>
+ <td align="right" bgcolor="#e8e8e0">
+ <table border="0" cellpadding="0" cellspacing="1">
+ <tr>
+ <td class="button_auto_env"
+ nowrap="true"
+ valign="middle"
+ align="center"
+ >
+ <a class="button_auto"
+ href="new"
+ var:queryDictionary="queryParameters"
+ ><var:string label:value="new"/></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <!-- the content -->
+ <table border="0" width="100%" class="contacttableview">
+ <tr>
+ <!-- localize -->
+ <th>Lastname</th>
+ <th>Firstname</th>
+ <th>Email</th>
+ <th>Phone</th>
+ <th>Location</th>
+ </tr>
+ <var:foreach list="clientObject.fetchCoreInfos"
+ item="contact">
+ <tr>
+ <td>
+ <a var:href="contact.cName"
+ ><var:string value="contact.sn" /></a>
+ </td>
+ <td><var:string value="contact.givenname" /></td>
+ <td><var:string value="contact.mail" /></td>
+ <td><var:string value="contact.telephonenumber" /></td>
+ <td><var:string value="contact.l" /></td>
+ </tr>
+ </var:foreach>
+ </table>
+ </td>
+ </tr>
+
+ <tr bgcolor="#F5F5E9">
+ <td align="left" width="10">
+ <var:entity const:name="nbsp"/>
+ </td>
+ <td align="right">
+ <img border="0"
+ alt=""
+ src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif"
+ />
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" bgcolor="#F5F5E9">
+ <table border="0" width="100%" cellpadding="10" cellspacing="0">
+ <tr/>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
<var:if condition="isUIxDebugEnabled">
<hr />
- clientObject: <var:string value="clientObject" />
+ <small>clientObject: <var:string value="clientObject" /></small>
</var:if>
</var:component>
\ No newline at end of file
# $Id$
-SUBMINOR_VERSION:=2
+SUBMINOR_VERSION:=3
protectedBy = "View";
pageName = "UIxContactsListView";
};
- GET = { /* hack to make it work as the default method */
- protectedBy = "View";
- pageName = "UIxContactsListView";
- };
};
};
+2004-08-27 Helge Hess <helge.hess@skyrix.com>
+
+ * UIxCalView.m: minor code cleanups (v0.9.72)
+
2004-08-25 Marcus Mueller <znek@mulle-kybernetik.com>
* GNUmakefile.preamble: removed NGScripting from dependencies - it's no
}
- (void)dealloc {
- [self->appointments release];
- [self->allDayApts release];
- [self->appointment release];
- [self->currentDay release];
- [self->aptFormatter release];
+ [self->appointments release];
+ [self->allDayApts release];
+ [self->appointment release];
+ [self->currentDay release];
+ [self->aptFormatter release];
[self->aptTooltipFormatter release];
[super dealloc];
}
}
- (NSDictionary *)aptTypeDict {
- return nil;
+ return nil;
}
-
- (NSString *)aptTypeLabel {
- return @"aptLabel";
+ return @"aptLabel";
}
-
- (NSString *)aptTypeIcon {
- return @"";
+ return @"";
}
- (SOGoAptFormatter *)aptFormatter {
- if(self->aptFormatter)
- return self->aptFormatter;
- self->aptFormatter = [[SOGoAptFormatter alloc]
- initWithDisplayTimeZone:[self viewTimeZone]];
- [self->aptFormatter setFullDetails];
+ if (self->aptFormatter)
return self->aptFormatter;
+
+ self->aptFormatter = [[SOGoAptFormatter alloc]
+ initWithDisplayTimeZone:[self viewTimeZone]];
+ [self->aptFormatter setFullDetails];
+ return self->aptFormatter;
}
- (SOGoAptFormatter *)aptTooltipFormatter {
- if(self->aptTooltipFormatter)
- return self->aptTooltipFormatter;
- self->aptTooltipFormatter = [[SOGoAptFormatter alloc]
- initWithDisplayTimeZone:[self viewTimeZone]];
- [self->aptTooltipFormatter setTooltip];
+ if (self->aptTooltipFormatter)
return self->aptTooltipFormatter;
+ self->aptTooltipFormatter = [[SOGoAptFormatter alloc]
+ initWithDisplayTimeZone:[self viewTimeZone]];
+ [self->aptTooltipFormatter setTooltip];
+ return self->aptTooltipFormatter;
}
/* TODO: remove this */
- (NSString *)shortTextForApt {
- return [[self aptFormatter] stringForObjectValue:self->appointment];
+ return [[self aptFormatter] stringForObjectValue:self->appointment];
}
- (NSString *)shortTitleForApt {
}
- (NSString *)tooltipForApt {
- return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
+ return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
}
- (BOOL)isMyApt {
- NSString *mailtoChunk;
- NSString *myEmail;
+ NSString *mailtoChunk;
+ NSString *myEmail;
- mailtoChunk = [self->appointment valueForKey:@"partmails"];
- myEmail = [self emailForUser];
- if([mailtoChunk rangeOfString:myEmail].length > 0)
- return YES;
- return NO;
+ mailtoChunk = [self->appointment valueForKey:@"partmails"];
+ myEmail = [self emailForUser];
+ if ([mailtoChunk rangeOfString:myEmail].length > 0)
+ return YES;
+ return NO;
}
- (NSString *)aptStyle {
- if(![self isMyApt])
- return @"apt_other";
- return nil;
+ if (![self isMyApt])
+ return @"apt_other";
+ return nil;
}
- (NSCalendarDate *)referenceDateForFormatter {
}
- (NSCalendarDate *)thisMonth {
- return [self selectedDate];
+ return [self selectedDate];
}
- (NSCalendarDate *)nextMonth {
- NSCalendarDate *date = [self thisMonth];
- return [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth]
- hours:0 minutes:0 seconds:0];
+ NSCalendarDate *date = [self thisMonth];
+
+ return [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth]
+ hours:0 minutes:0 seconds:0];
}
}
- (id)holidayInfo {
- return nil;
+ return nil;
}
- (NSArray *)allDayApts {
- NSArray *apts;
- NSMutableArray *filtered;
- unsigned i, count;
+ NSArray *apts;
+ NSMutableArray *filtered;
+ unsigned i, count;
- if(self->allDayApts)
- return self->allDayApts;
+ if (self->allDayApts)
+ return self->allDayApts;
- apts = [self appointments];
- count = [apts count];
- filtered = [[NSMutableArray alloc] initWithCapacity:3];
- for(i = 0; i < count; i++) {
- id apt;
- NSNumber *bv;
+ apts = [self appointments];
+ count = [apts count];
+ filtered = [[NSMutableArray alloc] initWithCapacity:3];
+ for (i = 0; i < count; i++) {
+ id apt;
+ NSNumber *bv;
- apt = [apts objectAtIndex:i];
+ apt = [apts objectAtIndex:i];
#warning !! check if isAllDay is correct
- bv = [apt valueForKey:@"isAllDay"];
- if([bv boolValue]) {
- [filtered addObject:apt];
- }
- }
+ bv = [apt valueForKey:@"isAllDay"];
+ if ([bv boolValue])
+ [filtered addObject:apt];
+ }
- ASSIGN(self->allDayApts, filtered);
- [filtered release];
- return self->allDayApts;
+ ASSIGN(self->allDayApts, filtered);
+ [filtered release];
+ return self->allDayApts;
}
/* special appointments */
- (BOOL)hasDayInfo {
- return [self hasHoldidayInfo] || [self hasAllDayApts];
+ return [self hasHoldidayInfo] || [self hasAllDayApts];
}
- (BOOL)hasHoldidayInfo {
- return [self holidayInfo] != nil;
+ return [self holidayInfo] != nil;
}
- (BOOL)hasAllDayApts {
- return [[self allDayApts] count] != 0;
+ return [[self allDayApts] count] != 0;
}
}
- (BOOL)shouldHideWeekend {
- return ![self shouldDisplayWeekend];
+ return ![self shouldDisplayWeekend];
}
- (NSString *)resourcePath {
// TODO: broken
+ // TODO: where is this used?
return @"/sogod.woa/WebServerResources/";
}