+2004-09-21 Helge Hess <helge.hess@skyrix.com>
+
+ * v4.3.41
+
+ * WOWatchDogApplicationMain.m: added new function
+ WOWatchDogApplicationMainWithServerDefaults() which installs the
+ WOServerDefaults class as the default NSUserDefaults class
+
+ * added WOServerDefaults class (not implemented yet)
+
2004-09-21 Marcus Mueller <znek@mulle-kybernetik.com>
* v4.3.41
WOStats.m \
WOWatchDogApplicationMain.m \
+ifeq ($(FOUNDATION_LIB),fd)
+NGObjWebCore_OBJC_FILES += WOServerDefaults.m
+endif
+
# ----- SoCore product for SOPE core registrations
BUNDLE_NAME = SoCore
int WOApplicationMain(NSString *_appClassName, int argc, const char *argv[]);
int WOWatchDogApplicationMain
(NSString *_appClassName, int argc, const char *argv[]);
+int WOWatchDogApplicationMainWithServerDefaults
+ (NSString *_appClassName, int argc, const char *argv[],
+ NSString *globalDomainPath, NSString *appDomainPath);
@interface WOCoreApplication(DeprecatedMethodsInWO4)
/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ 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, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id: WOScriptedComponent.m 1 2004-08-20 10:08:27Z znek $
#include "WOScriptedComponent.h"
#include <NGObjWeb/WOTemplateBuilder.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.
+*/
+
+#import <Foundation/NSUserDefaults.h>
+
+@interface WOServerDefaults : NSUserDefaults
+{
+ NSUserDefaults *userDefaults;
+ NSString *globalDomainPath;
+ NSString *appDomainPath;
+}
+
+@end
+
+#include "common.h"
+
+@implementation WOServerDefaults
+
++ (id)hackInServerDefaults:(NSUserDefaults *)_ud
+ withAppDomainPath:(NSString *)_appDomainPath
+ globalDomainPath:(NSString *)_globalDomainPath
+{
+ return _ud;
+}
+
+@end /* WOServerDefaults */
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#import <Foundation/Foundation.h>
#include <NGObjWeb/NGObjWeb.h>
}
}
#endif
+
+/* main function which initializes server defaults (usually in /etc) */
+
+@interface NSUserDefaults(ServerDefaults)
++ (id)hackInServerDefaults:(NSUserDefaults *)_ud
+ withAppDomainPath:(NSString *)_appDomainPath
+ globalDomainPath:(NSString *)_globalDomainPath;
+@end
+
+int WOWatchDogApplicationMainWithServerDefaults
+(NSString *appName, int argc, const char *argv[],
+ NSString *globalDomainPath, NSString *appDomainPath)
+{
+ NSAutoreleasePool *pool;
+ Class defClass;
+
+ pool = [[NSAutoreleasePool alloc] init];
+#if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS)
+ {
+ extern char **environ;
+ [NSProcessInfo initializeWithArguments:(void*)argv count:argc
+ environment:(void*)environ];
+ }
+#endif
+
+ if ((defClass = NSClassFromString(@"WOServerDefaults")) != nil) {
+ NSUserDefaults *ud, *sd;
+
+ ud = [NSUserDefaults standardUserDefaults];
+ sd = [defClass hackInServerDefaults:ud
+ withAppDomainPath:appDomainPath
+ globalDomainPath:globalDomainPath];
+
+ if (((sd == nil) || (sd == ud)) && (appDomainPath != nil)) {
+ NSLog(@"Note: not using server defaults: '%@' "
+ @"(not supported on this Foundation)", appDomainPath);
+ }
+ }
+
+ return WOWatchDogApplicationMain(appName, argc, argv);
+}