line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Model::Filemaker; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12584
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
80
|
|
4
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
22
|
use base qw/ Catalyst::Model /; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1264
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
13
|
use Carp qw( croak ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
149
|
|
9
|
2
|
|
|
2
|
|
1154
|
use Catalyst::Utils (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Net::FileMaker::XML::ResultSet; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Catalyst::Model::Filemaker - Catalyst model for Filemaker's XML services |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Use the helper to add a L<Net::FileMaker::XML> model to your application |
22
|
|
|
|
|
|
|
script/myapp_create.pl create model Filemaker Filemaker host=myhost \ |
23
|
|
|
|
|
|
|
user=myuser pass=mypassword db=mydb |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
or |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# lib/MyApp/Model/Filemaker.pm |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
package MyApp::Model::Filemaker; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use base qw/ Catalyst::Model::Filemaker /; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__PACKAGE__->config( |
34
|
|
|
|
|
|
|
host => 'myhostname', |
35
|
|
|
|
|
|
|
user => 'myusername', |
36
|
|
|
|
|
|
|
pass => 'mypassword', |
37
|
|
|
|
|
|
|
db => 'mydb.fpX' |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# In a controller... |
44
|
|
|
|
|
|
|
my $fm = $c->model('Filemaker'); |
45
|
|
|
|
|
|
|
print ref($fm); # Net::FileMaker::XML |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This is a L<Catalyst> model that interfaces with Filemaker's XML service. |
51
|
|
|
|
|
|
|
See the L<Net::FileMaker::XML> documentation for a description of the |
52
|
|
|
|
|
|
|
methods available. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 ->new() |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Instantiate a new L<Net::FileMaker::XML> Model. See L<Net::FileMaker::XML's |
60
|
|
|
|
|
|
|
new method|Net::FileMaker::XML/new> for the options available. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub new { |
65
|
|
|
|
|
|
|
my $self = shift->next::method(@_); |
66
|
|
|
|
|
|
|
my $class = ref($self); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my ( $c, $arg_ref ) = @_; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# check configuration |
71
|
|
|
|
|
|
|
croak "->config->{host} must be set for $class\n" |
72
|
|
|
|
|
|
|
unless $self->{host}; |
73
|
|
|
|
|
|
|
croak "->config->{user} must be set for $class\n" |
74
|
|
|
|
|
|
|
unless $self->{user}; |
75
|
|
|
|
|
|
|
croak "->config->{pass} must be set for $class\n" |
76
|
|
|
|
|
|
|
unless $self->{pass}; |
77
|
|
|
|
|
|
|
croak "->config->{db} must be set for $class\n" |
78
|
|
|
|
|
|
|
unless $self->{db}; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
my $fms = Net::FileMaker::XML->new( host => $self->{host} ); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my $fmdb = $fms->database( |
83
|
|
|
|
|
|
|
db => $self->{db}, |
84
|
|
|
|
|
|
|
user => $self->{user}, |
85
|
|
|
|
|
|
|
pass => $self->{pass} |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Instantiating a Net::FileMaker::XML obj |
89
|
|
|
|
|
|
|
$self->{'fm'} = $fmdb; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
return $self; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 ACCEPT_CONTEXT |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Return the L<Net::FileMaker::XML> object. Called automatically via |
97
|
|
|
|
|
|
|
C<$c-E<gt>model('Filemaker');> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub ACCEPT_CONTEXT { |
102
|
|
|
|
|
|
|
return shift->{'fm'}; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; # End of the module code; everything from here is documentation... |
106
|
|
|
|
|
|
|
__END__ |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 SEE ALSO |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
L<Catalyst>, L<Catalyst::Helper::Model::Filemaker>, L<Net::FileMaker::XML> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=over |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
L<Carp> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
L<Catalyst::Model> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
L<Catalyst::Utils> |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
L<Net::FileMaker::XML::ResultSet> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=back |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 BUGS |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
139
|
|
|
|
|
|
|
C<bug-catalyst-model-filemaker at rt.cpan.org>, or through the web interface at |
140
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Model-Filemaker>. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 SUPPORT |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
perldoc Catalyst::Model::Filemaker |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
You may also look for information at: |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=over 4 |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * Catalyst::Model::Filemaker |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
L<https://github.com/micheleo/Catalyst--Model--Filemaker> |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Catalyst-Model-Filemaker/> |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Model-Filemaker> |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item * Search CPAN |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/Catalyst-Model-Filemaker/> |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=back |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHOR |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
<micheleo@cpan.org> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Copyright (c) 2011 Michele Ongaro. All rights reserved. |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
182
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=cut |