commit f18c764ffad13c8e3dbda85019025b65d71f614d Author: dev-unix.inverse.qc.ca Date: Thu Jun 15 19:34:10 2006 +0000 see ChangeLog Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89 Monotone-Author: dev-unix.inverse.qc.ca Monotone-Date: 2006-06-15T19:34:10 Monotone-Branch: ca.inverse.sogo diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..90d070e0e --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3 @@ +2006-06-15 ludovic@inverse.ca + + * Initial import of SOGo from trunk. diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 000000000..78ec6851d --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,13 @@ +# GNUstep makefile + +-include config.make +include $(GNUSTEP_MAKEFILES)/common.make + +SUBPROJECTS = \ + OGoContentStore \ + SoObjects \ + Main \ + UI \ + Protocols \ + +include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/Main/ChangeLog b/Main/ChangeLog new file mode 100644 index 000000000..72d4f0e92 --- /dev/null +++ b/Main/ChangeLog @@ -0,0 +1,219 @@ +2005-08-01 Helge Hess + + * 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 + + * 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 + + * 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 + + * 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 + + * GNUmakefile.preamble: fixed Cocoa compilation (v0.9.34) + +2005-07-14 Helge Hess + + * moved SOGoUser and SOGoAuthenticator to libSOGo (v0.9.33) + +2005-07-14 Marcus Mueller + + * 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 + + * 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 + + * README: updated for new default 'SOGoAllowsUnrestrictedAccess' + +2005-07-05 Marcus Mueller + + * v0.9.29 + + * README: updated defaults documentation + + * SOGo.m: added new default 'SOGoEnableDoubleReleaseCheck' for + debugging of NSAutoreleasePool issues + +2005-03-28 Helge Hess + + * SOGoProductLoader.m: do not try to load directories without + extensions (v0.9.28) + +2005-03-23 Marcus Mueller + + * renamed "default.strings" to "Localizable.strings" (v0.9.27) + +2005-02-21 Helge Hess + + * GNUmakefile: properly install bundle in FHS (v0.9.26) + +2005-02-20 Helge Hess + + * SOGoProductLoader.m: fixed product loader for FHS and Cocoa (0.9.25) + +2005-02-17 Helge Hess + + * SOGo.m: added a proper application 'name' for the WEResourceManager, + use WEResourceManager per default (v0.9.24) + +2005-02-12 Marcus Mueller + + * SOGo.m: corrected incorrect use of logging (v0.9.23) + +2005-02-10 Helge Hess + + * 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 + + * {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 + + * SOGoUserHomePage.m: added defaultAction to redirect to + "Calendar/" (v0.9.17) + +2004-12-08 Marcus Mueller + + * SOGoProductLoader.m, sogod.m: changed to use NGLogging (v0.9.16) + +2004-10-19 Marcus Mueller + + * SOGoUserHomePage.[wox|m]: changed hrefs to be computed dynamically + instead of being static (v0.9.15) + +2004-10-18 Marcus Mueller + + * v0.9.14 + + * SOGoUserHomePage.wox: Changed label for "eMail" to "Mail" for + consistency + + * *.lproj/default.strings: added label "Mail" + +2004-09-26 Helge Hess + + * 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 + + * sogod.m: fixed a compile warning on OSX (v0.9.11) + +2004-09-20 Helge Hess + + * SOGoUserHomePage.wox: added link to Mail (v0.9.10) + +2004-08-27 Marcus Mueller + + * 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 + + * GNUmakefile.preamble: fixed superflous libjs (v0.9.8) + +2004-08-11 Helge Hess + + * 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 + + * French.lproj/Locale: minor changes to capitalization (v0.9.5) + +2004-07-27 Marcus Mueller + + * sogod.m: added static SoRootURL to context (v0.9.4) + +2004-07-19 Marcus Mueller + + * sogod.m, */Locale: converted to UTF-8 for better editability (v0.9.3) + +2004-07-19 Marcus Mueller + + * 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. diff --git a/Main/GNUmakefile b/Main/GNUmakefile new file mode 100644 index 000000000..fbc5ae16e --- /dev/null +++ b/Main/GNUmakefile @@ -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 diff --git a/Main/GNUmakefile.preamble b/Main/GNUmakefile.preamble new file mode 100644 index 000000000..1132d88bc --- /dev/null +++ b/Main/GNUmakefile.preamble @@ -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 diff --git a/Main/MainUIProduct.m b/Main/MainUIProduct.m new file mode 100644 index 000000000..1018ad738 --- /dev/null +++ b/Main/MainUIProduct.m @@ -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 + +@interface MainUIProduct : NSObject +{ +} + +@end + +#import + +@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 */ diff --git a/Main/README b/Main/README new file mode 100644 index 000000000..a814c6f7c --- /dev/null +++ b/Main/README @@ -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 + + + 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 + + + + SetHandler default-handler + + + +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/ diff --git a/Main/SOGo.m b/Main/SOGo.m new file mode 100644 index 000000000..4274d8385 --- /dev/null +++ b/Main/SOGo.m @@ -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 + +@interface SOGo : SoApplication +{ + NSMutableDictionary *localeLUT; +} + +- (NSDictionary *)currentLocaleConsideringLanguages:(NSArray *)_langs; +- (NSDictionary *)localeForLanguageNamed:(NSString *)_name; + +@end + +#include "SOGoProductLoader.h" +#include +#include +#include +#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 */ diff --git a/Main/SOGoProductLoader.h b/Main/SOGoProductLoader.h new file mode 100644 index 000000000..fc8668dbb --- /dev/null +++ b/Main/SOGoProductLoader.h @@ -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 + +@class NSString, NSArray; + +@interface SOGoProductLoader : NSObject +{ + NSString *productDirectoryName; + NSArray *searchPathes; +} + ++ (id)productLoader; + +/* operations */ + +- (void)loadProducts; + +@end + +#endif /* __Main_SOGoProductLoader_H__ */ diff --git a/Main/SOGoProductLoader.m b/Main/SOGoProductLoader.m new file mode 100644 index 000000000..2d994ea2a --- /dev/null +++ b/Main/SOGoProductLoader.m @@ -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 */ diff --git a/Main/Version b/Main/Version new file mode 100644 index 000000000..21363f43a --- /dev/null +++ b/Main/Version @@ -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 diff --git a/Main/common.h b/Main/common.h new file mode 100644 index 000000000..f29bf7474 --- /dev/null +++ b/Main/common.h @@ -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 + +#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY +# include +# include +#endif + +#include +#include +#include + +#include diff --git a/Main/fhs.make b/Main/fhs.make new file mode 100644 index 000000000..c9cd79f8a --- /dev/null +++ b/Main/fhs.make @@ -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 diff --git a/Main/sogod.m b/Main/sogod.m new file mode 100644 index 000000000..314a248ce --- /dev/null +++ b/Main/sogod.m @@ -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 +#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; +} diff --git a/Misc/WebUI/Application.h b/Misc/WebUI/Application.h new file mode 100644 index 000000000..cd026c5ca --- /dev/null +++ b/Misc/WebUI/Application.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __Application_H_ +#define __Application_H_ + + +#include + + +@interface Application : SoApplication +{ + +} + +@end + +#endif /* __Application_H_ */ diff --git a/Misc/WebUI/Application.m b/Misc/WebUI/Application.m new file mode 100644 index 000000000..9252c4147 --- /dev/null +++ b/Misc/WebUI/Application.m @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "Application.h" +#import "common.h" + + +@implementation Application + +- (id)init { + self = [super init]; + if(self) { + [self logInfoWithFormat:@"Welcome to '%@'", [self name]]; + } + return self; +} + +@end diff --git a/Misc/WebUI/COPYING b/Misc/WebUI/COPYING new file mode 100644 index 000000000..161a3d1d4 --- /dev/null +++ b/Misc/WebUI/COPYING @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/Misc/WebUI/COPYRIGHT b/Misc/WebUI/COPYRIGHT new file mode 100644 index 000000000..1053b2aa3 --- /dev/null +++ b/Misc/WebUI/COPYRIGHT @@ -0,0 +1,4 @@ +Copyright (C) 2004 SKYRIX Software AG + + +Contact: info@skyrix.com diff --git a/Misc/WebUI/ChangeLog b/Misc/WebUI/ChangeLog new file mode 100644 index 000000000..b45b24dd4 --- /dev/null +++ b/Misc/WebUI/ChangeLog @@ -0,0 +1,13 @@ +2004-05-27 Marcus Mueller + + * README: updated + +2004-05-27 Marcus Mueller + + * README, NOTES: updated + + * NGExtensions/NGLogging/ChangeLog: created + +2004-05-26 Marcus Mueller + + * ChangeLog: created diff --git a/Misc/WebUI/DirectAction.h b/Misc/WebUI/DirectAction.h new file mode 100644 index 000000000..e25f29b95 --- /dev/null +++ b/Misc/WebUI/DirectAction.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __DirectAction_H_ +#define __DirectAction_H_ + + +#include + + +@interface DirectAction : WODirectAction +{ + +} + +@end + +#endif /* __DirectAction_H_ */ diff --git a/Misc/WebUI/DirectAction.m b/Misc/WebUI/DirectAction.m new file mode 100644 index 000000000..695f82b67 --- /dev/null +++ b/Misc/WebUI/DirectAction.m @@ -0,0 +1,29 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 "DirectAction.h" + + +@implementation DirectAction + +@end diff --git a/Misc/WebUI/English.lproj/InfoPlist.strings b/Misc/WebUI/English.lproj/InfoPlist.strings new file mode 100644 index 000000000..d22a0a2c6 Binary files /dev/null and b/Misc/WebUI/English.lproj/InfoPlist.strings differ diff --git a/Misc/WebUI/GNUmakefile b/Misc/WebUI/GNUmakefile new file mode 100644 index 000000000..d8eaed497 --- /dev/null +++ b/Misc/WebUI/GNUmakefile @@ -0,0 +1,33 @@ +# $Id$ + +include $(GNUSTEP_MAKEFILES)/common.make + +WOAPP_NAME = WebUI + +WebUI_OBJC_FILES = \ + WebUI_main.m \ + Application.m \ + Session.m \ + DirectAction.m \ + + +ADDITIONAL_INCLUDE_DIRS = -INGExtensions -INGExtensions/NGLogging + +WebUI_COMPONENTS = \ + Main.wo \ + + +WebUI_RESOURCE_FILES = \ + + +WebUI_WEBSERVER_RESOURCE_FILES := \ + $(shell find WebServerResources -type f -print) + + +WebUI_SUBPROJECTS = \ + NGExtensions \ + + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/woapp.make +-include GNUmakefile.postamble diff --git a/Misc/WebUI/GNUmakefile.preamble b/Misc/WebUI/GNUmakefile.preamble new file mode 100644 index 000000000..9c0fa2920 --- /dev/null +++ b/Misc/WebUI/GNUmakefile.preamble @@ -0,0 +1,8 @@ +# $Id$ + + +-include GNUmakefile.preamble.local + +ifeq ($(findstring darwin, $(GNUSTEP_HOST_OS)),) +ADDITIONAL_OBJCFLAGS += -DWITHOUT_SOPEX +endif diff --git a/Misc/WebUI/Info.plist b/Misc/WebUI/Info.plist new file mode 100644 index 000000000..d0cabb589 --- /dev/null +++ b/Misc/WebUI/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + WebUI + CFBundleIconFile + Lori + CFBundleIdentifier + my.sope.apps.WebUI + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 0.1 + NSMainNibFile + + NSPrincipalClass + SOPEXApplication + + diff --git a/Misc/WebUI/Lori.icns b/Misc/WebUI/Lori.icns new file mode 100644 index 000000000..4d1024410 Binary files /dev/null and b/Misc/WebUI/Lori.icns differ diff --git a/Misc/WebUI/NGExtensions/GNUmakefile b/Misc/WebUI/NGExtensions/GNUmakefile new file mode 100644 index 000000000..40bba8bb5 --- /dev/null +++ b/Misc/WebUI/NGExtensions/GNUmakefile @@ -0,0 +1,18 @@ +# $Id$ + +include $(GNUSTEP_MAKEFILES)/common.make + + +SUBPROJECT_NAME = NGExtensions + + +ADDITIONAL_INCLUDE_DIRS += -I.. + + +NGExtensions_SUBPROJECTS = \ + NGLogging + + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/subproject.make +-include GNUmakefile.postamble diff --git a/Misc/WebUI/NGExtensions/NGLogging/ChangeLog b/Misc/WebUI/NGExtensions/NGLogging/ChangeLog new file mode 100644 index 000000000..770975e0c --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/ChangeLog @@ -0,0 +1,17 @@ +2004-05-27 Marcus Mueller + + * NGLogAppender.[hm]: introduced -formattedEvent:, currently not + configurable. + + * NGLogSyslogAppender.m: works as expected now. + + * NGLogger.m: uses new default (see README) to select the default + appender. Not optimal, but sufficient. + + * NGLogConsoleAppender.m: changed to use -formattedEvent: now. + +2004-05-27 Marcus Mueller + + * NGLogSyslogAppender.[hm]: syslog appender, untested. + + * ChangeLog: created diff --git a/Misc/WebUI/NGExtensions/NGLogging/GNUmakefile b/Misc/WebUI/NGExtensions/NGLogging/GNUmakefile new file mode 100644 index 000000000..e596eaaf7 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/GNUmakefile @@ -0,0 +1,30 @@ +# $Id$ + +include $(GNUSTEP_MAKEFILES)/common.make + + +SUBPROJECT_NAME = NGLogging + + +ADDITIONAL_INCLUDE_DIRS += -I.. -I../.. + + +NGLogging_OBJC_FILES = \ + NSObject+ExtendedLogging.m \ + NGLogger.m \ + NGLogEvent.m \ + NGLogAppender.m \ + NGLogConsoleAppender.m \ + +NGLogging_HEADER_FILES = \ + NGLogging.h \ + NSObject+ExtendedLogging.h \ + NGLogger.h \ + NGLogEvent.h \ + NGLogAppender.h \ + NGLogConsoleAppender.h \ + + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/subproject.make +-include GNUmakefile.postamble diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.h new file mode 100644 index 000000000..fabab54a2 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.h @@ -0,0 +1,51 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogAppender_H_ +#define __NGLogAppender_H_ + +/* + Abstract superclass for all appenders. +*/ + +#import +#import "NSObject+ExtendedLogging.h" + + +@class NGLogEvent; + + +@interface NGLogAppender : NSObject +{ + +} + +/* subclass responsibility */ +- (void)appendLogEvent:(NGLogEvent *)_event; +- (NSString *)formattedEvent:(NGLogEvent *)_event; + +- (NSString *)localizedNameOfLogLevel:(NGLogLevel)_level; + +@end + +#endif /* __NGLogAppender_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.m b/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.m new file mode 100644 index 000000000..3743c843f --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogAppender.m @@ -0,0 +1,66 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "NGLogAppender.h" +#import "NGLogEvent.h" + + +@implementation NGLogAppender + +- (void)appendLogEvent:(NGLogEvent *)_event { + [self subclassResponsibility:_cmd]; +} + +- (NSString *)formattedEvent:(NGLogEvent *)_event { + return [NSString stringWithFormat:@"[%@] %@", + [self localizedNameOfLogLevel:[_event level]], + [_event message]]; +} + +- (NSString *)localizedNameOfLogLevel:(NGLogLevel)_level { + NSString *name; + + switch (_level) { + case NGLogLevelDebug: + name = @"DEBUG"; + break; + case NGLogLevelInfo: + name = @"INFO"; + break; + case NGLogLevelWarn: + name = @"WARN"; + break; + case NGLogLevelError: + name = @"ERROR"; + break; + case NGLogLevelFatal: + name = @"FATAL"; + break; + default: + name = @""; + break; + } + return name; +} + +@end diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.h new file mode 100644 index 000000000..bc3fd3438 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogConsoleAppender_H_ +#define __NGLogConsoleAppender_H_ + + +#import "NGLogAppender.h" + + +@interface NGLogConsoleAppender : NGLogAppender +{ + +} + +@end + +#endif /* __NGLogConsoleAppender_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.m b/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.m new file mode 100644 index 000000000..d9a53c46e --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogConsoleAppender.m @@ -0,0 +1,34 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "NGLogConsoleAppender.h" +#import "NGLogEvent.h" + + +@implementation NGLogConsoleAppender + +- (void)appendLogEvent:(NGLogEvent *)_event { + NSLog([self formattedEvent:_event]); +} + +@end diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.h new file mode 100644 index 000000000..3b1dfa4b3 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogEvent_H_ +#define __NGLogEvent_H_ + + +#import +#import "NSObject+ExtendedLogging.h" + + +@interface NGLogEvent : NSObject +{ + NSString *msg; + NGLogLevel level; + NSTimeInterval date; +} + +- (id)initWithLevel:(NGLogLevel)_level message:(NSString *)_msg; + +- (NGLogLevel)level; +- (NSString *)message; +- (NSDate *)date; + +@end + +#endif /* __NGLogEvent_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.m b/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.m new file mode 100644 index 000000000..e9c617340 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogEvent.m @@ -0,0 +1,56 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "NGLogEvent.h" +#import + + +@implementation NGLogEvent + +- (id)initWithLevel:(NGLogLevel)_level message:(NSString *)_msg { + if((self = [super init])) { + self->date = [NSDate timeIntervalSinceReferenceDate]; + self->level = _level; + ASSIGN(self->msg, _msg); + } + return self; +} + +- (void)dealloc { + [self->msg release]; + [super dealloc]; +} + +- (NGLogLevel)level { + return self->level; +} + +- (NSString *)message { + return self->msg; +} + +- (NSDate *)date { + return [NSDate dateWithTimeIntervalSinceReferenceDate:self->date]; +} + +@end diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.h new file mode 100644 index 000000000..e7253b825 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogSyslogAppender_H_ +#define __NGLogSyslogAppender_H_ + + +#import "NGLogAppender.h" + + +@interface NGLogSyslogAppender : NGLogAppender +{ + +} + ++ (id)sharedAppender; + +/* provide syslog identifier */ +- (id)initWithIdentifier:(NSString *)_ident; + +@end + +#endif /* __NGLogSyslogAppender_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.m b/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.m new file mode 100644 index 000000000..856b47548 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogSyslogAppender.m @@ -0,0 +1,114 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "NGLogSyslogAppender.h" +#import "NGLogEvent.h" +#include +#include + + +@interface NGLogSyslogAppender (PrivateAPI) +- (int)syslogLevelForLogLevel:(NGLogLevel)_level; +@end + +@implementation NGLogSyslogAppender + + +static NSString *defaultSyslogIdentifier = nil; + + ++ (void)initialize { + NSUserDefaults *ud; + static BOOL isInitialized = NO; + + if(isInitialized) + return; + + ud = [NSUserDefaults standardUserDefaults]; + defaultSyslogIdentifier = + [[ud stringForKey:@"NGLogSyslogIdentifier"] retain]; + + isInitialized = YES; +} + ++ (id)sharedAppender { + static id sharedAppender = nil; + if(sharedAppender == nil) { + sharedAppender = [[self alloc] init]; + } + return sharedAppender; +} + +- (id)init { + return [self initWithIdentifier:defaultSyslogIdentifier]; +} + +- (id)initWithIdentifier:(NSString *)_ident { + if((self = [super init])) { + #warning ** default flags? + openlog([_ident cString], LOG_PID | LOG_NDELAY, LOG_USER); + } + return self; +} + +- (void)dealloc { + closelog(); + [super dealloc]; +} + +- (void)appendLogEvent:(NGLogEvent *)_event { + NSString *formattedMsg; + int level; + + formattedMsg = [self formattedEvent:_event]; + level = [self syslogLevelForLogLevel:[_event level]]; + syslog(level, [formattedMsg cString]); +} + +- (int)syslogLevelForLogLevel:(NGLogLevel)_level { + int level; + + switch (_level) { + case NGLogLevelDebug: + level = LOG_DEBUG; + break; + case NGLogLevelInfo: + level = LOG_INFO; + break; + case NGLogLevelWarn: + level = LOG_WARNING; + break; + case NGLogLevelError: + level = LOG_ERR; + break; + case NGLogLevelFatal: + level = LOG_ALERT; // LOG_EMERG is broadcast to all users... + break; + default: + level = LOG_NOTICE; + break; + } + return level; +} + +@end diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogger.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogger.h new file mode 100644 index 000000000..421abb0ed --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogger.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogger_H_ +#define __NGLogger_H_ + +/* + The logger, modeled closely after log4j. + */ + + +#import +#include "NSObject+ExtendedLogging.h" + + +@interface NGLogger : NSObject +{ + NGLogLevel minLogLevel; + id _appender; // going away as soon as we have a config +} + +- (id)initWithLogLevel:(NGLogLevel)_level; + +- (void)setLogLevel:(NGLogLevel)_level; +- (NGLogLevel)logLevel; + +@end + +#endif /* __NGLogger_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogger.m b/Misc/WebUI/NGExtensions/NGLogging/NGLogger.m new file mode 100644 index 000000000..52a08de1b --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogger.m @@ -0,0 +1,111 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 "NGLogger.h" +#include +#include "common.h" +#include "NGLogEvent.h" +#include "NGLogAppender.h" + + +@implementation NGLogger + +- (id)init { + self = [self initWithLogLevel:NGLogLevelAll]; + return self; +} + +- (id)initWithLogLevel:(NGLogLevel)_level { + if((self = [super init])) { + NSUserDefaults *ud; + NSString *appenderClassName; + + [self setLogLevel:_level]; + +#warning ** remove this as soon as we have a config + ud = [NSUserDefaults standardUserDefaults]; + appenderClassName = [ud stringForKey:@"NGLogDefaultAppenderClass"]; + if(appenderClassName == nil) + appenderClassName = @"NGLogConsoleAppender"; + self->_appender = [[NSClassFromString(appenderClassName) alloc] init]; + } + return self; +} + +- (void)dealloc { + [self->_appender release]; + [super dealloc]; +} + + +- (void)setLogLevel:(NGLogLevel)_level { + self->minLogLevel = _level; +} + +- (NGLogLevel)logLevel { + return self->minLogLevel; +} + +- (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ... { + NSString *msg; + NGLogEvent *event; + va_list va; + + if(self->minLogLevel > _level) + return; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + + event = [[NGLogEvent alloc] initWithLevel:_level message:msg]; + + // iterate appenders + // TODO: as soon as we have more appenders, we need to iterate on them + [self->_appender appendLogEvent:event]; + + [event release]; + [msg release]; +} + +- (BOOL)isLogDebugEnabled { + return self->minLogLevel >= NGLogLevelDebug; +} + +- (BOOL)isLogInfoEnabled { + return self->minLogLevel >= NGLogLevelInfo; +} + +- (BOOL)isLogWarnEnabled { + return self->minLogLevel >= NGLogLevelWarn; +} + +- (BOOL)isLogErrorEnabled { + return self->minLogLevel >= NGLogLevelError; +} + +- (BOOL)isLogFatalEnabled { + return self->minLogLevel >= NGLogLevelFatal; +} + +@end diff --git a/Misc/WebUI/NGExtensions/NGLogging/NGLogging.h b/Misc/WebUI/NGExtensions/NGLogging/NGLogging.h new file mode 100644 index 000000000..b774724a0 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NGLogging.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NGLogging_H_ +#define __NGLogging_H_ + +/* + NGLogging is a somewhat more sophisticated logging framework, modeled + apparently similar to log4j - without some of its bloat. The current + idea is to replace the default logging used throughout OGo (-logWithFormat:, + -debugWithFormat:, NSLog()) with the new logging framework to get rid of + stdout only logging. +*/ + + +#import + +#include "NSObject+ExtendedLogging.h" +#include "NGLogger.h" + + +#endif /* __NGLogging_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.h b/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.h new file mode 100644 index 000000000..04845d9a5 --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.h @@ -0,0 +1,63 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __NSObject_ExtendedLogging_H_ +#define __NSObject_ExtendedLogging_H_ + + +#import + + +typedef enum { + NGLogLevelAll = 0, + NGLogLevelDebug = 1, + NGLogLevelInfo = 2, + NGLogLevelWarn = 3, + NGLogLevelError = 4, + NGLogLevelFatal = 5, + NGLogLevelOff = 6 +} NGLogLevel; + + +@interface NSObject (NGExtendedLogging) + +- (id)sharedLogger; +- (id)logger; + +- (void)logDebugWithFormat:(NSString *)_fmt, ...; +- (void)logInfoWithFormat:(NSString *)_fmt, ...; +- (void)logWarnWithFormat:(NSString *)_fmt, ...; +- (void)logErrorWithFormat:(NSString *)_fmt, ...; +- (void)logFatalWithFormat:(NSString *)_fmt, ...; + +- (BOOL)isLogDebugEnabled; +- (BOOL)isLogInfoEnabled; +- (BOOL)isLogWarnEnabled; +- (BOOL)isLogErrorEnabled; +- (BOOL)isLogFatalEnabled; + +- (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ...; + +@end + +#endif /* __NSObject_ExtendedLogging_H_ */ diff --git a/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.m b/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.m new file mode 100644 index 000000000..50d30204a --- /dev/null +++ b/Misc/WebUI/NGExtensions/NGLogging/NSObject+ExtendedLogging.m @@ -0,0 +1,128 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#import "NSObject+ExtendedLogging.h" +#import "NGLogger.h" + + +@implementation NSObject (NGExtendedLogging) + +- (id)sharedLogger { + static id sharedLogger = nil; + if(sharedLogger == nil) { + sharedLogger = [[NGLogger alloc] init]; + } + return sharedLogger; +} + +- (id)logger { + return [self sharedLogger]; +} + +- (void)logDebugWithFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [self logLevel:NGLogLevelDebug withFormat:msg]; + [msg release]; +} + +- (void)logInfoWithFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [self logLevel:NGLogLevelInfo withFormat:msg]; + [msg release]; +} + +- (void)logWarnWithFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [self logLevel:NGLogLevelWarn withFormat:msg]; + [msg release]; +} + +- (void)logErrorWithFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [self logLevel:NGLogLevelError withFormat:msg]; + [msg release]; +} + +- (void)logFatalWithFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [self logLevel:NGLogLevelFatal withFormat:msg]; + [msg release]; +} + +- (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ... { + NSString *msg; + va_list va; + + va_start(va, _fmt); + msg = [[NSString alloc] initWithFormat:_fmt arguments:va]; + va_end(va); + [[self logger] logLevel:_level withFormat:msg]; + [msg release]; +} + +- (BOOL)isLogDebugEnabled { + return [[self logger] isLogDebugEnabled]; +} + +- (BOOL)isLogInfoEnabled { + return [[self logger] isLogInfoEnabled]; +} + +- (BOOL)isLogWarnEnabled { + return [[self logger] isLogWarnEnabled]; +} + +- (BOOL)isLogErrorEnabled { + return [[self logger] isLogErrorEnabled]; +} + +- (BOOL)isLogFatalEnabled { + return [[self logger] isLogFatalEnabled]; +} + +@end diff --git a/Misc/WebUI/NOTES b/Misc/WebUI/NOTES new file mode 100644 index 000000000..16dc5b805 --- /dev/null +++ b/Misc/WebUI/NOTES @@ -0,0 +1,15 @@ +$Id$ + +- NGExtensions + - Stuff I believe might be useful for later addition to NGExtensions framework + + - NGLogging + - Had a look at log4cocoa, appeared to be too bloated (they mimic all of + log4j which doesn't really make sense in Objective-C). + - NGLogConsoleAppender is the only appender currently available, it's + hardcoded in NGLogger as default. This should change as soon as we have + a config for that purpose. Logging is low priority, so we don't need to + do that too soon. + - Syslog appender might be useful for the ministry. Syslog provides its own + buffering, so syslog appender should be straight forward. Current + implementation makes some fix assumptions (log facility). \ No newline at end of file diff --git a/Misc/WebUI/PROJECTLEAD b/Misc/WebUI/PROJECTLEAD new file mode 100644 index 000000000..ab0c70acd --- /dev/null +++ b/Misc/WebUI/PROJECTLEAD @@ -0,0 +1,3 @@ +# $Id$ + +PROJECTLEAD=helge.hess@opengroupware.org diff --git a/Misc/WebUI/README b/Misc/WebUI/README new file mode 100644 index 000000000..c5beb54d3 --- /dev/null +++ b/Misc/WebUI/README @@ -0,0 +1,24 @@ +$Id$ + + +WebUI + Part of SOGo + Copyright (C) 2000-2004 SKYRIX Software AG - http://www.skyrix.com/ + +Subprojects +=========== + +- NGExtensions + - NGLogging + + +UserDefaults +============ + + Default | Type | Example Value + ============================================================== + NGLogSyslogIdentifier | String | WebUI + NGLogDefaultAppenderClass| String | NGLogConsoleAppender + + + diff --git a/Misc/WebUI/Session.h b/Misc/WebUI/Session.h new file mode 100644 index 000000000..9cea90775 --- /dev/null +++ b/Misc/WebUI/Session.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __Session_H_ +#define __Session_H_ + + +#include + + +@interface Session : WOSession +{ + +} + +@end + +#endif /* __Session_H_ */ diff --git a/Misc/WebUI/Session.m b/Misc/WebUI/Session.m new file mode 100644 index 000000000..58c00f537 --- /dev/null +++ b/Misc/WebUI/Session.m @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 "Session.h" +#include "common.h" + + +@implementation Session + +- (id)init { + self = [super init]; + if(self) { + [self logWarnWithFormat:@"session with id '%@' did init - this " \ + @"should NOT happen!", [self sessionID]]; + } + return self; +} +@end diff --git a/Misc/WebUI/TODO b/Misc/WebUI/TODO new file mode 100644 index 000000000..e69de29bb diff --git a/Misc/WebUI/Version b/Misc/WebUI/Version new file mode 100644 index 000000000..f96f6a3cf --- /dev/null +++ b/Misc/WebUI/Version @@ -0,0 +1,15 @@ +# $Id$ +# +# This file is included by library makefiles to set the version information +# of the executable. +# +# NOTE: This has no effect whatsover if you are using Xcode on Mac OS X. +# For Xcode please use the appropriate user interface or issue the following +# command in a shell: +# /Developer/Tools/agvtool new-version \ +# ${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} + +MAJOR_VERSION=1 +MINOR_VERSION=0 +SUBMINOR_VERSION=0 + diff --git a/Misc/WebUI/WebServerResources/favicon.ico b/Misc/WebUI/WebServerResources/favicon.ico new file mode 100644 index 000000000..829cb223f Binary files /dev/null and b/Misc/WebUI/WebServerResources/favicon.ico differ diff --git a/Misc/WebUI/WebUI.xcode/project.pbxproj b/Misc/WebUI/WebUI.xcode/project.pbxproj new file mode 100644 index 000000000..676185015 --- /dev/null +++ b/Misc/WebUI/WebUI.xcode/project.pbxproj @@ -0,0 +1,952 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 39; + objects = { + 080E96DDFE201D6D7F000001 = { + children = ( + AD95C2640664CE7400FCB211, + AD19ED5205D7FBD1009EBA3A, + AD19ED5305D7FBD1009EBA3A, + AD19ED6305D7FBEA009EBA3A, + AD19ED6405D7FBEA009EBA3A, + ADEE3DD505DD126900F523DB, + ADEE3DD605DD126900F523DB, + 32CA4F630368D1EE00C91783, + 29B97316FDCFA39411CA2CEA, + ); + isa = PBXGroup; + name = "Main Server"; + refType = 4; + sourceTree = ""; + }; + 089C165CFE840E0CC02AAC07 = { + children = ( + 089C165DFE840E0CC02AAC07, + ); + isa = PBXVariantGroup; + name = InfoPlist.strings; + refType = 4; + sourceTree = ""; + }; + 089C165DFE840E0CC02AAC07 = { + fileEncoding = 10; + isa = PBXFileReference; + lastKnownFileType = text.plist.strings; + name = English; + path = English.lproj/InfoPlist.strings; + refType = 4; + sourceTree = ""; + }; +//080 +//081 +//082 +//083 +//084 +//100 +//101 +//102 +//103 +//104 + 1058C7A1FEA54F0111CA2CBB = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = Foundation.framework; + path = /System/Library/Frameworks/Foundation.framework; + refType = 0; + sourceTree = ""; + }; +//100 +//101 +//102 +//103 +//104 +//190 +//191 +//192 +//193 +//194 + 19C28FACFE9D520D11CA2CBB = { + children = ( + 8D1107320486CEB800E47090, + ); + isa = PBXGroup; + name = Products; + refType = 4; + sourceTree = ""; + }; +//190 +//191 +//192 +//193 +//194 +//290 +//291 +//292 +//293 +//294 + 29B97313FDCFA39411CA2CEA = { + buildSettings = { + }; + buildStyles = ( + 4A9504CCFFE6A4B311CA0CBA, + 4A9504CDFFE6A4B311CA0CBA, + ); + hasScannedForEncodings = 1; + isa = PBXProject; + mainGroup = 29B97314FDCFA39411CA2CEA; + projectDirPath = ""; + targets = ( + 8D1107260486CEB800E47090, + ); + }; + 29B97314FDCFA39411CA2CEA = { + children = ( + ADA38BE605DD23C400C820AA, + AD95C1890664C1E400FCB211, + AD95C18B0664C1E400FCB211, + AD95C1870664C1E400FCB211, + AD95C1880664C1E400FCB211, + AD95C18A0664C1E400FCB211, + ADC15A300664CF290063754B, + AD95AEBB0664BC7B00FCB211, + AD95AEB90664BC6700FCB211, + AD0ACCDE062732BD0054A820, + 080E96DDFE201D6D7F000001, + ADC15A400664D0F50063754B, + 29B97317FDCFA39411CA2CEA, + ADEE3DCE05DD11C900F523DB, + 29B97323FDCFA39411CA2CEA, + 19C28FACFE9D520D11CA2CBB, + ); + isa = PBXGroup; + name = WebUI; + path = ""; + refType = 4; + sourceTree = ""; + }; + 29B97316FDCFA39411CA2CEA = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = WebUI_main.m; + refType = 4; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA = { + children = ( + 8D1107310486CEB800E47090, + 089C165CFE840E0CC02AAC07, + ADA38B8105DD238A00C820AA, + ); + isa = PBXGroup; + name = Resources; + path = ""; + refType = 4; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA = { + children = ( + 1058C7A1FEA54F0111CA2CBB, + ADEE3DEB05DD135A00F523DB, + AD19ED3105D7FAF4009EBA3A, + ADEE3DDB05DD131E00F523DB, + ); + isa = PBXGroup; + name = Frameworks; + path = ""; + refType = 4; + sourceTree = ""; + }; +//290 +//291 +//292 +//293 +//294 +//320 +//321 +//322 +//323 +//324 + 32CA4F630368D1EE00C91783 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = WebUI_Prefix.pch; + refType = 4; + sourceTree = ""; + }; +//320 +//321 +//322 +//323 +//324 +//4A0 +//4A1 +//4A2 +//4A3 +//4A4 + 4A9504CCFFE6A4B311CA0CBA = { + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OPTIMIZATION_CFLAGS = "-O0"; + ZERO_LINK = YES; + }; + isa = PBXBuildStyle; + name = Development; + }; + 4A9504CDFFE6A4B311CA0CBA = { + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + ZERO_LINK = NO; + }; + isa = PBXBuildStyle; + name = Deployment; + }; +//4A0 +//4A1 +//4A2 +//4A3 +//4A4 +//8D0 +//8D1 +//8D2 +//8D3 +//8D4 + 8D1107260486CEB800E47090 = { + buildPhases = ( + 8D1107270486CEB800E47090, + 8D1107290486CEB800E47090, + 8D11072C0486CEB800E47090, + 8D11072E0486CEB800E47090, + ADF026F205D903AE00D2292D, + ); + buildRules = ( + ); + buildSettings = { + FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WebUI_Prefix.pch; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + HEADER_SEARCH_PATHS = "-INGExtensions -INGExtensions/NGLogging"; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "-DCOCOA_Foundation_LIBRARY=1 -DNeXT_RUNTIME=1 -DAPPLE_RUNTIME=1"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = WebUI; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + WRAPPER_EXTENSION = sopex; + }; + dependencies = ( + ); + isa = PBXNativeTarget; + name = WebUI; + productInstallPath = "$(HOME)/Applications"; + productName = WebUI; + productReference = 8D1107320486CEB800E47090; + productType = "com.apple.product-type.application"; + }; + 8D1107270486CEB800E47090 = { + buildActionMask = 2147483647; + files = ( + 8D1107280486CEB800E47090, + AD19ED5405D7FBD1009EBA3A, + AD19ED6505D7FBEA009EBA3A, + ADEE3DD705DD126900F523DB, + AD95C2660664CE7400FCB211, + ADC15A430664D1D90063754B, + ADC15A470664DA320063754B, + ADC15A4B0664DA980063754B, + ADC15A4F0664E25B0063754B, + ADC15A560664E33A0063754B, + AD1967250665E52400E19038, + AD0618D0066610A200AC467F, + ); + isa = PBXHeadersBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 8D1107280486CEB800E47090 = { + fileRef = 32CA4F630368D1EE00C91783; + isa = PBXBuildFile; + settings = { + }; + }; + 8D1107290486CEB800E47090 = { + buildActionMask = 2147483647; + files = ( + 8D11072B0486CEB800E47090, + ADEE3DD005DD11C900F523DB, + ADA38B8205DD238A00C820AA, + AD95AEBA0664BC6700FCB211, + AD95AEBC0664BC7B00FCB211, + AD0618D50666121C00AC467F, + ); + isa = PBXResourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 8D11072B0486CEB800E47090 = { + fileRef = 089C165CFE840E0CC02AAC07; + isa = PBXBuildFile; + settings = { + }; + }; + 8D11072C0486CEB800E47090 = { + buildActionMask = 2147483647; + files = ( + 8D11072D0486CEB800E47090, + AD19ED5505D7FBD1009EBA3A, + AD19ED6605D7FBEA009EBA3A, + ADEE3DD805DD126900F523DB, + ADC15A440664D1D90063754B, + ADC15A4C0664DA980063754B, + ADC15A500664E25B0063754B, + ADC15A570664E33A0063754B, + AD1967260665E52400E19038, + AD0618D1066610A200AC467F, + ); + isa = PBXSourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 8D11072D0486CEB800E47090 = { + fileRef = 29B97316FDCFA39411CA2CEA; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + ); + }; + }; + 8D11072E0486CEB800E47090 = { + buildActionMask = 2147483647; + files = ( + ADEE3DEC05DD135A00F523DB, + ADEE3DDC05DD131F00F523DB, + ); + isa = PBXFrameworksBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + 8D1107310486CEB800E47090 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.plist; + path = Info.plist; + refType = 4; + sourceTree = ""; + }; + 8D1107320486CEB800E47090 = { + explicitFileType = wrapper.application; + includeInIndex = 0; + isa = PBXFileReference; + path = WebUI.sopex; + refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; + }; +//8D0 +//8D1 +//8D2 +//8D3 +//8D4 +//AD0 +//AD1 +//AD2 +//AD3 +//AD4 + AD0618CE066610A200AC467F = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogSyslogAppender.h; + refType = 4; + sourceTree = ""; + }; + AD0618CF066610A200AC467F = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = NGLogSyslogAppender.m; + refType = 4; + sourceTree = ""; + }; + AD0618D0066610A200AC467F = { + fileRef = AD0618CE066610A200AC467F; + isa = PBXBuildFile; + settings = { + }; + }; + AD0618D1066610A200AC467F = { + fileRef = AD0618CF066610A200AC467F; + isa = PBXBuildFile; + settings = { + }; + }; + AD0618D40666121C00AC467F = { + explicitFileType = text; + fileEncoding = 4; + isa = PBXFileReference; + path = ChangeLog; + refType = 4; + sourceTree = ""; + tabWidth = 4; + usesTabs = 1; + }; + AD0618D50666121C00AC467F = { + fileRef = AD0618D40666121C00AC467F; + isa = PBXBuildFile; + settings = { + }; + }; + AD0ACCDE062732BD0054A820 = { + children = ( + AD0ACCDF062733370054A820, + AD0ACCE1062733370054A820, + AD0ACCE0062733370054A820, + ); + isa = PBXGroup; + name = Makefiles; + refType = 4; + sourceTree = ""; + }; + AD0ACCDF062733370054A820 = { + explicitFileType = sourcecode.make; + fileEncoding = 30; + isa = PBXFileReference; + path = GNUmakefile; + refType = 4; + sourceTree = ""; + }; + AD0ACCE0062733370054A820 = { + explicitFileType = sourcecode.make; + fileEncoding = 30; + isa = PBXFileReference; + path = GNUmakefile.postamble; + refType = 4; + sourceTree = ""; + }; + AD0ACCE1062733370054A820 = { + explicitFileType = sourcecode.make; + fileEncoding = 30; + isa = PBXFileReference; + path = GNUmakefile.preamble; + refType = 4; + sourceTree = ""; + }; + AD1967230665E52400E19038 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogConsoleAppender.h; + refType = 4; + sourceTree = ""; + }; + AD1967240665E52400E19038 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = NGLogConsoleAppender.m; + refType = 4; + sourceTree = ""; + }; + AD1967250665E52400E19038 = { + fileRef = AD1967230665E52400E19038; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + AD1967260665E52400E19038 = { + fileRef = AD1967240665E52400E19038; + isa = PBXBuildFile; + settings = { + }; + }; + AD1967610665FE4800E19038 = { + children = ( + AD1967620665FE5B00E19038, + ); + isa = PBXGroup; + name = Makefiles; + refType = 4; + sourceTree = ""; + }; + AD1967620665FE5B00E19038 = { + explicitFileType = sourcecode.make; + fileEncoding = 4; + isa = PBXFileReference; + path = GNUmakefile; + refType = 4; + sourceTree = ""; + }; + AD1967660665FE6800E19038 = { + children = ( + AD1967670665FE9200E19038, + ); + isa = PBXGroup; + name = Makefiles; + path = NGExtensions; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + AD1967670665FE9200E19038 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + name = GNUmakefile; + path = NGLogging/GNUmakefile; + refType = 4; + sourceTree = ""; + }; + AD19ED3105D7FAF4009EBA3A = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = SOPE.framework; + path = /Library/Frameworks/SOPE.framework; + refType = 0; + sourceTree = ""; + }; + AD19ED5205D7FBD1009EBA3A = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = Application.h; + refType = 4; + sourceTree = ""; + }; + AD19ED5305D7FBD1009EBA3A = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = Application.m; + refType = 4; + sourceTree = ""; + }; + AD19ED5405D7FBD1009EBA3A = { + fileRef = AD19ED5205D7FBD1009EBA3A; + isa = PBXBuildFile; + settings = { + }; + }; + AD19ED5505D7FBD1009EBA3A = { + fileRef = AD19ED5305D7FBD1009EBA3A; + isa = PBXBuildFile; + settings = { + }; + }; + AD19ED6305D7FBEA009EBA3A = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = Session.h; + refType = 4; + sourceTree = ""; + }; + AD19ED6405D7FBEA009EBA3A = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = Session.m; + refType = 4; + sourceTree = ""; + }; + AD19ED6505D7FBEA009EBA3A = { + fileRef = AD19ED6305D7FBEA009EBA3A; + isa = PBXBuildFile; + settings = { + }; + }; + AD19ED6605D7FBEA009EBA3A = { + fileRef = AD19ED6405D7FBEA009EBA3A; + isa = PBXBuildFile; + settings = { + }; + }; + AD95AEB90664BC6700FCB211 = { + explicitFileType = sourcecode.make; + fileEncoding = 4; + isa = PBXFileReference; + path = Version; + refType = 4; + sourceTree = ""; + }; + AD95AEBA0664BC6700FCB211 = { + fileRef = AD95AEB90664BC6700FCB211; + isa = PBXBuildFile; + settings = { + }; + }; + AD95AEBB0664BC7B00FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = ChangeLog; + refType = 4; + sourceTree = ""; + tabWidth = 4; + usesTabs = 1; + }; + AD95AEBC0664BC7B00FCB211 = { + fileRef = AD95AEBB0664BC7B00FCB211; + isa = PBXBuildFile; + settings = { + }; + }; + AD95C1870664C1E400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = COPYING; + refType = 4; + sourceTree = ""; + }; + AD95C1880664C1E400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = COPYRIGHT; + refType = 4; + sourceTree = ""; + }; + AD95C1890664C1E400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = NOTES; + refType = 4; + sourceTree = ""; + }; + AD95C18A0664C1E400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = PROJECTLEAD; + refType = 4; + sourceTree = ""; + }; + AD95C18B0664C1E400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = TODO; + refType = 4; + sourceTree = ""; + }; + AD95C2640664CE7400FCB211 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = common.h; + refType = 4; + sourceTree = ""; + }; + AD95C2660664CE7400FCB211 = { + fileRef = AD95C2640664CE7400FCB211; + isa = PBXBuildFile; + settings = { + }; + }; + ADA38B8105DD238A00C820AA = { + isa = PBXFileReference; + lastKnownFileType = image.icns; + path = Lori.icns; + refType = 4; + sourceTree = ""; + }; + ADA38B8205DD238A00C820AA = { + fileRef = ADA38B8105DD238A00C820AA; + isa = PBXBuildFile; + settings = { + }; + }; + ADA38BE605DD23C400C820AA = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = README; + refType = 4; + sourceTree = ""; + }; + ADC15A300664CF290063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text; + path = "wox-cheat-sheet.txt"; + refType = 4; + sourceTree = ""; + }; + ADC15A400664D0F50063754B = { + children = ( + AD1967610665FE4800E19038, + ADC15A530664E3280063754B, + ); + isa = PBXGroup; + path = NGExtensions; + refType = 4; + sourceTree = ""; + }; + ADC15A410664D1D90063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "NSObject+ExtendedLogging.h"; + refType = 4; + sourceTree = ""; + }; + ADC15A420664D1D90063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = "NSObject+ExtendedLogging.m"; + refType = 4; + sourceTree = ""; + }; + ADC15A430664D1D90063754B = { + fileRef = ADC15A410664D1D90063754B; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + ADC15A440664D1D90063754B = { + fileRef = ADC15A420664D1D90063754B; + isa = PBXBuildFile; + settings = { + }; + }; + ADC15A450664DA320063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogging.h; + refType = 4; + sourceTree = ""; + }; + ADC15A470664DA320063754B = { + fileRef = ADC15A450664DA320063754B; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + ADC15A490664DA980063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogger.h; + refType = 4; + sourceTree = ""; + }; + ADC15A4A0664DA980063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = NGLogger.m; + refType = 4; + sourceTree = ""; + }; + ADC15A4B0664DA980063754B = { + fileRef = ADC15A490664DA980063754B; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + ADC15A4C0664DA980063754B = { + fileRef = ADC15A4A0664DA980063754B; + isa = PBXBuildFile; + settings = { + }; + }; + ADC15A4D0664E25B0063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogAppender.h; + refType = 4; + sourceTree = ""; + }; + ADC15A4E0664E25B0063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = NGLogAppender.m; + refType = 4; + sourceTree = ""; + }; + ADC15A4F0664E25B0063754B = { + fileRef = ADC15A4D0664E25B0063754B; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + ADC15A500664E25B0063754B = { + fileRef = ADC15A4E0664E25B0063754B; + isa = PBXBuildFile; + settings = { + }; + }; + ADC15A530664E3280063754B = { + children = ( + AD1967660665FE6800E19038, + AD0618D40666121C00AC467F, + ADC15A450664DA320063754B, + ADC15A410664D1D90063754B, + ADC15A420664D1D90063754B, + ADC15A490664DA980063754B, + ADC15A4A0664DA980063754B, + ADC15A540664E33A0063754B, + ADC15A550664E33A0063754B, + ADC15A4D0664E25B0063754B, + ADC15A4E0664E25B0063754B, + AD1967230665E52400E19038, + AD1967240665E52400E19038, + AD0618CE066610A200AC467F, + AD0618CF066610A200AC467F, + ); + isa = PBXGroup; + name = Logging; + path = NGLogging; + refType = 4; + sourceTree = ""; + }; + ADC15A540664E33A0063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = NGLogEvent.h; + refType = 4; + sourceTree = ""; + }; + ADC15A550664E33A0063754B = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = NGLogEvent.m; + refType = 4; + sourceTree = ""; + }; + ADC15A560664E33A0063754B = { + fileRef = ADC15A540664E33A0063754B; + isa = PBXBuildFile; + settings = { + ATTRIBUTES = ( + Public, + ); + }; + }; + ADC15A570664E33A0063754B = { + fileRef = ADC15A550664E33A0063754B; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DCE05DD11C900F523DB = { + isa = PBXFileReference; + lastKnownFileType = folder; + path = WebServerResources; + refType = 4; + sourceTree = ""; + }; + ADEE3DD005DD11C900F523DB = { + fileRef = ADEE3DCE05DD11C900F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DD405DD123C00F523DB = { + fileRef = ADEE3DCE05DD11C900F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DD505DD126900F523DB = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = DirectAction.h; + refType = 4; + sourceTree = ""; + }; + ADEE3DD605DD126900F523DB = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = DirectAction.m; + refType = 4; + sourceTree = ""; + }; + ADEE3DD705DD126900F523DB = { + fileRef = ADEE3DD505DD126900F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DD805DD126900F523DB = { + fileRef = ADEE3DD605DD126900F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DDB05DD131E00F523DB = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = SOPEX.framework; + path = /Library/Frameworks/SOPEX.framework; + refType = 0; + sourceTree = ""; + }; + ADEE3DDC05DD131F00F523DB = { + fileRef = ADEE3DDB05DD131E00F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADEE3DEB05DD135A00F523DB = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = Cocoa.framework; + path = /System/Library/Frameworks/Cocoa.framework; + refType = 0; + sourceTree = ""; + }; + ADEE3DEC05DD135A00F523DB = { + fileRef = ADEE3DEB05DD135A00F523DB; + isa = PBXBuildFile; + settings = { + }; + }; + ADF026F205D903AE00D2292D = { + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 1; + files = ( + ADEE3DD405DD123C00F523DB, + ); + isa = PBXCopyFilesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; + }; + }; + rootObject = 29B97313FDCFA39411CA2CEA; +} diff --git a/Misc/WebUI/WebUI_Prefix.pch b/Misc/WebUI/WebUI_Prefix.pch new file mode 100644 index 000000000..c12a93e6f --- /dev/null +++ b/Misc/WebUI/WebUI_Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header for all source files of the 'WebUI' target in the 'WebUI' project +// + +#ifdef __OBJC__ + #import + #include + #include +#endif diff --git a/Misc/WebUI/WebUI_main.m b/Misc/WebUI/WebUI_main.m new file mode 100644 index 000000000..dfe7dcd53 --- /dev/null +++ b/Misc/WebUI/WebUI_main.m @@ -0,0 +1,35 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#ifdef WITHOUT_SOPEX +#import +#define SOPEXMain WOApplicationMain +#else +#import +#endif /* WITHOUT_SOPEX */ + + +int main(int argc, const char *argv[]) +{ + return SOPEXMain(@"Application", argc, argv); +} diff --git a/Misc/WebUI/common.h b/Misc/WebUI/common.h new file mode 100644 index 000000000..79bf6b89a --- /dev/null +++ b/Misc/WebUI/common.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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 __common_H_ +#define __common_H_ + + +#import + +#include "NGLogging.h" + + +#endif /* __common_H_ */ diff --git a/Misc/WebUI/version.plist b/Misc/WebUI/version.plist new file mode 100644 index 000000000..6f3c68caa --- /dev/null +++ b/Misc/WebUI/version.plist @@ -0,0 +1,16 @@ + + + + + BuildVersion + 1 + CFBundleShortVersionString + 0.1 + CFBundleVersion + 0.1 + ProjectName + NibPBTemplates + SourceVersion + 1160200 + + diff --git a/Misc/WebUI/wox-cheat-sheet.txt b/Misc/WebUI/wox-cheat-sheet.txt new file mode 100644 index 000000000..4a79b24bf --- /dev/null +++ b/Misc/WebUI/wox-cheat-sheet.txt @@ -0,0 +1,50 @@ +WOxControlElemBuilder +--------------------- + +:if -> WOConditional +:foreach -> WORepetition +:for-each -> WORepetition +:with -> WOSetCursor + +WOxMiscElemBuilder +------------------ + +:component-content -> WOComponentContent +:checkbox-list -> WOCheckBoxList +:entity -> WOEntity +:multiselection -> WOBrowser +:nbsp /*DEPRECATED*/ -> WOEntity +:popup -> WOPopUpButton +:radio-button-matrix -> WORadioButtonMatrix +:string -> WOString +:singleselection -> WOBrowser + + +WOxHTMLElemBuilder +------------------ + +:text -> WOTextField +:file -> WOFileUpload +:a -> WOHyperlink +:img -> WOImage +:form -> WOForm +:textarea -> WOText +:embed -> WOEmbeddedObject +:frame -> WOFrame +:iframe -> WOIFrame +:body -> WOBody + +:input [type="submit"] -> WOSubmitButton +:input [type="reset"] -> WOResetButton +:input [type="image"] -> WOImageButton +:input [type="radio"] -> WORadioButton +:input [type="checkbox"] -> WOCheckBox +:input [type="file"] -> WOFileUpload +:input [type="hidden"] -> WOHiddenField +:input [type="password"] -> WOPasswordField +:input [type="*"] -> WOTextField + +:meta [http-equiv="refresh*"] -> WOMetaRefresh + +:* [hasChildNodes="YES"] -> WOGenericContainer +:* [hasChildNodes="NO"] -> WOGenericElement diff --git a/Misc/ZideStore/UI-X/ChangeLog b/Misc/ZideStore/UI-X/ChangeLog new file mode 100644 index 000000000..f8c8667da --- /dev/null +++ b/Misc/ZideStore/UI-X/ChangeLog @@ -0,0 +1,208 @@ +2004-06-30 Marcus Müller + + * Scheduler/UIxAppointmentEditor.m: improved -saveAction. Does + everything in a complete manner now - except for saving which isn't + done at all. + +2004-06-30 Helge Hess + + * Scheduler/UIxAppointmentEditor.m: made the hack more hackish to work + on MacOSX + +2004-06-28 Marcus Mueller + + * Common/UIxComponent.[hm]: moved -ownMethodName here. + + * Scheduler/UIxCalView.[hm]: removed -ownMethodName, moved to + UIxComponent (reuse). + + * Scheduler/UIxAppointmentView.[hm]: first "draft" of view component. + The look of OGo is resembled closely, but most features are still + missing. + +2004-06-28 Marcus Mueller + + * Scheduler/GNUmakefile.preamble: links against libSOGoLogic now. + + * Scheduler/UIxAppointmentView.m, Scheduler/UIxAppointmentView.wox: + test of iCal object. + +2004-06-23 Marcus Mueller + + * UIxCalMonthOverview.[m,wox]: completed month view. Turned out to + be much more difficult to improve with style sheets than expected. + Requires version 4.2.45 of WEExtensions. + +2004-06-22 Marcus Mueller + + * Refactoring: Renamed everything from OGo to UIx in order to avoid + nameclashes (happens on OSX related to NGBundleManager) + + * Refactoring 2: Moved methods from UIxWeekOverview to UIxCalView. + + * Highlighting in UIxWeekOverview works now. + +2004-06-22 Helge Hess + + * Common/GNUmakefile.preamble: fixed linking for OGo gstep-make + +2004-06-21 Helge Hess + + * Scheduler/OGoCalWeekOverview.m: fixed syntax errors + +2004-06-18 Marcus Mueller + + * Implemented proper calendar in week overview. Highlighting isn't + enabled, yet. + +2004-06-18 Marcus Mueller + + * Common/OGoComponent.[hm]: new component which serves as a base + component for calendar components now. Knows how to deal with + queryParameters and offers url construction method(s). + + * All existing components have been rewritten to use queryParameters + instead of hardcoded strings where this is feasible. This provides + future extensibility and flexibility. + + * Handling of dates has been fixed to center around the use of a + 'day' parameter. startDate/endDate are coupled to this, but + don't override it as it's the duty of the individual view to set + its (feasible) ranges accordingly. The new behaviour is noticable + in the calendar selection tabview instantly, as it now replicates + what OGo does. + +2004-06-16 Marcus Mueller + + * Common/OGoAppNavView.m: construct URL correctly. + + * Common/OGoPageFrame.m: display login correctly. + + * Common/calendar.css: cosmetic changes. + + * Scheduler/OGoCalSelectTab.m: always display mondayOfWeek. + + * Scheduler/OGoCalBackForthNavView.m: created. + +2004-06-16 Marcus Mueller + + * Common/zidestoreui.css: new style for button_auto. + + * Scheduler/OGoCalView.[hm]: API for completing hrefs with necessary + query parts. + + * Scheduler/OGoCalWeekView.m: bugfix for startDate. + + * Scheduler/product.plist: added still missing views -> point to + weekoverview for the time being. + +2004-06-15 Marcus Mueller + + * Common/UIxTabView.m: removed class from tag, removed rendering + of headerFooter (what's that good for anyways?) + + * Several resources which resolved to wrong products added statically + in templates. + + * Cosmetic changes in templates. + +2004-06-14 Helge Hess + + * Scheduler/OGoCalMonthOverview.wox: added missing rsrc namespace + +2004-06-14 Helge Hess + + * Common/common.h: fixed a gcc 3.4 warning + +2004-06-14 Helge Hess + + * added aggregate project for UI-X + +2004-06-14 Marcus Mueller + + * Common/calendar.css: new date_label (unused) + + * Scheduler/OGoCalSelectTab.m: finished all labels + + * Scheduler/OGoCalDateLabel.m, Scheduler/OGoCalDateLabel.wox: new + component for rendering the correct date label based on startDate, + endDate and selection + + * Scheduler/OGoCalMonthView.m: prev/next month corrected + + * Scheduler/OGoCalMonthOverview.wox: uses date label and tabs now + + * Scheduler/OGoCalWeekOverview.wox: completed layout + + * Scheduler/GNUmakefile: new component added + +2004-06-14 Marcus Mueller + + * Common/UIxTabView.[hm]: more stylesheet support via headerStyle + and bodyStyle bindings. + + * Common/zidestoreui.css: styles for tabs, resembling OGo look. + + * Scheduler/OGoCalSelectTab.m: implemented dateLabel (for testing). + + * Scheduler/OGoCalSelectTab.wox: corrected selection binding namespace. + +2004-06-08 Helge Hess + + * Scheduler/NOTES: added class hierarchy + + * */common.h, GNUmakefile.preamble.: fixed for OSX compile + +2004-06-08 Marcus Mueller + + * Common/images: added a bunch of images from OGo + +2004-06-07 Marcus Mueller + + * Custom/GNUmakefile: changed ZIDESTORE to include installed version + (ZideStore12). Removed post install hooks. + + * Custom/GNUmakefile.postamble: new file, post install hooks and + xmllint for .wox. + +2004-06-07 Marcus Mueller + + * Scheduler/GNUmakefile: changed ZIDESTORE to include installed version + (ZideStore12). Removed post install hooks. + + * Scheduler/GNUmakefile.postamble: post install hooks updated for + GNUSTEP_BUILD_DIR. + +2004-06-03 Helge Hess + + * Scheduler/OGoCalWeekOverview.m: moved navigation URL generation to + superclass (now generic because we use the 'ownMethodName'). Could + even be moved to OGoCalView? + + * Scheduler/OGoCalMonthView.m: added next/prev month URL generation + methods, calculate startdate from form value + + * Scheduler/OGoCalView.m: added -ownMethodName method to return the + last path component of the request URL (the SOPE method), eg + 'weekoverview' for OGoCalWeekView, added + -dateNavigationURLWithNewStartDate: method to calculate 'startDate' + URLs (should be improved to include existing query parameters!) + + * Scheduler/OGoCalWeekOverview.m: minor tweaks ;-) + +2004-06-03 Marcus Mueller + + * Scheduler/OGoCalWeekView.m: construct startDate from formValue, + otherwise use current week's monday as startDate. + + * Scheduler/OGoCalWeekOverview.wox: switch back/forth + + * Scheduler/OGoCalWeekOverview.m: provide URLs for switching back/forth + weekoverview. + + * Scheduler/OGoCalView.[hm]: methods for converting dates into strings + and vice versa. + + * Scheduler/OGoAppointmentView.m, Scheduler/OGoCalView.m: fixed include + + * ChangeLog: created diff --git a/Misc/ZideStore/UI-X/Common/CommonUIProduct.m b/Misc/ZideStore/UI-X/Common/CommonUIProduct.m new file mode 100644 index 000000000..b5a4da4a4 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/CommonUIProduct.m @@ -0,0 +1,34 @@ +/* + Copyright (C) 2000-2003 SKYRIX Software AG + + This file is part of OGo + + 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: CommonUIProduct.m,v 1.1 2003/11/24 01:24:40 helge Exp $ + +#import + +@interface CommonUIProduct : NSObject +{ +} + +@end + +#include "common.h" + +@implementation CommonUIProduct +@end /* CommonUIProduct */ diff --git a/Misc/ZideStore/UI-X/Common/GNUmakefile b/Misc/ZideStore/UI-X/Common/GNUmakefile new file mode 100644 index 000000000..0fda272fc --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/GNUmakefile @@ -0,0 +1,82 @@ +# $Id: GNUmakefile,v 1.2 2003/12/09 17:38:42 helge Exp $ + +include $(GNUSTEP_MAKEFILES)/common.make + +ZIDESTORE=$(GNUSTEP_USER_ROOT)/Headers/ZideStore12 + + +BUNDLE_NAME = CommonUI +BUNDLE_EXTENSION = .zsp +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/ZideStore12 + +LIBRARY_NAME = libZideStoreCommonUI + + +libZideStoreCommonUI_HEADER_FILES_DIR = . +libZideStoreCommonUI_HEADER_FILES_INSTALL_DIR = $(ZIDESTORE)/Common + +libZideStoreCommonUI_HEADER_FILES += \ + UIxComponent.h \ + +libZideStoreCommonUI_OBJC_FILES += \ + UIxComponent.m \ + + +CommonUI_PRINCIPAL_CLASS = CommonUIProduct + +CommonUI_OBJC_FILES += \ + CommonUIProduct.m \ + UIxPageFrame.m \ + UIxAppFrame.m \ + UIxAppHeader.m \ + UIxAppNavigation.m \ + UIxWinClose.m \ + UIxAppNavView.m \ + \ + UIxElemBuilder.m \ + UIxTabView.m \ + UIxTabItem.m \ + + +CommonUI_RESOURCE_FILES += \ + Version \ + product.plist \ + UIxPageFrame.wox \ + UIxAppFrame.wox \ + UIxAppHeader.wox \ + UIxAppNavigation.wox \ + UIxWinClose.wox \ + UIxAppNavView.wox \ + \ + zidestoreui.css \ + calendar.css \ + \ + images/OGoLogo.gif \ + images/menu_logo_top.gif \ + images/line_left.gif \ + images/line_stretch.gif \ + images/line_right.gif \ + images/box_topleft.gif \ + images/box_top.gif \ + images/box_topright.gif \ + images/box_left.gif \ + images/box_right.gif \ + images/box_botleft.gif \ + images/box_bottom.gif\ + images/box_botright.gif\ + images/tab_selected.gif\ + images/tab_.gif\ + images/corner_right.gif\ + images/closewindow.gif + +ADDITIONAL_INCLUDE_DIRS += \ + -I. \ + -I$(ZIDESTORE)/Frontend -I$(ZIDESTORE)/Backend -I$(ZIDESTORE) + + +# make + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/library.make +include $(GNUSTEP_MAKEFILES)/bundle.make +-include GNUmakefile.postamble diff --git a/Misc/ZideStore/UI-X/Common/GNUmakefile.postamble b/Misc/ZideStore/UI-X/Common/GNUmakefile.postamble new file mode 100644 index 000000000..3986bccea --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/GNUmakefile.postamble @@ -0,0 +1,17 @@ +# $Id: GNUmakefile.postamble,v 1.1 2004/05/12 14:45:56 helge Exp $ + +validate-wox: + xmllint --noout *.wox + +before-all :: validate-wox + + +ifneq ($(GNUSTEP_BUILD_DIR),) +after-all :: + @(cp bundle-info.plist \ + $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) +else +after-all :: + @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ + cp ../bundle-info.plist .) +endif diff --git a/Misc/ZideStore/UI-X/Common/GNUmakefile.preamble b/Misc/ZideStore/UI-X/Common/GNUmakefile.preamble new file mode 100644 index 000000000..e76e480c0 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/GNUmakefile.preamble @@ -0,0 +1,16 @@ +# $Id$ + +ifneq ($(GNUSTEP_BUILD_DIR),) + RELBUILD_DIR_libZideStoreCommonUI = $(GNUSTEP_OBJ_DIR) +else + RELBUILD_DIR_libZideStoreCommonUI = $(GNUSTEP_OBJ_DIR) +endif + +libZideStoreCommonUI_LIBRARIES_DEPEND_UPON += -lNGObjWeb + +CommonUI_LIB_DIRS += -L$(RELBUILD_DIR_libZideStoreCommonUI) + +CommonUI_BUNDLE_LIBS += \ + -lNGObjWeb -lNGScripting \ + -lNGMime -lNGStreams -lNGExtensions -lEOControl \ + -lXmlRpc -lDOM -lSaxObjC -lZideStoreCommonUI diff --git a/Misc/ZideStore/UI-X/Common/UIxAppFrame.m b/Misc/ZideStore/UI-X/Common/UIxAppFrame.m new file mode 100644 index 000000000..51859cd6d --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppFrame.m @@ -0,0 +1,11 @@ +// $Id: UIxAppFrame.m 59 2004-06-22 13:40:19Z znek $ + +#include + +@interface UIxAppFrame : SoComponent +@end + +#include "common.h" + +@implementation UIxAppFrame +@end /* UIxAppFrame */ diff --git a/Misc/ZideStore/UI-X/Common/UIxAppFrame.wox b/Misc/ZideStore/UI-X/Common/UIxAppFrame.wox new file mode 100644 index 000000000..0437cf397 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppFrame.wox @@ -0,0 +1,44 @@ + + + + + <var:string value="title"/> + + + + + + + + + + + + + + + + + + + + + + + + This pages requires frame tags, which your browser does not support, + sorry ;-> + + diff --git a/Misc/ZideStore/UI-X/Common/UIxAppHeader.m b/Misc/ZideStore/UI-X/Common/UIxAppHeader.m new file mode 100644 index 000000000..3bba7b13a --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppHeader.m @@ -0,0 +1,11 @@ +// $Id: UIxAppHeader.m 59 2004-06-22 13:40:19Z znek $ + +#include + +@interface UIxAppHeader : SoComponent +@end + +#include "common.h" + +@implementation UIxAppHeader +@end /* UIxAppHeader */ diff --git a/Misc/ZideStore/UI-X/Common/UIxAppHeader.wox b/Misc/ZideStore/UI-X/Common/UIxAppHeader.wox new file mode 100644 index 000000000..4f8c0d270 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppHeader.wox @@ -0,0 +1,32 @@ + + + + + + + + + + + + +
+ reload - + resistance is obsolete ;-) +
+ + diff --git a/Misc/ZideStore/UI-X/Common/UIxAppNavView.m b/Misc/ZideStore/UI-X/Common/UIxAppNavView.m new file mode 100644 index 000000000..a6c8bd542 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppNavView.m @@ -0,0 +1,104 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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: UIxAppNavView.m 59 2004-06-22 13:40:19Z znek $ + + +#import +#import +#import +#import + + +@interface UIxAppNavView : WOComponent +{ + id element; + id lastElement; +} + +@end + + +@implementation UIxAppNavView + +- (void)dealloc { + [self->element release]; + [self->lastElement release]; + [super dealloc]; +} + +- (void)setElement:(id)_element { + ASSIGN(self->element, _element); +} + +- (id)element { + return self->element; +} + +- (void)setLastElement:(id)_element { + ASSIGN(self->lastElement, _element); +} + +- (id)lastElement { + return self->lastElement; +} + +- (NSArray *)navPathElements { + NSArray *traversalObjects; + NSMutableArray *navPathComponents; + NSMutableString *navURL; + unsigned int i, count; + + traversalObjects = [[self context] objectTraversalStack]; + count = ([traversalObjects count] - 1); /* remove SoPageInvocation */ + navPathComponents = [[NSMutableArray alloc] initWithCapacity:count]; + navURL = [[NSMutableString alloc] initWithString:@"/"]; + + for(i = 0; i < count; i++) { + NSString *name, *url; + id obj; + + obj = [traversalObjects objectAtIndex:i]; + + name = [obj davDisplayName]; + if(!name) + name = NSStringFromClass([obj class]); + + [navURL appendString:name]; + [navURL appendString:@"/"]; + + if(! [name hasPrefix:@"ZideStore"]) { + NSMutableDictionary *c; + + c = [[NSMutableDictionary alloc] initWithCapacity:2]; + [c setObject:name forKey:@"name"]; + url = [navURL copy]; + [c setObject:url forKey:@"url"]; + [url release]; + [navPathComponents addObject:c]; + [c release]; + } + } + + [self setLastElement:[navPathComponents lastObject]]; + return [navPathComponents autorelease]; +} + +@end diff --git a/Misc/ZideStore/UI-X/Common/UIxAppNavView.wox b/Misc/ZideStore/UI-X/Common/UIxAppNavView.wox new file mode 100644 index 000000000..6e924d43c --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppNavView.wox @@ -0,0 +1,10 @@ + + + +You are here:/ + \ No newline at end of file diff --git a/Misc/ZideStore/UI-X/Common/UIxAppNavigation.m b/Misc/ZideStore/UI-X/Common/UIxAppNavigation.m new file mode 100644 index 000000000..5b1912c89 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppNavigation.m @@ -0,0 +1,11 @@ +// $Id: UIxAppNavigation.m 59 2004-06-22 13:40:19Z znek $ + +#include + +@interface UIxAppNavigation : SoComponent +@end + +#include "common.h" + +@implementation UIxAppNavigation +@end /* UIxAppNavigation */ diff --git a/Misc/ZideStore/UI-X/Common/UIxAppNavigation.wox b/Misc/ZideStore/UI-X/Common/UIxAppNavigation.wox new file mode 100644 index 000000000..27eadaf53 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxAppNavigation.wox @@ -0,0 +1,85 @@ + + + + + + + + + + + + +
+ +
+ +
+ (reload) +
+ +
+ +
+ +
+ CSS Menues + + diff --git a/Misc/ZideStore/UI-X/Common/UIxComponent.h b/Misc/ZideStore/UI-X/Common/UIxComponent.h new file mode 100644 index 000000000..7782a76ab --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxComponent.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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: UIxComponent.h 84 2004-06-29 22:34:55Z znek $ + + +#ifndef __UIxComponent_H_ +#define __UIxComponent_H_ + +#include + +@class NSCalendarDate; + + +@interface UIxComponent : SoComponent +{ + NSMutableDictionary *queryParameters; +} + +- (NSString *)queryParameterForKey:(NSString *)_key; +- (NSDictionary *)queryParameters; + +/* use this to set 'sticky' query parameters */ +- (void)setQueryParameter:(NSString *)_param forKey:(NSString *)_key; + +/* appends queryParameters to _method if any are set */ +- (NSString *)completeHrefForMethod:(NSString *)_method; + +- (NSString *)ownMethodName; + +/* date selection */ +- (NSCalendarDate *)selectedDate; +- (NSString *)dateStringForDate:(NSCalendarDate *)_date; +- (NSCalendarDate *)dateForDateString:(NSString *)_dateString; + +@end + +#endif /* __UIxComponent_H_ */ diff --git a/Misc/ZideStore/UI-X/Common/UIxComponent.m b/Misc/ZideStore/UI-X/Common/UIxComponent.m new file mode 100644 index 000000000..81aeec573 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxComponent.m @@ -0,0 +1,168 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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: UIxComponent.m 84 2004-06-29 22:34:55Z znek $ + + +#include "UIxComponent.h" +#include +#include +#include + + +@interface UIxComponent (PrivateAPI) +- (void)_parseQueryString:(NSString *)_s; +@end + + +@implementation UIxComponent + +- (id)init { + if ((self = [super init])) { + self->queryParameters = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)dealloc { + [self->queryParameters release]; + [super dealloc]; +} + + +- (void)awake { + WORequest *req; + NSString *uri; + NSRange r; + + [super awake]; + + req = [[self context] request]; + uri = [req uri]; + r = [uri rangeOfString:@"?"]; + if(r.length > 0) { + NSString *qs; + + qs = [uri substringFromIndex:(r.location + r.length)]; + [self->queryParameters removeAllObjects]; + [self _parseQueryString:qs]; + } +} + +- (void)_parseQueryString:(NSString *)_s { + NSEnumerator *e; + NSString *part; + + e = [[_s componentsSeparatedByString:@"&"] objectEnumerator]; + while ((part = [e nextObject])) { + NSRange r; + NSString *key, *value; + + r = [part rangeOfString:@"="]; + if (r.length == 0) { + /* missing value of query parameter */ + key = [part stringByUnescapingURL]; + value = @"1"; + } + else { + key = [[part substringToIndex:r.location] stringByUnescapingURL]; + value = [[part substringFromIndex:(r.location + r.length)] + stringByUnescapingURL]; + } + [self->queryParameters setObject:value forKey:key]; + } +} + +- (NSString *)queryParameterForKey:(NSString *)_key { + return [self->queryParameters objectForKey:_key]; +} + +- (void)setQueryParameter:(NSString *)_param forKey:(NSString *)_key { + if(_key == nil) + return; + + if(_param != nil) + [self->queryParameters setObject:_param forKey:_key]; + else + [self->queryParameters removeObjectForKey:_key]; +} + +- (NSDictionary *)queryParameters { + return self->queryParameters; +} + +- (NSString *)completeHrefForMethod:(NSString *)_method { + NSDictionary *qp; + NSString *qs; + + qp = [self queryParameters]; + if([qp count] == 0) + return _method; + + qs = [[self context] queryStringFromDictionary:qp]; + return [_method stringByAppendingFormat:@"?%@", qs]; +} + +- (NSString *)ownMethodName { + NSString *uri; + NSRange r; + + uri = [[[self context] request] uri]; + + /* first: cut off query parameters */ + + r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; + if (r.length > 0) + uri = [uri substringToIndex:r.location]; + + /* next: strip trailing slash */ + + if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)]; + r = [uri rangeOfString:@"/" options:NSBackwardsSearch]; + + /* then: cut of last path component */ + + if (r.length == 0) // no slash? are we at root? + return @"/"; + + return [uri substringFromIndex:(r.location + 1)]; +} + +/* date */ + +- (NSCalendarDate *)selectedDate { + NSString *s; + + s = [self queryParameterForKey:@"day"]; + if(s) { + return [self dateForDateString:s]; + } + return [NSCalendarDate date]; +} + +- (NSString *)dateStringForDate:(NSCalendarDate *)_date { + return [_date descriptionWithCalendarFormat:@"%Y%m%d"]; +} + +- (NSCalendarDate *)dateForDateString:(NSString *)_dateString { + return [NSCalendarDate dateWithString:_dateString calendarFormat:@"%Y%m%d"]; +} + +@end diff --git a/Misc/ZideStore/UI-X/Common/UIxElemBuilder.m b/Misc/ZideStore/UI-X/Common/UIxElemBuilder.m new file mode 100644 index 000000000..ba7dcfa62 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxElemBuilder.m @@ -0,0 +1,86 @@ +/* + Copyright (C) 2000-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: UIxElemBuilder.m 30 2004-06-11 12:07:09Z znek $ + +#include + +/* + This builder builds various elements from the UI-X product. + + All tags are mapped into the namespace (XMLNS_OD_BIND). + + maps to UIxTabView + maps to UIxTabItem +*/ + +@interface UIxElemBuilder : WOxTagClassElemBuilder +{ +} + +@end + +#include +#include "common.h" + +#define XMLNS_UIX @"OGo:uix" + + +@implementation UIxElemBuilder + +- (Class)classForElement:(id)_element { + NSString *tagName; + unsigned tl; + unichar c1; + + if (![[_element namespaceURI] isEqualToString:XMLNS_UIX]) + return Nil; + + tagName = [_element tagName]; + if ((tl = [tagName length]) < 2) + return Nil; + + c1 = [tagName characterAtIndex:0]; + + switch (c1) { + case 't': { /* starting with 't' */ + unichar c2; + + c2 = [tagName characterAtIndex:1]; + + if (tl == 3 && c2 == 'a') { + if ([tagName characterAtIndex:2] == 'b') + return NSClassFromString(@"UIxTabItem"); + } + + if (tl > 5) { + if (c2 == 'a') { + if ([tagName isEqualToString:@"tabview"]) + return NSClassFromString(@"UIxTabView"); + } + } + break; + } + } + + return Nil; +} + +@end /* UIxElemBuilder */ diff --git a/Misc/ZideStore/UI-X/Common/UIxPageFrame.m b/Misc/ZideStore/UI-X/Common/UIxPageFrame.m new file mode 100644 index 000000000..07553a3fe --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxPageFrame.m @@ -0,0 +1,44 @@ +// $Id: UIxPageFrame.m 59 2004-06-22 13:40:19Z znek $ + +#include +#include +#include + + +@interface UIxPageFrame : SoComponent +{ + NSString *title; +} + +@end + +#include "common.h" + +@implementation UIxPageFrame + +- (void)dealloc { + [self->title release]; + [super dealloc]; +} + +/* accessors */ + +- (void)setTitle:(NSString *)_value { + ASSIGN(self->title, _value); +} + +- (NSString *)title { + return self->title; +} + +- (NSString *)login { + WOContext *ctx; + SoUser *user; + + ctx = [self context]; + user = [[[self clientObject] authenticatorInContext:ctx] + userInContext:ctx]; + return [user login]; +} + +@end /* UIxPageFrame */ diff --git a/Misc/ZideStore/UI-X/Common/UIxPageFrame.wox b/Misc/ZideStore/UI-X/Common/UIxPageFrame.wox new file mode 100644 index 000000000..efc1f4d93 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxPageFrame.wox @@ -0,0 +1,308 @@ + + + + + <var:string value="title"/> + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + + +
+ + + + + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + SOGo () + +
+ + + + + + +
+ + + + + +
+
+
+ + News + +
+ + Projects + +
+ + Contacts + +
+ + Companies + +
+ + Calendar + +
+ + Tasks + +
+
+ +
+ + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Misc +
+ + + + + + +
+ + + + + +
+
+
+ New Email +
+ Inbox +
+ Preferences +
+ Home +
+ Desktop +
+ Logout +
+
+ +
+ + + + + +
+
+
+ +
+ + + + + + + + +
+ + + + + +
+
+ + + + + +
+ + 2000-2004 SKYRIX Software AG. + We welcome your + feedback. + + + + No sessions required! ;-) + +
+
+ + diff --git a/Misc/ZideStore/UI-X/Common/UIxTabItem.m b/Misc/ZideStore/UI-X/Common/UIxTabItem.m new file mode 100644 index 000000000..8f3c27030 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxTabItem.m @@ -0,0 +1,475 @@ +/* + Copyright (C) 2000-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: UIxTabItem.m 31 2004-06-11 15:47:50Z znek $ + +#include "UIxTabView.h" +#include "common.h" + +#if DEBUG +# define DEBUG_JS 1 +#endif + +/* context keys */ +extern NSString *UIxTabView_HEAD; +extern NSString *UIxTabView_BODY; +extern NSString *UIxTabView_KEYS; +extern NSString *UIxTabView_SCRIPT; +extern NSString *UIxTabView_ACTIVEKEY; +extern NSString *UIxTabView_COLLECT; + +@implementation UIxTabItem + +static Class StrClass = Nil; + ++ (int)version { + return [super version] + 0; +} ++ (void)initialize { + StrClass = [NSString class]; +} + +static NSString *retStrForInt(int i) { + switch(i) { + case 0: return @"0"; + case 1: return @"1"; + case 2: return @"2"; + case 3: return @"3"; + case 4: return @"4"; + case 5: return @"5"; + case 6: return @"6"; + case 7: return @"7"; + case 8: return @"8"; + case 9: return @"9"; + case 10: return @"10"; + // TODO: find useful count! + default: + return [[StrClass alloc] initWithFormat:@"%i", i]; + } +} + +- (id)initWithName:(NSString *)_name + associations:(NSDictionary *)_config + template:(WOElement *)_subs +{ + if ((self = [super initWithName:_name associations:_config template:_subs])) { + self->key = WOExtGetProperty(_config, @"key"); + self->label = WOExtGetProperty(_config, @"label"); + + self->isScript = WOExtGetProperty(_config, @"isScript"); + self->href = WOExtGetProperty(_config, @"href"); + + self->icon = WOExtGetProperty(_config, @"icon"); + self->action = WOExtGetProperty(_config, @"action"); + + self->tabStyle = WOExtGetProperty(_config, @"tabStyle"); + self->selectedTabStyle = WOExtGetProperty(_config, @"selectedTabStyle"); + + self->tabIcon = WOExtGetProperty(_config, @"tabIcon"); + self->leftTabIcon = WOExtGetProperty(_config, @"leftTabIcon"); + self->selectedTabIcon = WOExtGetProperty(_config, @"selectedTabIcon"); + + self->asBackground = WOExtGetProperty(_config, @"asBackground"); + self->width = WOExtGetProperty(_config, @"width"); + self->height = WOExtGetProperty(_config, @"height"); + self->activeBgColor = WOExtGetProperty(_config, @"activeBgColor"); + self->inactiveBgColor = WOExtGetProperty(_config, @"inactiveBgColor"); + + self->template = [_subs retain]; + } + return self; +} + +- (void)dealloc { + [self->key release]; + [self->label release]; + + [self->href release]; + + [self->action release]; + + [self->isScript release]; + [self->template release]; + + [self->tabStyle release]; + [self->selectedTabStyle release]; + + [self->icon release]; + [self->leftTabIcon release]; + [self->selectedTabIcon release]; + [self->tabIcon release]; + + [self->asBackground release]; + [self->width release]; + [self->height release]; + + [self->activeBgColor release]; + [self->inactiveBgColor release]; + + [super dealloc]; +} + +/* responder */ + +- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx { + NSString *activeTabKey; + NSString *myTabKey; + BOOL doCheck; + + if ([_ctx objectForKey:UIxTabView_HEAD]) { + /* head clicks */ + [[_ctx component] debugWithFormat: + @"UIxTabItem: head takes (no) values, eid='%@'", + [_ctx elementID]]; + return; + } + + if ((activeTabKey = [_ctx objectForKey:UIxTabView_BODY]) == nil) { + [[_ctx component] debugWithFormat:@"UIxTabItem: invalid state"]; + [self->template takeValuesFromRequest:_rq inContext:_ctx]; + return; + } + + myTabKey = [self->key stringValueInComponent:[_ctx component]]; + doCheck = [self->isScript boolValueInComponent:[_ctx component]]; + + if ([activeTabKey isEqualToString:myTabKey] || doCheck) { +#if ADD_OWN_ELEMENTIDS + [_ctx appendElementIDComponent:activeTabKey]; +#endif + +#if DEBUG_TAKEVALUES + [[_ctx component] debugWithFormat: + @"UIxTabItem: body takes values, eid='%@'", + [_ctx elementID]]; +#endif + + [self->template takeValuesFromRequest:_rq inContext:_ctx]; +#if ADD_OWN_ELEMENTIDS + [_ctx deleteLastElementIDComponent]; +#endif + } +#if DEBUG_TAKEVALUES + else { + [[_ctx component] debugWithFormat: + @"UIxTabItem: body takes no values, eid='%@'", + [_ctx elementID]]; + } +#endif +} + +- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx { + id result; + WOAssociation *tmp; + NSString *activeTabKey; + + if ((tmp = [_ctx objectForKey:UIxTabView_HEAD])) { + /* click on tab icon */ + NSString *tabkey; + + tabkey = [_ctx currentElementID]; + [_ctx consumeElementID]; + [_ctx appendElementIDComponent:tabkey]; + + if ([tmp isValueSettable]) + [tmp setValue:tabkey inComponent:[_ctx component]]; + +#if 0 + result = [self->action valueInComponent:[_ctx component]]; +#endif + + [_ctx deleteLastElementIDComponent]; + } + else if ((activeTabKey = [_ctx objectForKey:UIxTabView_BODY])) { + /* clicked somewhere in the (active) body */ + result = [self->template invokeActionForRequest:_req inContext:_ctx]; + } + else { + [[_ctx component] logWithFormat:@"UIxTabItem: invalid invoke state"]; + result = [self->template invokeActionForRequest:_req inContext:_ctx]; + } + + return result; +} + +/* info collection */ + +- (void)_collectInContext:(WOContext *)_ctx key:(NSString *)k { + BOOL isLeft = NO; + NSMutableArray *keys; + UIxTabItemInfo *info; + WOComponent *cmp; + + cmp = [_ctx component]; + keys = [_ctx objectForKey:UIxTabView_KEYS]; + if (keys == nil) { + keys = [[[NSMutableArray alloc] init] autorelease]; + [_ctx setObject:keys forKey:UIxTabView_KEYS]; + isLeft = YES; + } + + if (k == nil) { + /* auto-assign a key */ + k = retStrForInt([keys count]); + } + else + k = [k retain]; + [_ctx appendElementIDComponent:k]; + + info = [[UIxTabItemInfo alloc] init]; + info->key = [k copy]; + info->label = [[self->label stringValueInComponent:cmp] copy]; + info->icon = [[self->icon stringValueInComponent:cmp] copy]; +#if 0 + info->uri = [[_ctx componentActionURL] copy]; +#else + info->uri = [[self->href stringValueInComponent:cmp] copy]; +#endif + info->isScript = [self->isScript boolValueInComponent:cmp]; + info->tabIcon = [[self->tabIcon stringValueInComponent:cmp] copy]; + info->leftIcon = [[self->leftTabIcon stringValueInComponent:cmp] copy]; + info->selIcon = [[self->selectedTabIcon stringValueInComponent:cmp] + copy]; + info->tabStyle = [[self->tabStyle stringValueInComponent:cmp] copy]; + info->selectedTabStyle = [[self->selectedTabStyle stringValueInComponent:cmp] + copy]; + + if (self->asBackground == nil) + info->asBackground = 0; + else { + info->asBackground + = ([self->asBackground boolValueInComponent:cmp]) ? 1 : -1; + } + info->width = [[self->width stringValueInComponent:cmp] copy]; + info->height = [[self->height stringValueInComponent:cmp] copy]; + info->activeBg = [[self->activeBgColor stringValueInComponent:cmp] + copy]; + info->inactiveBg = [[self->inactiveBgColor stringValueInComponent:cmp] + copy]; + + if (info->leftIcon == nil) info->leftIcon = [info->tabIcon copy]; + + [keys addObject:info]; + [info release]; + [k release]; + + [_ctx deleteLastElementIDComponent]; +} + +/* header generation */ + +- (void)_appendHeadToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + activeKey:(NSString *)activeKey + key:(NSString *)k +{ + /* head is currently generated in UIxTabView */ +#if 0 + // note: some associations can be inherited by UIxTabView ! + BOOL doImages; + WOComponent *comp; + BOOL doBgIcon; + NSString *label; + NSString *w, *h; + + doImages = ![[[_ctx request] clientCapabilities] isTextModeBrowser]; + comp = [_ctx component]; + + doBgIcon = self->asBackground && doImages + ? [self->asBackground boolValueInComponent:comp] ? YES : NO + : NO; + + if ((label = [self->label stringValueInComponent:comp]) == nil) + label = k; + + if (doImages) { + /* lookup image */ + NSString *imgName = nil; + // ... + + imgUri = WEUriOfResource(imgName, _ctx); + if ([imgUri length] < 1) + doImages = NO; + } + + // .... _isActive +#endif +} + +/* body generation */ + +- (void)_appendBodyToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + activeKey:(NSString *)tmp + key:(NSString *)k +{ + BOOL doScript; + BOOL isScript_; + BOOL isActive; + + doScript = [[_ctx objectForKey:UIxTabView_SCRIPT] boolValue]; + isScript_ = [self->isScript boolValueInComponent:[_ctx component]]; + isActive = [tmp isEqualToString:k]; + + if (doScript && (isActive || isScript_)) { + [_response appendContentString:@"
\n"]; + } + + if (isActive || (doScript && isScript_)) { + /* content is active or used as layer*/ +#if ADD_OWN_ELEMENTIDS + [_ctx appendElementIDComponent:k]; +#endif +#if DEBUG && 0 + NSLog(@"TAB: %@", k); +#endif + + [self->template appendToResponse:_response inContext:_ctx]; + +#if ADD_OWN_ELEMENTIDS + [_ctx deleteLastElementIDComponent]; +#endif + } + + if (doScript && (isActive || isScript_)) { + NSString *jsout; + [_response appendContentString:@"
"]; + + jsout = [NSString alloc]; + jsout = [jsout initWithFormat: + @""]; + } +} + +/* master generation method */ + +- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + NSString *k; + BOOL doForm; + id tmp; + + doForm = [_ctx isInForm]; + k = [self->key stringValueInComponent:[_ctx component]]; + + if ((tmp = [_ctx objectForKey:UIxTabView_HEAD])) { + if ([tmp isEqual:UIxTabView_COLLECT]) { + [self _collectInContext:_ctx key:k]; + } + else { + [self _appendHeadToResponse:_response inContext:_ctx + activeKey:tmp key:k]; + } + } + else if ((tmp = [_ctx objectForKey:UIxTabView_BODY])) { + [self _appendBodyToResponse:_response inContext:_ctx + activeKey:tmp key:k]; + } + else { + NSLog(@"WARNING(%s): invalid UIxTabItem state !!!", __PRETTY_FUNCTION__); + [_response appendContentString:@"[invalid state]"]; + } +} + +@end /* UIxTabItem */ + +@implementation UIxTabItemInfo + +- (void)dealloc { + [self->uri release]; + [self->icon release]; + [self->label release]; + [self->key release]; + [self->tabStyle release]; + [self->selectedTabStyle release]; + [self->tabIcon release]; + [self->selIcon release]; + [self->leftIcon release]; + [self->width release]; + [self->height release]; + [self->activeBg release]; + [self->inactiveBg release]; + + [super dealloc]; +} + +/* accessors */ + +- (NSString *)key { + return self->key; +} +- (NSString *)label { + return self->label; +} +- (NSString *)icon { + return self->icon; +} +- (NSString *)uri { + return self->uri; +} +- (BOOL)isScript { + return self->isScript; +} + +- (int)asBackground { + return self->asBackground; +} + +- (NSString *)width { + return self->width; +} + +- (NSString *)height { + return self->height; +} + +- (NSString *)activeBg { + return self->activeBg; +} + +- (NSString *)inactiveBg { + return self->inactiveBg; +} + +@end /* UIxTabItemInfo */ diff --git a/Misc/ZideStore/UI-X/Common/UIxTabView.h b/Misc/ZideStore/UI-X/Common/UIxTabView.h new file mode 100644 index 000000000..40da978e3 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxTabView.h @@ -0,0 +1,134 @@ +/* + Copyright (C) 2000-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: UIxTabView.h 32 2004-06-14 14:41:46Z znek $ + +#ifndef __UIxTabView_H__ +#define __UIxTabView_H__ + +/* + This is a library private header ! +*/ + +#include + +/* + Does not support tab-head-creation from nested components !!! + + hh: Why not ??? -> Because selection is manipulated in sub-elements + + UIxTabView creates element-IDs like + + .h.*.$key. for the tab-items (head-mode) + .b.$key... for the tab-content (content-mode) (new, hh) + + !!! UIxTabView JavaScript can't handle duplicate tab-keys !!! +*/ + +@interface UIxTabView : WODynamicElement +{ + WOAssociation *selection; + + /* config: */ + WOAssociation *headerStyle; + WOAssociation *bodyStyle; + WOAssociation *tabStyle; + WOAssociation *selectedTabStyle; + + /* old config: */ + WOAssociation *bgColor; + WOAssociation *nonSelectedBgColor; + WOAssociation *leftCornerIcon; + WOAssociation *rightCornerIcon; + + WOAssociation *tabIcon; + WOAssociation *leftTabIcon; + WOAssociation *selectedTabIcon; + + WOAssociation *asBackground; + WOAssociation *width; + WOAssociation *height; + WOAssociation *activeBgColor; + WOAssociation *inactiveBgColor; + + WOAssociation *fontColor; + WOAssociation *fontSize; + WOAssociation *fontFace; + + id template; +} + +@end + +@interface UIxTabItem : WODynamicElement +{ + WOAssociation *key; + WOAssociation *label; + + WOAssociation *href; + WOAssociation *isScript; + + WOAssociation *action; + WOAssociation *icon; + + /* config: */ + WOAssociation *tabStyle; + WOAssociation *selectedTabStyle; + + /* old config */ + WOAssociation *tabIcon; + WOAssociation *leftTabIcon; + WOAssociation *selectedTabIcon; + + WOAssociation *asBackground; + WOAssociation *width; + WOAssociation *height; + WOAssociation *activeBgColor; + WOAssociation *inactiveBgColor; + + id template; +} + +@end + +@interface UIxTabItemInfo : NSObject +{ +@public + NSString *label; + NSString *icon; + NSString *key; + NSString *uri; + NSString *tabIcon; + NSString *leftIcon; + NSString *selIcon; + NSString *tabStyle; + NSString *selectedTabStyle; + + int asBackground; // 0 -> not set, 1 -> YES, else -> NO + NSString *width; + NSString *height; + NSString *activeBg; + NSString *inactiveBg; + + BOOL isScript; +} +@end + +#endif /* __UIxTabView_H__ */ diff --git a/Misc/ZideStore/UI-X/Common/UIxTabView.m b/Misc/ZideStore/UI-X/Common/UIxTabView.m new file mode 100644 index 000000000..d70cf72c8 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxTabView.m @@ -0,0 +1,819 @@ +/* + Copyright (C) 2000-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: UIxTabView.m 37 2004-06-15 17:52:39Z znek $ + +#include "UIxTabView.h" +#include "common.h" +#import +#import +#import +#include + +#if DEBUG +// # define DEBUG_TAKEVALUES 1 +# define DEBUG_JS 1 +#endif + +/* context keys */ +NSString *UIxTabView_HEAD = @"UIxTabView_head"; +NSString *UIxTabView_BODY = @"UIxTabView_body"; +NSString *UIxTabView_KEYS = @"UIxTabView_keys"; +NSString *UIxTabView_SCRIPT = @"UIxTabView_script"; +NSString *UIxTabView_ACTIVEKEY = @"UIxTabView_activekey"; +NSString *UIxTabView_COLLECT = @"~tv~"; + +@implementation UIxTabView + +static NSNumber *YesNumber; + ++ (void)initialize { + if (YesNumber == nil) + YesNumber = [[NSNumber numberWithBool:YES] retain]; +} + ++ (int)version { + return [super version] + 0; +} + +- (id)initWithName:(NSString *)_name + associations:(NSDictionary *)_config + template:(WOElement *)_subs +{ + if ((self = [super initWithName:_name associations:_config template:_subs])) { + self->selection = WOExtGetProperty(_config, @"selection"); + + self->headerStyle = WOExtGetProperty(_config, @"headerStyle"); + self->bodyStyle = WOExtGetProperty(_config, @"bodyStyle"); + self->tabStyle = WOExtGetProperty(_config, @"tabStyle"); + self->selectedTabStyle = WOExtGetProperty(_config, @"selectedTabStyle"); + + self->bgColor = WOExtGetProperty(_config, @"bgColor"); + self->nonSelectedBgColor = WOExtGetProperty(_config, @"nonSelectedBgColor"); + self->leftCornerIcon = WOExtGetProperty(_config, @"leftCornerIcon"); + self->rightCornerIcon = WOExtGetProperty(_config, @"rightCornerIcon"); + + self->tabIcon = WOExtGetProperty(_config, @"tabIcon"); + self->leftTabIcon = WOExtGetProperty(_config, @"leftTabIcon"); + self->selectedTabIcon = WOExtGetProperty(_config, @"selectedTabIcon"); + + self->asBackground = WOExtGetProperty(_config, @"asBackground"); + self->width = WOExtGetProperty(_config, @"width"); + self->height = WOExtGetProperty(_config, @"height"); + self->activeBgColor = WOExtGetProperty(_config, @"activeBgColor"); + self->inactiveBgColor = WOExtGetProperty(_config, @"inactiveBgColor"); + + self->fontColor = WOExtGetProperty(_config, @"fontColor"); + self->fontSize = WOExtGetProperty(_config, @"fontSize"); + self->fontFace = WOExtGetProperty(_config, @"fontFace"); + + self->template = RETAIN(_subs); + } + return self; +} + +- (void)dealloc { + [self->selection release]; + + [self->headerStyle release]; + [self->bodyStyle release]; + [self->tabStyle release]; + [self->selectedTabStyle release]; + + RELEASE(self->bgColor); + RELEASE(self->nonSelectedBgColor); + RELEASE(self->leftCornerIcon); + RELEASE(self->rightCornerIcon); + + RELEASE(self->leftTabIcon); + RELEASE(self->selectedTabIcon); + RELEASE(self->tabIcon); + + RELEASE(self->width); + RELEASE(self->height); + + RELEASE(self->activeBgColor); + RELEASE(self->inactiveBgColor); + + RELEASE(self->fontColor); + RELEASE(self->fontSize); + RELEASE(self->fontFace); + + RELEASE(self->template); + [super dealloc]; +} + +/* nesting */ + +- (id)saveNestedStateInContext:(WOContext *)_ctx { + return nil; +} +- (void)restoreNestedState:(id)_state inContext:(WOContext *)_ctx { + if (_state == nil) return; +} + +- (NSArray *)collectKeysInContext:(WOContext *)_ctx { + /* collect mode, collects all keys */ + [_ctx setObject:UIxTabView_COLLECT forKey:UIxTabView_HEAD]; + + [self->template appendToResponse:nil inContext:_ctx]; + + [_ctx removeObjectForKey:UIxTabView_HEAD]; + return [_ctx objectForKey:UIxTabView_KEYS]; +} + +/* responder */ + +- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx { + id nestedState; + NSString *activeTabKey; + + activeTabKey = [self->selection stringValueInComponent:[_ctx component]]; + NSLog(@"%s activeTabKey:%@", __PRETTY_FUNCTION__, activeTabKey); + nestedState = [self saveNestedStateInContext:_ctx]; + [_ctx appendElementIDComponent:@"b"]; + [_ctx appendElementIDComponent:activeTabKey]; + + [_ctx setObject:activeTabKey forKey:UIxTabView_BODY]; + +#if DEBUG_TAKEVALUES + [[_ctx component] debugWithFormat:@"UIxTabView: body takes values, eid='%@'", + [_ctx elementID]]; +#endif + + [self->template takeValuesFromRequest:_req inContext:_ctx]; + + [_ctx removeObjectForKey:UIxTabView_BODY]; + [_ctx deleteLastElementIDComponent]; // activeKey + [_ctx deleteLastElementIDComponent]; /* 'b' */ + [self restoreNestedState:nestedState inContext:_ctx]; +} + +- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx { + NSString *key; + id result; + id nestedState; + + if ((key = [_ctx currentElementID]) == nil) + return nil; + + result = nil; + nestedState = [self saveNestedStateInContext:_ctx]; + + if ([key isEqualToString:@"h"]) { + /* header action */ + //NSString *urlKey; + + [_ctx consumeElementID]; + [_ctx appendElementIDComponent:@"h"]; +#if 0 + if ((urlKey = [_ctx currentElementID]) == nil) { + [[_ctx application] + debugWithFormat:@"missing active head tab key !"]; + } + else { + //NSLog(@"clicked: %@", urlKey); + [_ctx consumeElementID]; + [_ctx appendElementIDComponent:urlKey]; + } +#endif + + [_ctx setObject:self->selection forKey:UIxTabView_HEAD]; + result = [self->template invokeActionForRequest:_req inContext:_ctx]; + [_ctx removeObjectForKey:UIxTabView_HEAD]; + +#if 0 + if (urlKey) + [_ctx deleteLastElementIDComponent]; // active key +#endif + [_ctx deleteLastElementIDComponent]; // 'h' + } + else if ([key isEqualToString:@"b"]) { + /* body action */ + NSString *activeTabKey, *urlKey; + + [_ctx consumeElementID]; + [_ctx appendElementIDComponent:@"b"]; + + if ((urlKey = [_ctx currentElementID]) == nil) { + [[_ctx application] + debugWithFormat:@"missing active body tab key !"]; + } + else { + //NSLog(@"clicked: %@", urlKey); + [_ctx consumeElementID]; + [_ctx appendElementIDComponent:urlKey]; + } + + activeTabKey = [self->selection stringValueInComponent:[_ctx component]]; + [_ctx setObject:activeTabKey forKey:UIxTabView_BODY]; + + result = [self->template invokeActionForRequest:_req inContext:_ctx]; + + [_ctx removeObjectForKey:UIxTabView_BODY]; + + if (urlKey) + [_ctx deleteLastElementIDComponent]; // active key + [_ctx deleteLastElementIDComponent]; // 'b' + } + else { + [[_ctx application] + debugWithFormat:@"unknown tab container key '%@'", key]; + } + + [self restoreNestedState:nestedState inContext:_ctx]; + return result; +} + +- (NSString *)_tabViewCountInContext:(WOContext *)_ctx { + int count; + count = [[_ctx valueForKey:@"UIxTabViewScriptDone"] intValue]; + return [NSString stringWithFormat:@"%d",count]; +} + +- (NSString *)scriptHref:(UIxTabItemInfo *)_info + inContext:(WOContext *)_ctx + isLeft:(BOOL)_isLeft + keys:(NSArray *)_keys +{ + NSMutableString *result = [NSMutableString string]; + UIxTabItemInfo *tmp; + NSString *activeKey; + int i, cnt; + NSString *elID; + NSString *tstring; + + activeKey = [self->selection stringValueInComponent:[_ctx component]]; + [result appendString:@"JavaScript:showTab("]; + [result appendString:_info->key]; + [result appendString:@"Tab);"]; + + [result appendString:@"swapCorners("]; + tstring = (!_isLeft) + ? @"tabCorner%@,tabCornerLeft%@);" + : @"tabCornerLeft%@,tabCorner%@);"; + elID = [self _tabViewCountInContext:_ctx]; + [result appendString:[NSString stringWithFormat:tstring,elID,elID]]; + + for (i=0, cnt = [_keys count]; i < cnt; i++) { + tmp = [_keys objectAtIndex:i]; + + if ((tmp->isScript || [tmp->key isEqualToString:activeKey]) + && ![tmp->key isEqualToString:_info->key]) { + [result appendString:@"hideTab("]; + [result appendString:tmp->key]; + [result appendString:@"Tab);"]; + } + } + return result; +} + +- (void)appendLink:(UIxTabItemInfo *)_info + toResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + isActive:(BOOL)_isActive isLeft:(BOOL)_isLeft + doScript:(BOOL)_doScript keys:(NSArray *)_keys +{ + NSString *headUri = nil; + NSString *label = nil; + NSString *scriptHref = nil; + NSString *styleName = nil; + + WEClientCapabilities *ccaps; + WOComponent *comp; + + ccaps = [[_ctx request] clientCapabilities]; + + comp = [_ctx component]; + headUri = _info->uri; + + if ((label = _info->label) == nil) + label = _info->key; + + if (_isActive) { + styleName = (_info->selectedTabStyle) + ? _info->selectedTabStyle + : [self->selectedTabStyle stringValueInComponent:comp]; + } + else { + styleName = (_info->tabStyle) + ? _info->tabStyle + : [self->tabStyle stringValueInComponent:comp]; + } + + [_response appendContentString:@"']; + + [_response appendContentString:@"isScript || _isActive)) { + scriptHref = + [self scriptHref:_info inContext:_ctx isLeft:_isLeft keys:_keys]; + [_response appendContentHTMLAttributeValue:scriptHref]; + } + else { + [_response appendContentHTMLAttributeValue:headUri]; + } + + [_response appendContentString:@"\" "]; + [_response appendContentString: + [NSString stringWithFormat:@"name='%@TabLink'", _info->key]]; + [_response appendContentString:@">"]; + + if ([label length] < 1) + label = _info->key; + [_response appendContentString:@""]; + [_response appendContentHTMLString:label]; + [_response appendContentString:@""]; + + [_response appendContentString:@""]; + + [_response appendContentString:@""]; + +#if 0 + if (_doScript && (_info->isScript || _isActive)) { + NSString *k; // key + NSString *s; // selected tab icon + NSString *u; // unselected tab icon + //NSString *out; + + k = _info->key; + s = _info->selIcon; // selectedTabIcon + u = (_isLeft) ? _info->leftIcon : _info->tabIcon; + + s = WEUriOfResource(s, _ctx); + u = WEUriOfResource(u, _ctx); + + s = ([s length] < 1) ? imgUri : s; + u = ([u length] < 1) ? imgUri : u; + +#if 0 + out = [NSString alloc]; + out = [out initWithFormat: + @"", + k, k, k, k, scriptHref, k, headUri, + k, k, k, k, + k, u, k, k, s + ]; + + [_response appendContentString:out]; + RELEASE(out); +#else +# define _appendStr_(_str_) [_response appendContentString:_str_] + _appendStr_(@""); +#undef _appendStr_ +#endif + } +#endif +} + +- (void)appendSubmitButton:(UIxTabItemInfo *)_info + toResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + isActive:(BOOL)_isActive isLeft:(BOOL)_left + doScript:(BOOL)_doScript keys:(NSArray *)_keys +{ + [self appendLink:_info + toResponse:_response + inContext:_ctx + isActive:_isActive isLeft:_left + doScript:_doScript keys:_keys]; +} + +- (void)_appendTabViewJSScriptToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx +{ + [_response appendContentString: + @""]; +} + +- (void)_appendHeaderRowToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + keys:(NSArray *)keys activeKey:(NSString *)activeKey + doScript:(BOOL)doScript +{ + unsigned i, count; + BOOL doForm; + NSString *styleName; + + doForm = NO; /* generate form controls ? */ + + [_response appendContentString:@""]; + + styleName = [self->headerStyle stringValueInComponent:[_ctx component]]; + if(styleName) { + [_response appendContentString: + @""]; + } + else { + [_response appendContentString: + @"
"]; + } + + for (i = 0, count = [keys count]; i < count; i++) { + UIxTabItemInfo *info; + NSString *key; + BOOL isActive; + + info = [keys objectAtIndex:i]; + key = info->key; + isActive = [key isEqualToString:activeKey]; + + [_ctx appendElementIDComponent:key]; + + if (doForm) { + /* tab is inside of a FORM, so produce submit buttons */ + [self appendSubmitButton:info + toResponse:_response + inContext:_ctx + isActive:isActive + isLeft:(i == 0) ? YES : NO + doScript:doScript + keys:keys]; + } + else { + /* tab is not in a FORM, generate hyperlinks for tab */ + [self appendLink:info + toResponse:_response + inContext:_ctx + isActive:isActive + isLeft:(i == 0) ? YES : NO + doScript:doScript + keys:keys]; + } + + [_ctx deleteLastElementIDComponent]; + } + // [_response appendContentString:@""]; + [_response appendContentString:@"
"]; + [_response appendContentString:@""]; +} + +- (void)_appendHeaderFootRowToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + bgcolor:(NSString *)bgcolor + doScript:(BOOL)doScript + isLeftActive:(BOOL)isLeftActive +{ + NSString *styleName; + [_response appendContentString:@" bodyStyle stringValueInComponent:[_ctx component]]; + if(styleName) { + [_response appendContentString:@" class='"]; + [_response appendContentHTMLAttributeValue:styleName]; + [_response appendContentCharacter:'\'']; + } + if (bgcolor) { + [_response appendContentString:@" bgcolor=\""]; + [_response appendContentHTMLAttributeValue:bgcolor]; + [_response appendContentString:@"\""]; + } + [_response appendContentString:@">\n"]; + + /* left corner */ + [_response appendContentString:@" "]; + + if (doScript) { + [_response appendContentString:@"
"]; + [_response appendContentString:@" "]; + [_response appendContentString:@"
"]; + } + else if (isLeftActive) + [_response appendContentString:@" "]; + + if (doScript) { + [_response appendContentString:@"
"]; + } + + if (!isLeftActive || doScript) { + NSString *uri; + + uri = [self->leftCornerIcon stringValueInComponent:[_ctx component]]; + if ((uri = WEUriOfResource(uri, _ctx))) { + [_response appendContentString:@"\"\""]; + } + else + [_response appendContentString:@" "]; + } + if (doScript) + [_response appendContentString:@"
"]; + + [_response appendContentString:@"\n"]; + + /* right corner */ + [_response appendContentString:@" "]; + { + NSString *uri; + + uri = [self->rightCornerIcon stringValueInComponent:[_ctx component]]; + if ((uri = WEUriOfResource(uri, _ctx))) { + [_response appendContentString:@"\"\""]; + } + else + [_response appendContentString:@" "]; + } + [_response appendContentString:@"\n"]; + + [_response appendContentString:@" \n"]; +} + +- (void)_appendBodyRowToResponse:(WOResponse *)_response + inContext:(WOContext *)_ctx + bgcolor:(NSString *)bgcolor + activeKey:(NSString *)activeKey +{ + WEClientCapabilities *ccaps; + BOOL indentContent; + NSString *styleName; + + styleName = [self->bodyStyle stringValueInComponent:[_ctx component]]; + ccaps = [[_ctx request] clientCapabilities]; + + /* put additional padding table into content ??? */ + indentContent = [ccaps isFastTableBrowser] && ![ccaps isTextModeBrowser]; + + [_response appendContentString:@"']; + + if (indentContent) { + /* start padding table */ + [_response appendContentString: + @""]; + [_response appendContentString:@"
"]; + } + + [_ctx appendElementIDComponent:@"b"]; + [_ctx appendElementIDComponent:activeKey]; + + /* generate currently active body */ + { + [_ctx setObject:activeKey forKey:UIxTabView_BODY]; + [self->template appendToResponse:_response inContext:_ctx]; + [_ctx removeObjectForKey:UIxTabView_BODY]; + } + + [_ctx deleteLastElementIDComponent]; // activeKey + [_ctx deleteLastElementIDComponent]; // 'b' + + if (indentContent) + /* close padding table */ + [_response appendContentString:@"
"]; + + [_response appendContentString:@""]; +} + +- (BOOL)isLeftActiveInKeys:(NSArray *)keys activeKey:(NSString *)activeKey{ + unsigned i, count; + BOOL isLeftActive; + + isLeftActive = NO; + + for (i = 0, count = [keys count]; i < count; i++) { + UIxTabItemInfo *info; + + info = [keys objectAtIndex:i]; + + if ((i == 0) && [info->key isEqualToString:activeKey]) + isLeftActive = YES; + } + + return isLeftActive; +} + +- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + WOComponent *cmp; + NSString *bgcolor; + BOOL isLeftActive; + BOOL doScript; + id nestedState; + NSString *activeKey; + NSArray *keys; + int tabViewCount; /* used for image id's and writing script once */ + + doScript = NO; /* perform tab-clicks on browser (use javascript) */ + tabViewCount = [[_ctx valueForKey:@"UIxTabViewScriptDone"] intValue]; + cmp = [_ctx component]; + + /* check for browser */ + { + WEClientCapabilities *ccaps; + //BOOL isJavaScriptBrowser; + + ccaps = [[_ctx request] clientCapabilities]; + doScript = [ccaps isInternetExplorer] && [ccaps isJavaScriptBrowser]; + doScript = (doScript && + [[[cmp session] + valueForKey:@"isJavaScriptEnabled"] boolValue]); + } + + /* disable javascript */ + doScript = NO; + + /* save state */ + + nestedState = [self saveNestedStateInContext:_ctx]; + + /* configure */ + + activeKey = [self->selection stringValueInComponent:cmp]; + + bgcolor = [self->bgColor stringValueInComponent:cmp]; + bgcolor = [bgcolor stringValue]; + + [_ctx appendElementIDComponent:@"h"]; + + /* collect & process keys (= available tabs) */ + + keys = [self collectKeysInContext:_ctx]; + + if (![[keys valueForKey:@"key"] containsObject:activeKey]) + /* selection is not available in keys */ + activeKey = nil; + + if ((activeKey == nil) && ([keys count] > 0)) { + /* no or invalid selection, use first key */ + activeKey = [[keys objectAtIndex:0] key]; + if ([self->selection isValueSettable]) + [self->selection setValue:activeKey inComponent:[_ctx component]]; + } + + if (doScript) { + doScript = [[keys valueForKey:@"isScript"] containsObject:YesNumber]; + [_ctx setObject:[NSNumber numberWithBool:doScript] + forKey:UIxTabView_SCRIPT]; + } + + /* start appending */ + + if ((doScript) && (tabViewCount == 0)) + [self _appendTabViewJSScriptToResponse:_response inContext:_ctx]; + + /* count up for unique tabCorner/tabCornerLeft images */ + [_ctx takeValue:[NSNumber numberWithInt:(tabViewCount + 1)] + forKey:@"UIxTabViewScriptDone"]; + + [_response appendContentString: + @""]; + + /* find out whether left is active */ + + isLeftActive = [self isLeftActiveInKeys:keys activeKey:activeKey]; + + /* generate header row */ + + [self _appendHeaderRowToResponse:_response inContext:_ctx + keys:keys activeKey:activeKey + doScript:doScript]; + + [_ctx deleteLastElementIDComponent]; // 'h' for head + [_ctx removeObjectForKey:UIxTabView_HEAD]; + +#if 0 + /* header foot row */ + + [self _appendHeaderFootRowToResponse:_response inContext:_ctx + bgcolor:bgcolor + doScript:doScript + isLeftActive:isLeftActive]; +#endif + + /* body row */ + + [self _appendBodyRowToResponse:_response inContext:_ctx + bgcolor:bgcolor + activeKey:activeKey]; + + /* close table */ + + [_response appendContentString:@"
"]; + [_ctx removeObjectForKey:UIxTabView_ACTIVEKEY]; + [_ctx removeObjectForKey:UIxTabView_KEYS]; + [self restoreNestedState:nestedState inContext:_ctx]; +} + +@end /* UIxTabView */ diff --git a/Misc/ZideStore/UI-X/Common/UIxWinClose.m b/Misc/ZideStore/UI-X/Common/UIxWinClose.m new file mode 100644 index 000000000..7af7edccb --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxWinClose.m @@ -0,0 +1,37 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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: UIxWinClose.m 59 2004-06-22 13:40:19Z znek $ + + +#include + + +@interface UIxWinClose : WOComponent +{ + +} + +@end + + +@implementation UIxWinClose + +@end diff --git a/Misc/ZideStore/UI-X/Common/UIxWinClose.wox b/Misc/ZideStore/UI-X/Common/UIxWinClose.wox new file mode 100644 index 000000000..35769e429 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/UIxWinClose.wox @@ -0,0 +1,6 @@ + +X diff --git a/Misc/ZideStore/UI-X/Common/Version b/Misc/ZideStore/UI-X/Common/Version new file mode 100644 index 000000000..d64ce5ad6 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/Version @@ -0,0 +1,5 @@ +# $Id: Version,v 1.1 2003/11/24 01:24:40 helge Exp $ + +SUBMINOR_VERSION:=1 + +# 1.1.0 requires NGObjWeb 4.2.202 diff --git a/Misc/ZideStore/UI-X/Common/bundle-info.plist b/Misc/ZideStore/UI-X/Common/bundle-info.plist new file mode 100644 index 000000000..c7081c18c --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/bundle-info.plist @@ -0,0 +1,40 @@ +{ + "__cvs__" = "$Id: bundle-info.plist,v 1.1 2003/11/24 01:24:40 helge Exp $"; + + requires = { + bundleManagerVersion = 1; + classes = ( + { name = NSObject; } + ); + }; + + provides = { + ZideStoreProducts = ( { name = CommonUIProduct; } ); + + classes = ( + { name = CommonUIProduct; }, + { name = UIxComponent; }, + { name = UIxPageFrame; }, + { name = UIxWinClose; }, + { name = UIxAppNavView; }, + { name = "UIxElemBuilder"; }, + { name = "UIxTabView"; }, + { name = "UIxTabItem"; }, + ); + + WOComponents = ( + { name = UIxPageFrame; }, + { name = UIxWinClose; }, + { name = UIxAppNavView; }, + ); + + WOxElemBuilder = ( + { name = "UIxElemBuilder"; }, + ); + + WODynamicElements = ( + { name = "UIxTabView"; }, + { name = "UIxTabItem"; }, + ); + }; +} diff --git a/Misc/ZideStore/UI-X/Common/calendar.css b/Misc/ZideStore/UI-X/Common/calendar.css new file mode 100644 index 000000000..34553bb4c --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/calendar.css @@ -0,0 +1,189 @@ +.aptview_title { + font-size: 10pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + color: #000000; + font-weight: bold; +} + +.aptview_text { + font-size: 10pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + color: #000000; +} + +.weekoverview_title { + font-size: 10pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + letter-spacing: 0pt; + color: #000000; + background-color: #d2d2cc; +} + +.weekoverview_title a { + color: #0033cc; + text-decoration: none; +} + +.weekoverview_title_hilite { + font-size: 10pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + letter-spacing: 0pt; + color: #000000; + background-color: #d2d2cc; + font-weight: bold; +} + +.weekoverview_title_hilite a { + color: #0033cc; + text-decoration: none; +} + +.weekoverview_title_daylink { + font-size: 12pt; + color: #0033cc; + font-weight: bold; +} + +.weekoverview_title_newlink { + font-size: 8pt; +} + +.weekoverview_holidayinfo { + font-size: 8pt; + font-weight: bold; +} + +.weekoverview_content { + color: #FFFFFF; + background-color: #e8e8e0; +} + +.weekoverview_content a { + color: #0000FF; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + letter-spacing: 0pt; + text-decoration: none; +} + +.weekoverview_content_hilite { + background-color: #fffff0; +} + +.weekoverview_content_hilite a { + color: #0000FF; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + letter-spacing: 0pt; + text-decoration: none; +} + +.monthoverview { + color: #000000; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 10pt; + letter-spacing: 0pt; + padding: 2px; +} + +.monthoverview a { + color: #0033cc; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 7pt; + font-style: normal; + font-weight: normal; + letter-spacing: 0pt; + text-decoration: none; +} + +.monthoverview a:hover { + text-decoration: underline; +} + +.monthoverview_title { + background-color: #d2d2cc; + text-align: center; +} + +.monthoverview_week { + background-color: #d2d2cc; + width: 16pt; + text-align: center; + vertical-align: middle; +} + +.monthoverview_week a { + color: #000000; + font-size: 10pt; +} + +.monthoverview_week_hilite { + background-color: #fffff0; + width: 16pt; + text-align: center; + vertical-align: middle; +} + +.monthoverview_week_hilite a { + color: #000000; + font-size: 10pt; +} + +.monthoverview_content { + background-color: #e8e8e0; + font-size: 9pt; + height: 60; +} + +.monthoverview_content a { + font-style: italic; + font-weight: bold; +} + +.monthoverview_content td { + text-align: let; + vertical-align: top; +} + + +.monthoverview_content_hilite { + background-color: #fffff0; + font-size: 9pt; + height: 60; +} + +.monthoverview_content_hilite a { + font-style: italic; + font-weight: bold; +} + +.monthoverview_content_dimmed { + background-color: #d2d2cc; + font-size: 9pt; + height: 60; +} + +.monthoverview_content_dimmed a { + font-style: normal; + font-weight: normal; +} + +.monthoverview_day a { + color: #000000; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 12pt; +} + +.monthoverview_day_new a { + font-style: normal; + font-weight: normal; +} + +.monthoverview_day_new a:hover { + font-style: normal; + font-weight: normal; + color: #ff0000; +} + +.monthoverview_content_link { + font-style: normal; + font-weight: normal; +} diff --git a/Misc/ZideStore/UI-X/Common/common.h b/Misc/ZideStore/UI-X/Common/common.h new file mode 100644 index 000000000..ea759a93a --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/common.h @@ -0,0 +1,155 @@ +/* + 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: common.h,v 1.1 2003/11/24 01:24:40 helge Exp $ + +#import + +#if LIB_FOUNDATION_LIBRARY +# include +#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY +# include +# include +#endif + +#include +#include +#include + +@interface WOContext(WOExtensionsPrivate) +- (void)addActiveFormElement:(WOElement *)_element; +@end + +static inline id WOExtGetProperty(NSDictionary *_set, NSString *_name) { + id propValue = [_set objectForKey:_name]; + + if (propValue) { + propValue = [propValue retain]; + [(NSMutableDictionary *)_set removeObjectForKey:_name]; + } + return propValue; +} + +static inline NSString *WEUriOfResource(NSString *_name, WOContext *_ctx) { + NSArray *languages; + WOResourceManager *resourceManager; + NSString *uri; + + if (_name == nil) + return nil; + + languages = [_ctx hasSession] + ? [[_ctx session] languages] + : [[_ctx request] browserLanguages]; + + resourceManager = [[_ctx application] resourceManager]; + + uri = [resourceManager urlForResourceNamed:_name + inFramework:nil + languages:languages + request:[_ctx request]]; + if ([uri rangeOfString:@"/missingresource?"].length > 0) + uri = nil; + + return uri; +} + +static inline void WEAppendFont(WOResponse *_resp, + NSString *_color, + NSString *_face, + NSString *_size) +{ + [_resp appendContentString:@"']; +} + +static inline void WEAppendTD(WOResponse *_resp, + NSString *_align, + NSString *_valign, + NSString *_bgColor) +{ + [_resp appendContentString:@"']; +} + +static inline WOElement *WECreateElement(NSString *_className, + NSString *_name, + NSDictionary *_config, + WOElement *_template) +{ + Class c; + WOElement *result = nil; + NSMutableDictionary *config = nil; + + if ((c = NSClassFromString(_className)) == Nil) { + NSLog(@"%s: missing '%@' class", __PRETTY_FUNCTION__, _className); + return nil; + } + config = [NSMutableDictionary dictionaryWithCapacity:4]; + { + NSEnumerator *keyEnum; + id key; + + keyEnum = [_config keyEnumerator]; + + while ((key = [keyEnum nextObject])) { + WOAssociation *a; + + a = [WOAssociation associationWithValue:[_config objectForKey:key]]; + [config setObject:a forKey:key]; + } + } + result = [[c alloc] initWithName:_name + associations:config + template:_template]; + return [result autorelease]; +} + +#define OWGetProperty WOExtGetProperty diff --git a/Misc/ZideStore/UI-X/Common/images/OGoLogo.gif b/Misc/ZideStore/UI-X/Common/images/OGoLogo.gif new file mode 100755 index 000000000..ea1b5f555 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/OGoLogo.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_botleft.gif b/Misc/ZideStore/UI-X/Common/images/box_botleft.gif new file mode 100644 index 000000000..edaa19035 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_botleft.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_botright.gif b/Misc/ZideStore/UI-X/Common/images/box_botright.gif new file mode 100644 index 000000000..bb8be1bd8 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_botright.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_bottom.gif b/Misc/ZideStore/UI-X/Common/images/box_bottom.gif new file mode 100644 index 000000000..c63a9cf94 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_bottom.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_left.gif b/Misc/ZideStore/UI-X/Common/images/box_left.gif new file mode 100644 index 000000000..260636dd2 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_left.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_right.gif b/Misc/ZideStore/UI-X/Common/images/box_right.gif new file mode 100644 index 000000000..5315a06d7 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_right.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_top.gif b/Misc/ZideStore/UI-X/Common/images/box_top.gif new file mode 100644 index 000000000..768bd4fa6 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_top.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_topleft.gif b/Misc/ZideStore/UI-X/Common/images/box_topleft.gif new file mode 100644 index 000000000..0ede3784c Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_topleft.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/box_topright.gif b/Misc/ZideStore/UI-X/Common/images/box_topright.gif new file mode 100644 index 000000000..5b3ca17b8 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/box_topright.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/closewindow.gif b/Misc/ZideStore/UI-X/Common/images/closewindow.gif new file mode 100644 index 000000000..f4305d65f Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/closewindow.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/corner_right.gif b/Misc/ZideStore/UI-X/Common/images/corner_right.gif new file mode 100644 index 000000000..75b945d25 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/corner_right.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/line_left.gif b/Misc/ZideStore/UI-X/Common/images/line_left.gif new file mode 100644 index 000000000..19415f347 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/line_left.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/line_right.gif b/Misc/ZideStore/UI-X/Common/images/line_right.gif new file mode 100644 index 000000000..504b5ce9f Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/line_right.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/line_stretch.gif b/Misc/ZideStore/UI-X/Common/images/line_stretch.gif new file mode 100644 index 000000000..481e30134 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/line_stretch.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/menu_logo_top.gif b/Misc/ZideStore/UI-X/Common/images/menu_logo_top.gif new file mode 100644 index 000000000..ea1b5f555 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/menu_logo_top.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/tab_.gif b/Misc/ZideStore/UI-X/Common/images/tab_.gif new file mode 100644 index 000000000..ad720a0c6 Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/tab_.gif differ diff --git a/Misc/ZideStore/UI-X/Common/images/tab_selected.gif b/Misc/ZideStore/UI-X/Common/images/tab_selected.gif new file mode 100644 index 000000000..2cbdea66a Binary files /dev/null and b/Misc/ZideStore/UI-X/Common/images/tab_selected.gif differ diff --git a/Misc/ZideStore/UI-X/Common/product.plist b/Misc/ZideStore/UI-X/Common/product.plist new file mode 100644 index 000000000..1636c4209 --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/product.plist @@ -0,0 +1,47 @@ +{ + requires = ( MAIN ); + + publicResources = ( + calendar.css, + zidestoreui.css, + menu_logo_top.gif, + line_left.gif, + line_stretch.gif, + line_right.gif, + box_topleft.gif, + box_top.gif, + box_topright.gif, + box_left.gif, + box_right.gif, + box_botleft.gif, + box_bottom.gif, + box_botright.gif, + tab_selected.gif, + tab_.gif, + corner_right.gif, + closewindow.gif, + OGoLogo.gif + ); + + factories = { + }; + + categories = { + SxFolder = { + methods = { + "app" = { + protectedBy = "View"; + pageName = "UIxAppFrame"; + }; + "appheader" = { + protectedBy = "View"; + pageName = "UIxAppHeader"; + }; + "appnavigation" = { + protectedBy = "View"; + pageName = "UIxAppNavigation"; + }; + }; + }; + }; +} diff --git a/Misc/ZideStore/UI-X/Common/zidestoreui.css b/Misc/ZideStore/UI-X/Common/zidestoreui.css new file mode 100644 index 000000000..5d1e878cc --- /dev/null +++ b/Misc/ZideStore/UI-X/Common/zidestoreui.css @@ -0,0 +1,199 @@ +/* ZideStore UI Stylesheet */ + +/* common stuff */ + +body { + color: #000000; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 10pt; + background-color: #FFFFFF; + margin: 0px; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + margin-right: 0px; +} + +a:link { + color: #0033CC; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + text-decoration: none; +} +a:visited { + color: #660066; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + text-decoration: none; +} +a:hover { + color: #FF0000; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + text-decoration: underline; +} + +.linecolor { + background-color: #06348B; +} + +font.defaultfont { + text-decoration: none; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 8pt; + color: #000000; +} + +.window_label { + color: #06348b; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 12pt; + font-weight: bold; +} + + +/* tabs */ + +.tab { + color: #000000; + background-color: #e8e8e0; + font-size: 10pt; + text-decoration: none; + width: 100px; + height: 22px; + border-top: 1px solid #06348b; + border-right: 1px solid #06348b; +} + +.tab a { + color: #000000; + border: none; + text-decoration: none; +} + +.tab_selected { + color: #000000; + background-color: #f5f5e9; + font-size: 10pt; + text-decoration: none; + font-weight: bold; + width: 100px; + height: 22px; + border-top: 1px solid #06348b; + border-right: 1px solid #06348b; +} + +.tab_selected a { + color: #000000; + border: none; + text-decoration: none; +} + +.tabview_body { + background-color: #f5f5e9; +} + + +/* buttons */ + +.button_auto_env { + height: 16px; + text-align: center; + vertical-align: middle; + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; + overflow: hidden; +} + +.button_auto_env a { + text-decoration: none; + color: #000000; +} + +.button_auto_env a:hover { + text-decoration: underline; + color: #ff0000; +} + +.button_auto { + height: 20px; + border-style: outset; + border-color: #DDDDDD; + border-width: 2px; + color: #000000; + background-color: #e8e8e0; + font-size: 8pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + letter-spacing: 0pt; + text-decoration: none; + text-color: #000000; + text-align: center; + vertical-align: middle; + padding-left: 5px; + padding-right: 5px; + padding-top: 1px; + padding-bottom: 1px; + overflow: hidden; +} + + +/* header */ + +div#header { + margin-left: 5px; + margin-right: 5px; + padding: 0; + border-bottom: 1px solid #000000; +} +div#header img.headerlogo { + float: right; + width: 182px; + height: 30px; +} + +div#header div#headerhistory { + font-size: 11px; + color: #000000; + margin: 0px; + padding-top: 18px; + height: 12px; +} +div#header a, div#header span { + margin: 0px; +} +div#header span#navtitle { + font-weight: bold; +} +div#header a:hover { + text-decoration: none; +} + +/* the dock */ + +a.skydockfont { + text-decoration: none; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 8pt; + color: #06348B; +} +font.skydockfont { + text-decoration: none; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 8pt; + color: #06348B; +} +font.skydockfont_inactiveMail { + text-decoration: none; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 8pt; + color: #CCCCCC; + font-weight: bold; +} +font.skydockfont_newMail { + text-decoration: none; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 8pt; + color: #06348B; + font-weight: bold; +} +table.skytextdocktable { + padding: 0px; + table-layout: auto; +} diff --git a/Misc/ZideStore/UI-X/GNUmakefile b/Misc/ZideStore/UI-X/GNUmakefile new file mode 100644 index 000000000..688556495 --- /dev/null +++ b/Misc/ZideStore/UI-X/GNUmakefile @@ -0,0 +1,9 @@ +# $Id$ + +include $(GNUSTEP_MAKEFILES)/common.make + +SUBPROJECTS = \ + Common \ + Scheduler \ + +include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/Misc/ZideStore/UI-X/Scheduler/COPYING b/Misc/ZideStore/UI-X/Scheduler/COPYING new file mode 100644 index 000000000..161a3d1d4 --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/COPYING @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/Misc/ZideStore/UI-X/Scheduler/COPYRIGHT b/Misc/ZideStore/UI-X/Scheduler/COPYRIGHT new file mode 100644 index 000000000..1053b2aa3 --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/COPYRIGHT @@ -0,0 +1,4 @@ +Copyright (C) 2004 SKYRIX Software AG + + +Contact: info@skyrix.com diff --git a/Misc/ZideStore/UI-X/Scheduler/GNUmakefile b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile new file mode 100644 index 000000000..40c6391ca --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile @@ -0,0 +1,66 @@ +# $Id: GNUmakefile,v 1.4 2004/06/04 16:15:23 znek Exp $ + +include $(GNUSTEP_MAKEFILES)/common.make + +BUNDLE_NAME = SchedulerUI +BUNDLE_EXTENSION = .zsp +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/ZideStore12 + +SchedulerUI_PRINCIPAL_CLASS = SchedulerUIProduct + +SchedulerUI_OBJC_FILES = \ + SchedulerUIProduct.m \ + UIxAppointmentFormatter.m \ + UIxCalView.m \ + UIxCalWeekView.m \ + UIxCalMonthView.m \ + UIxAptTableView.m \ + \ + UIxCalWeekOverview.m \ + UIxCalMonthOverview.m \ + UIxAppointmentView.m \ + UIxAppointmentEditor.m \ + UIxCalSelectTab.m \ + UIxCalDateLabel.m \ + UIxCalBackForthNavView.m \ + +SchedulerUI_RESOURCE_FILES += \ + Version \ + product.plist \ + \ + UIxAptTableView.wox \ + UIxCalWeekOverview.wox \ + UIxCalMonthOverview.wox \ + UIxAppointmentView.wox \ + UIxAppointmentEditor.wox \ + UIxCalSelectTab.wox \ + UIxCalDateLabel.wox \ + UIxCalBackForthNavView.wox \ + images/next_week.gif \ + images/previous_week.gif \ + images/icon_apt_chart.gif \ + images/icon_apt_overview.gif \ + images/icon_apt_chart_inactive.gif \ + images/icon_apt_overview_inactive.gif \ + images/icon_apt_column_view.gif \ + images/icon_apt_list.gif \ + images/icon_apt_list_inactive.gif \ + + +ifeq ($(FOUNDATION_LIB),apple) +ZIDESTORE=$(GNUSTEP_USER_ROOT)/Library/Headers/ZideStore12 +else +ZIDESTORE=$(GNUSTEP_USER_ROOT)/Headers/ZideStore12 +endif + +ADDITIONAL_INCLUDE_DIRS += \ + -I. \ + -I.. \ + -I$(ZIDESTORE)/Frontend -I$(ZIDESTORE)/Backend \ + -I$(ZIDESTORE) -I$(ZIDESTORE)/Common + +# make + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/bundle.make +-include GNUmakefile.postamble diff --git a/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.postamble b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.postamble new file mode 100644 index 000000000..3986bccea --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.postamble @@ -0,0 +1,17 @@ +# $Id: GNUmakefile.postamble,v 1.1 2004/05/12 14:45:56 helge Exp $ + +validate-wox: + xmllint --noout *.wox + +before-all :: validate-wox + + +ifneq ($(GNUSTEP_BUILD_DIR),) +after-all :: + @(cp bundle-info.plist \ + $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) +else +after-all :: + @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ + cp ../bundle-info.plist .) +endif diff --git a/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.preamble b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.preamble new file mode 100644 index 000000000..23c9438a9 --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/GNUmakefile.preamble @@ -0,0 +1,17 @@ +# $Id$ + +ifneq ($(GNUSTEP_BUILD_DIR),) + RELBUILD_DIR_libZideStoreCommonUI = \ + $(GNUSTEP_BUILD_DIR)/../Common/$(GNUSTEP_OBJ_DIR_NAME) +else + RELBUILD_DIR_libZideStoreCommonUI = ../Common +endif + +SchedulerUI_LIB_DIRS += -L$(RELBUILD_DIR_libZideStoreCommonUI) + +SchedulerUI_BUNDLE_LIBS += \ + -lNGObjWeb -lNGScripting -lNGJavaScript -ljs \ + -lNGMime -lNGStreams -lNGExtensions -lEOControl \ + -lXmlRpc -lDOM -lSaxObjC \ + -lSOGoLogic -lZideStoreCommonUI \ + -lNGiCal diff --git a/Misc/ZideStore/UI-X/Scheduler/NOTES b/Misc/ZideStore/UI-X/Scheduler/NOTES new file mode 100644 index 000000000..35c83b1bf --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/NOTES @@ -0,0 +1,52 @@ +// $Id: NOTES,v 1.1 2003/11/24 01:24:40 helge Exp $ + +Scheduler +========= + +SOPE based interface for scheduler. + +Class Hierarchy +=============== + + [WOComponent] + [SoComponent] + UIxAppointmentView + UIxCalView + UIxCalMonthView + UIxCalMonthOverview + UIxCalWeekView + UIxCalWeekOverview + UIxAptTableView + SchedulerUIProduct + +TBD: + UIxCalDayView + UIxCalDayOverview + UIxCalDayChart + UIxCalDayHChart + [UIxCalWeekView] + UIxCalWeekColumnView + UIxCalWeekChart + UIxCalWeekHChart + OGoYearOverview - should use aggressive caching in the long run + + - editor page (which comes up in a new window) + - delete page + - print views + +Notes +===== + +editor pages need to use JavaScript to trigger reloads in the parent window +=> find out how to do that + +URLs +==== + +/zidestore/ControlPanel/ => SoControlPanel +/zidestore/ControlPanel/Products => SoProductRegistry +/zidestore/ControlPanel/Products/ZideStoreUI => SoProduct +/zidestore/ControlPanel/Products/ZideStoreUI/Resources/ +=> SoProductResourceManager +/zidestore/ControlPanel/Products/ZideStoreUI/Resources/calendar.css +=> resource diff --git a/Misc/ZideStore/UI-X/Scheduler/SchedulerUIProduct.m b/Misc/ZideStore/UI-X/Scheduler/SchedulerUIProduct.m new file mode 100644 index 000000000..7666ef0a8 --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/SchedulerUIProduct.m @@ -0,0 +1,34 @@ +/* + Copyright (C) 2000-2003 SKYRIX Software AG + + This file is part of OGo + + 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: SchedulerUIProduct.m,v 1.1 2003/11/24 01:24:40 helge Exp $ + +#import + +@interface SchedulerUIProduct : NSObject +{ +} + +@end + +#include "common.h" + +@implementation SchedulerUIProduct +@end /* SchedulerUIProduct */ diff --git a/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.m b/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.m new file mode 100644 index 000000000..892fcb27c --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.m @@ -0,0 +1,277 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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: UIxAppointmentEditor.m 90 2004-06-30 01:07:58Z znek $ + + +#include "common.h" +#include +#include +#include + + +/* TODO: CLEAN THIS MESS UP */ + + +@interface NSObject (AppointmentHack) +- (BOOL)isAppointment; +@end + +@implementation NSObject (AppointmentHack) +- (BOOL)isAppointment { + return [self isKindOfClass:NSClassFromString(@"SxAppointment")]; +} +@end + +@interface iCalPerson (Convenience) +- (NSString *)rfc822Email; +@end + +@implementation iCalPerson (Convenience) +- (NSString *)rfc822Email { + NSString *_email = [self email]; + NSRange colon = [_email rangeOfString:@":"]; + if(colon.location != NSNotFound) { + return [_email substringFromIndex:colon.location + 1]; + } + return _email; +} +@end + +@interface UIxAppointmentEditor : UIxComponent +{ + id appointment; + id participants; +} + +- (SOGoAppointment *)appointment; +- (NSString *)iCalStringTemplate; +- (NSString *)iCalString; +- (BOOL)isNewAppointment; + +@end + +@implementation UIxAppointmentEditor + +- (void)dealloc { + [self->appointment release]; + [self->participants release]; + [super dealloc]; +} + + +/* accessors */ + + +- (NSString *)formattedAptStartTime { + NSCalendarDate *date; + + date = [[self appointment] startDate]; + /* TODO: convert this into display timeZone! */ + return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"]; +} + +- (BOOL)isNewAppointment { + return ! [[self clientObject] isAppointment]; +} + +- (NSString *)iCalString { + if([self isNewAppointment]) { + return [self iCalStringTemplate]; + } + else { + return [[self clientObject] valueForKey:@"iCalString"]; + } +} + +- (NSString *)iCalStringTemplate { + static NSString *iCalStringTemplate = \ + @"BEGIN:VCALENDAR\nMETHOD:REQUEST\nPRODID:OpenGroupware.org ZideStore 1.2\n" \ + @"VERSION:2.0\nBEGIN:VEVENT\nCLASS:PRIVATE\nSTATUS:CONFIRMED\n" \ + @"DTSTART:%@\nDTEND:%@\n" \ + @"TRANSP:OPAQUE\n" \ + @"END:VEVENT\nEND:VCALENDAR"; + NSCalendarDate *startDate, *endDate; + NSString *template; + + startDate = [self selectedDate]; + endDate = [startDate dateByAddingYears:0 months:0 days:0 + hours:1 minutes:0 seconds:0]; + + template = [NSString stringWithFormat:iCalStringTemplate, + [startDate icalString], + [endDate icalString]]; + + return template; +} + + +/* backend */ + + +- (SOGoAppointment *)appointment { + if(self->appointment == nil) { + self->appointment = [[SOGoAppointment alloc] + initWithICalString:[self iCalString]]; + } + return self->appointment; +} + +- (id)participants { + if(self->participants == nil) { + NSArray *attendees; + NSMutableArray *emailAddresses; + unsigned i, count; + + attendees = [self->appointment attendees]; + count = [attendees count]; + emailAddresses = [[NSMutableArray alloc] initWithCapacity:count]; + for(i = 0; i < count; i++) { + NSString *email; + + email = [[attendees objectAtIndex:i] rfc822Email]; + if(email) + [emailAddresses addObject:email]; + } + self->participants = [[emailAddresses componentsJoinedByString:@"\n"] + retain]; + [emailAddresses release]; + } + return self->participants; +} + + +/* helper */ + +- (NSString *)uriAsFormat { + NSString *uri, *qp; + NSRange r; + + uri = [[[self context] request] uri]; + + /* first: identify query parameters */ + r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; + if (r.length > 0) { + uri = [uri substringToIndex:r.location]; + qp = [uri substringFromIndex:r.location]; + } + else { + qp = nil; + } + + /* next: strip trailing slash */ + if([uri hasSuffix:@"/"]) + uri = [uri substringToIndex:([uri length] - 1)]; + r = [uri rangeOfString:@"/" options:NSBackwardsSearch]; + + /* then: cut of last path component */ + if(r.location == NSNotFound) { // no slash? are we at root? + uri = @"/"; + } + else { + uri = [uri substringToIndex:(r.location + 1)]; + } + /* next: append format token */ + uri = [uri stringByAppendingString:@"%@"]; + if(qp != nil) + uri = [uri stringByAppendingString:qp]; + return uri; +} + + +/* save */ + + +- (id)saveAction { + SOGoAppointment *apt; + NSString *iCalString, *summary, *location, *nextMethod, *uri, *uriFormat; + NSCalendarDate *sd, *ed; + NSArray *ps; + unsigned i, count; + WOResponse *r; + WORequest *req; + + req = [[self context] request]; + + /* get iCalString from hidden input */ + iCalString = [req formValueForKey:@"ical"]; + apt = [[SOGoAppointment alloc] initWithICalString:iCalString]; + + /* merge in form values */ + sd = [NSCalendarDate dateWithString:[req formValueForKey:@"startDate"] + calendarFormat:@"%Y-%m-%d %H:%M"]; + [apt setStartDate:sd]; + ed = [NSCalendarDate dateWithString:[req formValueForKey:@"endDate"] + calendarFormat:@"%Y-%m-%d %H:%M"]; + [apt setEndDate:ed]; + summary = [req formValueForKey:@"summary"]; + [apt setSummary:title]; + location = [req formValueForKey:@"location"]; + [apt setLocation:location]; + + [apt removeAllAttendees]; /* clean up */ + ps = [[req formValueForKey:@"participants"] + componentsSeparatedByString:@"\n"]; + count = [ps count]; + for(i = 0; i < count; i++) { + NSString *email; + + email = [ps objectAtIndex:i]; + if([email length] > 0) { + iCalPerson *p; + NSRange cnr; + + p = [[iCalPerson alloc] init]; + [p setEmail:[NSString stringWithFormat:@"mailto:%@", email]]; + /* construct a fake CN */ + cnr = [email rangeOfString:@"@"]; + if(cnr.location != NSNotFound) { + [p setCn:[email substringToIndex:cnr.location]]; + } + [apt addToAttendees:p]; + [p release]; + } + } + + /* receive current representation for save operation */ + iCalString = [apt iCalString]; + [apt release]; + + + /* determine what's to do and where to go next */ + if([self isNewAppointment]) { + nextMethod = @"duhduh"; + } + else { + nextMethod = @"view"; + } + + NSLog(@"%s new iCalString:\n%@", __PRETTY_FUNCTION__, iCalString); + + uriFormat = [self uriAsFormat]; + uri = [NSString stringWithFormat:uriFormat, nextMethod]; + + r = [WOResponse responseWithRequest:req]; + [r setStatus:302 /* moved */]; + [r setHeader:uri forKey:@"location"]; + return r; +} + +@end diff --git a/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.wox b/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.wox new file mode 100644 index 000000000..ce2381aad --- /dev/null +++ b/Misc/ZideStore/UI-X/Scheduler/UIxAppointmentEditor.wox @@ -0,0 +1,111 @@ + + + +
+ + + + + + + + + + +
+ + + + + +
+ Appointment Editor + +
+
+ + + + + + + + + + + + + + + + + + + + +
+ Appointment on +
+ Start time: + + + + +
+ End time: + + + + +
+ Title: + + + + +
+ Location: + + + + +
+
+ + + + + + +
+ Search participants +
+ Participants: + + +