]> err.no Git - scalable-opengroupware.org/commitdiff
added more fields to Kolab contact viewer
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 30 Jul 2005 17:17:16 +0000 (17:17 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 30 Jul 2005 17:17:16 +0000 (17:17 +0000)
cache parse DOM documents

git-svn-id: http://svn.opengroupware.org/SOGo/trunk@925 d1b88da0-ebda-0310-925b-ed51d893ca5b

UI/MailPartViewers/ChangeLog
UI/MailPartViewers/UIxKolabPartViewer.h
UI/MailPartViewers/UIxKolabPartViewer.m
UI/MailPartViewers/Version
UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox

index 42c280a1e15ac2fef867383d1c0340821215f01c..2e886cbc97d406b4529fb715ba6a79351a6972c4 100644 (file)
@@ -1,5 +1,7 @@
 2005-07-30  Helge Hess  <helge.hess@opengroupware.org>
-       
+
+       * UIxKolabPartViewer.m: cache parsed DOM document (v0.9.21)
+
        * v0.9.20
        
        * UIxMailPartViewer.m: added ability to use a fallback string encoding
index af288097303d80811341baa48bca071fb41ec0c2..c2d02c6839afcb0f14c0c347fde67acdf0b12422 100644 (file)
   Superclass for viewers which show the application/x-vnd.* XML documents.
 */
 
+#include <DOM/DOMProtocols.h>
+
 @interface UIxKolabPartViewer : UIxMailPartViewer
 {
+  id<DOMDocument> domDocument;
 }
 
 @end
index 0d75446965322cd4cda27451e4c77296db802c7c..aecdb03adb6e660e755d30aac830870267e2dbd8 100644 (file)
@@ -36,13 +36,33 @@ static id<DOMBuilder> domBuilder = nil;
        NSStringFromClass(self), domBuilder);
 }
 
+- (void)dealloc {
+  [(id)self->domDocument release];
+  [super dealloc];
+}
+
+/* maintain caches */
+
+- (void)resetPathCaches {
+  [super resetPathCaches];
+  [(id)self->domDocument release]; self->domDocument = nil;
+}
+
+/* getting a DOM representation */
+
 - (id<DOMDocument>)domDocument {
   /* 
      Note: this ignores the charset MIME header and will rely on proper
            encoding header in the XML.
   */
-  return [domBuilder buildFromSource:[self decodedFlatContent]
-                    systemId:@"Kolab Mail Object"];
+
+  if (self->domDocument != nil)
+    return [(id)self->domDocument isNotNull] ? self->domDocument : nil;
+  
+  self->domDocument =
+    [[domBuilder buildFromSource:[self decodedFlatContent]
+                systemId:@"Kolab Mail Object"] retain];
+  return self->domDocument;
 }
 
 @end /* UIxKolabPartViewer */
index af42e0b0bfbd9f7dd5d5fe604855ace81325f532..d7c250fcac8deb05740ffc85e133a676715803ff 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=20
+SUBMINOR_VERSION:=21
 
 # v0.9.0 requires libNGiCal v4.5.53
 # v0.9.1 requires libNGMime v4.5.213
index 378f46545cf576f461ba65805865e8193008dfa2..0b5f57240cb4cf8e40cc8f6bbf9ff66d73c015a9 100644 (file)
@@ -14,6 +14,7 @@
     </legend>
 
     <div class="linked_attachment_meta" style="background-color: white;">
+      <!-- TODO: add some reasonable sorting .. -->
       <table border="0" class="linked_attachment_meta">
         <tr>
           <td><var:string label:value="Name"/>:</td>
           <td><var:string label:value="Job Title"/>:</td>
           <td><var:string value="domDocument./job-title.textValue" /></td>
         </tr>
+        <tr>
+          <td><var:string label:value="Nickname"/>:</td>
+          <td><var:string value="domDocument./nick-name.textValue" /></td>
+        </tr>
+        <tr>
+          <td><var:string label:value="Spouse"/>:</td>
+          <td><var:string value="domDocument./spouse-name.textValue" /></td>
+        </tr>
+        <tr>
+          <td><var:string label:value="Birthday"/>:</td>
+          <td><var:string value="domDocument./birthday.textValue" /></td>
+        </tr>
+        <tr>
+          <td><var:string label:value="Anniversary"/>:</td>
+          <td><var:string value="domDocument./anniversary.textValue" /></td>
+        </tr>
+        <tr>
+          <td><var:string label:value="Geo"/>:</td>
+          <td>
+            <!-- use gmaps: http://maps.google.com/maps?q=52.5+13.366 -->
+            <var:string label:value="Latitude"/>
+            <var:string value="domDocument./latitude.textValue" />
+            /
+            <var:string label:value="Longitude"/>
+            <var:string value="domDocument./longitude.textValue" />
+          </td>
+        </tr>
+      </table>
 <!--
 creation-date
 last-modification-date
-nick-name
-spouse-name
-birthday
-anniversary
+
 picture
 x-logo
+
 phone [ type, number]
 email [ display-name, smtp-address ]
+
 address [ type, street, locality, region, postal-code, country ]
 preferred-address (type: home)
-latitude
-longitude
+
 x-custom [ @value, @app, @name ]
   -->
-      </table>
     </div>
 
 <!--