From: wolfgang Date: Fri, 20 Jul 2007 20:34:34 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1112 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75368350ecd5e90ac7c4912b348d472b2d0eade0;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1112 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index cfc4cf35..b0c5f04e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-07-20 Wolfgang Sourdeau + + * UI/Contacts/UIxContactsListView.m ([UIxContactsListView + -contactInfos]): cache the results to avoid multiple invocations. + + * SoObjects/Contacts/SOGoContactLDAPFolder.m + ([SOGoContactLDAPFolder -toOneRelationshipKeys]): check whether we + really should return something or if we fake to return nil... + 2007-07-13 Wolfgang Sourdeau * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): set diff --git a/SOPE/NGCards/Version b/SOPE/NGCards/Version index dbc6c2d3..d0254180 100644 --- a/SOPE/NGCards/Version +++ b/SOPE/NGCards/Version @@ -1,7 +1,7 @@ # version file MAJOR_VERSION=4 -MINOR_VERSION=5 +MINOR_VERSION=7 SUBMINOR_VERSION:=76 # v4.5.40 requires NGExtensions v4.5.145 diff --git a/Scripts/sogo-init.d-redhat b/Scripts/sogo-init.d-redhat index 3c04063d..ad94d06b 100755 --- a/Scripts/sogo-init.d-redhat +++ b/Scripts/sogo-init.d-redhat @@ -1,10 +1,21 @@ -#!/bin/sh +#!/bin/bash +# +# sogod Scalable OpenGroupware.org (Inverse edition) +# +# chkconfig: - 85 15 +# description: SOGo is a groupware server +# processname: sogod-0.9 +# config: /etc/sysconfig/sogo +# config: /etc/httpd/conf.d/SOGo.conf +# pidfile: /var/run/sogo/sogod.pid PATH=/sbin:/bin:/usr/sbin:/usr/bin +. /etc/rc.d/init.d/functions + DAEMON=/usr/sbin/sogod NAME=sogo -DESC="Scalable OpenGroupware.Org" +DESC="Scalable OpenGroupware.Org (Inverse edition)" PIDFILE=/var/run/sogo/sogod.pid @@ -14,35 +25,36 @@ if [ -f /etc/sysconfig/sogo ]; then . /etc/sysconfig/sogo fi -. /etc/init.d/functions - test -x $DAEMON || exit 0 #set -e case "$1" in start) - echo -n "Starting $DESC: " - daemon $DAEMON + echo -n $"Starting $DESC: " / + daemon --user sogo --pidfile $PIDFILE $DAEMON echo "$NAME." ;; stop) - echo -n "Stopping $DESC: " - killall sogod-0.9 2> /dev/null + echo -n $"Stopping $DESC: " + killproc --pidfile $PIDFILE $DAEMON rm -f $PIDFILE echo "$NAME." ;; restart|force-reload) - echo -n "Restarting $DESC: " - killall sogod-0.9 2> /dev/null + echo -n $"Restarting $DESC: " + killproc --pidfile $PIDFILE $DAEMON rm -f $PIDFILE sleep 1 - daemon $DAEMON + daemon --user sogo --pidfile $PIDFILE $DAEMON echo "$NAME." ;; + status) + status $DAEMON + ;; *) N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac diff --git a/Scripts/sogod-redhat b/Scripts/sogod-redhat index 99584cec..03cb492a 100755 --- a/Scripts/sogod-redhat +++ b/Scripts/sogod-redhat @@ -2,8 +2,7 @@ PIDFILE=/var/run/sogo/sogod.pid -. /usr/lib/GNUstep/System/Library/Makefiles/GNUstep.sh +. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh echo $$ > $PIDFILE -exec $GNUSTEP_LOCAL_ROOT/Tools/sogod-0.9 >& /var/log/sogo/sogod.log - +exec $GNUSTEP_SYSTEM_ROOT/Tools/sogod-0.9 >& /var/log/sogo/sogod.log diff --git a/SoObjects/Contacts/SOGoContactLDAPFolder.h b/SoObjects/Contacts/SOGoContactLDAPFolder.h index da09d382..ad1ceb89 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.h +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.h @@ -34,6 +34,7 @@ NSString *displayName; LDAPSource *ldapSource; NSMutableDictionary *entries; + BOOL ignoreSoObjectHunger; } - (id ) initWithName: (NSString *) newName diff --git a/SoObjects/Contacts/SOGoContactLDAPFolder.m b/SoObjects/Contacts/SOGoContactLDAPFolder.m index 39133639..60e4ee98 100644 --- a/SoObjects/Contacts/SOGoContactLDAPFolder.m +++ b/SoObjects/Contacts/SOGoContactLDAPFolder.m @@ -73,6 +73,7 @@ displayName = nil; entries = nil; ldapSource = nil; + ignoreSoObjectHunger = NO; } return self; @@ -119,7 +120,9 @@ // NSLog (@"looking up name '%@'...", name); /* first check attributes directly bound to the application */ + ignoreSoObjectHunger = YES; obj = [super lookupName: objectName inContext: lookupContext acquire: NO]; + ignoreSoObjectHunger = NO; if (!obj) { ldifEntry = [ldapSource lookupContactEntry: objectName]; @@ -135,7 +138,14 @@ - (NSArray *) toOneRelationshipKeys { - return [ldapSource allEntryIDs]; + NSArray *keys; + + if (ignoreSoObjectHunger) + keys = nil; + else + keys = [ldapSource allEntryIDs]; + + return keys; } - (NSArray *) lookupContactsWithFilter: (NSString *) filter diff --git a/UI/Contacts/UIxContactsListView.h b/UI/Contacts/UIxContactsListView.h index ed952fff..70430674 100644 --- a/UI/Contacts/UIxContactsListView.h +++ b/UI/Contacts/UIxContactsListView.h @@ -33,6 +33,7 @@ { NSDictionary *currentContact; NSString *selectorComponentClass; + NSArray *contactInfos; } @end diff --git a/UI/Contacts/UIxContactsListView.m b/UI/Contacts/UIxContactsListView.m index a68239d2..4803bba0 100644 --- a/UI/Contacts/UIxContactsListView.m +++ b/UI/Contacts/UIxContactsListView.m @@ -26,8 +26,6 @@ #import #import -#import "common.h" - #import "UIxContactsListView.h" @implementation UIxContactsListView @@ -37,11 +35,18 @@ if ((self = [super init])) { selectorComponentClass = nil; + contactInfos = nil; } return self; } +- (void) dealloc +{ + [contactInfos release]; + [super dealloc]; +} + /* accessors */ - (void) setCurrentContact: (NSDictionary *) _contact @@ -118,21 +123,27 @@ NSString *ascending, *searchText, *valueText; NSComparisonResult ordering; - folder = [self clientObject]; - - ascending = [self queryParameterForKey: @"asc"]; - ordering = ((![ascending length] || [ascending boolValue]) - ? NSOrderedAscending : NSOrderedDescending); - - searchText = [self queryParameterForKey: @"search"]; - if ([searchText length] > 0) - valueText = [self queryParameterForKey: @"value"]; - else - valueText = nil; + if (!contactInfos) + { + folder = [self clientObject]; + + ascending = [self queryParameterForKey: @"asc"]; + ordering = ((![ascending length] || [ascending boolValue]) + ? NSOrderedAscending : NSOrderedDescending); + + searchText = [self queryParameterForKey: @"search"]; + if ([searchText length] > 0) + valueText = [self queryParameterForKey: @"value"]; + else + valueText = nil; + + ASSIGN (contactInfos, + [folder lookupContactsWithFilter: valueText + sortBy: [self sortKey] + ordering: ordering]); + } - return [folder lookupContactsWithFilter: valueText - sortBy: [self sortKey] - ordering: ordering]; + return contactInfos; } /* actions */ diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index 2cee81ff..d9638d34 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -52,7 +52,7 @@