see ChangeLog

Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89

Monotone-Author: dev-unix.inverse.qc.ca
Monotone-Date: 2006-06-15T19:34:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
dev-unix.inverse.qc.ca
2006-06-15 19:34:10 +00:00
commit f18c764ffa
965 changed files with 99196 additions and 0 deletions

3
ChangeLog Normal file
View File

@@ -0,0 +1,3 @@
2006-06-15 ludovic@inverse.ca
* Initial import of SOGo from trunk.

13
GNUmakefile Normal file
View File

@@ -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

219
Main/ChangeLog Normal file
View File

@@ -0,0 +1,219 @@
2005-08-01 Helge Hess <helge.hess@skyrix.com>
* GNUmakefile: added FHS installation of sogod-0.9 (v0.9.41)
* SOGo.m: added class security declarations (previously in
product.plist of MainUI), ensure that core SOGo SoClasses are loaded
(v0.9.40)
* v0.9.39
* moved MainUI product bundle to UI/MainUI
* SOGo.m: fixed some gcc 4.0 warnings
2005-07-21 Helge Hess <helge.hess@opengroupware.org>
* product.plist: protect homepage using SOPE access control (v0.9.38)
* SOGoRootPage.m: redirect authenticated users to their login page
(v0.9.37)
2005-07-21 Marcus Mueller <znek@mulle-kybernetik.com>
* homepage.js: fixed post to send an empty string instead of null -
this works in Firefox on MacOSX but fails on Windows (v0.9.36)
2005-07-20 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.35
* README: updated with new default description
* SOGoUserHomePage.wox: in case user is not authorized to change the
internet access flag, the rendered text is different now
* English.lproj/Localizable.strings: provide new label for case that
user is not allowed to change internet access
2005-07-15 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile.preamble: fixed Cocoa compilation (v0.9.34)
2005-07-14 Helge Hess <helge.hess@opengroupware.org>
* moved SOGoUser and SOGoAuthenticator to libSOGo (v0.9.33)
2005-07-14 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.m: vacation message state is now properly being
retrieved from AgenorUserManager (v0.9.32)
* v0.9.31
* SOGoUserHomePage.[m, wox]: added internet access lock
display/modification and vacation state (currently only faked)
* homepage.js: JavaScript in use on the homepage
* English.lproj/Localizable.strings: removed old labels and added a
bunch of new labels
2005-07-12 Helge Hess <helge.hess@opengroupware.org>
* v0.9.30
* SOGoAuthenticator.m: create SOGoUser objects
* added 'SOGoUser' object/class as a subclass of SoUser, using this
object various Agenor properties like cn or email can be determined
(will use the AgenorUserManager to retrieve such)
2005-07-08 Marcus Mueller <znek@mulle-kybernetik.com>
* README: updated for new default 'SOGoAllowsUnrestrictedAccess'
2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.29
* README: updated defaults documentation
* SOGo.m: added new default 'SOGoEnableDoubleReleaseCheck' for
debugging of NSAutoreleasePool issues
2005-03-28 Helge Hess <helge.hess@opengroupware.org>
* SOGoProductLoader.m: do not try to load directories without
extensions (v0.9.28)
2005-03-23 Marcus Mueller <znek@mulle-kybernetik.com>
* renamed "default.strings" to "Localizable.strings" (v0.9.27)
2005-02-21 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile: properly install bundle in FHS (v0.9.26)
2005-02-20 Helge Hess <helge.hess@opengroupware.org>
* SOGoProductLoader.m: fixed product loader for FHS and Cocoa (0.9.25)
2005-02-17 Helge Hess <helge.hess@opengroupware.org>
* SOGo.m: added a proper application 'name' for the WEResourceManager,
use WEResourceManager per default (v0.9.24)
2005-02-12 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGo.m: corrected incorrect use of logging (v0.9.23)
2005-02-10 Helge Hess <helge.hess@opengroupware.org>
* GNUmakefile.preamble: fixed linking on MacOSX (v0.9.22)
* v0.9.21
* SOGoProductLoader.m: perform properly versioned plugin lookups (load
bundles from Library/SOGo-0.9 instead of Library/SOGo)
* sogod is now a tool, not a .woa anymore
* SOGo.m: minor cleanup in locale code, removed some dead code
(v0.9.20)
* GNUmakefile: some support for tool compilation (does not work yet)
* sogod.m: moved application class to own file, started to work on
daemon/product separation (v0.9.19)
2004-01-07 Marcus Mueller <znek@mulle-kybernetik.com>
* {English/French}.lproj/default.strings: changed encoding from
ISO-Latin-1 to UTF-8, which is now the default (v0.9.18)
2004-12-15 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.m: added defaultAction to redirect to
"Calendar/" (v0.9.17)
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoProductLoader.m, sogod.m: changed to use NGLogging (v0.9.16)
2004-10-19 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoUserHomePage.[wox|m]: changed hrefs to be computed dynamically
instead of being static (v0.9.15)
2004-10-18 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.14
* SOGoUserHomePage.wox: Changed label for "eMail" to "Mail" for
consistency
* *.lproj/default.strings: added label "Mail"
2004-09-26 Helge Hess <helge.hess@opengroupware.org>
* sogod.m: return 404 for favicon.ico queries (v0.9.13)
* fixed title bindings to const: in .wox (should be label:?) (v0.9.12)
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
* sogod.m: fixed a compile warning on OSX (v0.9.11)
2004-09-20 Helge Hess <helge.hess@skyrix.com>
* SOGoUserHomePage.wox: added link to Mail (v0.9.10)
2004-08-27 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.9
* English.lproj/default.strings, French.lproj/default.strings:
dictionaries for labels
* SOGoUserHomePage.wox: replaced constant strings with labels
2004-08-26 Helge Hess <helge.hess@skyrix.com>
* GNUmakefile.preamble: fixed superflous libjs (v0.9.8)
2004-08-11 Helge Hess <helge.hess@skyrix.com>
* added SOGoGroupPage and SOGoGroupsPage (default views for the group
folders) (v0.9.7)
* sogod.m: do not set SoRootURL manually (v0.9.6)
2004-08-10 Marcus Mueller <znek@mulle-kybernetik.com>
* French.lproj/Locale: minor changes to capitalization (v0.9.5)
2004-07-27 Marcus Mueller <znek@mulle-kybernetik.com>
* sogod.m: added static SoRootURL to context (v0.9.4)
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* sogod.m, */Locale: converted to UTF-8 for better editability (v0.9.3)
2004-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.2
* sogod.m: added localization methods. Current locale is put into
WOContext upon first request. All locales are cached in the
application object.
* [English,French].lproj: created. Put appropriate Locale
representations here.
* GNUmakefile: added LANGUAGES and LOCALIZED_RESOURCES.
* SOGoRootPage.wox: some debug code (for locales).
* created ChangeLog.

21
Main/GNUmakefile Normal file
View File

@@ -0,0 +1,21 @@
# GNUstep makefile
-include ../config.make
include $(GNUSTEP_MAKEFILES)/common.make
include ../Version
include ./Version
SOGOD = sogod-$(MAJOR_VERSION).$(MINOR_VERSION)
TOOL_NAME = $(SOGOD)
# daemon tool
$(SOGOD)_OBJC_FILES += \
sogod.m \
SOGo.m \
SOGoProductLoader.m \
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/tool.make
-include GNUmakefile.postamble
include fhs.make

28
Main/GNUmakefile.preamble Normal file
View File

@@ -0,0 +1,28 @@
# compile settings
ADDITIONAL_CPPFLAGS += \
-DSOGO_MAJOR_VERSION=$(MAJOR_VERSION) \
-DSOGO_MINOR_VERSION=$(MINOR_VERSION) \
-DSOGO_SUBMINOR_VERSION=$(SUBMINOR_VERSION)
ADDITIONAL_INCLUDE_DIRS += \
-I../SoObjects/ \
-I../..
ADDITIONAL_LIB_DIRS += \
-L../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)/ \
-L../OGoContentStore/$(GNUSTEP_OBJ_DIR)/
SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib
$(SOGOD)_TOOL_LIBS += \
-lSOGo \
-lOGoContentStore \
-lGDLContentStore \
-lGDLAccess \
-lWEExtensions \
-lNGiCal \
-lNGObjWeb \
-lNGMime -lNGLdap \
-lNGStreams -lNGExtensions -lEOControl \
-lDOM -lXmlRpc -lSaxObjC

47
Main/MainUIProduct.m Normal file
View File

@@ -0,0 +1,47 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#import <Foundation/NSObject.h>
@interface MainUIProduct : NSObject
{
}
@end
#import <Foundation/Foundation.h>
@implementation MainUIProduct
+ (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name {
// TODO: this is kind of a hack, we reuse the class registry to find
// resources ...
NSBundle *bundle;
NSString *ldir, *path;
bundle = [NSBundle bundleForClass:self];
ldir = [_name stringByAppendingPathExtension:@"lproj"];
path = [bundle pathForResource:@"Locale" ofType:nil inDirectory:ldir];
return path;
}
@end /* MainUIProduct */

88
Main/README Normal file
View File

@@ -0,0 +1,88 @@
SOGo
====
Master Daemon, loads the functionality from product bundles in Library/SOGo.
Setup
=====
Defaults write sogod NGBundlePath '"$HOME/Library/SOGo"'
=> otherwise some bundles will clash with "fat" OGo
=> the UIx .wox driver must be found
Defaults
========
SOGoDefaultLanguage - string - currently used for selecting the language of
the mail templates. Default is "French".
SOGoCrashOnSessionCreate - bool - crash the server if a session is created
=> useful for debugging
SOGoEnableDoubleReleaseCheck - bool - call
+[NSAutoreleasePool enableDoubleReleaseCheck:YES] upon start
=> useful for debugging
SOGoInternetDetectQualifier
- an EOQualifier to detect whether a set of HTTP headers is from the outside,
eg: "NOT (minequprovenance = 'intranet')"
-SOGoInternetDetectQualifier '"NOT (minequprovenance = \"intranet\")"'
Note: all header field names are lowercase
Testing: -SOGoInternetDetectQualifier '"host = \"agenor.opengroupware.org\""'
AgenorProfileURL - URL
- configure database location of the user profile
eg: http://postgres:@agenor-db:5432/test/sogo_user_profile
SOGoDoNotRedirectRootPage - YES|NO
- do not redirect to home-folder for authenticated users but show the
root page (with the login name)
What it does
============
- provides locale support
- preloads the SOGo products (SOGoProductLoader)
- provides the root object (the application object with user lookup)
- sets the authenticator
- does some process limits and restart support
Apache Setup
============
AliasMatch /SOGoHH/so/ControlPanel/Products/(.*)/Resources/(.*) \
/home/helge/GNUstep/Library/SOGo-0.9/$1.SOGo/Resources/$2
<LocationMatch "^/SOGoHH*">
AuthName "Agenor LDAP"
AuthType Basic
AuthLDAPEnabled on
AuthLDAPUrl ldap://agenor-ldap:389/ou=organisation,dc=equipement,dc=gouv,dc=fr??sub?(&(objectClass=person)(uid=*))
require valid-user
SetHandler ngobjweb-adaptor
SetAppPort 9000
</LocationMatch>
<LocationMatch "^/SOGoHH/so/ControlPanel/Products/.*UI/Resources/.*(\.png$|\.gif$|\.css$|\.js$)">
SetHandler default-handler
</LocationMatch>
FHS Setup
=========
NOTE: use the appname, sogo-0.9, not the tool name (sogod-0.9)!
cd /usr/local/share
mkdir sogo-0.9/
cd sogo-0.9/
ln -s ~/dev/SOGo-trunk/UI/Templates ./templates
ln -s ~/dev/SOGo-trunk/UI/WebServerResources ./www
Apache:
Alias /SOGo.woa/WebServerResources/ \
/usr/local/share/sogo-0.9/www/

320
Main/SOGo.m Normal file
View File

@@ -0,0 +1,320 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include <NGObjWeb/SoApplication.h>
@interface SOGo : SoApplication
{
NSMutableDictionary *localeLUT;
}
- (NSDictionary *)currentLocaleConsideringLanguages:(NSArray *)_langs;
- (NSDictionary *)localeForLanguageNamed:(NSString *)_name;
@end
#include "SOGoProductLoader.h"
#include <SOGo/SOGoAuthenticator.h>
#include <WEExtensions/WEResourceManager.h>
#include <SOGo/SOGoUserFolder.h>
#include "common.h"
@implementation SOGo
static unsigned int vMemSizeLimit = 0;
static BOOL doCrashOnSessionCreate = NO;
+ (void)initialize {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
id tmp;
doCrashOnSessionCreate = [ud boolForKey:@"SOGoCrashOnSessionCreate"];
/* vMem size check - default is 200MB */
tmp = [ud objectForKey:@"SxVMemLimit"];
vMemSizeLimit = (tmp != nil)
? [tmp intValue]
: 200;
if (vMemSizeLimit > 0) {
NSLog(@"Note: vmem size check enabled: shutting down app when "
@"vmem > %d MB", vMemSizeLimit);
}
#if LIB_FOUNDATION_LIBRARY
if ([ud boolForKey:@"SOGoEnableDoubleReleaseCheck"])
[NSAutoreleasePool enableDoubleReleaseCheck:YES];
#endif
/* SoClass security declarations */
/* require View permission to access the root (bound to authenticated ...) */
[[self soClassSecurityInfo] declareObjectProtected:SoPerm_View];
/* to allow public access to all contained objects (subkeys) */
[[self soClassSecurityInfo] setDefaultAccess:@"allow"];
/* require Authenticated role for View and WebDAV */
[[self soClassSecurityInfo] declareRole:SoRole_Authenticated
asDefaultForPermission:SoPerm_View];
[[self soClassSecurityInfo] declareRole:SoRole_Authenticated
asDefaultForPermission:SoPerm_WebDAVAccess];
}
- (id)init {
if ((self = [super init])) {
WOResourceManager *rm;
/* ensure core SoClass'es are setup */
[NSClassFromString(@"SOGoObject") soClass];
[NSClassFromString(@"SOGoContentObject") soClass];
[NSClassFromString(@"SOGoFolder") soClass];
/* setup locale cache */
self->localeLUT = [[NSMutableDictionary alloc] initWithCapacity:2];
/* load products */
[[SOGoProductLoader productLoader] loadProducts];
/* setup resource manager */
rm = [[WEResourceManager alloc] init];
[self setResourceManager:rm];
}
return self;
}
- (void)dealloc {
[self->localeLUT release];
[super dealloc];
}
/* authenticator */
- (id)authenticatorInContext:(id)_ctx {
return [SOGoAuthenticator sharedSOGoAuthenticator];
}
/* name lookup */
- (BOOL)isUserName:(NSString *)_key inContext:(id)_ctx {
if ([_key length] < 1)
return NO;
if (isdigit([_key characterAtIndex:0]))
return NO;
return YES;
}
- (id)lookupUser:(NSString *)_key inContext:(id)_ctx {
return [[[NSClassFromString(@"SOGoUserFolder") alloc]
initWithName:_key inContainer:self] autorelease];
}
- (void)_setupLocaleInContext:(WOContext *)_ctx {
NSArray *langs;
NSDictionary *locale;
if ([[_ctx valueForKey:@"locale"] isNotNull])
return;
langs = [[(WOContext *)_ctx request] browserLanguages];
locale = [self currentLocaleConsideringLanguages:langs];
[_ctx takeValue:locale forKey:@"locale"];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
id obj;
/* put locale info into the context in case it's not there */
[self _setupLocaleInContext:_ctx];
/* first check attributes directly bound to the application */
if ((obj = [super lookupName:_key inContext:_ctx acquire:_flag]))
return obj;
/*
The problem is, that at this point we still get request for resources,
eg 'favicon.ico'.
Addition: we also get queries for various other methods, like "GET" if
no method was provided in the query path.
*/
if ([_key isEqualToString:@"favicon.ico"])
return nil;
if ([self isUserName:_key inContext:_ctx])
return [self lookupUser:_key inContext:_ctx];
return nil;
}
/* WebDAV */
- (NSString *)davDisplayName {
/* this is used in the UI, eg in the navigation */
return @"SOGo";
}
/* exception handling */
- (WOResponse *)handleException:(NSException *)_exc
inContext:(WOContext *)_ctx
{
printf("EXCEPTION: %s\n", [[_exc description] cString]);
abort();
}
/* runtime maintenance */
- (void)checkIfDaemonHasToBeShutdown {
unsigned int limit, vmem;
if ((limit = vMemSizeLimit) == 0)
return;
vmem = [[NSProcessInfo processInfo] virtualMemorySize]/1048576;
if (vmem > limit) {
[self logWithFormat:
@"terminating app, vMem size limit (%d MB) has been reached"
@" (currently %d MB)",
limit, vmem];
[self terminate];
}
}
- (WOResponse *)dispatchRequest:(WORequest *)_request {
static NSArray *runLoopModes = nil;
WOResponse *resp;
resp = [super dispatchRequest:_request];
if ([self isTerminating])
return resp;
if (runLoopModes == nil)
runLoopModes = [[NSArray alloc] initWithObjects:NSDefaultRunLoopMode, nil];
// TODO: a bit complicated? (-perform:afterDelay: doesn't work?)
[[NSRunLoop currentRunLoop] performSelector:
@selector(checkIfDaemonHasToBeShutdown)
target:self argument:nil
order:1 modes:runLoopModes];
return resp;
}
/* session management */
- (id)createSessionForRequest:(WORequest *)_request {
[self warnWithFormat:@"session creation requested!"];
if (doCrashOnSessionCreate)
abort();
return [super createSessionForRequest:_request];
}
/* localization */
- (NSDictionary *)currentLocaleConsideringLanguages:(NSArray *)_langs {
unsigned i, count;
/* assume _langs is ordered by priority */
count = [_langs count];
for (i = 0; i < count; i++) {
NSString *lname;
NSDictionary *locale;
lname = [_langs objectAtIndex:i];
locale = [self localeForLanguageNamed:lname];
if (locale != nil)
return locale;
}
/* no appropriate language, fallback to default */
return [self localeForLanguageNamed:@"English"];
}
- (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name {
static Class MainProduct = Nil;
NSString *lpath;
lpath = [[self resourceManager] pathForResourceNamed:@"Locale"
inFramework:nil
languages:[NSArray arrayWithObject:_name]];
if ([lpath isNotNull])
return lpath;
if (MainProduct == Nil) {
if ((MainProduct = NSClassFromString(@"MainUIProduct")) == Nil)
[self errorWithFormat:@"did not find MainUIProduct class!"];
}
lpath = [(id)MainProduct pathToLocaleForLanguageNamed:_name];
if ([lpath isNotNull])
return lpath;
return nil;
}
- (NSDictionary *)localeForLanguageNamed:(NSString *)_name {
NSString *lpath;
id data;
NSDictionary *locale;
if (![_name isNotNull]) {
[self errorWithFormat:@"%s: name parameter must not be nil!",
__PRETTY_FUNCTION__];
return nil;
}
if ((locale = [self->localeLUT objectForKey:_name]) != nil)
return locale;
if ((lpath = [self pathToLocaleForLanguageNamed:_name]) == nil) {
[self errorWithFormat:@"did not find Locale for language: %@", _name];
return nil;
}
if ((data = [NSData dataWithContentsOfFile:lpath]) == nil) {
[self logWithFormat:@"%s didn't find locale with name:%@",
__PRETTY_FUNCTION__,
_name];
return nil;
}
data = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
locale = [data propertyList];
if (locale == nil) {
[self logWithFormat:@"%s couldn't load locale with name:%@",
__PRETTY_FUNCTION__,
_name];
return nil;
}
[self->localeLUT setObject:locale forKey:_name];
return locale;
}
/* name (used by the WEResourceManager) */
- (NSString *)name {
return @"SOGo-0.9";
}
@end /* SOGo */

44
Main/SOGoProductLoader.h Normal file
View File

@@ -0,0 +1,44 @@
/*
Copyright (C) 2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
// $Id: SOGoProductLoader.h 540 2005-02-10 16:22:38Z helge $
#ifndef __Main_SOGoProductLoader_H__
#define __Main_SOGoProductLoader_H__
#import <Foundation/NSObject.h>
@class NSString, NSArray;
@interface SOGoProductLoader : NSObject
{
NSString *productDirectoryName;
NSArray *searchPathes;
}
+ (id)productLoader;
/* operations */
- (void)loadProducts;
@end
#endif /* __Main_SOGoProductLoader_H__ */

174
Main/SOGoProductLoader.m Normal file
View File

@@ -0,0 +1,174 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include "SOGoProductLoader.h"
#include "common.h"
@implementation SOGoProductLoader
+ (int)sogoMajorVersion {
return SOGO_MAJOR_VERSION;
}
+ (int)sogoMinorVersion {
return SOGO_MINOR_VERSION;
}
+ (id)productLoader {
return [[[self alloc] init] autorelease];
}
- (id)init {
if ((self = [super init])) {
self->productDirectoryName =
[[NSString alloc] initWithFormat:@"SOGo-%i.%i",
[[self class] sogoMajorVersion],
[[self class] sogoMinorVersion]];
}
return self;
}
- (void)dealloc {
[self->productDirectoryName release];
[self->searchPathes release];
[super dealloc];
}
/* loading */
- (void)_addCocoaSearchPathesToArray:(NSMutableArray *)ma {
id tmp;
tmp = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
NSAllDomainsMask,
YES);
if ([tmp count] > 0) {
NSEnumerator *e;
e = [tmp objectEnumerator];
while ((tmp = [e nextObject])) {
tmp = [tmp stringByAppendingPathComponent:self->productDirectoryName];
if (![ma containsObject:tmp])
[ma addObject:tmp];
}
}
}
- (void)_addGNUstepSearchPathesToArray:(NSMutableArray *)ma {
NSDictionary *env;
id tmp;
env = [[NSProcessInfo processInfo] environment];
if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil)
tmp = [env objectForKey:@"GNUSTEP_PATHLIST"];
tmp = [tmp componentsSeparatedByString:@":"];
if ([tmp count] > 0) {
NSEnumerator *e;
e = [tmp objectEnumerator];
while ((tmp = [e nextObject])) {
tmp = [tmp stringByAppendingPathComponent:@"Library"];
tmp = [tmp stringByAppendingPathComponent:self->productDirectoryName];
if (![ma containsObject:tmp])
[ma addObject:tmp];
}
}
else {
NSLog(@"%s: empty library search path !", __PRETTY_FUNCTION__);
}
}
- (void)_addFHSPathesToArray:(NSMutableArray *)ma {
NSString *s;
s = @"sogod-0.9";
[ma addObject:[@"/usr/local/lib/" stringByAppendingString:s]];
[ma addObject:[@"/usr/lib/" stringByAppendingString:s]];
}
- (NSArray *)productSearchPathes {
NSMutableArray *ma;
BOOL hasGNUstepEnv;
if (self->searchPathes != nil)
return self->searchPathes;
hasGNUstepEnv = [[[[NSProcessInfo processInfo] environment]
objectForKey:@"GNUSTEP_USER_ROOT"] length] > 0 ? YES : NO;
ma = [NSMutableArray arrayWithCapacity:6];
if (hasGNUstepEnv)
[self _addGNUstepSearchPathesToArray:ma];
#if COCOA_Foundation_LIBRARY
else
[self _addCocoaSearchPathesToArray:ma];
#endif
[self _addFHSPathesToArray:ma];
self->searchPathes = [ma copy];
if ([self->searchPathes count] == 0) {
[self logWithFormat:@"%s: no search pathes were found !",
__PRETTY_FUNCTION__];
}
return self->searchPathes;
}
- (void)loadProducts {
SoProductRegistry *registry = nil;
NSFileManager *fm;
NSEnumerator *pathes;
NSString *lpath;
registry = [SoProductRegistry sharedProductRegistry];
fm = [NSFileManager defaultManager];
pathes = [[self productSearchPathes] objectEnumerator];
while ((lpath = [pathes nextObject]) != nil) {
NSEnumerator *productNames;
NSString *productName;
[self logWithFormat:@"scanning SOGo products in: %@", lpath];
productNames = [[fm directoryContentsAtPath:lpath] objectEnumerator];
while ((productName = [productNames nextObject]) != nil) {
NSString *bpath;
if ([[productName pathExtension] length] == 0)
/* filter out directories without extensions */
continue;
bpath = [lpath stringByAppendingPathComponent:productName];
[self logWithFormat:@" register SOGo product: %@",
[bpath lastPathComponent]];
[registry registerProductAtPath:bpath];
}
}
if (![registry loadAllProducts])
[self warnWithFormat:@"could not load all products !"];
}
@end /* SOGoProductLoader */

7
Main/Version Normal file
View File

@@ -0,0 +1,7 @@
# Version file
SUBMINOR_VERSION:=41
# v0.9.32 requires libSOGo v0.9.57
# v0.9.24 requires libWEExtensions v4.5.67
# v0.9.16 requires libNGExtensions v4.5.136

33
Main/common.h Normal file
View File

@@ -0,0 +1,33 @@
/*
Copyright (C) 2002-2004 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#import <Foundation/Foundation.h>
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
#include <GDLAccess/GDLAccess.h>

26
Main/fhs.make Normal file
View File

@@ -0,0 +1,26 @@
# postprocessing
# FHS support (this is a hack and is going to be done by gstep-make!)
ifneq ($(FHS_INSTALL_ROOT),)
FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/
FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/
FHS_SBIN_DIR=$(FHS_INSTALL_ROOT)/sbin/
fhs-bin-dirs ::
$(MKDIRS) $(FHS_SBIN_DIR)
NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)"
move-daemons-to-fhs :: fhs-bin-dirs
@echo "moving daemons from $(NONFHS_BINDIR) to $(FHS_SBIN_DIR) .."
for i in $(TOOL_NAME); do \
mv "$(NONFHS_BINDIR)/$${i}" $(FHS_SBIN_DIR); \
done
move-to-fhs :: move-daemons-to-fhs
after-install :: move-to-fhs
endif

38
Main/sogod.m Normal file
View File

@@ -0,0 +1,38 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
#include <NGObjWeb/NGObjWeb.h>
#include "common.h"
int main(int argc, char **argv, char **env) {
NSAutoreleasePool *pool;
pool = [[NSAutoreleasePool alloc] init];
#if LIB_FOUNDATION_LIBRARY
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
[NGBundleManager defaultBundleManager];
WOWatchDogApplicationMain(@"SOGo", argc, (void*)argv);
[pool release];
return 0;
}

38
Misc/WebUI/Application.h Normal file
View File

@@ -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 <NGObjWeb/SoApplication.h>
@interface Application : SoApplication
{
}
@end
#endif /* __Application_H_ */

38
Misc/WebUI/Application.m Normal file
View File

@@ -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

482
Misc/WebUI/COPYING Normal file
View File

@@ -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.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

4
Misc/WebUI/COPYRIGHT Normal file
View File

@@ -0,0 +1,4 @@
Copyright (C) 2004 SKYRIX Software AG
Contact: info@skyrix.com

13
Misc/WebUI/ChangeLog Normal file
View File

@@ -0,0 +1,13 @@
2004-05-27 Marcus Mueller <mm@skyrix.com>
* README: updated
2004-05-27 Marcus Mueller <mm@skyrix.com>
* README, NOTES: updated
* NGExtensions/NGLogging/ChangeLog: created
2004-05-26 Marcus Mueller <mm@skyrix.com>
* ChangeLog: created

38
Misc/WebUI/DirectAction.h Normal file
View File

@@ -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 <NGObjWeb/NGObjWeb.h>
@interface DirectAction : WODirectAction
{
}
@end
#endif /* __DirectAction_H_ */

29
Misc/WebUI/DirectAction.m Normal file
View File

@@ -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

Binary file not shown.

33
Misc/WebUI/GNUmakefile Normal file
View File

@@ -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

View File

@@ -0,0 +1,8 @@
# $Id$
-include GNUmakefile.preamble.local
ifeq ($(findstring darwin, $(GNUSTEP_HOST_OS)),)
ADDITIONAL_OBJCFLAGS += -DWITHOUT_SOPEX
endif

26
Misc/WebUI/Info.plist Normal file
View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>WebUI</string>
<key>CFBundleIconFile</key>
<string>Lori</string>
<key>CFBundleIdentifier</key>
<string>my.sope.apps.WebUI</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>NSMainNibFile</key>
<string></string>
<key>NSPrincipalClass</key>
<string>SOPEXApplication</string>
</dict>
</plist>

BIN
Misc/WebUI/Lori.icns Normal file

Binary file not shown.

View File

@@ -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

View File

@@ -0,0 +1,17 @@
2004-05-27 Marcus Mueller <mm@skyrix.com>
* 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 <mm@skyrix.com>
* NGLogSyslogAppender.[hm]: syslog appender, untested.
* ChangeLog: created

View File

@@ -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

View File

@@ -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 <Foundation/Foundation.h>
#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_ */

View File

@@ -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

View File

@@ -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_ */

View File

@@ -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

View File

@@ -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 <Foundation/Foundation.h>
#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_ */

View File

@@ -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 <NGExtensions/NGExtensions.h>
@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

View File

@@ -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_ */

View File

@@ -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 <syslog.h>
#include <stdarg.h>
@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

View File

@@ -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 <Foundation/Foundation.h>
#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_ */

View File

@@ -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 <NGExtensions/NGExtensions.h>
#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

View File

@@ -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 <Foundation/Foundation.h>
#include "NSObject+ExtendedLogging.h"
#include "NGLogger.h"
#endif /* __NGLogging_H_ */

View File

@@ -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 <Foundation/Foundation.h>
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_ */

View File

@@ -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

15
Misc/WebUI/NOTES Normal file
View File

@@ -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).

3
Misc/WebUI/PROJECTLEAD Normal file
View File

@@ -0,0 +1,3 @@
# $Id$
PROJECTLEAD=helge.hess@opengroupware.org

24
Misc/WebUI/README Normal file
View File

@@ -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

38
Misc/WebUI/Session.h Normal file
View File

@@ -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 <NGObjWeb/NGObjWeb.h>
@interface Session : WOSession
{
}
@end
#endif /* __Session_H_ */

38
Misc/WebUI/Session.m Normal file
View File

@@ -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

0
Misc/WebUI/TODO Normal file
View File

15
Misc/WebUI/Version Normal file
View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -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 = "<group>";
};
089C165CFE840E0CC02AAC07 = {
children = (
089C165DFE840E0CC02AAC07,
);
isa = PBXVariantGroup;
name = InfoPlist.strings;
refType = 4;
sourceTree = "<group>";
};
089C165DFE840E0CC02AAC07 = {
fileEncoding = 10;
isa = PBXFileReference;
lastKnownFileType = text.plist.strings;
name = English;
path = English.lproj/InfoPlist.strings;
refType = 4;
sourceTree = "<group>";
};
//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 = "<absolute>";
};
//100
//101
//102
//103
//104
//190
//191
//192
//193
//194
19C28FACFE9D520D11CA2CBB = {
children = (
8D1107320486CEB800E47090,
);
isa = PBXGroup;
name = Products;
refType = 4;
sourceTree = "<group>";
};
//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 = "<group>";
};
29B97316FDCFA39411CA2CEA = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = WebUI_main.m;
refType = 4;
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA = {
children = (
8D1107310486CEB800E47090,
089C165CFE840E0CC02AAC07,
ADA38B8105DD238A00C820AA,
);
isa = PBXGroup;
name = Resources;
path = "";
refType = 4;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA = {
children = (
1058C7A1FEA54F0111CA2CBB,
ADEE3DEB05DD135A00F523DB,
AD19ED3105D7FAF4009EBA3A,
ADEE3DDB05DD131E00F523DB,
);
isa = PBXGroup;
name = Frameworks;
path = "";
refType = 4;
sourceTree = "<group>";
};
//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 = "<group>";
};
//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 = "<group>";
};
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 = "<group>";
};
AD0618CF066610A200AC467F = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = NGLogSyslogAppender.m;
refType = 4;
sourceTree = "<group>";
};
AD0618D0066610A200AC467F = {
fileRef = AD0618CE066610A200AC467F;
isa = PBXBuildFile;
settings = {
};
};
AD0618D1066610A200AC467F = {
fileRef = AD0618CF066610A200AC467F;
isa = PBXBuildFile;
settings = {
};
};
AD0618D40666121C00AC467F = {
explicitFileType = text;
fileEncoding = 4;
isa = PBXFileReference;
path = ChangeLog;
refType = 4;
sourceTree = "<group>";
tabWidth = 4;
usesTabs = 1;
};
AD0618D50666121C00AC467F = {
fileRef = AD0618D40666121C00AC467F;
isa = PBXBuildFile;
settings = {
};
};
AD0ACCDE062732BD0054A820 = {
children = (
AD0ACCDF062733370054A820,
AD0ACCE1062733370054A820,
AD0ACCE0062733370054A820,
);
isa = PBXGroup;
name = Makefiles;
refType = 4;
sourceTree = "<group>";
};
AD0ACCDF062733370054A820 = {
explicitFileType = sourcecode.make;
fileEncoding = 30;
isa = PBXFileReference;
path = GNUmakefile;
refType = 4;
sourceTree = "<group>";
};
AD0ACCE0062733370054A820 = {
explicitFileType = sourcecode.make;
fileEncoding = 30;
isa = PBXFileReference;
path = GNUmakefile.postamble;
refType = 4;
sourceTree = "<group>";
};
AD0ACCE1062733370054A820 = {
explicitFileType = sourcecode.make;
fileEncoding = 30;
isa = PBXFileReference;
path = GNUmakefile.preamble;
refType = 4;
sourceTree = "<group>";
};
AD1967230665E52400E19038 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = NGLogConsoleAppender.h;
refType = 4;
sourceTree = "<group>";
};
AD1967240665E52400E19038 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = NGLogConsoleAppender.m;
refType = 4;
sourceTree = "<group>";
};
AD1967250665E52400E19038 = {
fileRef = AD1967230665E52400E19038;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Public,
);
};
};
AD1967260665E52400E19038 = {
fileRef = AD1967240665E52400E19038;
isa = PBXBuildFile;
settings = {
};
};
AD1967610665FE4800E19038 = {
children = (
AD1967620665FE5B00E19038,
);
isa = PBXGroup;
name = Makefiles;
refType = 4;
sourceTree = "<group>";
};
AD1967620665FE5B00E19038 = {
explicitFileType = sourcecode.make;
fileEncoding = 4;
isa = PBXFileReference;
path = GNUmakefile;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
AD19ED3105D7FAF4009EBA3A = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = SOPE.framework;
path = /Library/Frameworks/SOPE.framework;
refType = 0;
sourceTree = "<absolute>";
};
AD19ED5205D7FBD1009EBA3A = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = Application.h;
refType = 4;
sourceTree = "<group>";
};
AD19ED5305D7FBD1009EBA3A = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = Application.m;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
AD19ED6405D7FBEA009EBA3A = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = Session.m;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
AD95AEBA0664BC6700FCB211 = {
fileRef = AD95AEB90664BC6700FCB211;
isa = PBXBuildFile;
settings = {
};
};
AD95AEBB0664BC7B00FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = ChangeLog;
refType = 4;
sourceTree = "<group>";
tabWidth = 4;
usesTabs = 1;
};
AD95AEBC0664BC7B00FCB211 = {
fileRef = AD95AEBB0664BC7B00FCB211;
isa = PBXBuildFile;
settings = {
};
};
AD95C1870664C1E400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = COPYING;
refType = 4;
sourceTree = "<group>";
};
AD95C1880664C1E400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = COPYRIGHT;
refType = 4;
sourceTree = "<group>";
};
AD95C1890664C1E400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = NOTES;
refType = 4;
sourceTree = "<group>";
};
AD95C18A0664C1E400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = PROJECTLEAD;
refType = 4;
sourceTree = "<group>";
};
AD95C18B0664C1E400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = TODO;
refType = 4;
sourceTree = "<group>";
};
AD95C2640664CE7400FCB211 = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = common.h;
refType = 4;
sourceTree = "<group>";
};
AD95C2660664CE7400FCB211 = {
fileRef = AD95C2640664CE7400FCB211;
isa = PBXBuildFile;
settings = {
};
};
ADA38B8105DD238A00C820AA = {
isa = PBXFileReference;
lastKnownFileType = image.icns;
path = Lori.icns;
refType = 4;
sourceTree = "<group>";
};
ADA38B8205DD238A00C820AA = {
fileRef = ADA38B8105DD238A00C820AA;
isa = PBXBuildFile;
settings = {
};
};
ADA38BE605DD23C400C820AA = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = README;
refType = 4;
sourceTree = "<group>";
};
ADC15A300664CF290063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = text;
path = "wox-cheat-sheet.txt";
refType = 4;
sourceTree = "<group>";
};
ADC15A400664D0F50063754B = {
children = (
AD1967610665FE4800E19038,
ADC15A530664E3280063754B,
);
isa = PBXGroup;
path = NGExtensions;
refType = 4;
sourceTree = "<group>";
};
ADC15A410664D1D90063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = "NSObject+ExtendedLogging.h";
refType = 4;
sourceTree = "<group>";
};
ADC15A420664D1D90063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = "NSObject+ExtendedLogging.m";
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
ADC15A470664DA320063754B = {
fileRef = ADC15A450664DA320063754B;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Public,
);
};
};
ADC15A490664DA980063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = NGLogger.h;
refType = 4;
sourceTree = "<group>";
};
ADC15A4A0664DA980063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = NGLogger.m;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
ADC15A4E0664E25B0063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = NGLogAppender.m;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
ADC15A540664E33A0063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
path = NGLogEvent.h;
refType = 4;
sourceTree = "<group>";
};
ADC15A550664E33A0063754B = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = NGLogEvent.m;
refType = 4;
sourceTree = "<group>";
};
ADC15A560664E33A0063754B = {
fileRef = ADC15A540664E33A0063754B;
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
Public,
);
};
};
ADC15A570664E33A0063754B = {
fileRef = ADC15A550664E33A0063754B;
isa = PBXBuildFile;
settings = {
};
};
ADEE3DCE05DD11C900F523DB = {
isa = PBXFileReference;
lastKnownFileType = folder;
path = WebServerResources;
refType = 4;
sourceTree = "<group>";
};
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 = "<group>";
};
ADEE3DD605DD126900F523DB = {
fileEncoding = 4;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
path = DirectAction.m;
refType = 4;
sourceTree = "<group>";
};
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 = "<absolute>";
};
ADEE3DDC05DD131F00F523DB = {
fileRef = ADEE3DDB05DD131E00F523DB;
isa = PBXBuildFile;
settings = {
};
};
ADEE3DEB05DD135A00F523DB = {
isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = Cocoa.framework;
path = /System/Library/Frameworks/Cocoa.framework;
refType = 0;
sourceTree = "<absolute>";
};
ADEE3DEC05DD135A00F523DB = {
fileRef = ADEE3DEB05DD135A00F523DB;
isa = PBXBuildFile;
settings = {
};
};
ADF026F205D903AE00D2292D = {
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 1;
files = (
ADEE3DD405DD123C00F523DB,
);
isa = PBXCopyFilesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
};
rootObject = 29B97313FDCFA39411CA2CEA;
}

View File

@@ -0,0 +1,9 @@
//
// Prefix header for all source files of the 'WebUI' target in the 'WebUI' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGExtensions/NGExtensions.h>
#endif

35
Misc/WebUI/WebUI_main.m Normal file
View File

@@ -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 <NGObjWeb/NGObjWeb.h>
#define SOPEXMain WOApplicationMain
#else
#import <SOPEX/SOPEX.h>
#endif /* WITHOUT_SOPEX */
int main(int argc, const char *argv[])
{
return SOPEXMain(@"Application", argc, argv);
}

33
Misc/WebUI/common.h Normal file
View File

@@ -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 <Foundation/Foundation.h>
#include "NGLogging.h"
#endif /* __common_H_ */

16
Misc/WebUI/version.plist Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>ProjectName</key>
<string>NibPBTemplates</string>
<key>SourceVersion</key>
<string>1160200</string>
</dict>
</plist>

View File

@@ -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

View File

@@ -0,0 +1,208 @@
2004-06-30 Marcus Müller <znek@mulle-kybernetik.com>
* 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 <helge.hess@opengroupware.org>
* Scheduler/UIxAppointmentEditor.m: made the hack more hackish to work
on MacOSX
2004-06-28 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* Scheduler/GNUmakefile.preamble: links against libSOGoLogic now.
* Scheduler/UIxAppointmentView.m, Scheduler/UIxAppointmentView.wox:
test of iCal object.
2004-06-23 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* 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 <helge.hess@skyrix.com>
* Common/GNUmakefile.preamble: fixed linking for OGo gstep-make
2004-06-21 Helge Hess <helge.hess@opengroupware.org>
* Scheduler/OGoCalWeekOverview.m: fixed syntax errors
2004-06-18 Marcus Mueller <znek@mulle-kybernetik.com>
* Implemented proper calendar in week overview. Highlighting isn't
enabled, yet.
2004-06-18 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* Common/UIxTabView.m: removed class from <a> 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 <helge.hess@opengroupware.org>
* Scheduler/OGoCalMonthOverview.wox: added missing rsrc namespace
2004-06-14 Helge Hess <helge.hess@skyrix.com>
* Common/common.h: fixed a gcc 3.4 warning
2004-06-14 Helge Hess <helge.hess@opengroupware.org>
* added aggregate project for UI-X
2004-06-14 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* 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 <helge.hess@opengroupware.org>
* Scheduler/NOTES: added class hierarchy
* */common.h, GNUmakefile.preamble.: fixed for OSX compile
2004-06-08 Marcus Mueller <znek@mulle-kybernetik.com>
* Common/images: added a bunch of images from OGo
2004-06-07 Marcus Mueller <znek@mulle-kybernetik.com>
* 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 <znek@mulle-kybernetik.com>
* 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 <helge.hess@opengroupware.org>
* 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 <znek@mulle-kybernetik.com>
* 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

View File

@@ -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 <Foundation/NSObject.h>
@interface CommonUIProduct : NSObject
{
}
@end
#include "common.h"
@implementation CommonUIProduct
@end /* CommonUIProduct */

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,11 @@
// $Id: UIxAppFrame.m 59 2004-06-22 13:40:19Z znek $
#include <NGObjWeb/SoComponent.h>
@interface UIxAppFrame : SoComponent
@end
#include "common.h"
@implementation UIxAppFrame
@end /* UIxAppFrame */

View File

@@ -0,0 +1,44 @@
<?xml version='1.0' standalone='yes'?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
>
<head>
<title><var:string value="title"/></title>
<meta name="description" content="ZideStore Web Interface" />
<meta name="author" content="SKYRIX Software AG" />
<meta name="robots" content="stop" />
<link href="mailto:hh@skyrix.com" rev="made" />
</head>
<frameset rows="48,*" frameborder="0" framespacing="0" border="0">
<frame src="appheader"
name="head"
leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"
scrolling="no" noresize="yes" />
<frameset cols="150,*">
<frame src="appnavigation"
name="navi"
leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"
scrolling="yes" />
<frame src="view"
name="content"
leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"
scrolling="yes" />
</frameset>
</frameset>
<noframes>
This pages requires frame tags, which your browser does not support,
sorry ;->
</noframes>
</html>

View File

@@ -0,0 +1,11 @@
// $Id: UIxAppHeader.m 59 2004-06-22 13:40:19Z znek $
#include <NGObjWeb/SoComponent.h>
@interface UIxAppHeader : SoComponent
@end
#include "common.h"
@implementation UIxAppHeader
@end /* UIxAppHeader */

View File

@@ -0,0 +1,32 @@
<?xml version='1.0' standalone='yes'?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
>
<head>
<link type="text/css" rel="stylesheet" rsrc:href="zidestoreui.css" />
<script language="javascript">
function viewInNavi(url) {
parent.navi.location=url;
return true
}
</script>
</head>
<body>
<div id="header">
<img filename="OGoLogo.gif" class="headerlogo" alt="Logo" />
<div id="headerhistory">
<span id="navtitle">ZideStore UI - Experimental</span>
</div>
</div>
<div style="text-align: right; font-size: 8pt;">
<a href="#" onClick="viewInNavi('appnavigation')">reload</a> -
resistance is obsolete <entity name="trade"/> ;-)
</div>
</body>
</html>

View File

@@ -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 <NGObjWeb/NGObjWeb.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <Foundation/Foundation.h>
@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

View File

@@ -0,0 +1,10 @@
<?xml version='1.0' standalone='yes'?>
<font xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
class="defaultfont"
>
<b>You are here:</b><var:entity const:name="nbsp" /><var:foreach list="navPathElements" item="element"><var:if condition="element" value="lastElement" const:negate="YES"><a var:href="element.url"><var:string value="element.name" /></a><var:entity const:name="nbsp" />/<var:entity const:name="nbsp" /></var:if><var:if condition="element" value="lastElement"><var:string value="element.name" /></var:if></var:foreach>
</font>

View File

@@ -0,0 +1,11 @@
// $Id: UIxAppNavigation.m 59 2004-06-22 13:40:19Z znek $
#include <NGObjWeb/SoComponent.h>
@interface UIxAppNavigation : SoComponent
@end
#include "common.h"
@implementation UIxAppNavigation
@end /* UIxAppNavigation */

View File

@@ -0,0 +1,85 @@
<?xml version='1.0' standalone='yes'?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
>
<head>
<link type="text/css" rel="stylesheet" rsrc:href="zidestoreui.css" />
<style>
a:link, a:visited, a:active, a:hover {
text-decoration: none;
font-family: Arial, Helvetica, Helv, Sans-Serif;
font-size: 9pt;
color: #0000FF;
}
a.reloadlink {
color: black;
}
ul {
margin: 0; /*removes indent IE and Opera*/
padding: 0; /*removes indent Mozilla and NN7*/
/* list-style-type: none; */ /*turns off display of bullet*/
font-family: Arial, Helvetica, sans-serif;
font-size: 14pt;
}
ul li {
/* padding-left: 4px; */
/* list-style: url(http://vesper.in.skyrix.com/SKYRiXgreen/WebServerResources/EN.lproj/nav_folder_open.gif); */
list-style: url(http://move:9000/OpenGroupware.woa/WebServerResources/English.lproj/icon_folder.gif);
}
ul li a {
display: block;
border: 1px solid #FFFFFF;
padding: 2px 2px 2px 24px;
width: 80%;
background-color: #EEEEEE;
}
ul li a:link, ul li a:visited {
text-decoration: none;
}
ul li a:hover {
border: 1px solid #333333;
background-color: #CCCCCC;
}
</style>
<script language="javascript"><![CDATA[
function viewInContent(url) {
parent.content.location=url;
return true;
}
]]></script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br />
<ul>
<li><a href="#">OGo</a></li>
<li><a href="#" onclick="viewInContent('view')" >View</a></li>
<li><a href="#" onclick="viewInContent('weekoverview')" >Week</a></li>
<li><a href="#" onclick="viewInContent('monthoverview')">Month</a></li>
<li><a href="#">OGo</a></li>
</ul>
<br />
<div style="border-top: 1px solid #000000;">
<a href="appnavigation" class="reloadlink"
var:_o="context.contextID"><i>(reload)</i></a>
</div>
<br />
<div style="border-top: 1px solid #000000; font-size: 8pt">
<var:string value="context.contextID" />
</div>
<a href="http://www.projectseven.com/tutorials/css_menus/list_01/"
target="extlink">CSS Menues</a>
</body>
</html>

View File

@@ -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 <NGObjWeb/SoComponent.h>
@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_ */

View File

@@ -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 <Foundation/Foundation.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGExtensions/NGExtensions.h>
@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

View File

@@ -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 <NGObjWeb/WOxElemBuilder.h>
/*
This builder builds various elements from the UI-X product.
All tags are mapped into the <uix:> namespace (XMLNS_OD_BIND).
<var:tabview .../> maps to UIxTabView
<var:tab .../> maps to UIxTabItem
*/
@interface UIxElemBuilder : WOxTagClassElemBuilder
{
}
@end
#include <SaxObjC/XMLNamespaces.h>
#include "common.h"
#define XMLNS_UIX @"OGo:uix"
@implementation UIxElemBuilder
- (Class)classForElement:(id<DOMElement>)_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 */

View File

@@ -0,0 +1,44 @@
// $Id: UIxPageFrame.m 59 2004-06-22 13:40:19Z znek $
#include <NGObjWeb/SoComponent.h>
#include <NGObjWeb/SoHTTPAuthenticator.h>
#include <NGObjWeb/SoUser.h>
@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 */

View File

@@ -0,0 +1,308 @@
<?xml version="1.0" standalone="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url">
<head>
<title>
<var:string value="title"/>
</title>
<meta name="description" content="ZideStore Web Interface"/>
<meta name="author" content="SKYRIX Software AG"/>
<meta name="robots" content="stop"/>
<link type="text/css" rel="stylesheet" rsrc:href="zidestoreui.css"/>
<link type="text/css" rel="stylesheet" rsrc:href="calendar.css"/>
<link href="mailto:hh@skyrix.com" rev="made"/>
</head>
<body>
<!--
<div id="header">
<img filename="OGoLogo.gif" class="headerlogo" alt="Logo" />
<div id="headerhistory">
<span id="navtitle">ZideStore UI - Experimental</span>
</div>
</div>
<br />
-->
<table cellpadding="5" cellspacing="0" border="0" width="100%">
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign="bottom">
<var:component className="UIxAppNavView" />
</td>
<td align="right">
<a href="http://www.opengroupware.org:80/" target="OGo">
<img rsrc:src="menu_logo_top.gif" align="center" border="0" ALT="" Valign="middle"/>
</a>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="linecolor">
<img rsrc:src="line_left.gif"/>
</td>
<td class="linecolor" width="100%">
<img rsrc:src="line_stretch.gif"/>
</td>
<td class="linecolor">
<img rsrc:src="line_right.gif"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<!-- $Id: SkyDock.html,v 1.13 2004/02/13 14:08:27 helge Exp $ -->
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" class="leftmenu">
<tr>
<td>
<img rsrc:src="box_topleft.gif"/>
</td>
<td valign="top" rsrc:background="box_top.gif">
<img rsrc:src="box_top.gif"/>
</td>
<td>
<img rsrc:src="box_topright.gif"/>
</td>
</tr>
<tr valign="top">
<td rsrc:background="box_left.gif">
<img rsrc:src="box_left.gif"/>
</td>
<td width="100%">
<table width="100%" border="0" cellspacing="2" cellpadding="" class="leftmenu">
<tr>
<td>
<font class="skydockfont">
<a href="/ZideStore/" class="skydockfont">SOGo (<var:string value="login" />)</a>
</font>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="linecolor">
<img rsrc:src="line_left.gif"/>
</td>
<td class="linecolor" width="100%">
<img rsrc:src="line_stretch.gif"/>
</td>
<td class="linecolor">
<img rsrc:src="line_right.gif"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="3"/>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skydockfont">News</a>
</font>
</td>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skydockfont">Projects</a>
</font>
</td>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skydockfont">Contacts</a>
</font>
</td>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skydockfont">Companies</a>
</font>
</td>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skyDockFont">Calendar</a>
</font>
</td>
</tr>
<tr>
<td valign="middle">
<font class="skydockfont">
<a href="/OpenGroupware/x/dock" class="skydockfont">Tasks</a>
</font>
</td>
</tr>
</table>
</td>
<td rsrc:background="box_right.gif">
<img rsrc:src="box_right.gif"/>
</td>
</tr>
<tr>
<td>
<img rsrc:src="box_botleft.gif"/>
</td>
<td rsrc:background="box_bottom.gif">
<img rsrc:src="box_bottom.gif"/>
</td>
<td>
<img rsrc:src="box_botright.gif"/>
</td>
</tr>
</table>
<!-- $Id: SkyDockedProjects.html,v 1.10 2004/05/07 16:05:03 helge Exp $ -->
</td>
</tr>
</table>
<br/>
<!-- $Id: SkyFavorites.html,v 1.5 2003/10/29 18:06:00 helge Exp $ -->
<!-- the misc box -->
<span>
<table cellspacing="0" class="leftmenu" border="0" cellpadding="0">
<tr>
<td>
<img rsrc:src="box_topleft.gif"/>
</td>
<td rsrc:background="box_top.gif">
<img rsrc:src="box_top.gif"/>
</td>
<td>
<img rsrc:src="box_topright.gif"/>
</td>
</tr>
<tr valign="top">
<td rsrc:background="box_left.gif">
<img rsrc:src="box_left.gif"/>
</td>
<td width="100%">
<table width="100%" cellspacing="2" class="leftmenu" border="0" cellpadding="">
<tr>
<td>
<font class="skydockfont">Misc</font>
</td>
</tr>
<tr>
<td colspan="2">
<table width="100%" cellspacing="0" border="0" cellpadding="0">
<tr>
<td class="linecolor">
<img rsrc:src="line_left.gif"/>
</td>
<td width="100%" class="linecolor">
<img rsrc:src="line_stretch.gif"/>
</td>
<td class="linecolor">
<img rsrc:src="line_right.gif"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="3"/>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/mail" class="skydockfont">New Email</a>
</td>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/mail" class="skydockfont">Inbox</a>
</td>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/dock" class="skydockfont">Preferences</a>
</td>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/downloadBookmark" target="private_desktop" class="skydockfont">Home</a>
</td>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/downloadBookmark" target="public_desktop" class="skydockfont">Desktop</a>
</td>
</tr>
<tr>
<td valign="middle">
<a href="/OpenGroupware/x/dock" class="skydockfont">Logout</a>
</td>
</tr>
</table>
</td>
<td rsrc:background="box_right.gif">
<img rsrc:src="box_right.gif"/>
</td>
</tr>
<tr>
<td>
<img rsrc:src="box_botleft.gif"/>
</td>
<td rsrc:background="box_bottom.gif">
<img rsrc:src="box_bottom.gif"/>
</td>
<td>
<img rsrc:src="box_botright.gif"/>
</td>
</tr>
</table>
</span>
</td>
<td valign="top" width="100%">
<var:component-content/>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="linecolor">
<img rsrc:src="line_left.gif"/>
</td>
<td class="linecolor" width="100%">
<img rsrc:src="line_stretch.gif"/>
</td>
<td class="linecolor">
<img rsrc:src="line_right.gif"/>
</td>
</tr>
<tr>
<td colspan="3"/>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top" align="left">
<font class="defaultfont"><var:entity const:name="copy"/>
2000-2004 <a href="http://www.skyrix.com:80/knoppix/skyrix/" target="SKYRIX">SKYRIX Software AG</a>.
We welcome your
<a href="http://www.opengroupware.org/en/feedback.html" target="feedback">feedback</a>.
</font>
</td>
<td valign="top" align="right">
<font class="defaultfont">
No sessions required! ;-)
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -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:@"<div id=\""];
[_response appendContentString:k];
[_response appendContentString:@"TabLayer\" style=\"display: none;\">\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:@"</div>"];
jsout = [NSString alloc];
jsout = [jsout initWithFormat:
@"<script language=\"JavaScript\">\n<!--\n"
@"%@Tab[\"Div\"] = %@TabLayer;\n",
k, k];
[_response appendContentString:jsout];
[jsout release];
#if DEBUG_JS
jsout = [NSString alloc];
jsout = [jsout initWithFormat:
@"if (%@Tab[\"Div\"].style==null) {"
@"alert('missing style in div for tab %@');}",
k, k];
[_response appendContentString:jsout];
[jsout release];
#endif
if (isActive) {
[_response appendContentString:@"showTab("];
[_response appendContentString:k];
[_response appendContentString:@"Tab);\n"];
}
[_response appendContentString:@"//-->\n</script>"];
}
}
/* 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 */

View File

@@ -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 <NGObjWeb/WODynamicElement.h>
/*
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__ */

View File

@@ -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 <NGObjWeb/NGObjWeb.h>
#import <NGExtensions/NGExtensions.h>
#import <EOControl/EOControl.h>
#include <WEExtensions/WEClientCapabilities.h>
#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:@"<td align='center' valign='middle'"];
if (styleName) {
[_response appendContentString:@" class='"];
[_response appendContentHTMLAttributeValue:styleName];
[_response appendContentCharacter:'\''];
}
// click on td background
if ([ccaps isInternetExplorer] && [ccaps isJavaScriptBrowser]) {
[_response appendContentString:@" onclick=\"window.location.href='"];
[_response appendContentHTMLAttributeValue:headUri];
[_response appendContentString:@"'\""];
}
[_response appendContentCharacter:'>'];
[_response appendContentString:@"<a href=\""];
if (_doScript && (_info->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:@"<nobr>"];
[_response appendContentHTMLString:label];
[_response appendContentString:@"</nobr>"];
[_response appendContentString:@"</a>"];
[_response appendContentString:@"</td>"];
#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:
@"<script language=\"JavaScript\">\n"
@"<!--\n"
@"var %@Tab = new Array();\n"
@"%@Tab[\"link\"] = %@TabLink;\n"
@"%@Tab[\"href1\"] = \"%@\";\n"
@"%@Tab[\"href2\"] = \"%@\";\n"
@"%@Tab[\"Img\"] = window.document.%@TabImg;\n"
@"%@Tab[\"Ar\"] = new Array();\n"
@"%@Tab[\"Ar\"][0] = new Image();\n"
@"%@Tab[\"Ar\"][0].src = \"%@\";\n"
@"%@Tab[\"Ar\"][1] = new Image();\n"
@"%@Tab[\"Ar\"][1].src = \"%@\";\n"
@"//-->\n</script>",
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_(@"<script language=\"JavaScript\">\n<!--\nvar ");
_appendStr_(k); _appendStr_(@"Tab = new Array();\n");
_appendStr_(k); _appendStr_(@"Tab[\"link\"] = ");
_appendStr_(k); _appendStr_(@"TabLink;\n"); // linkName
_appendStr_(k); _appendStr_(@"Tab[\"href1\"] = \"");
_appendStr_(scriptHref); _appendStr_(@"\";\n"); // scriptHref
_appendStr_(k); _appendStr_(@"Tab[\"href2\"] = \"");
_appendStr_(_info->uri); _appendStr_(@"\";\n"); // actionHref
_appendStr_(k); _appendStr_(@"Tab[\"Img\"] = window.document.");
_appendStr_(k); _appendStr_(@"TabImg;\n");
_appendStr_(k); _appendStr_(@"Tab[\"Ar\"] = new Array();\n");
_appendStr_(k); _appendStr_(@"Tab[\"Ar\"][0] = new Image();\n");
_appendStr_(k); _appendStr_(@"Tab[\"Ar\"][0].src = \"");
_appendStr_(u); _appendStr_(@"\";\n"); // unselected img
_appendStr_(k); _appendStr_(@"Tab[\"Ar\"][1] = new Image();\n");
_appendStr_(k); _appendStr_(@"Tab[\"Ar\"][1].src = \"");
_appendStr_(s); _appendStr_(@"\";\n"); // selected img
_appendStr_(@"//-->\n</script>");
#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:
@"<script language=\"JavaScript\">\n<!--\n\n"
@"function showTab(obj) {\n"
#if DEBUG_JS
@" if (obj==null) { alert('missing tab obj ..'); return; }\n"
@" if (obj['Div']==null) {"
@" alert('missing div key in ' + obj); return; }\n"
@" if (obj['Div'].style==null) {"
@" alert('missing style key in div ' + obj['Div']);return; }\n"
#endif
@" obj['Div'].style.display = \"\";\n"
@" obj['Img'].src = obj[\"Ar\"][1].src;\n"
@" obj['link'].href = obj[\"href2\"];\n"
@"}\n"
@"function hideTab(obj) {\n"
#if DEBUG_JS
@" if (obj==null) { alert('missing tab obj ..'); return; }\n"
@" if (obj['Div']==null) {"
@" alert('missing div key in ' + obj); return; }\n"
@" if (obj['Div'].style==null) {"
@" alert('missing style key in div ' + obj['Div']);return; }\n"
#endif
@" obj['Div'].style.display = \"none\";\n"
@" obj['Img'].src = obj[\"Ar\"][0].src;\n"
@" obj['link'].href = obj[\"href1\"];\n"
@"}\n"
@"function swapCorners(obj1,obj2) {\n"
@" if (obj1==null) { alert('missing corner 1'); return; }\n"
@" if (obj2==null) { alert('missing corner 2'); return; }\n"
@" obj1.style.display = \"none\";\n"
@" obj2.style.display = \"\";\n"
@"}\n"
@"//-->\n</script>"];
}
- (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:@"<tr><td colspan='2'>"];
styleName = [self->headerStyle stringValueInComponent:[_ctx component]];
if(styleName) {
[_response appendContentString:
@"<table border='0' cellpadding='0' cellspacing='0' class='"];
[_response appendContentHTMLAttributeValue:styleName];
[_response appendContentString:@"'><tr>"];
}
else {
[_response appendContentString:
@"<table border='0' cellpadding='0' cellspacing='0'><tr>"];
}
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:@"<td></td>"];
[_response appendContentString:@"</tr></table>"];
[_response appendContentString:@"</td></tr>"];
}
- (void)_appendHeaderFootRowToResponse:(WOResponse *)_response
inContext:(WOContext *)_ctx
bgcolor:(NSString *)bgcolor
doScript:(BOOL)doScript
isLeftActive:(BOOL)isLeftActive
{
NSString *styleName;
[_response appendContentString:@" <tr"];
styleName = [self->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:@" <td align=\"left\" width=\"10\">"];
if (doScript) {
[_response appendContentString:@"<div id=\"tabCorner"];
[_response appendContentString:[self _tabViewCountInContext:_ctx]];
[_response appendContentString:@"\" "];
[_response appendContentString:@"style=\"display: "];
[_response appendContentString:(isLeftActive) ? @"" : @"none"];
[_response appendContentString:@";\">"];
[_response appendContentString:@"&nbsp;"];
[_response appendContentString:@"</div>"];
}
else if (isLeftActive)
[_response appendContentString:@"&nbsp;"];
if (doScript) {
[_response appendContentString:@"<div id=\"tabCornerLeft"];
[_response appendContentString:[self _tabViewCountInContext:_ctx]];
[_response appendContentString:@"\" "];
[_response appendContentString:@"style=\"display: "];
[_response appendContentString:(!isLeftActive) ? @"visible" : @"none"];
[_response appendContentString:@";\">"];
}
if (!isLeftActive || doScript) {
NSString *uri;
uri = [self->leftCornerIcon stringValueInComponent:[_ctx component]];
if ((uri = WEUriOfResource(uri, _ctx))) {
[_response appendContentString:@"<img border=\"0\" alt=\"\" src=\""];
[_response appendContentString:uri];
[_response appendContentString:@"\">"];
}
else
[_response appendContentString:@"&nbsp;"];
}
if (doScript)
[_response appendContentString:@"</div>"];
[_response appendContentString:@"</td>\n"];
/* right corner */
[_response appendContentString:@" <td align=\"right\">"];
{
NSString *uri;
uri = [self->rightCornerIcon stringValueInComponent:[_ctx component]];
if ((uri = WEUriOfResource(uri, _ctx))) {
[_response appendContentString:@"<img border=\"0\" alt=\"\" src=\""];
[_response appendContentString:uri];
[_response appendContentString:@"\" />"];
}
else
[_response appendContentString:@"&nbsp;"];
}
[_response appendContentString:@"</td>\n"];
[_response appendContentString:@" </tr>\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:@"<tr"];
if(styleName) {
[_response appendContentString:@" class='"];
[_response appendContentHTMLAttributeValue:styleName];
[_response appendContentCharacter:'\''];
}
[_response appendContentString:@"><td colspan='2'"];
if (bgcolor) {
[_response appendContentString:@" bgcolor=\""];
[_response appendContentHTMLAttributeValue:bgcolor];
[_response appendContentCharacter:'\"'];
}
[_response appendContentCharacter:'>'];
if (indentContent) {
/* start padding table */
[_response appendContentString:
@"<table border='0' width='100%'"
@" cellpadding='10' cellspacing='0'>"];
[_response appendContentString:@"<tr><td>"];
}
[_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:@"</td></tr></table>"];
[_response appendContentString:@"</td></tr>"];
}
- (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:
@"<table border='0' width='100%'"
@" cellpadding='0' cellspacing='0'>"];
/* 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:@"</table>"];
[_ctx removeObjectForKey:UIxTabView_ACTIVEKEY];
[_ctx removeObjectForKey:UIxTabView_KEYS];
[self restoreNestedState:nestedState inContext:_ctx];
}
@end /* UIxTabView */

View File

@@ -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 <NGObjWeb/NGObjWeb.h>
@interface UIxWinClose : WOComponent
{
}
@end
@implementation UIxWinClose
@end

View File

@@ -0,0 +1,6 @@
<?xml version='1.0' standalone='yes'?>
<a xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url"
href="javascript:history.back()"><img border="0" alt="X" src="/ZideStore/so/ControlPanel/Products/CommonUI/Resources/closewindow.gif"/></a>

View File

@@ -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

View File

@@ -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"; },
);
};
}

View File

@@ -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;
}

View File

@@ -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 <Foundation/Foundation.h>
#if LIB_FOUNDATION_LIBRARY
# include <Foundation/exceptions/GeneralExceptions.h>
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
@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:@"<font"];
if (_color) {
[_resp appendContentString:@" color=\""];
[_resp appendContentHTMLAttributeValue:_color];
[_resp appendContentCharacter:'"'];
}
if (_face) {
[_resp appendContentString:@" face=\""];
[_resp appendContentHTMLAttributeValue:_face];
[_resp appendContentCharacter:'"'];
}
if (_size) {
[_resp appendContentString:@" size=\""];
[_resp appendContentHTMLAttributeValue:_size];
[_resp appendContentCharacter:'"'];
}
[_resp appendContentCharacter:'>'];
}
static inline void WEAppendTD(WOResponse *_resp,
NSString *_align,
NSString *_valign,
NSString *_bgColor)
{
[_resp appendContentString:@"<td"];
if (_bgColor) {
[_resp appendContentString:@" bgcolor=\""];
[_resp appendContentHTMLAttributeValue:_bgColor];
[_resp appendContentCharacter:'"'];
}
if (_align) {
[_resp appendContentString:@" align=\""];
[_resp appendContentHTMLAttributeValue:_align];
[_resp appendContentCharacter:'"'];
}
if (_valign) {
[_resp appendContentString:@" valign=\""];
[_resp appendContentHTMLAttributeValue:_valign];
[_resp appendContentCharacter:'"'];
}
[_resp appendContentCharacter:'>'];
}
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Some files were not shown because too many files have changed in this diff Show More