see ChangeLog

Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89

Monotone-Author: dev-unix.inverse.qc.ca
Monotone-Date: 2006-06-15T19:34:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
dev-unix.inverse.qc.ca
2006-06-15 19:34:10 +00:00
commit f18c764ffa
965 changed files with 99196 additions and 0 deletions
+219
View File
@@ -0,0 +1,219 @@
2005-08-01 Helge Hess <helge.hess@skyrix.com>
* GNUmakefile: added FHS installation of sogod-0.9 (v0.9.41)
* SOGo.m: added class security declarations (previously in
product.plist of MainUI), ensure that core SOGo SoClasses are loaded
(v0.9.40)
* v0.9.39
* moved MainUI product bundle to UI/MainUI
* SOGo.m: fixed some gcc 4.0 warnings
2005-07-21 Helge Hess <helge.hess@opengroupware.org>
* product.plist: protect homepage using SOPE access control (v0.9.38)
* SOGoRootPage.m: redirect authenticated users to their login page
(v0.9.37)
2005-07-21 Marcus Mueller <znek@mulle-kybernetik.com>
* homepage.js: fixed post to send an empty string instead of null -
this works in Firefox on MacOSX but fails on Windows (v0.9.36)
2005-07-20 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.35
* README: updated with new default description
* SOGoUserHomePage.wox: in case user is not authorized to change the
internet access flag, the rendered text is different now
* English.lproj/Localizable.strings: provide new label for case that
user is not allowed to change internet access
2005-07-15 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile.preamble: fixed Cocoa compilation (v0.9.34)
2005-07-14 Helge Hess <helge.hess@opengroupware.org>
* moved SOGoUser and SOGoAuthenticator to libSOGo (v0.9.33)
2005-07-14 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.m: vacation message state is now properly being
retrieved from AgenorUserManager (v0.9.32)
* v0.9.31
* SOGoUserHomePage.[m, wox]: added internet access lock
display/modification and vacation state (currently only faked)
* homepage.js: JavaScript in use on the homepage
* English.lproj/Localizable.strings: removed old labels and added a
bunch of new labels
2005-07-12 Helge Hess <helge.hess@opengroupware.org>
* v0.9.30
* SOGoAuthenticator.m: create SOGoUser objects
* added 'SOGoUser' object/class as a subclass of SoUser, using this
object various Agenor properties like cn or email can be determined
(will use the AgenorUserManager to retrieve such)
2005-07-08 Marcus Mueller <znek@mulle-kybernetik.com>
* README: updated for new default 'SOGoAllowsUnrestrictedAccess'
2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.29
* README: updated defaults documentation
* SOGo.m: added new default 'SOGoEnableDoubleReleaseCheck' for
debugging of NSAutoreleasePool issues
2005-03-28 Helge Hess <helge.hess@opengroupware.org>
* SOGoProductLoader.m: do not try to load directories without
extensions (v0.9.28)
2005-03-23 Marcus Mueller <znek@mulle-kybernetik.com>
* renamed "default.strings" to "Localizable.strings" (v0.9.27)
2005-02-21 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile: properly install bundle in FHS (v0.9.26)
2005-02-20 Helge Hess <helge.hess@opengroupware.org>
* SOGoProductLoader.m: fixed product loader for FHS and Cocoa (0.9.25)
2005-02-17 Helge Hess <helge.hess@opengroupware.org>
* SOGo.m: added a proper application 'name' for the WEResourceManager,
use WEResourceManager per default (v0.9.24)
2005-02-12 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGo.m: corrected incorrect use of logging (v0.9.23)
2005-02-10 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile.preamble: fixed linking on MacOSX (v0.9.22)
* v0.9.21
* SOGoProductLoader.m: perform properly versioned plugin lookups (load
bundles from Library/SOGo-0.9 instead of Library/SOGo)
* sogod is now a tool, not a .woa anymore
* SOGo.m: minor cleanup in locale code, removed some dead code
(v0.9.20)
* GNUmakefile: some support for tool compilation (does not work yet)
* sogod.m: moved application class to own file, started to work on
daemon/product separation (v0.9.19)
2004-01-07 Marcus Mueller <znek@mulle-kybernetik.com>
* {English/French}.lproj/default.strings: changed encoding from
ISO-Latin-1 to UTF-8, which is now the default (v0.9.18)
2004-12-15 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.m: added defaultAction to redirect to
"Calendar/" (v0.9.17)
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoProductLoader.m, sogod.m: changed to use NGLogging (v0.9.16)
2004-10-19 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.[wox|m]: changed hrefs to be computed dynamically
instead of being static (v0.9.15)
2004-10-18 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.14
* SOGoUserHomePage.wox: Changed label for "eMail" to "Mail" for
consistency
* *.lproj/default.strings: added label "Mail"
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>
* sogod.m: fixed a compile warning on OSX (v0.9.11)
2004-09-20 Helge Hess <helge.hess@skyrix.com>
* SOGoUserHomePage.wox: added link to Mail (v0.9.10)
2004-08-27 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.9
* English.lproj/default.strings, French.lproj/default.strings:
dictionaries for labels
* SOGoUserHomePage.wox: replaced constant strings with labels
2004-08-26 Helge Hess <helge.hess@skyrix.com>
* GNUmakefile.preamble: fixed superflous libjs (v0.9.8)
2004-08-11 Helge Hess <helge.hess@skyrix.com>
* added SOGoGroupPage and SOGoGroupsPage (default views for the group
folders) (v0.9.7)
* sogod.m: do not set SoRootURL manually (v0.9.6)
2004-08-10 Marcus Mueller <znek@mulle-kybernetik.com>
* French.lproj/Locale: minor changes to capitalization (v0.9.5)
2004-07-27 Marcus Mueller <znek@mulle-kybernetik.com>
* sogod.m: added static SoRootURL to context (v0.9.4)
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* sogod.m, */Locale: converted to UTF-8 for better editability (v0.9.3)
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.2
* sogod.m: added localization methods. Current locale is put into
WOContext upon first request. All locales are cached in the
application object.
* [English,French].lproj: created. Put appropriate Locale
representations here.
* GNUmakefile: added LANGUAGES and LOCALIZED_RESOURCES.
* SOGoRootPage.wox: some debug code (for locales).
* created ChangeLog.
+21
View File
@@ -0,0 +1,21 @@
# GNUstep makefile
-include ../config.make
include $(GNUSTEP_MAKEFILES)/common.make
include ../Version
include ./Version
SOGOD = sogod-$(MAJOR_VERSION).$(MINOR_VERSION)
TOOL_NAME = $(SOGOD)
# daemon tool
$(SOGOD)_OBJC_FILES += \
sogod.m \
SOGo.m \
SOGoProductLoader.m \
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/tool.make
-include GNUmakefile.postamble
include fhs.make
+28
View File
@@ -0,0 +1,28 @@
# compile settings
ADDITIONAL_CPPFLAGS += \
-DSOGO_MAJOR_VERSION=$(MAJOR_VERSION) \
-DSOGO_MINOR_VERSION=$(MINOR_VERSION) \
-DSOGO_SUBMINOR_VERSION=$(SUBMINOR_VERSION)
ADDITIONAL_INCLUDE_DIRS += \
-I../SoObjects/ \
-I../..
ADDITIONAL_LIB_DIRS += \
-L../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)/ \
-L../OGoContentStore/$(GNUSTEP_OBJ_DIR)/
SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib
$(SOGOD)_TOOL_LIBS += \
-lSOGo \
-lOGoContentStore \
-lGDLContentStore \
-lGDLAccess \
-lWEExtensions \
-lNGiCal \
-lNGObjWeb \
-lNGMime -lNGLdap \
-lNGStreams -lNGExtensions -lEOControl \
-lDOM -lXmlRpc -lSaxObjC
+47
View File
@@ -0,0 +1,47 @@
/*
Copyright (C) 2004-2005 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/NSObject.h>
@interface MainUIProduct : NSObject
{
}
@end
#import <Foundation/Foundation.h>
@implementation MainUIProduct
+ (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name {
// TODO: this is kind of a hack, we reuse the class registry to find
// resources ...
NSBundle *bundle;
NSString *ldir, *path;
bundle = [NSBundle bundleForClass:self];
ldir = [_name stringByAppendingPathExtension:@"lproj"];
path = [bundle pathForResource:@"Locale" ofType:nil inDirectory:ldir];
return path;
}
@end /* MainUIProduct */
+88
View File
@@ -0,0 +1,88 @@
SOGo
====
Master Daemon, loads the functionality from product bundles in Library/SOGo.
Setup
=====
Defaults write sogod NGBundlePath '"$HOME/Library/SOGo"'
=> otherwise some bundles will clash with "fat" OGo
=> the UIx .wox driver must be found
Defaults
========
SOGoDefaultLanguage - string - currently used for selecting the language of
the mail templates. Default is "French".
SOGoCrashOnSessionCreate - bool - crash the server if a session is created
=> useful for debugging
SOGoEnableDoubleReleaseCheck - bool - call
+[NSAutoreleasePool enableDoubleReleaseCheck:YES] upon start
=> useful for debugging
SOGoInternetDetectQualifier
- an EOQualifier to detect whether a set of HTTP headers is from the outside,
eg: "NOT (minequprovenance = 'intranet')"
-SOGoInternetDetectQualifier '"NOT (minequprovenance = \"intranet\")"'
Note: all header field names are lowercase
Testing: -SOGoInternetDetectQualifier '"host = \"agenor.opengroupware.org\""'
AgenorProfileURL - URL
- configure database location of the user profile
eg: http://postgres:@agenor-db:5432/test/sogo_user_profile
SOGoDoNotRedirectRootPage - YES|NO
- do not redirect to home-folder for authenticated users but show the
root page (with the login name)
What it does
============
- provides locale support
- preloads the SOGo products (SOGoProductLoader)
- provides the root object (the application object with user lookup)
- sets the authenticator
- does some process limits and restart support
Apache Setup
============
AliasMatch /SOGoHH/so/ControlPanel/Products/(.*)/Resources/(.*) \
/home/helge/GNUstep/Library/SOGo-0.9/$1.SOGo/Resources/$2
<LocationMatch "^/SOGoHH*">
AuthName "Agenor LDAP"
AuthType Basic
AuthLDAPEnabled on
AuthLDAPUrl ldap://agenor-ldap:389/ou=organisation,dc=equipement,dc=gouv,dc=fr??sub?(&(objectClass=person)(uid=*))
require valid-user
SetHandler ngobjweb-adaptor
SetAppPort 9000
</LocationMatch>
<LocationMatch "^/SOGoHH/so/ControlPanel/Products/.*UI/Resources/.*(\.png$|\.gif$|\.css$|\.js$)">
SetHandler default-handler
</LocationMatch>
FHS Setup
=========
NOTE: use the appname, sogo-0.9, not the tool name (sogod-0.9)!
cd /usr/local/share
mkdir sogo-0.9/
cd sogo-0.9/
ln -s ~/dev/SOGo-trunk/UI/Templates ./templates
ln -s ~/dev/SOGo-trunk/UI/WebServerResources ./www
Apache:
Alias /SOGo.woa/WebServerResources/ \
/usr/local/share/sogo-0.9/www/
+320
View File
@@ -0,0 +1,320 @@
/*
Copyright (C) 2004-2005 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.
*/
#include <NGObjWeb/SoApplication.h>
@interface SOGo : SoApplication
{
NSMutableDictionary *localeLUT;
}
- (NSDictionary *)currentLocaleConsideringLanguages:(NSArray *)_langs;
- (NSDictionary *)localeForLanguageNamed:(NSString *)_name;
@end
#include "SOGoProductLoader.h"
#include <SOGo/SOGoAuthenticator.h>
#include <WEExtensions/WEResourceManager.h>
#include <SOGo/SOGoUserFolder.h>
#include "common.h"
@implementation SOGo
static unsigned int vMemSizeLimit = 0;
static BOOL doCrashOnSessionCreate = NO;
+ (void)initialize {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
id tmp;
doCrashOnSessionCreate = [ud boolForKey:@"SOGoCrashOnSessionCreate"];
/* vMem size check - default is 200MB */
tmp = [ud objectForKey:@"SxVMemLimit"];
vMemSizeLimit = (tmp != nil)
? [tmp intValue]
: 200;
if (vMemSizeLimit > 0) {
NSLog(@"Note: vmem size check enabled: shutting down app when "
@"vmem > %d MB", vMemSizeLimit);
}
#if LIB_FOUNDATION_LIBRARY
if ([ud boolForKey:@"SOGoEnableDoubleReleaseCheck"])
[NSAutoreleasePool enableDoubleReleaseCheck:YES];
#endif
/* SoClass security declarations */
/* require View permission to access the root (bound to authenticated ...) */
[[self soClassSecurityInfo] declareObjectProtected:SoPerm_View];
/* to allow public access to all contained objects (subkeys) */
[[self soClassSecurityInfo] setDefaultAccess:@"allow"];
/* require Authenticated role for View and WebDAV */
[[self soClassSecurityInfo] declareRole:SoRole_Authenticated
asDefaultForPermission:SoPerm_View];
[[self soClassSecurityInfo] declareRole:SoRole_Authenticated
asDefaultForPermission:SoPerm_WebDAVAccess];
}
- (id)init {
if ((self = [super init])) {
WOResourceManager *rm;
/* ensure core SoClass'es are setup */
[NSClassFromString(@"SOGoObject") soClass];
[NSClassFromString(@"SOGoContentObject") soClass];
[NSClassFromString(@"SOGoFolder") soClass];
/* setup locale cache */
self->localeLUT = [[NSMutableDictionary alloc] initWithCapacity:2];
/* load products */
[[SOGoProductLoader productLoader] loadProducts];
/* setup resource manager */
rm = [[WEResourceManager alloc] init];
[self setResourceManager:rm];
}
return self;
}
- (void)dealloc {
[self->localeLUT release];
[super dealloc];
}
/* authenticator */
- (id)authenticatorInContext:(id)_ctx {
return [SOGoAuthenticator sharedSOGoAuthenticator];
}
/* name lookup */
- (BOOL)isUserName:(NSString *)_key inContext:(id)_ctx {
if ([_key length] < 1)
return NO;
if (isdigit([_key characterAtIndex:0]))
return NO;
return YES;
}
- (id)lookupUser:(NSString *)_key inContext:(id)_ctx {
return [[[NSClassFromString(@"SOGoUserFolder") alloc]
initWithName:_key inContainer:self] autorelease];
}
- (void)_setupLocaleInContext:(WOContext *)_ctx {
NSArray *langs;
NSDictionary *locale;
if ([[_ctx valueForKey:@"locale"] isNotNull])
return;
langs = [[(WOContext *)_ctx request] browserLanguages];
locale = [self currentLocaleConsideringLanguages:langs];
[_ctx takeValue:locale forKey:@"locale"];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
id obj;
/* put locale info into the context in case it's not there */
[self _setupLocaleInContext:_ctx];
/* first check attributes directly bound to the application */
if ((obj = [super lookupName:_key inContext:_ctx acquire:_flag]))
return obj;
/*
The problem is, that at this point we still get request for resources,
eg 'favicon.ico'.
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];
return nil;
}
/* WebDAV */
- (NSString *)davDisplayName {
/* this is used in the UI, eg in the navigation */
return @"SOGo";
}
/* exception handling */
- (WOResponse *)handleException:(NSException *)_exc
inContext:(WOContext *)_ctx
{
printf("EXCEPTION: %s\n", [[_exc description] cString]);
abort();
}
/* runtime maintenance */
- (void)checkIfDaemonHasToBeShutdown {
unsigned int limit, vmem;
if ((limit = vMemSizeLimit) == 0)
return;
vmem = [[NSProcessInfo processInfo] virtualMemorySize]/1048576;
if (vmem > limit) {
[self logWithFormat:
@"terminating app, vMem size limit (%d MB) has been reached"
@" (currently %d MB)",
limit, vmem];
[self terminate];
}
}
- (WOResponse *)dispatchRequest:(WORequest *)_request {
static NSArray *runLoopModes = nil;
WOResponse *resp;
resp = [super dispatchRequest:_request];
if ([self isTerminating])
return resp;
if (runLoopModes == nil)
runLoopModes = [[NSArray alloc] initWithObjects:NSDefaultRunLoopMode, nil];
// TODO: a bit complicated? (-perform:afterDelay: doesn't work?)
[[NSRunLoop currentRunLoop] performSelector:
@selector(checkIfDaemonHasToBeShutdown)
target:self argument:nil
order:1 modes:runLoopModes];
return resp;
}
/* session management */
- (id)createSessionForRequest:(WORequest *)_request {
[self warnWithFormat:@"session creation requested!"];
if (doCrashOnSessionCreate)
abort();
return [super createSessionForRequest:_request];
}
/* localization */
- (NSDictionary *)currentLocaleConsideringLanguages:(NSArray *)_langs {
unsigned i, count;
/* assume _langs is ordered by priority */
count = [_langs count];
for (i = 0; i < count; i++) {
NSString *lname;
NSDictionary *locale;
lname = [_langs objectAtIndex:i];
locale = [self localeForLanguageNamed:lname];
if (locale != nil)
return locale;
}
/* no appropriate language, fallback to default */
return [self localeForLanguageNamed:@"English"];
}
- (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name {
static Class MainProduct = Nil;
NSString *lpath;
lpath = [[self resourceManager] pathForResourceNamed:@"Locale"
inFramework:nil
languages:[NSArray arrayWithObject:_name]];
if ([lpath isNotNull])
return lpath;
if (MainProduct == Nil) {
if ((MainProduct = NSClassFromString(@"MainUIProduct")) == Nil)
[self errorWithFormat:@"did not find MainUIProduct class!"];
}
lpath = [(id)MainProduct pathToLocaleForLanguageNamed:_name];
if ([lpath isNotNull])
return lpath;
return nil;
}
- (NSDictionary *)localeForLanguageNamed:(NSString *)_name {
NSString *lpath;
id data;
NSDictionary *locale;
if (![_name isNotNull]) {
[self errorWithFormat:@"%s: name parameter must not be nil!",
__PRETTY_FUNCTION__];
return nil;
}
if ((locale = [self->localeLUT objectForKey:_name]) != nil)
return locale;
if ((lpath = [self pathToLocaleForLanguageNamed:_name]) == nil) {
[self errorWithFormat:@"did not find Locale for language: %@", _name];
return nil;
}
if ((data = [NSData dataWithContentsOfFile:lpath]) == nil) {
[self logWithFormat:@"%s didn't find locale with name:%@",
__PRETTY_FUNCTION__,
_name];
return nil;
}
data = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
locale = [data propertyList];
if (locale == nil) {
[self logWithFormat:@"%s couldn't load locale with name:%@",
__PRETTY_FUNCTION__,
_name];
return nil;
}
[self->localeLUT setObject:locale forKey:_name];
return locale;
}
/* name (used by the WEResourceManager) */
- (NSString *)name {
return @"SOGo-0.9";
}
@end /* SOGo */
+44
View File
@@ -0,0 +1,44 @@
/*
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: SOGoProductLoader.h 540 2005-02-10 16:22:38Z helge $
#ifndef __Main_SOGoProductLoader_H__
#define __Main_SOGoProductLoader_H__
#import <Foundation/NSObject.h>
@class NSString, NSArray;
@interface SOGoProductLoader : NSObject
{
NSString *productDirectoryName;
NSArray *searchPathes;
}
+ (id)productLoader;
/* operations */
- (void)loadProducts;
@end
#endif /* __Main_SOGoProductLoader_H__ */
+174
View File
@@ -0,0 +1,174 @@
/*
Copyright (C) 2004-2005 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.
*/
#include "SOGoProductLoader.h"
#include "common.h"
@implementation SOGoProductLoader
+ (int)sogoMajorVersion {
return SOGO_MAJOR_VERSION;
}
+ (int)sogoMinorVersion {
return SOGO_MINOR_VERSION;
}
+ (id)productLoader {
return [[[self alloc] init] autorelease];
}
- (id)init {
if ((self = [super init])) {
self->productDirectoryName =
[[NSString alloc] initWithFormat:@"SOGo-%i.%i",
[[self class] sogoMajorVersion],
[[self class] sogoMinorVersion]];
}
return self;
}
- (void)dealloc {
[self->productDirectoryName release];
[self->searchPathes release];
[super dealloc];
}
/* loading */
- (void)_addCocoaSearchPathesToArray:(NSMutableArray *)ma {
id tmp;
tmp = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
NSAllDomainsMask,
YES);
if ([tmp count] > 0) {
NSEnumerator *e;
e = [tmp objectEnumerator];
while ((tmp = [e nextObject])) {
tmp = [tmp stringByAppendingPathComponent:self->productDirectoryName];
if (![ma containsObject:tmp])
[ma addObject:tmp];
}
}
}
- (void)_addGNUstepSearchPathesToArray:(NSMutableArray *)ma {
NSDictionary *env;
id tmp;
env = [[NSProcessInfo processInfo] environment];
if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil)
tmp = [env objectForKey:@"GNUSTEP_PATHLIST"];
tmp = [tmp componentsSeparatedByString:@":"];
if ([tmp count] > 0) {
NSEnumerator *e;
e = [tmp objectEnumerator];
while ((tmp = [e nextObject])) {
tmp = [tmp stringByAppendingPathComponent:@"Library"];
tmp = [tmp stringByAppendingPathComponent:self->productDirectoryName];
if (![ma containsObject:tmp])
[ma addObject:tmp];
}
}
else {
NSLog(@"%s: empty library search path !", __PRETTY_FUNCTION__);
}
}
- (void)_addFHSPathesToArray:(NSMutableArray *)ma {
NSString *s;
s = @"sogod-0.9";
[ma addObject:[@"/usr/local/lib/" stringByAppendingString:s]];
[ma addObject:[@"/usr/lib/" stringByAppendingString:s]];
}
- (NSArray *)productSearchPathes {
NSMutableArray *ma;
BOOL hasGNUstepEnv;
if (self->searchPathes != nil)
return self->searchPathes;
hasGNUstepEnv = [[[[NSProcessInfo processInfo] environment]
objectForKey:@"GNUSTEP_USER_ROOT"] length] > 0 ? YES : NO;
ma = [NSMutableArray arrayWithCapacity:6];
if (hasGNUstepEnv)
[self _addGNUstepSearchPathesToArray:ma];
#if COCOA_Foundation_LIBRARY
else
[self _addCocoaSearchPathesToArray:ma];
#endif
[self _addFHSPathesToArray:ma];
self->searchPathes = [ma copy];
if ([self->searchPathes count] == 0) {
[self logWithFormat:@"%s: no search pathes were found !",
__PRETTY_FUNCTION__];
}
return self->searchPathes;
}
- (void)loadProducts {
SoProductRegistry *registry = nil;
NSFileManager *fm;
NSEnumerator *pathes;
NSString *lpath;
registry = [SoProductRegistry sharedProductRegistry];
fm = [NSFileManager defaultManager];
pathes = [[self productSearchPathes] objectEnumerator];
while ((lpath = [pathes nextObject]) != nil) {
NSEnumerator *productNames;
NSString *productName;
[self logWithFormat:@"scanning SOGo products in: %@", lpath];
productNames = [[fm directoryContentsAtPath:lpath] objectEnumerator];
while ((productName = [productNames nextObject]) != nil) {
NSString *bpath;
if ([[productName pathExtension] length] == 0)
/* filter out directories without extensions */
continue;
bpath = [lpath stringByAppendingPathComponent:productName];
[self logWithFormat:@" register SOGo product: %@",
[bpath lastPathComponent]];
[registry registerProductAtPath:bpath];
}
}
if (![registry loadAllProducts])
[self warnWithFormat:@"could not load all products !"];
}
@end /* SOGoProductLoader */
+7
View File
@@ -0,0 +1,7 @@
# Version file
SUBMINOR_VERSION:=41
# v0.9.32 requires libSOGo v0.9.57
# v0.9.24 requires libWEExtensions v4.5.67
# v0.9.16 requires libNGExtensions v4.5.136
+33
View File
@@ -0,0 +1,33 @@
/*
Copyright (C) 2002-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/Foundation.h>
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
#include <GDLAccess/GDLAccess.h>
+26
View File
@@ -0,0 +1,26 @@
# postprocessing
# FHS support (this is a hack and is going to be done by gstep-make!)
ifneq ($(FHS_INSTALL_ROOT),)
FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/
FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/
FHS_SBIN_DIR=$(FHS_INSTALL_ROOT)/sbin/
fhs-bin-dirs ::
$(MKDIRS) $(FHS_SBIN_DIR)
NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)"
move-daemons-to-fhs :: fhs-bin-dirs
@echo "moving daemons from $(NONFHS_BINDIR) to $(FHS_SBIN_DIR) .."
for i in $(TOOL_NAME); do \
mv "$(NONFHS_BINDIR)/$${i}" $(FHS_SBIN_DIR); \
done
move-to-fhs :: move-daemons-to-fhs
after-install :: move-to-fhs
endif
+38
View File
@@ -0,0 +1,38 @@
/*
Copyright (C) 2004-2005 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.
*/
#include <NGObjWeb/NGObjWeb.h>
#include "common.h"
int main(int argc, char **argv, char **env) {
NSAutoreleasePool *pool;
pool = [[NSAutoreleasePool alloc] init];
#if LIB_FOUNDATION_LIBRARY
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
[NGBundleManager defaultBundleManager];
WOWatchDogApplicationMain(@"SOGo", argc, (void*)argv);
[pool release];
return 0;
}