+2005-01-27 Helge Hess <helge.hess@skyrix.com>
+
+ * started attachment (download) viewer (#1074) (v0.9.76)
+
2005-01-26 Helge Hess <helge.hess@skyrix.com>
* v0.9.75
UIxMailPartViewer.m \
UIxMailPartTextViewer.m \
UIxMailPartImageViewer.m \
+ UIxMailPartLinkViewer.m \
UIxMailPartMixedViewer.m \
UIxMailPartAlternativeViewer.m \
\
UIxMailPartTextViewer.wox \
UIxMailPartMixedViewer.wox \
UIxMailPartImageViewer.wox \
+ UIxMailPartLinkViewer.wox \
UIxMailPartAlternativeViewer.wox\
\
UIxFilterList.wox \
--- /dev/null
+/*
+ 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 "UIxMailPartViewer.h"
+
+/*
+ UIxMailPartLinkViewer
+
+ The generic viewer for all kinds of attachments. Renders a link to download
+ the attachment.
+
+ TODO: show info based on the 'bodyInfo' dictionary:
+ {
+ bodyId = "";
+ description = "";
+ encoding = BASE64;
+ parameterList = {
+ "x-unix-mode" = 0666;
+ name = "IncoWEBOpenGroupwarepresentation.pdf";
+ };
+ size = 1314916;
+ subtype = PDF; type = application;
+ }
+*/
+
+@interface UIxMailPartLinkViewer : UIxMailPartViewer
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation UIxMailPartLinkViewer
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+/* URLs */
+
+- (NSString *)pathToAttachment {
+ NSString *url, *n;
+
+ url = [[self clientObject] baseURLInContext:[self context]];
+ if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
+
+ n = [[self partPath] componentsJoinedByString:@"/"];
+ return [url stringByAppendingString:n];
+}
+
+@end /* UIxMailPartLinkViewer */
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<div xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+>
+ <a var:href="pathToAttachment"
+ var:title="bodyInfo"
+ class="mailer_imagecontent"
+ >[abc <var:string value="bodyInfo" />]</a>
+</div>
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
WOComponent *mixedViewer;
WOComponent *textViewer;
WOComponent *imageViewer;
+ WOComponent *linkViewer;
}
- (id)initWithViewer:(WOComponent *)_viewer context:(WOContext *)_ctx;
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
[self->mixedViewer release];
[self->textViewer release];
[self->imageViewer release];
+ [self->linkViewer release];
[super dealloc];
}
[self->mixedViewer release]; self->mixedViewer = nil;
[self->textViewer release]; self->textViewer = nil;
[self->imageViewer release]; self->imageViewer = nil;
+ [self->linkViewer release]; self->linkViewer = nil;
}
/* fetching */
return self->imageViewer;
}
+- (WOComponent *)linkViewer {
+ if (self->linkViewer == nil) {
+ self->linkViewer =
+ [[self->viewer pageWithName:@"UIxMailPartLinkViewer"] retain];
+ }
+ return self->linkViewer;
+}
+
- (WOComponent *)viewerForBodyInfo:(id)_info {
NSString *mt, *st;
}
// TODO: always fallback to octet viewer?!
+#if 0
[self errorWithFormat:@"found no viewer for MIME type: %@/%@", mt, st];
- return nil;
+#endif
+ return [self linkViewer];
}
/* debugging */
# version file
-SUBMINOR_VERSION:=75
+SUBMINOR_VERSION:=76
# v0.9.74 requires SoObjects/Mailer v0.9.56
# v0.9.70 requires NGExtensions v4.5.136