From 46724175a39516042876ebf1a99523e4ebf6bf18 Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 30 Jan 2005 20:09:43 +0000 Subject: [PATCH] minor work on script upload git-svn-id: http://svn.opengroupware.org/SOGo/trunk@508 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Mailer/SOGoMailBodyPart.m | 1 + SOGo/SoObjects/Sieve/ChangeLog | 4 +++ SOGo/SoObjects/Sieve/SOGoSieveBaseObject.h | 2 +- SOGo/SoObjects/Sieve/SOGoSieveBaseObject.m | 2 +- SOGo/SoObjects/Sieve/SOGoSieveScriptObject.h | 10 +++++++- SOGo/SoObjects/Sieve/SOGoSieveScriptObject.m | 26 +++++++++++++++++++- SOGo/SoObjects/Sieve/Version | 2 +- 7 files changed, 42 insertions(+), 5 deletions(-) diff --git a/SOGo/SoObjects/Mailer/SOGoMailBodyPart.m b/SOGo/SoObjects/Mailer/SOGoMailBodyPart.m index bc68c637..4ced6a48 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SOGo/SoObjects/Mailer/SOGoMailBodyPart.m @@ -99,6 +99,7 @@ - (id)lookupImap4BodyPartKey:(NSString *)_key inContext:(id)_ctx { // TODO: we might want to check for existence prior controller creation + // TODO: we might(should?) want to create type-specific body-part objects return [[[SOGoMailBodyPart alloc] initWithName:_key inContainer:self] autorelease]; } diff --git a/SOGo/SoObjects/Sieve/ChangeLog b/SOGo/SoObjects/Sieve/ChangeLog index 366cc880..2706045f 100644 --- a/SOGo/SoObjects/Sieve/ChangeLog +++ b/SOGo/SoObjects/Sieve/ChangeLog @@ -1,3 +1,7 @@ +2005-01-30 Helge Hess + + * some work on script upload (v0.9.5) + 2004-12-03 Helge Hess * SOGoSieveScriptObject.m, SOGoSieveScriptsFolder.m: added script diff --git a/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.h b/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.h index 71fbdcf9..b96de2ca 100644 --- a/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.h +++ b/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2004-2005 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.m b/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.m index 091ff77a..ccd47c29 100644 --- a/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.m +++ b/SOGo/SoObjects/Sieve/SOGoSieveBaseObject.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2004-2005 SKYRIX Software AG This file is part of OpenGroupware.org. diff --git a/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.h b/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.h index 8d6f2dd2..7063adf8 100644 --- a/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.h +++ b/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2004-2005 SKYRIX Software AG This file is part of OpenGroupware.org. @@ -33,10 +33,18 @@ The SOGoSieveScriptObject represents a single sieve script on a Cyrus folder. */ +@class NSData, NSString, NSException; + @interface SOGoSieveScriptObject : SOGoSieveBaseObject { } +/* content */ + +- (NSString *)contentAsString; +- (NSData *)content; +- (NSException *)writeContent:(id)_content; + @end #endif /* __Sieve_SOGoSieveScriptObject_H__ */ diff --git a/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.m b/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.m index bb8bbbdc..37ad358b 100644 --- a/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.m +++ b/SOGo/SoObjects/Sieve/SOGoSieveScriptObject.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2004-2005 SKYRIX Software AG This file is part of OpenGroupware.org. @@ -46,6 +46,16 @@ return [[self contentAsString] dataUsingEncoding:NSUTF8StringEncoding]; } +- (NSException *)writeContent:(id)_content { + if (_content == nil) { + return [NSException exceptionWithHTTPStatus:400 /* Bad Request */ + reason:@"Missing content to write!"]; + } + + return [NSException exceptionWithHTTPStatus:501 /* Not Implemented */ + reason:@"Does not implement script upload yet!"]; +} + /* operations */ - (NSException *)delete { @@ -81,6 +91,20 @@ return [NSException exceptionWithHTTPStatus:404 /* Not Found */]; } +/* operations */ + +- (id)PUTAction:(id)_context { + NSException *e; + NSData *content; + + content = [[_context request] content]; + + if ((e = [self writeContent:content])) + return e; + + return self; +} + /* WebDAV */ @end /* SOGoSieveScriptObject */ diff --git a/SOGo/SoObjects/Sieve/Version b/SOGo/SoObjects/Sieve/Version index 60cc37e5..298ef851 100644 --- a/SOGo/SoObjects/Sieve/Version +++ b/SOGo/SoObjects/Sieve/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=4 +SUBMINOR_VERSION:=5 # v0.9.1 requires libNGMime v4.3.194 -- 2.39.5