From: helge Date: Tue, 24 Aug 2004 14:41:09 +0000 (+0000) Subject: fixed version dependend bundles X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1da4d61e1058fa4263b53f3e17a99ba0439debc;p=sope fixed version dependend bundles git-svn-id: http://svn.opengroupware.org/SOPE/trunk@51 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index d8c860e8..7f800270 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,5 +1,15 @@ 2004-08-24 Helge Hess + * v4.3.10 + + * GNUmakefile: install SoCore.sxp in Library/SoProducts/4.3/ + + * Templates/WOxTemplateBuilder.m: moved WOApplication category to an + own file, preload builder bundles in Library/WOxElemBuilders/4.3 + + * SoObjects/SoProductRegistry.m: look for products in + Library/SoProducts/4.3 + * v4.3.9 * DynamicElements/WOConditional.m: added specific WOx initializer to diff --git a/sope-appserver/NGObjWeb/GNUmakefile b/sope-appserver/NGObjWeb/GNUmakefile index af6bcb69..604f393a 100644 --- a/sope-appserver/NGObjWeb/GNUmakefile +++ b/sope-appserver/NGObjWeb/GNUmakefile @@ -129,7 +129,7 @@ libNGObjWeb_OBJC_FILES = \ BUNDLE_NAME = SoCore BUNDLE_EXTENSION = .sxp -BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SoProducts +BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SoProducts/4.3/ SoCore_OBJC_FILES = SoCoreProduct.m SoCore_RESOURCE_FILES = SoObjects/product.plist Version diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m b/sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m index a6632b4f..e642b0f2 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "SoProductRegistry.h" #include "SoProduct.h" @@ -258,6 +257,7 @@ static int debugOn = 0; lPath = [lPath stringByAppendingPathComponent:@"Library"]; #endif lPath = [lPath stringByAppendingPathComponent:@"SoProducts"]; + lPath = [lPath stringByAppendingPathComponent:@"4.3"]; if (![fm fileExistsAtPath:lPath isDirectory:&isDir]) continue; diff --git a/sope-appserver/NGObjWeb/Templates/GNUmakefile b/sope-appserver/NGObjWeb/Templates/GNUmakefile index ba56059d..f0bedf1a 100644 --- a/sope-appserver/NGObjWeb/Templates/GNUmakefile +++ b/sope-appserver/NGObjWeb/Templates/GNUmakefile @@ -19,6 +19,7 @@ Templates_OBJC_FILES = \ WOxComponentElemBuilder.m \ WOxTemplateBuilder.m \ WOxElemBuilder.m \ + WOApplication+Builders.m \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make diff --git a/sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m b/sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m new file mode 100644 index 00000000..8eb9d6ee --- /dev/null +++ b/sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m @@ -0,0 +1,170 @@ +/* + 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. +*/ + +#include +#include "WOxTemplateBuilder.h" +#include +#include "common.h" + +@implementation WOApplication(BuilderStack) + +- (void)scanForBuilderBundlesInDirectory:(NSString *)_path { + NGBundleManager *bm; + NSFileManager *fm; + NSEnumerator *pathes; + NSString *lPath; + + bm = [NGBundleManager defaultBundleManager]; + + fm = [NSFileManager defaultManager]; + pathes = [[fm directoryContentsAtPath:_path] objectEnumerator]; + while ((lPath = [pathes nextObject])) { + NSBundle *bundle; + BOOL isDir; + + lPath = [_path stringByAppendingPathComponent:lPath]; + + if (![fm fileExistsAtPath:lPath isDirectory:&isDir]) + continue; + if (!isDir) + continue; + + if ((bundle = [bm bundleWithPath:lPath]) == nil) { + [self logWithFormat:@"WARNING: could not get bundle for path: '%@'", + lPath]; + continue; + } + + if (![bundle load]) { + [self logWithFormat:@"WARNING: could not load bundle: '%@'", lPath]; + continue; + } + + [self debugWithFormat:@"loaded elem builder bundle: %@", + [lPath lastPathComponent]]; + } +} + +- (void)loadBuilderBundles { + NSFileManager *fm; + NSProcessInfo *pi; + NSArray *pathes; + unsigned i; + + /* scan library pathes */ + + fm = [NSFileManager defaultManager]; + pi = [NSProcessInfo processInfo]; + +#if COCOA_Foundation_LIBRARY + /* + TODO: (like COMPILE_FOR_GNUSTEP) + This should actually check whether we are compiling in the + GNUstep environment since this modifies the location of bundles. + */ + pathes = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, + NSAllDomainsMask, + YES); +#else + pathes = [[pi environment] objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]; + if (pathes == nil) + pathes = [[pi environment] objectForKey:@"GNUSTEP_PATHLIST"]; + + pathes = [[pathes stringValue] componentsSeparatedByString:@":"]; +#endif + + if ([pathes count] == 0) { + [self debugWithFormat:@"found no builder bundle pathes."]; + return; + } + + [self debugWithFormat:@"scanning for builder bundles ..."]; + + for (i = 0; i < [pathes count]; i++) { + NSString *lPath; + BOOL isDir; + + lPath = [pathes objectAtIndex:i]; +#if !COCOA_Foundation_LIBRARY + lPath = [lPath stringByAppendingPathComponent:@"Library"]; +#endif + lPath = [lPath stringByAppendingPathComponent:@"WOxElemBuilders"]; + lPath = [lPath stringByAppendingPathComponent:@"4.3"]; + + if (![fm fileExistsAtPath:lPath isDirectory:&isDir]) + continue; + if (!isDir) + continue; + + [self debugWithFormat:@" directory %@", lPath]; + [self scanForBuilderBundlesInDirectory:lPath]; + } + + [self debugWithFormat:@"finished scan for builders."]; +} + +- (WOxElemBuilder *)builderForDocument:(id)_document { + static WOxElemBuilder *builder = nil; + static NSArray *defClasses = nil; + NSUserDefaults *ud; + NSArray *classes = nil; + NSArray *infos; + + if (builder != nil) + return builder; + + ud = [NSUserDefaults standardUserDefaults]; + if (defClasses == nil) + defClasses = [[ud arrayForKey:@"WOxBuilderClasses"] copy]; + + /* ensure that bundles are loaded */ + [self loadBuilderBundles]; + + infos = [[NGBundleManager defaultBundleManager] + providedResourcesOfType:@"WOxElemBuilder"]; + if ([infos count] > 0) { + classes = [NSMutableArray arrayWithCapacity:24]; + [(id)classes addObjectsFromArray:[infos valueForKey:@"name"]]; + [(id)classes addObjectsFromArray:defClasses]; + } + else + classes = defClasses; + + if ([ud boolForKey:@"WOxLogBuilderQueue"]) { + NSEnumerator *e; + NSString *b; + + if ([classes count] > 0) { + [self debugWithFormat:@"builder stack:"]; + e = [classes objectEnumerator]; + while ((b = [e nextObject])) + [self logWithFormat:@" %@", b]; + } + else { + [self debugWithFormat:@"empty wox-element builder stack !"]; + } + } + + builder = [[WOxElemBuilder createBuilderQueue:classes] retain]; + return builder; +} + +@end /* WOApplication(BuilderStack) */ diff --git a/sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m b/sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m index b86d0d0a..eede0d9a 100644 --- a/sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m +++ b/sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "WOxTemplateBuilder.h" #include @@ -145,51 +144,3 @@ static Class DateClass = Nil; } @end /* WOxTemplateBuilder */ - -@implementation WOApplication(BuilderStack) - -- (WOxElemBuilder *)builderForDocument:(id)_document { - static WOxElemBuilder *builder = nil; - static NSArray *defClasses = nil; - NSUserDefaults *ud; - NSArray *classes = nil; - NSArray *infos; - - if (builder != nil) - return builder; - - ud = [NSUserDefaults standardUserDefaults]; - if (defClasses == nil) - defClasses = [[ud arrayForKey:@"WOxBuilderClasses"] copy]; - -#warning TODO: remove that for SOPE 4.4! (use a fix bundle location) - infos = [[NGBundleManager defaultBundleManager] - providedResourcesOfType:@"WOxElemBuilder"]; - if ([infos count] > 0) { - classes = [NSMutableArray arrayWithCapacity:24]; - [(id)classes addObjectsFromArray:[infos valueForKey:@"name"]]; - [(id)classes addObjectsFromArray:defClasses]; - } - else - classes = defClasses; - - if ([ud boolForKey:@"WOxLogBuilderQueue"]) { - NSEnumerator *e; - NSString *b; - - if ([classes count] > 0) { - [self debugWithFormat:@"builder stack:"]; - e = [classes objectEnumerator]; - while ((b = [e nextObject])) - [self logWithFormat:@" %@", b]; - } - else { - [self debugWithFormat:@"empty wox-element builder stack !"]; - } - } - - builder = [[WOxElemBuilder createBuilderQueue:classes] retain]; - return builder; -} - -@end /* WOApplication(BuilderStack) */ diff --git a/sope-appserver/SoOFS/ChangeLog b/sope-appserver/SoOFS/ChangeLog index 0315ddf7..1b981bb6 100644 --- a/sope-appserver/SoOFS/ChangeLog +++ b/sope-appserver/SoOFS/ChangeLog @@ -1,3 +1,7 @@ +2004-08-24 Helge Hess + + * install product in Library/SoProducts/4.3/ (v4.3.4) + 2004-08-23 Helge Hess * GNUmakefile.preamble: removed libjs linking path (v4.3.3) diff --git a/sope-appserver/SoOFS/GNUmakefile b/sope-appserver/SoOFS/GNUmakefile index f8268f29..79c4d220 100644 --- a/sope-appserver/SoOFS/GNUmakefile +++ b/sope-appserver/SoOFS/GNUmakefile @@ -52,7 +52,7 @@ libSoOFS_OBJC_FILES = \ BUNDLE_NAME = SoOFS BUNDLE_EXTENSION = .sxp -BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SoProducts +BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/SoProducts/4.3/ SoOFS_OBJC_FILES = SoOFSProduct.m SoOFS_RESOURCE_FILES = product.plist Version diff --git a/sope-appserver/SoOFS/Version b/sope-appserver/SoOFS/Version index 81d0f5a4..9d93031b 100644 --- a/sope-appserver/SoOFS/Version +++ b/sope-appserver/SoOFS/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=3 +SUBMINOR_VERSION:=4 diff --git a/sope-appserver/WEExtensions/ChangeLog b/sope-appserver/WEExtensions/ChangeLog index dacaa0e9..d2b8cdaa 100644 --- a/sope-appserver/WEExtensions/ChangeLog +++ b/sope-appserver/WEExtensions/ChangeLog @@ -1,6 +1,11 @@ +2004-08-24 Helge Hess + + * install (elem builder) bundle in Library/WOxElemBuilders/4.3/ + (v4.3.56) + 2004-08-20 Helge Hess - * fixed for SOPE 3.3 directory layout (v4.3.55) + * fixed for SOPE 4.3 directory layout (v4.3.55) * moved to SOPE 4.3 (v4.3.54) diff --git a/sope-appserver/WEExtensions/GNUmakefile b/sope-appserver/WEExtensions/GNUmakefile index 4f8e1778..9157fddf 100644 --- a/sope-appserver/WEExtensions/GNUmakefile +++ b/sope-appserver/WEExtensions/GNUmakefile @@ -6,6 +6,7 @@ include ./Version LIBRARY_NAME = libWEExtensions BUNDLE_NAME = WEExtensions +BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/WOxElemBuilders/4.3/ libWEExtensions_HEADER_FILES_DIR = . libWEExtensions_HEADER_FILES_INSTALL_DIR = /WEExtensions diff --git a/sope-appserver/WEExtensions/Version b/sope-appserver/WEExtensions/Version index 0f46daa2..bc613e3d 100644 --- a/sope-appserver/WEExtensions/Version +++ b/sope-appserver/WEExtensions/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=55 +SUBMINOR_VERSION:=56 diff --git a/sope-appserver/WOExtensions/ChangeLog b/sope-appserver/WOExtensions/ChangeLog index 8a73cc2c..302687d8 100644 --- a/sope-appserver/WOExtensions/ChangeLog +++ b/sope-appserver/WOExtensions/ChangeLog @@ -1,6 +1,16 @@ +2004-08-24 Helge Hess + + * v4.3.56 + + * added a bundle manager class (WOExtensionsBuilderModule) + + * install (elem builder) bundle in Library/WOxElemBuilders/4.3/ + + * added a GNUmakefile.postamble + 2004-08-20 Helge Hess - * fixed for SOPE 3.3 directory layout (v4.3.16) + * fixed for SOPE 4.3 directory layout (v4.3.16) * moved to SOPE 4.3 (v4.3.15) diff --git a/sope-appserver/WOExtensions/GNUmakefile b/sope-appserver/WOExtensions/GNUmakefile index 51fa16d5..578ffe3f 100644 --- a/sope-appserver/WOExtensions/GNUmakefile +++ b/sope-appserver/WOExtensions/GNUmakefile @@ -6,6 +6,7 @@ include ./Version LIBRARY_NAME = libWOExtensions BUNDLE_NAME = WOExtensions +BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/WOxElemBuilders/4.3/ libWOExtensions_HEADER_FILES_DIR = . libWOExtensions_HEADER_FILES_INSTALL_DIR = /WOExtensions @@ -33,18 +34,8 @@ libWOExtensions_OBJC_FILES = \ WORadioButtonMatrix.m \ WOCheckBoxMatrix.m \ -WOExtensions_OBJC_FILES += dummy.m -WOExtensions_PRINCIPAL_CLASS = WOxExtElemBuilder - -ifneq ($(GNUSTEP_BUILD_DIR),) -after-WOExtensions-all :: - @(cp bundle-info.plist \ - $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) -else -after-WOExtensions-all :: - @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ - cp ../bundle-info.plist .) -endif +WOExtensions_OBJC_FILES += WOExtensionsBuilderModule.m +WOExtensions_PRINCIPAL_CLASS = WOExtensionsBuilderModule -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make diff --git a/sope-appserver/WOExtensions/GNUmakefile.postamble b/sope-appserver/WOExtensions/GNUmakefile.postamble new file mode 100644 index 00000000..548ac9ab --- /dev/null +++ b/sope-appserver/WOExtensions/GNUmakefile.postamble @@ -0,0 +1,11 @@ +# postprocessing + +ifneq ($(GNUSTEP_BUILD_DIR),) +after-WOExtensions-all :: + @(cp bundle-info.plist \ + $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) +else +after-WOExtensions-all :: + @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ + cp ../bundle-info.plist .) +endif diff --git a/sope-appserver/WOExtensions/WOExtensionsBuilderModule.m b/sope-appserver/WOExtensions/WOExtensionsBuilderModule.m new file mode 100644 index 00000000..466a672e --- /dev/null +++ b/sope-appserver/WOExtensions/WOExtensionsBuilderModule.m @@ -0,0 +1,28 @@ +/* + 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. +*/ + +#import + +@interface WOExtensionsBuilderModule : NSObject +@end + +@implementation WOExtensionsBuilderModule +@end /* WOExtensionsBuilderModule */ diff --git a/sope-appserver/WOExtensions/WOxExtElemBuilder.m b/sope-appserver/WOExtensions/WOxExtElemBuilder.m index f424d251..9601d960 100644 --- a/sope-appserver/WOExtensions/WOxExtElemBuilder.m +++ b/sope-appserver/WOExtensions/WOxExtElemBuilder.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include diff --git a/sope-appserver/WOExtensions/bundle-info.plist b/sope-appserver/WOExtensions/bundle-info.plist index ac444582..52215bbe 100644 --- a/sope-appserver/WOExtensions/bundle-info.plist +++ b/sope-appserver/WOExtensions/bundle-info.plist @@ -1,6 +1,4 @@ { - CVSID = "$Id$"; - requires = { bundleManagerVersion = 1; @@ -36,6 +34,7 @@ ); classes = ( + { name = "WOExtensionsBuilderModule"; }, { name = "WOxExtElemBuilder"; }, { name = "JSAlertPanel"; },