]> err.no Git - sope/commitdiff
fixed version dependend bundles
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 24 Aug 2004 14:41:09 +0000 (14:41 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 24 Aug 2004 14:41:09 +0000 (14:41 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@51 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

18 files changed:
sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/GNUmakefile
sope-appserver/NGObjWeb/SoObjects/SoProductRegistry.m
sope-appserver/NGObjWeb/Templates/GNUmakefile
sope-appserver/NGObjWeb/Templates/WOApplication+Builders.m [new file with mode: 0644]
sope-appserver/NGObjWeb/Templates/WOxTemplateBuilder.m
sope-appserver/SoOFS/ChangeLog
sope-appserver/SoOFS/GNUmakefile
sope-appserver/SoOFS/Version
sope-appserver/WEExtensions/ChangeLog
sope-appserver/WEExtensions/GNUmakefile
sope-appserver/WEExtensions/Version
sope-appserver/WOExtensions/ChangeLog
sope-appserver/WOExtensions/GNUmakefile
sope-appserver/WOExtensions/GNUmakefile.postamble [new file with mode: 0644]
sope-appserver/WOExtensions/WOExtensionsBuilderModule.m [new file with mode: 0644]
sope-appserver/WOExtensions/WOxExtElemBuilder.m
sope-appserver/WOExtensions/bundle-info.plist

index d8c860e8c7380e339cbc004dcf2ae9215ee500ab..7f800270766058d324a11be23099c7671c2bc62c 100644 (file)
@@ -1,5 +1,15 @@
 2004-08-24  Helge Hess  <helge.hess@opengroupware.org>
 
+       * 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
index af6bcb69efc79f6bdfee38b6a0f326930dfb8073..604f393a33f822ead5f14225d72f79824e39e9d8 100644 (file)
@@ -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
index a6632b4f372c1e990dc0a77573fc080f5bbecc18..e642b0f23aa699cdb4874d8a9c699aed31a90536 100644 (file)
@@ -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;
index ba56059de4f8abbbd47b571e41993f14a127f791..f0bedf1afa6b9e2e6f41ea4c90c0af33aee6d798 100644 (file)
@@ -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 (file)
index 0000000..8eb9d6e
--- /dev/null
@@ -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 <NGObjWeb/WOApplication.h>
+#include "WOxTemplateBuilder.h"
+#include <NGObjWeb/WOxElemBuilder.h>
+#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<DOMDocument>)_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) */
index b86d0d0a71d6f839ce699c9a8725b907ce37fcf7..eede0d9aa2fe2901d34f9ad37bf7cc866324858c 100644 (file)
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #include "WOxTemplateBuilder.h"
 #include <NGObjWeb/WOxElemBuilder.h>
@@ -145,51 +144,3 @@ static Class DateClass = Nil;
 }
 
 @end /* WOxTemplateBuilder */
-
-@implementation WOApplication(BuilderStack)
-
-- (WOxElemBuilder *)builderForDocument:(id<DOMDocument>)_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) */
index 0315ddf7a5c563f44cdfb7e3b1b3908b608d7091..1b981bb6f8fdf02e822117dd33210e8891e69c32 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-24  Helge Hess  <helge.hess@skyrix.com>
+
+       * install product in Library/SoProducts/4.3/ (v4.3.4)
+
 2004-08-23  Helge Hess  <helge.hess@opengroupware.org>
 
        * GNUmakefile.preamble: removed libjs linking path (v4.3.3)
index f8268f29365f56bede20b3ce915fb59830d6b5c5..79c4d220852488fd4798cf38fb5bbfeff3211fa3 100644 (file)
@@ -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
index 81d0f5a4cff3edc3be75e404954d4eed90c1bd38..9d93031b2c14602d3af70ada8fe43b6eda356ce9 100644 (file)
@@ -1,3 +1,3 @@
 # version file
 
-SUBMINOR_VERSION:=3
+SUBMINOR_VERSION:=4
index dacaa0e95b9bf1b893d5f6b28912980b27f9c9f6..d2b8cdaa8486305445bc08f7f3e766dee26fd18f 100644 (file)
@@ -1,6 +1,11 @@
+2004-08-24  Helge Hess  <helge.hess@skyrix.com>
+
+       * install (elem builder) bundle in Library/WOxElemBuilders/4.3/
+         (v4.3.56)
+
 2004-08-20  Helge Hess  <helge.hess@opengroupware.org>
 
-       * 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)
 
index 4f8e1778acee66f631b14bd17d71911e202c73e8..9157fddf0b0a1cbb2577b5cfed5022bec61644f1 100644 (file)
@@ -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
index 0f46daa27a5d7776702a7929c8c017151179dfcc..bc613e3d15a1b083d6abc45707dffd212d43d641 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=55
+SUBMINOR_VERSION:=56
index 8a73cc2c2724508f1d48d16ba2221c319f5debb8..302687d85817eb1ef599f1909ebe881dea1bfe05 100644 (file)
@@ -1,6 +1,16 @@
+2004-08-24  Helge Hess  <helge.hess@skyrix.com>
+
+       * 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  <helge.hess@opengroupware.org>
 
-       * 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)
 
index 51fa16d5cb6f1e74061ff259040a1860d9ee2cbe..578ffe3f45e987ffcb8bbb449f735315c8c28d0c 100644 (file)
@@ -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 (file)
index 0000000..548ac9a
--- /dev/null
@@ -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 (file)
index 0000000..466a672
--- /dev/null
@@ -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 <Foundation/NSObject.h>
+
+@interface WOExtensionsBuilderModule : NSObject
+@end
+
+@implementation WOExtensionsBuilderModule
+@end /* WOExtensionsBuilderModule */
index f424d251c8f0ee2968cf838a070aeb3cb5bcecaf..9601d960bbdf3fa6b0a70246777c9dd2c09ce8ee 100644 (file)
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #include <NGObjWeb/WOxElemBuilder.h>
 
index ac4445829025b1d5eca9ccb0bcf7a029df17456e..52215bbed05d806c37ea1e9c8d263a250d8ebef1 100644 (file)
@@ -1,6 +1,4 @@
 {
-  CVSID = "$Id$";
-
   requires = {
     bundleManagerVersion = 1;
     
@@ -36,6 +34,7 @@
     );
     
     classes = (
+      { name = "WOExtensionsBuilderModule"; },
       { name = "WOxExtElemBuilder";     },
 
       { name = "JSAlertPanel";          },