2004-09-26 Helge Hess <helge.hess@opengroupware.org>
+ * sogod.m: return 404 for favicon.ico queries (v0.9.13)
+
* fixed title bindings to const: in .wox (should be label:?) (v0.9.12)
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
# $Id$
-SUBMINOR_VERSION:=12
+SUBMINOR_VERSION:=13
- (BOOL)isUserName:(NSString *)_key inContext:(id)_ctx {
if ([_key length] < 1)
return NO;
-
+
if (isdigit([_key characterAtIndex:0]))
return NO;
/*
The problem is, that at this point we still get request for resources,
eg 'favicon.ico'.
- The hack here is to check for a dot in the key, but we should find a way
- to catch that in a more sensible way.
-
- One way to check for a valid key would be to check whether the key is a
- valid hostname, but I would like to avoid that for performance reasons.
Addition: we also get queries for various other methods, like "GET" if
no method was provided in the query path.
*/
+
+ if ([_key isEqualToString:@"favicon.ico"])
+ return nil;
+
if ([self isUserName:_key inContext:_ctx])
return [self lookupUser:_key inContext:_ctx];
mapping email <-> logins
usermanager -> part of SOGoLogic
+Default to enable debugging output in the page:
+ SOGoUIxDebugEnabled YES|NO
// !$*UTF8*$!
{
+ E82F8A4207075D7100CDD2CA = {
+ fRef = E87205F40692E3D00099CBBD;
+ isa = PBXTextBookmark;
+ name = "README: 4";
+ rLen = 0;
+ rLoc = 17;
+ rType = 0;
+ vrLen = 404;
+ vrLoc = 0;
+ };
+ E82F8A4607075D7100CDD2CA = {
+ fRef = E87205F40692E3D00099CBBD;
+ isa = PBXTextBookmark;
+ name = "README: 3";
+ rLen = 0;
+ rLoc = 12;
+ rType = 0;
+ vrLen = 404;
+ vrLoc = 0;
+ };
E87205890692E3B40099CBBD = {
activeBuildStyle = E87205870692E3B40099CBBD;
activeTarget = E8720A7A0692E5010099CBBD;
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
- 294,
+ 273,
20,
- 57,
+ 53,
43,
43,
20,
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 110289844;
+ PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 215,
+ 50,
+ 20,
+ 50,
+ 43,
+ 43,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXTargetDataSource_PrimaryAttribute,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ );
+ };
+ PBXPerProjectTemplateStateSaveDate = 117923177;
PBXPrepackagedSmartGroups_v2 = (
{
PBXTransientLocationAtTop = bottom;
root = "<PROJECT>";
};
},
+ {
+ PBXTransientLocationAtTop = bottom;
+ clz = XDDesignSmartGroup;
+ description = "Displays Xdesign models";
+ globalID = 2E4A936305E6979E00701470;
+ name = Design;
+ preferences = {
+ image = Design;
+ isLeaf = 0;
+ };
+ },
);
PBXWorkspaceContents = (
{
};
RubberWindowFrame = "114 92 779 734 0 0 1280 832 ";
};
- PBXWorkspaceStateSaveDate = 110289844;
+ PBXWorkspaceStateSaveDate = 117923177;
};
perUserProjectItems = {
- E8720A070692E4930099CBBD = E8720A070692E4930099CBBD;
- E8720A090692E4930099CBBD = E8720A090692E4930099CBBD;
- E8720A110692E49A0099CBBD = E8720A110692E49A0099CBBD;
- E8720A130692E49A0099CBBD = E8720A130692E49A0099CBBD;
- E8720A170692E4A20099CBBD = E8720A170692E4A20099CBBD;
- E8720A190692E4A20099CBBD = E8720A190692E4A20099CBBD;
- E8720A1D0692E4A90099CBBD = E8720A1D0692E4A90099CBBD;
- E8720A1F0692E4A90099CBBD = E8720A1F0692E4A90099CBBD;
- E8720A220692E4A90099CBBD = E8720A220692E4A90099CBBD;
- E8720A240692E4A90099CBBD = E8720A240692E4A90099CBBD;
- E8720A300692E4BA0099CBBD = E8720A300692E4BA0099CBBD;
- E8720A320692E4BA0099CBBD = E8720A320692E4BA0099CBBD;
- E8720A360692E4C00099CBBD = E8720A360692E4C00099CBBD;
- E8720A380692E4C00099CBBD = E8720A380692E4C00099CBBD;
- E8720A440692E4CC0099CBBD = E8720A440692E4CC0099CBBD;
- E8720A460692E4CC0099CBBD = E8720A460692E4CC0099CBBD;
- E8720A4E0692E4DB0099CBBD = E8720A4E0692E4DB0099CBBD;
- E8720A500692E4DB0099CBBD = E8720A500692E4DB0099CBBD;
- E8720A5C0692E4E40099CBBD = E8720A5C0692E4E40099CBBD;
- E8720A5E0692E4E40099CBBD = E8720A5E0692E4E40099CBBD;
- E8720A620692E4E70099CBBD = E8720A620692E4E70099CBBD;
- E8720A640692E4E70099CBBD = E8720A640692E4E70099CBBD;
- E8720A700692E4F20099CBBD = E8720A700692E4F20099CBBD;
- E8720A720692E4F20099CBBD = E8720A720692E4F20099CBBD;
- E8720A7E0692E5020099CBBD = E8720A7E0692E5020099CBBD;
- E8720A7F0692E5020099CBBD = E8720A7F0692E5020099CBBD;
- E8720A800692E5020099CBBD = E8720A800692E5020099CBBD;
- E8720A820692E50C0099CBBD = E8720A820692E50C0099CBBD;
+ E82F8A4207075D7100CDD2CA = E82F8A4207075D7100CDD2CA;
+ E82F8A4607075D7100CDD2CA = E82F8A4607075D7100CDD2CA;
+ E8E5318507075AF1002E3166 = E8E5318507075AF1002E3166;
+ E8E5318707075AF1002E3166 = E8E5318707075AF1002E3166;
};
sourceControlManager = E872058A0692E3B40099CBBD;
userBuildSettings = {
};
};
E872058A0692E3B40099CBBD = {
+ fallbackIsa = XCSourceControlManager;
+ isSCMEnabled = 0;
isa = PBXSourceControlManager;
scmConfiguration = {
};
isa = PBXCodeSenseManager;
usesDefaults = 1;
wantsCodeCompletion = 1;
- wantsCodeCompletionAutoPopup = 0;
wantsCodeCompletionAutoSuggestions = 0;
wantsCodeCompletionCaseSensitivity = 1;
+ wantsCodeCompletionListAlways = 1;
wantsCodeCompletionOnlyMatchingItems = 1;
wantsCodeCompletionParametersIncluded = 1;
wantsCodeCompletionPlaceholdersInserted = 1;
wantsCodeCompletionTabCompletes = 1;
wantsIndex = 1;
};
+ E87205F40692E3D00099CBBD = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {470, 448}}";
+ sepNavSelRange = "{12, 0}";
+ sepNavVisRect = "{{0, 0}, {470, 448}}";
+ };
+ };
E872064C0692E3D00099CBBD = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {493, 311}}";
sepNavVisRect = "{{0, 0}, {493, 311}}";
};
};
- E87207D40692E3D20099CBBD = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {493, 311}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRect = "{{0, 0}, {493, 311}}";
- };
- };
- E87207DC0692E3D20099CBBD = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {493, 783}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRect = "{{0, 0}, {493, 311}}";
- };
- };
E87207E70692E3D20099CBBD = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {493, 2799}}";
sepNavVisRect = "{{0, 0}, {493, 311}}";
};
};
- E8720A070692E4930099CBBD = {
- fRef = E872064C0692E3D00099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 136;
- vrLoc = 0;
- };
- E8720A090692E4930099CBBD = {
- fRef = E872064C0692E3D00099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 136;
- vrLoc = 0;
- };
- E8720A110692E49A0099CBBD = {
- fRef = E87208930692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 547;
- vrLoc = 0;
- };
- E8720A130692E49A0099CBBD = {
- fRef = E87208930692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 547;
- vrLoc = 0;
- };
- E8720A170692E4A20099CBBD = {
- fRef = E87208D30692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "NOTES: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 389;
- vrLoc = 0;
- };
- E8720A190692E4A20099CBBD = {
- fRef = E87208D30692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "NOTES: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 389;
- vrLoc = 0;
- };
- E8720A1D0692E4A90099CBBD = {
- fRef = E87208F50692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentFormatter.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 896;
- vrLoc = 0;
- };
- E8720A1F0692E4A90099CBBD = {
- fRef = E87208F50692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentFormatter.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 896;
- vrLoc = 0;
- };
- E8720A220692E4A90099CBBD = {
- fRef = E87208F60692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentFormatter.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 895;
- vrLoc = 0;
- };
- E8720A240692E4A90099CBBD = {
- fRef = E87208F60692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentFormatter.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 895;
- vrLoc = 0;
- };
- E8720A300692E4BA0099CBBD = {
- fRef = E87208F80692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentView.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 440;
- vrLoc = 0;
- };
- E8720A320692E4BA0099CBBD = {
- fRef = E87208F80692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppointmentView.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 440;
- vrLoc = 0;
- };
- E8720A360692E4C00099CBBD = {
- fRef = E87209020692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxCalMonthView.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 437;
- vrLoc = 0;
- };
- E8720A380692E4C00099CBBD = {
- fRef = E87209020692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "UIxCalMonthView.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 437;
- vrLoc = 0;
- };
- E8720A440692E4CC0099CBBD = {
- fRef = E87208900692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "common.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 882;
- vrLoc = 0;
- };
- E8720A460692E4CC0099CBBD = {
- fRef = E87208900692E3D30099CBBD;
- isa = PBXTextBookmark;
- name = "common.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 882;
- vrLoc = 0;
- };
- E8720A4E0692E4DB0099CBBD = {
- fRef = E872074D0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 462;
- vrLoc = 0;
- };
- E8720A500692E4DB0099CBBD = {
- fRef = E872074D0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "GNUmakefile: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 462;
- vrLoc = 0;
- };
- E8720A5C0692E4E40099CBBD = {
- fRef = E87207D40692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppFrame.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 204;
- vrLoc = 0;
- };
- E8720A5E0692E4E40099CBBD = {
- fRef = E87207D40692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "UIxAppFrame.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 204;
- vrLoc = 0;
- };
- E8720A620692E4E70099CBBD = {
- fRef = E87207DC0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "UIxComponent.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 833;
- vrLoc = 0;
- };
- E8720A640692E4E70099CBBD = {
- fRef = E87207DC0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "UIxComponent.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 833;
- vrLoc = 0;
- };
- E8720A700692E4F20099CBBD = {
- fRef = E872074A0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "common.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 877;
- vrLoc = 0;
- };
- E8720A720692E4F20099CBBD = {
- fRef = E872074A0692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "common.h: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 877;
- vrLoc = 0;
- };
E8720A7A0692E5010099CBBD = {
activeExec = 0;
};
- E8720A7E0692E5020099CBBD = {
- fRef = E87207E70692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "zidestoreui.css: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 511;
- vrLoc = 0;
- };
- E8720A7F0692E5020099CBBD = {
+ E8E5318507075AF1002E3166 = {
isa = PBXTargetBookmark;
trg = E8720A7A0692E5010099CBBD;
};
- E8720A800692E5020099CBBD = {
- fRef = E87207E70692E3D20099CBBD;
- isa = PBXTextBookmark;
- name = "zidestoreui.css: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 511;
- vrLoc = 0;
- };
- E8720A820692E50C0099CBBD = {
+ E8E5318707075AF1002E3166 = {
isa = PBXTargetBookmark;
trg = E8720A7A0692E5010099CBBD;
- uiCtxt = {
- TOCViewDetailVisibleRect = "{{0, 160}, {361, 279}}";
- TOCViewExpandedItems = (
- "com.apple.target-editor-pane.settings",
- );
- TOCViewMasterVisibleRect = "{{0, 0}, {140, 279}}";
- TOCViewSelectedItems = (
- "com.apple.target-editor-pane.settings",
- );
- };
};
}
sourceTree = "<group>";
};
E8720A7A0692E5010099CBBD = {
- buildArgumentsString = "$(ACTION)";
+ buildArgumentsString = "$(ACTION) GNUSTEP_SYSTEM_ROOT=$(HOME)/GNUstep";
buildPhases = (
);
buildSettings = {
+2004-09-26 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.5
+
+ * added SOGoMailBaseObject as a base object for the other mailer
+ SoObjects
+
+ * added -imapURL method to the mail SoObjects (the imapURL is used to
+ locate the object in the IMAP4 server, just like in Thunderbird)
+
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
* fixed compilation on MacOSX (v0.9.4)
Mailer_OBJC_FILES += \
Product.m \
\
+ SOGoMailBaseObject.m \
SOGoMailAccounts.m \
SOGoMailAccount.m \
SOGoMailFolder.m \
#ifndef __Mailer_SOGoMailAccount_H__
#define __Mailer_SOGoMailAccount_H__
-#include <SOGo/SOGoObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailBaseObject.h>
/*
SOGoMailAccount
password, etc)
*/
-@class NSString, NSArray, NSCalendarDate, NSException;
-
-@interface SOGoMailAccount : SOGoObject
+@interface SOGoMailAccount : SOGoMailBaseObject
{
}
// $Id: SOGoMailAccount.m 274 2004-08-26 13:10:49Z znek $
#include "SOGoMailAccount.h"
+#include "SOGoMailFolder.h"
#include "common.h"
@implementation SOGoMailAccount
+/* IMAP4 */
+
+- (BOOL)useSSL {
+ return NO;
+}
+
+- (NSURL *)imap4URL {
+ /* imap://agenortest@mail.opengroupware.org/INBOX/withsubdirs/subdir1 */
+ NSString *s;
+ NSRange r;
+
+ if (self->imap4URL != nil)
+ return self->imap4URL;
+
+ s = [self nameInContainer];
+ r = [s rangeOfString:@"@"];
+ if (r.length == 0) {
+ [self logWithFormat:@"ERROR: missing login in account folder name: %@", s];
+ return nil;
+ }
+
+ s = [([self useSSL] ? @"imaps://" : @"imap://") stringByAppendingString:s];
+ s = [s stringByAppendingString:@"/"];
+
+ self->imap4URL = [[NSURL alloc] initWithString:s];
+ return self->imap4URL;
+}
+
+/* name lookup */
+
+- (id)lookupImap4Folder:(NSString *)_key inContext:(id)_ctx {
+ return [[[SOGoMailFolder alloc] initWithName:_key
+ inContainer:self] autorelease];
+}
+
+- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+ id obj;
+
+ /* first check attributes directly bound to the application */
+ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil)
+ return obj;
+
+ if ((obj = [self lookupImap4Folder:_key inContext:_ctx]) != nil)
+ return obj;
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
@end /* SOGoMailAccount */
The SOGoMailAccounts folder contains the mail accounts which are associated
with a user.
-*/
-@class NSString, NSArray, NSCalendarDate, NSException;
+ Note: this is not yet an IMAP4 object. Its a wrapper which contains the root
+ IMAP4 objects.
+*/
@interface SOGoMailAccounts : SOGoObject
{
/* listing the available mailboxes */
- (NSArray *)toManyRelationshipKeys {
- // TODO: hardcoded
+ // TODO: hardcoded, need to implement the Agenor Anais LDAP query?
return [NSArray arrayWithObjects:
- @"mail.opengroupware.org",
+ @"agenortest@mail.opengroupware.org",
nil];
}
--- /dev/null
+/*
+ Copyright (C) 2004 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo 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.
+
+ OGo 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 OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+// $Id$
+
+#ifndef __Mailer_SOGoMailBaseObject_H__
+#define __Mailer_SOGoMailBaseObject_H__
+
+#include <SOGo/SOGoObject.h>
+
+/*
+ SOGoMailBaseObject
+
+ Common base class for mailer SoObjects.
+*/
+
+@class NSURL;
+
+@interface SOGoMailBaseObject : SOGoObject
+{
+ NSURL *imap4URL;
+}
+
+- (id)initWithImap4URL:(NSURL *)_url inContainer:(id)_container;
+
+/* IMAP4 */
+
+- (NSURL *)imap4URL;
+
+@end
+
+#endif /* __Mailer_SOGoMailBaseObject_H__ */
--- /dev/null
+/*
+ Copyright (C) 2004 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo 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.
+
+ OGo 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 OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+// $Id$
+
+#include "SOGoMailBaseObject.h"
+#include "common.h"
+
+@implementation SOGoMailBaseObject
+
+- (id)initWithImap4URL:(NSURL *)_url inContainer:(id)_container {
+ NSString *n;
+
+ n = [[_url path] lastPathComponent];
+ if ((self = [self initWithName:n inContainer:_container])) {
+ self->imap4URL = [_url retain];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [self->imap4URL release];
+ [super dealloc];
+}
+
+/* IMAP4 */
+
+- (NSString *)relativeImap4Name {
+ [self logWithFormat:@"WARNING: subclass should override %@",
+ NSStringFromSelector(_cmd)];
+ return nil;
+}
+- (NSURL *)imap4URL {
+ NSString *sn;
+
+ if (self->imap4URL != nil)
+ return self->imap4URL;
+
+ if ((sn = [self relativeImap4Name]) == nil)
+ return nil;
+
+ if (![[self container] respondsToSelector:_cmd]) {
+ [self logWithFormat:@"WARNING: container does not implement -imap4URL!"];
+ return nil;
+ }
+
+ self->imap4URL = [[NSURL alloc] initWithString:[self nameInContainer]
+ relativeToURL:[[self container] imap4URL]];
+ return self->imap4URL;
+}
+
+@end /* SOGoMailBaseObject */
#ifndef __Mailer_SOGoMailFolder_H__
#define __Mailer_SOGoMailFolder_H__
-#include <SOGo/SOGoObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailBaseObject.h>
/*
SOGoMailFolder
The SOGoMailFolder maps to an IMAP4 folder from NGImap4.
*/
-@class NSString, NSArray, NSCalendarDate, NSException;
-
-@interface SOGoMailFolder : SOGoObject
+@interface SOGoMailFolder : SOGoMailBaseObject
{
}
// $Id$
#include "SOGoMailFolder.h"
+#include "SOGoMailObject.h"
#include "common.h"
@implementation SOGoMailFolder
+/* IMAP4 */
+
+- (NSString *)relativeImap4Name {
+ return [self nameInContainer];
+}
+
+/* name lookup */
+
+- (BOOL)isMessageKey:(NSString *)_key inContext:(id)_ctx {
+ /*
+ Every key starting with a digit is consider an IMAP4 message key. This is
+ not entirely correct since folders could also start with a number.
+
+ If we want to support folders beginning with numbers, we would need to
+ scan the folder list for the _key, which would make everything quite a bit
+ slower.
+ TODO: support this mode using a default.
+ */
+ if ([_key length] == 0)
+ return NO;
+
+ if (isdigit([_key characterAtIndex:0]))
+ return YES;
+
+ return NO;
+}
+
+- (id)lookupImap4Folder:(NSString *)_key inContext:(id)_ctx {
+ // TODO: we might want to check for existence prior controller creation
+ return [[[SOGoMailFolder alloc] initWithName:_key
+ inContainer:self] autorelease];
+}
+- (id)lookupImap4Message:(NSString *)_key inContext:(id)_ctx {
+ // TODO: we might want to check for existence prior controller creation
+ return [[[SOGoMailObject alloc] initWithName:_key
+ inContainer:self] autorelease];
+}
+
+- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
+ id obj;
+
+ /* first check attributes directly bound to the application */
+ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil)
+ return obj;
+
+ obj = [self isMessageKey:_key inContext:_ctx]
+ ? [self lookupImap4Message:_key inContext:_ctx]
+ : [self lookupImap4Folder:_key inContext:_ctx];
+ if (obj != nil)
+ return obj;
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
@end /* SOGoMailFolder */
#ifndef __Mailer_SOGoMailObject_H__
#define __Mailer_SOGoMailObject_H__
-#include <SOGo/SOGoContentObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailBaseObject.h>
/*
SOGoMailObject
Represents a single mail as retrieved using NGImap4.
*/
-@class NSString, NSArray, NSException;
-
-@interface SOGoMailObject : SOGoObject
+@interface SOGoMailObject : SOGoMailBaseObject
{
}
@implementation SOGoMailObject
+/* IMAP4 */
+
+- (NSString *)relativeImap4Name {
+ return [self nameInContainer];
+}
+
@end /* SOGoMailObject */
# $Id$
-SUBMINOR_VERSION:=4
+SUBMINOR_VERSION:=5
};
classes = {
- SOGoMailAccounts = {
+ SOGoMailBaseObject = {
superclass = "SOGoObject";
};
+ SOGoMailAccounts = {
+ superclass = "SOGoMailBaseObject";
+ };
+
SOGoMailAccount = {
- superclass = "SOGoObject";
+ superclass = "SOGoMailBaseObject";
};
SOGoMailFolder = {
- superclass = "SOGoObject";
+ superclass = "SOGoMailBaseObject";
};
SOGoMailObject = {
- superclass = "SOGoObject";
+ superclass = "SOGoMailBaseObject";
};
};
}
<?xml version='1.0' standalone='yes'?>
-<var:component xmlns="http://www.w3.org/1999/xhtml"
- xmlns:var="http://www.skyrix.com/od/binding"
- xmlns:const="http://www.skyrix.com/od/constant"
- xmlns:uix="OGo:uix"
- xmlns:label="OGo:label"
- className="UIxPageFrame"
- title="name"
+<var:component
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:uix="OGo:uix"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+ className="UIxMailMainFrame"
+ title="name"
>
-
-</var:component>
\ No newline at end of file
+ <h4>Mail Folder Page</h4>
+ <a rsrc:href="tbird_073_mailwelcome.png">screenshot</a>
+</var:component>
<td valign="top">clientObject:</td>
<td valign="top"><var:string value="clientObject" /></td>
</tr>
+ <tr>
+ <td valign="top">IMAP4-URL:</td>
+ <td valign="top"><var:string
+ value="clientObject.imap4URL.absoluteString" /></td>
+ </tr>
<tr>
<td valign="top">traversal stack:</td>
<td valign="top">
+2004-09-26 Helge Hess <helge.hess@opengroupware.org>
+
+ * UIxComponent.m: minor code cleanups (v0.9.13)
+
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
* v0.9.12
*/
// $Id$
-
#include "UIxComponent.h"
#include "common.h"
#include <NGObjWeb/SoHTTPAuthenticator.h>
-
@interface UIxComponent (PrivateAPI)
- (void)_parseQueryString:(NSString *)_s;
@end
-
@implementation UIxComponent
static NSTimeZone *MET = nil;
static NSTimeZone *GMT = nil;
-static NSMutableArray *dayLabelKeys = nil;
-static NSMutableArray *abbrDayLabelKeys = nil;
-static NSMutableArray *monthLabelKeys = nil;
+static NSMutableArray *dayLabelKeys = nil;
+static NSMutableArray *abbrDayLabelKeys = nil;
+static NSMutableArray *monthLabelKeys = nil;
static NSMutableArray *abbrMonthLabelKeys = nil;
static BOOL uixDebugEnabled = NO;
+ (void)initialize {
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- uixDebugEnabled = [ud boolForKey:@"SOGoUIxDebugEnabled"];
+ uixDebugEnabled = [ud boolForKey:@"SOGoUIxDebugEnabled"];
- if (MET == nil) {
- MET = [[NSTimeZone timeZoneWithAbbreviation:@"MET"] retain];
- GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain];
- }
- if (dayLabelKeys == nil) {
- dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
- [dayLabelKeys addObject:@"Sunday"];
- [dayLabelKeys addObject:@"Monday"];
- [dayLabelKeys addObject:@"Tuesday"];
- [dayLabelKeys addObject:@"Wednesday"];
- [dayLabelKeys addObject:@"Thursday"];
- [dayLabelKeys addObject:@"Friday"];
- [dayLabelKeys addObject:@"Saturday"];
-
- abbrDayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
- [abbrDayLabelKeys addObject:@"a2_Sunday"];
- [abbrDayLabelKeys addObject:@"a2_Monday"];
- [abbrDayLabelKeys addObject:@"a2_Tuesday"];
- [abbrDayLabelKeys addObject:@"a2_Wednesday"];
- [abbrDayLabelKeys addObject:@"a2_Thursday"];
- [abbrDayLabelKeys addObject:@"a2_Friday"];
- [abbrDayLabelKeys addObject:@"a2_Saturday"];
-
- monthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12];
- [monthLabelKeys addObject:@"January"];
- [monthLabelKeys addObject:@"February"];
- [monthLabelKeys addObject:@"March"];
- [monthLabelKeys addObject:@"April"];
- [monthLabelKeys addObject:@"May"];
- [monthLabelKeys addObject:@"June"];
- [monthLabelKeys addObject:@"July"];
- [monthLabelKeys addObject:@"August"];
- [monthLabelKeys addObject:@"September"];
- [monthLabelKeys addObject:@"October"];
- [monthLabelKeys addObject:@"November"];
- [monthLabelKeys addObject:@"December"];
-
- abbrMonthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12];
- [abbrMonthLabelKeys addObject:@"a3_January"];
- [abbrMonthLabelKeys addObject:@"a3_February"];
- [abbrMonthLabelKeys addObject:@"a3_March"];
- [abbrMonthLabelKeys addObject:@"a3_April"];
- [abbrMonthLabelKeys addObject:@"a3_May"];
- [abbrMonthLabelKeys addObject:@"a3_June"];
- [abbrMonthLabelKeys addObject:@"a3_July"];
- [abbrMonthLabelKeys addObject:@"a3_August"];
- [abbrMonthLabelKeys addObject:@"a3_September"];
- [abbrMonthLabelKeys addObject:@"a3_October"];
- [abbrMonthLabelKeys addObject:@"a3_November"];
- [abbrMonthLabelKeys addObject:@"a3_December"];
- }
+ if (MET == nil) {
+ MET = [[NSTimeZone timeZoneWithAbbreviation:@"MET"] retain];
+ GMT = [[NSTimeZone timeZoneWithAbbreviation:@"GMT"] retain];
+ }
+ if (dayLabelKeys == nil) {
+ dayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
+ [dayLabelKeys addObject:@"Sunday"];
+ [dayLabelKeys addObject:@"Monday"];
+ [dayLabelKeys addObject:@"Tuesday"];
+ [dayLabelKeys addObject:@"Wednesday"];
+ [dayLabelKeys addObject:@"Thursday"];
+ [dayLabelKeys addObject:@"Friday"];
+ [dayLabelKeys addObject:@"Saturday"];
+
+ abbrDayLabelKeys = [[NSMutableArray alloc] initWithCapacity:7];
+ [abbrDayLabelKeys addObject:@"a2_Sunday"];
+ [abbrDayLabelKeys addObject:@"a2_Monday"];
+ [abbrDayLabelKeys addObject:@"a2_Tuesday"];
+ [abbrDayLabelKeys addObject:@"a2_Wednesday"];
+ [abbrDayLabelKeys addObject:@"a2_Thursday"];
+ [abbrDayLabelKeys addObject:@"a2_Friday"];
+ [abbrDayLabelKeys addObject:@"a2_Saturday"];
+
+ monthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12];
+ [monthLabelKeys addObject:@"January"];
+ [monthLabelKeys addObject:@"February"];
+ [monthLabelKeys addObject:@"March"];
+ [monthLabelKeys addObject:@"April"];
+ [monthLabelKeys addObject:@"May"];
+ [monthLabelKeys addObject:@"June"];
+ [monthLabelKeys addObject:@"July"];
+ [monthLabelKeys addObject:@"August"];
+ [monthLabelKeys addObject:@"September"];
+ [monthLabelKeys addObject:@"October"];
+ [monthLabelKeys addObject:@"November"];
+ [monthLabelKeys addObject:@"December"];
+
+ abbrMonthLabelKeys = [[NSMutableArray alloc] initWithCapacity:12];
+ [abbrMonthLabelKeys addObject:@"a3_January"];
+ [abbrMonthLabelKeys addObject:@"a3_February"];
+ [abbrMonthLabelKeys addObject:@"a3_March"];
+ [abbrMonthLabelKeys addObject:@"a3_April"];
+ [abbrMonthLabelKeys addObject:@"a3_May"];
+ [abbrMonthLabelKeys addObject:@"a3_June"];
+ [abbrMonthLabelKeys addObject:@"a3_July"];
+ [abbrMonthLabelKeys addObject:@"a3_August"];
+ [abbrMonthLabelKeys addObject:@"a3_September"];
+ [abbrMonthLabelKeys addObject:@"a3_October"];
+ [abbrMonthLabelKeys addObject:@"a3_November"];
+ [abbrMonthLabelKeys addObject:@"a3_December"];
+ }
}
- (id)init {
if ((self = [super init])) {
- self->queryParameters = [[NSMutableDictionary alloc] init];
+ self->queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
}
return self;
}
[super dealloc];
}
+/* notifications */
- (void)awake {
WORequest *req;
}
}
+/* query parameters */
+
- (void)_parseQueryString:(NSString *)_s {
NSEnumerator *e;
NSString *part;
return self->queryParameters;
}
-- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date {
+- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date{
NSMutableDictionary *qp;
qp = [[self queryParameters] mutableCopy];
}
- (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
- inDictionary:(NSMutableDictionary *)_qp;
+ inDictionary:(NSMutableDictionary *)_qp;
{
if(_newDate != nil)
[_qp setObject:[self dateStringForDate:_newDate] forKey:@"day"];
[cdate setTimeZone:[self viewTimeZone]];
s = [self queryParameterForKey:@"hm"];
if([s length] == 4) {
- unsigned hour, minute;
+ unsigned hour, minute;
- hour = [[s substringToIndex:2] unsignedIntValue];
- minute = [[s substringFromIndex:2] unsignedIntValue];
- cdate = [cdate hour:hour minute:minute];
+ hour = [[s substringToIndex:2] unsignedIntValue];
+ minute = [[s substringFromIndex:2] unsignedIntValue];
+ cdate = [cdate hour:hour minute:minute];
}
else {
- cdate = [cdate hour:12 minute:0];
+ cdate = [cdate hour:12 minute:0];
}
return cdate;
}
/* SoUser */
- (SoUser *)user {
- WOContext *ctx;
-
- ctx = [self context];
- return [[[self clientObject] authenticatorInContext:ctx]
- userInContext:ctx];
+ WOContext *ctx;
+
+ ctx = [self context];
+ return [[[self clientObject] authenticatorInContext:ctx] userInContext:ctx];
}
- (NSString *)shortUserNameForDisplay {
- // TODO: better use a SoUser formatter?
- NSString *s;
- NSRange r;
+ // TODO: better use a SoUser formatter?
+ NSString *s;
+ NSRange r;
#warning !! USE USER MANAGER INSTEAD!
- s = [[self user] login];
- if ([s length] < 10)
- return s;
+ s = [[self user] login];
+ if ([s length] < 10)
+ return s;
- // TODO: algorithm might be inappropriate, depends on the actual UID
+ // TODO: algorithm might be inappropriate, depends on the actual UID
- r = [s rangeOfString:@"."];
- if (r.length == 0)
- return s;
+ r = [s rangeOfString:@"."];
+ if (r.length == 0)
+ return s;
- return [s substringToIndex:r.location];
+ return [s substringToIndex:r.location];
}
/* labels */
- (NSString *)labelForKey:(NSString *)_str {
- WOResourceManager *rm;
- NSArray *languages;
- WOContext *ctx;
- NSString *label;
- NSString *lKey, *lTable, *lVal;
- NSRange r;
-
- if ([_str length] == 0) {
- return nil;
- }
+ WOResourceManager *rm;
+ NSArray *languages;
+ WOContext *ctx;
+ NSString *label;
+ NSString *lKey, *lTable, *lVal;
+ NSRange r;
+
+ if ([_str length] == 0) {
+ return nil;
+ }
- /* lookup languages */
+ /* lookup languages */
- ctx = [self context];
- languages = [ctx hasSession]
- ? [[ctx session] languages]
- : [[ctx request] browserLanguages];
+ ctx = [self context];
+ languages = [ctx hasSession]
+ ? [[ctx session] languages]
+ : [[ctx request] browserLanguages];
- /* find resource manager */
+ /* find resource manager */
- if ((rm = [self resourceManager]) == nil)
- rm = [[WOApplication application] resourceManager];
- if (rm == nil)
- [self debugWithFormat:@"WARNING: missing resource manager!"];
+ if ((rm = [self resourceManager]) == nil)
+ rm = [[WOApplication application] resourceManager];
+ if (rm == nil)
+ [self debugWithFormat:@"WARNING: missing resource manager!"];
- /* get parameters */
+ /* get parameters */
- r = [_str rangeOfString:@"/"];
- if (r.length > 0) {
- lTable = [_str substringToIndex:r.location];
- lKey = [_str substringFromIndex:(r.location + r.length)];
- }
- else {
- lTable = nil;
- lKey = _str;
- }
- lVal = lKey;
+ r = [_str rangeOfString:@"/"];
+ if (r.length > 0) {
+ lTable = [_str substringToIndex:r.location];
+ lKey = [_str substringFromIndex:(r.location + r.length)];
+ }
+ else {
+ lTable = nil;
+ lKey = _str;
+ }
+ lVal = lKey;
- if([lKey hasPrefix:@"$"]) {
- lKey = [self valueForKeyPath:[lKey substringFromIndex:1]];
- }
- if([lTable hasPrefix:@"$"]) {
- lTable = [self valueForKeyPath:[lTable substringFromIndex:1]];
- }
+ if([lKey hasPrefix:@"$"]) {
+ lKey = [self valueForKeyPath:[lKey substringFromIndex:1]];
+ }
+ if([lTable hasPrefix:@"$"]) {
+ lTable = [self valueForKeyPath:[lTable substringFromIndex:1]];
+ }
#if 0
- if([lVal hasPrefix:@"$"]) {
- lVal = [self valueForKeyPath:[lVal substringFromIndex:1]];
- }
+ if([lVal hasPrefix:@"$"]) {
+ lVal = [self valueForKeyPath:[lVal substringFromIndex:1]];
+ }
#endif
- /* lookup string */
+ /* lookup string */
- label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
- languages:languages];
- return label;
+ label = [rm stringForKey:lKey inTableNamed:lTable withDefaultValue:lVal
+ languages:languages];
+ return label;
}
- (NSString *)localizedNameForDayOfWeek:(unsigned)_dayOfWeek {
- NSString *key = [dayLabelKeys objectAtIndex:_dayOfWeek % 7];
- return [self labelForKey:key];
+ NSString *key = [dayLabelKeys objectAtIndex:_dayOfWeek % 7];
+ return [self labelForKey:key];
}
- (NSString *)localizedAbbreviatedNameForDayOfWeek:(unsigned)_dayOfWeek {
- NSString *key = [abbrDayLabelKeys objectAtIndex:_dayOfWeek % 7];
- return [self labelForKey:key];
+ NSString *key = [abbrDayLabelKeys objectAtIndex:_dayOfWeek % 7];
+ return [self labelForKey:key];
}
- (NSString *)localizedNameForMonthOfYear:(unsigned)_monthOfYear {
- NSString *key = [monthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
- return [self labelForKey:key];
+ NSString *key = [monthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
+ return [self labelForKey:key];
}
- (NSString *)localizedAbbreviatedNameForMonthOfYear:(unsigned)_monthOfYear {
- NSString *key = [abbrMonthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
- return [self labelForKey:key];
+ NSString *key = [abbrMonthLabelKeys objectAtIndex:(_monthOfYear - 1) % 12];
+ return [self labelForKey:key];
}
/* locale */
- (NSDictionary *)locale {
- /* we need no fallback here, as locale is guaranteed to be set by sogod */
- return [[self context] valueForKey:@"locale"];
+ /* we need no fallback here, as locale is guaranteed to be set by sogod */
+ return [[self context] valueForKey:@"locale"];
}
-/* Debugging */
+/* debugging */
- (BOOL)isUIxDebugEnabled {
- return uixDebugEnabled;
+ return uixDebugEnabled;
}
@end /* UIxComponent */
# $Id$
-SUBMINOR_VERSION:=11
+SUBMINOR_VERSION:=13