line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Helper::Model::XMLRPC; |
2
|
1
|
|
|
1
|
|
1793
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
159
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Catalyst::Helper::Model::XMLRPC - Helper for XMLRPC models |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
script/myapp_create.pl model RemoteService XMLRPC http://webservice.example.com:9000 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Helper for the L<Catalyst> XMLRPC model. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 USAGE |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
When creating a new XMLRPC model class using this helper, you can |
20
|
|
|
|
|
|
|
specify much of the configuration and have it filled automatically. |
21
|
|
|
|
|
|
|
Using the example from the L</SYNOPSIS> section: |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=over |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item * C<RemoteService> |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
The name of the model. This is also used to determine the filename, |
28
|
|
|
|
|
|
|
e.g. C<lib/MyApp/Model/RemoteService.pm>. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=item * C<XMLRPC> |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
The helper to use, i.e. this one. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item * C<http://webservice.example.com:9000> |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
The XMLRPC webservice fully qualified domain name (FQDN). Can also be an |
37
|
|
|
|
|
|
|
IP address, e.g. C<127.0.0.1>. Followed by the port number, separated by |
38
|
|
|
|
|
|
|
colons. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=back |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 mk_compclass |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Makes the XMLRPC model class. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub mk_compclass { |
51
|
0
|
|
|
0
|
1
|
|
my ($self, $helper, $location) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
0
|
|
|
|
$helper->{location} = $location || ''; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$helper->render_file('modelclass', $helper->{file}); |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return 1; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 mk_comptest |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Makes tests for the XMLRPC model. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub mk_comptest { |
67
|
0
|
|
|
0
|
1
|
|
my ($self, $helper) = @_; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
$helper->render_file('modeltest', $helper->{test}); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SEE ALSO |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 1 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * L<Catalyst::Model::XMLRPC> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * L<Catalyst::Helper> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * L<Catalyst::Manual> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over 1 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * Daniel Westermann-Clark's module, L<Catalyst::Model::LDAP>, it was my reference. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Florian Merges E<lt>fmerges@cpan.orgE<gt> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
99
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
__DATA__ |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=begin pod_to_ignore |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
__modelclass__ |
110
|
|
|
|
|
|
|
package [% class %]; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
use strict; |
113
|
|
|
|
|
|
|
use warnings; |
114
|
|
|
|
|
|
|
use base 'Catalyst::Model::XMLRPC'; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
__PACKAGE__->config( |
117
|
|
|
|
|
|
|
location => '[% location %]', |
118
|
|
|
|
|
|
|
# For more options take a look at L<RPC::XML::Client>. |
119
|
|
|
|
|
|
|
); |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 NAME |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
[% class %] - XMLRPC Catalyst model component |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 SYNOPSIS |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
See L<[% app %]>. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 DESCRIPTION |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
XMLRPC Catalyst model component. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 AUTHOR |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
[% author %] |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 LICENSE |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
140
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
1; |
145
|
|
|
|
|
|
|
__modeltest__ |
146
|
|
|
|
|
|
|
use strict; |
147
|
|
|
|
|
|
|
use warnings; |
148
|
|
|
|
|
|
|
use Test::More tests => 2; |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
use_ok('Catalyst::Test', '[% app %]'); |
151
|
|
|
|
|
|
|
use_ok('[% class %]'); |
152
|
|
|
|
|
|
|
|