2 Copyright (C) 2004 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 <SOGoUI/UIxComponent.h>
27 An editor component which works on SOGoSieveScriptObject's.
30 @class NSArray, NSString;
32 @interface UIxSieveEditor : UIxComponent
40 #include <SoObjects/Sieve/SOGoSieveScriptObject.h>
43 @implementation UIxSieveEditor
46 [self->scriptText release];
47 [self->scriptName release];
53 - (void)setScriptName:(NSString *)_value {
54 ASSIGNCOPY(self->scriptName, _value);
56 - (NSString *)scriptName {
57 return self->scriptName ? self->scriptName : @"";
60 - (void)setScriptText:(NSString *)_value {
61 ASSIGNCOPY(self->scriptText, _value);
63 - (NSString *)scriptText {
64 return [self->scriptText isNotNull] ? self->scriptText : @"";
67 - (NSString *)panelTitle {
68 return [self labelForKey:@"Edit Mail Filter"];
73 - (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c {
80 return [self redirectToLocation:@"edit"];
85 [self logWithFormat:@"edit action, load content from: %@",
89 [self setScriptName:[[self clientObject] nameInContainer]];
90 [self setScriptText:[[self clientObject] contentAsString]];
99 text = [self scriptText];
100 if ((error = [[self clientObject] writeContent:text]) != nil)
109 if ((error = [[self clientObject] delete]) != nil)
115 @end /* UIxSieveEditor */