]> err.no Git - sope/blob - sope-appserver/NGObjWeb/NGObjWeb/WOTemplate.h
improved SOPE security exceptions
[sope] / sope-appserver / NGObjWeb / NGObjWeb / WOTemplate.h
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __NGObjWeb_WOTemplate_H__
24 #define __NGObjWeb_WOTemplate_H__
25
26 #import <Foundation/NSObject.h>
27 #include <NGObjWeb/WOElement.h>
28
29 @class NSURL, NSDate, NSString, NSDictionary, NSMutableDictionary;
30 @class NSEnumerator;
31 @class WOTemplate, WOSubcomponentInfo, WOComponentScript;
32
33 @interface WOTemplate : WOElement
34 {
35   /* should add some info about the logic of the component ... */
36   NSURL               *url;
37   WOElement           *rootElement;
38   NSDate              *loadDate;
39   NSMutableDictionary *subcomponentInfos;
40   WOComponentScript   *componentScript;
41   NSDictionary        *kvcTemplateVars;
42 }
43
44 - (id)initWithURL:(NSURL *)_url rootElement:(WOElement *)_element;
45
46 /* component info */
47
48 - (void)setComponentScript:(WOComponentScript *)_script;
49 - (WOComponentScript *)componentScript;
50
51 - (void)setKeyValueArchivedTemplateVariables:(NSDictionary *)_vars;
52 - (NSDictionary *)keyValueArchivedTemplateVariables;
53
54 /* subcomponent info */
55
56 - (void)addSubcomponentWithKey:(NSString *)_key
57   name:(NSString *)_name
58   bindings:(NSDictionary *)_bindings;
59
60 - (BOOL)hasSubcomponentInfos;
61 - (NSEnumerator *)infoKeyEnumerator;
62 - (WOSubcomponentInfo *)subcomponentInfoForKey:(NSString *)_key;
63
64 /* accessors */
65
66 - (void)setRootElement:(WOElement *)_element;
67 - (WOElement *)rootElement;
68
69 - (NSURL *)url;
70
71 @end
72
73 @interface WOSubcomponentInfo : NSObject
74 {
75   NSString     *componentName;
76   NSDictionary *bindings;
77 }
78
79 - (id)initWithName:(NSString *)_name bindings:(NSDictionary *)_bindings;
80
81 /* accessors */
82
83 - (NSString *)componentName;
84 - (NSDictionary *)bindings;
85
86 @end
87
88 #endif /* __NGObjWeb_WOTemplate_H__ */