]> err.no Git - scalable-opengroupware.org/commitdiff
fixed navigation support
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 29 Sep 2004 14:49:23 +0000 (14:49 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 29 Sep 2004 14:49:23 +0000 (14:49 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@333 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoMailAccounts.m
SOGo/SoObjects/Mailer/SOGoMailBaseObject.m
SOGo/SoObjects/Mailer/Version
SOGo/SoObjects/SOGo/ChangeLog
SOGo/SoObjects/SOGo/GNUmakefile.preamble
SOGo/SoObjects/SOGo/SOGoObject.h
SOGo/SoObjects/SOGo/SOGoObject.m
SOGo/SoObjects/SOGo/Version

index 0e6b6ad21f565d1e3a2cce4b159160ad502a0a73..a09246c8c2bb2221fa78d13383abaaff68b57fb7 100644 (file)
@@ -1,5 +1,11 @@
 2004-09-29  Helge Hess  <helge.hess@opengroupware.org>
 
+       * v0.9.14
+
+       * SOGoMailAccounts.m: added tree navigation support
+
+       * SOGoMailBaseObject.m: moved fetchSubfolders method to SOGoObject
+
        * SOGoMailBaseObject.m: fixed WebDAV include (v0.9.13)
 
        * v0.9.12
index 609bec963311965d521a66550b550b156341b71c..aca3fc7fd3deaddd7b4fa7bfebb355beab438d60 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "SOGoMailAccounts.h"
 #include "common.h"
+#include <NGObjWeb/SoObject+SoDAV.h>
 
 @implementation SOGoMailAccounts
 
 
 /* tree navigation */
 
+- (NSString *)treeNavigationLinkAtDepth:(int)_depth {
+  NSString *link;
+  unsigned i;
+  
+  link = [[self nameInContainer] stringByAppendingString:@"/"];
+  for (i = 0; i < _depth; i++)
+    link = [@"../" stringByAppendingString:link];
+  return link;
+}
+
+- (id)treeNavigationBlockForLeafNodeAtDepth:(int)_depth {
+  NSMutableDictionary *md;
+  
+  md = [NSMutableDictionary dictionaryWithCapacity:4];
+  [md setObject:[self davDisplayName]                   forKey:@"title"];
+  [md setObject:[self treeNavigationLinkAtDepth:_depth] forKey:@"link"];
+  
+  if ([[self toManyRelationshipKeys] count] > 0)
+    /* trigger plus in treeview */
+    [md setObject:[NSArray arrayWithObject:@"FAKE"] forKey:@"children"];
+  return md;
+}
+
+- (id)treeNavigationBlockForActiveNode {
+  /* this generates the block for the clientObject */
+  NSMutableDictionary *md;
+  NSMutableArray *blocks;
+  NSArray  *folders;
+  unsigned i, count;
+  
+  /* process child folders */
+  
+  folders = [self fetchSubfolders];
+  count   = [folders count];
+  blocks  = [NSMutableArray arrayWithCapacity:count];
+  for (i = 0; i < count; i++) {
+    id block;
+    
+    block = [[folders objectAtIndex:i] 
+                     treeNavigationBlockForLeafNodeAtDepth:0];
+    if ([block isNotNull]) [blocks addObject:block];
+  }
+  
+  /* build block */
+  
+  md = [NSMutableDictionary dictionaryWithCapacity:4];
+  [md setObject:[NSNumber numberWithBool:YES] forKey:@"isActiveNode"];
+  [md setObject:[NSNumber numberWithBool:YES] forKey:@"isPathNode"];
+  [md setObject:[self davDisplayName]         forKey:@"title"];
+  [md setObject:[self nameInContainer]        forKey:@"name"];
+  [md setObject:@"."                          forKey:@"link"];
+  if ([blocks count] > 0)
+    [md setObject:blocks forKey:@"children"];
+  return md;
+}
+
 - (id)treeNavigationBlockWithActiveChildBlock:(id)_activeChildBlock 
   depth:(int)_depth
 {
   return _activeChildBlock;
 }
 
+- (id)treeNavigationNodes {
+  return [self treeNavigationBlockForActiveNode];
+}
+
 @end /* SOGoMailAccounts */
index 10a94f613e4a3a89d2ecd14b20aeb5124805b52c..53bffb9347a07cdd71a9039b7dfac160b69a7fb1 100644 (file)
   return [[self container] mailAccountFolder];
 }
 
-- (NSArray *)fetchSubfolders {
-  NSMutableArray *ma;
-  NSArray  *names;
-  unsigned i, count;
-  
-  if ((names = [self toManyRelationshipKeys]) == nil)
-    return nil;
-  
-  count = [names count];
-  ma    = [NSMutableArray arrayWithCapacity:count + 1];
-  for (i = 0; i < count; i++) {
-    id folder;
-    
-    folder = [self lookupName:[names objectAtIndex:i] inContext:nil 
-                  acquire:NO];
-    if (folder == nil)
-      continue;
-    if ([folder isKindOfClass:[NSException class]])
-      continue;
-    
-    [ma addObject:folder];
-  }
-  return ma;
-}
-
 /* IMAP4 */
 
 - (SOGoMailManager *)mailManager {
index 92c8fa08c38f073a34665a077f87e34ece0ab9e3..cc039aca8fe720e89b35bf8bb715cdccb043159e 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=13
+SUBMINOR_VERSION:=14
index 3d132a0d9cf63710e1c9f0f1e4831ec993f19163..b76017e8f83e3336cb027cc430b9ea8d4c60964b 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-29  Helge Hess  <helge.hess@opengroupware.org>
+       
+       * SOGoObject.m: added -fetchSubfolders method to resolve all 
+         toManyRelationshipKeys to SOPE objects (v0.9.19)
+       
 2004-09-20  Helge Hess  <helge.hess@skyrix.com>
 
        * SOGoObject.m: added a default GET method which redirects to
index 4de78edca078bf47294be24a5afb8db4257b5827..d1cfafc578b881fa4ac8a7ab6720ed1aebaf0630 100644 (file)
@@ -17,5 +17,7 @@ libSOGo_LIB_DIRS +=                           \
 libSOGo_LIBRARIES_DEPEND_UPON += \
        -lOGoContentStore       \
        -lGDLAccess             \
-       -lEOControl             \
-       -lSaxObjC
+       -lNGObjWeb              \
+       -lNGMime                \
+       -lNGStreams -lNGExtensions -lEOControl \
+       -lXmlRpc -lDOM -lSaxObjC
index de2680a4ffca3dea14eb89d6f3be29e40b5b0b43..a79577a521811810882c41cbf26c7439d54e6847 100644 (file)
@@ -25,7 +25,7 @@
 
 #import <Foundation/NSObject.h>
 
-@class NSString, NSMutableString, NSException;
+@class NSString, NSArray, NSMutableString, NSException;
 @class OCSFolderManager, OCSFolder;
 @class SOGoUserFolder, SOGoGroupsFolder;
 
 
 - (void)sleep;
 
+/* hierarchy */
+
+- (NSArray *)fetchSubfolders;
+
 /* operations */
 
 - (NSException *)delete;
index 889b25e1d71536d59ec8174cdbe36ae79e94b646..2afabb992407ce8da4ee5028abca12beed48d9cb 100644 (file)
   return [[self container] ownerInContext:_ctx];
 }
 
+/* hierarchy */
+
+- (NSArray *)fetchSubfolders {
+  NSMutableArray *ma;
+  NSArray  *names;
+  unsigned i, count;
+  
+  if ((names = [self toManyRelationshipKeys]) == nil)
+    return nil;
+  
+  count = [names count];
+  ma    = [NSMutableArray arrayWithCapacity:count + 1];
+  for (i = 0; i < count; i++) {
+    id folder;
+    
+    folder = [self lookupName:[names objectAtIndex:i] inContext:nil 
+                  acquire:NO];
+    if (folder == nil)
+      continue;
+    if ([folder isKindOfClass:[NSException class]])
+      continue;
+    
+    [ma addObject:folder];
+  }
+  return ma;
+}
+
 /* looking up shared objects */
 
 - (SOGoUserFolder *)lookupUserFolder {
   return [self nameInContainer];
 }
 
+/* actions */
+
 - (id)DELETEAction:(id)_ctx {
   return [self delete];
 }
index 3b031fb7161e15e52ab7616f579c757b485c9c51..590c3a2c58997118391876a0466083719b50f8cb 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: Version 170 2004-08-11 10:45:40Z helge $
 
-SUBMINOR_VERSION:=18
+SUBMINOR_VERSION:=19