2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGObjWeb_WOResourceManager_H__
23 #define __NGObjWeb_WOResourceManager_H__
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSLock.h>
27 #import <Foundation/NSMapTable.h>
28 #import <Foundation/NSHashTable.h>
30 @class NSString, NSArray, NSData;
31 @class WORequest, WOComponent, WOElement, WOSession;
33 @interface WOResourceManager : NSObject < NSLocking >
38 NSString *w3resources;
40 NSMapTable *componentDefinitions; // name.language => definition
41 NSMapTable *stringTables; // path => tableinfo
42 NSMapTable *existingPathes;
43 NSMapTable *keyedResources;
46 - (NSString *)pathForResourceNamed:(NSString *)_name
47 inFramework:(NSString *)_frameworkName
48 languages:(NSArray *)_languages;
50 - (NSString *)urlForResourceNamed:(NSString *)_name
51 inFramework:(NSString *)_frameworkName
52 languages:(NSArray *)_languages
53 request:(WORequest *)_request;
57 - (NSString *)stringForKey:(NSString *)_key
58 inTableNamed:(NSString *)_tableName
59 withDefaultValue:(NSString *)_default
60 languages:(NSArray *)_languages;
62 - (NSString *)stringForKey:(NSString *)_key
63 inTableNamed:(NSString *)_tableName
64 withDefaultValue:(NSString *)_defaultValue
65 inFramework:(NSString *)_framework
66 languages:(NSArray *)_languages;
70 @interface WOResourceManager(KeyedData)
74 - (void)setData:(NSData *)_data
75 forKey:(NSString *)_key
76 mimeType:(NSString *)_type
77 session:(WOSession *)_session;
78 - (void)removeDataForKey:(NSString *)_key session:(WOSession *)_session;
79 - (void)flushDataCache;
83 @interface WOResourceManager(PrivateMethods)
85 - (id)initWithPath:(NSString *)_path;
86 + (void)setResourcePrefix:(NSString *)_prefix;
88 - (WOElement *)templateWithName:(NSString *)_name languages:(NSArray *)_langs;
89 - (id)pageWithName:(NSString *)_name languages:(NSArray *)_langs;
91 - (NSString *)pathToComponentNamed:(NSString *)_name
92 inFramework:(NSString *)_framework
93 languages:(NSArray *)_langs;
95 - (void)setCachingEnabled:(BOOL)_flag;
96 - (BOOL)isCachingEnabled;
100 @interface WOResourceManager(DeprecatedMethods)
102 - (NSString *)pathForResourceNamed:(NSString *)_name;
103 - (NSString *)pathForResourceNamed:(NSString *)_name ofType:(NSString *)_type;
104 - (NSString *)urlForResourceNamed:(NSString *)_name;
105 - (NSString *)urlForResourceNamed:(NSString *)_name ofType:(NSString *)_type;
109 #endif /* __NGObjWeb_WOResourceManager_H__ */