#include "common.h"
@implementation UIxKolabPartContactViewer
+
+- (id<NSObject,DOMNodeList>)addressElements {
+ return [[[self domDocument] documentElement]
+ getElementsByTagName:@"address"];
+}
+
+- (id<NSObject,DOMNodeList>)phoneElements {
+ return [[[self domDocument] documentElement]
+ getElementsByTagName:@"phone"];
+}
+
+- (id<NSObject,DOMNodeList>)emailElements {
+ return [[[self domDocument] documentElement]
+ getElementsByTagName:@"email"];
+}
+
+- (id<NSObject,DOMNodeList>)customElements {
+ return [[[self domDocument] documentElement]
+ getElementsByTagName:@"x-custom"];
+}
+
@end /* UIxKolabPartContactViewer */
- (void)dealloc {
[(id)self->domDocument release];
+ [self->item release];
[super dealloc];
}
- (void)resetPathCaches {
[super resetPathCaches];
[(id)self->domDocument release]; self->domDocument = nil;
+ [self->item release]; self->item = nil;
}
/* getting a DOM representation */
return self->domDocument;
}
+/* accessors */
+
+- (void)setItem:(id)_item {
+ ASSIGN(self->item, _item);
+}
+- (id)item {
+ return self->item;
+}
+
@end /* UIxKolabPartViewer */
<var:string value="domDocument./longitude.textValue" />
</td>
</tr>
+
+ <tr>
+ <td valign="top"><var:string label:value="Phones"/>:</td>
+ <td>
+ <var:foreach list="phoneElements" item="item">
+ <var:string value="item./number.textValue"/>
+ (<var:string value="item./type.textValue"/>)
+ <br />
+ </var:foreach>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top"><var:string label:value="Emails"/>:</td>
+ <td>
+ <var:foreach list="emailElements" item="item">
+ <var:string value="item./display-name.textValue"/>
+ <<var:string value="item./smtp-address.textValue"/>>
+ <br />
+ </var:foreach>
+ </td>
+ </tr>
</table>
<!--
creation-date
picture
x-logo
-phone [ type, number]
-email [ display-name, smtp-address ]
-
-address [ type, street, locality, region, postal-code, country ]
preferred-address (type: home)
x-custom [ @value, @app, @name ]
-->
</div>
+ <br />
+
+ <var:foreach list="addressElements" item="item">
+ <fieldset>
+ <legend>
+ <var:string label:value="Address"/>:
+ <var:string value="item./type.textValue"/><br />
+ </legend>
+
+ <div class="linked_attachment_meta"
+ style="background-color: white; padding: 8px;">
+ <var:string value="item./street.textValue"/><br />
+ <var:string value="item./locality.textValue"/><br />
+ <var:string value="item./region.textValue"/><br />
+ <var:string value="item./postal-code.textValue"/><br />
+ <var:string value="item./country.textValue"/>
+ </div>
+ </fieldset>
+ </var:foreach>
+
+ <fieldset>
+ <legend>
+ <var:string label:value="Custom Attributes"/>
+ </legend>
+
+ <div class="linked_attachment_meta" style="background-color: white;">
+ <table border="0" class="linked_attachment_meta">
+ <var:foreach list="customElements" item="item">
+ <tr>
+ <td valign="top"><var:string value="item.@name.textValue"/>:</td>
+ <td><var:string value="item.@value.textValue"/></td>
+ </tr>
+ </var:foreach>
+ </table>
+ </div>
+ </fieldset>
+
<!--
DOC: <var:string value="domDocument" /><br />
DOCEL: <var:string value="domDocument.documentElement" /><br />