2 Copyright (C) 2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #import <NGExtensions/NSNull+misc.h>
23 #import <DOM/DOMBuilderFactory.h>
24 #import <DOM/DOMProtocols.h>
26 #import "UIxKolabPartViewer.h"
28 @implementation UIxKolabPartViewer
30 static id<DOMBuilder> domBuilder = nil;
33 DOMBuilderFactory *factory
34 = [DOMBuilderFactory standardDOMBuilderFactory];
36 domBuilder = [[factory createDOMBuilderForMimeType:@"text/xml"] retain];
37 NSLog(@"Note(%@): using DOM builder: %@",
38 NSStringFromClass(self), domBuilder);
42 [(id)self->domDocument release];
49 - (void)resetPathCaches {
50 [super resetPathCaches];
51 [(id)self->domDocument release]; self->domDocument = nil;
52 [self->item release]; self->item = nil;
55 /* getting a DOM representation */
57 - (id<DOMDocument>)domDocument {
59 Note: this ignores the charset MIME header and will rely on proper
60 encoding header in the XML.
63 if (self->domDocument != nil)
64 return [(id)self->domDocument isNotNull] ? self->domDocument : nil;
67 [[domBuilder buildFromSource:[self decodedFlatContent]
68 systemId:@"Kolab Mail Object"] retain];
69 return self->domDocument;
74 - (void)setItem:(id)_item {
75 ASSIGN(self->item, _item);
81 @end /* UIxKolabPartViewer */