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 #include "UIxKolabPartViewer.h"
24 #include <DOM/DOMBuilderFactory.h>
26 @implementation UIxKolabPartViewer
28 static id<DOMBuilder> domBuilder = nil;
31 DOMBuilderFactory *factory
32 = [DOMBuilderFactory standardDOMBuilderFactory];
34 domBuilder = [[factory createDOMBuilderForMimeType:@"text/xml"] retain];
35 NSLog(@"Note(%@): using DOM builder: %@",
36 NSStringFromClass(self), domBuilder);
40 [(id)self->domDocument release];
47 - (void)resetPathCaches {
48 [super resetPathCaches];
49 [(id)self->domDocument release]; self->domDocument = nil;
50 [self->item release]; self->item = nil;
53 /* getting a DOM representation */
55 - (id<DOMDocument>)domDocument {
57 Note: this ignores the charset MIME header and will rely on proper
58 encoding header in the XML.
61 if (self->domDocument != nil)
62 return [(id)self->domDocument isNotNull] ? self->domDocument : nil;
65 [[domBuilder buildFromSource:[self decodedFlatContent]
66 systemId:@"Kolab Mail Object"] retain];
67 return self->domDocument;
72 - (void)setItem:(id)_item {
73 ASSIGN(self->item, _item);
79 @end /* UIxKolabPartViewer */