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