]> err.no Git - scalable-opengroupware.org/commitdiff
fixed MailerContactsUI for MacOSX (some code reorgs)
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 26 Jun 2005 19:11:35 +0000 (19:11 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 26 Jun 2005 19:11:35 +0000 (19:11 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@651 d1b88da0-ebda-0310-925b-ed51d893ca5b

20 files changed:
SOGo/UI/Contacts/ChangeLog
SOGo/UI/Contacts/GNUmakefile
SOGo/UI/Contacts/GNUmakefile.preamble
SOGo/UI/Contacts/UIxContactEditorBase.h [moved from SOGo/UI/Contacts/UIxContactEditor.h with 82% similarity]
SOGo/UI/Contacts/UIxContactEditorBase.m [moved from SOGo/UI/Contacts/UIxContactEditor.m with 89% similarity]
SOGo/UI/Contacts/UIxContactsListViewBase.h [moved from SOGo/UI/Contacts/UIxContactsListView.h with 81% similarity]
SOGo/UI/Contacts/UIxContactsListViewBase.m [moved from SOGo/UI/Contacts/UIxContactsListView.m with 96% similarity]
SOGo/UI/Contacts/UIxContactsSelectionView.m
SOGo/UI/Contacts/Version
SOGo/UI/Contacts/bundle-info.plist
SOGo/UI/MailerContactsUI/ChangeLog
SOGo/UI/MailerContactsUI/GNUmakefile.preamble [new file with mode: 0644]
SOGo/UI/MailerContactsUI/UIxMailContactEditor.m
SOGo/UI/MailerContactsUI/UIxMailContactList.m
SOGo/UI/MailerContactsUI/Version
SOGo/UI/MailerContactsUI/bundle-info.plist [new file with mode: 0644]
SOGo/UI/MailerContactsUI/product.plist
SOGo/UI/Templates/ChangeLog
SOGo/UI/Templates/UIxMailContactEditor.wox
SOGo/UI/common.make

index 1e1c211b01667fc5faeaa5f7acb171244a795601..aa3202405d7a462649b389c2c311691c4b4fdcb4 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-26  Helge Hess  <helge.hess@opengroupware.org>
+
+       * created a library containing shared base classes (for
+         MailerContactsUI) (v0.9.23)
+
 2005-03-23  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * renamed "default.strings" to "Localizable.strings" (v0.9.22)
index cbac87f253e0dbfe732638ef14841a519363976c..b7f4f3f68e5b546fef37e74f700a15a52fa8179c 100644 (file)
@@ -2,20 +2,24 @@
 
 include ../common.make
 
+LIBRARY_NAME = libContactsUI
 BUNDLE_NAME = ContactsUI
 
 ContactsUI_PRINCIPAL_CLASS = ContactsUIProduct
 
 ContactsUI_LANGUAGES = English French
 
+libContactsUI_OBJC_FILES = \
+       UIxContactsListViewBase.m       \
+       UIxContactEditorBase.m          \
+
 ContactsUI_OBJC_FILES =                        \
        ContactsUIProduct.m             \
-                                       \
-       UIxContactsListView.m           \
        UIxContactsSelectionView.m      \
        UIxContactView.m                \
-       UIxContactEditor.m              \
        UIxContactSelector.m            \
+       UIxContactEditor.m              \
+       UIxContactsListView.m           \
 
 ContactsUI_RESOURCE_FILES +=           \
        Version                         \
@@ -27,6 +31,7 @@ ContactsUI_LOCALIZED_RESOURCE_FILES +=        \
 # make
 
 -include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/library.make
 include $(GNUSTEP_MAKEFILES)/bundle.make
 -include GNUmakefile.postamble
 include ../../fhsbundle.make
index ca886a67390aa57934c05c6e78788b2e0704ec68..e7b69962293924eaad43bdff010d8c3a01379ae7 100644 (file)
@@ -2,3 +2,21 @@
 
 ADDITIONAL_INCLUDE_DIRS += \
        -I.. -I../.. -I../../..
+
+ADDITIONAL_LIB_DIRS += \
+       -L./$(GNUSTEP_OBJ_DIR)
+
+libContactsUI_LIBRARIES_DEPEND_UPON += \
+       -lOGoContentStore       \
+       -lSOGo          \
+       \
+       -lGDLContentStore       \
+       -lGDLAccess             \
+       -lNGObjWeb              \
+       -lNGLdap                \
+       -lNGiCal                \
+       -lNGMime                \
+       -lNGStreams -lNGExtensions -lEOControl  \
+       -lXmlRpc -lDOM -lSaxObjC
+
+ContactsUI_BUNDLE_LIBS += -lContactsUI
similarity index 82%
rename from SOGo/UI/Contacts/UIxContactEditor.h
rename to SOGo/UI/Contacts/UIxContactEditorBase.h
index 535b297dc4534a19cfbe9ca2916451a3d7af8a3b..b9a26c55fdc80f3d3871550fe960f2c1a29b7b1e 100644 (file)
   02111-1307, USA.
 */
 
+#ifndef __UIxContactEditorBase_H__
+#define __UIxContactEditorBase_H__
+
 #include <SOGoUI/UIxComponent.h>
 
-@class NSMutableDictionary;
+@class NSString, NSMutableDictionary;
 
-@interface UIxContactEditor : UIxComponent
+@interface UIxContactEditorBase : UIxComponent
 {
   NSString *contentString;
   NSString *errorText;
@@ -31,3 +34,5 @@
 }
 
 @end
+
+#endif /* __UIxContactEditorBase_H__ */
similarity index 89%
rename from SOGo/UI/Contacts/UIxContactEditor.m
rename to SOGo/UI/Contacts/UIxContactEditorBase.m
index d37eb1ea454a261bd413e4637252541988a234b1..6e67a38a6a243f53ea8b3a1fc67a991fd8dcd38b 100644 (file)
   02111-1307, USA.
 */
 
-#include "UIxContactEditor.h"
+#include "UIxContactEditorBase.h"
 #include <Contacts/SOGoContactObject.h>
 #include <Contacts/SOGoContactFolder.h>
 #include "common.h"
 
-@implementation UIxContactEditor
+@implementation UIxContactEditorBase
 
 - (id)init {
   if ((self = [super init])) {
                respondsToSelector:@selector(saveContentString:)];
 }
 
+- (NSString *)viewActionName {
+  /* this is overridden in the mail based contacts UI to redirect to tb.edit */
+  return @"";
+}
+- (NSString *)editActionName {
+  /* this is overridden in the mail based contacts UI to redirect to tb.edit */
+  return @"edit";
+}
+
 - (id)saveAction {
   NSException *ex;
-  NSString *recstr;
+  NSString *recstr, *uri;
   id record;
   
   if (![self isWriteableClientObject]) {
-    /* return 400 == Bad Request */
-    return [NSException exceptionWithHTTPStatus:400
+    return [NSException exceptionWithHTTPStatus:400 /* Bad Request */
                         reason:@"method cannot be invoked on "
                                @"the specified object"];
   }
   
-  record = [[[[self contentString] propertyList] mutableCopy] autorelease];
+  if ((record = [self contentString]) == nil) {
+    [self setErrorText:@"Missing object content!"]; // localize
+    return self;
+  }
+  record = [[[record propertyList] mutableCopy] autorelease];
   if (record == nil) {
     [self setErrorText:@"Invalid property list data ..."]; // localize
     return self;
     return self;
   }
   
-  return [self redirectToLocation:[self _completeURIForMethod:@".."]];
+  uri = ([(uri = [self viewActionName]) length] > 0)
+    ? [self viewActionName] : @"..";
+  uri = [self _completeURIForMethod:uri];
+  return [self redirectToLocation:uri];
 }
 
 - (id)testAction {
                        reason:@"could not create a unique ID"];
   }
   
-  nextMethod = [NSString stringWithFormat:@"../%@/edit", objectId];
+  nextMethod = [NSString stringWithFormat:@"../%@/%@", 
+                          objectId, [self editActionName]];
   uri = [self _completeURIForMethod:nextMethod];
   return [self redirectToLocation:uri];
 }
 
-@end /* UIxContactEditor */
+@end /* UIxContactEditorBase */
similarity index 81%
rename from SOGo/UI/Contacts/UIxContactsListView.h
rename to SOGo/UI/Contacts/UIxContactsListViewBase.h
index 31d68c27fd7d953675a8a20250b5438913ed977c..8205f9bef4a772b80d2f9e3637d6065998f93c73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
  
  This file is part of OpenGroupware.org.
  
  02111-1307, USA.
 */
 
-#ifndef __UIxContactsListView_H__
-#define __UIxContactsListView_H__
+#ifndef __UIxContactsListViewBase_H__
+#define __UIxContactsListViewBase_H__
 
 #include <SOGoUI/UIxComponent.h>
 
 @class NSString, NSArray;
 
-@interface UIxContactsListView : UIxComponent
+@interface UIxContactsListViewBase : UIxComponent
 {
   NSArray  *allRecords;
   NSArray  *filteredRecords;
@@ -36,4 +36,4 @@
 
 @end
 
-#endif /* __UIxContactsListView_H__ */
+#endif /* __UIxContactsListViewBase_H__ */
similarity index 96%
rename from SOGo/UI/Contacts/UIxContactsListView.m
rename to SOGo/UI/Contacts/UIxContactsListViewBase.m
index a028b42e39aaf3806752d1bdcbd5f3f5572be1fc..ddb2b425fa8f09463fbe0655f4fe2c1f48720d5b 100644 (file)
   02111-1307, USA.
 */
 
-#include "UIxContactsListView.h"
+#include "UIxContactsListViewBase.h"
 #include <Contacts/SOGoContactFolder.h>
 #include "common.h"
 
-@implementation UIxContactsListView
+@implementation UIxContactsListViewBase
 
 - (void)dealloc {
   [self->allRecords      release];
   return YES;
 }
 
-@end /* UIxContactsListView */
+@end /* UIxContactsListViewBase */
index ff13bca431126ce9afa6cbebe2b75cee2834bfd8..ee926fd222d7ebbdfcb64b2bef6aadfb1ac0119b 100644 (file)
@@ -1,30 +1,28 @@
 /*
- 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 "UIxContactsListView.h"
+  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 "UIxContactsListViewBase.h"
 #include <SOGoUI/SOGoJSStringFormatter.h>
 
-@interface UIxContactsSelectionView : UIxContactsListView
+@interface UIxContactsSelectionView : UIxContactsListViewBase
 {
   NSString *callback;
 }
index 9e92ea2e372d59b4d087333966ebf5b0c77c8bf8..09d4f5bfbc4c8f5dda6de8b2b018e580035df790 100644 (file)
@@ -1,6 +1,6 @@
 # GNUstep makefile
 
-SUBMINOR_VERSION:=22
+SUBMINOR_VERSION:=23
 
 # v0.9.18 requires NGExtensions v4.5.136
 # v0.9.16 requires libSOGoUI    v0.9.16
index fa33c7dbdc1bfc249fe70bb4388f22fe7bbdef9a..e990cf99295f0f47d0511c456acbacf38b9d20da 100644 (file)
@@ -1,6 +1,4 @@
 {
-  "__cvs__" = "$Id$";
-
   requires = {
     bundleManagerVersion = 1;
     classes = (
@@ -10,8 +8,10 @@
 
   provides = {
     classes = (
+      { name = UIxContactEditor; }
     );
     WOComponents = (
+      { name = UIxContactEditor; }
     );
   };
 }
index f9c44d2793cbe56fc67eb404c35a12e3f266e9f9..c87a3d017d9f71b55b664970bf5b5e48156f434d 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-26  Helge Hess  <helge.hess@opengroupware.org>
+
+       * use new ContactsUI library from Contacts (v0.9.9)
+
+2005-06-24  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailContactEditor.m: fixed an exception with Cocoa due to empty
+         fields on contact creation (v0.9.8)
+
 2005-02-22  Helge Hess  <helge.hess@opengroupware.org>
 
        * UIxMailContactList.m: hide frame if "noframe" query parameter is set
diff --git a/SOGo/UI/MailerContactsUI/GNUmakefile.preamble b/SOGo/UI/MailerContactsUI/GNUmakefile.preamble
new file mode 100644 (file)
index 0000000..994890c
--- /dev/null
@@ -0,0 +1,9 @@
+# compile flags
+
+ADDITIONAL_INCLUDE_DIRS += \
+       -I.. -I../.. -I../../..
+
+ADDITIONAL_LIB_DIRS += \
+       -L../Contacts/$(GNUSTEP_OBJ_DIR)
+
+MailerContactsUI_BUNDLE_LIBS += -lContactsUI
index e241cd0936f0a7c7c3705bd31b105ad42d354ffb..26900fe96d7e6cd74e8cf3011313f7a8077132f0 100644 (file)
@@ -19,9 +19,9 @@
   02111-1307, USA.
 */
 
-#include <UI/Contacts/UIxContactEditor.h>
+#include <UI/Contacts/UIxContactEditorBase.h>
 
-@interface UIxMailContactEditor : UIxContactEditor
+@interface UIxMailContactEditor : UIxContactEditorBase
 {
 }
 
   return [[l stringByAppendingString:@", "] stringByAppendingString:f];
 }
 - (NSString *)panelTitle {
-  NSString *s;
+  NSString *s, *t;
   
+  t = [self objectTitle];
   s = [self labelForKey:@"Edit Contact"];
-  s = [s stringByAppendingString:@": "];
-  s = [s stringByAppendingString:[self objectTitle]];
+  if ([t isNotNull]) {
+    s = [s stringByAppendingString:@": "];
+    s = [s stringByAppendingString:t];
+  }
   return s;
 }
 
+/* actions */
+
+- (NSString *)editActionName {
+  /* this is called by the parent class new action */
+  return @"tb.edit";
+}
+- (NSString *)viewxActionName {
+  /* this is called by the parent class save action */
+  return @"tb.edit";
+}
+
 @end /* UIxMailContactEditor */
index 10a80e0b16a0aa5b10a7f01cca2f081a41efcf2e..0140a39c1bfb941c39af3f9aa928db750d1755b7 100644 (file)
@@ -19,9 +19,9 @@
   02111-1307, USA.
 */
 
-#include <UI/Contacts/UIxContactsListView.h>
+#include <UI/Contacts/UIxContactsListViewBase.h>
 
-@interface UIxMailContactList : UIxContactsListView
+@interface UIxMailContactList : UIxContactsListViewBase
 {
 }
 
index bf17f4596ded6ffb6d3d335d8ac3719c8465a561..c92539a58f8b7c0c2ff8fb767e57d14fdab9510e 100644 (file)
@@ -1,5 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=7
+SUBMINOR_VERSION:=9
 
 # v0.9.5 requires MailerUI v0.9.116
diff --git a/SOGo/UI/MailerContactsUI/bundle-info.plist b/SOGo/UI/MailerContactsUI/bundle-info.plist
new file mode 100644 (file)
index 0000000..0217dc5
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  requires = {
+    bundleManagerVersion = 1;
+    classes = (
+      { name = NSObject;    }
+    );
+  };
+
+  provides = {
+    classes = (
+    );
+    WOComponents = (
+      { name = UIxMailContactEditor; }
+    );
+  };
+}
index f8d68b2e191313e72bc30117dd8aff82a9a0c1a6..b94a617d32e788eea1a9adc89f2fa1e6dbf95d4a 100644 (file)
                 cssClass = "tbicon_getmail"; label = "Get Mail";
               },
               {
-                link     = "new";
-                // onclick  = "clickedCompose(this);return false;";
+                link     = "tb.new";
+                // onclick  = "clickedNewContact(this);return false;";
                 cssClass = "tbicon_compose"; label = "New Contact";
+               target = "_blank";
               },
 /* enable if we actually can do that
               { link  = "tb.compose"; target = "_blank";
           actionClass = "UIxMailEditorAction"; 
           actionName  = "compose";
         };
+
+        "tb.new" = { 
+          protectedBy = "View";
+          pageName    = "UIxMailContactEditor"; 
+          actionName  = "new";
+        };
       };
     };
 
index bb67646d1776ebea45d532c54d45f6d7918e51da..48ce13272b9dec0f557fdd6f0e649421ee119a44 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-26  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailContactEditor.wox: added a hidden field containing the contact
+         content
+
 2005-03-23  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxCalWeekOverview.wox: changed the right corner URL yet again
index a6b2ac7a1c5ee338ffff21927814a0ea320a8f4f..38fab05345aae8cff01cb05efaee27bff3b2b517 100644 (file)
@@ -198,4 +198,6 @@ div#contacteditor_extended {
       </table>
     </div>
   </div>
+
+  <input type="hidden" name="content" var:value="contentString" />
 </var:component>
index 72153ffddae377edca529fee0da7ab80da2c558b..ecb62dbf76d2828846c03bfb88ca9d57363a686b 100644 (file)
@@ -26,7 +26,7 @@ RELBUILD_DIR_libSOGo = \
 RELBUILD_DIR_libSOGoUI = \
        $(GNUSTEP_BUILD_DIR)/../SOGoUI/$(GNUSTEP_OBJ_DIR_NAME)
 RELBUILD_DIR_libOGoContentStore = \
-       $(GNUSTEP_BUILD_DIR)/../../../OGoContentStore/$(GNUSTEP_OBJ_DIR_NAME)
+       $(GNUSTEP_BUILD_DIR)/../../OGoContentStore/$(GNUSTEP_OBJ_DIR_NAME)
 
 ADDITIONAL_LIB_DIRS +=                                 \
        -L$(RELBUILD_DIR_libSOGo)               \