]> err.no Git - sope/blob - sope-appserver/NGObjWeb/NGObjWeb/WORequest.h
Ported "fragmentID" stuff from JOPE to SOPE.
[sope] / sope-appserver / NGObjWeb / NGObjWeb / WORequest.h
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #ifndef __NGObjWeb_WORequest_H__
23 #define __NGObjWeb_WORequest_H__
24
25 #import <Foundation/NSString.h>
26 #include <NGObjWeb/WOMessage.h>
27 #include <NGObjWeb/NGObjWebDecls.h>
28
29 @class NSString, NSArray, NSData, NSDictionary, NSCalendarDate;
30 @class NGHashMap;
31 @class NGHttpRequest;
32
33 NGObjWeb_EXPORT NSString *WORequestValueData;
34 NGObjWeb_EXPORT NSString *WORequestValueInstance;
35 NGObjWeb_EXPORT NSString *WORequestValuePageName;
36 NGObjWeb_EXPORT NSString *WORequestValueContextID;
37 NGObjWeb_EXPORT NSString *WORequestValueSenderID;
38 NGObjWeb_EXPORT NSString *WORequestValueSessionID;
39 NGObjWeb_EXPORT NSString *WORequestValueFragmentID;
40 NGObjWeb_EXPORT NSString *WONoSelectionString;
41
42 @interface WORequest : WOMessage
43 {
44 @private
45   NGHttpRequest *request;     // NGHttp Request
46   id            formContent;  // FORM data (message content or URL paras)
47   
48 @private
49   NSString      *method;
50   NSString      *_uri;
51   
52 @protected
53   NSString     *adaptorPrefix;
54   NSString     *appName;
55   NSString     *requestHandlerKey;
56   NSString     *requestHandlerPath;
57
58 @protected
59   NSCalendarDate *startDate;
60   id             startStatistics;
61 }
62
63 - (id)initWithMethod:(NSString *)_method
64   uri:(NSString *)_uri
65   httpVersion:(NSString *)_version
66   headers:(NSDictionary *)_headers
67   content:(NSData *)_body
68   userInfo:(NSDictionary *)_userInfo;
69
70 /* WO accessors */
71
72 - (BOOL)isFromClientComponent;
73
74 - (NSString *)applicationName;
75 - (NSString *)adaptorPrefix;
76
77 /* HTTP accessors */
78
79 - (NSString *)method;
80 - (NSString *)uri;
81 - (BOOL)isProxyRequest; /* check whether uri is a full URL */
82
83 /* forms */
84
85 - (NSStringEncoding)formValueEncoding;
86 - (void)setDefaultFormValueEncoding:(NSStringEncoding)_enc;
87 - (NSStringEncoding)defaultFormValueEncoding;
88 - (void)setFormValueEncodingDetectionEnabled:(BOOL)_flag;
89 - (BOOL)isFormValueEncodingDetectionEnabled;
90
91 - (NSArray *)formValueKeys;
92 - (NSString *)formValueForKey:(NSString *)_key;
93 - (NSArray *)formValuesForKey:(NSString *)_key;
94 - (NSDictionary *)formValues;
95
96 /* HTTP header */
97
98 - (NSArray *)browserLanguages; // new in WO4
99
100 /* request handler */
101
102 - (NSString *)requestHandlerKey;       // new in WO4
103 - (NSString *)requestHandlerPath;      // new in WO4
104 - (NSArray *)requestHandlerPathArray;  // new in WO4
105
106 /* cookie support (new in WO4) */
107
108 - (NSArray *)cookieValuesForKey:(NSString *)_key;
109 - (NSString *)cookieValueForKey:(NSString *)_key;
110 - (NSDictionary *)cookieValues;
111
112 /* SOPE extensions */
113
114 - (NSString *)fragmentID;
115 - (BOOL)isFragmentIDInRequest;
116
117 @end
118
119 #if COMPILING_NGOBJWEB
120
121 @interface WORequest(PrivateMethods)
122
123 - (NGHttpRequest *)httpRequest;
124
125 /* accessors */
126
127 - (NGHashMap *)formParameters;
128
129 @end
130
131 #endif
132
133 @interface WORequest(DeprecatedMethodsInWO4)
134
135 - (NSString *)applicationHost; // use NSProcessInfo and/or NSTask
136 - (NSString *)sessionID;       // [[context session] sessionID]
137 - (NSString *)senderID;        // replaced by WOContext:-senderID
138 - (NSString *)contextID;       // use WOContext:-contextID
139
140 @end
141
142 #endif /* __NGObjWeb_WORequest_H__ */