]> err.no Git - sope/blob - sope-appserver/NGXmlRpc/NGXmlRpcAction.h
define some default defaults for the simple http parser (when the Defaults.plist...
[sope] / sope-appserver / NGXmlRpc / NGXmlRpcAction.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
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 __NGXmlRpc_NGXmlRpcAction_H__
24 #define __NGXmlRpc_NGXmlRpcAction_H__
25
26 #import <Foundation/NSObject.h>
27 #import <NGObjWeb/WOActionResults.h>
28 #include <NGObjWeb/WOApplication.h>
29 #include <NGXmlRpc/WODirectAction+XmlRpc.h>
30
31 @class NSArray, NSString, NSException;
32 @class XmlRpcMethodCall;
33 @class NGAsyncResultProxy;
34 @class WORequest;
35
36 @interface NGXmlRpcAction : NSObject
37 {
38 @protected
39   WOContext *context;
40 }
41
42 /* initializer */
43
44 - (id)initWithContext:(WOContext *)_context;
45
46 /* accessors */
47
48 - (id)application;
49 - (WORequest *)request;
50 - (id)session;
51 - (id)existingSession;
52
53 /* notifications */
54
55 - (void)awake;
56 - (void)sleep;
57
58 /* sandstorm components */
59
60 - (NSString *)xmlrpcComponentNamespacePrefix;
61 - (NSString *)xmlrpcComponentName;
62 - (NSString *)xmlrpcComponentNamespace;
63
64 /* XML-RPC direct action dispatcher ... */
65
66 - (id)performActionNamed:(NSString *)_name parameters:(NSArray *)_params;
67 - (id<WOActionResults>)performMethodCall:(XmlRpcMethodCall *)_call;
68
69 - (id<WOActionResults>)missingAuthAction;
70 - (id<WOActionResults>)accessDeniedAction;
71
72 - (id<WOActionResults>)actionResponseForResult:(id)resValue;
73
74 /* async operation*/
75
76 - (WOResponse *)responseForAsyncResult:(NGAsyncResultProxy *)_proxy;
77
78 /* command context */
79
80 - (BOOL)hasAuthorizationHeader;
81 - (NSString *)credentials;
82
83 @end
84
85 @interface NGXmlRpcAction(Registry)
86
87 /* class registry */
88
89 + (void)registerActionClass:(Class)_class forURI:(NSString *)_uri;
90 + (Class)actionClassForURI:(NSString *)_uri;
91
92 /* action registry */
93
94 + (BOOL)registerMappingsInFile:(NSString *)_path;
95
96 + (void)registerSelector:(SEL)_selector
97   forMethodNamed:(NSString *)_method
98   signature:(id)_signature; /* either array or CSV */
99
100 + (SEL)selectorForActionNamed:(NSString *)_name
101   signature:(NSArray *)_signature;
102
103 + (NSArray *)registeredMethodNames; /* can be used for listMethods */
104 + (NSArray *)signaturesForMethodNamed:(NSString *)_method;
105 + (NSArray *)registeredMethodNames;
106
107 @end
108
109 @interface WOApplication(XmlRpcActionClass)
110
111 - (Class)defaultActionClassForRequest:(WORequest *)_request;
112
113 @end
114
115 #endif /* __NGXmlRpc_NGXmlRpcAction_H__ */