From 48904dd78f1c2cbdec8f7d1ff66bac207d814d66 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 10 Mar 2010 18:42:06 +0000 Subject: [PATCH 01/90] Fixed Net::FileMaker::XML bug that showed up in CPAN Test report #6919489. --- lib/Net/FileMaker/XML.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index c3b88e5..89e976a 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -48,7 +48,7 @@ sub new my($class, %args) = @_; # If the protocol isn't specified, let's assume it's just HTTP. - if($args{host} !=~/^http/) + if($args{host} !~/^http/) { $args{host} = 'http://'.$args{host}; } From 3f32ef390f6725dbc84dcbc07219f0e35dffa4f7 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 10 Mar 2010 19:03:34 +0000 Subject: [PATCH 02/90] Fixed contributors section. --- lib/Net/FileMaker.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 0d59fdd..3668c77 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -18,7 +18,7 @@ Version 0.05 =cut -our $VERSION = 0.05; +our $VERSION = "0.05_02"; =head1 SYNOPSIS @@ -69,6 +69,10 @@ As all of the current structure is confied to the XML base, see L >> +=head1 CONTRIBUTORS + +Simon Cozens, C<> + =head1 BUGS This distrobution is in it's early stages and B. From 44d7fa5a4d3f37d3bdb2675542ec7992075e537c Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 11 Mar 2010 13:00:28 +0000 Subject: [PATCH 03/90] Net::FileMaker::XML using URI to build the request address. --- lib/Net/FileMaker/XML.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 89e976a..9d7c62d 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -57,7 +57,8 @@ sub new host => $args{host}, ua => LWP::UserAgent->new, xml => XML::Twig->new, - resultset => '/fmi/xml/fmresultset.xml?', # Entirely for dbnames(); + uri => URI->new($args{host}), + resultset => '/fmi/xml/fmresultset.xml', # Entirely for dbnames(); }; return bless $self; @@ -112,7 +113,7 @@ sub dbnames -# _request(query => $query, resultset => $resultset, user => $user, pass => $pass) +# _request(query => $query, params => $params, resultset => $resultset, user => $user, pass => $pass) # # Performs a request to the FileMaker Server. The query and resultset keys are mandatory, # however user and pass keys are not. The query should always be URI encoded. @@ -120,10 +121,13 @@ sub _request { my ($self, %args) = @_; - # Everything in %args should be uri encoded. - my $url = $self->{host}.$args{resultset}.$args{query}; + # Construct the URI + my $uri = $self->{uri}->clone; + $uri->path($args{resultset}); + $uri->query($args{query}); + $uri->query_form(%{$args{query_form}}) if ($args{query_form}); - my $req = HTTP::Request->new(GET => $url); + my $req = HTTP::Request->new(GET => $uri->as_string); if($args{user} && $args{pass}) { From 3f02338e27da38a6e7b9f41ade188e37b2dc4f17 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 11 Mar 2010 18:04:34 +0000 Subject: [PATCH 04/90] Added layoutnames test. --- t/01_xml/{01-dblist.t => 01-dbnames.t} | 0 t/01_xml/02-layoutnames.t | 30 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) rename t/01_xml/{01-dblist.t => 01-dbnames.t} (100%) create mode 100644 t/01_xml/02-layoutnames.t diff --git a/t/01_xml/01-dblist.t b/t/01_xml/01-dbnames.t similarity index 100% rename from t/01_xml/01-dblist.t rename to t/01_xml/01-dbnames.t diff --git a/t/01_xml/02-layoutnames.t b/t/01_xml/02-layoutnames.t new file mode 100644 index 0000000..025e9e5 --- /dev/null +++ b/t/01_xml/02-layoutnames.t @@ -0,0 +1,30 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); +my $dbx = $fmx->dbnames; + +# This test assumes that database +if(ref($dbx) eq 'ARRAY') +{ + my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); + my $layouts = $fmdb->layoutnames; + is(ref($layouts), 'ARRAY', 'layoutnames returned arrayref'); +} + +done_testing(); + From 72d00ab95488cc10f11fa8fa7d1e589d6e67b1ca Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 11 Mar 2010 18:09:14 +0000 Subject: [PATCH 05/90] Fixed drama's with URI - doesn't let valueless param keys be added, had to work around it. --- lib/Net/FileMaker/XML.pm | 40 +++++++++++++++++----------- lib/Net/FileMaker/XML/Database.pm | 43 ++++++++++++++++--------------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 9d7c62d..b211537 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -15,7 +15,7 @@ Version 0.05 =cut -our $VERSION = 0.05; +our $VERSION = "0.05_02"; =head1 SYNOPSIS @@ -119,24 +119,34 @@ sub dbnames # however user and pass keys are not. The query should always be URI encoded. sub _request { - my ($self, %args) = @_; + my ($self, %args) = @_; + + # Construct the URI + my $uri = $self->{uri}->clone; + $uri->path($args{resultset}); + + my $url; + # This kind of defeats the purpose of using URI to begin with, + if($args{params}) + { + $uri->query_form(%{$args{params}}); + $url = $uri->as_string."&".$args{query}; + } + else + { + $url = $uri->as_string."?".$args{query}; + } - # Construct the URI - my $uri = $self->{uri}->clone; - $uri->path($args{resultset}); - $uri->query($args{query}); - $uri->query_form(%{$args{query_form}}) if ($args{query_form}); + my $req = HTTP::Request->new(GET => $url); - my $req = HTTP::Request->new(GET => $uri->as_string); + if($args{user} && $args{pass}) + { + $req->authorization_basic( $args{user}, $args{pass}); + } - if($args{user} && $args{pass}) - { - $req->authorization_basic( $args{user}, $args{pass}); - } - - my $res = $self->{ua}->request($req); + my $res = $self->{ua}->request($req); - return $res; + return $res; } diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 6c6d8c5..f06f1bb 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -11,14 +11,8 @@ our @ISA = qw(Net::FileMaker::XML); Net::FileMaker::XML::Database -=head1 VERSION - -Version 0.05 - =cut -our $VERSION = 0.05; - =head1 SYNOPSIS This module handles all the tasks with XML data. @@ -28,6 +22,7 @@ This module handles all the tasks with XML data. my $db = $fm->database(db => $db, user => $user, pass => $pass); my $layouts = $db->layoutnames; + my $scripts = $db->scriptnames; =head1 METHODS @@ -45,13 +40,15 @@ sub new pass => $args{pass}, resultset => '/fmi/xml/fmresultset.xml?', ua => LWP::UserAgent->new, - xml => XML::Twig->new + xml => XML::Twig->new, + uri => URI->new($args{host}) + }; return bless $self; } -=head2 layoutnames +=head2 layoutnames($database) Returns an arrayref containing layouts accessible for the respective database. @@ -60,12 +57,14 @@ Returns an arrayref containing layouts accessible for the respective database. sub layoutnames { my $self = shift; - my $res = $self->_request( - user => $self->{user}, - pass => $self->{pass}, - resultset => $self->{resultset}, - query =>'-db='.uri_escape_utf8($self->{db}).'&-layoutnames' - ); + my $res = $self->_request( + user => $self->{user}, + pass => $self->{pass}, + resultset => $self->{resultset}, + query => '-layoutnames', + params => { '-db' => $self->{db} } + ); + if($res->is_success) { @@ -78,7 +77,7 @@ sub layoutnames } } -=head2 scriptnames +=head2 scriptnames($database) Returns an arrayref containing scripts accessible for the respective database. @@ -87,12 +86,14 @@ Returns an arrayref containing scripts accessible for the respective database. sub scriptnames { my $self = shift; - my $res = $self->_request( - user => $self->{user}, - pass => $self->{pass}, - resultset => $self->{resultset}, - query =>'-db='.uri_escape_utf8($self->{db}).'&-scriptnames' - ); + my $res = $self->_request( + user => $self->{user}, + pass => $self->{pass}, + resultset => $self->{resultset}, + query => '-scriptnames', + params => { '-db' => $self->{db} } + ); + if($res->is_success) { From c4ac6290c83e2ec99b2893d2809bd33d869991e4 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 11 Mar 2010 18:16:33 +0000 Subject: [PATCH 06/90] scriptnames XML test in, MANIFEST updated --- MANIFEST | 4 +++- t/01_xml/03-scriptnames.t | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 t/01_xml/03-scriptnames.t diff --git a/MANIFEST b/MANIFEST index f1225db..53d125a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,8 @@ lib/Net/FileMaker/XML.pm lib/Net/FileMaker/XML/Database.pm t/00_load/00-net-filemaker.t t/01_xml/00-load.t -t/01_xml/01-dblist.t +t/01_xml/01-dbnames.t +t/01_xml/02-layoutnames.t +t/01_xml/03-scriptnames.t t/manifest.t t/pod.t diff --git a/t/01_xml/03-scriptnames.t b/t/01_xml/03-scriptnames.t new file mode 100644 index 0000000..9bf3c40 --- /dev/null +++ b/t/01_xml/03-scriptnames.t @@ -0,0 +1,31 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); +my $dbx = $fmx->dbnames; + +# This test assumes that database +if(ref($dbx) eq 'ARRAY') +{ + my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); + my $scripts = $fmdb->scriptnames; + is(ref($scripts), 'ARRAY', 'scriptnames returned arrayref'); +} + +done_testing(); + + From 937576a4a9d7a0a2453d22b5d0daacfb995b3d5f Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 12 Mar 2010 14:51:23 +0000 Subject: [PATCH 07/90] Added findall test, simply does a single record findall. --- t/01_xml/04-findall.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 t/01_xml/04-findall.t diff --git a/t/01_xml/04-findall.t b/t/01_xml/04-findall.t new file mode 100644 index 0000000..a4be5e5 --- /dev/null +++ b/t/01_xml/04-findall.t @@ -0,0 +1,33 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); +my $dbx = $fmx->dbnames; + +# This test assumes that database +if(ref($dbx) eq 'ARRAY') +{ + my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); + my $layouts = $fmdb->layoutnames; + if(ref($layouts) eq 'ARRAY') + { + my $findall = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1}); + is(ref($findall), 'HASH', 'findall() returned hashref'); + } +} + +done_testing(); From c5d629cfd3fbc29a19f1567f984be3f357e738d8 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 12 Mar 2010 14:52:04 +0000 Subject: [PATCH 08/90] findall() now brought up to speed, param checking setup now in place. --- lib/Net/FileMaker/XML.pm | 29 ++++++++++++++-- lib/Net/FileMaker/XML/Database.pm | 58 +++++++++++++++++++++---------- 2 files changed, 66 insertions(+), 21 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index b211537..6f17001 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -111,7 +111,11 @@ sub dbnames } +=head1 SEE ALSO +L + +=cut # _request(query => $query, params => $params, resultset => $resultset, user => $user, pass => $pass) # @@ -213,10 +217,29 @@ sub _compose_arrayref } -=head1 SEE ALSO -L +# _assert_param() +# +# Optional parameters sometimes validation to ensure they are correct. +# Warnings are issued if a parameter name is somehow invalid. +sub _assert_param +{ + my($self, $unclean_param, $acceptable_params) = @_; + my $param; + + if($unclean_param =~/$acceptable_params/) + { + $param = $unclean_param; + } + else + { + # TODO: Localise this error message + warn "Invalid parameter specified - $unclean_param"; + } + + + return $param; +} -=cut 1; # End of Net::FileMaker::XML; diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index f06f1bb..91b58ca 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -7,6 +7,18 @@ use URI::Escape; our @ISA = qw(Net::FileMaker::XML); +# +# Particular methods have specific parameters that are either expected or optional. +# This list comprises of each supported. +my $acceptable_params = { + 'findall' => 'recid|lop|op|max|skip|sortorder|sortfield|script|script\.prefind|script\.presort', + 'findany' => '', + 'findquery' => '', + 'delete' => 'db|lay|recid|script', + 'dup' => 'db|lay|recid|script', + 'edit' => 'db|lay|recid|modid|script', +}; + =head1 NAME Net::FileMaker::XML::Database @@ -38,7 +50,7 @@ sub new db => $args{db}, user => $args{user}, pass => $args{pass}, - resultset => '/fmi/xml/fmresultset.xml?', + resultset => '/fmi/xml/fmresultset.xml', ua => LWP::UserAgent->new, xml => XML::Twig->new, uri => URI->new($args{host}) @@ -48,7 +60,7 @@ sub new return bless $self; } -=head2 layoutnames($database) +=head2 layoutnames Returns an arrayref containing layouts accessible for the respective database. @@ -77,7 +89,7 @@ sub layoutnames } } -=head2 scriptnames($database) +=head2 scriptnames Returns an arrayref containing scripts accessible for the respective database. @@ -107,35 +119,45 @@ sub scriptnames } -=head2 findall($layout, { options }) +=head2 findall(layout => $layout, params => { parameters }, nocheck => 1) Returns all rows on a specific database and layout. +nocheck is an optional argument that will skip checking of parameters if set to 1. + =cut sub findall { - my ($self, $layout, $args) = @_; + my ($self, %args) = @_; - my $url; - - # Keys are just actual URL vars from the API minus the prefixing dash. - # According to the documentation, that means all the options are: - # –recid, –lop, –op, –max, –skip, –sortorder, –sortfield, –script, –script.prefind, –script.presort + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; - #TODO: Validations done on the applicable params so we don't spew junk to the server. - for my $var (keys %{$args}) - { - $url .= sprintf('-%s=%s&', uri_escape_utf8($var), uri_escape_utf8($args->{$var})); + if($args{params} && ref($args{params}) eq 'HASH') + { + for my $param(keys %{$args{params}}) + { + # Perform or skip parameter checking + if($args{nocheck} && $args{nocheck} == 1) + { + $params->{$param} = $args{params}->{$param}; + } + else + { + $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); + } + } } - $url .= '-findall&-db=' . uri_escape_utf8($self->{db}) . '&-lay=' . $layout; - my $res = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, - query => $url + query => '-findall', + params => $params ); if($res->is_success) @@ -147,7 +169,7 @@ sub findall else { return $res; - }2 + }; } From c5ca32637073e8e45267d444ec3ffa9eaee9a617 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 12 Mar 2010 15:12:51 +0000 Subject: [PATCH 09/90] Added findany, test suite and MANIFEST also sorted. --- MANIFEST | 2 + lib/Net/FileMaker/XML/Database.pm | 70 +++++++++++++++++++++++++++---- t/01_xml/05-findany.t | 33 +++++++++++++++ 3 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 t/01_xml/05-findany.t diff --git a/MANIFEST b/MANIFEST index 53d125a..83b81bb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -10,5 +10,7 @@ t/01_xml/00-load.t t/01_xml/01-dbnames.t t/01_xml/02-layoutnames.t t/01_xml/03-scriptnames.t +t/01_xml/04-findall.t +t/01_xml/05-findany.t t/manifest.t t/pod.t diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 91b58ca..d9ce298 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -8,15 +8,14 @@ use URI::Escape; our @ISA = qw(Net::FileMaker::XML); # -# Particular methods have specific parameters that are either expected or optional. -# This list comprises of each supported. +# Particular methods have specific parameters that are optional, but need to be validated to mitigate sending +# bad parameters to the server. my $acceptable_params = { - 'findall' => 'recid|lop|op|max|skip|sortorder|sortfield|script|script\.prefind|script\.presort', - 'findany' => '', - 'findquery' => '', - 'delete' => 'db|lay|recid|script', - 'dup' => 'db|lay|recid|script', - 'edit' => 'db|lay|recid|modid|script', + 'findall' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', + 'findany' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', + 'delete' => 'db|lay|recid|script', + 'dup' => 'db|lay|recid|script', + 'edit' => 'db|lay|recid|modid|script', }; =head1 NAME @@ -173,6 +172,61 @@ sub findall } +=head2 findany(layout => $layout, params => { parameters }, nocheck => 1) + +Returns a random hashref of rows on a specific database and layout. + +nocheck is an optional argument that will skip checking of parameters if set to 1. + +=cut + +sub findany +{ + my ($self, %args) = @_; + + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; + + if($args{params} && ref($args{params}) eq 'HASH') + { + for my $param(keys %{$args{params}}) + { + # Perform or skip parameter checking + if($args{nocheck} && $args{nocheck} == 1) + { + $params->{$param} = $args{params}->{$param}; + } + else + { + $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); + } + } + } + + my $res = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-findany', + params => $params + ); + + if($res->is_success) + { + my $xml = $self->{xml}->parse($res->content); + my $xml_data = $xml->simplify; + return $xml_data->{resultset}->{record}; + } + else + { + return $res; + }; + +} + + =head2 total_rows($database, $layout) Returns a scalar with the total rows for a given database and layout. diff --git a/t/01_xml/05-findany.t b/t/01_xml/05-findany.t new file mode 100644 index 0000000..2692747 --- /dev/null +++ b/t/01_xml/05-findany.t @@ -0,0 +1,33 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); +my $dbx = $fmx->dbnames; + +# This test assumes that database +if(ref($dbx) eq 'ARRAY') +{ + my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); + my $layouts = $fmdb->layoutnames; + if(ref($layouts) eq 'ARRAY') + { + my $findall = $fmdb->findany(layout => $layouts->[0], params => { '-max' => 1}); + is(ref($findall), 'HASH', 'findany() returned hashref'); + } +} + +done_testing(); From ef1493861b6b797563c8e91c0b1850bd51252994 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 12:05:38 +0000 Subject: [PATCH 10/90] Included credit for hanekomu. --- lib/Net/FileMaker.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 3668c77..562f535 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -6,7 +6,7 @@ use warnings; use 5.008; use LWP::UserAgent; -use URI::Escape; +use URI; =head1 NAME @@ -18,7 +18,7 @@ Version 0.05 =cut -our $VERSION = "0.05_02"; +our $VERSION = '0.05_02'; =head1 SYNOPSIS @@ -72,6 +72,7 @@ Squeeks, C<< >> =head1 CONTRIBUTORS Simon Cozens, C<> +Marcel Grünauer, C<> =head1 BUGS From 8d7d049062d304e16784d75100d98d26c89b8d84 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 12:06:56 +0000 Subject: [PATCH 11/90] Methods no longer parsing XML themselves, _request handles it + error injection ready pre-merge. --- lib/Net/FileMaker/XML.pm | 55 ++++++++-------------------------------- 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 6f17001..945dcd7 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -15,7 +15,7 @@ Version 0.05 =cut -our $VERSION = "0.05_02"; +our $VERSION = '0.05_02'; =head1 SYNOPSIS @@ -94,20 +94,12 @@ Lists all XML/XSLT enabled databases for a given host. This method requires no a sub dbnames { my $self = shift; - my $res = $self->_request( + my $xml = $self->_request( resultset => $self->{resultset}, query =>'-dbnames' ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - return $self->_compose_arrayref('DATABASE_NAME', $xml->simplify); - } - else - { - return undef; - } + return $self->_compose_arrayref('DATABASE_NAME', $xml); } @@ -130,7 +122,8 @@ sub _request $uri->path($args{resultset}); my $url; - # This kind of defeats the purpose of using URI to begin with, + # This kind of defeats the purpose of using URI to begin with, but this fault has been reported + # on rt.cpan.org for over 2 years and many releases with no fix. if($args{params}) { $uri->query_form(%{$args{params}}); @@ -150,42 +143,16 @@ sub _request my $res = $self->{ua}->request($req); - return $res; + my $xml = $self->{xml}->parse($res->content); + my $xml_data = $xml->simplify; -} - -# _request_xml(query => $query, resultset => $resultset, user => $user, pass => $pass) -# -# Performs the same as _request, except will load and parse the XML itself. Returns a -# hashref containing the parsed XML on success. -sub _request_xml -{ - my($self, %args) = @_; - - my $url = $self->{host}.$self->{resultset}.$args{query}; - - my $req = HTTP::Request->new(GET => $url); - - if($args{user} && $args{pass}) + # Inject localised error message + if($xml_data->{error}->{code} ne '0' && $self->{error}) { - $req->authorization_basic( $args{user}, $args{pass}); + $xml_data->{error}->{message} = $self->{error}->get_string($xml_data->{error}->{code}); } - my $res = $self->{ua}->request($req); - - if($res->is_success) - { - my $xml = XMLin($res->content); - #TODO: Error Handling. - return $xml; - } - else - { - # Shouldn't really return undef, rather... - # TODO: Incorporate the HTTP error codes into the response so - # N::F::Error::HTTP can deal with it. - return undef; - } + return $xml_data; } From 35b9e06d02ca793066648a3b8b84912d2fb91985 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 12:08:22 +0000 Subject: [PATCH 12/90] Huge boiler plate clear out as _request handles XML parsing for us. --- lib/Net/FileMaker/XML/Database.pm | 102 ++++++++++++------------------ 1 file changed, 41 insertions(+), 61 deletions(-) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index d9ce298..6363b12 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -3,8 +3,6 @@ package Net::FileMaker::XML::Database; use strict; use warnings; -use URI::Escape; - our @ISA = qw(Net::FileMaker::XML); # @@ -68,7 +66,7 @@ Returns an arrayref containing layouts accessible for the respective database. sub layoutnames { my $self = shift; - my $res = $self->_request( + my $xml = $self->_request( user => $self->{user}, pass => $self->{pass}, resultset => $self->{resultset}, @@ -77,15 +75,7 @@ sub layoutnames ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - return $self->_compose_arrayref('LAYOUT_NAME', $xml->simplify); - } - else - { - return undef; - } + return $self->_compose_arrayref('LAYOUT_NAME', $xml); } =head2 scriptnames @@ -97,7 +87,7 @@ Returns an arrayref containing scripts accessible for the respective database. sub scriptnames { my $self = shift; - my $res = $self->_request( + my $xml = $self->_request( user => $self->{user}, pass => $self->{pass}, resultset => $self->{resultset}, @@ -106,18 +96,37 @@ sub scriptnames ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - return $self->_compose_arrayref('SCRIPT_NAME', $xml->simplify); - } - else - { - return undef; - } + return $self->_compose_arrayref('SCRIPT_NAME', $xml); +} + +=head2 find(layout => $layout, params => { parameters }) + +Returns a random hashref of rows on a specific database and layout. + +=cut + +sub find +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-find', + params => $args{params} + ); + + return $xml; } + + + =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) Returns all rows on a specific database and layout. @@ -151,7 +160,7 @@ sub findall } } - my $res = $self->_request( + my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, @@ -159,17 +168,7 @@ sub findall params => $params ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - my $xml_data = $xml->simplify; - return $xml_data->{resultset}->{record}; - } - else - { - return $res; - }; - + return $xml; } =head2 findany(layout => $layout, params => { parameters }, nocheck => 1) @@ -205,7 +204,7 @@ sub findany } } - my $res = $self->_request( + my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, @@ -213,23 +212,12 @@ sub findany params => $params ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - my $xml_data = $xml->simplify; - return $xml_data->{resultset}->{record}; - } - else - { - return $res; - }; - + return $xml; } - =head2 total_rows($database, $layout) -Returns a scalar with the total rows for a given database and layout. +Returns a scalar with the total rows for a given layout. =cut @@ -238,21 +226,13 @@ sub total_rows my($self, $layout) = @_; # Just do a findall with 1 record and parse the result. This might break on an empty database. - my $res = $self->_request( - resultset => $self->{resultset}, - query =>'-findall&-max=1&-db='.uri_escape_utf8($self->{db})."&-lay=".uri_escape_utf8($layout) + my $xml = $self->_request( + resultset => $self->{resultset}, + params => {'-db' => $self->{db}, '-lay' => $layout, '-max' => '1' }, + query => '-findall' ); - if($res->is_success) - { - my $xml = $self->{xml}->parse($res->content); - my $xml_data = $xml->simplify; - return $xml_data->{resultset}->{count}; - } - else - { - return undef; - } + return $xml; } From d471067cf34c6f6fa249914f77fe2e3093d454f8 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 12:45:03 +0000 Subject: [PATCH 13/90] Fixed test suite for error strings, thanks to report #6929828 --- t/02_error/01-en.t | 6 +----- t/02_error/02-ja.t | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/t/02_error/01-en.t b/t/02_error/01-en.t index bf7f252..119547e 100644 --- a/t/02_error/01-en.t +++ b/t/02_error/01-en.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 7; use_ok('Net::FileMaker::Error'); @@ -30,7 +30,3 @@ is($xslt_error_10205, 'Message “CC Field” error', 'Returned error string'); my $xslt_error_minusone = $xslt->get_string('-1'); is($xslt_error_minusone, 'Unknown error', 'Returned error string on -1'); - - - -done_testing(); diff --git a/t/02_error/02-ja.t b/t/02_error/02-ja.t index ab397aa..901e282 100644 --- a/t/02_error/02-ja.t +++ b/t/02_error/02-ja.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More; +use Test::More tests => 7; use_ok('Net::FileMaker::Error'); @@ -30,7 +30,3 @@ is($xslt_error_10209, 'メッセージの本文のエラー', 'Returned error st my $xslt_error_minusone = $xslt->get_string('-1'); is($xslt_error_minusone, '原因不明のエラー', 'Returned error string on -1'); - - - -done_testing(); From 3d627a4042bc296e3bdc96faa099610d5b191859 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 14:03:28 +0000 Subject: [PATCH 14/90] Documentation and clean up for 0.06 release --- lib/Net/FileMaker.pm | 4 ++-- lib/Net/FileMaker/Error.pm | 6 +++--- lib/Net/FileMaker/XML.pm | 36 ++++++++++++++++++++++--------- lib/Net/FileMaker/XML/Database.pm | 23 +++++++++----------- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 562f535..8ead8b6 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -14,11 +14,11 @@ Net::FileMaker - Interact with FileMaker services =head1 VERSION -Version 0.05 +Version 0.06 =cut -our $VERSION = '0.05_02'; +our $VERSION = 0.06; =head1 SYNOPSIS diff --git a/lib/Net/FileMaker/Error.pm b/lib/Net/FileMaker/Error.pm index a6d3002..a1ff13f 100644 --- a/lib/Net/FileMaker/Error.pm +++ b/lib/Net/FileMaker/Error.pm @@ -9,18 +9,18 @@ Net::FileMaker::Error - Error strings and codes =head1 SYNOPSIS -Classes within this namespace store the applicable error codes, and the localised strings for them. You don't need to call these modules yourself directly. To enable them, the key "error" must be defined as an ISO 639 short code when you construct your objects with L or a subclass that handles individual interface types like so: +Classes within this namespace store the applicable error codes, and the localised strings for them. You don't call these modules yourself directly. To enable them, the key "error" must be defined as an ISO 639 short code when you construct your objects with L or a subclass that handles individual interface types like so: use Net::FileMaker; my $fms = Net::FileMaker->new(host => $host, error => 'en'); =head1 LANGUAGES SUPPORTED -At present only English and Japanese are supported, but the eventual goal is to cover all languages presently documented by FileMaker which is over a dozen and includes German, French and Japanese. +English, Japanese and German are presently supported with the aims of covering all languages documented by FileMaker in the future. =cut -# new( lang => $lang, type => $type +# new( lang => $lang, type => $type) # # Creates a new object. There is no inheritance in the Error classes, mearly factory objects. # Both the language (in ISO 639) and type (XML/XSLT/IWP etc) needs be defined. Returns undef if diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 945dcd7..f1e8690 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -3,6 +3,8 @@ package Net::FileMaker::XML; use strict; use warnings; +use Net::FileMaker::Error; + use XML::Twig; =head1 NAME @@ -11,11 +13,11 @@ Net::FileMaker::XML - Interact with FileMaker Server's XML Interface. =head1 VERSION -Version 0.05 +Version 0.06 =cut -our $VERSION = '0.05_02'; +our $VERSION = 0.06; =head1 SYNOPSIS @@ -29,10 +31,13 @@ key in the constructor as "xml": my $fms = Net::FileMaker->new(host => $host, type => 'xml'); It's also possible to call this module directly: - + + use Net::FileMaker::XML; + my $fms = Net::FileMaker::XML->new(host => $host); + my $dbnames = $fms->dbnames; - my $fmdb = $fms->database(); + my $fmdb = $fms->database(db => $db, user => $user, pass => $pass); =head1 METHODS @@ -61,6 +66,11 @@ sub new resultset => '/fmi/xml/fmresultset.xml', # Entirely for dbnames(); }; + if($args{error}) + { + $self->{error} = Net::FileMaker::Error->new(lang => $args{error}, type => 'XML'); + } + return bless $self; } @@ -77,17 +87,17 @@ sub database require Net::FileMaker::XML::Database; return Net::FileMaker::XML::Database->new( - host => $self->{host}, - db => $args{db}, - user => $args{user} || '', - pass => $args{pass} || '' + host => $self->{host}, + db => $args{db}, + user => $args{user} || '', + pass => $args{pass} || '' ); } =head2 dbnames -Lists all XML/XSLT enabled databases for a given host. This method requires no authentication. +Returns an arrayref containing all XML/XSLT enabled databases for a given host. This method requires no authentication. =cut @@ -103,6 +113,12 @@ sub dbnames } +=head1 COMPATIBILITY + +This distrobution is tested against FileMaker Advanced Server 10.0.1.59 and shortly testing will commence against version 11. +Older versions are not tested at present, but feedback is welcome. See the messages present in the test suite on how to setup +tests against your server. + =head1 SEE ALSO L @@ -147,7 +163,7 @@ sub _request my $xml_data = $xml->simplify; # Inject localised error message - if($xml_data->{error}->{code} ne '0' && $self->{error}) + if($self->{error}) { $xml_data->{error}->{message} = $self->{error}->get_string($xml_data->{error}->{code}); } diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 6363b12..95fca4c 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -24,15 +24,16 @@ Net::FileMaker::XML::Database =head1 SYNOPSIS -This module handles all the tasks with XML data. +This module handles all the tasks with XML data. Don't call this module directly, instead use L. use Net::FileMaker::XML; - my $fm = Net::FileMaker::XML->new(); + my $fm = Net::FileMaker::XML->new(host => $host); my $db = $fm->database(db => $db, user => $user, pass => $pass); my $layouts = $db->layoutnames; my $scripts = $db->scriptnames; - + my $records = $db->findall( layout => $layout, params => { '-max' => '10'}); + my $records = $db->findany( layout => $layout, params => { '-skip' => '10'}); =head1 METHODS @@ -50,8 +51,7 @@ sub new resultset => '/fmi/xml/fmresultset.xml', ua => LWP::UserAgent->new, xml => XML::Twig->new, - uri => URI->new($args{host}) - + uri => URI->new($args{host}), }; return bless $self; @@ -101,7 +101,7 @@ sub scriptnames =head2 find(layout => $layout, params => { parameters }) -Returns a random hashref of rows on a specific database and layout. +Returns a hashref of rows on a specific database and layout. =cut @@ -124,9 +124,6 @@ sub find } - - - =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) Returns all rows on a specific database and layout. @@ -173,7 +170,7 @@ sub findall =head2 findany(layout => $layout, params => { parameters }, nocheck => 1) -Returns a random hashref of rows on a specific database and layout. +Returns a hashref of random rows on a specific database and layout. nocheck is an optional argument that will skip checking of parameters if set to 1. @@ -215,7 +212,7 @@ sub findany return $xml; } -=head2 total_rows($database, $layout) +=head2 total_rows(layout => $layout) Returns a scalar with the total rows for a given layout. @@ -223,12 +220,12 @@ Returns a scalar with the total rows for a given layout. sub total_rows { - my($self, $layout) = @_; + my($self, %args) = @_; # Just do a findall with 1 record and parse the result. This might break on an empty database. my $xml = $self->_request( resultset => $self->{resultset}, - params => {'-db' => $self->{db}, '-lay' => $layout, '-max' => '1' }, + params => {'-db' => $self->{db}, '-lay' => $args{layout}, '-max' => '1' }, query => '-findall' ); From c788b0eb2e93e6c9e05930570accf9461f64fa6f Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 15 Mar 2010 14:03:49 +0000 Subject: [PATCH 15/90] MANIFEST and changelog brought up to date --- Changes | 6 +++++- MANIFEST | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 9164f57..94c4ec0 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Revision history for Net::FileMaker -0.06 2010-03-04 +0.06 2010-03-15 + + Localised Error strings in English, Japanese and German + + Huge amounts of boilerplate removed + +0.05 2010-03-04 + Significant changes to the entire structure of the distrobution, and as such the interface has also changed, So please check the documentation. + XML::Simple has been dropped for XML::Twig diff --git a/MANIFEST b/MANIFEST index 83b81bb..afd2e33 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,6 +5,12 @@ README lib/Net/FileMaker.pm lib/Net/FileMaker/XML.pm lib/Net/FileMaker/XML/Database.pm +lib/Net/FileMaker/Error.pm +lib/Net/FileMaker/Error/EN/XML.pm +lib/Net/FileMaker/Error/EN/XSLT.pm +lib/Net/FileMaker/Error/JA/XML.pm +lib/Net/FileMaker/Error/JA/XSLT.pm +lib/Net/FileMaker/Error/DE/XML.pm t/00_load/00-net-filemaker.t t/01_xml/00-load.t t/01_xml/01-dbnames.t @@ -12,5 +18,8 @@ t/01_xml/02-layoutnames.t t/01_xml/03-scriptnames.t t/01_xml/04-findall.t t/01_xml/05-findany.t +t/02_error/00-load.t +t/02_error/01-en.t +t/02_error/02-ja.t t/manifest.t t/pod.t From fb32c4f6976d97dccec47400034b6025c56b9604 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 7 Apr 2010 16:09:51 +0100 Subject: [PATCH 16/90] Fixed significant bug where total_rows did not send authentication. --- lib/Net/FileMaker/XML/Database.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 95fca4c..c7b4f50 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -224,6 +224,8 @@ sub total_rows # Just do a findall with 1 record and parse the result. This might break on an empty database. my $xml = $self->_request( + user => $self->{user}, + pass => $self->{pass}, resultset => $self->{resultset}, params => {'-db' => $self->{db}, '-lay' => $args{layout}, '-max' => '1' }, query => '-findall' From 82e39a9b784e38d82a6e1addfc195e02d9e444f2 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 7 Apr 2010 18:17:33 +0100 Subject: [PATCH 17/90] Preparing for new release, looks like versioning modules was a bad, bad idea. Have ot keep them all up to date. --- Changes | 3 +++ lib/Net/FileMaker.pm | 4 ++-- lib/Net/FileMaker/XML.pm | 4 ++-- lib/Net/FileMaker/XML/Database.pm | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 94c4ec0..f2ab786 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ Revision history for Net::FileMaker +0.062 2010-04-07 + + Minor Bugfixes + + Enhancements to the test suite 0.06 2010-03-15 + Localised Error strings in English, Japanese and German diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 8ead8b6..03a3c2b 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -14,11 +14,11 @@ Net::FileMaker - Interact with FileMaker services =head1 VERSION -Version 0.06 +Version 0.062 =cut -our $VERSION = 0.06; +our $VERSION = 0.062; =head1 SYNOPSIS diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index f1e8690..3ed05f9 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -13,11 +13,11 @@ Net::FileMaker::XML - Interact with FileMaker Server's XML Interface. =head1 VERSION -Version 0.06 +Version 0.062 =cut -our $VERSION = 0.06; +our $VERSION = 0.062; =head1 SYNOPSIS diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index c7b4f50..3155967 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -20,8 +20,14 @@ my $acceptable_params = { Net::FileMaker::XML::Database +=head1 VERSION + +Version 0.062 + =cut +our $VERSION = 0.062; + =head1 SYNOPSIS This module handles all the tasks with XML data. Don't call this module directly, instead use L. From a029a31bae532adbe1223ac387bcf15f9332fa4f Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 8 Apr 2010 09:46:29 +0100 Subject: [PATCH 18/90] Fixed bug with _compose_arrayref and data being supplied as a hash. --- lib/Net/FileMaker/XML.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 3ed05f9..f73656d 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -184,7 +184,7 @@ sub _compose_arrayref if(ref($xml->{resultset}->{record}) eq 'HASH') { - return $xml->{resultset}->{record}->{field}->{data}; + return $xml->{resultset}->{record}->{field}->{$fieldname}->{data}; } elsif(ref($xml->{resultset}->{record}) eq 'ARRAY') { From 1f667d4f7733334b8fe07a897bcdbd76a15c573a Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 8 Apr 2010 09:52:50 +0100 Subject: [PATCH 19/90] Updated documentation as we are now testing against Advanced Server 11. --- lib/Net/FileMaker/XML.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index f73656d..a21a3f5 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -115,7 +115,7 @@ sub dbnames =head1 COMPATIBILITY -This distrobution is tested against FileMaker Advanced Server 10.0.1.59 and shortly testing will commence against version 11. +This distrobution is actively tested against FileMaker Advanced Server 10.0.1.59 and 11.0.1.95. Older versions are not tested at present, but feedback is welcome. See the messages present in the test suite on how to setup tests against your server. From 7c12be427e0ca0b2f2dbba51330503a8b5d4e1bd Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 8 Apr 2010 10:25:52 +0100 Subject: [PATCH 20/90] Adding utf8 pod header into Net::FileMaker since various non-latin (ie MARCEL's name) doesn't render properly, sometimes. --- lib/Net/FileMaker.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 03a3c2b..663310e 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -8,6 +8,8 @@ use 5.008; use LWP::UserAgent; use URI; +=encoding utf8 + =head1 NAME Net::FileMaker - Interact with FileMaker services From 88adbc04f0cab34131f0d963bbb05a447dac7769 Mon Sep 17 00:00:00 2001 From: michele ongaro Date: Wed, 5 Jan 2011 17:29:12 +0100 Subject: [PATCH 21/90] created resultset branch testing addition of errors' localization files in italian --- lib/Net/FileMaker/Error/IT/XML.pm | 259 +++++++++++++++++++++++++++++ lib/Net/FileMaker/Error/IT/XSLT.pm | 75 +++++++++ 2 files changed, 334 insertions(+) create mode 100644 lib/Net/FileMaker/Error/IT/XML.pm create mode 100644 lib/Net/FileMaker/Error/IT/XSLT.pm diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm new file mode 100644 index 0000000..35263ab --- /dev/null +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -0,0 +1,259 @@ +package Net::FileMaker::Error::IT::XML; + +use strict; +use warnings; + +=head1 NAME + +Net::FileMaker::Error::EN::XML - Error strings for FileMaker Server XML interface in English. + +=head1 INFO + +The error codes supported by this module were plucked from the FileMaker documentation on XML/XSLT, and appear valid for FileMaker Server 10. + +=head1 SEE ALSO + +L + +=cut + +my $error_codes = { + + '-1' => 'Unknown error', + 0 => 'No error', + 1 => "User canceled action ", + 2 => "Memory error ", + 3 => "Command is unavailable (for example, wrong operating system, wrong mode, etc.)", + 4 => "Command is unknown", + 5 => "Command is invalid (for example, a Set Field script step does not have a calculation specified)", + 6 => "File is read-only", + 7 => "Running out of memory", + 8 => "Empty result", + 9 => "Insufficient privileges", + 10 => "Requested data is missing", + 11 => "Name is not valid", + 12 => "Name already exists", + 13 => "File or object is in use", + 14 => "Out of range", + 15 => "Can’t divide by zero", + 16 => "Operation failed, request retry (for example, a user query)", + 17 => "Attempt to convert foreign character set to UTF-16 failed", + 18 => "Client must provide account information to proceed", + 19 => "String contains characters other than A-Z, a-z, 0-9 (ASCII)", + 20 => "Command or operation cancelled by triggered script", + 100 => "File is missing", + 101 => "Record is missing", + 102 => "Field is missing", + 103 => "Relationship is missing", + 104 => "Script is missing", + 105 => "Layout is missing", + 106 => "Table is missing", + 107 => "Index is missing", + 108 => "Value list is missing", + 109 => "Privilege set is missing", + 110 => "Related tables are missing", + 111 => "Field repetition is invalid", + 112 => "Window is missing", + 113 => "Function is missing", + 114 => "File reference is missing", + 115 => "The menu set is missing", + 116 => "The layout object is missing", + 117 => "The data source is missing", + 130 => "Files are damaged or missing and must be reinstalled", + 131 => "Language pack files are missing (such as template files)", + 200 => "Record access is denied", + 201 => "Field cannot be modified", + 202 => "Field access is denied", + 203 => "No records in file to print, or password doesn’t allow print access", + 204 => "No access to field(s) in sort order", + 205 => "User does not have access privileges to create new records; import will overwrite existing data", + 206 => "User does not have password change privileges, or file is not modifiable", + 207 => "User does not have sufficient privileges to change database schema, or file is not modifiable", + 208 => "Password does not contain enough characters", + 209 => "New password must be different from existing one", + 210 => "User account is inactive", + 211 => "Password has expired", + 212 => "Invalid user account and/or password. Please try again", + 213 => "User account and/or password does not exist", + 214 => "Too many login attempts", + 215 => "Administrator privileges cannot be duplicated", + 216 => "Guest account cannot be duplicated", + 217 => "User does not have sufficient privileges to modify administrator account", + 300 => "File is locked or in use", + 301 => "Record is in use by another user", + 302 => "Table is in use by another user", + 303 => "Database schema is in use by another user", + 304 => "Layout is in use by another user", + 306 => "Record modification ID does not match", + 400 => "Find criteria are empty", + 401 => "No records match the request", + 402 => "Selected field is not a match field for a lookup", + 403 => "Exceeding maximum record limit for trial version of FileMaker Pro", + 404 => "Sort order is invalid", + 405 => "Number of records specified exceeds number of records that can be omitted", + 406 => "Replace/Reserialize criteria are invalid", + 407 => "One or both match fields are missing (invalid relationship)", + 408 => "Specified field has inappropriate data type for this operation", + 409 => "Import order is invalid", + 410 => "Export order is invalid", + 412 => "Wrong version of FileMaker Pro used to recover file", + 413 => "Specified field has inappropriate field type", + 414 => "Layout cannot display the result", + 415 => "One or more required related records are not available", + 416 => "A primary key is required from the data source table", + 417 => "The database is not a supported data source", + 500 => "Date value does not meet validation entry options", + 501 => "Time value does not meet validation entry options", + 502 => "Number value does not meet validation entry options", + 503 => "Value in field is not within the range specified in validation entry options", + 504 => "Value in field is not unique as required in validation entry options", + 505 => "Value in field is not an existing value in the database file as required in validation entry options", + 506 => "Value in field is not listed on the value list specified in validation entry option", + 507 => "Value in field failed calculation test of validation entry option", + 508 => "Invalid value entered in Find mode", + 509 => "Field requires a valid value", + 510 => "Related value is empty or unavailable", + 511 => "Value in field exceeds maximum number of allowed characters", + 512 => "The record was already modified by another user", + 513 => "To create a record, the record has to have a value in at least one field", + 600 => "Print error has occurred", + 601 => "Combined header and footer exceed one page", + 602 => "Body doesn’t fit on a page for current column setup", + 603 => "Print connection lost", + 700 => "File is of the wrong file type for import", + 706 => "EPSF file has no preview image", + 707 => "Graphic translator cannot be found", + 708 => "Can’t import the file or need color monitor support to import file", + 709 => "QuickTime movie import failed", + 710 => "Unable to update QuickTime file reference because the database file is read-only", + 711 => "Import translator cannot be found", + 714 => "Password privileges do not allow the operation", + 715 => "Specified Excel worksheet or named range is missing", + 716 => "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import", + 717 => "There is not enough XML/XSL information to proceed with the import or export", + 718 => "Error in parsing XML file (from Xerces)", + 719 => "Error in transforming XML using XSL (from Xalan)", + 720 => "Error when exporting; intended format does not support repeating fields", + 721 => "Unknown error occurred in the parser or the transformer", + 722 => "Cannot import data into a file that has no fields", + 723 => "You do not have permission to add records to or modify records in the target table", + 724 => "You do not have permission to add records to the target table", + 725 => "You do not have permission to modify records in the target table", + 726 => "There are more records in the import file than in the target table. Not all records were imported", + 727 => "There are more records in the target table than in the import file. Not all records were updated", + 729 => "Errors occurred during import. Records could not be imported", + 730 => "Unsupported Excel version. Convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again.", + 731 => "The file you are importing from contains no data", + 732 => "This file cannot be inserted because it contains other files", + 733 => "A table cannot be imported into itself", + 734 => "This file type cannot be displayed as a picture", + 735 => "This file type cannot be displayed as a picture. It will be inserted and displayed as a file", + 736 => "There is too much data to be exported to this format. It will be truncated", + 800 => "Unable to create file on disk", + 801 => "Unable to create temporary file on System disk", + 802 => "Unable to open file. This error can be caused by one or more of the following: invalid database name, the file is closed in FileMaker Server or invalid permission", + 803 => "File is single user or host cannot be found", + 804 => "File cannot be opened as read-only in its current state", + 805 => "File is damaged; use Recover command", + 806 => "File cannot be opened with this version of FileMaker Pro", + 807 => "File is not a FileMaker Pro file or is severely damaged", + 808 => "Cannot open file because access privileges are damaged", + 809 => "Disk/volume is full", + 810 => "Disk/volume is locked", + 811 => "Temporary file cannot be opened as FileMaker Pro file", + 813 => "Record Synchronization error on network", + 814 => "File(s) cannot be opened because maximum number is open", + 815 => "Couldn’t open lookup file", + 816 => "Unable to convert file", + 817 => "Unable to open file because it does not belong to this solution", + 819 => "Cannot save a local copy of a remote file", + 820 => "File is in the process of being closed", + 821 => "Host forced a disconnect", + 822 => "FMI files not found; reinstall missing files", + 823 => "Cannot set file to single-user, guests are connected", + 824 => "File is damaged or not a FileMaker file", + 900 => "General spelling engine error", + 901 => "Main spelling dictionary not installed", + 902 => "Could not launch the Help system", + 903 => "Command cannot be used in a shared file", + 904 => "Command can only be used in a file hosted under FileMaker Server", + 905 => "No active field selected; command can only be used if there is an active field", + 906 => "The current file is not shared; command can be used only if the file is shared", + 920 => "Can’t initialize the spelling engine", + 921 => "User dictionary cannot be loaded for editing", + 922 => "User dictionary cannot be found", + 923 => "User dictionary is read-only", + 951 => "An unexpected error occurred", + 954 => "Unsupported XML grammar", + 955 => "No database name", + 956 => "Maximum number of database sessions exceeded", + 957 => "Conflicting commands", + 958 => "Parameter missing in query", + 1200 => "Generic calculation error", + 1201 => "Too few parameters in the function", + 1202 => "Too many parameters in the function", + 1203 => "Unexpected end of calculation", + 1204 => "Number, text constant, field name or '(' expected", + 1205 => "Comment is not terminated with '*/'", + 1206 => "Text constant must end with a quotation mark", + 1207 => "Unbalanced parenthesis", + 1208 => "Operator missing, function not found or '(' not expected", + 1209 => "Name (such as field name or layout name) is missing", + 1210 => "Plug-in function has already been registered", + 1211 => "List usage is not allowed in this function", + 1212 => "An operator (for example, +, -, *) is expected here", + 1213 => "This variable has already been defined in the Let function", + 1214 => "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed", + 1215 => "This parameter is an invalid Get function parameter", + 1216 => "Only Summary fields allowed as first argument in GETSUMMARY", + 1217 => "Break field is invalid", + 1218 => "Cannot evaluate the number", + 1219 => "A field cannot be used in its own formula", + 1220 => "Field type must be normal or calculated", + 1221 => "Data type must be number, date, time, or timestamp", + 1222 => "Calculation cannot be stored", + 1223 => "The function referred to is not yet implemented", + 1224 => "The function referred to does not exist", + 1225 => "The function referred to is not supported in this context", + 1400 => "ODBC client driver initialization failed; make sure the ODBC client drivers are properly installed.", + 1401 => "Failed to allocate environment (ODBC)", + 1402 => "Failed to free environment (ODBC)", + 1403 => "Failed to disconnect (ODBC)", + 1404 => "Failed to allocate connection (ODBC)", + 1405 => "Failed to free connection (ODBC)", + 1406 => "Failed check for SQL API (ODBC)", + 1407 => "Failed to allocate statement (ODBC)", + 1408 => "Extended error (ODBC)", + 1409 => "Extended error (ODBC)", + 1410 => "Extended error (ODBC)", + 1411 => "Extended error (ODBC)", + 1412 => "Extended error (ODBC)", + 1413 => "Extended error (ODBC)", + 1450 => "Action requires PHP privilege extension", + 1451 => "Action requires that current file be remote", + 1501 => "SMTP authentication failed", + 1502 => "Connection refused by SMTP server", + 1503 => "Error with SSL", + 1504 => "SMTP server requires the connection to be encrypted", + 1505 => "Specified authentication is not supported by SMTP server", + 1506 => "Email message(s) could not be sent successfully", + 1507 => "Unable to log in to the SMTP server" + +}; + +sub new +{ + my $class = shift; + $class = ref($class) || $class; + + my $self = { }; + return bless $self, $class; +} + +sub get_string +{ + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; +} + +1; # End of Net::FileMaker::Error::EN::XML diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm new file mode 100644 index 0000000..5773471 --- /dev/null +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -0,0 +1,75 @@ +package Net::FileMaker::Error::IT::XSLT; + +use strict; +use warnings; + +=head1 NAME + +Net::FileMaker::Error::EN::XML - Error strings for FileMaker Server XSLT interface in English. + +=head1 INFO + +The error codes supported by this module were plucked from the FileMaker documentation on XML/XSLT, and appear valid for FileMaker Server 10. + +=head1 SEE ALSO + +L + +=cut + +my $error_codes = { + + '-1' => "Unknown error", + 0 => "No error", + 10000 => "Invalid header name", + 10001 => "Invalid HTTP status code", + 10100 => "Unknown session error", + 10101 => "Requested session name is already used", + 10102 => "Session could not be accessed - maybe it does not exist", + 10103 => "Session has timed out", + 10104 => "Specified session object does not exist", + 10200 => "Unknown messaging error", + 10201 => "Message formatting error", + 10202 => "Message SMTP fields error", + 10203 => "Message “To Field” error", + 10204 => "Message “From Field” error", + 10205 => "Message “CC Field” error", + 10206 => "Message “BCC Field” error", + 10207 => "Message “Subject Field” error", + 10208 => "Message “Reply-To Field” error", + 10209 => "Message body error", + 10210 => "Recursive mail error - attempted to call send_email() inside an email XSLT stylesheet", + 10211 => "SMTP authentication error - either login failed or wrong type of authentication provided", + 10212 => "Invalid function usage - attempted to call set_header(), set_status_code() or set_cookie() inside an email XSLT stylesheet", + 10213 => "SMTP server is invalid or is not working.", + 10300 => "Unknown formatting error", + 10301 => "Invalid date time format", + 10302 => "Invalid date format", + 10303 => "Invalid time format", + 10304 => "Invalid day format", + 10305 => "Improperly formatted date time string", + 10306 => "Improperly formatted date string", + 10307 => "Improperly formatted time string", + 10308 => "Improperly formatted day string", + 10309 => "Unsupported text encoding", + 10310 => "Invalid URL encoding", + 10311 => "Regular expression pattern error" + +}; + +sub new +{ + my $class = shift; + $class = ref($class) || $class; + + my $self = { }; + return bless $self, $class; +} + +sub get_string +{ + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; +} + +1; # End of Net::FileMaker::Error::EN::XSLT From 05b1f656bccc2b205856b921dc1f0bc655cb3da3 Mon Sep 17 00:00:00 2001 From: michele ongaro Date: Mon, 10 Jan 2011 12:36:51 +0100 Subject: [PATCH 22/90] added N::F::X::ResultSet N::F::X::ResultSet::FieldsDefinition N::F::X::ResultSet::FieldsDefinition::Field begun to add tests --- lib/Net/FileMaker/XML/ResultSet.pm | 116 ++++++++++++++ .../XML/ResultSet/FieldsDefinition.pm | 94 ++++++++++++ .../XML/ResultSet/FieldsDefinition/Field.pm | 142 ++++++++++++++++++ lib/Net/FileMaker/XML/ResultSet/Result.pm | 0 lib/Net/FileMaker/XML/ResultSet/Row.pm | 0 t/02_error/03-it.t | 32 ++++ t/03_resultset/00-load.t | 13 ++ 7 files changed, 397 insertions(+) create mode 100644 lib/Net/FileMaker/XML/ResultSet.pm create mode 100644 lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm create mode 100644 lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm create mode 100644 lib/Net/FileMaker/XML/ResultSet/Result.pm create mode 100644 lib/Net/FileMaker/XML/ResultSet/Row.pm create mode 100644 t/02_error/03-it.t create mode 100644 t/03_resultset/00-load.t diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm new file mode 100644 index 0000000..466af41 --- /dev/null +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -0,0 +1,116 @@ +package Net::FileMaker::XML::ResultSet; + +use strict; +use warnings; +use Moose; +use Net::FileMaker::XML; + +require Exporter; +use AutoLoader qw(AUTOLOAD); + +our @ISA = qw(Exporter Net::FileMaker::XML); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +our @EXPORT_OK = ( ); + +our @EXPORT = qw( + + +); + +=head1 NAME + +Net::FileMaker::XML::ResultSet + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = 0.01; + +=head1 SYNOPSIS + +This module handles the hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. + +=head1 METHODS + +=cut + +sub new +{ + my($class, $res_hash) = @_; + + my $self = { + _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + # these are the references to the parsed blocks + _field_def => undef, + _resultset => undef, + _datasource => undef, + _product => undef, + _version => undef, + _xmlns => undef + }; + bless $self; + + # let's begin the parsing + $self->_parse; + + return $self; +} + +# _parse +# calls all the methods that parse the single blocks of the response + +sub _parse +{ + my $self = shift; + # parse the resultset + $self->_parse_field_definition; +} + +# _parse_field_definition +# parses the field definition instantiating a N::F::X::D::FieldDefinition + +sub _parse_field_definition +{ + my ($self) = @_; + require Net::FileMaker::XML::ResultSet::FieldsDefinition; + $self->{_field_def} = new Net::FileMaker::XML::ResultSet::FieldsDefinition($self->{_res_hash}{metadata}{'field-definition'}); +} + +=head2 fields_definition + + returns the fields definition + +=cut + +sub fields_definition +{ + my $self = shift; + return $self->{_field_def}->fields; +} + +=head2 datasource + +=item * 'database' # database file name +=item * 'layout' # kind of layout, eg. 'List' +=item * 'timestamp-format' # eg. 'MM/dd/yyyy HH:mm:ss', +=item * 'date-format' # eg. 'MM/dd/yyyy', +=item * 'time-format' # eg. 'HH:mm:ss', +=item * 'table' # name of the selected database table, +=item * 'total-count' # total count of the records in the selected table + +=cut + +sub fields_definition +{ + my $self = shift; + return $self->{_field_def}->fields; +} + +1; # End of Net::FileMaker::XML::Database; +__END__ \ No newline at end of file diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm new file mode 100644 index 0000000..56007e6 --- /dev/null +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -0,0 +1,94 @@ +package Net::FileMaker::XML::ResultSet::FieldsDefinition; + +use strict; +use warnings; +use Moose; + + +require Exporter; +use AutoLoader qw(AUTOLOAD); + +our @ISA = qw(Exporter Net::FileMaker::XML); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +our @EXPORT_OK = ( ); + +our @EXPORT = qw( + + +); + +=head1 NAME + +Net::FileMaker::XML::ResultSet::FieldsDefinition + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = 0.01; + +=head1 SYNOPSIS + +This module handles the field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. + +=head1 METHODS + +=cut + +sub new +{ + my($class, $res_hash) = @_; + + my $self = { + _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + # these are the references to the parsed blocks + }; + bless $self; + $self->_parse; + return $self; +} + +# _parse +# + +sub _parse{ + my $self = shift; + my %fields; + require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + foreach my $key (sort keys %{$self->{_res_hash}}) { + $fields{$key} = new Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + } + $self->{fields} = \%fields; +} + +=head2 get('field') + + returns the field definition object (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) + +=cut + +sub get +{ + my ( $self, $field ) = @_; + return $self->{fields}{$field}; +} + +=head2 fields + + returns an hash with the field definition objects (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) + +=cut + +sub fields +{ + my ( $self, $field ) = @_; + return $self->{fields}; +} + +1; +__END__ \ No newline at end of file diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm new file mode 100644 index 0000000..3e45f9a --- /dev/null +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -0,0 +1,142 @@ +package Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + +use strict; +use warnings; +use Moose; +use Carp; + +require Exporter; +use AutoLoader qw(AUTOLOAD); + +our @ISA = qw(Exporter Net::FileMaker::XML); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +our @EXPORT_OK = ( ); + +our @EXPORT = qw( + + +); + +=head1 NAME + +Net::FileMaker::XML::ResultSet::FieldsDefinition::Field + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = 0.01; + +=head1 SYNOPSIS + +This module handles the single field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. + +=head1 METHODS + +=cut + +sub new +{ + my($class, $res_hash) = @_; + + my $self = { + _res_hash => $res_hash, + global => undef, + numeric_only => undef, + four_digit_year => undef, + not_empty => undef, + auto_enter => undef, + type => undef, + time_of_day => undef, + max_repeat => undef, + result => undef + }; + bless $self; + $self->_parse; + return $self; +} + +# _parse +# + + + +#The attributes specify: +# whether the field is an auto-enter field (“yes” or “no”) +# whether the field is a four-digit-year field (“yes” or “no) +# whether it is a global field (“yes” or “no”) +# the maximum number of repeating values (max-repeat attribute) +# the maximum number of characters allowed (max-characters attribute) +# whether it is a not-empty field (“yes” or “no”) +# whether it is for numeric data only (“yes” or “no”) +# result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) +# whether it is a time-of-day field (“yes” or “no”) +# type (“normal”, “calculation”, or “summary” + + +sub _parse +{ + my $self = shift; + $self->{global} = $self->{_res_hash}{global} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{global} ; + $self->{numeric_only} = $self->{_res_hash}{'numeric-only'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'numeric-only'}; + $self->{four_digit_year} = $self->{_res_hash}{'four-digit-year'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'four-digit-year'}; + $self->{not_empty} = $self->{_res_hash}{'not-empty'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'not-empty'}; + $self->{auto_enter} = $self->{_res_hash}{'auto-enter'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'auto-enter'}; + $self->{type} = $self->{_res_hash}{type} if defined $self->{_res_hash}{type}; + $self->{time_of_day} = $self->{_res_hash}{'time-of-day'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'time-of-day'}; + $self->{max_repeat} = $self->{_res_hash}{'max-repeat'} if defined $self->{_res_hash}{'max-repeat'}; + $self->{max_characters} = $self->{_res_hash}{'max-characters'} if defined $self->{_res_hash}{'max-characters'}; + $self->{result} = $self->{_res_hash}{result} if defined $self->{_res_hash}{result}; +} + +=head2 get('field') + +returns the value for the passed parameter + +the accepted params are ( possible results in parentheses ): +=over 4 + +=item * global (0,1) +=item * numeric_only (0,1) +=item * four_digit_year (0,1) +=item * not_empty (0,1) +=item * auto_enter (0,1) +=item * type (“normal”, “calculation”, or “summary”) +=item * time_of_day (0,1) +=item * max_repeat (int) +=item * max_characters (int) +=item * result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) + +=cut + +my @availables = qw( global numeric_only four_digit_year not_empty auto_enter type time_of_day max_repeat max_characters result ); + +sub get +{ + my ( $self, $par ) = @_; + + croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); + return $self->{$par}; +} + +=head2 get_all + + returns a reference to an hash with all the parameters of this field + +=cut + +sub get_all +{ + my $self = shift; + my %tmp = map { $_ => $self->{$_} } @availables; + return \%tmp; +} + + +1; +__END__ \ No newline at end of file diff --git a/lib/Net/FileMaker/XML/ResultSet/Result.pm b/lib/Net/FileMaker/XML/ResultSet/Result.pm new file mode 100644 index 0000000..e69de29 diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm new file mode 100644 index 0000000..e69de29 diff --git a/t/02_error/03-it.t b/t/02_error/03-it.t new file mode 100644 index 0000000..8900ec3 --- /dev/null +++ b/t/02_error/03-it.t @@ -0,0 +1,32 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 7; + +use_ok('Net::FileMaker::Error'); + +# +# XML Errors +# +my $xml = Net::FileMaker::Error->new(lang => 'it', type => 'xml'); +ok($xml, 'Net::FileMaker::Error loaded XML strings in Italian'); + +my $xml_error_210 = $xml->get_string('210'); +is($xml_error_210, 'Account utente inattivo', 'Returned error string'); + +my $xml_error_minusone = $xml->get_string('-1'); +is($xml_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); + +# +# XSLT Errors +# +my $xslt = Net::FileMaker::Error->new(lang => 'en', type => 'xslt'); +ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in English'); + +my $xslt_error_10205 = $xslt->get_string('10205'); +is($xslt_error_10205, 'Errore “CC Field”', 'Returned error string'); + +my $xslt_error_minusone = $xslt->get_string('-1'); +is($xslt_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); diff --git a/t/03_resultset/00-load.t b/t/03_resultset/00-load.t new file mode 100644 index 0000000..eff6f8d --- /dev/null +++ b/t/03_resultset/00-load.t @@ -0,0 +1,13 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 1; + +BEGIN +{ + use_ok( 'Net::FileMaker::XML::ResultSet' ); +} + +diag( "Testing Net::FileMaker::XML::ResultSet, Perl $], $^X" ); From b2c6776d3d1bba9c2088440ed3a269390aac0eb4 Mon Sep 17 00:00:00 2001 From: michele ongaro Date: Mon, 10 Jan 2011 13:47:28 +0100 Subject: [PATCH 23/90] completed translation of the error modules ( both XML and XSLT ) in Italian minor changes in FieldsDefinition::Field added method \"datasource\" to ResultSet --- lib/Net/FileMaker/Error/IT/XML.pm | 444 +++++++++--------- lib/Net/FileMaker/Error/IT/XSLT.pm | 74 +-- lib/Net/FileMaker/XML/ResultSet.pm | 4 +- .../XML/ResultSet/FieldsDefinition/Field.pm | 45 +- 4 files changed, 280 insertions(+), 287 deletions(-) diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm index 35263ab..a6cf727 100644 --- a/lib/Net/FileMaker/Error/IT/XML.pm +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -5,7 +5,7 @@ use warnings; =head1 NAME -Net::FileMaker::Error::EN::XML - Error strings for FileMaker Server XML interface in English. +Net::FileMaker::Error::EN::XML - Error strings for FileMaker Server XML interface in Italian. =head1 INFO @@ -18,226 +18,226 @@ L =cut my $error_codes = { - - '-1' => 'Unknown error', - 0 => 'No error', - 1 => "User canceled action ", - 2 => "Memory error ", - 3 => "Command is unavailable (for example, wrong operating system, wrong mode, etc.)", - 4 => "Command is unknown", - 5 => "Command is invalid (for example, a Set Field script step does not have a calculation specified)", - 6 => "File is read-only", - 7 => "Running out of memory", - 8 => "Empty result", - 9 => "Insufficient privileges", - 10 => "Requested data is missing", - 11 => "Name is not valid", - 12 => "Name already exists", - 13 => "File or object is in use", - 14 => "Out of range", - 15 => "Can’t divide by zero", - 16 => "Operation failed, request retry (for example, a user query)", - 17 => "Attempt to convert foreign character set to UTF-16 failed", - 18 => "Client must provide account information to proceed", - 19 => "String contains characters other than A-Z, a-z, 0-9 (ASCII)", - 20 => "Command or operation cancelled by triggered script", - 100 => "File is missing", - 101 => "Record is missing", - 102 => "Field is missing", - 103 => "Relationship is missing", - 104 => "Script is missing", - 105 => "Layout is missing", - 106 => "Table is missing", - 107 => "Index is missing", - 108 => "Value list is missing", - 109 => "Privilege set is missing", - 110 => "Related tables are missing", - 111 => "Field repetition is invalid", - 112 => "Window is missing", - 113 => "Function is missing", - 114 => "File reference is missing", - 115 => "The menu set is missing", - 116 => "The layout object is missing", - 117 => "The data source is missing", - 130 => "Files are damaged or missing and must be reinstalled", - 131 => "Language pack files are missing (such as template files)", - 200 => "Record access is denied", - 201 => "Field cannot be modified", - 202 => "Field access is denied", - 203 => "No records in file to print, or password doesn’t allow print access", - 204 => "No access to field(s) in sort order", - 205 => "User does not have access privileges to create new records; import will overwrite existing data", - 206 => "User does not have password change privileges, or file is not modifiable", - 207 => "User does not have sufficient privileges to change database schema, or file is not modifiable", - 208 => "Password does not contain enough characters", - 209 => "New password must be different from existing one", - 210 => "User account is inactive", - 211 => "Password has expired", - 212 => "Invalid user account and/or password. Please try again", - 213 => "User account and/or password does not exist", - 214 => "Too many login attempts", - 215 => "Administrator privileges cannot be duplicated", - 216 => "Guest account cannot be duplicated", - 217 => "User does not have sufficient privileges to modify administrator account", - 300 => "File is locked or in use", - 301 => "Record is in use by another user", - 302 => "Table is in use by another user", - 303 => "Database schema is in use by another user", - 304 => "Layout is in use by another user", - 306 => "Record modification ID does not match", - 400 => "Find criteria are empty", - 401 => "No records match the request", - 402 => "Selected field is not a match field for a lookup", - 403 => "Exceeding maximum record limit for trial version of FileMaker Pro", - 404 => "Sort order is invalid", - 405 => "Number of records specified exceeds number of records that can be omitted", - 406 => "Replace/Reserialize criteria are invalid", - 407 => "One or both match fields are missing (invalid relationship)", - 408 => "Specified field has inappropriate data type for this operation", - 409 => "Import order is invalid", - 410 => "Export order is invalid", - 412 => "Wrong version of FileMaker Pro used to recover file", - 413 => "Specified field has inappropriate field type", - 414 => "Layout cannot display the result", - 415 => "One or more required related records are not available", - 416 => "A primary key is required from the data source table", - 417 => "The database is not a supported data source", - 500 => "Date value does not meet validation entry options", - 501 => "Time value does not meet validation entry options", - 502 => "Number value does not meet validation entry options", - 503 => "Value in field is not within the range specified in validation entry options", - 504 => "Value in field is not unique as required in validation entry options", - 505 => "Value in field is not an existing value in the database file as required in validation entry options", - 506 => "Value in field is not listed on the value list specified in validation entry option", - 507 => "Value in field failed calculation test of validation entry option", - 508 => "Invalid value entered in Find mode", - 509 => "Field requires a valid value", - 510 => "Related value is empty or unavailable", - 511 => "Value in field exceeds maximum number of allowed characters", - 512 => "The record was already modified by another user", - 513 => "To create a record, the record has to have a value in at least one field", - 600 => "Print error has occurred", - 601 => "Combined header and footer exceed one page", - 602 => "Body doesn’t fit on a page for current column setup", - 603 => "Print connection lost", - 700 => "File is of the wrong file type for import", - 706 => "EPSF file has no preview image", - 707 => "Graphic translator cannot be found", - 708 => "Can’t import the file or need color monitor support to import file", - 709 => "QuickTime movie import failed", - 710 => "Unable to update QuickTime file reference because the database file is read-only", - 711 => "Import translator cannot be found", - 714 => "Password privileges do not allow the operation", - 715 => "Specified Excel worksheet or named range is missing", - 716 => "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import", - 717 => "There is not enough XML/XSL information to proceed with the import or export", - 718 => "Error in parsing XML file (from Xerces)", - 719 => "Error in transforming XML using XSL (from Xalan)", - 720 => "Error when exporting; intended format does not support repeating fields", - 721 => "Unknown error occurred in the parser or the transformer", - 722 => "Cannot import data into a file that has no fields", - 723 => "You do not have permission to add records to or modify records in the target table", - 724 => "You do not have permission to add records to the target table", - 725 => "You do not have permission to modify records in the target table", - 726 => "There are more records in the import file than in the target table. Not all records were imported", - 727 => "There are more records in the target table than in the import file. Not all records were updated", - 729 => "Errors occurred during import. Records could not be imported", - 730 => "Unsupported Excel version. Convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again.", - 731 => "The file you are importing from contains no data", - 732 => "This file cannot be inserted because it contains other files", - 733 => "A table cannot be imported into itself", - 734 => "This file type cannot be displayed as a picture", - 735 => "This file type cannot be displayed as a picture. It will be inserted and displayed as a file", - 736 => "There is too much data to be exported to this format. It will be truncated", - 800 => "Unable to create file on disk", - 801 => "Unable to create temporary file on System disk", - 802 => "Unable to open file. This error can be caused by one or more of the following: invalid database name, the file is closed in FileMaker Server or invalid permission", - 803 => "File is single user or host cannot be found", - 804 => "File cannot be opened as read-only in its current state", - 805 => "File is damaged; use Recover command", - 806 => "File cannot be opened with this version of FileMaker Pro", - 807 => "File is not a FileMaker Pro file or is severely damaged", - 808 => "Cannot open file because access privileges are damaged", - 809 => "Disk/volume is full", - 810 => "Disk/volume is locked", - 811 => "Temporary file cannot be opened as FileMaker Pro file", - 813 => "Record Synchronization error on network", - 814 => "File(s) cannot be opened because maximum number is open", - 815 => "Couldn’t open lookup file", - 816 => "Unable to convert file", - 817 => "Unable to open file because it does not belong to this solution", - 819 => "Cannot save a local copy of a remote file", - 820 => "File is in the process of being closed", - 821 => "Host forced a disconnect", - 822 => "FMI files not found; reinstall missing files", - 823 => "Cannot set file to single-user, guests are connected", - 824 => "File is damaged or not a FileMaker file", - 900 => "General spelling engine error", - 901 => "Main spelling dictionary not installed", - 902 => "Could not launch the Help system", - 903 => "Command cannot be used in a shared file", - 904 => "Command can only be used in a file hosted under FileMaker Server", - 905 => "No active field selected; command can only be used if there is an active field", - 906 => "The current file is not shared; command can be used only if the file is shared", - 920 => "Can’t initialize the spelling engine", - 921 => "User dictionary cannot be loaded for editing", - 922 => "User dictionary cannot be found", - 923 => "User dictionary is read-only", - 951 => "An unexpected error occurred", - 954 => "Unsupported XML grammar", - 955 => "No database name", - 956 => "Maximum number of database sessions exceeded", - 957 => "Conflicting commands", - 958 => "Parameter missing in query", - 1200 => "Generic calculation error", - 1201 => "Too few parameters in the function", - 1202 => "Too many parameters in the function", - 1203 => "Unexpected end of calculation", - 1204 => "Number, text constant, field name or '(' expected", - 1205 => "Comment is not terminated with '*/'", - 1206 => "Text constant must end with a quotation mark", - 1207 => "Unbalanced parenthesis", - 1208 => "Operator missing, function not found or '(' not expected", - 1209 => "Name (such as field name or layout name) is missing", - 1210 => "Plug-in function has already been registered", - 1211 => "List usage is not allowed in this function", - 1212 => "An operator (for example, +, -, *) is expected here", - 1213 => "This variable has already been defined in the Let function", - 1214 => "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed", - 1215 => "This parameter is an invalid Get function parameter", - 1216 => "Only Summary fields allowed as first argument in GETSUMMARY", - 1217 => "Break field is invalid", - 1218 => "Cannot evaluate the number", - 1219 => "A field cannot be used in its own formula", - 1220 => "Field type must be normal or calculated", - 1221 => "Data type must be number, date, time, or timestamp", - 1222 => "Calculation cannot be stored", - 1223 => "The function referred to is not yet implemented", - 1224 => "The function referred to does not exist", - 1225 => "The function referred to is not supported in this context", - 1400 => "ODBC client driver initialization failed; make sure the ODBC client drivers are properly installed.", - 1401 => "Failed to allocate environment (ODBC)", - 1402 => "Failed to free environment (ODBC)", - 1403 => "Failed to disconnect (ODBC)", - 1404 => "Failed to allocate connection (ODBC)", - 1405 => "Failed to free connection (ODBC)", - 1406 => "Failed check for SQL API (ODBC)", - 1407 => "Failed to allocate statement (ODBC)", - 1408 => "Extended error (ODBC)", - 1409 => "Extended error (ODBC)", - 1410 => "Extended error (ODBC)", - 1411 => "Extended error (ODBC)", - 1412 => "Extended error (ODBC)", - 1413 => "Extended error (ODBC)", - 1450 => "Action requires PHP privilege extension", - 1451 => "Action requires that current file be remote", - 1501 => "SMTP authentication failed", - 1502 => "Connection refused by SMTP server", - 1503 => "Error with SSL", - 1504 => "SMTP server requires the connection to be encrypted", - 1505 => "Specified authentication is not supported by SMTP server", - 1506 => "Email message(s) could not be sent successfully", - 1507 => "Unable to log in to the SMTP server" + '-1' => 'Errore sconosciuto', + 0 => 'Nessun errore', + 1 => "Azione annullata dall'utente", + 2 => "Errore di memoria", + 3 => "Comando non disponibile (ad esempio, sistema operativo non appropriato, modo errato e così via)", + 4 => "Comando sconosciuto", + 5 => "Comando non valido (ad esempio, un'istruzione di script Definisci il campo priva di calcolo)", + 6 => "File di sola lettura", + 7 => "Memoria esaurita", + 8 => "Risultato vuoto", + 9 => "Privilegi insufficienti", + 10 => "Dati richiesti non disponibili", + 11 => "Nome non valido", + 12 => "Il nome esiste già", + 13 => "File o oggetto in uso", + 14 => "Fuori intervallo", + 15 => "Impossibile dividere per zero", + 16 => "Operazione non riuscita, nuovo tentativo richiesta (ad esempio una query dell'utente)", + 17 => "Tentativo di convertire il set di caratteri stranieri in UTF-16 non riuscito", + 18 => "Il client deve fornire le informazioni sull'account per procedere", + 19 => "La stringa contiene caratteri diversi da A-Z, a-z, 0-9 (ASCII)", + 20 => "Comando o operazione cancellata dallo script triggerato", + 100 => "Manca un file", + 101 => "Manca un record", + 102 => "Manca un campo", + 103 => "Manca una relazione", + 104 => "Manca uno script", + 105 => "Manca un formato", + 106 => "Manca una tabella", + 107 => "Manca un indice", + 108 => "Manca una lista valori", + 109 => "Manca un set di privilegi", + 110 => "Mancano tabelle correlate", + 111 => "Ripetizione campo non valida", + 112 => "Manca una finestra", + 113 => "Manca una funzione", + 114 => "Manca un riferimento al file", + 115 => "Il set di menu specificato non è presente", + 116 => "L'oggetto formato specificato non è presente", + 117 => "L'origine dati specificata non è presente", + 130 => "File danneggiati o non presenti; reinstallarli", + 131 => "Impossibile trovare i file del supporto per la lingua (come i file modello)", + 200 => "Accesso al record negato", + 201 => "Impossibile modificare il campo", + 202 => "Accesso al campo negato", + 203 => "Nel file non c'è nessun record da stampare o la password non consente l'accesso alla stampa", + 204 => "Nessun accesso ai campi nei criteri di ordinamento", + 205 => "L'utente non dispone dei privilegi di accesso per creare nuovi record; l'importazione sovrascriverà i dati esistenti", + 206 => "L'utente non dispone del privilegio per cambiare la password o il file non è modificabile", + 207 => "L'utente non ha privilegi sufficienti per cambiare lo schema del database, oppure il file non è modificabile", + 208 => "La password non contiene abbastanza caratteri", + 209 => "La nuova password deve essere diversa da quella esistente", + 210 => "L'account utente è inattivo", + 211 => "La password è scaduta", + 212 => "Nome utente e/o password non validi. Riprovare", + 213 => "Il nome utente e/o la password non esistono", + 214 => "Troppi tentativi di accesso", + 215 => "I privilegi di amministratore non possono essere duplicati", + 216 => "L'account Ospite non può essere duplicato", + 217 => "L'utente non dispone di privilegi sufficienti per modificare l'account Admin", + 300 => "File bloccato o in uso", + 301 => "Record usato da un altro utente", + 302 => "Tabella usata da un altro utente", + 303 => "Schema database usato da un altro utente", + 304 => "Formato usato da un altro utente", + 306 => "ID modifica del record non corrispondente", + 400 => "Criteri di ricerca vuoti", + 401 => "Nessun record soddisfa la richiesta", + 402 => "Il campo selezionato non è un campo di confronto per un riferimento", + 403 => "Limite massimo di record per la versione di prova di FileMaker Pro superato", + 404 => "Criterio di ordinamento non valido", + 405 => "Il numero di record specificato supera il numero di record che possono essere omessi", + 406 => "Criteri di sostituzione/riserializzazione non validi", + 407 => "Manca uno o entrambi i campi di confronto (relazione non valida)", + 408 => "Tipo di dati associato al campo specificato non valido per questa operazione", + 409 => "Ordine di importazione non valido", + 410 => "Ordine di esportazione non valido", + 412 => "Per recuperare il file è stata usata una versione errata di FileMaker Pro", + 413 => "Tipo di campo non valido", + 414 => "Il formato non può visualizzare il risultato", + 415 => "Uno o più record correlati richiesti non sono disponibili", + 416 => "Chiave primaria richiesta dalla tabella di origine dati", + 417 => "Il database non è supportato per le operazioni ODBC", + 500 => "Il valore della data non soddisfa le opzioni di verifica", + 501 => "Il valore dell'ora non soddisfa le opzioni di verifica", + 502 => "Il valore del numero non soddisfa le opzioni di verifica", + 503 => "Il valore nel campo non è compreso nell'intervallo specificato nelle opzioni di verifica", + 504 => "Il valore del campo non è univoco come richiesto dalle opzioni di verifica", + 505 => "Il valore del campo non esiste nel file di database come richiesto dalle opzioni di verifica", + 506 => "Il valore nel campo non è elencato nella lista di valori specificata nelle opzioni di verifica", + 507 => "Il valore nel campo non ha superato il test del calcolo dell'opzione di verifica", + 508 => "Valore non valido immesso in modo Trova", + 509 => "Il campo richiede un valore valido", + 510 => "Valore correlato vuoto o non disponibile", + 511 => "Il valore immesso nel campo supera il numero massimo di caratteri consentiti", + 512 => "Il record è già stato modificato da un altro utente", + 513 => "Il record deve comprendere almeno un valore in un campo per poter essere creato", + 600 => "Errore di stampa", + 601 => "La combinazione di intestazione e piè di pagina supera una pagina", + 602 => "Il corpo non rientra in una pagina per l'impostazione della colonna corrente", + 603 => "Connessione di stampa interrotta", + 700 => "Tipo di file errato per l'importazione", + 706 => "File EPSF privo di immagine di anteprima", + 707 => "Impossibile trovare traduttore per immagini", + 708 => "Impossibile importare il file. È necessario un computer a colori", + 709 => "Non è riuscita l'importazione del filmato QuickTime", + 710 => "Impossibile aggiornare il riferimento QuickTime. Il file di database è di sola lettura", + 711 => "Impossibile trovare il traduttore per l'importazione", + 714 => "Operazione non consentita dai privilegi della password", + 715 => "È stato specificato un foglio di lavoro di Excel o un intervallo con nome mancante", + 716 => "Una query SQL che impiega istruzioni DELETE, INSERT o UPDATE non è consentita per l'importazione ODBC", + 717 => "Informazioni XML/XSL insufficienti per procedere con l'importazione o l'esportazione", + 718 => "Errore di analisi del file XML (da Xerces)", + 719 => "Errore di conversione XML usando XSL (da Xalan)", + 720 => "Errore durante l'esportazione; il formato desiderato non supporta i campi multipli", + 721 => "Errore sconosciuto nel parser o nel convertitore", + 722 => "Impossibile importare dati in un file che non ha campi", + 723 => "Non si dispone dell'autorizzazione per aggiungere o modificare record nella tabella di destinazione", + 724 => "Non si dispone dell'autorizzazione per aggiungere record alla tabella di destinazione", + 725 => "Non si dispone dell'autorizzazione per modificare record nella tabella di destinazione", + 726 => "Vi sono più record nel file di importazione che nella tabella di destinazione. Non tutti i record sono stati importati", + 727 => "Vi sono più record nella tabella di destinazione che nel file di importazione. Non tutti i record sono stati aggiornati", + 729 => "Errori durante l'importazione. Impossibile importare i record", + 730 => "Versione Excel non supportata. (Convertire il file in formato Excel 7.0 (Excel 95), Excel 97, 2000 o XP e riprovare)", + 731 => "Il file da importare non contiene dati", + 732 => "Questo file non può essere inserito perché contiene altri file", + 733 => "Una tabella non può essere importata in se stessa", + 734 => "I file di questo tipo non possono essere visualizzati come immagine", + 735 => "I file di questo tipo non possono essere visualizzati come immagine. Verranno inseriti e visualizzati come file", + 736 => "Troppi dati da esportare in questo formato. Sarà troncato", + 800 => "Impossibile creare il file su disco", + 801 => "Impossibile creare il file temporaneo sul disco di sistema", + 802 => "Impossibile aprire il file", + 803 => "Il file è per un singolo utente oppure non è stato possibile trovare l'host", + 804 => "Impossibile aprire il file.", + 805 => "Usare il comando Recupera", + 806 => "Impossibile aprire il file con questa versione di FileMaker Pro", + 807 => "Il file non è un file FileMaker Pro oppure è gravemente danneggiato", + 808 => "Impossibile aprire il file. I privilegi di accesso sono danneggiati", + 809 => "Il disco o il volume è pieno", + 810 => "Il disco o il volume è protetto", + 811 => "Impossibile aprire il file temporaneo come file di FileMaker Pro", + 813 => "Errore di sincronizzazione del record in rete", + 814 => "Impossibile aprire i file. È già aperto il numero massimo", + 815 => "Impossibile aprire il file di riferimento", + 816 => "Impossibile convertire il file", + 817 => "Impossibile aprire il file poiché non fa parte di questa soluzione", + 819 => "Impossibile salvare una copia locale di un file remoto", + 820 => "File in fase di chiusura", + 821 => "L'host ha forzato una disconnessione", + 822 => "File FMI non trovati; reinstallare i file non presenti", + 823 => "Impossibile impostare il file su utente singolo; alcuni ospiti sono connessi", + 824 => "Il file è danneggiato o non è un file FileMaker", + 900 => "Errore generico del modulo di gestione del controllo ortografico", + 901 => "Dizionario principale non installato", + 902 => "Impossibile avviare la Guida", + 903 => "Impossibile usare il comando in un file condiviso", + 904 => "Questo comando non può essere usato in un file ospitato sotto FileMaker Server", + 905 => "Non è selezionato nessun campo attivo; il comando può essere usato solo se un campo è attivo", + 906 => "Il file corrente deve essere condiviso per usare questo comando", + 920 => "Impossibile inizializzare il modulo di gestione del controllo ortografico", + 921 => "Impossibile caricare il dizionario utente per la modifica", + 922 => "Impossibile trovare il dizionario utente", + 923 => "Il dizionario utente è di sola lettura", + 951 => "Errore imprevisto (*)", + 954 => "Grammatica XML non supportata (*)", + 955 => "Nessun nome per il database (*)", + 956 => "È stato superato il numero massimo di sessioni del database (*)", + 957 => "Conflitto tra i comandi (*)", + 958 => "Parametro mancante (*)", + 1200 => "Errore di calcolo generico", + 1201 => "Troppi pochi parametri nella funzione", + 1202 => "Troppi parametri nella funzione", + 1203 => "Fine calcolo non previsto", + 1204 => "Sono previsti un numero, una costante di testo, un nome di campo o una '('", + 1205 => "Il commento non termina con '*/'", + 1206 => "La costante di testo deve terminare con un punto interrogativo", + 1207 => "Parentesi mancante", + 1208 => "Operatore mancante, funzione non trovata o '(' non prevista", + 1209 => "Nome (come nome campo o nome formato) mancante", + 1210 => "La funzione del plug-in è già stata registrata", + 1211 => "Utilizzo della lista valori non consentito in questa funzione", + 1212 => "Qui è previsto un operatore (ad esempio, +, -, *)", + 1213 => "Questa variabile è già stata definita nella funzione Consenti", + 1214 => "MEDIO, CONTEGGIO, ESPANSO, RICAVARIPETIZIONI, MAX, MIN, VPN, DEVST, SOMMA e RICAVARIASSUNTO: espressione trovata dove è necessario un campo solo", + 1215 => "Questo parametro è un parametro non valido per la funzione Get", + 1216 => "Solo i campi Riassunto sono consentiti come primo argomento in RICAVARIASSUNTO", + 1217 => "Il campo di separazione non è valido", + 1218 => "Impossibile valutare il numero", + 1219 => "Non è possibile usare un campo nella propria formula", + 1220 => "Il campo deve essere di tipo normale o Calcolo", + 1221 => "I dati devono essere di tipo Numero, Data, Ora o Indicatore data e ora", + 1222 => "Impossibile memorizzare il calcolo", + 1223 => "La funzione non è implementata", + 1224 => "La funzione non è definita", + 1225 => "La funzione non è supportata in questo contesto", + 1300 => "Il nome specificato non può essere utilizzato", + 1400 => "Errore nell'inizializzazione del driver ODBC; assicurarsi che i driver ODBC siano installati correttamente", + 1401 => "Allocazione ambiente fallita (ODBC)", + 1402 => "Impossibile liberare l'ambiente (ODBC)", + 1403 => "Impossibile disconnettersi (ODBC)", + 1404 => "Impossibile allocare la connessione (ODBC)", + 1405 => "Impossibile liberare la connessione ( ODBC)", + 1406 => "Controllo SQL API (ODBC) fallito", + 1407 => "Impossibile allocare l'istruzione (ODBC)", + 1408 => "Errore esteso (ODBC)", + 1409 => "Errore (ODBC)", + 1410 => "Link comunicazione fallito (ODBC)", + 1411 => "Link comunicazione fallito (ODBC)", + 1412 => "Link comunicazione fallito (ODBC)", + 1413 => "Link comunicazione fallito (ODBC)", + 1450 => "L'azione richiede privilegi PHP estesi", + 1451 => "L'azione richiede che il file corrente sia remoto", + 1501 => "Autenticazione SMTP fallita", + 1502 => "Connessione rifiutata dal server SMTP", + 1503 => "Errore con SSL", + 1504 => "Il server SMTP richiede che la connessione sia cifrata", + 1505 => "L'autenticazione specificata non è supportata dal server SMTP", + 1506 => "L'Email non può essere inviata", + 1507 => "Impossibile registrare all'interno del server SMTP" }; @@ -256,4 +256,4 @@ sub get_string return $error_codes->{$error_code}; } -1; # End of Net::FileMaker::Error::EN::XML +1; # End of Net::FileMaker::Error::IT::XML diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm index 5773471..11e975d 100644 --- a/lib/Net/FileMaker/Error/IT/XSLT.pm +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -5,7 +5,7 @@ use warnings; =head1 NAME -Net::FileMaker::Error::EN::XML - Error strings for FileMaker Server XSLT interface in English. +Net::FileMaker::Error::IT::XML - Error strings for FileMaker Server XSLT interface in Italian. =head1 INFO @@ -19,41 +19,41 @@ L my $error_codes = { - '-1' => "Unknown error", - 0 => "No error", - 10000 => "Invalid header name", - 10001 => "Invalid HTTP status code", - 10100 => "Unknown session error", - 10101 => "Requested session name is already used", - 10102 => "Session could not be accessed - maybe it does not exist", - 10103 => "Session has timed out", - 10104 => "Specified session object does not exist", - 10200 => "Unknown messaging error", - 10201 => "Message formatting error", - 10202 => "Message SMTP fields error", - 10203 => "Message “To Field” error", - 10204 => "Message “From Field” error", - 10205 => "Message “CC Field” error", - 10206 => "Message “BCC Field” error", - 10207 => "Message “Subject Field” error", - 10208 => "Message “Reply-To Field” error", - 10209 => "Message body error", - 10210 => "Recursive mail error - attempted to call send_email() inside an email XSLT stylesheet", - 10211 => "SMTP authentication error - either login failed or wrong type of authentication provided", - 10212 => "Invalid function usage - attempted to call set_header(), set_status_code() or set_cookie() inside an email XSLT stylesheet", - 10213 => "SMTP server is invalid or is not working.", - 10300 => "Unknown formatting error", - 10301 => "Invalid date time format", - 10302 => "Invalid date format", - 10303 => "Invalid time format", - 10304 => "Invalid day format", - 10305 => "Improperly formatted date time string", - 10306 => "Improperly formatted date string", - 10307 => "Improperly formatted time string", - 10308 => "Improperly formatted day string", - 10309 => "Unsupported text encoding", - 10310 => "Invalid URL encoding", - 10311 => "Regular expression pattern error" + '-1' => "Errore sconosciuto", + 0 => "Nessun errore", + 10000 => "Nome instestazione non valido", + 10001 => "Il codice status HTTP non è valido", + 10100 => "Errore di sessione sconosciuto", + 10101 => "Il nome della sessione è già in uso", + 10102 => "Non posso accedere alla sessione - probabilmente non esiste", + 10103 => "Sessione scaduta", + 10104 => "L'oggetto della sessione non esiste", + 10200 => "Messaggio di errore sconosciuto", + 10201 => "Errore di formattazione sconosciuto", + 10202 => "Errore nei campi SMTP ", + 10203 => "Errore “Al Campo”", + 10204 => "Errore “Dal Campo”", + 10205 => "Errore “Campo CC ”", + 10206 => "Errore “Campo BCC”", + 10207 => "Errore “Campo Oggetto”", + 10208 => "Errore “Campo Inoltra”", + 10209 => "Errore nel corpo della email", + 10210 => "Errore ricorsivo - tentativo di chiamata a send_email() dentro un foglio di stile XSLT di una email", + 10211 => "Errore di autenticazione SMTP - login fallito o errato metodo di autenticazione", + 10212 => "Utilizzo non valido di una funzione - tentativo di chiamata a set_header(), set_status_code() o set_cookie() dentro un foglio di stile XSLT di una email", + 10213 => "Il server SMTP non è valido o non sta funzionando.", + 10300 => "Errore di formattazione sconosciuto", + 10301 => "Formato data-tempo non valido", + 10302 => "Formato data non valido", + 10303 => "Formato tempo non valido", + 10304 => "Formato giorno non valido", + 10305 => "Formattazione errata per la stringa data-tempo", + 10306 => "Formattazione errata per la stringa data", + 10307 => "Formattazione errata per la stringa tempo", + 10308 => "Formattazione errata per la stringa giorno", + 10309 => "Codifica testo non supportata", + 10310 => "Codifica URL non supportata", + 10311 => "Errore nel pattern dell'Espressione Regolare" }; @@ -72,4 +72,4 @@ sub get_string return $error_codes->{$error_code}; } -1; # End of Net::FileMaker::Error::EN::XSLT +1; # End of Net::FileMaker::Error::IT::XSLT diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 466af41..01ac0bd 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -96,6 +96,8 @@ sub fields_definition =head2 datasource +returns + =item * 'database' # database file name =item * 'layout' # kind of layout, eg. 'List' =item * 'timestamp-format' # eg. 'MM/dd/yyyy HH:mm:ss', @@ -106,7 +108,7 @@ sub fields_definition =cut -sub fields_definition +sub datasource { my $self = shift; return $self->{_field_def}->fields; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 3e45f9a..9c3c1a5 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -45,16 +45,7 @@ sub new my($class, $res_hash) = @_; my $self = { - _res_hash => $res_hash, - global => undef, - numeric_only => undef, - four_digit_year => undef, - not_empty => undef, - auto_enter => undef, - type => undef, - time_of_day => undef, - max_repeat => undef, - result => undef + _res_hash => $res_hash }; bless $self; $self->_parse; @@ -82,16 +73,16 @@ sub new sub _parse { my $self = shift; - $self->{global} = $self->{_res_hash}{global} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{global} ; - $self->{numeric_only} = $self->{_res_hash}{'numeric-only'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'numeric-only'}; - $self->{four_digit_year} = $self->{_res_hash}{'four-digit-year'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'four-digit-year'}; - $self->{not_empty} = $self->{_res_hash}{'not-empty'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'not-empty'}; - $self->{auto_enter} = $self->{_res_hash}{'auto-enter'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'auto-enter'}; - $self->{type} = $self->{_res_hash}{type} if defined $self->{_res_hash}{type}; - $self->{time_of_day} = $self->{_res_hash}{'time-of-day'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'time-of-day'}; - $self->{max_repeat} = $self->{_res_hash}{'max-repeat'} if defined $self->{_res_hash}{'max-repeat'}; - $self->{max_characters} = $self->{_res_hash}{'max-characters'} if defined $self->{_res_hash}{'max-characters'}; - $self->{result} = $self->{_res_hash}{result} if defined $self->{_res_hash}{result}; + $self->{global} = $self->{_res_hash}{global} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{global} ; + $self->{'numeric-only'} = $self->{_res_hash}{'numeric-only'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'numeric-only'}; + $self->{'four-digit-year'} = $self->{_res_hash}{'four-digit-year'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'four-digit-year'}; + $self->{'not-empty'} = $self->{_res_hash}{'not-empty'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'not-empty'}; + $self->{'auto-enter'} = $self->{_res_hash}{'auto-enter'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'auto-enter'}; + $self->{type} = $self->{_res_hash}{type} if defined $self->{_res_hash}{type}; + $self->{'time-of-day'} = $self->{_res_hash}{'time-of-day'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'time-of-day'}; + $self->{'max-repeat'} = $self->{_res_hash}{'max-repeat'} if defined $self->{_res_hash}{'max-repeat'}; + $self->{'max-characters'} = $self->{_res_hash}{'max-characters'} if defined $self->{_res_hash}{'max-characters'}; + $self->{result} = $self->{_res_hash}{result} if defined $self->{_res_hash}{result}; } =head2 get('field') @@ -102,19 +93,19 @@ the accepted params are ( possible results in parentheses ): =over 4 =item * global (0,1) -=item * numeric_only (0,1) -=item * four_digit_year (0,1) -=item * not_empty (0,1) +=item * numeric-only (0,1) +=item * four-digit-year (0,1) +=item * not-empty (0,1) =item * auto_enter (0,1) =item * type (“normal”, “calculation”, or “summary”) -=item * time_of_day (0,1) -=item * max_repeat (int) -=item * max_characters (int) +=item * time-of_day (0,1) +=item * max-repeat (int) +=item * max-characters (int) =item * result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) =cut -my @availables = qw( global numeric_only four_digit_year not_empty auto_enter type time_of_day max_repeat max_characters result ); +my @availables = qw( global numeric-only four-digit-year not-empty auto-enter type time-of-day max-repeat max-characters result ); sub get { From 8b0a61b88373a1e6ef0db54ea34052c46903ff1f Mon Sep 17 00:00:00 2001 From: michele ongaro Date: Mon, 10 Jan 2011 16:20:37 +0100 Subject: [PATCH 24/90] added datasource, returns the datasource object fetch_size, returns the number of fetched rows total_count, returns the total number of rows matched by the research product, returns info about the server version, returns info aout the version of the server _parse_rows, parses the rows of the result set and creates the relative ResultSet::Row --- lib/Net/FileMaker/XML/ResultSet/Result.pm | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/Net/FileMaker/XML/ResultSet/Result.pm diff --git a/lib/Net/FileMaker/XML/ResultSet/Result.pm b/lib/Net/FileMaker/XML/ResultSet/Result.pm deleted file mode 100644 index e69de29..0000000 From 8760f01aa09e851582a89390273f65596f5ae2f4 Mon Sep 17 00:00:00 2001 From: System Administrator Date: Mon, 10 Jan 2011 16:24:52 +0100 Subject: [PATCH 25/90] added the following methods get('colname') get_inflated('colname'), as the previous but returns a DateTime for dates, times and datetimes get_columns get_inflated_columns (see above) mod_id, returns the mod id --- lib/Net/FileMaker/XML/ResultSet/Row.pm | 163 +++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index e69de29..a779a2a 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -0,0 +1,163 @@ +package Net::FileMaker::XML::ResultSet::Row; + +use strict; +use warnings; +use Moose; +use Carp; +use DateTime; +use DateTime::Format::CLDR; + +require Exporter; +use AutoLoader qw(AUTOLOAD); + +our @ISA = qw(Exporter Net::FileMaker::XML); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. +our @EXPORT_OK = ( ); + +our @EXPORT = qw( + + +); + +=head1 NAME + +Net::FileMaker::XML::ResultSet::FieldsDefinition::Row + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = 0.01; + +=head1 SYNOPSIS + +This module handles the single row of the resultset returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. + +=head1 METHODS + +=cut + +sub new +{ + my($class, $res_hash , $col_def , $data_source) = @_; + my $self = { + _col_def => $col_def, + _datasource => $data_source, + _res_hash => $res_hash + }; + bless $self; + $self->_parse; + return $self; +} + + + +# _parse +sub _parse{ + my $self = shift; + +} + +=head2 mod_id + + returns the mod id for this row + +=cut + +sub mod_id +{ + my $self = shift; + return $self->{_res_hash}{'mod-id'}; +} + + +=head2 record_id + + returns the record id for this row + +=cut + +sub record_id +{ + my $self = shift; + return $self->{_res_hash}{'mod-id'}; +} + + +=head2 get('colname') + + returns the value of the selected column for this row + +=cut + +sub get +{ + my ( $self , $col ) = @_; + return $self->{_res_hash}{field}{$col}{data}; +} + + +=head2 get_inflated('colname') + + returns the value of the selected column for this row, if the type is date|time|datetime returns a DateTime obj + +=cut + +sub get_inflated +{ + my ( $self , $col ) = @_; + # if the field is a “date”, “time” or “timestamp" + if(defined $self->{_col_def}{$col}){ + if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ + # let's convert it to a DateTime + print STDERR $self->{_col_def}{$col}{result}; + my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $cldr = new DateTime::Format::CLDR( + pattern => $pattern + ); + return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); + } + } + # if the type is one of the ones above let's convert the value in a DateTime + return $self->{_res_hash}{field}{$col}{data}; +} + +=head2 get_columns + + returns an hash with column names & relative values for this row + +=cut +sub get_columns +{ + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get($k); + } + return \%res; +} + +=head2 get_inflated_columns + + returns an hash with column names & relative values for this row, if the type is date|time|datetime returns a DateTime obj + +=cut + +sub get_inflated_columns +{ + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get_inflated($k); + } + return \%res; +} + + +1; +__END__ \ No newline at end of file From 3be1fd8b0f67f445acea9025dd2362018f301c2a Mon Sep 17 00:00:00 2001 From: System Administrator Date: Mon, 10 Jan 2011 16:25:44 +0100 Subject: [PATCH 26/90] added many methods --- lib/Net/FileMaker/XML/ResultSet.pm | 94 +++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 7 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 01ac0bd..d17c68d 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -44,15 +44,12 @@ sub new { my($class, $res_hash) = @_; + my @rows; my $self = { _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods # these are the references to the parsed blocks _field_def => undef, - _resultset => undef, - _datasource => undef, - _product => undef, - _version => undef, - _xmlns => undef + _rows => \@rows }; bless $self; @@ -70,6 +67,7 @@ sub _parse my $self = shift; # parse the resultset $self->_parse_field_definition; + $self->_parse_rows; } # _parse_field_definition @@ -111,8 +109,90 @@ returns sub datasource { my $self = shift; - return $self->{_field_def}->fields; + return $self->{_res_hash}{datasource}; +} + +=head2 xmlns + + returns the xml's namespace of the response + +=cut + +sub xmlns +{ + my $self = shift; + return $self->{_res_hash}{xmlns}; +} + + +=head2 version + + returns xml's version of the response + +=cut + +sub version +{ + my $self = shift; + return $self->{_res_hash}{version}; } -1; # End of Net::FileMaker::XML::Database; +=head2 product + + returns an hash with info about the fm db server ( version and build ) +=cut + +sub product +{ + my $self = shift; + return { + version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, + build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, + } +} + +=head2 total_count + + returns an integer representing the total number of rows that match the research, DOES NOT TAKE IN ACCOUNT THE LIMIT CLAUSE + +=cut + +sub total_count +{ + my $self = shift; + return $self->{_res_hash}{resultset}{count}; +} + +=head2 total_count + + returns an integer representing the total number of rows of the resultset, TAKES IN ACCOUNT THE LIMIT CLAUSE + +=cut + +sub fetch_size +{ + my $self = shift; + return $self->{_res_hash}{resultset}{'fetch-size'}; +} + + +# _parse_rows +sub _parse_rows +{ + my $self = shift; + require Net::FileMaker::XML::ResultSet::Row; + my $cd = $self->fields_definition; # column definition, I need it for the inflater + my $ds = $self->datasource; + + if($self->fetch_size == 1){ + push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($self->{_res_hash}{resultset}{record}, $cd , $ds); + }else{ + for my $row (@{$self->{_res_hash}{resultset}{record}}){ + push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($row, $cd,$ds); + } + } +} + + +1; # End of Net::FileMaker::XML::ResultSet; __END__ \ No newline at end of file From 0f4a790e53bdfc1d2ece5ec1a8b61822c105fa82 Mon Sep 17 00:00:00 2001 From: System Administrator Date: Mon, 10 Jan 2011 16:26:53 +0100 Subject: [PATCH 27/90] first commit for this module --- .../XML/ResultSet/FieldsDefinition/Field.pm | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 9c3c1a5..6ad01bc 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -55,21 +55,6 @@ sub new # _parse # - - -#The attributes specify: -# whether the field is an auto-enter field (“yes” or “no”) -# whether the field is a four-digit-year field (“yes” or “no) -# whether it is a global field (“yes” or “no”) -# the maximum number of repeating values (max-repeat attribute) -# the maximum number of characters allowed (max-characters attribute) -# whether it is a not-empty field (“yes” or “no”) -# whether it is for numeric data only (“yes” or “no”) -# result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) -# whether it is a time-of-day field (“yes” or “no”) -# type (“normal”, “calculation”, or “summary” - - sub _parse { my $self = shift; From f3ba339a72ceb16501acd946b5d8f44108578872 Mon Sep 17 00:00:00 2001 From: System Administrator Date: Tue, 11 Jan 2011 10:38:43 +0100 Subject: [PATCH 28/90] corrected testing and documentation bugs --- lib/Net/FileMaker/XML/ResultSet.pm | 15 +++++++++++++-- .../XML/ResultSet/FieldsDefinition/Field.pm | 5 ++--- t/02_error/03-it.t | 8 ++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index d17c68d..b371bf5 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -95,7 +95,7 @@ sub fields_definition =head2 datasource returns - +=over =item * 'database' # database file name =item * 'layout' # kind of layout, eg. 'List' =item * 'timestamp-format' # eg. 'MM/dd/yyyy HH:mm:ss', @@ -103,7 +103,7 @@ returns =item * 'time-format' # eg. 'HH:mm:ss', =item * 'table' # name of the selected database table, =item * 'total-count' # total count of the records in the selected table - +=back =cut sub datasource @@ -193,6 +193,17 @@ sub _parse_rows } } +=head2 rows + + returns all the rows of the resultset as Net::FileMaker::XML::ResultSet::Row(s) + +=cut + +sub rows +{ + my $self = shift; + return $self->{_rows}; +} 1; # End of Net::FileMaker::XML::ResultSet; __END__ \ No newline at end of file diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 6ad01bc..ec79a8f 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -75,8 +75,7 @@ sub _parse returns the value for the passed parameter the accepted params are ( possible results in parentheses ): -=over 4 - +=over =item * global (0,1) =item * numeric-only (0,1) =item * four-digit-year (0,1) @@ -87,7 +86,7 @@ the accepted params are ( possible results in parentheses ): =item * max-repeat (int) =item * max-characters (int) =item * result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) - +=back =cut my @availables = qw( global numeric-only four-digit-year not-empty auto-enter type time-of-day max-repeat max-characters result ); diff --git a/t/02_error/03-it.t b/t/02_error/03-it.t index 8900ec3..e475823 100644 --- a/t/02_error/03-it.t +++ b/t/02_error/03-it.t @@ -14,7 +14,7 @@ my $xml = Net::FileMaker::Error->new(lang => 'it', type => 'xml'); ok($xml, 'Net::FileMaker::Error loaded XML strings in Italian'); my $xml_error_210 = $xml->get_string('210'); -is($xml_error_210, 'Account utente inattivo', 'Returned error string'); +is($xml_error_210, 'L\'account utente è inattivo', 'Returned error string'); my $xml_error_minusone = $xml->get_string('-1'); is($xml_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); @@ -22,11 +22,11 @@ is($xml_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); # # XSLT Errors # -my $xslt = Net::FileMaker::Error->new(lang => 'en', type => 'xslt'); -ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in English'); +my $xslt = Net::FileMaker::Error->new(lang => 'it', type => 'xslt'); +ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in Italian'); my $xslt_error_10205 = $xslt->get_string('10205'); -is($xslt_error_10205, 'Errore “CC Field”', 'Returned error string'); +is($xslt_error_10205, 'Errore “Campo CC ”', 'Returned error string'); my $xslt_error_minusone = $xslt->get_string('-1'); is($xslt_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); From fcbc6c495f13df801b1db2ba4d7b1ea924d7ddd1 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 11:39:58 +0100 Subject: [PATCH 29/90] corrected documentation of ResultSet.pm and Field.pm. added test for ResultSet instantiation in a real world case. --- lib/Net/FileMaker/XML/ResultSet.pm | 64 ++++++++++++++----- .../XML/ResultSet/FieldsDefinition/Field.pm | 15 ++++- t/03_resultset/01-instantiation.t | 30 +++++++++ 3 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 t/03_resultset/01-instantiation.t diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index b371bf5..296154d 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -82,7 +82,8 @@ sub _parse_field_definition =head2 fields_definition - returns the fields definition +returns the fields definition ( see L for details on what it might return ) + =cut @@ -94,16 +95,44 @@ sub fields_definition =head2 datasource -returns -=over -=item * 'database' # database file name -=item * 'layout' # kind of layout, eg. 'List' -=item * 'timestamp-format' # eg. 'MM/dd/yyyy HH:mm:ss', -=item * 'date-format' # eg. 'MM/dd/yyyy', -=item * 'time-format' # eg. 'HH:mm:ss', -=item * 'table' # name of the selected database table, -=item * 'total-count' # total count of the records in the selected table +return useful informations about the datasource. +you don't need to use these infos to parse the date|time|timestamp fields as it is already done by the get_inflated* methods of each row returned by the I method. + +returns: + +=over 4 + +=item * database + + database file name + +=item * layout + + kind of layout, eg. 'List + +=item * timestamp-format + + eg. 'MM/dd/yyyy HH:mm:ss' + +=item * date-format + + eg. 'MM/dd/yyyy' + +=item * time-format + + eg. 'HH:mm:ss' + +=item * table + + name of the selected database table + +=item * total-count + + total count of the records in the selected table + =back + + =cut sub datasource @@ -114,7 +143,7 @@ sub datasource =head2 xmlns - returns the xml's namespace of the response +returns the xml's namespace of the response =cut @@ -127,7 +156,7 @@ sub xmlns =head2 version - returns xml's version of the response +returns xml's version of the response =cut @@ -139,7 +168,8 @@ sub version =head2 product - returns an hash with info about the fm db server ( version and build ) +returns an hash with info about the fm db server ( version and build ) + =cut sub product @@ -154,7 +184,7 @@ sub product =head2 total_count returns an integer representing the total number of rows that match the research, DOES NOT TAKE IN ACCOUNT THE LIMIT CLAUSE - + =cut sub total_count @@ -163,10 +193,10 @@ sub total_count return $self->{_res_hash}{resultset}{count}; } -=head2 total_count +=head2 fetch_size + +returns an integer representing the total number of rows of the resultset, TAKES IN ACCOUNT THE LIMIT CLAUSE - returns an integer representing the total number of rows of the resultset, TAKES IN ACCOUNT THE LIMIT CLAUSE - =cut sub fetch_size diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index ec79a8f..1a27572 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -74,19 +74,32 @@ sub _parse returns the value for the passed parameter -the accepted params are ( possible results in parentheses ): +it might return ( possible results in parentheses ): + =over + =item * global (0,1) + =item * numeric-only (0,1) + =item * four-digit-year (0,1) + =item * not-empty (0,1) + =item * auto_enter (0,1) + =item * type (“normal”, “calculation”, or “summary”) + =item * time-of_day (0,1) + =item * max-repeat (int) + =item * max-characters (int) + =item * result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) + =back + =cut my @availables = qw( global numeric-only four-digit-year not-empty auto-enter type time-of-day max-repeat max-characters result ); diff --git a/t/03_resultset/01-instantiation.t b/t/03_resultset/01-instantiation.t new file mode 100644 index 0000000..7dffa59 --- /dev/null +++ b/t/03_resultset/01-instantiation.t @@ -0,0 +1,30 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} && $ENV{FMS_LAYOUT} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); +use_ok('Net::FileMaker::XML::ResultSet'); + + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); + +my $dbx = $fmx->dbnames; +my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); +ok($fmdb,'Logged in'); + +my $records = $fmdb->find(layout => $ENV{FMS_LAYOUT}, params => { '-max' => '3'}); +my $rs = Net::FileMaker::XML::ResultSet->new($records); +ok($rs, 'Directly constructed Net::FileMaker::XML::ResultSet'); + +done_testing(); From 9077110fa80554ec01bd9eb1318e4589023a5289 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 12:40:41 +0100 Subject: [PATCH 30/90] now it's possible to pass a reference to the db in order to add update and delete methods to the row. it wil be done after adding the relative methods to NFX. --- lib/Net/FileMaker/XML/ResultSet.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 296154d..a6aaae8 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -42,11 +42,11 @@ This module handles the hash returned by the Net::FileMaker::XML search methods sub new { - my($class, $res_hash) = @_; - + my($class, %args) = @_; my @rows; my $self = { - _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + _db => $args{db}, # ref to the db, it is useful to add an $row->update method later # these are the references to the parsed blocks _field_def => undef, _rows => \@rows From d11ab46559869c400e7be1711e65e1cb38f09448 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 15:42:21 +0100 Subject: [PATCH 31/90] added more tests Database now returns NFX::ResultSet object for search methods minor changes for other files --- t/01_xml/04-findall.t | 2 +- t/03_resultset/01-instantiation.t | 2 +- t/03_resultset/02-rows.t | 33 +++++++++++++++++++++++ t/04_field_definition/00-load.t | 13 +++++++++ t/04_field_definition/01-fields.t | 33 +++++++++++++++++++++++ t/05_row/00-load.t | 13 +++++++++ t/05_row/01-inflated.t | 44 +++++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 t/03_resultset/02-rows.t create mode 100644 t/04_field_definition/00-load.t create mode 100644 t/04_field_definition/01-fields.t create mode 100644 t/05_row/00-load.t create mode 100644 t/05_row/01-inflated.t diff --git a/t/01_xml/04-findall.t b/t/01_xml/04-findall.t index a4be5e5..a2c18f3 100644 --- a/t/01_xml/04-findall.t +++ b/t/01_xml/04-findall.t @@ -26,7 +26,7 @@ if(ref($dbx) eq 'ARRAY') if(ref($layouts) eq 'ARRAY') { my $findall = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1}); - is(ref($findall), 'HASH', 'findall() returned hashref'); + is(ref($findall), 'Net::FileMaker::XML::ResultSet', 'findall() returned Net::FileMaker::XML::ResultSet'); } } diff --git a/t/03_resultset/01-instantiation.t b/t/03_resultset/01-instantiation.t index 7dffa59..291b77e 100644 --- a/t/03_resultset/01-instantiation.t +++ b/t/03_resultset/01-instantiation.t @@ -24,7 +24,7 @@ my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{ ok($fmdb,'Logged in'); my $records = $fmdb->find(layout => $ENV{FMS_LAYOUT}, params => { '-max' => '3'}); -my $rs = Net::FileMaker::XML::ResultSet->new($records); +my $rs = Net::FileMaker::XML::ResultSet->new(rs => $records , db => $fmdb); ok($rs, 'Directly constructed Net::FileMaker::XML::ResultSet'); done_testing(); diff --git a/t/03_resultset/02-rows.t b/t/03_resultset/02-rows.t new file mode 100644 index 0000000..4e3e6dd --- /dev/null +++ b/t/03_resultset/02-rows.t @@ -0,0 +1,33 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} && $ENV{FMS_LAYOUT} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); +use_ok('Net::FileMaker::XML::ResultSet'); + + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); + +my $dbx = $fmx->dbnames; +my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); +ok($fmdb,'Logged in'); + +my $layouts = $fmdb->layoutnames; +if(ref($layouts) eq 'ARRAY') +{ + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1})->rows; + is(ref(@$records[0]), 'Net::FileMaker::XML::ResultSet::Row', 'the first row of the RS is a Net::FileMaker::XML::ResultSet::Row'); +} + +done_testing(); diff --git a/t/04_field_definition/00-load.t b/t/04_field_definition/00-load.t new file mode 100644 index 0000000..a78c1ed --- /dev/null +++ b/t/04_field_definition/00-load.t @@ -0,0 +1,13 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 1; + +BEGIN +{ + use_ok( 'Net::FileMaker::XML::ResultSet::FieldsDefinition' ); +} + +diag( "Testing Net::FileMaker::XML::ResultSet::FieldsDefinition, Perl $], $^X" ); diff --git a/t/04_field_definition/01-fields.t b/t/04_field_definition/01-fields.t new file mode 100644 index 0000000..678b59d --- /dev/null +++ b/t/04_field_definition/01-fields.t @@ -0,0 +1,33 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} && $ENV{FMS_LAYOUT} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); +use_ok('Net::FileMaker::XML::ResultSet'); + + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); + +my $dbx = $fmx->dbnames; +my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); +ok($fmdb,'Logged in'); + +my $layouts = $fmdb->layoutnames; +if(ref($layouts) eq 'ARRAY') +{ + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1})->{_field_def}; + is(ref($records->fields), 'HASH', 'the fields method returns an Hash'); +} + +done_testing(); diff --git a/t/05_row/00-load.t b/t/05_row/00-load.t new file mode 100644 index 0000000..ea8b2cc --- /dev/null +++ b/t/05_row/00-load.t @@ -0,0 +1,13 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 1; + +BEGIN +{ + use_ok( 'Net::FileMaker::XML::ResultSet::Row' ); +} + +diag( "Net::FileMaker::XML::ResultSet::Row, Perl $], $^X" ); diff --git a/t/05_row/01-inflated.t b/t/05_row/01-inflated.t new file mode 100644 index 0000000..2d04943 --- /dev/null +++ b/t/05_row/01-inflated.t @@ -0,0 +1,44 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More; + +unless ( $ENV{FMS_HOST} && $ENV{FMS_USER} && $ENV{FMS_PASS} && $ENV{FMS_LAYOUT} ) +{ + plan( skip_all => "FileMaker Server and authentication not declared" ); +} + +use_ok('Net::FileMaker'); +use_ok('Net::FileMaker::XML'); +use_ok('Net::FileMaker::XML::ResultSet'); + + +# Direct access the package +my $fmx = Net::FileMaker::XML->new( host => $ENV{FMS_HOST}); +ok($fmx, 'Directly constructed Net::FileMaker::XML'); + +my $dbx = $fmx->dbnames; +my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); +ok($fmdb,'Logged in'); + +my $layouts = $fmdb->layoutnames; +my $success = 1; +if(ref($layouts) eq 'ARRAY') +{ + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 2})->rows; + + for my $row (@$records){ + my $fields = $row->get_inflated_columns; + foreach my $key (keys %$fields) { + my $col = $fields->{$key}; + if(defined $col){ + $success = 0 if(ref $col !~ m/^(ARRAY|SCALAR|DateTime)$/xms); + } + } + } + +} +$success == 1 ? pass() : fail(); +done_testing(); From 5e6e6da75a7c695f7ea63d22306102c6dab82a37 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 15:46:19 +0100 Subject: [PATCH 32/90] see previous log message --- lib/Net/FileMaker/XML/Database.pm | 13 +++++++------ lib/Net/FileMaker/XML/ResultSet.pm | 3 +-- .../XML/ResultSet/FieldsDefinition/Field.pm | 5 +---- lib/Net/FileMaker/XML/ResultSet/Row.pm | 1 - t/01_xml/05-findany.t | 2 +- t/03_resultset/01-instantiation.t | 9 ++++++--- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 3155967..49defc8 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -2,6 +2,7 @@ package Net::FileMaker::XML::Database; use strict; use warnings; +use Net::FileMaker::XML::ResultSet; our @ISA = qw(Net::FileMaker::XML); @@ -107,7 +108,7 @@ sub scriptnames =head2 find(layout => $layout, params => { parameters }) -Returns a hashref of rows on a specific database and layout. +Returns Net::FileMaker::XML::ResultSet for a specific database and layout. =cut @@ -126,13 +127,13 @@ sub find params => $args{params} ); - return $xml; + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) -Returns all rows on a specific database and layout. +Returns a Net::FileMaker::XML::ResultSet of all rows on a specific database and layout. nocheck is an optional argument that will skip checking of parameters if set to 1. @@ -171,12 +172,12 @@ sub findall params => $params ); - return $xml; + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } =head2 findany(layout => $layout, params => { parameters }, nocheck => 1) -Returns a hashref of random rows on a specific database and layout. +Returns Net::FileMaker::XML::ResultSet of random rows on a specific database and layout. nocheck is an optional argument that will skip checking of parameters if set to 1. @@ -215,7 +216,7 @@ sub findany params => $params ); - return $xml; + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } =head2 total_rows(layout => $layout) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index a6aaae8..9ca0aca 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -213,8 +213,7 @@ sub _parse_rows require Net::FileMaker::XML::ResultSet::Row; my $cd = $self->fields_definition; # column definition, I need it for the inflater my $ds = $self->datasource; - - if($self->fetch_size == 1){ + if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($self->{_res_hash}{resultset}{record}, $cd , $ds); }else{ for my $row (@{$self->{_res_hash}{resultset}{record}}){ diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 1a27572..76ebf5c 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -15,10 +15,7 @@ our @ISA = qw(Exporter Net::FileMaker::XML); # Do not simply export all your public functions/methods/constants. our @EXPORT_OK = ( ); -our @EXPORT = qw( - - -); +our @EXPORT = qw(); =head1 NAME diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index a779a2a..7b7e8b3 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -115,7 +115,6 @@ sub get_inflated if(defined $self->{_col_def}{$col}){ if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ # let's convert it to a DateTime - print STDERR $self->{_col_def}{$col}{result}; my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' my $cldr = new DateTime::Format::CLDR( pattern => $pattern diff --git a/t/01_xml/05-findany.t b/t/01_xml/05-findany.t index 2692747..02f7db7 100644 --- a/t/01_xml/05-findany.t +++ b/t/01_xml/05-findany.t @@ -26,7 +26,7 @@ if(ref($dbx) eq 'ARRAY') if(ref($layouts) eq 'ARRAY') { my $findall = $fmdb->findany(layout => $layouts->[0], params => { '-max' => 1}); - is(ref($findall), 'HASH', 'findany() returned hashref'); + is(ref($findall), 'Net::FileMaker::XML::ResultSet', 'findany() returned Net::FileMaker::XML::ResultSet'); } } diff --git a/t/03_resultset/01-instantiation.t b/t/03_resultset/01-instantiation.t index 291b77e..49cb0e8 100644 --- a/t/03_resultset/01-instantiation.t +++ b/t/03_resultset/01-instantiation.t @@ -23,8 +23,11 @@ my $dbx = $fmx->dbnames; my $fmdb = $fmx->database(db => $dbx->[0], user => $ENV{FMS_USER}, pass => $ENV{FMS_PASS}); ok($fmdb,'Logged in'); -my $records = $fmdb->find(layout => $ENV{FMS_LAYOUT}, params => { '-max' => '3'}); -my $rs = Net::FileMaker::XML::ResultSet->new(rs => $records , db => $fmdb); -ok($rs, 'Directly constructed Net::FileMaker::XML::ResultSet'); +my $layouts = $fmdb->layoutnames; +if(ref($layouts) eq 'ARRAY') +{ + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1}); + ok($records, 'Directly constructed Net::FileMaker::XML::ResultSet'); +} done_testing(); From 22eeced0f87dbec24a99374d5d13a52738caba8d Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 16:14:58 +0100 Subject: [PATCH 33/90] modified doc --- lib/Net/FileMaker/XML/ResultSet.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 9ca0aca..0114cf8 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -82,7 +82,7 @@ sub _parse_field_definition =head2 fields_definition -returns the fields definition ( see L for details on what it might return ) +returns an hash with the fields' definition ( see L for details on what it might return each definition ) =cut @@ -95,10 +95,10 @@ sub fields_definition =head2 datasource -return useful informations about the datasource. +return an hash with useful informations about the datasource. you don't need to use these infos to parse the date|time|timestamp fields as it is already done by the get_inflated* methods of each row returned by the I method. -returns: +the hash contains: =over 4 From 1bda41d0c2cf8c781e59c4d76862a50cb2e77aa5 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 17:08:34 +0100 Subject: [PATCH 34/90] updated the MANIFEST --- MANIFEST | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MANIFEST b/MANIFEST index afd2e33..47ad2ec 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,11 +5,17 @@ README lib/Net/FileMaker.pm lib/Net/FileMaker/XML.pm lib/Net/FileMaker/XML/Database.pm +lib/Net/FileMaker/XML/ResultSet.pm +lib/Net/FileMaker/XML/ResultSet/FiedlsDefinition.pm +lib/Net/FileMaker/XML/ResultSet/Row.pm +lib/Net/FileMaker/XML/ResultSet/FiedlsDefinition/Field.pm lib/Net/FileMaker/Error.pm lib/Net/FileMaker/Error/EN/XML.pm lib/Net/FileMaker/Error/EN/XSLT.pm lib/Net/FileMaker/Error/JA/XML.pm lib/Net/FileMaker/Error/JA/XSLT.pm +lib/Net/FileMaker/Error/IT/XML.pm +lib/Net/FileMaker/Error/IT/XSLT.pm lib/Net/FileMaker/Error/DE/XML.pm t/00_load/00-net-filemaker.t t/01_xml/00-load.t @@ -21,5 +27,12 @@ t/01_xml/05-findany.t t/02_error/00-load.t t/02_error/01-en.t t/02_error/02-ja.t +t/03_resultset/00-load.t +t/03_resultset/01-instantiation.t +t/03_resultset/02-rows.t +t/04_field_definition/00-load.t +t/04_field_definition/01-fields.t +t/05_row/00-load.t +t/05_row/01-inflated.t t/manifest.t t/pod.t From 3306aa300a162f9244150e326fe9ac4884f8e897 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 17:15:39 +0100 Subject: [PATCH 35/90] added DateTime dependency --- Makefile.PL | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.PL b/Makefile.PL index 52e2c72..884c3f9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,6 +15,7 @@ WriteMakefile( 'Test::More' => 0, 'LWP' => 0, 'URI' => 0, + 'DateTime' => 0, 'XML::Twig' => "3.33", }, From bb58910d553e6f69803af6e60d04a10482a0e340 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 11 Jan 2011 18:23:12 +0100 Subject: [PATCH 36/90] corrected path error --- MANIFEST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 47ad2ec..2564691 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6,9 +6,9 @@ lib/Net/FileMaker.pm lib/Net/FileMaker/XML.pm lib/Net/FileMaker/XML/Database.pm lib/Net/FileMaker/XML/ResultSet.pm -lib/Net/FileMaker/XML/ResultSet/FiedlsDefinition.pm +lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm lib/Net/FileMaker/XML/ResultSet/Row.pm -lib/Net/FileMaker/XML/ResultSet/FiedlsDefinition/Field.pm +lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm lib/Net/FileMaker/Error.pm lib/Net/FileMaker/Error/EN/XML.pm lib/Net/FileMaker/Error/EN/XSLT.pm From 369064402904a2923b1a8cb4f2f572fd7ba8f6a3 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 10:31:32 +0100 Subject: [PATCH 37/90] Corrected Moose and Export issues. Rewrote in a more elegant way FieldsDefinition::Field::_parse --- lib/Net/FileMaker/XML/ResultSet.pm | 18 +--------- .../XML/ResultSet/FieldsDefinition.pm | 17 ---------- .../XML/ResultSet/FieldsDefinition/Field.pm | 33 ++++++------------- lib/Net/FileMaker/XML/ResultSet/Row.pm | 23 +++---------- 4 files changed, 15 insertions(+), 76 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 0114cf8..94ac2ae 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -2,24 +2,8 @@ package Net::FileMaker::XML::ResultSet; use strict; use warnings; -use Moose; use Net::FileMaker::XML; -require Exporter; -use AutoLoader qw(AUTOLOAD); - -our @ISA = qw(Exporter Net::FileMaker::XML); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -our @EXPORT_OK = ( ); - -our @EXPORT = qw( - - -); - =head1 NAME Net::FileMaker::XML::ResultSet @@ -217,7 +201,7 @@ sub _parse_rows push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($self->{_res_hash}{resultset}{record}, $cd , $ds); }else{ for my $row (@{$self->{_res_hash}{resultset}{record}}){ - push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($row, $cd,$ds); + push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($row, $cd,$ds,$self->{_db}); } } } diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 56007e6..7ec6cc1 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -2,23 +2,6 @@ package Net::FileMaker::XML::ResultSet::FieldsDefinition; use strict; use warnings; -use Moose; - - -require Exporter; -use AutoLoader qw(AUTOLOAD); - -our @ISA = qw(Exporter Net::FileMaker::XML); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -our @EXPORT_OK = ( ); - -our @EXPORT = qw( - - -); =head1 NAME diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 76ebf5c..3e68d8e 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -2,21 +2,8 @@ package Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; use strict; use warnings; -use Moose; use Carp; -require Exporter; -use AutoLoader qw(AUTOLOAD); - -our @ISA = qw(Exporter Net::FileMaker::XML); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -our @EXPORT_OK = ( ); - -our @EXPORT = qw(); - =head1 NAME Net::FileMaker::XML::ResultSet::FieldsDefinition::Field @@ -55,16 +42,16 @@ sub new sub _parse { my $self = shift; - $self->{global} = $self->{_res_hash}{global} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{global} ; - $self->{'numeric-only'} = $self->{_res_hash}{'numeric-only'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'numeric-only'}; - $self->{'four-digit-year'} = $self->{_res_hash}{'four-digit-year'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'four-digit-year'}; - $self->{'not-empty'} = $self->{_res_hash}{'not-empty'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'not-empty'}; - $self->{'auto-enter'} = $self->{_res_hash}{'auto-enter'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'auto-enter'}; - $self->{type} = $self->{_res_hash}{type} if defined $self->{_res_hash}{type}; - $self->{'time-of-day'} = $self->{_res_hash}{'time-of-day'} eq 'no' ? 0 : 1 if defined $self->{_res_hash}{'time-of-day'}; - $self->{'max-repeat'} = $self->{_res_hash}{'max-repeat'} if defined $self->{_res_hash}{'max-repeat'}; - $self->{'max-characters'} = $self->{_res_hash}{'max-characters'} if defined $self->{_res_hash}{'max-characters'}; - $self->{result} = $self->{_res_hash}{result} if defined $self->{_res_hash}{result}; + + # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 + my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); + foreach my $key (keys %{$self->{_res_hash}}) { + if(grep $_ eq $key, @bools){ + $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; + }else{ + $self->{$key} = $self->{_res_hash}{$key}; + } + } } =head2 get('field') diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 7b7e8b3..555585b 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -2,26 +2,10 @@ package Net::FileMaker::XML::ResultSet::Row; use strict; use warnings; -use Moose; use Carp; use DateTime; use DateTime::Format::CLDR; -require Exporter; -use AutoLoader qw(AUTOLOAD); - -our @ISA = qw(Exporter Net::FileMaker::XML); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -our @EXPORT_OK = ( ); - -our @EXPORT = qw( - - -); - =head1 NAME Net::FileMaker::XML::ResultSet::FieldsDefinition::Row @@ -44,11 +28,12 @@ This module handles the single row of the resultset returned by the Net::FileMak sub new { - my($class, $res_hash , $col_def , $data_source) = @_; + my($class, $res_hash , $col_def , $data_source , $db) = @_; my $self = { _col_def => $col_def, _datasource => $data_source, - _res_hash => $res_hash + _res_hash => $res_hash, + _db_ref => $db }; bless $self; $self->_parse; @@ -85,7 +70,7 @@ sub mod_id sub record_id { my $self = shift; - return $self->{_res_hash}{'mod-id'}; + return $self->{_res_hash}{'record-id'}; } From 79d832b5d4484598072131e3a27ad19b2ed3cbfe Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 10:41:47 +0100 Subject: [PATCH 38/90] fixed dependencies --- Makefile.PL | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 884c3f9..a8e6d2b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,10 +12,11 @@ WriteMakefile( : ()), PREREQ_PM => { - 'Test::More' => 0, + 'Test::More' => 0, 'LWP' => 0, 'URI' => 0, - 'DateTime' => 0, + 'DateTime::Format::CLDR' => 0, + 'Carp' => 0, 'XML::Twig' => "3.33", }, From 9a890d11275f65d6d76f31a82a21e36d8973ccae Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 12:33:57 +0100 Subject: [PATCH 39/90] corrected Indirect Object Syntax using Perl::Critic with Objects::ProhibitIndirectSyntax plugin. --- lib/Net/FileMaker/XML/ResultSet.pm | 6 +++--- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm | 2 +- lib/Net/FileMaker/XML/ResultSet/Row.pm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 94ac2ae..ce943d5 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -61,7 +61,7 @@ sub _parse_field_definition { my ($self) = @_; require Net::FileMaker::XML::ResultSet::FieldsDefinition; - $self->{_field_def} = new Net::FileMaker::XML::ResultSet::FieldsDefinition($self->{_res_hash}{metadata}{'field-definition'}); + $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); } =head2 fields_definition @@ -198,10 +198,10 @@ sub _parse_rows my $cd = $self->fields_definition; # column definition, I need it for the inflater my $ds = $self->datasource; if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($self->{_res_hash}{resultset}{record}, $cd , $ds); + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); }else{ for my $row (@{$self->{_res_hash}{resultset}{record}}){ - push @{$self->{_rows}} , new Net::FileMaker::XML::ResultSet::Row($row, $cd,$ds,$self->{_db}); + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); } } } diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 7ec6cc1..547201d 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -44,7 +44,7 @@ sub _parse{ my %fields; require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; foreach my $key (sort keys %{$self->{_res_hash}}) { - $fields{$key} = new Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); } $self->{fields} = \%fields; } diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 555585b..62c9f3f 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -101,7 +101,7 @@ sub get_inflated if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ # let's convert it to a DateTime my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - my $cldr = new DateTime::Format::CLDR( + my $cldr = DateTime::Format::CLDR->new( pattern => $pattern ); return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); From 1a59ebc25987ff080529648eeb84d4abe64a7c25 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 13:52:38 +0100 Subject: [PATCH 40/90] substituted tabs with 4 spaces --- lib/Net/FileMaker/Error/IT/XML.pm | 454 +++++++++--------- lib/Net/FileMaker/Error/IT/XSLT.pm | 84 ++-- lib/Net/FileMaker/XML/ResultSet.pm | 100 ++-- .../XML/ResultSet/FieldsDefinition.pm | 42 +- .../XML/ResultSet/FieldsDefinition/Field.pm | 46 +- lib/Net/FileMaker/XML/ResultSet/Row.pm | 100 ++-- 6 files changed, 413 insertions(+), 413 deletions(-) diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm index a6cf727..2355676 100644 --- a/lib/Net/FileMaker/Error/IT/XML.pm +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -18,242 +18,242 @@ L =cut my $error_codes = { - '-1' => 'Errore sconosciuto', - 0 => 'Nessun errore', - 1 => "Azione annullata dall'utente", - 2 => "Errore di memoria", - 3 => "Comando non disponibile (ad esempio, sistema operativo non appropriato, modo errato e così via)", - 4 => "Comando sconosciuto", - 5 => "Comando non valido (ad esempio, un'istruzione di script Definisci il campo priva di calcolo)", - 6 => "File di sola lettura", - 7 => "Memoria esaurita", - 8 => "Risultato vuoto", - 9 => "Privilegi insufficienti", - 10 => "Dati richiesti non disponibili", - 11 => "Nome non valido", - 12 => "Il nome esiste già", - 13 => "File o oggetto in uso", - 14 => "Fuori intervallo", - 15 => "Impossibile dividere per zero", - 16 => "Operazione non riuscita, nuovo tentativo richiesta (ad esempio una query dell'utente)", - 17 => "Tentativo di convertire il set di caratteri stranieri in UTF-16 non riuscito", - 18 => "Il client deve fornire le informazioni sull'account per procedere", - 19 => "La stringa contiene caratteri diversi da A-Z, a-z, 0-9 (ASCII)", - 20 => "Comando o operazione cancellata dallo script triggerato", - 100 => "Manca un file", - 101 => "Manca un record", - 102 => "Manca un campo", - 103 => "Manca una relazione", - 104 => "Manca uno script", - 105 => "Manca un formato", - 106 => "Manca una tabella", - 107 => "Manca un indice", - 108 => "Manca una lista valori", - 109 => "Manca un set di privilegi", - 110 => "Mancano tabelle correlate", - 111 => "Ripetizione campo non valida", - 112 => "Manca una finestra", - 113 => "Manca una funzione", - 114 => "Manca un riferimento al file", - 115 => "Il set di menu specificato non è presente", - 116 => "L'oggetto formato specificato non è presente", - 117 => "L'origine dati specificata non è presente", - 130 => "File danneggiati o non presenti; reinstallarli", - 131 => "Impossibile trovare i file del supporto per la lingua (come i file modello)", - 200 => "Accesso al record negato", - 201 => "Impossibile modificare il campo", - 202 => "Accesso al campo negato", - 203 => "Nel file non c'è nessun record da stampare o la password non consente l'accesso alla stampa", - 204 => "Nessun accesso ai campi nei criteri di ordinamento", - 205 => "L'utente non dispone dei privilegi di accesso per creare nuovi record; l'importazione sovrascriverà i dati esistenti", - 206 => "L'utente non dispone del privilegio per cambiare la password o il file non è modificabile", - 207 => "L'utente non ha privilegi sufficienti per cambiare lo schema del database, oppure il file non è modificabile", - 208 => "La password non contiene abbastanza caratteri", - 209 => "La nuova password deve essere diversa da quella esistente", - 210 => "L'account utente è inattivo", - 211 => "La password è scaduta", - 212 => "Nome utente e/o password non validi. Riprovare", - 213 => "Il nome utente e/o la password non esistono", - 214 => "Troppi tentativi di accesso", - 215 => "I privilegi di amministratore non possono essere duplicati", - 216 => "L'account Ospite non può essere duplicato", - 217 => "L'utente non dispone di privilegi sufficienti per modificare l'account Admin", - 300 => "File bloccato o in uso", - 301 => "Record usato da un altro utente", - 302 => "Tabella usata da un altro utente", - 303 => "Schema database usato da un altro utente", - 304 => "Formato usato da un altro utente", - 306 => "ID modifica del record non corrispondente", - 400 => "Criteri di ricerca vuoti", - 401 => "Nessun record soddisfa la richiesta", - 402 => "Il campo selezionato non è un campo di confronto per un riferimento", - 403 => "Limite massimo di record per la versione di prova di FileMaker Pro superato", - 404 => "Criterio di ordinamento non valido", - 405 => "Il numero di record specificato supera il numero di record che possono essere omessi", - 406 => "Criteri di sostituzione/riserializzazione non validi", - 407 => "Manca uno o entrambi i campi di confronto (relazione non valida)", - 408 => "Tipo di dati associato al campo specificato non valido per questa operazione", - 409 => "Ordine di importazione non valido", - 410 => "Ordine di esportazione non valido", - 412 => "Per recuperare il file è stata usata una versione errata di FileMaker Pro", - 413 => "Tipo di campo non valido", - 414 => "Il formato non può visualizzare il risultato", - 415 => "Uno o più record correlati richiesti non sono disponibili", - 416 => "Chiave primaria richiesta dalla tabella di origine dati", - 417 => "Il database non è supportato per le operazioni ODBC", - 500 => "Il valore della data non soddisfa le opzioni di verifica", - 501 => "Il valore dell'ora non soddisfa le opzioni di verifica", - 502 => "Il valore del numero non soddisfa le opzioni di verifica", - 503 => "Il valore nel campo non è compreso nell'intervallo specificato nelle opzioni di verifica", - 504 => "Il valore del campo non è univoco come richiesto dalle opzioni di verifica", - 505 => "Il valore del campo non esiste nel file di database come richiesto dalle opzioni di verifica", - 506 => "Il valore nel campo non è elencato nella lista di valori specificata nelle opzioni di verifica", - 507 => "Il valore nel campo non ha superato il test del calcolo dell'opzione di verifica", - 508 => "Valore non valido immesso in modo Trova", - 509 => "Il campo richiede un valore valido", - 510 => "Valore correlato vuoto o non disponibile", - 511 => "Il valore immesso nel campo supera il numero massimo di caratteri consentiti", - 512 => "Il record è già stato modificato da un altro utente", - 513 => "Il record deve comprendere almeno un valore in un campo per poter essere creato", - 600 => "Errore di stampa", - 601 => "La combinazione di intestazione e piè di pagina supera una pagina", - 602 => "Il corpo non rientra in una pagina per l'impostazione della colonna corrente", - 603 => "Connessione di stampa interrotta", - 700 => "Tipo di file errato per l'importazione", - 706 => "File EPSF privo di immagine di anteprima", - 707 => "Impossibile trovare traduttore per immagini", - 708 => "Impossibile importare il file. È necessario un computer a colori", - 709 => "Non è riuscita l'importazione del filmato QuickTime", - 710 => "Impossibile aggiornare il riferimento QuickTime. Il file di database è di sola lettura", - 711 => "Impossibile trovare il traduttore per l'importazione", - 714 => "Operazione non consentita dai privilegi della password", - 715 => "È stato specificato un foglio di lavoro di Excel o un intervallo con nome mancante", - 716 => "Una query SQL che impiega istruzioni DELETE, INSERT o UPDATE non è consentita per l'importazione ODBC", - 717 => "Informazioni XML/XSL insufficienti per procedere con l'importazione o l'esportazione", - 718 => "Errore di analisi del file XML (da Xerces)", - 719 => "Errore di conversione XML usando XSL (da Xalan)", - 720 => "Errore durante l'esportazione; il formato desiderato non supporta i campi multipli", - 721 => "Errore sconosciuto nel parser o nel convertitore", - 722 => "Impossibile importare dati in un file che non ha campi", - 723 => "Non si dispone dell'autorizzazione per aggiungere o modificare record nella tabella di destinazione", - 724 => "Non si dispone dell'autorizzazione per aggiungere record alla tabella di destinazione", - 725 => "Non si dispone dell'autorizzazione per modificare record nella tabella di destinazione", - 726 => "Vi sono più record nel file di importazione che nella tabella di destinazione. Non tutti i record sono stati importati", - 727 => "Vi sono più record nella tabella di destinazione che nel file di importazione. Non tutti i record sono stati aggiornati", - 729 => "Errori durante l'importazione. Impossibile importare i record", - 730 => "Versione Excel non supportata. (Convertire il file in formato Excel 7.0 (Excel 95), Excel 97, 2000 o XP e riprovare)", - 731 => "Il file da importare non contiene dati", - 732 => "Questo file non può essere inserito perché contiene altri file", - 733 => "Una tabella non può essere importata in se stessa", - 734 => "I file di questo tipo non possono essere visualizzati come immagine", - 735 => "I file di questo tipo non possono essere visualizzati come immagine. Verranno inseriti e visualizzati come file", - 736 => "Troppi dati da esportare in questo formato. Sarà troncato", - 800 => "Impossibile creare il file su disco", - 801 => "Impossibile creare il file temporaneo sul disco di sistema", - 802 => "Impossibile aprire il file", - 803 => "Il file è per un singolo utente oppure non è stato possibile trovare l'host", - 804 => "Impossibile aprire il file.", - 805 => "Usare il comando Recupera", - 806 => "Impossibile aprire il file con questa versione di FileMaker Pro", - 807 => "Il file non è un file FileMaker Pro oppure è gravemente danneggiato", - 808 => "Impossibile aprire il file. I privilegi di accesso sono danneggiati", - 809 => "Il disco o il volume è pieno", - 810 => "Il disco o il volume è protetto", - 811 => "Impossibile aprire il file temporaneo come file di FileMaker Pro", - 813 => "Errore di sincronizzazione del record in rete", - 814 => "Impossibile aprire i file. È già aperto il numero massimo", - 815 => "Impossibile aprire il file di riferimento", - 816 => "Impossibile convertire il file", - 817 => "Impossibile aprire il file poiché non fa parte di questa soluzione", - 819 => "Impossibile salvare una copia locale di un file remoto", - 820 => "File in fase di chiusura", - 821 => "L'host ha forzato una disconnessione", - 822 => "File FMI non trovati; reinstallare i file non presenti", - 823 => "Impossibile impostare il file su utente singolo; alcuni ospiti sono connessi", - 824 => "Il file è danneggiato o non è un file FileMaker", - 900 => "Errore generico del modulo di gestione del controllo ortografico", - 901 => "Dizionario principale non installato", - 902 => "Impossibile avviare la Guida", - 903 => "Impossibile usare il comando in un file condiviso", - 904 => "Questo comando non può essere usato in un file ospitato sotto FileMaker Server", - 905 => "Non è selezionato nessun campo attivo; il comando può essere usato solo se un campo è attivo", - 906 => "Il file corrente deve essere condiviso per usare questo comando", - 920 => "Impossibile inizializzare il modulo di gestione del controllo ortografico", - 921 => "Impossibile caricare il dizionario utente per la modifica", - 922 => "Impossibile trovare il dizionario utente", - 923 => "Il dizionario utente è di sola lettura", - 951 => "Errore imprevisto (*)", - 954 => "Grammatica XML non supportata (*)", - 955 => "Nessun nome per il database (*)", - 956 => "È stato superato il numero massimo di sessioni del database (*)", - 957 => "Conflitto tra i comandi (*)", - 958 => "Parametro mancante (*)", - 1200 => "Errore di calcolo generico", - 1201 => "Troppi pochi parametri nella funzione", - 1202 => "Troppi parametri nella funzione", - 1203 => "Fine calcolo non previsto", - 1204 => "Sono previsti un numero, una costante di testo, un nome di campo o una '('", - 1205 => "Il commento non termina con '*/'", - 1206 => "La costante di testo deve terminare con un punto interrogativo", - 1207 => "Parentesi mancante", - 1208 => "Operatore mancante, funzione non trovata o '(' non prevista", - 1209 => "Nome (come nome campo o nome formato) mancante", - 1210 => "La funzione del plug-in è già stata registrata", - 1211 => "Utilizzo della lista valori non consentito in questa funzione", - 1212 => "Qui è previsto un operatore (ad esempio, +, -, *)", - 1213 => "Questa variabile è già stata definita nella funzione Consenti", - 1214 => "MEDIO, CONTEGGIO, ESPANSO, RICAVARIPETIZIONI, MAX, MIN, VPN, DEVST, SOMMA e RICAVARIASSUNTO: espressione trovata dove è necessario un campo solo", - 1215 => "Questo parametro è un parametro non valido per la funzione Get", - 1216 => "Solo i campi Riassunto sono consentiti come primo argomento in RICAVARIASSUNTO", - 1217 => "Il campo di separazione non è valido", - 1218 => "Impossibile valutare il numero", - 1219 => "Non è possibile usare un campo nella propria formula", - 1220 => "Il campo deve essere di tipo normale o Calcolo", - 1221 => "I dati devono essere di tipo Numero, Data, Ora o Indicatore data e ora", - 1222 => "Impossibile memorizzare il calcolo", - 1223 => "La funzione non è implementata", - 1224 => "La funzione non è definita", - 1225 => "La funzione non è supportata in questo contesto", - 1300 => "Il nome specificato non può essere utilizzato", - 1400 => "Errore nell'inizializzazione del driver ODBC; assicurarsi che i driver ODBC siano installati correttamente", - 1401 => "Allocazione ambiente fallita (ODBC)", - 1402 => "Impossibile liberare l'ambiente (ODBC)", - 1403 => "Impossibile disconnettersi (ODBC)", - 1404 => "Impossibile allocare la connessione (ODBC)", - 1405 => "Impossibile liberare la connessione ( ODBC)", - 1406 => "Controllo SQL API (ODBC) fallito", - 1407 => "Impossibile allocare l'istruzione (ODBC)", - 1408 => "Errore esteso (ODBC)", - 1409 => "Errore (ODBC)", - 1410 => "Link comunicazione fallito (ODBC)", - 1411 => "Link comunicazione fallito (ODBC)", - 1412 => "Link comunicazione fallito (ODBC)", - 1413 => "Link comunicazione fallito (ODBC)", - 1450 => "L'azione richiede privilegi PHP estesi", - 1451 => "L'azione richiede che il file corrente sia remoto", - 1501 => "Autenticazione SMTP fallita", - 1502 => "Connessione rifiutata dal server SMTP", - 1503 => "Errore con SSL", - 1504 => "Il server SMTP richiede che la connessione sia cifrata", - 1505 => "L'autenticazione specificata non è supportata dal server SMTP", - 1506 => "L'Email non può essere inviata", - 1507 => "Impossibile registrare all'interno del server SMTP" - + '-1' => 'Errore sconosciuto', + 0 => 'Nessun errore', + 1 => "Azione annullata dall'utente", + 2 => "Errore di memoria", + 3 => "Comando non disponibile (ad esempio, sistema operativo non appropriato, modo errato e così via)", + 4 => "Comando sconosciuto", + 5 => "Comando non valido (ad esempio, un'istruzione di script Definisci il campo priva di calcolo)", + 6 => "File di sola lettura", + 7 => "Memoria esaurita", + 8 => "Risultato vuoto", + 9 => "Privilegi insufficienti", + 10 => "Dati richiesti non disponibili", + 11 => "Nome non valido", + 12 => "Il nome esiste già", + 13 => "File o oggetto in uso", + 14 => "Fuori intervallo", + 15 => "Impossibile dividere per zero", + 16 => "Operazione non riuscita, nuovo tentativo richiesta (ad esempio una query dell'utente)", + 17 => "Tentativo di convertire il set di caratteri stranieri in UTF-16 non riuscito", + 18 => "Il client deve fornire le informazioni sull'account per procedere", + 19 => "La stringa contiene caratteri diversi da A-Z, a-z, 0-9 (ASCII)", + 20 => "Comando o operazione cancellata dallo script triggerato", + 100 => "Manca un file", + 101 => "Manca un record", + 102 => "Manca un campo", + 103 => "Manca una relazione", + 104 => "Manca uno script", + 105 => "Manca un formato", + 106 => "Manca una tabella", + 107 => "Manca un indice", + 108 => "Manca una lista valori", + 109 => "Manca un set di privilegi", + 110 => "Mancano tabelle correlate", + 111 => "Ripetizione campo non valida", + 112 => "Manca una finestra", + 113 => "Manca una funzione", + 114 => "Manca un riferimento al file", + 115 => "Il set di menu specificato non è presente", + 116 => "L'oggetto formato specificato non è presente", + 117 => "L'origine dati specificata non è presente", + 130 => "File danneggiati o non presenti; reinstallarli", + 131 => "Impossibile trovare i file del supporto per la lingua (come i file modello)", + 200 => "Accesso al record negato", + 201 => "Impossibile modificare il campo", + 202 => "Accesso al campo negato", + 203 => "Nel file non c'è nessun record da stampare o la password non consente l'accesso alla stampa", + 204 => "Nessun accesso ai campi nei criteri di ordinamento", + 205 => "L'utente non dispone dei privilegi di accesso per creare nuovi record; l'importazione sovrascriverà i dati esistenti", + 206 => "L'utente non dispone del privilegio per cambiare la password o il file non è modificabile", + 207 => "L'utente non ha privilegi sufficienti per cambiare lo schema del database, oppure il file non è modificabile", + 208 => "La password non contiene abbastanza caratteri", + 209 => "La nuova password deve essere diversa da quella esistente", + 210 => "L'account utente è inattivo", + 211 => "La password è scaduta", + 212 => "Nome utente e/o password non validi. Riprovare", + 213 => "Il nome utente e/o la password non esistono", + 214 => "Troppi tentativi di accesso", + 215 => "I privilegi di amministratore non possono essere duplicati", + 216 => "L'account Ospite non può essere duplicato", + 217 => "L'utente non dispone di privilegi sufficienti per modificare l'account Admin", + 300 => "File bloccato o in uso", + 301 => "Record usato da un altro utente", + 302 => "Tabella usata da un altro utente", + 303 => "Schema database usato da un altro utente", + 304 => "Formato usato da un altro utente", + 306 => "ID modifica del record non corrispondente", + 400 => "Criteri di ricerca vuoti", + 401 => "Nessun record soddisfa la richiesta", + 402 => "Il campo selezionato non è un campo di confronto per un riferimento", + 403 => "Limite massimo di record per la versione di prova di FileMaker Pro superato", + 404 => "Criterio di ordinamento non valido", + 405 => "Il numero di record specificato supera il numero di record che possono essere omessi", + 406 => "Criteri di sostituzione/riserializzazione non validi", + 407 => "Manca uno o entrambi i campi di confronto (relazione non valida)", + 408 => "Tipo di dati associato al campo specificato non valido per questa operazione", + 409 => "Ordine di importazione non valido", + 410 => "Ordine di esportazione non valido", + 412 => "Per recuperare il file è stata usata una versione errata di FileMaker Pro", + 413 => "Tipo di campo non valido", + 414 => "Il formato non può visualizzare il risultato", + 415 => "Uno o più record correlati richiesti non sono disponibili", + 416 => "Chiave primaria richiesta dalla tabella di origine dati", + 417 => "Il database non è supportato per le operazioni ODBC", + 500 => "Il valore della data non soddisfa le opzioni di verifica", + 501 => "Il valore dell'ora non soddisfa le opzioni di verifica", + 502 => "Il valore del numero non soddisfa le opzioni di verifica", + 503 => "Il valore nel campo non è compreso nell'intervallo specificato nelle opzioni di verifica", + 504 => "Il valore del campo non è univoco come richiesto dalle opzioni di verifica", + 505 => "Il valore del campo non esiste nel file di database come richiesto dalle opzioni di verifica", + 506 => "Il valore nel campo non è elencato nella lista di valori specificata nelle opzioni di verifica", + 507 => "Il valore nel campo non ha superato il test del calcolo dell'opzione di verifica", + 508 => "Valore non valido immesso in modo Trova", + 509 => "Il campo richiede un valore valido", + 510 => "Valore correlato vuoto o non disponibile", + 511 => "Il valore immesso nel campo supera il numero massimo di caratteri consentiti", + 512 => "Il record è già stato modificato da un altro utente", + 513 => "Il record deve comprendere almeno un valore in un campo per poter essere creato", + 600 => "Errore di stampa", + 601 => "La combinazione di intestazione e piè di pagina supera una pagina", + 602 => "Il corpo non rientra in una pagina per l'impostazione della colonna corrente", + 603 => "Connessione di stampa interrotta", + 700 => "Tipo di file errato per l'importazione", + 706 => "File EPSF privo di immagine di anteprima", + 707 => "Impossibile trovare traduttore per immagini", + 708 => "Impossibile importare il file. È necessario un computer a colori", + 709 => "Non è riuscita l'importazione del filmato QuickTime", + 710 => "Impossibile aggiornare il riferimento QuickTime. Il file di database è di sola lettura", + 711 => "Impossibile trovare il traduttore per l'importazione", + 714 => "Operazione non consentita dai privilegi della password", + 715 => "È stato specificato un foglio di lavoro di Excel o un intervallo con nome mancante", + 716 => "Una query SQL che impiega istruzioni DELETE, INSERT o UPDATE non è consentita per l'importazione ODBC", + 717 => "Informazioni XML/XSL insufficienti per procedere con l'importazione o l'esportazione", + 718 => "Errore di analisi del file XML (da Xerces)", + 719 => "Errore di conversione XML usando XSL (da Xalan)", + 720 => "Errore durante l'esportazione; il formato desiderato non supporta i campi multipli", + 721 => "Errore sconosciuto nel parser o nel convertitore", + 722 => "Impossibile importare dati in un file che non ha campi", + 723 => "Non si dispone dell'autorizzazione per aggiungere o modificare record nella tabella di destinazione", + 724 => "Non si dispone dell'autorizzazione per aggiungere record alla tabella di destinazione", + 725 => "Non si dispone dell'autorizzazione per modificare record nella tabella di destinazione", + 726 => "Vi sono più record nel file di importazione che nella tabella di destinazione. Non tutti i record sono stati importati", + 727 => "Vi sono più record nella tabella di destinazione che nel file di importazione. Non tutti i record sono stati aggiornati", + 729 => "Errori durante l'importazione. Impossibile importare i record", + 730 => "Versione Excel non supportata. (Convertire il file in formato Excel 7.0 (Excel 95), Excel 97, 2000 o XP e riprovare)", + 731 => "Il file da importare non contiene dati", + 732 => "Questo file non può essere inserito perché contiene altri file", + 733 => "Una tabella non può essere importata in se stessa", + 734 => "I file di questo tipo non possono essere visualizzati come immagine", + 735 => "I file di questo tipo non possono essere visualizzati come immagine. Verranno inseriti e visualizzati come file", + 736 => "Troppi dati da esportare in questo formato. Sarà troncato", + 800 => "Impossibile creare il file su disco", + 801 => "Impossibile creare il file temporaneo sul disco di sistema", + 802 => "Impossibile aprire il file", + 803 => "Il file è per un singolo utente oppure non è stato possibile trovare l'host", + 804 => "Impossibile aprire il file.", + 805 => "Usare il comando Recupera", + 806 => "Impossibile aprire il file con questa versione di FileMaker Pro", + 807 => "Il file non è un file FileMaker Pro oppure è gravemente danneggiato", + 808 => "Impossibile aprire il file. I privilegi di accesso sono danneggiati", + 809 => "Il disco o il volume è pieno", + 810 => "Il disco o il volume è protetto", + 811 => "Impossibile aprire il file temporaneo come file di FileMaker Pro", + 813 => "Errore di sincronizzazione del record in rete", + 814 => "Impossibile aprire i file. È già aperto il numero massimo", + 815 => "Impossibile aprire il file di riferimento", + 816 => "Impossibile convertire il file", + 817 => "Impossibile aprire il file poiché non fa parte di questa soluzione", + 819 => "Impossibile salvare una copia locale di un file remoto", + 820 => "File in fase di chiusura", + 821 => "L'host ha forzato una disconnessione", + 822 => "File FMI non trovati; reinstallare i file non presenti", + 823 => "Impossibile impostare il file su utente singolo; alcuni ospiti sono connessi", + 824 => "Il file è danneggiato o non è un file FileMaker", + 900 => "Errore generico del modulo di gestione del controllo ortografico", + 901 => "Dizionario principale non installato", + 902 => "Impossibile avviare la Guida", + 903 => "Impossibile usare il comando in un file condiviso", + 904 => "Questo comando non può essere usato in un file ospitato sotto FileMaker Server", + 905 => "Non è selezionato nessun campo attivo; il comando può essere usato solo se un campo è attivo", + 906 => "Il file corrente deve essere condiviso per usare questo comando", + 920 => "Impossibile inizializzare il modulo di gestione del controllo ortografico", + 921 => "Impossibile caricare il dizionario utente per la modifica", + 922 => "Impossibile trovare il dizionario utente", + 923 => "Il dizionario utente è di sola lettura", + 951 => "Errore imprevisto (*)", + 954 => "Grammatica XML non supportata (*)", + 955 => "Nessun nome per il database (*)", + 956 => "È stato superato il numero massimo di sessioni del database (*)", + 957 => "Conflitto tra i comandi (*)", + 958 => "Parametro mancante (*)", + 1200 => "Errore di calcolo generico", + 1201 => "Troppi pochi parametri nella funzione", + 1202 => "Troppi parametri nella funzione", + 1203 => "Fine calcolo non previsto", + 1204 => "Sono previsti un numero, una costante di testo, un nome di campo o una '('", + 1205 => "Il commento non termina con '*/'", + 1206 => "La costante di testo deve terminare con un punto interrogativo", + 1207 => "Parentesi mancante", + 1208 => "Operatore mancante, funzione non trovata o '(' non prevista", + 1209 => "Nome (come nome campo o nome formato) mancante", + 1210 => "La funzione del plug-in è già stata registrata", + 1211 => "Utilizzo della lista valori non consentito in questa funzione", + 1212 => "Qui è previsto un operatore (ad esempio, +, -, *)", + 1213 => "Questa variabile è già stata definita nella funzione Consenti", + 1214 => "MEDIO, CONTEGGIO, ESPANSO, RICAVARIPETIZIONI, MAX, MIN, VPN, DEVST, SOMMA e RICAVARIASSUNTO: espressione trovata dove è necessario un campo solo", + 1215 => "Questo parametro è un parametro non valido per la funzione Get", + 1216 => "Solo i campi Riassunto sono consentiti come primo argomento in RICAVARIASSUNTO", + 1217 => "Il campo di separazione non è valido", + 1218 => "Impossibile valutare il numero", + 1219 => "Non è possibile usare un campo nella propria formula", + 1220 => "Il campo deve essere di tipo normale o Calcolo", + 1221 => "I dati devono essere di tipo Numero, Data, Ora o Indicatore data e ora", + 1222 => "Impossibile memorizzare il calcolo", + 1223 => "La funzione non è implementata", + 1224 => "La funzione non è definita", + 1225 => "La funzione non è supportata in questo contesto", + 1300 => "Il nome specificato non può essere utilizzato", + 1400 => "Errore nell'inizializzazione del driver ODBC; assicurarsi che i driver ODBC siano installati correttamente", + 1401 => "Allocazione ambiente fallita (ODBC)", + 1402 => "Impossibile liberare l'ambiente (ODBC)", + 1403 => "Impossibile disconnettersi (ODBC)", + 1404 => "Impossibile allocare la connessione (ODBC)", + 1405 => "Impossibile liberare la connessione ( ODBC)", + 1406 => "Controllo SQL API (ODBC) fallito", + 1407 => "Impossibile allocare l'istruzione (ODBC)", + 1408 => "Errore esteso (ODBC)", + 1409 => "Errore (ODBC)", + 1410 => "Link comunicazione fallito (ODBC)", + 1411 => "Link comunicazione fallito (ODBC)", + 1412 => "Link comunicazione fallito (ODBC)", + 1413 => "Link comunicazione fallito (ODBC)", + 1450 => "L'azione richiede privilegi PHP estesi", + 1451 => "L'azione richiede che il file corrente sia remoto", + 1501 => "Autenticazione SMTP fallita", + 1502 => "Connessione rifiutata dal server SMTP", + 1503 => "Errore con SSL", + 1504 => "Il server SMTP richiede che la connessione sia cifrata", + 1505 => "L'autenticazione specificata non è supportata dal server SMTP", + 1506 => "L'Email non può essere inviata", + 1507 => "Impossibile registrare all'interno del server SMTP" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::IT::XML diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm index 11e975d..7020f84 100644 --- a/lib/Net/FileMaker/Error/IT/XSLT.pm +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -19,57 +19,57 @@ L my $error_codes = { - '-1' => "Errore sconosciuto", - 0 => "Nessun errore", - 10000 => "Nome instestazione non valido", - 10001 => "Il codice status HTTP non è valido", - 10100 => "Errore di sessione sconosciuto", - 10101 => "Il nome della sessione è già in uso", - 10102 => "Non posso accedere alla sessione - probabilmente non esiste", - 10103 => "Sessione scaduta", - 10104 => "L'oggetto della sessione non esiste", - 10200 => "Messaggio di errore sconosciuto", - 10201 => "Errore di formattazione sconosciuto", - 10202 => "Errore nei campi SMTP ", - 10203 => "Errore “Al Campo”", - 10204 => "Errore “Dal Campo”", - 10205 => "Errore “Campo CC ”", - 10206 => "Errore “Campo BCC”", - 10207 => "Errore “Campo Oggetto”", - 10208 => "Errore “Campo Inoltra”", - 10209 => "Errore nel corpo della email", - 10210 => "Errore ricorsivo - tentativo di chiamata a send_email() dentro un foglio di stile XSLT di una email", - 10211 => "Errore di autenticazione SMTP - login fallito o errato metodo di autenticazione", - 10212 => "Utilizzo non valido di una funzione - tentativo di chiamata a set_header(), set_status_code() o set_cookie() dentro un foglio di stile XSLT di una email", - 10213 => "Il server SMTP non è valido o non sta funzionando.", - 10300 => "Errore di formattazione sconosciuto", - 10301 => "Formato data-tempo non valido", - 10302 => "Formato data non valido", - 10303 => "Formato tempo non valido", - 10304 => "Formato giorno non valido", - 10305 => "Formattazione errata per la stringa data-tempo", - 10306 => "Formattazione errata per la stringa data", - 10307 => "Formattazione errata per la stringa tempo", - 10308 => "Formattazione errata per la stringa giorno", - 10309 => "Codifica testo non supportata", - 10310 => "Codifica URL non supportata", - 10311 => "Errore nel pattern dell'Espressione Regolare" - + '-1' => "Errore sconosciuto", + 0 => "Nessun errore", + 10000 => "Nome instestazione non valido", + 10001 => "Il codice status HTTP non è valido", + 10100 => "Errore di sessione sconosciuto", + 10101 => "Il nome della sessione è già in uso", + 10102 => "Non posso accedere alla sessione - probabilmente non esiste", + 10103 => "Sessione scaduta", + 10104 => "L'oggetto della sessione non esiste", + 10200 => "Messaggio di errore sconosciuto", + 10201 => "Errore di formattazione sconosciuto", + 10202 => "Errore nei campi SMTP ", + 10203 => "Errore “Al Campo”", + 10204 => "Errore “Dal Campo”", + 10205 => "Errore “Campo CC ”", + 10206 => "Errore “Campo BCC”", + 10207 => "Errore “Campo Oggetto”", + 10208 => "Errore “Campo Inoltra”", + 10209 => "Errore nel corpo della email", + 10210 => "Errore ricorsivo - tentativo di chiamata a send_email() dentro un foglio di stile XSLT di una email", + 10211 => "Errore di autenticazione SMTP - login fallito o errato metodo di autenticazione", + 10212 => "Utilizzo non valido di una funzione - tentativo di chiamata a set_header(), set_status_code() o set_cookie() dentro un foglio di stile XSLT di una email", + 10213 => "Il server SMTP non è valido o non sta funzionando.", + 10300 => "Errore di formattazione sconosciuto", + 10301 => "Formato data-tempo non valido", + 10302 => "Formato data non valido", + 10303 => "Formato tempo non valido", + 10304 => "Formato giorno non valido", + 10305 => "Formattazione errata per la stringa data-tempo", + 10306 => "Formattazione errata per la stringa data", + 10307 => "Formattazione errata per la stringa tempo", + 10308 => "Formattazione errata per la stringa giorno", + 10309 => "Codifica testo non supportata", + 10310 => "Codifica URL non supportata", + 10311 => "Errore nel pattern dell'Espressione Regolare" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::IT::XSLT diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index ce943d5..6f9f8ce 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -26,21 +26,21 @@ This module handles the hash returned by the Net::FileMaker::XML search methods sub new { - my($class, %args) = @_; + my($class, %args) = @_; my @rows; - my $self = { - _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods - _db => $args{db}, # ref to the db, it is useful to add an $row->update method later - # these are the references to the parsed blocks - _field_def => undef, - _rows => \@rows - }; - bless $self; - - # let's begin the parsing - $self->_parse; - - return $self; + my $self = { + _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + _db => $args{db}, # ref to the db, it is useful to add an $row->update method later + # these are the references to the parsed blocks + _field_def => undef, + _rows => \@rows + }; + bless $self; + + # let's begin the parsing + $self->_parse; + + return $self; } # _parse @@ -48,10 +48,10 @@ sub new sub _parse { - my $self = shift; - # parse the resultset - $self->_parse_field_definition; - $self->_parse_rows; + my $self = shift; + # parse the resultset + $self->_parse_field_definition; + $self->_parse_rows; } # _parse_field_definition @@ -73,8 +73,8 @@ returns an hash with the fields' definition ( see L{_field_def}->fields; + my $self = shift; + return $self->{_field_def}->fields; } =head2 datasource @@ -121,8 +121,8 @@ the hash contains: sub datasource { - my $self = shift; - return $self->{_res_hash}{datasource}; + my $self = shift; + return $self->{_res_hash}{datasource}; } =head2 xmlns @@ -133,8 +133,8 @@ returns the xml's namespace of the response sub xmlns { - my $self = shift; - return $self->{_res_hash}{xmlns}; + my $self = shift; + return $self->{_res_hash}{xmlns}; } @@ -146,8 +146,8 @@ returns xml's version of the response sub version { - my $self = shift; - return $self->{_res_hash}{version}; + my $self = shift; + return $self->{_res_hash}{version}; } =head2 product @@ -158,23 +158,23 @@ returns an hash with info about the fm db server ( version and build ) sub product { - my $self = shift; - return { - version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, - build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, - } + my $self = shift; + return { + version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, + build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, + } } =head2 total_count - returns an integer representing the total number of rows that match the research, DOES NOT TAKE IN ACCOUNT THE LIMIT CLAUSE + returns an integer representing the total number of rows that match the research, DOES NOT TAKE IN ACCOUNT THE LIMIT CLAUSE =cut sub total_count { - my $self = shift; - return $self->{_res_hash}{resultset}{count}; + my $self = shift; + return $self->{_res_hash}{resultset}{count}; } =head2 fetch_size @@ -185,37 +185,37 @@ returns an integer representing the total number of rows of the resultset, TAKES sub fetch_size { - my $self = shift; - return $self->{_res_hash}{resultset}{'fetch-size'}; + my $self = shift; + return $self->{_res_hash}{resultset}{'fetch-size'}; } # _parse_rows sub _parse_rows { - my $self = shift; - require Net::FileMaker::XML::ResultSet::Row; - my $cd = $self->fields_definition; # column definition, I need it for the inflater - my $ds = $self->datasource; - if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); - }else{ - for my $row (@{$self->{_res_hash}{resultset}{record}}){ - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); - } - } + my $self = shift; + require Net::FileMaker::XML::ResultSet::Row; + my $cd = $self->fields_definition; # column definition, I need it for the inflater + my $ds = $self->datasource; + if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); + }else{ + for my $row (@{$self->{_res_hash}{resultset}{record}}){ + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); + } + } } =head2 rows - returns all the rows of the resultset as Net::FileMaker::XML::ResultSet::Row(s) + returns all the rows of the resultset as Net::FileMaker::XML::ResultSet::Row(s) =cut sub rows { - my $self = shift; - return $self->{_rows}; + my $self = shift; + return $self->{_rows}; } 1; # End of Net::FileMaker::XML::ResultSet; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 547201d..fe5a2ff 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -25,52 +25,52 @@ This module handles the field definition hash returned by the Net::FileMaker::XM sub new { - my($class, $res_hash) = @_; + my($class, $res_hash) = @_; - my $self = { - _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods - # these are the references to the parsed blocks - }; - bless $self; - $self->_parse; - return $self; + my $self = { + _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + # these are the references to the parsed blocks + }; + bless $self; + $self->_parse; + return $self; } # _parse # sub _parse{ - my $self = shift; - my %fields; - require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; - foreach my $key (sort keys %{$self->{_res_hash}}) { - $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); - } - $self->{fields} = \%fields; + my $self = shift; + my %fields; + require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + foreach my $key (sort keys %{$self->{_res_hash}}) { + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + } + $self->{fields} = \%fields; } =head2 get('field') - returns the field definition object (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) + returns the field definition object (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) =cut sub get { - my ( $self, $field ) = @_; - return $self->{fields}{$field}; + my ( $self, $field ) = @_; + return $self->{fields}{$field}; } =head2 fields - returns an hash with the field definition objects (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) + returns an hash with the field definition objects (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) =cut sub fields { - my ( $self, $field ) = @_; - return $self->{fields}; + my ( $self, $field ) = @_; + return $self->{fields}; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 3e68d8e..8caa9bd 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -26,14 +26,14 @@ This module handles the single field definition hash returned by the Net::FileMa sub new { - my($class, $res_hash) = @_; + my($class, $res_hash) = @_; - my $self = { - _res_hash => $res_hash - }; - bless $self; - $self->_parse; - return $self; + my $self = { + _res_hash => $res_hash + }; + bless $self; + $self->_parse; + return $self; } # _parse @@ -41,17 +41,17 @@ sub new sub _parse { - my $self = shift; - - # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 - my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); - foreach my $key (keys %{$self->{_res_hash}}) { + my $self = shift; + + # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 + my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); + foreach my $key (keys %{$self->{_res_hash}}) { if(grep $_ eq $key, @bools){ - $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; + $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; }else{ - $self->{$key} = $self->{_res_hash}{$key}; + $self->{$key} = $self->{_res_hash}{$key}; } - } + } } =head2 get('field') @@ -59,7 +59,7 @@ sub _parse returns the value for the passed parameter it might return ( possible results in parentheses ): - + =over =item * global (0,1) @@ -90,23 +90,23 @@ my @availables = qw( global numeric-only four-digit-year not-empty auto-enter ty sub get { - my ( $self, $par ) = @_; + my ( $self, $par ) = @_; - croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); - return $self->{$par}; + croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); + return $self->{$par}; } =head2 get_all - returns a reference to an hash with all the parameters of this field + returns a reference to an hash with all the parameters of this field =cut sub get_all { - my $self = shift; - my %tmp = map { $_ => $self->{$_} } @availables; - return \%tmp; + my $self = shift; + my %tmp = map { $_ => $self->{$_} } @availables; + return \%tmp; } diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 62c9f3f..cbd07f7 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -28,118 +28,118 @@ This module handles the single row of the resultset returned by the Net::FileMak sub new { - my($class, $res_hash , $col_def , $data_source , $db) = @_; - my $self = { - _col_def => $col_def, - _datasource => $data_source, - _res_hash => $res_hash, - _db_ref => $db - }; - bless $self; - $self->_parse; - return $self; + my($class, $res_hash , $col_def , $data_source , $db) = @_; + my $self = { + _col_def => $col_def, + _datasource => $data_source, + _res_hash => $res_hash, + _db_ref => $db + }; + bless $self; + $self->_parse; + return $self; } # _parse sub _parse{ - my $self = shift; - + my $self = shift; + } =head2 mod_id - returns the mod id for this row + returns the mod id for this row =cut sub mod_id { - my $self = shift; - return $self->{_res_hash}{'mod-id'}; + my $self = shift; + return $self->{_res_hash}{'mod-id'}; } =head2 record_id - returns the record id for this row + returns the record id for this row =cut sub record_id { - my $self = shift; - return $self->{_res_hash}{'record-id'}; + my $self = shift; + return $self->{_res_hash}{'record-id'}; } =head2 get('colname') - returns the value of the selected column for this row + returns the value of the selected column for this row =cut sub get { - my ( $self , $col ) = @_; - return $self->{_res_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + return $self->{_res_hash}{field}{$col}{data}; } =head2 get_inflated('colname') - returns the value of the selected column for this row, if the type is date|time|datetime returns a DateTime obj + returns the value of the selected column for this row, if the type is date|time|datetime returns a DateTime obj =cut sub get_inflated { - my ( $self , $col ) = @_; - # if the field is a “date”, “time” or “timestamp" - if(defined $self->{_col_def}{$col}){ - if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ - # let's convert it to a DateTime - my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - my $cldr = DateTime::Format::CLDR->new( - pattern => $pattern - ); - return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); - } - } - # if the type is one of the ones above let's convert the value in a DateTime - return $self->{_res_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + # if the field is a “date”, “time” or “timestamp" + if(defined $self->{_col_def}{$col}){ + if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ + # let's convert it to a DateTime + my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $cldr = DateTime::Format::CLDR->new( + pattern => $pattern + ); + return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); + } + } + # if the type is one of the ones above let's convert the value in a DateTime + return $self->{_res_hash}{field}{$col}{data}; } =head2 get_columns - returns an hash with column names & relative values for this row + returns an hash with column names & relative values for this row =cut sub get_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { - $res{$k} = $self->get($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get($k); + } + return \%res; } =head2 get_inflated_columns - returns an hash with column names & relative values for this row, if the type is date|time|datetime returns a DateTime obj + returns an hash with column names & relative values for this row, if the type is date|time|datetime returns a DateTime obj =cut sub get_inflated_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { - $res{$k} = $self->get_inflated($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get_inflated($k); + } + return \%res; } From b6de949d8eb4a64a930fcc42ae869fb5aaa26bcf Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:35:53 +0000 Subject: [PATCH 41/90] Removing versioning from packages. --- lib/Net/FileMaker/XML/ResultSet.pm | 10 +--------- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm | 10 +--------- .../FileMaker/XML/ResultSet/FieldsDefinition/Field.pm | 10 +--------- lib/Net/FileMaker/XML/ResultSet/Row.pm | 10 +--------- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 6f9f8ce..0a2dc5e 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -8,14 +8,6 @@ use Net::FileMaker::XML; Net::FileMaker::XML::ResultSet -=head1 VERSION - -Version 0.01 - -=cut - -our $VERSION = 0.01; - =head1 SYNOPSIS This module handles the hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. @@ -219,4 +211,4 @@ sub rows } 1; # End of Net::FileMaker::XML::ResultSet; -__END__ \ No newline at end of file +__END__ diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index fe5a2ff..698069f 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -7,14 +7,6 @@ use warnings; Net::FileMaker::XML::ResultSet::FieldsDefinition -=head1 VERSION - -Version 0.01 - -=cut - -our $VERSION = 0.01; - =head1 SYNOPSIS This module handles the field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. @@ -74,4 +66,4 @@ sub fields } 1; -__END__ \ No newline at end of file +__END__ diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 8caa9bd..b2ed584 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -8,14 +8,6 @@ use Carp; Net::FileMaker::XML::ResultSet::FieldsDefinition::Field -=head1 VERSION - -Version 0.01 - -=cut - -our $VERSION = 0.01; - =head1 SYNOPSIS This module handles the single field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. @@ -111,4 +103,4 @@ sub get_all 1; -__END__ \ No newline at end of file +__END__ diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index cbd07f7..06ba22b 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -10,14 +10,6 @@ use DateTime::Format::CLDR; Net::FileMaker::XML::ResultSet::FieldsDefinition::Row -=head1 VERSION - -Version 0.01 - -=cut - -our $VERSION = 0.01; - =head1 SYNOPSIS This module handles the single row of the resultset returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. @@ -144,4 +136,4 @@ sub get_inflated_columns 1; -__END__ \ No newline at end of file +__END__ From 750b2ac2a93a6123103b1b666b8a926774ae8135 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:39:18 +0000 Subject: [PATCH 42/90] Fixing ResultSet::FieldsDefinition documentation. --- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 698069f..ae7d9ec 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -9,7 +9,9 @@ Net::FileMaker::XML::ResultSet::FieldsDefinition =head1 SYNOPSIS -This module handles the field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. +This module handles the field definition hash returned by the +L search methods. Don't call this module +directly, instead use L. =head1 METHODS @@ -41,9 +43,10 @@ sub _parse{ $self->{fields} = \%fields; } -=head2 get('field') +=head2 get($field_name) - returns the field definition object (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) +Returns the field definition object +(L). =cut @@ -55,7 +58,8 @@ sub get =head2 fields - returns an hash with the field definition objects (Net::FileMaker::XML::ResultSet::FieldsDefinition::Field) +Returns an hash with the field definition objects +(L) =cut @@ -66,4 +70,3 @@ sub fields } 1; -__END__ From 22546a50967d92125e74993efc996b51fd8d2c81 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:40:00 +0000 Subject: [PATCH 43/90] Moving internal functions to the bottom of script - _parse will need documentation. --- .../XML/ResultSet/FieldsDefinition.pm | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index ae7d9ec..744fa6c 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -30,19 +30,6 @@ sub new return $self; } -# _parse -# - -sub _parse{ - my $self = shift; - my %fields; - require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; - foreach my $key (sort keys %{$self->{_res_hash}}) { - $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); - } - $self->{fields} = \%fields; -} - =head2 get($field_name) Returns the field definition object @@ -69,4 +56,18 @@ sub fields return $self->{fields}; } + +# _parse +# +sub _parse +{ + my $self = shift; + my %fields; + require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + foreach my $key (sort keys %{$self->{_res_hash}}) { + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + } + $self->{fields} = \%fields; +} + 1; From 7bee37ebc6801d137137632d73b0109ba9b2da6a Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:46:31 +0000 Subject: [PATCH 44/90] Cleaning up documentation in ResultSet::FieldsDefinition::Field. --- .../XML/ResultSet/FieldsDefinition/Field.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index b2ed584..3d35745 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -10,7 +10,9 @@ Net::FileMaker::XML::ResultSet::FieldsDefinition::Field =head1 SYNOPSIS -This module handles the single field definition hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. +This module handles the single field definition hash returned by the +L search methods. Don't call this module directly, +instead use L. =head1 METHODS @@ -46,11 +48,11 @@ sub _parse } } -=head2 get('field') +=head2 get($field_name) -returns the value for the passed parameter +Returns the value for the supplied field name. -it might return ( possible results in parentheses ): +It may return (possible results in parentheses): =over @@ -90,7 +92,7 @@ sub get =head2 get_all - returns a reference to an hash with all the parameters of this field +Returns a reference to an hash with all the parameters of this field. =cut @@ -103,4 +105,3 @@ sub get_all 1; -__END__ From fcebfa6581b9b7d97f2d5d389537ab84316950f9 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:46:59 +0000 Subject: [PATCH 45/90] Moving internal functions to the bottom in ResultSet::FieldsDefinition::Field. --- .../XML/ResultSet/FieldsDefinition/Field.pm | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 3d35745..4c8f744 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -30,24 +30,6 @@ sub new return $self; } -# _parse -# - -sub _parse -{ - my $self = shift; - - # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 - my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); - foreach my $key (keys %{$self->{_res_hash}}) { - if(grep $_ eq $key, @bools){ - $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; - }else{ - $self->{$key} = $self->{_res_hash}{$key}; - } - } -} - =head2 get($field_name) Returns the value for the supplied field name. @@ -104,4 +86,21 @@ sub get_all } +# _parse +# +sub _parse +{ + my $self = shift; + + # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 + my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); + foreach my $key (keys %{$self->{_res_hash}}) { + if(grep $_ eq $key, @bools){ + $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; + }else{ + $self->{$key} = $self->{_res_hash}{$key}; + } + } +} + 1; From 56707dc3c6aa3fcd73167bc235a6dbad4a81eaba Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:49:25 +0000 Subject: [PATCH 46/90] Documentation cleanup of Resulset::Row. --- lib/Net/FileMaker/XML/ResultSet/Row.pm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 06ba22b..629abcf 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -12,7 +12,9 @@ Net::FileMaker::XML::ResultSet::FieldsDefinition::Row =head1 SYNOPSIS -This module handles the single row of the resultset returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. +This module handles the single row of the resultset returned by the +L search methods. Don't call this module directly, +instead use L. =head1 METHODS @@ -42,7 +44,7 @@ sub _parse{ =head2 mod_id - returns the mod id for this row +Returns the mod id for this row. =cut @@ -55,7 +57,7 @@ sub mod_id =head2 record_id - returns the record id for this row +Returns the record id for this row. =cut @@ -68,7 +70,7 @@ sub record_id =head2 get('colname') - returns the value of the selected column for this row +Returns the value of the selected column for this row. =cut @@ -81,7 +83,8 @@ sub get =head2 get_inflated('colname') - returns the value of the selected column for this row, if the type is date|time|datetime returns a DateTime obj +Returns the value of the selected column for this row. If the type is +date, time or datetime returns, it will return a L object. =cut @@ -105,7 +108,7 @@ sub get_inflated =head2 get_columns - returns an hash with column names & relative values for this row +Returns an hash with column names & relative values for this row. =cut sub get_columns @@ -120,7 +123,8 @@ sub get_columns =head2 get_inflated_columns - returns an hash with column names & relative values for this row, if the type is date|time|datetime returns a DateTime obj +Returns an hash with column names & relative values for this row. If the type is +date, time or datetime returns a L object. =cut @@ -136,4 +140,3 @@ sub get_inflated_columns 1; -__END__ From f228488b95b2158ea1c75298383877499b80b21f Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:50:15 +0000 Subject: [PATCH 47/90] Moving internal function to the bottom of ResultSet::Row. --- lib/Net/FileMaker/XML/ResultSet/Row.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 629abcf..70be496 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -34,14 +34,6 @@ sub new return $self; } - - -# _parse -sub _parse{ - my $self = shift; - -} - =head2 mod_id Returns the mod id for this row. @@ -139,4 +131,12 @@ sub get_inflated_columns } + +# _parse +sub _parse{ + my $self = shift; + +} + + 1; From d1b44d731910a90f616cbb084cbe219d630a801b Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:54:40 +0000 Subject: [PATCH 48/90] Documentation clean up in XML::Resultset. --- lib/Net/FileMaker/XML/ResultSet.pm | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 0a2dc5e..ed5940d 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -10,7 +10,8 @@ Net::FileMaker::XML::ResultSet =head1 SYNOPSIS -This module handles the hash returned by the Net::FileMaker::XML search methods . Don't call this module directly, instead use L. +This module handles the hash returned by the Net::FileMaker::XML search methods. +Don't call this module directly, instead use L. =head1 METHODS @@ -58,8 +59,8 @@ sub _parse_field_definition =head2 fields_definition -returns an hash with the fields' definition ( see L for details on what it might return each definition ) - +Returns an hash with the fields' definition. See +L. =cut @@ -71,8 +72,9 @@ sub fields_definition =head2 datasource -return an hash with useful informations about the datasource. -you don't need to use these infos to parse the date|time|timestamp fields as it is already done by the get_inflated* methods of each row returned by the I method. +Return an hash with useful information about the datasource. +You don't need to use this information to parse the date, time or timestamp fields +as it is already done by the C methods of each row returned by the I method. the hash contains: @@ -119,7 +121,7 @@ sub datasource =head2 xmlns -returns the xml's namespace of the response +Returns the XML namespace of the response. =cut @@ -132,7 +134,7 @@ sub xmlns =head2 version -returns xml's version of the response +Returns the XML version of the response. =cut @@ -144,7 +146,7 @@ sub version =head2 product -returns an hash with info about the fm db server ( version and build ) +Returns an hash with information about the FileMaker Server. =cut @@ -159,7 +161,8 @@ sub product =head2 total_count - returns an integer representing the total number of rows that match the research, DOES NOT TAKE IN ACCOUNT THE LIMIT CLAUSE +Returns an integer representing the total number of rows that match the research +but B take into account the limit clause. =cut @@ -171,7 +174,8 @@ sub total_count =head2 fetch_size -returns an integer representing the total number of rows of the resultset, TAKES IN ACCOUNT THE LIMIT CLAUSE +Returns an integer representing the total number of rows of the resultset, but +does take into account the limit clause. =cut @@ -200,7 +204,8 @@ sub _parse_rows =head2 rows - returns all the rows of the resultset as Net::FileMaker::XML::ResultSet::Row(s) +Returns all the rows of the resultset as L +objects. =cut @@ -210,5 +215,4 @@ sub rows return $self->{_rows}; } -1; # End of Net::FileMaker::XML::ResultSet; -__END__ +1; From 1a688fed56dd0ce558735778a3438a759692d313 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Wed, 12 Jan 2011 13:55:19 +0000 Subject: [PATCH 49/90] Moving internal functions to the bottom of XML::ResulSet. --- lib/Net/FileMaker/XML/ResultSet.pm | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index ed5940d..47081e4 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -36,27 +36,6 @@ sub new return $self; } -# _parse -# calls all the methods that parse the single blocks of the response - -sub _parse -{ - my $self = shift; - # parse the resultset - $self->_parse_field_definition; - $self->_parse_rows; -} - -# _parse_field_definition -# parses the field definition instantiating a N::F::X::D::FieldDefinition - -sub _parse_field_definition -{ - my ($self) = @_; - require Net::FileMaker::XML::ResultSet::FieldsDefinition; - $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); -} - =head2 fields_definition Returns an hash with the fields' definition. See @@ -215,4 +194,25 @@ sub rows return $self->{_rows}; } +# _parse +# calls all the methods that parse the single blocks of the response +sub _parse +{ + my $self = shift; + # parse the resultset + $self->_parse_field_definition; + $self->_parse_rows; +} + +# _parse_field_definition +# parses the field definition instantiating a N::F::X::D::FieldDefinition +sub _parse_field_definition +{ + my ($self) = @_; + require Net::FileMaker::XML::ResultSet::FieldsDefinition; + $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); +} + + + 1; From 25befd638b552e791b878f9db1a1ffe7ceba923d Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 17:40:13 +0100 Subject: [PATCH 50/90] added methods to - insert - edit - delete a record. All these methods return a NFX::ResultSet. TODO: add tests to /t/01_xml --- lib/Net/FileMaker/XML/Database.pm | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 49defc8..5795763 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -3,6 +3,7 @@ package Net::FileMaker::XML::Database; use strict; use warnings; use Net::FileMaker::XML::ResultSet; +use Carp; our @ISA = qw(Net::FileMaker::XML); @@ -131,6 +132,89 @@ sub find } +=head2 edit(layout => 'mylayout' , recid => $recid , params => { params }) + +Updates the value of a specific record column and returns an N::F::X::ResultSet object + +=cut + +sub edit +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + # just to make the recid param more visible than putting it into the params + croak 'recid must be defined' if(! defined $args{recid}); + $args{params}->{'-recid'} = $args{recid}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-edit', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + +=head2 delete(layout => 'mylayout' , recid => $recid , params => { params }) + +Deletes the record with that specific record id and returns an N::F::X::ResultSet object + +=cut + +sub delete +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + # just to make the recid param more visible than putting it into the params + croak 'recid must be defined' if(! defined $args{recid}); + $args{params}->{'-recid'} = $args{recid}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-delete', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + + + +=head2 insert(layout => 'mylayout' , recid => $recid , params => { params }) + +Creates a new record and populates that record with the contents of any name/value pair passed with the params' hash and returns an N::F::X::ResultSet object + +=cut + +sub insert +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-new', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + + =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) Returns a Net::FileMaker::XML::ResultSet of all rows on a specific database and layout. From db333cb10c223e3ac37c9d166cdd253bf8d148df Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Wed, 12 Jan 2011 17:54:31 +0100 Subject: [PATCH 51/90] added a todo --- lib/Net/FileMaker/XML/Database.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 5795763..0400a96 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -138,6 +138,8 @@ Updates the value of a specific record column and returns an N::F::X::ResultSet =cut +#todo: add tests to /t/01_xml + sub edit { my ($self, %args) = @_; From 8d3296dbf281ccf03744901594505ba8bfca685e Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 10:47:02 +0100 Subject: [PATCH 52/90] substituted \s{4} with \t according to the module's guideline --- lib/Net/FileMaker/XML/ResultSet.pm | 120 +++++++++--------- .../XML/ResultSet/FieldsDefinition.pm | 40 +++--- .../XML/ResultSet/FieldsDefinition/Field.pm | 51 ++++---- lib/Net/FileMaker/XML/ResultSet/Row.pm | 88 ++++++------- 4 files changed, 148 insertions(+), 151 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 47081e4..a7adb7f 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -19,21 +19,21 @@ Don't call this module directly, instead use L. sub new { - my($class, %args) = @_; - my @rows; - my $self = { - _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods - _db => $args{db}, # ref to the db, it is useful to add an $row->update method later - # these are the references to the parsed blocks - _field_def => undef, - _rows => \@rows - }; - bless $self; - - # let's begin the parsing - $self->_parse; - - return $self; + my($class, %args) = @_; + my @rows; + my $self = { + _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + _db => $args{db}, # ref to the db, it is useful to add an $row->update method later + # these are the references to the parsed blocks + _field_def => undef, + _rows => \@rows + }; + bless $self; + + # let's begin the parsing + $self->_parse; + + return $self; } =head2 fields_definition @@ -45,8 +45,8 @@ L. sub fields_definition { - my $self = shift; - return $self->{_field_def}->fields; + my $self = shift; + return $self->{_field_def}->fields; } =head2 datasource @@ -61,31 +61,31 @@ the hash contains: =item * database - database file name + database file name =item * layout - kind of layout, eg. 'List + kind of layout, eg. 'List =item * timestamp-format - eg. 'MM/dd/yyyy HH:mm:ss' + eg. 'MM/dd/yyyy HH:mm:ss' =item * date-format - eg. 'MM/dd/yyyy' + eg. 'MM/dd/yyyy' =item * time-format - eg. 'HH:mm:ss' + eg. 'HH:mm:ss' =item * table - name of the selected database table + name of the selected database table =item * total-count - total count of the records in the selected table + total count of the records in the selected table =back @@ -94,8 +94,8 @@ the hash contains: sub datasource { - my $self = shift; - return $self->{_res_hash}{datasource}; + my $self = shift; + return $self->{_res_hash}{datasource}; } =head2 xmlns @@ -106,8 +106,8 @@ Returns the XML namespace of the response. sub xmlns { - my $self = shift; - return $self->{_res_hash}{xmlns}; + my $self = shift; + return $self->{_res_hash}{xmlns}; } @@ -119,8 +119,8 @@ Returns the XML version of the response. sub version { - my $self = shift; - return $self->{_res_hash}{version}; + my $self = shift; + return $self->{_res_hash}{version}; } =head2 product @@ -131,11 +131,11 @@ Returns an hash with information about the FileMaker Server. sub product { - my $self = shift; - return { - version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, - build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, - } + my $self = shift; + return { + version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, + build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, + } } =head2 total_count @@ -147,8 +147,8 @@ but B take into account the limit clause. sub total_count { - my $self = shift; - return $self->{_res_hash}{resultset}{count}; + my $self = shift; + return $self->{_res_hash}{resultset}{count}; } =head2 fetch_size @@ -160,25 +160,25 @@ does take into account the limit clause. sub fetch_size { - my $self = shift; - return $self->{_res_hash}{resultset}{'fetch-size'}; + my $self = shift; + return $self->{_res_hash}{resultset}{'fetch-size'}; } # _parse_rows sub _parse_rows { - my $self = shift; - require Net::FileMaker::XML::ResultSet::Row; - my $cd = $self->fields_definition; # column definition, I need it for the inflater - my $ds = $self->datasource; - if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); - }else{ - for my $row (@{$self->{_res_hash}{resultset}{record}}){ - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); - } - } + my $self = shift; + require Net::FileMaker::XML::ResultSet::Row; + my $cd = $self->fields_definition; # column definition, I need it for the inflater + my $ds = $self->datasource; + if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); + }else{ + for my $row (@{$self->{_res_hash}{resultset}{record}}){ + push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); + } + } } =head2 rows @@ -190,29 +190,27 @@ objects. sub rows { - my $self = shift; - return $self->{_rows}; + my $self = shift; + return $self->{_rows}; } # _parse # calls all the methods that parse the single blocks of the response sub _parse { - my $self = shift; - # parse the resultset - $self->_parse_field_definition; - $self->_parse_rows; + my $self = shift; + # parse the resultset + $self->_parse_field_definition; + $self->_parse_rows; } # _parse_field_definition # parses the field definition instantiating a N::F::X::D::FieldDefinition sub _parse_field_definition { - my ($self) = @_; - require Net::FileMaker::XML::ResultSet::FieldsDefinition; - $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); + my ($self) = @_; + require Net::FileMaker::XML::ResultSet::FieldsDefinition; + $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); } - - 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 744fa6c..2f009b7 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -19,15 +19,15 @@ directly, instead use L. sub new { - my($class, $res_hash) = @_; - - my $self = { - _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods - # these are the references to the parsed blocks - }; - bless $self; - $self->_parse; - return $self; + my($class, $res_hash) = @_; + + my $self = { + _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + # these are the references to the parsed blocks + }; + bless $self; + $self->_parse; + return $self; } =head2 get($field_name) @@ -39,8 +39,8 @@ Returns the field definition object sub get { - my ( $self, $field ) = @_; - return $self->{fields}{$field}; + my ( $self, $field ) = @_; + return $self->{fields}{$field}; } =head2 fields @@ -52,8 +52,8 @@ Returns an hash with the field definition objects sub fields { - my ( $self, $field ) = @_; - return $self->{fields}; + my ( $self, $field ) = @_; + return $self->{fields}; } @@ -61,13 +61,13 @@ sub fields # sub _parse { - my $self = shift; - my %fields; - require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; - foreach my $key (sort keys %{$self->{_res_hash}}) { - $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); - } - $self->{fields} = \%fields; + my $self = shift; + my %fields; + require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + foreach my $key (sort keys %{$self->{_res_hash}}) { + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + } + $self->{fields} = \%fields; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 4c8f744..3778efb 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -20,14 +20,14 @@ instead use L. sub new { - my($class, $res_hash) = @_; - - my $self = { - _res_hash => $res_hash - }; - bless $self; - $self->_parse; - return $self; + my($class, $res_hash) = @_; + + my $self = { + _res_hash => $res_hash + }; + bless $self; + $self->_parse; + return $self; } =head2 get($field_name) @@ -66,10 +66,9 @@ my @availables = qw( global numeric-only four-digit-year not-empty auto-enter ty sub get { - my ( $self, $par ) = @_; - - croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); - return $self->{$par}; + my ( $self, $par ) = @_; + croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); + return $self->{$par}; } =head2 get_all @@ -80,9 +79,9 @@ Returns a reference to an hash with all the parameters of this field. sub get_all { - my $self = shift; - my %tmp = map { $_ => $self->{$_} } @availables; - return \%tmp; + my $self = shift; + my %tmp = map { $_ => $self->{$_} } @availables; + return \%tmp; } @@ -90,17 +89,17 @@ sub get_all # sub _parse { - my $self = shift; - - # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 - my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); - foreach my $key (keys %{$self->{_res_hash}}) { - if(grep $_ eq $key, @bools){ - $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; - }else{ - $self->{$key} = $self->{_res_hash}{$key}; - } - } + my $self = shift; + + # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 + my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); + foreach my $key (keys %{$self->{_res_hash}}) { + if(grep $_ eq $key, @bools){ + $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; + }else{ + $self->{$key} = $self->{_res_hash}{$key}; + } + } } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 70be496..7374615 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -22,16 +22,16 @@ instead use L. sub new { - my($class, $res_hash , $col_def , $data_source , $db) = @_; - my $self = { - _col_def => $col_def, - _datasource => $data_source, - _res_hash => $res_hash, - _db_ref => $db - }; - bless $self; - $self->_parse; - return $self; + my($class, $res_hash , $col_def , $data_source , $db) = @_; + my $self = { + _col_def => $col_def, + _datasource => $data_source, + _res_hash => $res_hash, + _db_ref => $db + }; + bless $self; + $self->_parse; + return $self; } =head2 mod_id @@ -42,8 +42,8 @@ Returns the mod id for this row. sub mod_id { - my $self = shift; - return $self->{_res_hash}{'mod-id'}; + my $self = shift; + return $self->{_res_hash}{'mod-id'}; } @@ -55,8 +55,8 @@ Returns the record id for this row. sub record_id { - my $self = shift; - return $self->{_res_hash}{'record-id'}; + my $self = shift; + return $self->{_res_hash}{'record-id'}; } @@ -68,8 +68,8 @@ Returns the value of the selected column for this row. sub get { - my ( $self , $col ) = @_; - return $self->{_res_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + return $self->{_res_hash}{field}{$col}{data}; } @@ -82,20 +82,20 @@ date, time or datetime returns, it will return a L object. sub get_inflated { - my ( $self , $col ) = @_; - # if the field is a “date”, “time” or “timestamp" - if(defined $self->{_col_def}{$col}){ - if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ - # let's convert it to a DateTime - my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - my $cldr = DateTime::Format::CLDR->new( - pattern => $pattern - ); - return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); - } - } - # if the type is one of the ones above let's convert the value in a DateTime - return $self->{_res_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + # if the field is a “date”, “time” or “timestamp" + if(defined $self->{_col_def}{$col}){ + if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ + # let's convert it to a DateTime + my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $cldr = DateTime::Format::CLDR->new( + pattern => $pattern + ); + return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); + } + } + # if the type is one of the ones above let's convert the value in a DateTime + return $self->{_res_hash}{field}{$col}{data}; } =head2 get_columns @@ -105,12 +105,12 @@ Returns an hash with column names & relative values for this row. =cut sub get_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { - $res{$k} = $self->get($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get($k); + } + return \%res; } =head2 get_inflated_columns @@ -122,20 +122,20 @@ date, time or datetime returns a L object. sub get_inflated_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { - $res{$k} = $self->get_inflated($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + $res{$k} = $self->get_inflated($k); + } + return \%res; } # _parse sub _parse{ - my $self = shift; - + my $self = shift; + } From 2e93ab981e749aba1bae279367d50e38ed32659a Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 11:23:46 +0100 Subject: [PATCH 53/90] corrected \"keys in $self never begin with underscores\" according to the module's guideline --- lib/Net/FileMaker/XML/ResultSet.pm | 37 +++++++++---------- .../XML/ResultSet/FieldsDefinition.pm | 7 ++-- .../XML/ResultSet/FieldsDefinition/Field.pm | 8 ++-- lib/Net/FileMaker/XML/ResultSet/Row.pm | 36 +++++++----------- 4 files changed, 38 insertions(+), 50 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index a7adb7f..cbe9128 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -22,17 +22,14 @@ sub new my($class, %args) = @_; my @rows; my $self = { - _res_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods - _db => $args{db}, # ref to the db, it is useful to add an $row->update method later - # these are the references to the parsed blocks - _field_def => undef, - _rows => \@rows + result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + db => $args{db}, # ref to the db, it is useful to add an $row->update method later + fields_def => undef, # fields definition + rows => \@rows # resultset's rows }; bless $self; - # let's begin the parsing $self->_parse; - return $self; } @@ -46,7 +43,7 @@ L. sub fields_definition { my $self = shift; - return $self->{_field_def}->fields; + return $self->{fields_def}->fields; } =head2 datasource @@ -95,7 +92,7 @@ the hash contains: sub datasource { my $self = shift; - return $self->{_res_hash}{datasource}; + return $self->{result_hash}{datasource}; } =head2 xmlns @@ -107,7 +104,7 @@ Returns the XML namespace of the response. sub xmlns { my $self = shift; - return $self->{_res_hash}{xmlns}; + return $self->{result_hash}{xmlns}; } @@ -120,7 +117,7 @@ Returns the XML version of the response. sub version { my $self = shift; - return $self->{_res_hash}{version}; + return $self->{result_hash}{version}; } =head2 product @@ -133,8 +130,8 @@ sub product { my $self = shift; return { - version => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{version}, - build => $self->{_res_hash}{product}{'FileMaker Web Publishing Engine'}{build}, + version => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{version}, + build => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{build}, } } @@ -148,7 +145,7 @@ but B take into account the limit clause. sub total_count { my $self = shift; - return $self->{_res_hash}{resultset}{count}; + return $self->{result_hash}{resultset}{count}; } =head2 fetch_size @@ -161,7 +158,7 @@ does take into account the limit clause. sub fetch_size { my $self = shift; - return $self->{_res_hash}{resultset}{'fetch-size'}; + return $self->{result_hash}{resultset}{'fetch-size'}; } @@ -173,10 +170,10 @@ sub _parse_rows my $cd = $self->fields_definition; # column definition, I need it for the inflater my $ds = $self->datasource; if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{_res_hash}{resultset}{record}, $cd , $ds); + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{result_hash}{resultset}{record}, $cd , $ds); }else{ - for my $row (@{$self->{_res_hash}{resultset}{record}}){ - push @{$self->{_rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{_db}); + for my $row (@{$self->{result_hash}{resultset}{record}}){ + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{db}); } } } @@ -191,7 +188,7 @@ objects. sub rows { my $self = shift; - return $self->{_rows}; + return $self->{rows}; } # _parse @@ -210,7 +207,7 @@ sub _parse_field_definition { my ($self) = @_; require Net::FileMaker::XML::ResultSet::FieldsDefinition; - $self->{_field_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{_res_hash}{metadata}{'field-definition'}); + $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{result_hash}{metadata}{'field-definition'}); } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 2f009b7..2f6145d 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -22,8 +22,7 @@ sub new my($class, $res_hash) = @_; my $self = { - _res_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods - # these are the references to the parsed blocks + result_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods }; bless $self; $self->_parse; @@ -64,8 +63,8 @@ sub _parse my $self = shift; my %fields; require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; - foreach my $key (sort keys %{$self->{_res_hash}}) { - $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{_res_hash}{$key}); + foreach my $key (sort keys %{$self->{result_hash}}) { + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{result_hash}{$key}); } $self->{fields} = \%fields; } diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 3778efb..28de5da 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -23,7 +23,7 @@ sub new my($class, $res_hash) = @_; my $self = { - _res_hash => $res_hash + result_hash => $res_hash }; bless $self; $self->_parse; @@ -93,11 +93,11 @@ sub _parse # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); - foreach my $key (keys %{$self->{_res_hash}}) { + foreach my $key (keys %{$self->{result_hash}}) { if(grep $_ eq $key, @bools){ - $self->{$key} = $self->{_res_hash}{$key} eq 'no' ? 0 : 1; + $self->{$key} = $self->{result_hash}{$key} eq 'no' ? 0 : 1; }else{ - $self->{$key} = $self->{_res_hash}{$key}; + $self->{$key} = $self->{result_hash}{$key}; } } } diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 7374615..5647fc7 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -24,13 +24,12 @@ sub new { my($class, $res_hash , $col_def , $data_source , $db) = @_; my $self = { - _col_def => $col_def, - _datasource => $data_source, - _res_hash => $res_hash, - _db_ref => $db + columns_def => $col_def, + datasource => $data_source, + result_hash => $res_hash, + db_ref => $db }; bless $self; - $self->_parse; return $self; } @@ -43,7 +42,7 @@ Returns the mod id for this row. sub mod_id { my $self = shift; - return $self->{_res_hash}{'mod-id'}; + return $self->{result_hash}{'mod-id'}; } @@ -56,7 +55,7 @@ Returns the record id for this row. sub record_id { my $self = shift; - return $self->{_res_hash}{'record-id'}; + return $self->{result_hash}{'record-id'}; } @@ -69,7 +68,7 @@ Returns the value of the selected column for this row. sub get { my ( $self , $col ) = @_; - return $self->{_res_hash}{field}{$col}{data}; + return $self->{result_hash}{field}{$col}{data}; } @@ -84,18 +83,18 @@ sub get_inflated { my ( $self , $col ) = @_; # if the field is a “date”, “time” or “timestamp" - if(defined $self->{_col_def}{$col}){ - if($self->{_col_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ + if(defined $self->{columns_def}{$col}){ + if($self->{columns_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ # let's convert it to a DateTime - my $pattern = $self->{_datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $pattern = $self->{datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' my $cldr = DateTime::Format::CLDR->new( pattern => $pattern ); - return $cldr->parse_datetime($self->{_res_hash}{field}{$col}{data}) if(defined $self->{_res_hash}{field}{$col}{data}); + return $cldr->parse_datetime($self->{result_hash}{field}{$col}{data}) if(defined $self->{result_hash}{field}{$col}{data}); } } # if the type is one of the ones above let's convert the value in a DateTime - return $self->{_res_hash}{field}{$col}{data}; + return $self->{result_hash}{field}{$col}{data}; } =head2 get_columns @@ -107,7 +106,7 @@ sub get_columns { my ( $self , $col ) = @_; my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + foreach my $k(sort keys %{$self->{result_hash}{field}}) { $res{$k} = $self->get($k); } return \%res; @@ -124,7 +123,7 @@ sub get_inflated_columns { my ( $self , $col ) = @_; my %res; - foreach my $k(sort keys %{$self->{_res_hash}{field}}) { + foreach my $k(sort keys %{$self->{result_hash}{field}}) { $res{$k} = $self->get_inflated($k); } return \%res; @@ -132,11 +131,4 @@ sub get_inflated_columns -# _parse -sub _parse{ - my $self = shift; - -} - - 1; From bde747ce5a15230d505db56ab551a1a514137cf4 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 11:24:33 +0100 Subject: [PATCH 54/90] corrected outdated test --- t/04_field_definition/01-fields.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/04_field_definition/01-fields.t b/t/04_field_definition/01-fields.t index 678b59d..009ce72 100644 --- a/t/04_field_definition/01-fields.t +++ b/t/04_field_definition/01-fields.t @@ -26,8 +26,8 @@ ok($fmdb,'Logged in'); my $layouts = $fmdb->layoutnames; if(ref($layouts) eq 'ARRAY') { - my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1})->{_field_def}; - is(ref($records->fields), 'HASH', 'the fields method returns an Hash'); + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 2}); + is(ref($records->fields_definition), 'HASH', 'the fields method returns an Hash'); } - done_testing(); + From e8f21abcb6e4954f84e1a9a624541755f274d203 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 14:04:25 +0100 Subject: [PATCH 55/90] Added 'update' and 'delete' methods to Row. Update has the capability to manage DateTimes on date|time fields modified Row constructor because I needed a complete reference to ResultSet in order to add Update and Delete methods. --- lib/Net/FileMaker/XML/ResultSet.pm | 32 +++++----- lib/Net/FileMaker/XML/ResultSet/Row.pm | 85 +++++++++++++++++++++++--- 2 files changed, 92 insertions(+), 25 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index cbe9128..75f64bc 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -162,22 +162,6 @@ sub fetch_size } -# _parse_rows -sub _parse_rows -{ - my $self = shift; - require Net::FileMaker::XML::ResultSet::Row; - my $cd = $self->fields_definition; # column definition, I need it for the inflater - my $ds = $self->datasource; - if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{result_hash}{resultset}{record}, $cd , $ds); - }else{ - for my $row (@{$self->{result_hash}{resultset}{record}}){ - push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row, $cd,$ds,$self->{db}); - } - } -} - =head2 rows Returns all the rows of the resultset as L @@ -210,4 +194,20 @@ sub _parse_field_definition $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{result_hash}{metadata}{'field-definition'}); } +# _parse_rows +sub _parse_rows +{ + my $self = shift; + require Net::FileMaker::XML::ResultSet::Row; + my $cd = $self->fields_definition; # column definition, I need it for the inflater + my $ds = $self->datasource; + if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{result_hash}{resultset}{record},$self); + }else{ + for my $row (@{$self->{result_hash}{resultset}{record}}){ + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row,$self); + } + } +} + 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 5647fc7..c5f6601 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -22,12 +22,17 @@ instead use L. sub new { - my($class, $res_hash , $col_def , $data_source , $db) = @_; + my($class, $res_hash , $dataset) = @_; + + my $cd = $dataset->fields_definition; # column definition, I need it for the inflater + my $ds = $dataset->datasource; + my $db = $dataset->{db}; + my $self = { - columns_def => $col_def, - datasource => $data_source, - result_hash => $res_hash, - db_ref => $db + columns_def => $cd, + datasource => $ds, + result_hash => $res_hash, + db_ref => $db }; bless $self; return $self; @@ -71,6 +76,17 @@ sub get return $self->{result_hash}{field}{$col}{data}; } +=head2 get_type('colname') + +Returns the type of the selected column for this row. + +=cut + +sub get_type +{ + my ( $self , $col ) = @_; + return $self->{columns_def}{$col}{result}; +} =head2 get_inflated('colname') @@ -83,8 +99,8 @@ sub get_inflated { my ( $self , $col ) = @_; # if the field is a “date”, “time” or “timestamp" - if(defined $self->{columns_def}{$col}){ - if($self->{columns_def}{$col}{result} =~ m/^(date|time|timestamp)$/xms ){ + if(defined $self->get_type($col)){ + if($self->get_type($col) =~ m/^(date|time|timestamp)$/xms ){ # let's convert it to a DateTime my $pattern = $self->{datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' my $cldr = DateTime::Format::CLDR->new( @@ -114,8 +130,8 @@ sub get_columns =head2 get_inflated_columns -Returns an hash with column names & relative values for this row. If the type is -date, time or datetime returns a L object. +Returns an hash with column names & relative values for this row. +If the type is date, time or datetime returns a L object. =cut @@ -129,6 +145,57 @@ sub get_inflated_columns return \%res; } +=head2 update(params => { 'Field Name' => $value , ... }) + +Updates the row with the fieldname/value couples passed to params, +returns an L object. + +=head3 Dates and Times editing + +Filemaker accepts time|date editing as a string only in the format +defined in the datasource, otherwise throws an error. +If you don't want to mess around with that this method allows you +to pass a L object and does the dirty +work for you. + +=cut + +sub update +{ + my ( $self , %pars ) = @_; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; + # let's play with DateTimes if passed + my $updates; + foreach my $key (keys %{$pars{params}}){ + my $value = $pars{params}{$key}; + if(ref($value) eq 'DateTime' ){ + # let's find what kind of field it is + my $format = $self->get_type($key); + # and then it's format + my $pattern = $self->{datasource}{"$format-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + $pars{params}{$key} = new DateTime::Format::CLDR(pattern => $pattern)->format_datetime($value); + } + } + my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); + return $result; +} + +=head2 delete(params => { 'Field Name' => $value , ... }) + +Deletes this row, returns an L object. + +=cut + + +sub delete +{ + my ( $self , %params ) = @_; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; + my $result = $db->delete(layout =>$layout , recid => $self->record_id , params => $params{params}); + return $result; +} 1; From cb2995b9e638cb40cc2966638463acf9fe18458a Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 14:34:32 +0100 Subject: [PATCH 56/90] Corrected some documentation and changed the position of some subs in order to give a more intuitive doc --- lib/Net/FileMaker/XML/Database.pm | 176 +++++++++++++------------ lib/Net/FileMaker/XML/ResultSet/Row.pm | 5 +- 2 files changed, 93 insertions(+), 88 deletions(-) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 0400a96..825f1fa 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -132,91 +132,6 @@ sub find } -=head2 edit(layout => 'mylayout' , recid => $recid , params => { params }) - -Updates the value of a specific record column and returns an N::F::X::ResultSet object - -=cut - -#todo: add tests to /t/01_xml - -sub edit -{ - my ($self, %args) = @_; - - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; - - # just to make the recid param more visible than putting it into the params - croak 'recid must be defined' if(! defined $args{recid}); - $args{params}->{'-recid'} = $args{recid}; - - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-edit', - params => $args{params} - ); - - return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); -} - -=head2 delete(layout => 'mylayout' , recid => $recid , params => { params }) - -Deletes the record with that specific record id and returns an N::F::X::ResultSet object - -=cut - -sub delete -{ - my ($self, %args) = @_; - - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; - - # just to make the recid param more visible than putting it into the params - croak 'recid must be defined' if(! defined $args{recid}); - $args{params}->{'-recid'} = $args{recid}; - - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-delete', - params => $args{params} - ); - - return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); -} - - - -=head2 insert(layout => 'mylayout' , recid => $recid , params => { params }) - -Creates a new record and populates that record with the contents of any name/value pair passed with the params' hash and returns an N::F::X::ResultSet object - -=cut - -sub insert -{ - my ($self, %args) = @_; - - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; - - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-new', - params => $args{params} - ); - - return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); -} - - =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) Returns a Net::FileMaker::XML::ResultSet of all rows on a specific database and layout. @@ -305,6 +220,97 @@ sub findany return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } + + +=head2 edit(layout => $layout , recid => $recid , params => { params }) + +Updates the row with the fieldname/value pairs passed to params, +returns an L object. + +=cut + +#todo: add tests to /t/01_xml + +sub edit +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + # just to make the recid param more visible than putting it into the params + croak 'recid must be defined' if(! defined $args{recid}); + $args{params}->{'-recid'} = $args{recid}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-edit', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + +=head2 delete(layout => $layout , recid => $recid , params => { params }) + +Deletes the record with that specific record id and returns an N::F::X::ResultSet object + +=cut + +sub delete +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + # just to make the recid param more visible than putting it into the params + croak 'recid must be defined' if(! defined $args{recid}); + $args{params}->{'-recid'} = $args{recid}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-delete', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + + + +=head2 insert(layout => $layout , recid => $recid , params => { params }) + +Creates a new record and populates that record with the fieldname/value pairs passed to params. + +Returns an N::F::X::ResultSet object + +=cut + +sub insert +{ + my ($self, %args) = @_; + + $args{params}->{'-lay'} = $args{layout}; + $args{params}->{'-db'} = $self->{db}; + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-new', + params => $args{params} + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); +} + + + =head2 total_rows(layout => $layout) Returns a scalar with the total rows for a given layout. diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index c5f6601..6a41c32 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -147,7 +147,7 @@ sub get_inflated_columns =head2 update(params => { 'Field Name' => $value , ... }) -Updates the row with the fieldname/value couples passed to params, +Updates the row with the fieldname/value pairs passed to params, returns an L object. =head3 Dates and Times editing @@ -155,8 +155,7 @@ returns an L object. Filemaker accepts time|date editing as a string only in the format defined in the datasource, otherwise throws an error. If you don't want to mess around with that this method allows you -to pass a L object and does the dirty -work for you. +to pass a L object and does the dirty work for you. =cut From 22f3fc487cab4c813a4381441dd78d6fdc1c5292 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 13 Jan 2011 16:47:09 +0100 Subject: [PATCH 57/90] cleaned up code using http://www.perlcritic.org/ at 'harsh' level. --- lib/Net/FileMaker.pm | 4 +-- lib/Net/FileMaker/Error.pm | 2 +- lib/Net/FileMaker/XML.pm | 23 ++++++++--------- lib/Net/FileMaker/XML/Database.pm | 25 ++++++++++--------- lib/Net/FileMaker/XML/ResultSet.pm | 13 ++++++---- .../XML/ResultSet/FieldsDefinition.pm | 3 ++- .../XML/ResultSet/FieldsDefinition/Field.pm | 7 +++--- lib/Net/FileMaker/XML/ResultSet/Row.pm | 17 ++++++------- 8 files changed, 49 insertions(+), 45 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 663310e..a273253 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -2,7 +2,7 @@ package Net::FileMaker; use strict; use warnings; - +use Carp; use 5.008; use LWP::UserAgent; @@ -58,7 +58,7 @@ sub new # TODO: Add XSLT, PHP, etc. else { - die('Unknown type specified.'); + croak 'Unknown type specified.'; } } diff --git a/lib/Net/FileMaker/Error.pm b/lib/Net/FileMaker/Error.pm index a1ff13f..b80d22c 100644 --- a/lib/Net/FileMaker/Error.pm +++ b/lib/Net/FileMaker/Error.pm @@ -40,7 +40,7 @@ sub new } else { - return undef; + return; } } diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index a21a3f5..ce2384f 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -2,7 +2,7 @@ package Net::FileMaker::XML; use strict; use warnings; - +use Carp; use Net::FileMaker::Error; use XML::Twig; @@ -53,16 +53,16 @@ sub new my($class, %args) = @_; # If the protocol isn't specified, let's assume it's just HTTP. - if($args{host} !~/^http/) + if($args{host} !~/^http/x) { $args{host} = 'http://'.$args{host}; } my $self = { - host => $args{host}, - ua => LWP::UserAgent->new, - xml => XML::Twig->new, - uri => URI->new($args{host}), + host => $args{host}, + ua => LWP::UserAgent->new, + xml => XML::Twig->new, + uri => URI->new($args{host}), resultset => '/fmi/xml/fmresultset.xml', # Entirely for dbnames(); }; @@ -71,7 +71,8 @@ sub new $self->{error} = Net::FileMaker::Error->new(lang => $args{error}, type => 'XML'); } - return bless $self; + bless $self , $class; + return $self; } @@ -106,7 +107,7 @@ sub dbnames my $self = shift; my $xml = $self->_request( resultset => $self->{resultset}, - query =>'-dbnames' + query =>'-dbnames' ); return $self->_compose_arrayref('DATABASE_NAME', $xml); @@ -180,8 +181,6 @@ sub _compose_arrayref { my ($self, $fieldname, $xml) = @_; - my @output; - if(ref($xml->{resultset}->{record}) eq 'HASH') { return $xml->{resultset}->{record}->{field}->{$fieldname}->{data}; @@ -210,14 +209,14 @@ sub _assert_param my($self, $unclean_param, $acceptable_params) = @_; my $param; - if($unclean_param =~/$acceptable_params/) + if($unclean_param =~/$acceptable_params/x) { $param = $unclean_param; } else { # TODO: Localise this error message - warn "Invalid parameter specified - $unclean_param"; + carp "Invalid parameter specified - $unclean_param"; } diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 825f1fa..e9877d0 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -59,10 +59,11 @@ sub new resultset => '/fmi/xml/fmresultset.xml', ua => LWP::UserAgent->new, xml => XML::Twig->new, - uri => URI->new($args{host}), + uri => URI->new($args{host}), }; - return bless $self; + bless $self , $class; + return $self; } =head2 layoutnames @@ -122,9 +123,9 @@ sub find my $xml = $self->_request( resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-find', + user => $self->{user}, + pass => $self->{pass}, + query => '-find', params => $args{params} ); @@ -167,9 +168,9 @@ sub findall my $xml = $self->_request( resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-findall', + user => $self->{user}, + pass => $self->{pass}, + query => '-findall', params => $params ); @@ -211,9 +212,9 @@ sub findany my $xml = $self->_request( resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-findany', + user => $self->{user}, + pass => $self->{pass}, + query => '-findany', params => $params ); @@ -327,7 +328,7 @@ sub total_rows pass => $self->{pass}, resultset => $self->{resultset}, params => {'-db' => $self->{db}, '-lay' => $args{layout}, '-max' => '1' }, - query => '-findall' + query => '-findall' ); return $xml; diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 75f64bc..8cc4e92 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -22,12 +22,12 @@ sub new my($class, %args) = @_; my @rows; my $self = { - result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods - db => $args{db}, # ref to the db, it is useful to add an $row->update method later - fields_def => undef, # fields definition - rows => \@rows # resultset's rows + result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + db => $args{db}, # ref to the db, it is useful to add an $row->update method later + fields_def => undef, # fields definition + rows => \@rows # resultset's rows }; - bless $self; + bless $self , $class; # let's begin the parsing $self->_parse; return $self; @@ -183,6 +183,7 @@ sub _parse # parse the resultset $self->_parse_field_definition; $self->_parse_rows; + return; } # _parse_field_definition @@ -192,6 +193,7 @@ sub _parse_field_definition my ($self) = @_; require Net::FileMaker::XML::ResultSet::FieldsDefinition; $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{result_hash}{metadata}{'field-definition'}); + return; } # _parse_rows @@ -208,6 +210,7 @@ sub _parse_rows push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row,$self); } } + return; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 2f6145d..cae8121 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -24,7 +24,7 @@ sub new my $self = { result_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods }; - bless $self; + bless $self , $class; $self->_parse; return $self; } @@ -67,6 +67,7 @@ sub _parse $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{result_hash}{$key}); } $self->{fields} = \%fields; + return; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 28de5da..5d3fb58 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -25,7 +25,7 @@ sub new my $self = { result_hash => $res_hash }; - bless $self; + bless $self , $class; $self->_parse; return $self; } @@ -67,7 +67,7 @@ my @availables = qw( global numeric-only four-digit-year not-empty auto-enter ty sub get { my ( $self, $par ) = @_; - croak 'this parameter is not defined!' if(! grep $_ eq $par, @availables); + croak 'this parameter is not defined!' if(! grep { $_ eq $par } @availables); return $self->{$par}; } @@ -94,12 +94,13 @@ sub _parse # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); foreach my $key (keys %{$self->{result_hash}}) { - if(grep $_ eq $key, @bools){ + if(grep {$_ eq $key} @bools){ $self->{$key} = $self->{result_hash}{$key} eq 'no' ? 0 : 1; }else{ $self->{$key} = $self->{result_hash}{$key}; } } + return; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 6a41c32..1551298 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -30,11 +30,11 @@ sub new my $self = { columns_def => $cd, - datasource => $ds, + datasource => $ds, result_hash => $res_hash, - db_ref => $db + db_ref => $db }; - bless $self; + bless $self , $class; return $self; } @@ -163,10 +163,9 @@ to pass a L object and does the dirty work for you. sub update { my ( $self , %pars ) = @_; - my $db = $self->{db_ref}; - my $layout = $self->{datasource}{layout}; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; # let's play with DateTimes if passed - my $updates; foreach my $key (keys %{$pars{params}}){ my $value = $pars{params}{$key}; if(ref($value) eq 'DateTime' ){ @@ -174,7 +173,7 @@ sub update my $format = $self->get_type($key); # and then it's format my $pattern = $self->{datasource}{"$format-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - $pars{params}{$key} = new DateTime::Format::CLDR(pattern => $pattern)->format_datetime($value); + $pars{params}{$key} = DateTime::Format::CLDR->new(pattern => $pattern)->format_datetime($value); } } my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); @@ -191,8 +190,8 @@ Deletes this row, returns an L object. sub delete { my ( $self , %params ) = @_; - my $db = $self->{db_ref}; - my $layout = $self->{datasource}{layout}; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; my $result = $db->delete(layout =>$layout , recid => $self->record_id , params => $params{params}); return $result; } From 9fc6c31e6b712d52d3d40b196b8ca662b435e39b Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Fri, 14 Jan 2011 11:03:58 +0100 Subject: [PATCH 58/90] Added HTTP debug capabilities for the user. Code cleanup at \"harsh\" level. ( remains just one issue to address in XML.pm ) Added get_max_lenght method to Row.pm --- lib/Net/FileMaker/XML.pm | 4 +- lib/Net/FileMaker/XML/Database.pm | 7 +-- lib/Net/FileMaker/XML/ResultSet.pm | 25 ++++++++ lib/Net/FileMaker/XML/ResultSet/Row.pm | 87 +++++++++++++++++++++++--- 4 files changed, 109 insertions(+), 14 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index ce2384f..9ff4fd2 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -169,7 +169,9 @@ sub _request $xml_data->{error}->{message} = $self->{error}->get_string($xml_data->{error}->{code}); } - return $xml_data; + $xml_data->{http_response} = $res; + $xml_data->{http_request} = $req; + return $xml_data; } diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index e9877d0..1eac78f 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -5,8 +5,7 @@ use warnings; use Net::FileMaker::XML::ResultSet; use Carp; -our @ISA = qw(Net::FileMaker::XML); - +use base qw(Net::FileMaker::XML); # # Particular methods have specific parameters that are optional, but need to be validated to mitigate sending # bad parameters to the server. @@ -254,13 +253,13 @@ sub edit return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } -=head2 delete(layout => $layout , recid => $recid , params => { params }) +=head2 remove(layout => $layout , recid => $recid , params => { params }) Deletes the record with that specific record id and returns an N::F::X::ResultSet object =cut -sub delete +sub remove { my ($self, %args) = @_; diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 8cc4e92..1c416e2 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -46,6 +46,31 @@ sub fields_definition return $self->{fields_def}->fields; } + +=head2 http_request + +Returns the http request for this call. Returns an L object + +=cut + +sub http_request +{ + my $self = shift; + return $self->{result_hash}{http_request}; +} + +=head2 http_response + +Returns the http response for this call. Returns an L object + +=cut + +sub http_response +{ + my $self = shift; + return $self->{result_hash}{http_response}; +} + =head2 datasource Return an hash with useful information about the datasource. diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 1551298..d427329 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -88,6 +88,18 @@ sub get_type return $self->{columns_def}{$col}{result}; } +=head2 get_max_length('colname') + +Returns the type of the selected column for this row. + +=cut + +sub get_max_length +{ + my ( $self , $col ) = @_; + return $self->{columns_def}{$col}{'max-repeat'}; +} + =head2 get_inflated('colname') Returns the value of the selected column for this row. If the type is @@ -157,6 +169,24 @@ defined in the datasource, otherwise throws an error. If you don't want to mess around with that this method allows you to pass a L object and does the dirty work for you. +=head3 Multiple values fields + +This method gives you the possibility to pass an array as a value for multiple-values-fields. +Obviously you can pass also an array of DateTimes. + +=begin text + +This allows you to do this: + +my @pars = ( 'hello' , undef , 'world' , ''); +$rs->update(params => {{ 'Field Name' => \@pars }); + +instead of: + +$rs->update(params => { 'Field Name[1]' => 'hello' , 'Field Name[3]' => 'world' , 'Field Name[4]' => '' }); + +=end text + =cut @@ -165,29 +195,64 @@ sub update my ( $self , %pars ) = @_; my $db = $self->{db_ref}; my $layout = $self->{datasource}{layout}; - # let's play with DateTimes if passed + + # let's play with DateTimes and arrays if passed foreach my $key (keys %{$pars{params}}){ my $value = $pars{params}{$key}; - if(ref($value) eq 'DateTime' ){ - # let's find what kind of field it is - my $format = $self->get_type($key); - # and then it's format - my $pattern = $self->{datasource}{"$format-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - $pars{params}{$key} = DateTime::Format::CLDR->new(pattern => $pattern)->format_datetime($value); + + # if the type is datetime let's format it right + $pars{params}{$key} = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); + + # let's transform the array into the single params, taking into account the datetimes + if(ref($value) eq 'ARRAY'){ + + # fm's arrays have a predefined number of slots + # throw error if the array is longer than the max size for this field + croak 'the lenght of the array exceeds the max size of the field' if( scalar @$value > $self->get_max_length($key) ); + + for(my $i = 0; $i < scalar @$value; $i++) { + + # if the user hasn't defined the value of an index it means he doesn't want it to be modified + if(defined $value->[$i]){ + + # manage datetimes + $value->[$i] = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); + + # set the param for the request + $pars{params}{$key."[".($i+1)."]"} = $value->[$i]; + + } + } + #finally let's delete the array from the params + delete $pars{params}{$key}; } } + use Data::Dumper; + print STDERR Dumper $pars{params}; my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); return $result; } -=head2 delete(params => { 'Field Name' => $value , ... }) + +sub _get_formatted_dt +{ + my ( $self , $fieldname , $dt ) = @_; + # let's find what kind of field it is + my $format = $self->get_type($fieldname); + # and then it's format + my $pattern = $self->{datasource}{"$format-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $result = DateTime::Format::CLDR->new(pattern => $pattern)->format_datetime($dt); + return $result; +} + +=head2 remove(params => { 'Field Name' => $value , ... }) Deletes this row, returns an L object. =cut -sub delete +sub remove { my ( $self , %params ) = @_; my $db = $self->{db_ref}; @@ -196,4 +261,8 @@ sub delete return $result; } + +# + + 1; From 92aec53c3ce7430e26052f31b0e3ffd13fba4743 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Fri, 14 Jan 2011 12:10:14 +0100 Subject: [PATCH 59/90] doc update --- lib/Net/FileMaker/XML/ResultSet.pm | 4 +++- lib/Net/FileMaker/XML/ResultSet/Row.pm | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 1c416e2..b1aac97 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -49,7 +49,9 @@ sub fields_definition =head2 http_request -Returns the http request for this call. Returns an L object +Returns the http request for this call. Returns an L object. + +This is quite useful for debugging purposes. =cut diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index d427329..271399b 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -233,6 +233,8 @@ sub update return $result; } +# _get_formatted_dt +# returns formatted dt according to the field definition sub _get_formatted_dt { From 8cf2ddfda245e87783569cb21ebbcfecca038cf4 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Fri, 14 Jan 2011 13:48:17 +0100 Subject: [PATCH 60/90] removed bundling of the HTTP::Request object from the Database::_request method and relative method in ResultSet --- lib/Net/FileMaker/XML.pm | 1 - lib/Net/FileMaker/XML/ResultSet.pm | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 9ff4fd2..f71b474 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -170,7 +170,6 @@ sub _request } $xml_data->{http_response} = $res; - $xml_data->{http_request} = $req; return $xml_data; } diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index b1aac97..cacd314 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -47,23 +47,17 @@ sub fields_definition } -=head2 http_request -Returns the http request for this call. Returns an L object. +=head2 http_response -This is quite useful for debugging purposes. +Returns the http response for this call. Returns an L object. -=cut +=begin text -sub http_request -{ - my $self = shift; - return $self->{result_hash}{http_request}; -} - -=head2 http_response +# let's print the request url for debugging purposes +print $rs->http_response->base; -Returns the http response for this call. Returns an L object +=end text =cut From cf53f53f107d0c09e1db8977425ff2b2e9a82d14 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Fri, 14 Jan 2011 15:00:49 +0100 Subject: [PATCH 61/90] unified params check ( code reduction ) --- lib/Net/FileMaker/XML.pm | 31 +++++++++++++++++++++++ lib/Net/FileMaker/XML/Database.pm | 35 +++----------------------- lib/Net/FileMaker/XML/ResultSet/Row.pm | 2 -- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index f71b474..bc0ebd5 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -205,6 +205,8 @@ sub _compose_arrayref # # Optional parameters sometimes validation to ensure they are correct. # Warnings are issued if a parameter name is somehow invalid. +# single param check + sub _assert_param { my($self, $unclean_param, $acceptable_params) = @_; @@ -225,4 +227,33 @@ sub _assert_param } +# _assert_params +# Optional parameters sometimes validation to ensure they are correct. +# Warnings are issued if a parameter name is somehow invalid. + +sub _assert_params +{ + my ($self , %args) = @_; + + my $params = $args{def_params}; + my $acceptable_params = $args{acceptable_params}; + + if($args{params} && ref($args{params}) eq 'HASH') + { + for my $param(keys %{$args{params}}) + { + # Perform or skip parameter checking + if($args{nocheck} && $args{nocheck} == 1) + { + $params->{$param} = $args{params}->{$param}; + } + else + { + $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); + } + } + } + return $params; +} + 1; # End of Net::FileMaker::XML; diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 1eac78f..af4b274 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -14,7 +14,8 @@ my $acceptable_params = { 'findany' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', 'delete' => 'db|lay|recid|script', 'dup' => 'db|lay|recid|script', - 'edit' => 'db|lay|recid|modid|script', + 'edit' => '-db|-lay|-recid|-modid|-script', + 'new' => '-db|-lay|-script' }; =head1 NAME @@ -149,21 +150,7 @@ sub findall '-db' => $self->{db} }; - if($args{params} && ref($args{params}) eq 'HASH') - { - for my $param(keys %{$args{params}}) - { - # Perform or skip parameter checking - if($args{nocheck} && $args{nocheck} == 1) - { - $params->{$param} = $args{params}->{$param}; - } - else - { - $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); - } - } - } + $params = $self->_assert_params(def_params => $params , acceptable_params => $acceptable_params); my $xml = $self->_request( resultset => $self->{resultset}, @@ -193,21 +180,7 @@ sub findany '-db' => $self->{db} }; - if($args{params} && ref($args{params}) eq 'HASH') - { - for my $param(keys %{$args{params}}) - { - # Perform or skip parameter checking - if($args{nocheck} && $args{nocheck} == 1) - { - $params->{$param} = $args{params}->{$param}; - } - else - { - $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); - } - } - } + $params = $self->_assert_params(def_params => $params , acceptable_params => $acceptable_params); my $xml = $self->_request( resultset => $self->{resultset}, diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 271399b..0c80fa4 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -227,8 +227,6 @@ sub update delete $pars{params}{$key}; } } - use Data::Dumper; - print STDERR Dumper $pars{params}; my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); return $result; } From f55e9f6b77b2219e37461e8354a1a8cb2b22b714 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Fri, 14 Jan 2011 16:28:54 +0100 Subject: [PATCH 62/90] cleaned up params check methods and added params check to insert, remove and edit methods --- lib/Net/FileMaker/XML.pm | 30 ++++++++++------- lib/Net/FileMaker/XML/Database.pm | 53 ++++++++++++++++++++----------- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index bc0ebd5..5e454db 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -211,17 +211,22 @@ sub _assert_param { my($self, $unclean_param, $acceptable_params) = @_; my $param; - - if($unclean_param =~/$acceptable_params/x) - { - $param = $unclean_param; - } - else - { - # TODO: Localise this error message - carp "Invalid parameter specified - $unclean_param"; - } - + # if the param is of private type '-something' let's check, otherwise skip 'cause it could be the name of a field + # todo: we might add a strict control to avoid passing others params than the ones with "-" like in findall etc + if($unclean_param =~ /^-.+$/x) + { + if($unclean_param =~/$acceptable_params/x) + { + $param = $unclean_param; + } + else + { + # TODO: Localise this error message + carp "Invalid parameter specified - $unclean_param"; + } + }else{ + $param = $unclean_param; + } return $param; } @@ -237,6 +242,7 @@ sub _assert_params my $params = $args{def_params}; my $acceptable_params = $args{acceptable_params}; + my $type = $args{type}; if($args{params} && ref($args{params}) eq 'HASH') { @@ -249,7 +255,7 @@ sub _assert_params } else { - $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{findall}); + $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{$type}); } } } diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index af4b274..ba70715 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -10,10 +10,11 @@ use base qw(Net::FileMaker::XML); # Particular methods have specific parameters that are optional, but need to be validated to mitigate sending # bad parameters to the server. my $acceptable_params = { + 'find' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', 'findall' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', 'findany' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', - 'delete' => 'db|lay|recid|script', - 'dup' => 'db|lay|recid|script', + 'delete' => '-db|-lay|-recid|-script', + 'dup' => '-db|-lay|-recid|-script', 'edit' => '-db|-lay|-recid|-modid|-script', 'new' => '-db|-lay|-script' }; @@ -118,15 +119,19 @@ sub find { my ($self, %args) = @_; - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; + + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params , type => 'find'); my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, query => '-find', - params => $args{params} + params => $params ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); @@ -150,7 +155,7 @@ sub findall '-db' => $self->{db} }; - $params = $self->_assert_params(def_params => $params , acceptable_params => $acceptable_params); + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'findall'); my $xml = $self->_request( resultset => $self->{resultset}, @@ -180,7 +185,7 @@ sub findany '-db' => $self->{db} }; - $params = $self->_assert_params(def_params => $params , acceptable_params => $acceptable_params); + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'findany'); my $xml = $self->_request( resultset => $self->{resultset}, @@ -208,19 +213,23 @@ sub edit { my ($self, %args) = @_; - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; # just to make the recid param more visible than putting it into the params croak 'recid must be defined' if(! defined $args{recid}); - $args{params}->{'-recid'} = $args{recid}; + $params->{'-recid'} = $args{recid}; + + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'edit'); my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, query => '-edit', - params => $args{params} + params => $params ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); @@ -236,19 +245,23 @@ sub remove { my ($self, %args) = @_; - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; # just to make the recid param more visible than putting it into the params croak 'recid must be defined' if(! defined $args{recid}); - $args{params}->{'-recid'} = $args{recid}; + $params->{'-recid'} = $args{recid}; + + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'delete'); my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, query => '-delete', - params => $args{params} + params => $params ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); @@ -268,15 +281,19 @@ sub insert { my ($self, %args) = @_; - $args{params}->{'-lay'} = $args{layout}; - $args{params}->{'-db'} = $self->{db}; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; + + $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params , type => 'new'); my $xml = $self->_request( resultset => $self->{resultset}, user => $self->{user}, pass => $self->{pass}, query => '-new', - params => $args{params} + params => $params ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); From 5d89f68153b3aca1c9596763130e9b830c401eab Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Thu, 20 Jan 2011 11:13:05 +0100 Subject: [PATCH 63/90] added "require LWP::UserAgent;" to XML->new. --- lib/Net/FileMaker/XML.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 5e454db..5712088 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -57,7 +57,7 @@ sub new { $args{host} = 'http://'.$args{host}; } - + require LWP::UserAgent; my $self = { host => $args{host}, ua => LWP::UserAgent->new, From 1f332cdf6bd24d857af92609709a5d73732bcbdf Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Mon, 24 Jan 2011 14:22:28 +0100 Subject: [PATCH 64/90] added perl critic test --- t/00_load/01-perlcritic.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 t/00_load/01-perlcritic.t diff --git a/t/00_load/01-perlcritic.t b/t/00_load/01-perlcritic.t new file mode 100755 index 0000000..bfc8eea --- /dev/null +++ b/t/00_load/01-perlcritic.t @@ -0,0 +1,15 @@ +#!perl -wT + +use strict; +use warnings; + +use Test::More; + + +eval 'use Test::Perl::Critic'; +if ( $@ ) { + plan skip_all => 'Test::Perl::Critic required to test for best-practices'; +} +else { + Test::Perl::Critic::all_critic_ok(); +} From b16dfa6ce1baf7ffb2c9ed6591e42b2537e18ee0 Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Mon, 24 Jan 2011 14:26:45 +0100 Subject: [PATCH 65/90] added pod test --- t/00_load/02-pod.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 t/00_load/02-pod.t diff --git a/t/00_load/02-pod.t b/t/00_load/02-pod.t new file mode 100755 index 0000000..1c4b79f --- /dev/null +++ b/t/00_load/02-pod.t @@ -0,0 +1,15 @@ +#!perl -wT + +use strict; +use warnings; + +use Test::More; + + +eval 'use Test::Pod 1.14'; +if ( $@ ) { + plan skip_all => 'Test::Pod 1.14 required for testing POD'; +} +else { + Test::Pod::all_pod_files_ok(); +} From 5a5df6b53d33bdf05dfbd1ffb2f950dbd456a3cf Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 1 Feb 2011 14:24:01 +0100 Subject: [PATCH 66/90] added methods ResultSet->next_row and ResultSet->reset_next. these allow to do something like while ( my $row = $rs->next_row ){ print Dumper $row->get_columns(); } --- lib/Net/FileMaker/XML/ResultSet.pm | 38 +++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index cacd314..b023e05 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -25,7 +25,8 @@ sub new result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods db => $args{db}, # ref to the db, it is useful to add an $row->update method later fields_def => undef, # fields definition - rows => \@rows # resultset's rows + rows => \@rows, # resultset's rows + next_index => 0, # index used by the "next" method }; bless $self , $class; # let's begin the parsing @@ -196,6 +197,41 @@ sub rows return $self->{rows}; } + +=head2 next + +Returns the next L if available, if not returns an undefined value + +=cut + +sub next_row +{ + my $self = shift; + # if next row exists let's return it, otherwise undefined + if( $self->{next_index} < scalar @{$self->{rows}} ){ + my $index = $self->{next_index}; + $self->{next_index} ++ ; + return @{$self->{rows}}[$index]; + }else{ + return; + } +} + + +=head2 reset_index + +Resets the index for the next method to the first value + +=cut + +sub reset_index +{ + my $self = shift; + $self->{next_index} = 0; + return; +} + + # _parse # calls all the methods that parse the single blocks of the response sub _parse From 751e9490b180bd1eb1f79a782b6fd1fed8e9a7ca Mon Sep 17 00:00:00 2001 From: Michele Ongaro Date: Tue, 1 Feb 2011 14:27:12 +0100 Subject: [PATCH 67/90] fixed doc bug --- lib/Net/FileMaker/XML/ResultSet.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index b023e05..58f2a01 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -198,7 +198,7 @@ sub rows } -=head2 next +=head2 next_row Returns the next L if available, if not returns an undefined value From 7a2238ce7fadfec40ce8ee50b6c66d8315dc382e Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 11 Feb 2011 10:19:29 +0000 Subject: [PATCH 68/90] Documentation fix in Net::FileMaker::XML::Database. --- lib/Net/FileMaker/XML/Database.pm | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index ba70715..478d794 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -23,10 +23,6 @@ my $acceptable_params = { Net::FileMaker::XML::Database -=head1 VERSION - -Version 0.062 - =cut our $VERSION = 0.062; @@ -111,7 +107,7 @@ sub scriptnames =head2 find(layout => $layout, params => { parameters }) -Returns Net::FileMaker::XML::ResultSet for a specific database and layout. +Returns a L for a specific database and layout. =cut @@ -140,9 +136,9 @@ sub find =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) -Returns a Net::FileMaker::XML::ResultSet of all rows on a specific database and layout. +Returns a L of all rows on a specific database and layout. -nocheck is an optional argument that will skip checking of parameters if set to 1. +C is an optional argument that will skip checking of parameters if set to 1. =cut @@ -170,9 +166,9 @@ sub findall =head2 findany(layout => $layout, params => { parameters }, nocheck => 1) -Returns Net::FileMaker::XML::ResultSet of random rows on a specific database and layout. +Returns a L of random rows on a specific database and layout. -nocheck is an optional argument that will skip checking of parameters if set to 1. +C is an optional argument that will skip checking of parameters if set to 1. =cut @@ -202,8 +198,8 @@ sub findany =head2 edit(layout => $layout , recid => $recid , params => { params }) -Updates the row with the fieldname/value pairs passed to params, -returns an L object. +Updates the row with the fieldname/value pairs passed to params. +Returns a L object. =cut @@ -237,7 +233,7 @@ sub edit =head2 remove(layout => $layout , recid => $recid , params => { params }) -Deletes the record with that specific record id and returns an N::F::X::ResultSet object +Deletes the record with that specific record id and returns a L object. =cut @@ -273,8 +269,8 @@ sub remove Creates a new record and populates that record with the fieldname/value pairs passed to params. -Returns an N::F::X::ResultSet object - +Returns an L object. + =cut sub insert From eabd830a5bf66fe91bbc141a04575dd7e0601078 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 11 Feb 2011 10:24:27 +0000 Subject: [PATCH 69/90] Fixes to Net::FileMaker::XML::ResultSet::FieldsDefinition::Field's formatting. --- .../XML/ResultSet/FieldsDefinition/Field.pm | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 5d3fb58..b815cc5 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -38,28 +38,49 @@ It may return (possible results in parentheses): =over -=item * global (0,1) +=item -=item * numeric-only (0,1) +* global (0,1) -=item * four-digit-year (0,1) +=item -=item * not-empty (0,1) +* numeric-only (0,1) -=item * auto_enter (0,1) +=item -=item * type (“normal”, “calculation”, or “summary”) +* four-digit-year (0,1) -=item * time-of_day (0,1) +=item -=item * max-repeat (int) +* not-empty (0,1) -=item * max-characters (int) +=item -=item * result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) +* auto_enter (0,1) + +=item + +* type (“normal”, “calculation”, or “summary”) + +=item + +* time-of_day (0,1) + +=item + +* max-repeat (int) + +=item + +* max-characters (int) + +=item + +* result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) =back + =cut my @availables = qw( global numeric-only four-digit-year not-empty auto-enter type time-of-day max-repeat max-characters result ); From d880a18eb9e53ca902ac0dd121bb30bc9e4cde04 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 11 Feb 2011 10:30:26 +0000 Subject: [PATCH 70/90] Removing unnecessary diag() from tests. --- t/01_xml/00-load.t | 1 - t/02_error/00-load.t | 1 - t/03_resultset/00-load.t | 1 - t/04_field_definition/00-load.t | 1 - t/05_row/00-load.t | 1 - 5 files changed, 5 deletions(-) diff --git a/t/01_xml/00-load.t b/t/01_xml/00-load.t index fd76707..995e12f 100644 --- a/t/01_xml/00-load.t +++ b/t/01_xml/00-load.t @@ -19,4 +19,3 @@ BEGIN use_ok('Net::FileMaker::XML::Database'); } -diag( "Testing Net::FileMaker::XML $Net::FileMaker::XML::VERSION, Perl $], $^X" ); diff --git a/t/02_error/00-load.t b/t/02_error/00-load.t index c0df234..a5cc8e5 100644 --- a/t/02_error/00-load.t +++ b/t/02_error/00-load.t @@ -10,4 +10,3 @@ BEGIN use_ok( 'Net::FileMaker::Error' ); } -diag( "Testing Net::FileMaker::Error, Perl $], $^X" ); diff --git a/t/03_resultset/00-load.t b/t/03_resultset/00-load.t index eff6f8d..40c9487 100644 --- a/t/03_resultset/00-load.t +++ b/t/03_resultset/00-load.t @@ -10,4 +10,3 @@ BEGIN use_ok( 'Net::FileMaker::XML::ResultSet' ); } -diag( "Testing Net::FileMaker::XML::ResultSet, Perl $], $^X" ); diff --git a/t/04_field_definition/00-load.t b/t/04_field_definition/00-load.t index a78c1ed..f09a7bb 100644 --- a/t/04_field_definition/00-load.t +++ b/t/04_field_definition/00-load.t @@ -10,4 +10,3 @@ BEGIN use_ok( 'Net::FileMaker::XML::ResultSet::FieldsDefinition' ); } -diag( "Testing Net::FileMaker::XML::ResultSet::FieldsDefinition, Perl $], $^X" ); diff --git a/t/05_row/00-load.t b/t/05_row/00-load.t index ea8b2cc..a9f4fc0 100644 --- a/t/05_row/00-load.t +++ b/t/05_row/00-load.t @@ -10,4 +10,3 @@ BEGIN use_ok( 'Net::FileMaker::XML::ResultSet::Row' ); } -diag( "Net::FileMaker::XML::ResultSet::Row, Perl $], $^X" ); From 057c1bc94f31482ac09de1312ad16391e6cc0ace Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 11 Feb 2011 10:31:59 +0000 Subject: [PATCH 71/90] Removing taint mode from the tests. --- t/00_load/00-net-filemaker.t | 2 -- t/00_load/01-perlcritic.t | 2 -- t/00_load/02-pod.t | 2 -- t/01_xml/00-load.t | 2 -- t/01_xml/01-dbnames.t | 2 -- t/01_xml/02-layoutnames.t | 2 -- t/01_xml/03-scriptnames.t | 2 -- t/01_xml/04-findall.t | 2 -- t/01_xml/05-findany.t | 2 -- t/02_error/00-load.t | 2 -- t/02_error/01-en.t | 2 -- t/02_error/02-ja.t | 2 -- t/02_error/03-it.t | 2 -- t/03_resultset/00-load.t | 2 -- t/03_resultset/01-instantiation.t | 2 -- t/03_resultset/02-rows.t | 2 -- t/04_field_definition/00-load.t | 2 -- t/04_field_definition/01-fields.t | 2 -- t/05_row/00-load.t | 2 -- t/05_row/01-inflated.t | 2 -- t/manifest.t | 2 -- t/pod.t | 2 -- 22 files changed, 44 deletions(-) diff --git a/t/00_load/00-net-filemaker.t b/t/00_load/00-net-filemaker.t index 6ab4618..a2d714c 100644 --- a/t/00_load/00-net-filemaker.t +++ b/t/00_load/00-net-filemaker.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/00_load/01-perlcritic.t b/t/00_load/01-perlcritic.t index bfc8eea..2dd1902 100755 --- a/t/00_load/01-perlcritic.t +++ b/t/00_load/01-perlcritic.t @@ -1,5 +1,3 @@ -#!perl -wT - use strict; use warnings; diff --git a/t/00_load/02-pod.t b/t/00_load/02-pod.t index 1c4b79f..ec7bd88 100755 --- a/t/00_load/02-pod.t +++ b/t/00_load/02-pod.t @@ -1,5 +1,3 @@ -#!perl -wT - use strict; use warnings; diff --git a/t/01_xml/00-load.t b/t/01_xml/00-load.t index 995e12f..460ef4f 100644 --- a/t/01_xml/00-load.t +++ b/t/01_xml/00-load.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/01_xml/01-dbnames.t b/t/01_xml/01-dbnames.t index 2fd8341..98f218a 100644 --- a/t/01_xml/01-dbnames.t +++ b/t/01_xml/01-dbnames.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/01_xml/02-layoutnames.t b/t/01_xml/02-layoutnames.t index 025e9e5..bda54f9 100644 --- a/t/01_xml/02-layoutnames.t +++ b/t/01_xml/02-layoutnames.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/01_xml/03-scriptnames.t b/t/01_xml/03-scriptnames.t index 9bf3c40..00d17ca 100644 --- a/t/01_xml/03-scriptnames.t +++ b/t/01_xml/03-scriptnames.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/01_xml/04-findall.t b/t/01_xml/04-findall.t index a2c18f3..33de429 100644 --- a/t/01_xml/04-findall.t +++ b/t/01_xml/04-findall.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/01_xml/05-findany.t b/t/01_xml/05-findany.t index 02f7db7..127f81d 100644 --- a/t/01_xml/05-findany.t +++ b/t/01_xml/05-findany.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/02_error/00-load.t b/t/02_error/00-load.t index a5cc8e5..08b5f15 100644 --- a/t/02_error/00-load.t +++ b/t/02_error/00-load.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/02_error/01-en.t b/t/02_error/01-en.t index 119547e..5f8ae76 100644 --- a/t/02_error/01-en.t +++ b/t/02_error/01-en.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/02_error/02-ja.t b/t/02_error/02-ja.t index 901e282..c5abd00 100644 --- a/t/02_error/02-ja.t +++ b/t/02_error/02-ja.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/02_error/03-it.t b/t/02_error/03-it.t index e475823..cb192cd 100644 --- a/t/02_error/03-it.t +++ b/t/02_error/03-it.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/03_resultset/00-load.t b/t/03_resultset/00-load.t index 40c9487..17b0dc0 100644 --- a/t/03_resultset/00-load.t +++ b/t/03_resultset/00-load.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/03_resultset/01-instantiation.t b/t/03_resultset/01-instantiation.t index 49cb0e8..8c9378c 100644 --- a/t/03_resultset/01-instantiation.t +++ b/t/03_resultset/01-instantiation.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/03_resultset/02-rows.t b/t/03_resultset/02-rows.t index 4e3e6dd..d9408e0 100644 --- a/t/03_resultset/02-rows.t +++ b/t/03_resultset/02-rows.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/04_field_definition/00-load.t b/t/04_field_definition/00-load.t index f09a7bb..905193d 100644 --- a/t/04_field_definition/00-load.t +++ b/t/04_field_definition/00-load.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/04_field_definition/01-fields.t b/t/04_field_definition/01-fields.t index 009ce72..e29c6b5 100644 --- a/t/04_field_definition/01-fields.t +++ b/t/04_field_definition/01-fields.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/05_row/00-load.t b/t/05_row/00-load.t index a9f4fc0..21f1cb0 100644 --- a/t/05_row/00-load.t +++ b/t/05_row/00-load.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/05_row/01-inflated.t b/t/05_row/01-inflated.t index 2d04943..5dc2fd4 100644 --- a/t/05_row/01-inflated.t +++ b/t/05_row/01-inflated.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; diff --git a/t/manifest.t b/t/manifest.t index 45eb83f..479b21f 100644 --- a/t/manifest.t +++ b/t/manifest.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; use Test::More; diff --git a/t/pod.t b/t/pod.t index ee8b18a..056e192 100644 --- a/t/pod.t +++ b/t/pod.t @@ -1,5 +1,3 @@ -#!perl -T - use strict; use warnings; use Test::More; From 963b8965c86a074629fb691d16f602afcc2782d1 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 11 Feb 2011 10:38:32 +0000 Subject: [PATCH 72/90] Bumping version to v0.63, adding Michele in the credits. --- lib/Net/FileMaker.pm | 5 +++-- lib/Net/FileMaker/XML/Database.pm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index a273253..d013068 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -16,11 +16,11 @@ Net::FileMaker - Interact with FileMaker services =head1 VERSION -Version 0.062 +Version 0.063 =cut -our $VERSION = 0.062; +our $VERSION = 0.063; =head1 SYNOPSIS @@ -73,6 +73,7 @@ Squeeks, C<< >> =head1 CONTRIBUTORS +Michele Ongaro, <> Simon Cozens, C<> Marcel Grünauer, C<> diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 478d794..27e3ed8 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -25,7 +25,7 @@ Net::FileMaker::XML::Database =cut -our $VERSION = 0.062; +our $VERSION = 0.063; =head1 SYNOPSIS From 3bd4951c23d1b9dd4675d439ef71c21a47b3311d Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:42:47 +0100 Subject: [PATCH 73/90] Deleting unnecessary files. --- MANIFEST | 38 --------------------------------- Makefile.PL | 34 ----------------------------- README | 61 ----------------------------------------------------- ignore.txt | 14 ------------ 4 files changed, 147 deletions(-) delete mode 100644 MANIFEST delete mode 100644 Makefile.PL delete mode 100644 README delete mode 100644 ignore.txt diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 2564691..0000000 --- a/MANIFEST +++ /dev/null @@ -1,38 +0,0 @@ -Changes -MANIFEST -Makefile.PL -README -lib/Net/FileMaker.pm -lib/Net/FileMaker/XML.pm -lib/Net/FileMaker/XML/Database.pm -lib/Net/FileMaker/XML/ResultSet.pm -lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm -lib/Net/FileMaker/XML/ResultSet/Row.pm -lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm -lib/Net/FileMaker/Error.pm -lib/Net/FileMaker/Error/EN/XML.pm -lib/Net/FileMaker/Error/EN/XSLT.pm -lib/Net/FileMaker/Error/JA/XML.pm -lib/Net/FileMaker/Error/JA/XSLT.pm -lib/Net/FileMaker/Error/IT/XML.pm -lib/Net/FileMaker/Error/IT/XSLT.pm -lib/Net/FileMaker/Error/DE/XML.pm -t/00_load/00-net-filemaker.t -t/01_xml/00-load.t -t/01_xml/01-dbnames.t -t/01_xml/02-layoutnames.t -t/01_xml/03-scriptnames.t -t/01_xml/04-findall.t -t/01_xml/05-findany.t -t/02_error/00-load.t -t/02_error/01-en.t -t/02_error/02-ja.t -t/03_resultset/00-load.t -t/03_resultset/01-instantiation.t -t/03_resultset/02-rows.t -t/04_field_definition/00-load.t -t/04_field_definition/01-fields.t -t/05_row/00-load.t -t/05_row/01-inflated.t -t/manifest.t -t/pod.t diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index a8e6d2b..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,34 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'Net::FileMaker', - AUTHOR => q{Squeeks }, - VERSION_FROM => 'lib/Net/FileMaker.pm', - ABSTRACT_FROM => 'lib/Net/FileMaker.pm', - ($ExtUtils::MakeMaker::VERSION >= 6.3002 - ? ('LICENSE'=> 'perl') - : ()), - - PREREQ_PM => { - 'Test::More' => 0, - 'LWP' => 0, - 'URI' => 0, - 'DateTime::Format::CLDR' => 0, - 'Carp' => 0, - 'XML::Twig' => "3.33", - }, - - MIN_PERL_VERSION => '5.008', - - META_MERGE => { - resources => { - repository => 'http://github.com/squeeks/Net-FileMaker' - } - }, - - test => { TESTS => join( ' ', (glob( 't/*.t'), glob('t/*/*.t'))) }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'Net::FileMaker-*' }, -); diff --git a/README b/README deleted file mode 100644 index 080caa6..0000000 --- a/README +++ /dev/null @@ -1,61 +0,0 @@ -Net::FileMaker - -This module interacts with FileMaker Server's XML Interface. - -INSTALLATION - -To install this module, run the following commands: - - perl Makefile.PL - make - make test - make install - -SUPPORT AND DOCUMENTATION - -After installing, you can find documentation for this module with the -perldoc command. - - perldoc Net::FileMaker - -You can also look for information at: - - RT, CPAN's request tracker - http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net::FileMaker - - AnnoCPAN, Annotated CPAN documentation - http://annocpan.org/dist/Net::FileMaker - - CPAN Ratings - http://cpanratings.perl.org/d/Net::FileMaker - - Search CPAN - http://search.cpan.org/dist/Net::FileMaker/ - - -THINGS TO DO - -There's plenty to worked on: - - * Better authentication handling - * Comprehensive test suite for those with an accessible FileMaker Server - * Removing redundant code - * Full support for the entire XML interface - * Better error handling - * XSLT support - * Future support to send headers to "mimmic" the PHP API - * Potentially supporting scraping the IWP interface as well - - -LICENSE AND COPYRIGHT - -Copyright (C) 2010 Squeeks. - -This program is free software; you can redistribute it and/or modify it -under the terms of either: the GNU General Public License as published -by the Free Software Foundation; or the Artistic License. - -FileMaker Server, FileMaker and other related names are trademarks of FileMaker Inc. - -See http://dev.perl.org/licenses/ for more information. - diff --git a/ignore.txt b/ignore.txt deleted file mode 100644 index e32062a..0000000 --- a/ignore.txt +++ /dev/null @@ -1,14 +0,0 @@ -blib* -Makefile -Makefile.old -Build -Build.bat -_build* -pm_to_blib* -*.tar.gz -.lwpcookies -cover_db -pod2htm*.tmp -Net::FileMaker-* -*.git* -.DS_Store From 8d94dd3f795323ef08efa5d9cc130790c4d46964 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:43:09 +0100 Subject: [PATCH 74/90] Adding dist.ini --- dist.ini | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dist.ini diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..0dc5117 --- /dev/null +++ b/dist.ini @@ -0,0 +1,20 @@ +name = Net-FileMaker +author = Squeeks +license = Perl_5 +copyright_holder = Squeeks +copyright_year = 2011 + +[Prereqs] +perl = 5.008001 + +XML::Twig = 3.33 +LWP = 0 +URI = 0 +DateTime::Format::CLDR = 0 + +[Prereqs / TestRequires] +Test::More = 0 + +[PkgVersion] +[@Basic] + From 66bc0571d4662262ed5c1376fdedb91a03169c43 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:46:53 +0100 Subject: [PATCH 75/90] Removing versions from files. --- lib/Net/FileMaker.pm | 8 -------- lib/Net/FileMaker/XML.pm | 8 -------- lib/Net/FileMaker/XML/Database.pm | 4 ---- 3 files changed, 20 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index d013068..e1a90b0 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -14,14 +14,6 @@ use URI; Net::FileMaker - Interact with FileMaker services -=head1 VERSION - -Version 0.063 - -=cut - -our $VERSION = 0.063; - =head1 SYNOPSIS use Net::FileMaker; diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 5712088..44db5a5 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -11,14 +11,6 @@ use XML::Twig; Net::FileMaker::XML - Interact with FileMaker Server's XML Interface. -=head1 VERSION - -Version 0.062 - -=cut - -our $VERSION = 0.062; - =head1 SYNOPSIS This module provides the interface for communicating with FileMaker Server's XML service. diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 27e3ed8..377e9a2 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -23,10 +23,6 @@ my $acceptable_params = { Net::FileMaker::XML::Database -=cut - -our $VERSION = 0.063; - =head1 SYNOPSIS This module handles all the tasks with XML data. Don't call this module directly, instead use L. From 72d5c10c5a9c490cab0e5593d988b3ddb39a5cfa Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:50:42 +0100 Subject: [PATCH 76/90] Newlining packages not already versioned to stop dzil adding it in. --- lib/Net/FileMaker/Error.pm | 3 ++- lib/Net/FileMaker/XML/ResultSet.pm | 3 ++- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm | 3 ++- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm | 3 ++- lib/Net/FileMaker/XML/ResultSet/Row.pm | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Net/FileMaker/Error.pm b/lib/Net/FileMaker/Error.pm index b80d22c..f61fba2 100644 --- a/lib/Net/FileMaker/Error.pm +++ b/lib/Net/FileMaker/Error.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error; +package + Net::FileMaker::Error; use strict; use warnings; diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 58f2a01..4229ff9 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::XML::ResultSet; +package + Net::FileMaker::XML::ResultSet; use strict; use warnings; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index cae8121..34fb9a9 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::XML::ResultSet::FieldsDefinition; +package + Net::FileMaker::XML::ResultSet::FieldsDefinition; use strict; use warnings; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index b815cc5..c016439 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; +package + Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; use strict; use warnings; diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 0c80fa4..50cd8a2 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::XML::ResultSet::Row; +package + Net::FileMaker::XML::ResultSet::Row; use strict; use warnings; From 9c8d85d60c7361c0186a7025c1a2af3850a50653 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:52:19 +0100 Subject: [PATCH 77/90] Newlines added to error lists as well. --- lib/Net/FileMaker/Error/DE/XML.pm | 3 ++- lib/Net/FileMaker/Error/EN/XML.pm | 3 ++- lib/Net/FileMaker/Error/EN/XSLT.pm | 3 ++- lib/Net/FileMaker/Error/IT/XML.pm | 3 ++- lib/Net/FileMaker/Error/IT/XSLT.pm | 3 ++- lib/Net/FileMaker/Error/JA/XML.pm | 5 +++-- lib/Net/FileMaker/Error/JA/XSLT.pm | 5 +++-- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/Net/FileMaker/Error/DE/XML.pm b/lib/Net/FileMaker/Error/DE/XML.pm index 96b52a0..11ac4ab 100644 --- a/lib/Net/FileMaker/Error/DE/XML.pm +++ b/lib/Net/FileMaker/Error/DE/XML.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::DE::XML; +package + Net::FileMaker::Error::DE::XML; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/EN/XML.pm b/lib/Net/FileMaker/Error/EN/XML.pm index beee781..f6a6c95 100644 --- a/lib/Net/FileMaker/Error/EN/XML.pm +++ b/lib/Net/FileMaker/Error/EN/XML.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::EN::XML; +package + Net::FileMaker::Error::EN::XML; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/EN/XSLT.pm b/lib/Net/FileMaker/Error/EN/XSLT.pm index dfbb5cf..a7144b6 100644 --- a/lib/Net/FileMaker/Error/EN/XSLT.pm +++ b/lib/Net/FileMaker/Error/EN/XSLT.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::EN::XSLT; +package + Net::FileMaker::Error::EN::XSLT; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm index 2355676..fa5f640 100644 --- a/lib/Net/FileMaker/Error/IT/XML.pm +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::IT::XML; +package + Net::FileMaker::Error::IT::XML; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm index 7020f84..9a6db82 100644 --- a/lib/Net/FileMaker/Error/IT/XSLT.pm +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::IT::XSLT; +package + Net::FileMaker::Error::IT::XSLT; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/JA/XML.pm b/lib/Net/FileMaker/Error/JA/XML.pm index db10cc1..cc2fd01 100644 --- a/lib/Net/FileMaker/Error/JA/XML.pm +++ b/lib/Net/FileMaker/Error/JA/XML.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::JA::XML; +package + Net::FileMaker::Error::JA::XML; use strict; use warnings; @@ -258,4 +259,4 @@ sub get_string return $error_codes->{$error_code}; } -1; # End of Net::FileMaker::Error::JA::XML \ No newline at end of file +1; # End of Net::FileMaker::Error::JA::XML diff --git a/lib/Net/FileMaker/Error/JA/XSLT.pm b/lib/Net/FileMaker/Error/JA/XSLT.pm index 1c6d230..16b1da2 100644 --- a/lib/Net/FileMaker/Error/JA/XSLT.pm +++ b/lib/Net/FileMaker/Error/JA/XSLT.pm @@ -1,4 +1,5 @@ -package Net::FileMaker::Error::JA::XSLT; +package + Net::FileMaker::Error::JA::XSLT; use strict; use warnings; @@ -74,4 +75,4 @@ sub get_string return $error_codes->{$error_code}; } -1; # End of Net::FileMaker::Error::JA::XSLT \ No newline at end of file +1; # End of Net::FileMaker::Error::JA::XSLT From c0c8dc21d2c842f165a90ca9063c1aa0916e1df0 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 16:56:18 +0100 Subject: [PATCH 78/90] Cleaning up whitespace in Italian error messages --- lib/Net/FileMaker/Error/IT/XML.pm | 324 ++++++++++++++--------------- lib/Net/FileMaker/Error/IT/XSLT.pm | 70 +++---- 2 files changed, 197 insertions(+), 197 deletions(-) diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm index fa5f640..7ff1602 100644 --- a/lib/Net/FileMaker/Error/IT/XML.pm +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -19,7 +19,7 @@ L =cut my $error_codes = { - '-1' => 'Errore sconosciuto', + '-1' => 'Errore sconosciuto', 0 => 'Nessun errore', 1 => "Azione annullata dall'utente", 2 => "Errore di memoria", @@ -28,167 +28,167 @@ my $error_codes = { 5 => "Comando non valido (ad esempio, un'istruzione di script Definisci il campo priva di calcolo)", 6 => "File di sola lettura", 7 => "Memoria esaurita", - 8 => "Risultato vuoto", - 9 => "Privilegi insufficienti", - 10 => "Dati richiesti non disponibili", - 11 => "Nome non valido", - 12 => "Il nome esiste già", - 13 => "File o oggetto in uso", - 14 => "Fuori intervallo", - 15 => "Impossibile dividere per zero", - 16 => "Operazione non riuscita, nuovo tentativo richiesta (ad esempio una query dell'utente)", - 17 => "Tentativo di convertire il set di caratteri stranieri in UTF-16 non riuscito", - 18 => "Il client deve fornire le informazioni sull'account per procedere", - 19 => "La stringa contiene caratteri diversi da A-Z, a-z, 0-9 (ASCII)", - 20 => "Comando o operazione cancellata dallo script triggerato", - 100 => "Manca un file", - 101 => "Manca un record", - 102 => "Manca un campo", - 103 => "Manca una relazione", - 104 => "Manca uno script", - 105 => "Manca un formato", - 106 => "Manca una tabella", - 107 => "Manca un indice", - 108 => "Manca una lista valori", - 109 => "Manca un set di privilegi", - 110 => "Mancano tabelle correlate", - 111 => "Ripetizione campo non valida", - 112 => "Manca una finestra", - 113 => "Manca una funzione", - 114 => "Manca un riferimento al file", - 115 => "Il set di menu specificato non è presente", - 116 => "L'oggetto formato specificato non è presente", - 117 => "L'origine dati specificata non è presente", - 130 => "File danneggiati o non presenti; reinstallarli", - 131 => "Impossibile trovare i file del supporto per la lingua (come i file modello)", - 200 => "Accesso al record negato", - 201 => "Impossibile modificare il campo", - 202 => "Accesso al campo negato", - 203 => "Nel file non c'è nessun record da stampare o la password non consente l'accesso alla stampa", - 204 => "Nessun accesso ai campi nei criteri di ordinamento", - 205 => "L'utente non dispone dei privilegi di accesso per creare nuovi record; l'importazione sovrascriverà i dati esistenti", - 206 => "L'utente non dispone del privilegio per cambiare la password o il file non è modificabile", - 207 => "L'utente non ha privilegi sufficienti per cambiare lo schema del database, oppure il file non è modificabile", - 208 => "La password non contiene abbastanza caratteri", - 209 => "La nuova password deve essere diversa da quella esistente", - 210 => "L'account utente è inattivo", - 211 => "La password è scaduta", - 212 => "Nome utente e/o password non validi. Riprovare", - 213 => "Il nome utente e/o la password non esistono", - 214 => "Troppi tentativi di accesso", - 215 => "I privilegi di amministratore non possono essere duplicati", - 216 => "L'account Ospite non può essere duplicato", - 217 => "L'utente non dispone di privilegi sufficienti per modificare l'account Admin", - 300 => "File bloccato o in uso", - 301 => "Record usato da un altro utente", - 302 => "Tabella usata da un altro utente", - 303 => "Schema database usato da un altro utente", - 304 => "Formato usato da un altro utente", - 306 => "ID modifica del record non corrispondente", - 400 => "Criteri di ricerca vuoti", - 401 => "Nessun record soddisfa la richiesta", - 402 => "Il campo selezionato non è un campo di confronto per un riferimento", - 403 => "Limite massimo di record per la versione di prova di FileMaker Pro superato", - 404 => "Criterio di ordinamento non valido", - 405 => "Il numero di record specificato supera il numero di record che possono essere omessi", - 406 => "Criteri di sostituzione/riserializzazione non validi", - 407 => "Manca uno o entrambi i campi di confronto (relazione non valida)", - 408 => "Tipo di dati associato al campo specificato non valido per questa operazione", - 409 => "Ordine di importazione non valido", - 410 => "Ordine di esportazione non valido", - 412 => "Per recuperare il file è stata usata una versione errata di FileMaker Pro", - 413 => "Tipo di campo non valido", - 414 => "Il formato non può visualizzare il risultato", - 415 => "Uno o più record correlati richiesti non sono disponibili", - 416 => "Chiave primaria richiesta dalla tabella di origine dati", - 417 => "Il database non è supportato per le operazioni ODBC", - 500 => "Il valore della data non soddisfa le opzioni di verifica", - 501 => "Il valore dell'ora non soddisfa le opzioni di verifica", - 502 => "Il valore del numero non soddisfa le opzioni di verifica", - 503 => "Il valore nel campo non è compreso nell'intervallo specificato nelle opzioni di verifica", - 504 => "Il valore del campo non è univoco come richiesto dalle opzioni di verifica", - 505 => "Il valore del campo non esiste nel file di database come richiesto dalle opzioni di verifica", - 506 => "Il valore nel campo non è elencato nella lista di valori specificata nelle opzioni di verifica", - 507 => "Il valore nel campo non ha superato il test del calcolo dell'opzione di verifica", - 508 => "Valore non valido immesso in modo Trova", - 509 => "Il campo richiede un valore valido", - 510 => "Valore correlato vuoto o non disponibile", - 511 => "Il valore immesso nel campo supera il numero massimo di caratteri consentiti", - 512 => "Il record è già stato modificato da un altro utente", - 513 => "Il record deve comprendere almeno un valore in un campo per poter essere creato", - 600 => "Errore di stampa", - 601 => "La combinazione di intestazione e piè di pagina supera una pagina", - 602 => "Il corpo non rientra in una pagina per l'impostazione della colonna corrente", - 603 => "Connessione di stampa interrotta", - 700 => "Tipo di file errato per l'importazione", - 706 => "File EPSF privo di immagine di anteprima", - 707 => "Impossibile trovare traduttore per immagini", - 708 => "Impossibile importare il file. È necessario un computer a colori", - 709 => "Non è riuscita l'importazione del filmato QuickTime", - 710 => "Impossibile aggiornare il riferimento QuickTime. Il file di database è di sola lettura", - 711 => "Impossibile trovare il traduttore per l'importazione", - 714 => "Operazione non consentita dai privilegi della password", - 715 => "È stato specificato un foglio di lavoro di Excel o un intervallo con nome mancante", - 716 => "Una query SQL che impiega istruzioni DELETE, INSERT o UPDATE non è consentita per l'importazione ODBC", - 717 => "Informazioni XML/XSL insufficienti per procedere con l'importazione o l'esportazione", - 718 => "Errore di analisi del file XML (da Xerces)", - 719 => "Errore di conversione XML usando XSL (da Xalan)", - 720 => "Errore durante l'esportazione; il formato desiderato non supporta i campi multipli", - 721 => "Errore sconosciuto nel parser o nel convertitore", - 722 => "Impossibile importare dati in un file che non ha campi", - 723 => "Non si dispone dell'autorizzazione per aggiungere o modificare record nella tabella di destinazione", - 724 => "Non si dispone dell'autorizzazione per aggiungere record alla tabella di destinazione", - 725 => "Non si dispone dell'autorizzazione per modificare record nella tabella di destinazione", - 726 => "Vi sono più record nel file di importazione che nella tabella di destinazione. Non tutti i record sono stati importati", - 727 => "Vi sono più record nella tabella di destinazione che nel file di importazione. Non tutti i record sono stati aggiornati", - 729 => "Errori durante l'importazione. Impossibile importare i record", - 730 => "Versione Excel non supportata. (Convertire il file in formato Excel 7.0 (Excel 95), Excel 97, 2000 o XP e riprovare)", - 731 => "Il file da importare non contiene dati", - 732 => "Questo file non può essere inserito perché contiene altri file", - 733 => "Una tabella non può essere importata in se stessa", - 734 => "I file di questo tipo non possono essere visualizzati come immagine", - 735 => "I file di questo tipo non possono essere visualizzati come immagine. Verranno inseriti e visualizzati come file", - 736 => "Troppi dati da esportare in questo formato. Sarà troncato", - 800 => "Impossibile creare il file su disco", - 801 => "Impossibile creare il file temporaneo sul disco di sistema", - 802 => "Impossibile aprire il file", - 803 => "Il file è per un singolo utente oppure non è stato possibile trovare l'host", - 804 => "Impossibile aprire il file.", - 805 => "Usare il comando Recupera", - 806 => "Impossibile aprire il file con questa versione di FileMaker Pro", - 807 => "Il file non è un file FileMaker Pro oppure è gravemente danneggiato", - 808 => "Impossibile aprire il file. I privilegi di accesso sono danneggiati", - 809 => "Il disco o il volume è pieno", - 810 => "Il disco o il volume è protetto", - 811 => "Impossibile aprire il file temporaneo come file di FileMaker Pro", - 813 => "Errore di sincronizzazione del record in rete", - 814 => "Impossibile aprire i file. È già aperto il numero massimo", - 815 => "Impossibile aprire il file di riferimento", - 816 => "Impossibile convertire il file", - 817 => "Impossibile aprire il file poiché non fa parte di questa soluzione", - 819 => "Impossibile salvare una copia locale di un file remoto", - 820 => "File in fase di chiusura", - 821 => "L'host ha forzato una disconnessione", - 822 => "File FMI non trovati; reinstallare i file non presenti", - 823 => "Impossibile impostare il file su utente singolo; alcuni ospiti sono connessi", - 824 => "Il file è danneggiato o non è un file FileMaker", - 900 => "Errore generico del modulo di gestione del controllo ortografico", - 901 => "Dizionario principale non installato", - 902 => "Impossibile avviare la Guida", - 903 => "Impossibile usare il comando in un file condiviso", - 904 => "Questo comando non può essere usato in un file ospitato sotto FileMaker Server", - 905 => "Non è selezionato nessun campo attivo; il comando può essere usato solo se un campo è attivo", - 906 => "Il file corrente deve essere condiviso per usare questo comando", - 920 => "Impossibile inizializzare il modulo di gestione del controllo ortografico", - 921 => "Impossibile caricare il dizionario utente per la modifica", - 922 => "Impossibile trovare il dizionario utente", - 923 => "Il dizionario utente è di sola lettura", - 951 => "Errore imprevisto (*)", - 954 => "Grammatica XML non supportata (*)", - 955 => "Nessun nome per il database (*)", - 956 => "È stato superato il numero massimo di sessioni del database (*)", - 957 => "Conflitto tra i comandi (*)", - 958 => "Parametro mancante (*)", + 8 => "Risultato vuoto", + 9 => "Privilegi insufficienti", + 10 => "Dati richiesti non disponibili", + 11 => "Nome non valido", + 12 => "Il nome esiste già", + 13 => "File o oggetto in uso", + 14 => "Fuori intervallo", + 15 => "Impossibile dividere per zero", + 16 => "Operazione non riuscita, nuovo tentativo richiesta (ad esempio una query dell'utente)", + 17 => "Tentativo di convertire il set di caratteri stranieri in UTF-16 non riuscito", + 18 => "Il client deve fornire le informazioni sull'account per procedere", + 19 => "La stringa contiene caratteri diversi da A-Z, a-z, 0-9 (ASCII)", + 20 => "Comando o operazione cancellata dallo script triggerato", + 100 => "Manca un file", + 101 => "Manca un record", + 102 => "Manca un campo", + 103 => "Manca una relazione", + 104 => "Manca uno script", + 105 => "Manca un formato", + 106 => "Manca una tabella", + 107 => "Manca un indice", + 108 => "Manca una lista valori", + 109 => "Manca un set di privilegi", + 110 => "Mancano tabelle correlate", + 111 => "Ripetizione campo non valida", + 112 => "Manca una finestra", + 113 => "Manca una funzione", + 114 => "Manca un riferimento al file", + 115 => "Il set di menu specificato non è presente", + 116 => "L'oggetto formato specificato non è presente", + 117 => "L'origine dati specificata non è presente", + 130 => "File danneggiati o non presenti; reinstallarli", + 131 => "Impossibile trovare i file del supporto per la lingua (come i file modello)", + 200 => "Accesso al record negato", + 201 => "Impossibile modificare il campo", + 202 => "Accesso al campo negato", + 203 => "Nel file non c'è nessun record da stampare o la password non consente l'accesso alla stampa", + 204 => "Nessun accesso ai campi nei criteri di ordinamento", + 205 => "L'utente non dispone dei privilegi di accesso per creare nuovi record; l'importazione sovrascriverà i dati esistenti", + 206 => "L'utente non dispone del privilegio per cambiare la password o il file non è modificabile", + 207 => "L'utente non ha privilegi sufficienti per cambiare lo schema del database, oppure il file non è modificabile", + 208 => "La password non contiene abbastanza caratteri", + 209 => "La nuova password deve essere diversa da quella esistente", + 210 => "L'account utente è inattivo", + 211 => "La password è scaduta", + 212 => "Nome utente e/o password non validi. Riprovare", + 213 => "Il nome utente e/o la password non esistono", + 214 => "Troppi tentativi di accesso", + 215 => "I privilegi di amministratore non possono essere duplicati", + 216 => "L'account Ospite non può essere duplicato", + 217 => "L'utente non dispone di privilegi sufficienti per modificare l'account Admin", + 300 => "File bloccato o in uso", + 301 => "Record usato da un altro utente", + 302 => "Tabella usata da un altro utente", + 303 => "Schema database usato da un altro utente", + 304 => "Formato usato da un altro utente", + 306 => "ID modifica del record non corrispondente", + 400 => "Criteri di ricerca vuoti", + 401 => "Nessun record soddisfa la richiesta", + 402 => "Il campo selezionato non è un campo di confronto per un riferimento", + 403 => "Limite massimo di record per la versione di prova di FileMaker Pro superato", + 404 => "Criterio di ordinamento non valido", + 405 => "Il numero di record specificato supera il numero di record che possono essere omessi", + 406 => "Criteri di sostituzione/riserializzazione non validi", + 407 => "Manca uno o entrambi i campi di confronto (relazione non valida)", + 408 => "Tipo di dati associato al campo specificato non valido per questa operazione", + 409 => "Ordine di importazione non valido", + 410 => "Ordine di esportazione non valido", + 412 => "Per recuperare il file è stata usata una versione errata di FileMaker Pro", + 413 => "Tipo di campo non valido", + 414 => "Il formato non può visualizzare il risultato", + 415 => "Uno o più record correlati richiesti non sono disponibili", + 416 => "Chiave primaria richiesta dalla tabella di origine dati", + 417 => "Il database non è supportato per le operazioni ODBC", + 500 => "Il valore della data non soddisfa le opzioni di verifica", + 501 => "Il valore dell'ora non soddisfa le opzioni di verifica", + 502 => "Il valore del numero non soddisfa le opzioni di verifica", + 503 => "Il valore nel campo non è compreso nell'intervallo specificato nelle opzioni di verifica", + 504 => "Il valore del campo non è univoco come richiesto dalle opzioni di verifica", + 505 => "Il valore del campo non esiste nel file di database come richiesto dalle opzioni di verifica", + 506 => "Il valore nel campo non è elencato nella lista di valori specificata nelle opzioni di verifica", + 507 => "Il valore nel campo non ha superato il test del calcolo dell'opzione di verifica", + 508 => "Valore non valido immesso in modo Trova", + 509 => "Il campo richiede un valore valido", + 510 => "Valore correlato vuoto o non disponibile", + 511 => "Il valore immesso nel campo supera il numero massimo di caratteri consentiti", + 512 => "Il record è già stato modificato da un altro utente", + 513 => "Il record deve comprendere almeno un valore in un campo per poter essere creato", + 600 => "Errore di stampa", + 601 => "La combinazione di intestazione e piè di pagina supera una pagina", + 602 => "Il corpo non rientra in una pagina per l'impostazione della colonna corrente", + 603 => "Connessione di stampa interrotta", + 700 => "Tipo di file errato per l'importazione", + 706 => "File EPSF privo di immagine di anteprima", + 707 => "Impossibile trovare traduttore per immagini", + 708 => "Impossibile importare il file. È necessario un computer a colori", + 709 => "Non è riuscita l'importazione del filmato QuickTime", + 710 => "Impossibile aggiornare il riferimento QuickTime. Il file di database è di sola lettura", + 711 => "Impossibile trovare il traduttore per l'importazione", + 714 => "Operazione non consentita dai privilegi della password", + 715 => "È stato specificato un foglio di lavoro di Excel o un intervallo con nome mancante", + 716 => "Una query SQL che impiega istruzioni DELETE, INSERT o UPDATE non è consentita per l'importazione ODBC", + 717 => "Informazioni XML/XSL insufficienti per procedere con l'importazione o l'esportazione", + 718 => "Errore di analisi del file XML (da Xerces)", + 719 => "Errore di conversione XML usando XSL (da Xalan)", + 720 => "Errore durante l'esportazione; il formato desiderato non supporta i campi multipli", + 721 => "Errore sconosciuto nel parser o nel convertitore", + 722 => "Impossibile importare dati in un file che non ha campi", + 723 => "Non si dispone dell'autorizzazione per aggiungere o modificare record nella tabella di destinazione", + 724 => "Non si dispone dell'autorizzazione per aggiungere record alla tabella di destinazione", + 725 => "Non si dispone dell'autorizzazione per modificare record nella tabella di destinazione", + 726 => "Vi sono più record nel file di importazione che nella tabella di destinazione. Non tutti i record sono stati importati", + 727 => "Vi sono più record nella tabella di destinazione che nel file di importazione. Non tutti i record sono stati aggiornati", + 729 => "Errori durante l'importazione. Impossibile importare i record", + 730 => "Versione Excel non supportata. (Convertire il file in formato Excel 7.0 (Excel 95), Excel 97, 2000 o XP e riprovare)", + 731 => "Il file da importare non contiene dati", + 732 => "Questo file non può essere inserito perché contiene altri file", + 733 => "Una tabella non può essere importata in se stessa", + 734 => "I file di questo tipo non possono essere visualizzati come immagine", + 735 => "I file di questo tipo non possono essere visualizzati come immagine. Verranno inseriti e visualizzati come file", + 736 => "Troppi dati da esportare in questo formato. Sarà troncato", + 800 => "Impossibile creare il file su disco", + 801 => "Impossibile creare il file temporaneo sul disco di sistema", + 802 => "Impossibile aprire il file", + 803 => "Il file è per un singolo utente oppure non è stato possibile trovare l'host", + 804 => "Impossibile aprire il file.", + 805 => "Usare il comando Recupera", + 806 => "Impossibile aprire il file con questa versione di FileMaker Pro", + 807 => "Il file non è un file FileMaker Pro oppure è gravemente danneggiato", + 808 => "Impossibile aprire il file. I privilegi di accesso sono danneggiati", + 809 => "Il disco o il volume è pieno", + 810 => "Il disco o il volume è protetto", + 811 => "Impossibile aprire il file temporaneo come file di FileMaker Pro", + 813 => "Errore di sincronizzazione del record in rete", + 814 => "Impossibile aprire i file. È già aperto il numero massimo", + 815 => "Impossibile aprire il file di riferimento", + 816 => "Impossibile convertire il file", + 817 => "Impossibile aprire il file poiché non fa parte di questa soluzione", + 819 => "Impossibile salvare una copia locale di un file remoto", + 820 => "File in fase di chiusura", + 821 => "L'host ha forzato una disconnessione", + 822 => "File FMI non trovati; reinstallare i file non presenti", + 823 => "Impossibile impostare il file su utente singolo; alcuni ospiti sono connessi", + 824 => "Il file è danneggiato o non è un file FileMaker", + 900 => "Errore generico del modulo di gestione del controllo ortografico", + 901 => "Dizionario principale non installato", + 902 => "Impossibile avviare la Guida", + 903 => "Impossibile usare il comando in un file condiviso", + 904 => "Questo comando non può essere usato in un file ospitato sotto FileMaker Server", + 905 => "Non è selezionato nessun campo attivo; il comando può essere usato solo se un campo è attivo", + 906 => "Il file corrente deve essere condiviso per usare questo comando", + 920 => "Impossibile inizializzare il modulo di gestione del controllo ortografico", + 921 => "Impossibile caricare il dizionario utente per la modifica", + 922 => "Impossibile trovare il dizionario utente", + 923 => "Il dizionario utente è di sola lettura", + 951 => "Errore imprevisto (*)", + 954 => "Grammatica XML non supportata (*)", + 955 => "Nessun nome per il database (*)", + 956 => "È stato superato il numero massimo di sessioni del database (*)", + 957 => "Conflitto tra i comandi (*)", + 958 => "Parametro mancante (*)", 1200 => "Errore di calcolo generico", 1201 => "Troppi pochi parametri nella funzione", 1202 => "Troppi parametri nella funzione", diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm index 9a6db82..c07fbed 100644 --- a/lib/Net/FileMaker/Error/IT/XSLT.pm +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -20,41 +20,41 @@ L my $error_codes = { - '-1' => "Errore sconosciuto", - 0 => "Nessun errore", - 10000 => "Nome instestazione non valido", - 10001 => "Il codice status HTTP non è valido", - 10100 => "Errore di sessione sconosciuto", - 10101 => "Il nome della sessione è già in uso", - 10102 => "Non posso accedere alla sessione - probabilmente non esiste", - 10103 => "Sessione scaduta", - 10104 => "L'oggetto della sessione non esiste", - 10200 => "Messaggio di errore sconosciuto", - 10201 => "Errore di formattazione sconosciuto", - 10202 => "Errore nei campi SMTP ", - 10203 => "Errore “Al Campo”", - 10204 => "Errore “Dal Campo”", - 10205 => "Errore “Campo CC ”", - 10206 => "Errore “Campo BCC”", - 10207 => "Errore “Campo Oggetto”", - 10208 => "Errore “Campo Inoltra”", - 10209 => "Errore nel corpo della email", - 10210 => "Errore ricorsivo - tentativo di chiamata a send_email() dentro un foglio di stile XSLT di una email", - 10211 => "Errore di autenticazione SMTP - login fallito o errato metodo di autenticazione", - 10212 => "Utilizzo non valido di una funzione - tentativo di chiamata a set_header(), set_status_code() o set_cookie() dentro un foglio di stile XSLT di una email", - 10213 => "Il server SMTP non è valido o non sta funzionando.", - 10300 => "Errore di formattazione sconosciuto", - 10301 => "Formato data-tempo non valido", - 10302 => "Formato data non valido", - 10303 => "Formato tempo non valido", - 10304 => "Formato giorno non valido", - 10305 => "Formattazione errata per la stringa data-tempo", - 10306 => "Formattazione errata per la stringa data", - 10307 => "Formattazione errata per la stringa tempo", - 10308 => "Formattazione errata per la stringa giorno", - 10309 => "Codifica testo non supportata", - 10310 => "Codifica URL non supportata", - 10311 => "Errore nel pattern dell'Espressione Regolare" + '-1' => "Errore sconosciuto", + 0 => "Nessun errore", + 10000 => "Nome instestazione non valido", + 10001 => "Il codice status HTTP non è valido", + 10100 => "Errore di sessione sconosciuto", + 10101 => "Il nome della sessione è già in uso", + 10102 => "Non posso accedere alla sessione - probabilmente non esiste", + 10103 => "Sessione scaduta", + 10104 => "L'oggetto della sessione non esiste", + 10200 => "Messaggio di errore sconosciuto", + 10201 => "Errore di formattazione sconosciuto", + 10202 => "Errore nei campi SMTP ", + 10203 => "Errore “Al Campo”", + 10204 => "Errore “Dal Campo”", + 10205 => "Errore “Campo CC ”", + 10206 => "Errore “Campo BCC”", + 10207 => "Errore “Campo Oggetto”", + 10208 => "Errore “Campo Inoltra”", + 10209 => "Errore nel corpo della email", + 10210 => "Errore ricorsivo - tentativo di chiamata a send_email() dentro un foglio di stile XSLT di una email", + 10211 => "Errore di autenticazione SMTP - login fallito o errato metodo di autenticazione", + 10212 => "Utilizzo non valido di una funzione - tentativo di chiamata a set_header(), set_status_code() o set_cookie() dentro un foglio di stile XSLT di una email", + 10213 => "Il server SMTP non è valido o non sta funzionando.", + 10300 => "Errore di formattazione sconosciuto", + 10301 => "Formato data-tempo non valido", + 10302 => "Formato data non valido", + 10303 => "Formato tempo non valido", + 10304 => "Formato giorno non valido", + 10305 => "Formattazione errata per la stringa data-tempo", + 10306 => "Formattazione errata per la stringa data", + 10307 => "Formattazione errata per la stringa tempo", + 10308 => "Formattazione errata per la stringa giorno", + 10309 => "Codifica testo non supportata", + 10310 => "Codifica URL non supportata", + 10311 => "Errore nel pattern dell'Espressione Regolare" }; From 9f79e31be00bcf6d1e727a06f6bb0eab789335ea Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 16 May 2011 17:00:54 +0100 Subject: [PATCH 79/90] Adding version to dist.ini --- dist.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist.ini b/dist.ini index 0dc5117..aa460e4 100644 --- a/dist.ini +++ b/dist.ini @@ -4,6 +4,8 @@ license = Perl_5 copyright_holder = Squeeks copyright_year = 2011 +version = 0.063 + [Prereqs] perl = 5.008001 From b687166c55755e5c1e0083d078e4de751a5a2864 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 28 Oct 2011 12:00:06 +0100 Subject: [PATCH 80/90] Syntax clean up on N::F::XML::Database --- lib/Net/FileMaker/XML/Database.pm | 208 ++++++++++++++++++------------ 1 file changed, 122 insertions(+), 86 deletions(-) diff --git a/lib/Net/FileMaker/XML/Database.pm b/lib/Net/FileMaker/XML/Database.pm index 377e9a2..49c54e6 100644 --- a/lib/Net/FileMaker/XML/Database.pm +++ b/lib/Net/FileMaker/XML/Database.pm @@ -6,17 +6,17 @@ use Net::FileMaker::XML::ResultSet; use Carp; use base qw(Net::FileMaker::XML); -# -# Particular methods have specific parameters that are optional, but need to be validated to mitigate sending -# bad parameters to the server. + +# Particular methods have specific parameters that are optional, but need to be +# validated to mitigate sending bad parameters to the server. my $acceptable_params = { - 'find' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', - 'findall' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', - 'findany' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', - 'delete' => '-db|-lay|-recid|-script', - 'dup' => '-db|-lay|-recid|-script', - 'edit' => '-db|-lay|-recid|-modid|-script', - 'new' => '-db|-lay|-script' + 'find' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', + 'findall' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', + 'findany' => '-recid|-lop|-op|-max|-skip|-sortorder|-sortfield|-script|-script\.prefind|-script\.presort', + 'delete' => '-db|-lay|-recid|-script', + 'dup' => '-db|-lay|-recid|-script', + 'edit' => '-db|-lay|-recid|-modid|-script', + 'new' => '-db|-lay|-script' }; =head1 NAME @@ -25,7 +25,8 @@ Net::FileMaker::XML::Database =head1 SYNOPSIS -This module handles all the tasks with XML data. Don't call this module directly, instead use L. +This module handles all the tasks with XML data. Don't call this module +directly, instead use L. use Net::FileMaker::XML; my $fm = Net::FileMaker::XML->new(host => $host); @@ -42,21 +43,21 @@ This module handles all the tasks with XML data. Don't call this module directly sub new { - my($class, %args) = @_; - - my $self = { - host => $args{host}, - db => $args{db}, - user => $args{user}, - pass => $args{pass}, - resultset => '/fmi/xml/fmresultset.xml', + my($class, %args) = @_; + + my $self = { + host => $args{host}, + db => $args{db}, + user => $args{user}, + pass => $args{pass}, + resultset => '/fmi/xml/fmresultset.xml', ua => LWP::UserAgent->new, xml => XML::Twig->new, uri => URI->new($args{host}), - }; + }; bless $self , $class; - return $self; + return $self; } =head2 layoutnames @@ -67,7 +68,7 @@ Returns an arrayref containing layouts accessible for the respective database. sub layoutnames { - my $self = shift; + my $self = shift; my $xml = $self->_request( user => $self->{user}, pass => $self->{pass}, @@ -77,7 +78,7 @@ sub layoutnames ); - return $self->_compose_arrayref('LAYOUT_NAME', $xml); + return $self->_compose_arrayref('LAYOUT_NAME', $xml); } =head2 scriptnames @@ -88,7 +89,7 @@ Returns an arrayref containing scripts accessible for the respective database. sub scriptnames { - my $self = shift; + my $self = shift; my $xml = $self->_request( user => $self->{user}, pass => $self->{pass}, @@ -98,7 +99,7 @@ sub scriptnames ); - return $self->_compose_arrayref('SCRIPT_NAME', $xml); + return $self->_compose_arrayref('SCRIPT_NAME', $xml); } =head2 find(layout => $layout, params => { parameters }) @@ -109,83 +110,98 @@ Returns a L for a specific database and layout. sub find { - my ($self, %args) = @_; + my ($self, %args) = @_; my $params = { '-lay' => $args{layout}, '-db' => $self->{db} }; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params , type => 'find'); - - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-find', - params => $params - ); - - return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); + $params = $self->_assert_params( + type => 'find', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params, + ); + + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-find', + params => $params + ); + + return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } =head2 findall(layout => $layout, params => { parameters }, nocheck => 1) -Returns a L of all rows on a specific database and layout. - -C is an optional argument that will skip checking of parameters if set to 1. +Returns a L of all rows on a specific database +and layout. C is an optional argument that will skip checking of +parameters if set to 1. =cut sub findall { - my ($self, %args) = @_; + my ($self, %args) = @_; - my $params = { - '-lay' => $args{layout}, - '-db' => $self->{db} - }; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'findall'); + $params = $self->_assert_params( + type => 'findall', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params + ); - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-findall', - params => $params - ); + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-findall', + params => $params + ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } =head2 findany(layout => $layout, params => { parameters }, nocheck => 1) -Returns a L of random rows on a specific database and layout. - -C is an optional argument that will skip checking of parameters if set to 1. +Returns a L of random rows on a specific +database and layout. C is an optional argument that will skip checking +of parameters if set to 1. =cut sub findany { - my ($self, %args) = @_; + my ($self, %args) = @_; - my $params = { - '-lay' => $args{layout}, - '-db' => $self->{db} - }; + my $params = { + '-lay' => $args{layout}, + '-db' => $self->{db} + }; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'findany'); + $params = $self->_assert_params( + type => 'findany', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params, + ); - my $xml = $self->_request( - resultset => $self->{resultset}, - user => $self->{user}, - pass => $self->{pass}, - query => '-findany', - params => $params - ); + my $xml = $self->_request( + resultset => $self->{resultset}, + user => $self->{user}, + pass => $self->{pass}, + query => '-findany', + params => $params + ); return Net::FileMaker::XML::ResultSet->new(rs => $xml , db => $self); } @@ -199,7 +215,7 @@ Returns a L object. =cut -#todo: add tests to /t/01_xml +#TODO: add tests to /t/01_xml sub edit { @@ -214,7 +230,12 @@ sub edit croak 'recid must be defined' if(! defined $args{recid}); $params->{'-recid'} = $args{recid}; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'edit'); + $params = $self->_assert_params( + type => 'edit', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params + ); my $xml = $self->_request( resultset => $self->{resultset}, @@ -229,7 +250,8 @@ sub edit =head2 remove(layout => $layout , recid => $recid , params => { params }) -Deletes the record with that specific record id and returns a L object. +Deletes the record with that specific record id and returns a +L object. =cut @@ -246,7 +268,12 @@ sub remove croak 'recid must be defined' if(! defined $args{recid}); $params->{'-recid'} = $args{recid}; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params, type => 'delete'); + $params = $self->_assert_params( + type => 'delete', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params + ); my $xml = $self->_request( resultset => $self->{resultset}, @@ -278,7 +305,12 @@ sub insert '-db' => $self->{db} }; - $params = $self->_assert_params(def_params => $params ,params => $args{params} , acceptable_params => $acceptable_params , type => 'new'); + $params = $self->_assert_params( + type => 'new', + def_params => $params, + params => $args{params}, + acceptable_params => $acceptable_params + ); my $xml = $self->_request( resultset => $self->{resultset}, @@ -301,18 +333,22 @@ Returns a scalar with the total rows for a given layout. sub total_rows { - my($self, %args) = @_; - - # Just do a findall with 1 record and parse the result. This might break on an empty database. - my $xml = $self->_request( - user => $self->{user}, - pass => $self->{pass}, - resultset => $self->{resultset}, - params => {'-db' => $self->{db}, '-lay' => $args{layout}, '-max' => '1' }, - query => '-findall' - ); - - return $xml; + my($self, %args) = @_; + + # Just do a findall with 1 record and parse the result. This might break on an empty database. + my $xml = $self->_request( + user => $self->{user}, + pass => $self->{pass}, + resultset => $self->{resultset}, + params => { + '-db' => $self->{db}, + '-lay' => $args{layout}, + '-max' => '1' + }, + query => '-findall' + ); + + return $xml; } From 8cdeae76a4e31a678c61bae0ae6c6e19b69194a8 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 28 Oct 2011 12:06:22 +0100 Subject: [PATCH 81/90] Syntax and documentation fixes in Resultset. --- lib/Net/FileMaker/XML/ResultSet.pm | 151 ++++++++++++++++------------- 1 file changed, 83 insertions(+), 68 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 4229ff9..309dfbe 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::XML::ResultSet; + Net::FileMaker::XML::ResultSet; use strict; use warnings; @@ -20,19 +20,19 @@ Don't call this module directly, instead use L. sub new { - my($class, %args) = @_; - my @rows; - my $self = { - result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods - db => $args{db}, # ref to the db, it is useful to add an $row->update method later - fields_def => undef, # fields definition - rows => \@rows, # resultset's rows - next_index => 0, # index used by the "next" method - }; - bless $self , $class; - # let's begin the parsing - $self->_parse; - return $self; + my($class, %args) = @_; + my @rows; + my $self = { + result_hash => $args{rs}, # complete result hash provided by Net::FileMaker::XML search methods + db => $args{db}, # ref to the db, it is useful to add an $row->update method later + fields_def => undef, # fields definition + rows => \@rows, # resultset's rows + next_index => 0, # index used by the "next" method + }; + bless $self , $class; + # let's begin the parsing + $self->_parse; + return $self; } =head2 fields_definition @@ -44,8 +44,8 @@ L. sub fields_definition { - my $self = shift; - return $self->{fields_def}->fields; + my $self = shift; + return $self->{fields_def}->fields; } @@ -71,9 +71,10 @@ sub http_response =head2 datasource -Return an hash with useful information about the datasource. -You don't need to use this information to parse the date, time or timestamp fields -as it is already done by the C methods of each row returned by the I method. +Return an hash with useful information about the datasource. You don't need to +use this information to parse the date, time or timestamp fields as it is +already done by the C methods of each row returned by the I +method. the hash contains: @@ -81,31 +82,31 @@ the hash contains: =item * database - database file name + database file name =item * layout - kind of layout, eg. 'List + kind of layout, eg. 'List =item * timestamp-format - eg. 'MM/dd/yyyy HH:mm:ss' + eg. 'MM/dd/yyyy HH:mm:ss' =item * date-format - eg. 'MM/dd/yyyy' + eg. 'MM/dd/yyyy' =item * time-format - eg. 'HH:mm:ss' + eg. 'HH:mm:ss' =item * table - name of the selected database table + name of the selected database table =item * total-count - total count of the records in the selected table + total count of the records in the selected table =back @@ -114,8 +115,8 @@ the hash contains: sub datasource { - my $self = shift; - return $self->{result_hash}{datasource}; + my $self = shift; + return $self->{result_hash}{datasource}; } =head2 xmlns @@ -126,8 +127,8 @@ Returns the XML namespace of the response. sub xmlns { - my $self = shift; - return $self->{result_hash}{xmlns}; + my $self = shift; + return $self->{result_hash}{xmlns}; } @@ -139,8 +140,8 @@ Returns the XML version of the response. sub version { - my $self = shift; - return $self->{result_hash}{version}; + my $self = shift; + return $self->{result_hash}{version}; } =head2 product @@ -151,11 +152,11 @@ Returns an hash with information about the FileMaker Server. sub product { - my $self = shift; - return { - version => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{version}, - build => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{build}, - } + my $self = shift; + return { + version => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{version}, + build => $self->{result_hash}{product}{'FileMaker Web Publishing Engine'}{build}, + } } =head2 total_count @@ -167,8 +168,8 @@ but B take into account the limit clause. sub total_count { - my $self = shift; - return $self->{result_hash}{resultset}{count}; + my $self = shift; + return $self->{result_hash}{resultset}{count}; } =head2 fetch_size @@ -180,8 +181,8 @@ does take into account the limit clause. sub fetch_size { - my $self = shift; - return $self->{result_hash}{resultset}{'fetch-size'}; + my $self = shift; + return $self->{result_hash}{resultset}{'fetch-size'}; } @@ -194,14 +195,15 @@ objects. sub rows { - my $self = shift; - return $self->{rows}; + my $self = shift; + return $self->{rows}; } =head2 next_row -Returns the next L if available, if not returns an undefined value +Returns the next L if available, if not +returns an undefined value. =cut @@ -209,11 +211,14 @@ sub next_row { my $self = shift; # if next row exists let's return it, otherwise undefined - if( $self->{next_index} < scalar @{$self->{rows}} ){ + if( $self->{next_index} < scalar @{$self->{rows}} ) + { my $index = $self->{next_index}; - $self->{next_index} ++ ; + $self->{next_index}++; return @{$self->{rows}}[$index]; - }else{ + } + else + { return; } } @@ -237,38 +242,48 @@ sub reset_index # calls all the methods that parse the single blocks of the response sub _parse { - my $self = shift; - # parse the resultset - $self->_parse_field_definition; - $self->_parse_rows; - return; + my $self = shift; + # parse the resultset + $self->_parse_field_definition; + $self->_parse_rows; + return; } # _parse_field_definition # parses the field definition instantiating a N::F::X::D::FieldDefinition sub _parse_field_definition { - my ($self) = @_; - require Net::FileMaker::XML::ResultSet::FieldsDefinition; - $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new($self->{result_hash}{metadata}{'field-definition'}); - return; + my ($self) = @_; + require Net::FileMaker::XML::ResultSet::FieldsDefinition; + $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new( + $self->{result_hash}{metadata}{'field-definition'} + ); + return; } # _parse_rows sub _parse_rows { - my $self = shift; - require Net::FileMaker::XML::ResultSet::Row; - my $cd = $self->fields_definition; # column definition, I need it for the inflater - my $ds = $self->datasource; - if($self->fetch_size == 1){ # if the fetch size is 1 it returns an hash with the row, if more it returns an array - push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($self->{result_hash}{resultset}{record},$self); - }else{ - for my $row (@{$self->{result_hash}{resultset}{record}}){ - push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row,$self); - } - } - return; + my $self = shift; + require Net::FileMaker::XML::ResultSet::Row; + my $cd = $self->fields_definition; # column definition, I need it for the inflater + my $ds = $self->datasource; + + # If the fetch size is 1 it returns an hash with the row, if more it returns an array + if($self->fetch_size == 1) + { + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new( + $self->{result_hash}{resultset}{record},$self + ); + } + else + { + for my $row (@{$self->{result_hash}{resultset}{record}}) + { + push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row,$self); + } + } + return; } 1; From 2c7dab948184f560921e48e578bb6fb73688600d Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 28 Oct 2011 12:07:26 +0100 Subject: [PATCH 82/90] Syntax fixes to Net::FileMaker::XML --- lib/Net/FileMaker/XML.pm | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 44db5a5..a6380b9 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -90,7 +90,8 @@ sub database =head2 dbnames -Returns an arrayref containing all XML/XSLT enabled databases for a given host. This method requires no authentication. +Returns an arrayref containing all XML/XSLT enabled databases for a given host. +This method requires no authentication. =cut @@ -108,9 +109,10 @@ sub dbnames =head1 COMPATIBILITY -This distrobution is actively tested against FileMaker Advanced Server 10.0.1.59 and 11.0.1.95. -Older versions are not tested at present, but feedback is welcome. See the messages present in the test suite on how to setup -tests against your server. +This distrobution is actively tested against FileMaker Advanced Server 10.0.1.59 +and 11.0.1.95. Older versions are not tested at present, but feedback is +welcome. See the messages present in the test suite on how to setup tests +against your server. =head1 SEE ALSO @@ -131,8 +133,9 @@ sub _request $uri->path($args{resultset}); my $url; - # This kind of defeats the purpose of using URI to begin with, but this fault has been reported - # on rt.cpan.org for over 2 years and many releases with no fix. + # This kind of defeats the purpose of using URI to begin with, but this + # fault has been reported on rt.cpan.org for over 2 years and many releases + # with no fix. if($args{params}) { $uri->query_form(%{$args{params}}); @@ -203,8 +206,10 @@ sub _assert_param { my($self, $unclean_param, $acceptable_params) = @_; my $param; - # if the param is of private type '-something' let's check, otherwise skip 'cause it could be the name of a field - # todo: we might add a strict control to avoid passing others params than the ones with "-" like in findall etc + # if the param is of private type '-something' let's check, otherwise skip + # 'cause it could be the name of a field + # TODO: we might add a strict control to avoid passing others params than + # the ones with "-" like in findall etc if($unclean_param =~ /^-.+$/x) { if($unclean_param =~/$acceptable_params/x) @@ -247,7 +252,8 @@ sub _assert_params } else { - $params->{$param} = $args{params}->{$param} if $self->_assert_param($param, $acceptable_params->{$type}); + $params->{$param} = $args{params}->{$param} + if $self->_assert_param($param, $acceptable_params->{$type}); } } } From 470a107b5fff1f046c83dc4d8f30a6c51d6991bd Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 28 Oct 2011 12:08:19 +0100 Subject: [PATCH 83/90] Documentation reformatting on Net::FileMaker --- lib/Net/FileMaker.pm | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index e1a90b0..9c2ccc6 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -19,15 +19,17 @@ Net::FileMaker - Interact with FileMaker services use Net::FileMaker; my $fms = Net::FileMaker->new(host => $host, type => 'xml'); -Net::FileMaker provides an interface to FileMaker's various HTTP-based interfaces, at present only the XML -API is supported, but further support to include XSLT and other means is planned. +Net::FileMaker provides an interface to FileMaker's various HTTP-based +interfaces, at present only the XML API is supported, but further support to +include XSLT and other means is planned. =head1 METHODS =head2 new(host => $host, type => 'xml') -Creates a new object. Host names must be valid URI. The type key specifies the type of database access - -XML, XSLT etc. At present only C is valid. If this is unspecified, XML is the default. +Creates a new object. Host names must be valid URI. The type key specifies the +type of database access - XML, XSLT etc. At present only C is valid. If +this is unspecified, XML is the default. =cut @@ -71,13 +73,16 @@ Marcel Grünauer, C<> =head1 BUGS -This distrobution is in it's early stages and B. -Please keep an eye out on the change log and the documentation of new releases before submitting bug reports. +This distrobution is in it's early stages and B. Please keep an eye out on the change log and +the documentation of new releases before submitting bug reports. -Please report any bugs or feature requests to C, or through -the web interface at L. I will be notified, and then you'll -automatically be notified of progress on your bug as I make changes. Please ensure to include the version of FileMaker Server -in your report. +Please report any bugs or feature requests to C, or through the web interface at +L. I will be +notified, and then you'll automatically be notified of progress on your bug as I +make changes. Please ensure to include the version of FileMaker Server in your +report. =head1 SUPPORT @@ -110,8 +115,9 @@ L =head1 DEVELOPMENT -Everyone is welcome to help towards the project with bugfixes, feature requests or contributions. -You'll find the git repository for this project is located at L. +Everyone is welcome to help towards the project with bugfixes, feature requests +or contributions. You'll find the git repository for this project is located at +L. =head1 LICENSE AND COPYRIGHT From d5719ce40354d75366f31f2bcb2efc4fdd4b796d Mon Sep 17 00:00:00 2001 From: Squeeks Date: Mon, 31 Oct 2011 11:11:39 +0000 Subject: [PATCH 84/90] Disabling perlcritic tests. To stop dzil from $VERSIONing packages, the package name is put on a new line, however perlcritic finds this to be a violation. There have been attempts to "work around" this, but I'm unhappy with implementing them all. --- t/00_load/01-perlcritic.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/00_load/01-perlcritic.t b/t/00_load/01-perlcritic.t index 2dd1902..5d4108b 100755 --- a/t/00_load/01-perlcritic.t +++ b/t/00_load/01-perlcritic.t @@ -3,6 +3,7 @@ use warnings; use Test::More; +plan skip_all => 'Perl::Critic false flagging issues with package declarations, skipping...'; eval 'use Test::Perl::Critic'; if ( $@ ) { From 864d3e47245721bb7b7b10e7011504d76a13ae59 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Tue, 1 Nov 2011 12:19:19 +0000 Subject: [PATCH 85/90] Minor syntax cleanup --- lib/Net/FileMaker/XML.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index a6380b9..732c762 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -210,8 +210,9 @@ sub _assert_param # 'cause it could be the name of a field # TODO: we might add a strict control to avoid passing others params than # the ones with "-" like in findall etc - if($unclean_param =~ /^-.+$/x) - { + + if($unclean_param =~ /^-.+$/x) + { if($unclean_param =~/$acceptable_params/x) { $param = $unclean_param; From bdcd126c1db59f170aa7d710fa09ee931df28ef2 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Thu, 21 Jun 2012 00:41:28 +0100 Subject: [PATCH 86/90] Switching quotation marks out for ASCII These have caused test failing with POD tests - see http://www.cpantesters.org/cpan/report/deffc91a-b9c3-11e1-968c-9e990346960a. --- lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index b815cc5..2639303 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -60,7 +60,7 @@ It may return (possible results in parentheses): =item -* type (“normal”, “calculation”, or “summary”) +* type ("normal", "calculation", or "summary") =item @@ -76,7 +76,7 @@ It may return (possible results in parentheses): =item -* result (“text”, “number”, “date”, “time”, “timestamp”, or “container”) +* result ("text", "number", "date", "time", "timestamp", or "container") =back From 92728eb8a5a2835677e14a56a2bcc0dc3d9ab882 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 1 Mar 2013 16:06:42 +0000 Subject: [PATCH 87/90] Adding in maintainence mode notice. --- lib/Net/FileMaker.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 9c2ccc6..3ec1580 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -73,9 +73,10 @@ Marcel Grünauer, C<> =head1 BUGS -This distrobution is in it's early stages and B. Please keep an eye out on the change log and -the documentation of new releases before submitting bug reports. +This distribution is now in maintainence mode as I (Squeeks) no longer have +access to a FileMaker Server to test functionality. If you are able to either +provide access to one or run the tests against one and provide feedback, please +get in touch so better support can be provided to this. Please report any bugs or feature requests to C, or through the web interface at From ca7fee5bdf8547bf31550d59bf3f42e2079997c0 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 1 Mar 2013 16:24:13 +0000 Subject: [PATCH 88/90] Removing tabs from nearly everything. --- lib/Net/FileMaker.pm | 38 +- lib/Net/FileMaker/Error.pm | 34 +- lib/Net/FileMaker/Error/DE/XML.pm | 454 ++++++++--------- lib/Net/FileMaker/Error/EN/XML.pm | 456 +++++++++--------- lib/Net/FileMaker/Error/EN/XSLT.pm | 86 ++-- lib/Net/FileMaker/Error/IT/XML.pm | 2 +- lib/Net/FileMaker/Error/IT/XSLT.pm | 2 +- lib/Net/FileMaker/Error/JA/XML.pm | 454 ++++++++--------- lib/Net/FileMaker/Error/JA/XSLT.pm | 84 ++-- lib/Net/FileMaker/XML.pm | 178 +++---- lib/Net/FileMaker/XML/ResultSet.pm | 24 +- .../XML/ResultSet/FieldsDefinition.pm | 42 +- .../XML/ResultSet/FieldsDefinition/Field.pm | 54 +-- lib/Net/FileMaker/XML/ResultSet/Row.pm | 178 +++---- t/00_load/01-perlcritic.t | 0 t/00_load/02-pod.t | 0 t/02_error/01-en.t | 4 +- t/02_error/02-ja.t | 4 +- t/02_error/03-it.t | 4 +- t/03_resultset/01-instantiation.t | 4 +- t/03_resultset/02-rows.t | 4 +- t/04_field_definition/01-fields.t | 2 +- t/05_row/01-inflated.t | 12 +- 23 files changed, 1060 insertions(+), 1060 deletions(-) mode change 100755 => 100644 t/00_load/01-perlcritic.t mode change 100755 => 100644 t/00_load/02-pod.t diff --git a/lib/Net/FileMaker.pm b/lib/Net/FileMaker.pm index 3ec1580..71e4003 100644 --- a/lib/Net/FileMaker.pm +++ b/lib/Net/FileMaker.pm @@ -35,25 +35,25 @@ this is unspecified, XML is the default. sub new { - my($class, %args) = @_; - - if($args{type} eq 'xml') - { - #TODO: Validate host is correct, must have http(s)? set first. - require Net::FileMaker::XML; - return Net::FileMaker::XML->new(%args); - } - elsif(!$args{type} || $args{type} eq '') - { - # Assume no type specified - use XML. - require Net::FileMaker::XML; - return Net::FileMaker::XML->new(%args); - } - # TODO: Add XSLT, PHP, etc. - else - { - croak 'Unknown type specified.'; - } + my($class, %args) = @_; + + if($args{type} eq 'xml') + { + #TODO: Validate host is correct, must have http(s)? set first. + require Net::FileMaker::XML; + return Net::FileMaker::XML->new(%args); + } + elsif(!$args{type} || $args{type} eq '') + { + # Assume no type specified - use XML. + require Net::FileMaker::XML; + return Net::FileMaker::XML->new(%args); + } + # TODO: Add XSLT, PHP, etc. + else + { + croak 'Unknown type specified.'; + } } diff --git a/lib/Net/FileMaker/Error.pm b/lib/Net/FileMaker/Error.pm index f61fba2..fe97927 100644 --- a/lib/Net/FileMaker/Error.pm +++ b/lib/Net/FileMaker/Error.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error; + Net::FileMaker::Error; use strict; use warnings; @@ -28,22 +28,22 @@ English, Japanese and German are presently supported with the aims of covering a # fails to load the strings. sub new { - my($class, %args) = @_; - - if($args{lang} ne '' && $args{type} ne '') - { - #TODO: Look at Module::Load instead? - my $class = "Net/FileMaker/Error/".uc($args{lang})."/".uc($args{type}).'.pm'; - my $package = "Net::FileMaker::Error::".uc($args{lang})."::".uc($args{type}); - require $class; - #TODO: try/catch if the sub class exists? - return $package->new; - } - else - { - return; - } - + my($class, %args) = @_; + + if($args{lang} ne '' && $args{type} ne '') + { + #TODO: Look at Module::Load instead? + my $class = "Net/FileMaker/Error/".uc($args{lang})."/".uc($args{type}).'.pm'; + my $package = "Net::FileMaker::Error::".uc($args{lang})."::".uc($args{type}); + require $class; + #TODO: try/catch if the sub class exists? + return $package->new; + } + else + { + return; + } + } 1; # End of Net::FileMaker::Error diff --git a/lib/Net/FileMaker/Error/DE/XML.pm b/lib/Net/FileMaker/Error/DE/XML.pm index 11ac4ab..c921113 100644 --- a/lib/Net/FileMaker/Error/DE/XML.pm +++ b/lib/Net/FileMaker/Error/DE/XML.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::DE::XML; + Net::FileMaker::Error::DE::XML; use strict; use warnings; @@ -22,241 +22,241 @@ L my $error_codes = { - '-1' => "Unbekannter Fehler", - 0 => "Kein Fehler", - 1 => "Aktion durch Benutzer abgebrochen", - 2 => "Speicherfehler", - 3 => "Befehl nicht verfügbar (z. B. falsches Betriebssystem, falscher Modus etc.)", - 4 => "Befehl unbekannt.", - 5 => "Befehl ungültig (z. B. ist für den Scriptschritt „Feldwert setzen“ keine Formel angegeben).", - 6 => "Datei ist schreibgeschützt.", - 7 => "Speicherüberlauf", - 8 => "Leeres Ergebnis", - 9 => "Ungenügende Berechtigungen", - 10 => "Angeforderte Daten fehlen.", - 11 => "Name ist nicht gültig.", - 12 => "Name existiert bereits.", - 13 => "Datei oder Objekt ist in Gebrauch.", - 14 => "Außerhalb des gültigen Bereichs", - 15 => "Teilen durch null nicht möglich.", - 16 => "Operation fehlgeschlagen, Anfrage wiederholen (z. B. eine Benutzeranfrage).", - 17 => "Konvertierung von fremdem Zeichensatz in UTF-16 fehlgeschlagen.", - 18 => "Client muss Kontoinformationen liefern, um fortzufahren.", - 19 => "Zeichenfolge enthält andere Zeichen als A-Z, a-z, 0-9 (ASCII).", - 20 => "Befehl oder Vorgang durch ausgelöstes Script abgebrochen.", - 100 => "Datei fehlt.", - 101 => "Datensatz fehlt.", - 102 => "Feld fehlt.", - 103 => "Beziehung fehlt.", - 104 => "Script fehlt.", - 105 => "Layout fehlt.", - 106 => "Tabelle fehlt.", - 107 => "Index fehlt.", - 108 => "Werteliste nicht vorhanden.", - 109 => "Berechtigung fehlt.", - 110 => "Bezugstabellen fehlen.", - 111 => "Feldwiederholung ist ungültig.", - 112 => "Fenster fehlt.", - 113 => "Funktion fehlt.", - 114 => "Dateiverweis fehlt.", - 115 => "Menüset fehlt.", - 116 => "Layoutobjekt fehlt.", - 117 => "Datenquelle fehlt.", - 130 => "Dateien sind beschädigt oder fehlen und müssen neu installiert werden.", - 131 => "Dateien des Sprachpakets fehlen (z. B. Vorlagendateien).", - 200 => "Zugriff auf Datensatz verweigert.", - 201 => "Feld kann nicht geändert werden.", - 202 => "Zugriff auf Feld verweigert.", - 203 => "Keine zu druckenden Datensätze in der Datei bzw. Passwort erlaubt kein Drucken.", - 204 => "Kein Zugriff auf Feld(er) in Sortierfolge", - 205 => "Benutzer hat keine Zugriffsrechte, um neue Datensätze zu erstellen; Import überschreibt bestehende Daten.", - 206 => "Benutzer hat keine Zugriffsrechte, um das Passwort zu ändern, oder die Datei ist schreibgeschützt.", - 207 => "Benutzer hat nicht genügend Zugriffsrechte, um das Datenbankschema zu ändern, oder die Datei ist schreibgeschützt.", - 208 => "Passwort enthält zu wenige Zeichen.", - 209 => "Neues Passwort muss sich vom bestehenden unterscheiden.", - 210 => "Benutzerkonto ist inaktiv.", - 211 => "Passwort ist abgelaufen.", - 212 => "Ungültiges Benutzerkonto und/oder Passwort. Versuchen Sie es erneut.", - 213 => "Benutzerkonto und/oder Passwort existieren nicht.", - 214 => "Zu viele Anmeldeversuche", - 215 => "Administratorrechte können nicht dupliziert werden.", - 216 => "Gastkonto kann nicht dupliziert werden.", - 217 => "Benutzer hat nicht genügend Zugriffsrechte, um Administratorkonto zu ändern.", - 300 => "Datei ist geschützt oder in Gebrauch.", - 301 => "Datei ist blockiert durch anderen Anwender.", - 302 => "Tabelle ist blockiert durch anderen Anwender.", - 303 => "Datenbankschema ist blockiert durch anderen Anwender.", - 304 => "Layout ist blockiert durch anderen Anwender.", - 306 => "Datensatzänderungs-ID stimmt nicht überein.", - 400 => "Suchkriterien sind leer.", - 401 => "Kein Datensatz entspricht der Abfrage.", - 402 => "Kein Abgleichsfeld für eine Referenz", - 403 => "Maximales Datensatzlimit für FileMaker Pro-Demo wird überschritten.", - 404 => "Ungültige Sortierfolge", - 405 => "Angegebene Datensatzzahl übersteigt die Anzahl der ausschließbaren Datensätze.", - 406 => "Ungültige Kriterien für Ersetzen/Neunummerierung", - 407 => "Ein oder beide Gruppierfeld(er) fehlen (ungültige Beziehung).", - 408 => "Angegebenes Feld hat ein Datenformat, das diesem Befehl nicht entspricht.", - 409 => "Ungültige Importfolge", - 410 => "Ungültige Exportfolge", - 412 => "Falsche Version von FileMaker Pro verwendet, um die Datei wiederherzustellen", - 413 => "Angegebenes Feld hat ungeeigneten Feldtyp.", - 414 => "Layout kann das Ergebnis nicht anzeigen.", - 415 => "Ein oder mehrere erforderliche Bezugsdatensätze sind nicht verfügbar.", - 416 => "Primärschlüssel erforderlich für Datenquelltabelle", - 417 => "Die Datenbank ist keine unterstützte Datenquelle.", - 500 => "Datumswert entspricht nicht den Überprüfungskriterien.", - 501 => "Zeitwert entspricht nicht den Überprüfungskriterien.", - 502 => "Zahlenwert entspricht nicht den Überprüfungskriterien.", - 503 => "Feldwert entspricht nicht der Bereichsüberprüfung.", - 504 => "Feldwert entspricht nicht der Eindeutigkeitsüberprüfung.", - 505 => "Feldwert existiert nicht in der Datenbank und entspricht nicht der Existenzüberprüfung.", - 506 => "Feldwert entspricht nicht der Überprüfung nach Bestandteil einer Werteliste.", - 507 => "Feldwert entspricht nicht der Überprüfung durch Berechnung.", - 508 => "Ungültiger Wert wurde in Suchenmodus eingegeben.", - 509 => "Feld verlangt gültigen Wert.", - 510 => "Bezugswert ist leer oder nicht verfügbar.", - 511 => "Der Wert im Feld überschreitet die maximale Anzahl der zulässigen Zeichen.", - 512 => "Datensatz wurde bereits durch anderen Anwender geändert.", - 513 => "Um einen Datensatz zu erstellen, muss der Datensatz in mindestens einem Feld einen Wert haben.", - 600 => "Druckerfehler aufgetreten.", - 601 => "Kombination von Kopf- und Fußbereich übersteigt eine Seitenlänge.", - 602 => "Datenbereich passt für aktuelle Spalteneinstellung nicht auf eine Seite.", - 603 => "Verbindung zum Drucker getrennt.", - 700 => "Datei hat falschen Dateityp für Import.", - 706 => "EPSF-Datei hat keine Übersichtsgrafik.", - 707 => "Grafikfilter nicht vorhanden.", - 708 => "Dateiimport nicht möglich bzw. Farbmonitor für Import erforderlich.", - 709 => "Import des QuickTime-Films fehlgeschlagen.", - 710 => "QuickTime-Dateiverweis konnte nicht aktualisiert werden, da für Datenbankdatei nur Lesezugriff besteht.", - 711 => "Importfilter nicht vorhanden.", - 714 => "Zugriffsrechte reichen für diesen Befehl nicht aus.", - 715 => "Benannter Bereich oder Tabellenblatt von Excel konnte nicht gefunden werden.", - 716 => "Eine SQL Anfrage mit DELETE, INSERT oder UPDATE ist nicht für ODBC Import erlaubt.", - 717 => "Zum Fortsetzen des Imports bzw. Exports sind nicht genügend XML/XSL-Daten vorhanden.", - 718 => "XML-Parsingfehler (von Xerces)", - 719 => "Fehler beim Transformieren von XML mit XSL (von Xalan)", - 720 => "Fehler beim Export: Das vorgesehene Format unterstützt keine Wiederholfelder.", - 721 => "Im Parser oder Transformer ist ein unbekannter Fehler aufgetreten.", - 722 => "Daten können nicht in eine Datei importiert werden, die keine Felder hat.", - 723 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle hinzuzufügen oder zu ändern.", - 724 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle hinzuzufügen.", - 725 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle zu ändern.", - 726 => "In der Importdatei sind mehr Datensätze vorhanden als in der Zieltabelle. Nicht alle Datensätze werden importiert.", - 727 => "In der Zieltabelle sind mehr Datensätze vorhanden als in der Importdatei. Nicht alle Datensätze werden aktualisiert.", - 729 => "Fehler beim Import. Datensätze konnten nicht importiert werden.", - 730 => "Nicht unterstützte Excel-Version. Konvertieren Sie die Datei in Excel 7.0 (Excel 95), Excel 97, 2000, XP oder 2007 und versuchen Sie es erneut.", - 731 => "Die für den Import ausgewählte Datei enthält keine Daten.", - 732 => "Diese Datei kann nicht eingefügt werden, weil sie selbst weitere Dateien enthält.", - 733 => "Eine Tabelle kann nicht in sich selbst importiert werden.", - 734 => "Dieser Dateityp kann nicht als Bild dargestellt werden.", - 735 => "Dieser Dateityp kann nicht als Bild dargestellt werden. Er wird eingefügt und dann als Datei dargestellt.", - 736 => "Zu viele Daten für den Export in dieses Format. Sie werden abgeschnitten.", - 800 => "Datei konnte auf Datenträger nicht erstellt werden.", - 801 => "Temporärdatei konnte auf Systemdatenträger nicht erstellt werden.", - 802 => "Datei konnte nicht geöffnet werden. Dieser Fehler kann durch eine oder mehrere der folgenden Möglichkeiten verursacht werden: Ungültiger Datenbankname, Datei ist in FileMaker Server geschlossen, Ungültige Berechtigung", - 803 => "Datei in Einzelbenutzer-Status oder Host nicht vorhanden.", - 804 => "Datei konnte in ihrem aktuellen Status nicht mit Nur-Lese-Zugriff geöffnet werden.", - 805 => "Datei ist beschädigt; stellen Sie die Datei wieder her.", - 806 => "Datei kann mit dieser Version von FileMaker Pro nicht geöffnet werden.", - 807 => "Datei ist keine FileMaker Pro-Datei oder ist schwer beschädigt.", - 808 => "Datei kann wegen beschädigter Zugriffsrechte nicht geöffnet werden.", - 809 => "Datenträger voll", - 810 => "Datenträger fixiert", - 811 => "Temporärdatei kann nicht als FileMaker Pro-Datei geöffnet werden.", - 813 => "Fehler bei Datensatz-Synchronisation im Netzwerk", - 814 => "Datei(en) kann (können) nicht geöffnet werden, da die maximale Anzahl an Dateien geöffnet ist.", - 815 => "Referenzdatei konnte nicht geöffnet werden.", - 816 => "Datei konnte nicht konvertiert werden.", - 817 => "Der Bindungsschlüssel der Datei stimmt nicht mit dieser Laufzeitanwendung überein.", - 819 => "Lokale Kopie einer remote Datei kann nicht gespeichert werden.", - 820 => "Datei wird geschlossen.", - 821 => "Host hat die Verbindung getrennt.", - 822 => "FMI-Dateien nicht gefunden; fehlende Dateien neu installieren.", - 823 => "Datei kann nicht auf Einzelbenutzer gesetzt werden, da Gäste verbunden sind.", - 824 => "Datei ist beschädigt oder keine FileMaker-Datei.", - 900 => "Allgemeiner Fehler in der Rechtschreibprüfung", - 901 => "Standardwörterbuch nicht installiert.", - 902 => "Hilfe-System konnte nicht gestartet werden.", - 903 => "Befehl kann nicht in einer gemeinsam genutzten Datei verwendet werden.", - 904 => "Befehl kann nur in einer Datei verwendet werden, die von FileMaker Pro Server freigegeben wurde.", - 905 => "Kein aktives Feld ausgewählt, Befehl kann nur mit aktivem Feld verwendet werden.", - 906 => "Die aktuelle Datei wird nicht bereitgestellt. Der Befehl kann nur verwendet werden, wenn die Datei bereitgestellt wird.", - 920 => "Initialisierung der Rechtschreibprüfung nicht möglich.", - 921 => "Anwenderwörterbuch kann nicht zur Bearbeitung geladen werden.", - 922 => "Anwenderwörterbuch existiert nicht.", - 923 => "Anwenderwörterbuch ist schreibgeschützt.", - 951 => "Ein unerwarteter Fehler ist aufgetreten.", - 954 => "Nicht unterstützte XML-Grammatik", - 955 => "Kein Datenbankname", - 956 => "Maximale Anzahl von Datenbanksitzungen überschritten.", - 957 => "Widersprüchliche Befehle", - 958 => "Parameter fehlt in Query", - 1200 => "Generischer Rechenfehler", - 1201 => "In dieser Funktion gibt es zu wenige Parameter.", - 1202 => "In dieser Funktion gibt es zu viele Parameter.", - 1203 => "Unerwartetes Ende der Berechnung", - 1204 => "Es wird eine Zahl, eine Textkonstante, ein Feldname bzw. „(“ erwartet.", - 1205 => "Kommentar ist nicht mit „*/“ beendet.", - 1206 => "Textkonstante muss mit einem Anführungszeichen enden.", - 1207 => "Klammer unvollständig", - 1208 => "Operator fehlt, Funktion nicht gefunden oder „(“ nicht erwartet.", - 1209 => "Name (z. B. Feldname oder Layoutname) fehlt.", - 1210 => "Plugin-Funktion wurde bereits registriert.", - 1211 => "In dieser Funktion ist die Listennutzung nicht zulässig.", - 1212 => "Hier wird ein Operator (z. B. +, -, * ) erwartet.", - 1213 => "Diese Variable wurde bereits in der SetzeVars-Funktion definiert.", - 1214 => "MITTELWERT, ANZAHL, ERWEITERN, HOLEWIEDERHOLFELDWERT, MAX, MIN, NBW, STABW, SUMME und HOLEERGEBNISWERT: Ausdruck gefunden, wo nur ein Feld benötigt wird.", - 1215 => "Dieser Parameter ist ein ungültiger Statusfunktionsparameter.", - 1216 => "Als erstes Argument einer HOLEERGEBNISWERT-Funktion können nur Statistikfelder angegeben werden.", - 1217 => "Gruppierfeld ist ungültig.", - 1218 => "Zahl kann nicht berechnet werden.", - 1219 => "Ein Feld kann nicht in seiner eigenen Formel benutzt werden.", - 1220 => "Feldtyp muss normal oder berechnet sein.", - 1221 => "Datentyp muss Zahl, Datum, Zeit oder Zeitstempel sein.", - 1222 => "Formel kann nicht gespeichert werden.", - 1223 => "Die angegebene Funktion ist noch nicht implementiert.", - 1224 => "Die angegebene Funktion existiert nicht.", - 1225 => "Die angegebene Funktion wird in diesem Kontext nicht unterstützt.", - 1400 => "ODBC-Client-Treiberinitialisierung fehlgeschlagen. Stellen Sie sicher, dass die ODBC-Client- Treiber richtig installiert sind.", - 1401 => "Umgebung konnte nicht zugeteilt werden (ODBC).", - 1402 => "Umgebung konnte nicht freigegeben werden (ODBC).", - 1403 => "Verbindung trennen fehlerhaft (ODBC).", - 1404 => "Verbindung konnte nicht zugeteilt werden (ODBC).", - 1405 => "Verbindung konnte nicht freigegeben werden (ODBC).", - 1406 => "Überprüfung von SQL API fehlgeschlagen (ODBC).", - 1407 => "Anweisung konnte nicht zugeteilt werden (ODBC).", - 1408 => "Erweiterter Fehler (ODBC)", - 1409 => "Erweiterter Fehler (ODBC)", - 1410 => "Erweiterter Fehler (ODBC)", - 1411 => "Erweiterter Fehler (ODBC)", - 1412 => "Erweiterter Fehler (ODBC)", - 1413 => "Erweiterter Fehler (ODBC)", - 1450 => "Aktion erfordert PHP-Berechtigungserweiterung.", - 1451 => "Aktion erfordert, dass die aktuelle Datei remote ist.", - 1501 => "SMTP-Authentifizierung fehlgeschlagen.", - 1502 => "Verbindung vom SMTP-Server abgelehnt.", - 1503 => "SSL-Fehler", - 1504 => "Der SMTP-Server erfordert eine verschlüsselte Verbindung.", - 1505 => "Die angegebene Authentifizierung wird vom SMTP-Server nicht unterstützt.", - 1506 => "E-Mail(s) konnte(n) nicht erfolgreich versendet werden.", - 1507 => "Anmeldung am SMTP-Server nicht möglich" - + '-1' => "Unbekannter Fehler", + 0 => "Kein Fehler", + 1 => "Aktion durch Benutzer abgebrochen", + 2 => "Speicherfehler", + 3 => "Befehl nicht verfügbar (z. B. falsches Betriebssystem, falscher Modus etc.)", + 4 => "Befehl unbekannt.", + 5 => "Befehl ungültig (z. B. ist für den Scriptschritt „Feldwert setzen“ keine Formel angegeben).", + 6 => "Datei ist schreibgeschützt.", + 7 => "Speicherüberlauf", + 8 => "Leeres Ergebnis", + 9 => "Ungenügende Berechtigungen", + 10 => "Angeforderte Daten fehlen.", + 11 => "Name ist nicht gültig.", + 12 => "Name existiert bereits.", + 13 => "Datei oder Objekt ist in Gebrauch.", + 14 => "Außerhalb des gültigen Bereichs", + 15 => "Teilen durch null nicht möglich.", + 16 => "Operation fehlgeschlagen, Anfrage wiederholen (z. B. eine Benutzeranfrage).", + 17 => "Konvertierung von fremdem Zeichensatz in UTF-16 fehlgeschlagen.", + 18 => "Client muss Kontoinformationen liefern, um fortzufahren.", + 19 => "Zeichenfolge enthält andere Zeichen als A-Z, a-z, 0-9 (ASCII).", + 20 => "Befehl oder Vorgang durch ausgelöstes Script abgebrochen.", + 100 => "Datei fehlt.", + 101 => "Datensatz fehlt.", + 102 => "Feld fehlt.", + 103 => "Beziehung fehlt.", + 104 => "Script fehlt.", + 105 => "Layout fehlt.", + 106 => "Tabelle fehlt.", + 107 => "Index fehlt.", + 108 => "Werteliste nicht vorhanden.", + 109 => "Berechtigung fehlt.", + 110 => "Bezugstabellen fehlen.", + 111 => "Feldwiederholung ist ungültig.", + 112 => "Fenster fehlt.", + 113 => "Funktion fehlt.", + 114 => "Dateiverweis fehlt.", + 115 => "Menüset fehlt.", + 116 => "Layoutobjekt fehlt.", + 117 => "Datenquelle fehlt.", + 130 => "Dateien sind beschädigt oder fehlen und müssen neu installiert werden.", + 131 => "Dateien des Sprachpakets fehlen (z. B. Vorlagendateien).", + 200 => "Zugriff auf Datensatz verweigert.", + 201 => "Feld kann nicht geändert werden.", + 202 => "Zugriff auf Feld verweigert.", + 203 => "Keine zu druckenden Datensätze in der Datei bzw. Passwort erlaubt kein Drucken.", + 204 => "Kein Zugriff auf Feld(er) in Sortierfolge", + 205 => "Benutzer hat keine Zugriffsrechte, um neue Datensätze zu erstellen; Import überschreibt bestehende Daten.", + 206 => "Benutzer hat keine Zugriffsrechte, um das Passwort zu ändern, oder die Datei ist schreibgeschützt.", + 207 => "Benutzer hat nicht genügend Zugriffsrechte, um das Datenbankschema zu ändern, oder die Datei ist schreibgeschützt.", + 208 => "Passwort enthält zu wenige Zeichen.", + 209 => "Neues Passwort muss sich vom bestehenden unterscheiden.", + 210 => "Benutzerkonto ist inaktiv.", + 211 => "Passwort ist abgelaufen.", + 212 => "Ungültiges Benutzerkonto und/oder Passwort. Versuchen Sie es erneut.", + 213 => "Benutzerkonto und/oder Passwort existieren nicht.", + 214 => "Zu viele Anmeldeversuche", + 215 => "Administratorrechte können nicht dupliziert werden.", + 216 => "Gastkonto kann nicht dupliziert werden.", + 217 => "Benutzer hat nicht genügend Zugriffsrechte, um Administratorkonto zu ändern.", + 300 => "Datei ist geschützt oder in Gebrauch.", + 301 => "Datei ist blockiert durch anderen Anwender.", + 302 => "Tabelle ist blockiert durch anderen Anwender.", + 303 => "Datenbankschema ist blockiert durch anderen Anwender.", + 304 => "Layout ist blockiert durch anderen Anwender.", + 306 => "Datensatzänderungs-ID stimmt nicht überein.", + 400 => "Suchkriterien sind leer.", + 401 => "Kein Datensatz entspricht der Abfrage.", + 402 => "Kein Abgleichsfeld für eine Referenz", + 403 => "Maximales Datensatzlimit für FileMaker Pro-Demo wird überschritten.", + 404 => "Ungültige Sortierfolge", + 405 => "Angegebene Datensatzzahl übersteigt die Anzahl der ausschließbaren Datensätze.", + 406 => "Ungültige Kriterien für Ersetzen/Neunummerierung", + 407 => "Ein oder beide Gruppierfeld(er) fehlen (ungültige Beziehung).", + 408 => "Angegebenes Feld hat ein Datenformat, das diesem Befehl nicht entspricht.", + 409 => "Ungültige Importfolge", + 410 => "Ungültige Exportfolge", + 412 => "Falsche Version von FileMaker Pro verwendet, um die Datei wiederherzustellen", + 413 => "Angegebenes Feld hat ungeeigneten Feldtyp.", + 414 => "Layout kann das Ergebnis nicht anzeigen.", + 415 => "Ein oder mehrere erforderliche Bezugsdatensätze sind nicht verfügbar.", + 416 => "Primärschlüssel erforderlich für Datenquelltabelle", + 417 => "Die Datenbank ist keine unterstützte Datenquelle.", + 500 => "Datumswert entspricht nicht den Überprüfungskriterien.", + 501 => "Zeitwert entspricht nicht den Überprüfungskriterien.", + 502 => "Zahlenwert entspricht nicht den Überprüfungskriterien.", + 503 => "Feldwert entspricht nicht der Bereichsüberprüfung.", + 504 => "Feldwert entspricht nicht der Eindeutigkeitsüberprüfung.", + 505 => "Feldwert existiert nicht in der Datenbank und entspricht nicht der Existenzüberprüfung.", + 506 => "Feldwert entspricht nicht der Überprüfung nach Bestandteil einer Werteliste.", + 507 => "Feldwert entspricht nicht der Überprüfung durch Berechnung.", + 508 => "Ungültiger Wert wurde in Suchenmodus eingegeben.", + 509 => "Feld verlangt gültigen Wert.", + 510 => "Bezugswert ist leer oder nicht verfügbar.", + 511 => "Der Wert im Feld überschreitet die maximale Anzahl der zulässigen Zeichen.", + 512 => "Datensatz wurde bereits durch anderen Anwender geändert.", + 513 => "Um einen Datensatz zu erstellen, muss der Datensatz in mindestens einem Feld einen Wert haben.", + 600 => "Druckerfehler aufgetreten.", + 601 => "Kombination von Kopf- und Fußbereich übersteigt eine Seitenlänge.", + 602 => "Datenbereich passt für aktuelle Spalteneinstellung nicht auf eine Seite.", + 603 => "Verbindung zum Drucker getrennt.", + 700 => "Datei hat falschen Dateityp für Import.", + 706 => "EPSF-Datei hat keine Übersichtsgrafik.", + 707 => "Grafikfilter nicht vorhanden.", + 708 => "Dateiimport nicht möglich bzw. Farbmonitor für Import erforderlich.", + 709 => "Import des QuickTime-Films fehlgeschlagen.", + 710 => "QuickTime-Dateiverweis konnte nicht aktualisiert werden, da für Datenbankdatei nur Lesezugriff besteht.", + 711 => "Importfilter nicht vorhanden.", + 714 => "Zugriffsrechte reichen für diesen Befehl nicht aus.", + 715 => "Benannter Bereich oder Tabellenblatt von Excel konnte nicht gefunden werden.", + 716 => "Eine SQL Anfrage mit DELETE, INSERT oder UPDATE ist nicht für ODBC Import erlaubt.", + 717 => "Zum Fortsetzen des Imports bzw. Exports sind nicht genügend XML/XSL-Daten vorhanden.", + 718 => "XML-Parsingfehler (von Xerces)", + 719 => "Fehler beim Transformieren von XML mit XSL (von Xalan)", + 720 => "Fehler beim Export: Das vorgesehene Format unterstützt keine Wiederholfelder.", + 721 => "Im Parser oder Transformer ist ein unbekannter Fehler aufgetreten.", + 722 => "Daten können nicht in eine Datei importiert werden, die keine Felder hat.", + 723 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle hinzuzufügen oder zu ändern.", + 724 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle hinzuzufügen.", + 725 => "Sie sind nicht berechtigt, Datensätze in der Zieltabelle zu ändern.", + 726 => "In der Importdatei sind mehr Datensätze vorhanden als in der Zieltabelle. Nicht alle Datensätze werden importiert.", + 727 => "In der Zieltabelle sind mehr Datensätze vorhanden als in der Importdatei. Nicht alle Datensätze werden aktualisiert.", + 729 => "Fehler beim Import. Datensätze konnten nicht importiert werden.", + 730 => "Nicht unterstützte Excel-Version. Konvertieren Sie die Datei in Excel 7.0 (Excel 95), Excel 97, 2000, XP oder 2007 und versuchen Sie es erneut.", + 731 => "Die für den Import ausgewählte Datei enthält keine Daten.", + 732 => "Diese Datei kann nicht eingefügt werden, weil sie selbst weitere Dateien enthält.", + 733 => "Eine Tabelle kann nicht in sich selbst importiert werden.", + 734 => "Dieser Dateityp kann nicht als Bild dargestellt werden.", + 735 => "Dieser Dateityp kann nicht als Bild dargestellt werden. Er wird eingefügt und dann als Datei dargestellt.", + 736 => "Zu viele Daten für den Export in dieses Format. Sie werden abgeschnitten.", + 800 => "Datei konnte auf Datenträger nicht erstellt werden.", + 801 => "Temporärdatei konnte auf Systemdatenträger nicht erstellt werden.", + 802 => "Datei konnte nicht geöffnet werden. Dieser Fehler kann durch eine oder mehrere der folgenden Möglichkeiten verursacht werden: Ungültiger Datenbankname, Datei ist in FileMaker Server geschlossen, Ungültige Berechtigung", + 803 => "Datei in Einzelbenutzer-Status oder Host nicht vorhanden.", + 804 => "Datei konnte in ihrem aktuellen Status nicht mit Nur-Lese-Zugriff geöffnet werden.", + 805 => "Datei ist beschädigt; stellen Sie die Datei wieder her.", + 806 => "Datei kann mit dieser Version von FileMaker Pro nicht geöffnet werden.", + 807 => "Datei ist keine FileMaker Pro-Datei oder ist schwer beschädigt.", + 808 => "Datei kann wegen beschädigter Zugriffsrechte nicht geöffnet werden.", + 809 => "Datenträger voll", + 810 => "Datenträger fixiert", + 811 => "Temporärdatei kann nicht als FileMaker Pro-Datei geöffnet werden.", + 813 => "Fehler bei Datensatz-Synchronisation im Netzwerk", + 814 => "Datei(en) kann (können) nicht geöffnet werden, da die maximale Anzahl an Dateien geöffnet ist.", + 815 => "Referenzdatei konnte nicht geöffnet werden.", + 816 => "Datei konnte nicht konvertiert werden.", + 817 => "Der Bindungsschlüssel der Datei stimmt nicht mit dieser Laufzeitanwendung überein.", + 819 => "Lokale Kopie einer remote Datei kann nicht gespeichert werden.", + 820 => "Datei wird geschlossen.", + 821 => "Host hat die Verbindung getrennt.", + 822 => "FMI-Dateien nicht gefunden; fehlende Dateien neu installieren.", + 823 => "Datei kann nicht auf Einzelbenutzer gesetzt werden, da Gäste verbunden sind.", + 824 => "Datei ist beschädigt oder keine FileMaker-Datei.", + 900 => "Allgemeiner Fehler in der Rechtschreibprüfung", + 901 => "Standardwörterbuch nicht installiert.", + 902 => "Hilfe-System konnte nicht gestartet werden.", + 903 => "Befehl kann nicht in einer gemeinsam genutzten Datei verwendet werden.", + 904 => "Befehl kann nur in einer Datei verwendet werden, die von FileMaker Pro Server freigegeben wurde.", + 905 => "Kein aktives Feld ausgewählt, Befehl kann nur mit aktivem Feld verwendet werden.", + 906 => "Die aktuelle Datei wird nicht bereitgestellt. Der Befehl kann nur verwendet werden, wenn die Datei bereitgestellt wird.", + 920 => "Initialisierung der Rechtschreibprüfung nicht möglich.", + 921 => "Anwenderwörterbuch kann nicht zur Bearbeitung geladen werden.", + 922 => "Anwenderwörterbuch existiert nicht.", + 923 => "Anwenderwörterbuch ist schreibgeschützt.", + 951 => "Ein unerwarteter Fehler ist aufgetreten.", + 954 => "Nicht unterstützte XML-Grammatik", + 955 => "Kein Datenbankname", + 956 => "Maximale Anzahl von Datenbanksitzungen überschritten.", + 957 => "Widersprüchliche Befehle", + 958 => "Parameter fehlt in Query", + 1200 => "Generischer Rechenfehler", + 1201 => "In dieser Funktion gibt es zu wenige Parameter.", + 1202 => "In dieser Funktion gibt es zu viele Parameter.", + 1203 => "Unerwartetes Ende der Berechnung", + 1204 => "Es wird eine Zahl, eine Textkonstante, ein Feldname bzw. „(“ erwartet.", + 1205 => "Kommentar ist nicht mit „*/“ beendet.", + 1206 => "Textkonstante muss mit einem Anführungszeichen enden.", + 1207 => "Klammer unvollständig", + 1208 => "Operator fehlt, Funktion nicht gefunden oder „(“ nicht erwartet.", + 1209 => "Name (z. B. Feldname oder Layoutname) fehlt.", + 1210 => "Plugin-Funktion wurde bereits registriert.", + 1211 => "In dieser Funktion ist die Listennutzung nicht zulässig.", + 1212 => "Hier wird ein Operator (z. B. +, -, * ) erwartet.", + 1213 => "Diese Variable wurde bereits in der SetzeVars-Funktion definiert.", + 1214 => "MITTELWERT, ANZAHL, ERWEITERN, HOLEWIEDERHOLFELDWERT, MAX, MIN, NBW, STABW, SUMME und HOLEERGEBNISWERT: Ausdruck gefunden, wo nur ein Feld benötigt wird.", + 1215 => "Dieser Parameter ist ein ungültiger Statusfunktionsparameter.", + 1216 => "Als erstes Argument einer HOLEERGEBNISWERT-Funktion können nur Statistikfelder angegeben werden.", + 1217 => "Gruppierfeld ist ungültig.", + 1218 => "Zahl kann nicht berechnet werden.", + 1219 => "Ein Feld kann nicht in seiner eigenen Formel benutzt werden.", + 1220 => "Feldtyp muss normal oder berechnet sein.", + 1221 => "Datentyp muss Zahl, Datum, Zeit oder Zeitstempel sein.", + 1222 => "Formel kann nicht gespeichert werden.", + 1223 => "Die angegebene Funktion ist noch nicht implementiert.", + 1224 => "Die angegebene Funktion existiert nicht.", + 1225 => "Die angegebene Funktion wird in diesem Kontext nicht unterstützt.", + 1400 => "ODBC-Client-Treiberinitialisierung fehlgeschlagen. Stellen Sie sicher, dass die ODBC-Client- Treiber richtig installiert sind.", + 1401 => "Umgebung konnte nicht zugeteilt werden (ODBC).", + 1402 => "Umgebung konnte nicht freigegeben werden (ODBC).", + 1403 => "Verbindung trennen fehlerhaft (ODBC).", + 1404 => "Verbindung konnte nicht zugeteilt werden (ODBC).", + 1405 => "Verbindung konnte nicht freigegeben werden (ODBC).", + 1406 => "Überprüfung von SQL API fehlgeschlagen (ODBC).", + 1407 => "Anweisung konnte nicht zugeteilt werden (ODBC).", + 1408 => "Erweiterter Fehler (ODBC)", + 1409 => "Erweiterter Fehler (ODBC)", + 1410 => "Erweiterter Fehler (ODBC)", + 1411 => "Erweiterter Fehler (ODBC)", + 1412 => "Erweiterter Fehler (ODBC)", + 1413 => "Erweiterter Fehler (ODBC)", + 1450 => "Aktion erfordert PHP-Berechtigungserweiterung.", + 1451 => "Aktion erfordert, dass die aktuelle Datei remote ist.", + 1501 => "SMTP-Authentifizierung fehlgeschlagen.", + 1502 => "Verbindung vom SMTP-Server abgelehnt.", + 1503 => "SSL-Fehler", + 1504 => "Der SMTP-Server erfordert eine verschlüsselte Verbindung.", + 1505 => "Die angegebene Authentifizierung wird vom SMTP-Server nicht unterstützt.", + 1506 => "E-Mail(s) konnte(n) nicht erfolgreich versendet werden.", + 1507 => "Anmeldung am SMTP-Server nicht möglich" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::DE::XML diff --git a/lib/Net/FileMaker/Error/EN/XML.pm b/lib/Net/FileMaker/Error/EN/XML.pm index f6a6c95..672623a 100644 --- a/lib/Net/FileMaker/Error/EN/XML.pm +++ b/lib/Net/FileMaker/Error/EN/XML.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::EN::XML; + Net::FileMaker::Error::EN::XML; use strict; use warnings; @@ -19,242 +19,242 @@ L =cut my $error_codes = { - - '-1' => 'Unknown error', - 0 => 'No error', - 1 => "User canceled action ", - 2 => "Memory error ", - 3 => "Command is unavailable (for example, wrong operating system, wrong mode, etc.)", - 4 => "Command is unknown", - 5 => "Command is invalid (for example, a Set Field script step does not have a calculation specified)", - 6 => "File is read-only", - 7 => "Running out of memory", - 8 => "Empty result", - 9 => "Insufficient privileges", - 10 => "Requested data is missing", - 11 => "Name is not valid", - 12 => "Name already exists", - 13 => "File or object is in use", - 14 => "Out of range", - 15 => "Can’t divide by zero", - 16 => "Operation failed, request retry (for example, a user query)", - 17 => "Attempt to convert foreign character set to UTF-16 failed", - 18 => "Client must provide account information to proceed", - 19 => "String contains characters other than A-Z, a-z, 0-9 (ASCII)", - 20 => "Command or operation cancelled by triggered script", - 100 => "File is missing", - 101 => "Record is missing", - 102 => "Field is missing", - 103 => "Relationship is missing", - 104 => "Script is missing", - 105 => "Layout is missing", - 106 => "Table is missing", - 107 => "Index is missing", - 108 => "Value list is missing", - 109 => "Privilege set is missing", - 110 => "Related tables are missing", - 111 => "Field repetition is invalid", - 112 => "Window is missing", - 113 => "Function is missing", - 114 => "File reference is missing", - 115 => "The menu set is missing", - 116 => "The layout object is missing", - 117 => "The data source is missing", - 130 => "Files are damaged or missing and must be reinstalled", - 131 => "Language pack files are missing (such as template files)", - 200 => "Record access is denied", - 201 => "Field cannot be modified", - 202 => "Field access is denied", - 203 => "No records in file to print, or password doesn’t allow print access", - 204 => "No access to field(s) in sort order", - 205 => "User does not have access privileges to create new records; import will overwrite existing data", - 206 => "User does not have password change privileges, or file is not modifiable", - 207 => "User does not have sufficient privileges to change database schema, or file is not modifiable", - 208 => "Password does not contain enough characters", - 209 => "New password must be different from existing one", - 210 => "User account is inactive", - 211 => "Password has expired", - 212 => "Invalid user account and/or password. Please try again", - 213 => "User account and/or password does not exist", - 214 => "Too many login attempts", - 215 => "Administrator privileges cannot be duplicated", - 216 => "Guest account cannot be duplicated", - 217 => "User does not have sufficient privileges to modify administrator account", - 300 => "File is locked or in use", - 301 => "Record is in use by another user", - 302 => "Table is in use by another user", - 303 => "Database schema is in use by another user", - 304 => "Layout is in use by another user", - 306 => "Record modification ID does not match", - 400 => "Find criteria are empty", - 401 => "No records match the request", - 402 => "Selected field is not a match field for a lookup", - 403 => "Exceeding maximum record limit for trial version of FileMaker Pro", - 404 => "Sort order is invalid", - 405 => "Number of records specified exceeds number of records that can be omitted", - 406 => "Replace/Reserialize criteria are invalid", - 407 => "One or both match fields are missing (invalid relationship)", - 408 => "Specified field has inappropriate data type for this operation", - 409 => "Import order is invalid", - 410 => "Export order is invalid", - 412 => "Wrong version of FileMaker Pro used to recover file", - 413 => "Specified field has inappropriate field type", - 414 => "Layout cannot display the result", - 415 => "One or more required related records are not available", - 416 => "A primary key is required from the data source table", - 417 => "The database is not a supported data source", - 500 => "Date value does not meet validation entry options", - 501 => "Time value does not meet validation entry options", - 502 => "Number value does not meet validation entry options", - 503 => "Value in field is not within the range specified in validation entry options", - 504 => "Value in field is not unique as required in validation entry options", - 505 => "Value in field is not an existing value in the database file as required in validation entry options", - 506 => "Value in field is not listed on the value list specified in validation entry option", - 507 => "Value in field failed calculation test of validation entry option", - 508 => "Invalid value entered in Find mode", - 509 => "Field requires a valid value", - 510 => "Related value is empty or unavailable", - 511 => "Value in field exceeds maximum number of allowed characters", - 512 => "The record was already modified by another user", - 513 => "To create a record, the record has to have a value in at least one field", - 600 => "Print error has occurred", - 601 => "Combined header and footer exceed one page", - 602 => "Body doesn’t fit on a page for current column setup", - 603 => "Print connection lost", - 700 => "File is of the wrong file type for import", - 706 => "EPSF file has no preview image", - 707 => "Graphic translator cannot be found", - 708 => "Can’t import the file or need color monitor support to import file", - 709 => "QuickTime movie import failed", - 710 => "Unable to update QuickTime file reference because the database file is read-only", - 711 => "Import translator cannot be found", - 714 => "Password privileges do not allow the operation", - 715 => "Specified Excel worksheet or named range is missing", - 716 => "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import", - 717 => "There is not enough XML/XSL information to proceed with the import or export", - 718 => "Error in parsing XML file (from Xerces)", - 719 => "Error in transforming XML using XSL (from Xalan)", - 720 => "Error when exporting; intended format does not support repeating fields", - 721 => "Unknown error occurred in the parser or the transformer", - 722 => "Cannot import data into a file that has no fields", - 723 => "You do not have permission to add records to or modify records in the target table", - 724 => "You do not have permission to add records to the target table", - 725 => "You do not have permission to modify records in the target table", - 726 => "There are more records in the import file than in the target table. Not all records were imported", - 727 => "There are more records in the target table than in the import file. Not all records were updated", - 729 => "Errors occurred during import. Records could not be imported", - 730 => "Unsupported Excel version. Convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again.", - 731 => "The file you are importing from contains no data", - 732 => "This file cannot be inserted because it contains other files", - 733 => "A table cannot be imported into itself", - 734 => "This file type cannot be displayed as a picture", - 735 => "This file type cannot be displayed as a picture. It will be inserted and displayed as a file", - 736 => "There is too much data to be exported to this format. It will be truncated", - 800 => "Unable to create file on disk", - 801 => "Unable to create temporary file on System disk", - 802 => "Unable to open file. This error can be caused by one or more of the following: invalid database name, the file is closed in FileMaker Server or invalid permission", - 803 => "File is single user or host cannot be found", - 804 => "File cannot be opened as read-only in its current state", - 805 => "File is damaged; use Recover command", - 806 => "File cannot be opened with this version of FileMaker Pro", - 807 => "File is not a FileMaker Pro file or is severely damaged", - 808 => "Cannot open file because access privileges are damaged", - 809 => "Disk/volume is full", - 810 => "Disk/volume is locked", - 811 => "Temporary file cannot be opened as FileMaker Pro file", - 813 => "Record Synchronization error on network", - 814 => "File(s) cannot be opened because maximum number is open", - 815 => "Couldn’t open lookup file", - 816 => "Unable to convert file", - 817 => "Unable to open file because it does not belong to this solution", - 819 => "Cannot save a local copy of a remote file", - 820 => "File is in the process of being closed", - 821 => "Host forced a disconnect", - 822 => "FMI files not found; reinstall missing files", - 823 => "Cannot set file to single-user, guests are connected", - 824 => "File is damaged or not a FileMaker file", - 900 => "General spelling engine error", - 901 => "Main spelling dictionary not installed", - 902 => "Could not launch the Help system", - 903 => "Command cannot be used in a shared file", - 904 => "Command can only be used in a file hosted under FileMaker Server", - 905 => "No active field selected; command can only be used if there is an active field", - 906 => "The current file is not shared; command can be used only if the file is shared", - 920 => "Can’t initialize the spelling engine", - 921 => "User dictionary cannot be loaded for editing", - 922 => "User dictionary cannot be found", - 923 => "User dictionary is read-only", - 951 => "An unexpected error occurred", - 954 => "Unsupported XML grammar", - 955 => "No database name", - 956 => "Maximum number of database sessions exceeded", - 957 => "Conflicting commands", - 958 => "Parameter missing in query", - 1200 => "Generic calculation error", - 1201 => "Too few parameters in the function", - 1202 => "Too many parameters in the function", - 1203 => "Unexpected end of calculation", - 1204 => "Number, text constant, field name or '(' expected", - 1205 => "Comment is not terminated with '*/'", - 1206 => "Text constant must end with a quotation mark", - 1207 => "Unbalanced parenthesis", - 1208 => "Operator missing, function not found or '(' not expected", - 1209 => "Name (such as field name or layout name) is missing", - 1210 => "Plug-in function has already been registered", - 1211 => "List usage is not allowed in this function", - 1212 => "An operator (for example, +, -, *) is expected here", - 1213 => "This variable has already been defined in the Let function", - 1214 => "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed", - 1215 => "This parameter is an invalid Get function parameter", - 1216 => "Only Summary fields allowed as first argument in GETSUMMARY", - 1217 => "Break field is invalid", - 1218 => "Cannot evaluate the number", - 1219 => "A field cannot be used in its own formula", - 1220 => "Field type must be normal or calculated", - 1221 => "Data type must be number, date, time, or timestamp", - 1222 => "Calculation cannot be stored", - 1223 => "The function referred to is not yet implemented", - 1224 => "The function referred to does not exist", - 1225 => "The function referred to is not supported in this context", - 1400 => "ODBC client driver initialization failed; make sure the ODBC client drivers are properly installed.", - 1401 => "Failed to allocate environment (ODBC)", - 1402 => "Failed to free environment (ODBC)", - 1403 => "Failed to disconnect (ODBC)", - 1404 => "Failed to allocate connection (ODBC)", - 1405 => "Failed to free connection (ODBC)", - 1406 => "Failed check for SQL API (ODBC)", - 1407 => "Failed to allocate statement (ODBC)", - 1408 => "Extended error (ODBC)", - 1409 => "Extended error (ODBC)", - 1410 => "Extended error (ODBC)", - 1411 => "Extended error (ODBC)", - 1412 => "Extended error (ODBC)", - 1413 => "Extended error (ODBC)", - 1450 => "Action requires PHP privilege extension", - 1451 => "Action requires that current file be remote", - 1501 => "SMTP authentication failed", - 1502 => "Connection refused by SMTP server", - 1503 => "Error with SSL", - 1504 => "SMTP server requires the connection to be encrypted", - 1505 => "Specified authentication is not supported by SMTP server", - 1506 => "Email message(s) could not be sent successfully", - 1507 => "Unable to log in to the SMTP server" - + + '-1' => 'Unknown error', + 0 => 'No error', + 1 => "User canceled action ", + 2 => "Memory error ", + 3 => "Command is unavailable (for example, wrong operating system, wrong mode, etc.)", + 4 => "Command is unknown", + 5 => "Command is invalid (for example, a Set Field script step does not have a calculation specified)", + 6 => "File is read-only", + 7 => "Running out of memory", + 8 => "Empty result", + 9 => "Insufficient privileges", + 10 => "Requested data is missing", + 11 => "Name is not valid", + 12 => "Name already exists", + 13 => "File or object is in use", + 14 => "Out of range", + 15 => "Can’t divide by zero", + 16 => "Operation failed, request retry (for example, a user query)", + 17 => "Attempt to convert foreign character set to UTF-16 failed", + 18 => "Client must provide account information to proceed", + 19 => "String contains characters other than A-Z, a-z, 0-9 (ASCII)", + 20 => "Command or operation cancelled by triggered script", + 100 => "File is missing", + 101 => "Record is missing", + 102 => "Field is missing", + 103 => "Relationship is missing", + 104 => "Script is missing", + 105 => "Layout is missing", + 106 => "Table is missing", + 107 => "Index is missing", + 108 => "Value list is missing", + 109 => "Privilege set is missing", + 110 => "Related tables are missing", + 111 => "Field repetition is invalid", + 112 => "Window is missing", + 113 => "Function is missing", + 114 => "File reference is missing", + 115 => "The menu set is missing", + 116 => "The layout object is missing", + 117 => "The data source is missing", + 130 => "Files are damaged or missing and must be reinstalled", + 131 => "Language pack files are missing (such as template files)", + 200 => "Record access is denied", + 201 => "Field cannot be modified", + 202 => "Field access is denied", + 203 => "No records in file to print, or password doesn’t allow print access", + 204 => "No access to field(s) in sort order", + 205 => "User does not have access privileges to create new records; import will overwrite existing data", + 206 => "User does not have password change privileges, or file is not modifiable", + 207 => "User does not have sufficient privileges to change database schema, or file is not modifiable", + 208 => "Password does not contain enough characters", + 209 => "New password must be different from existing one", + 210 => "User account is inactive", + 211 => "Password has expired", + 212 => "Invalid user account and/or password. Please try again", + 213 => "User account and/or password does not exist", + 214 => "Too many login attempts", + 215 => "Administrator privileges cannot be duplicated", + 216 => "Guest account cannot be duplicated", + 217 => "User does not have sufficient privileges to modify administrator account", + 300 => "File is locked or in use", + 301 => "Record is in use by another user", + 302 => "Table is in use by another user", + 303 => "Database schema is in use by another user", + 304 => "Layout is in use by another user", + 306 => "Record modification ID does not match", + 400 => "Find criteria are empty", + 401 => "No records match the request", + 402 => "Selected field is not a match field for a lookup", + 403 => "Exceeding maximum record limit for trial version of FileMaker Pro", + 404 => "Sort order is invalid", + 405 => "Number of records specified exceeds number of records that can be omitted", + 406 => "Replace/Reserialize criteria are invalid", + 407 => "One or both match fields are missing (invalid relationship)", + 408 => "Specified field has inappropriate data type for this operation", + 409 => "Import order is invalid", + 410 => "Export order is invalid", + 412 => "Wrong version of FileMaker Pro used to recover file", + 413 => "Specified field has inappropriate field type", + 414 => "Layout cannot display the result", + 415 => "One or more required related records are not available", + 416 => "A primary key is required from the data source table", + 417 => "The database is not a supported data source", + 500 => "Date value does not meet validation entry options", + 501 => "Time value does not meet validation entry options", + 502 => "Number value does not meet validation entry options", + 503 => "Value in field is not within the range specified in validation entry options", + 504 => "Value in field is not unique as required in validation entry options", + 505 => "Value in field is not an existing value in the database file as required in validation entry options", + 506 => "Value in field is not listed on the value list specified in validation entry option", + 507 => "Value in field failed calculation test of validation entry option", + 508 => "Invalid value entered in Find mode", + 509 => "Field requires a valid value", + 510 => "Related value is empty or unavailable", + 511 => "Value in field exceeds maximum number of allowed characters", + 512 => "The record was already modified by another user", + 513 => "To create a record, the record has to have a value in at least one field", + 600 => "Print error has occurred", + 601 => "Combined header and footer exceed one page", + 602 => "Body doesn’t fit on a page for current column setup", + 603 => "Print connection lost", + 700 => "File is of the wrong file type for import", + 706 => "EPSF file has no preview image", + 707 => "Graphic translator cannot be found", + 708 => "Can’t import the file or need color monitor support to import file", + 709 => "QuickTime movie import failed", + 710 => "Unable to update QuickTime file reference because the database file is read-only", + 711 => "Import translator cannot be found", + 714 => "Password privileges do not allow the operation", + 715 => "Specified Excel worksheet or named range is missing", + 716 => "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import", + 717 => "There is not enough XML/XSL information to proceed with the import or export", + 718 => "Error in parsing XML file (from Xerces)", + 719 => "Error in transforming XML using XSL (from Xalan)", + 720 => "Error when exporting; intended format does not support repeating fields", + 721 => "Unknown error occurred in the parser or the transformer", + 722 => "Cannot import data into a file that has no fields", + 723 => "You do not have permission to add records to or modify records in the target table", + 724 => "You do not have permission to add records to the target table", + 725 => "You do not have permission to modify records in the target table", + 726 => "There are more records in the import file than in the target table. Not all records were imported", + 727 => "There are more records in the target table than in the import file. Not all records were updated", + 729 => "Errors occurred during import. Records could not be imported", + 730 => "Unsupported Excel version. Convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again.", + 731 => "The file you are importing from contains no data", + 732 => "This file cannot be inserted because it contains other files", + 733 => "A table cannot be imported into itself", + 734 => "This file type cannot be displayed as a picture", + 735 => "This file type cannot be displayed as a picture. It will be inserted and displayed as a file", + 736 => "There is too much data to be exported to this format. It will be truncated", + 800 => "Unable to create file on disk", + 801 => "Unable to create temporary file on System disk", + 802 => "Unable to open file. This error can be caused by one or more of the following: invalid database name, the file is closed in FileMaker Server or invalid permission", + 803 => "File is single user or host cannot be found", + 804 => "File cannot be opened as read-only in its current state", + 805 => "File is damaged; use Recover command", + 806 => "File cannot be opened with this version of FileMaker Pro", + 807 => "File is not a FileMaker Pro file or is severely damaged", + 808 => "Cannot open file because access privileges are damaged", + 809 => "Disk/volume is full", + 810 => "Disk/volume is locked", + 811 => "Temporary file cannot be opened as FileMaker Pro file", + 813 => "Record Synchronization error on network", + 814 => "File(s) cannot be opened because maximum number is open", + 815 => "Couldn’t open lookup file", + 816 => "Unable to convert file", + 817 => "Unable to open file because it does not belong to this solution", + 819 => "Cannot save a local copy of a remote file", + 820 => "File is in the process of being closed", + 821 => "Host forced a disconnect", + 822 => "FMI files not found; reinstall missing files", + 823 => "Cannot set file to single-user, guests are connected", + 824 => "File is damaged or not a FileMaker file", + 900 => "General spelling engine error", + 901 => "Main spelling dictionary not installed", + 902 => "Could not launch the Help system", + 903 => "Command cannot be used in a shared file", + 904 => "Command can only be used in a file hosted under FileMaker Server", + 905 => "No active field selected; command can only be used if there is an active field", + 906 => "The current file is not shared; command can be used only if the file is shared", + 920 => "Can’t initialize the spelling engine", + 921 => "User dictionary cannot be loaded for editing", + 922 => "User dictionary cannot be found", + 923 => "User dictionary is read-only", + 951 => "An unexpected error occurred", + 954 => "Unsupported XML grammar", + 955 => "No database name", + 956 => "Maximum number of database sessions exceeded", + 957 => "Conflicting commands", + 958 => "Parameter missing in query", + 1200 => "Generic calculation error", + 1201 => "Too few parameters in the function", + 1202 => "Too many parameters in the function", + 1203 => "Unexpected end of calculation", + 1204 => "Number, text constant, field name or '(' expected", + 1205 => "Comment is not terminated with '*/'", + 1206 => "Text constant must end with a quotation mark", + 1207 => "Unbalanced parenthesis", + 1208 => "Operator missing, function not found or '(' not expected", + 1209 => "Name (such as field name or layout name) is missing", + 1210 => "Plug-in function has already been registered", + 1211 => "List usage is not allowed in this function", + 1212 => "An operator (for example, +, -, *) is expected here", + 1213 => "This variable has already been defined in the Let function", + 1214 => "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed", + 1215 => "This parameter is an invalid Get function parameter", + 1216 => "Only Summary fields allowed as first argument in GETSUMMARY", + 1217 => "Break field is invalid", + 1218 => "Cannot evaluate the number", + 1219 => "A field cannot be used in its own formula", + 1220 => "Field type must be normal or calculated", + 1221 => "Data type must be number, date, time, or timestamp", + 1222 => "Calculation cannot be stored", + 1223 => "The function referred to is not yet implemented", + 1224 => "The function referred to does not exist", + 1225 => "The function referred to is not supported in this context", + 1400 => "ODBC client driver initialization failed; make sure the ODBC client drivers are properly installed.", + 1401 => "Failed to allocate environment (ODBC)", + 1402 => "Failed to free environment (ODBC)", + 1403 => "Failed to disconnect (ODBC)", + 1404 => "Failed to allocate connection (ODBC)", + 1405 => "Failed to free connection (ODBC)", + 1406 => "Failed check for SQL API (ODBC)", + 1407 => "Failed to allocate statement (ODBC)", + 1408 => "Extended error (ODBC)", + 1409 => "Extended error (ODBC)", + 1410 => "Extended error (ODBC)", + 1411 => "Extended error (ODBC)", + 1412 => "Extended error (ODBC)", + 1413 => "Extended error (ODBC)", + 1450 => "Action requires PHP privilege extension", + 1451 => "Action requires that current file be remote", + 1501 => "SMTP authentication failed", + 1502 => "Connection refused by SMTP server", + 1503 => "Error with SSL", + 1504 => "SMTP server requires the connection to be encrypted", + 1505 => "Specified authentication is not supported by SMTP server", + 1506 => "Email message(s) could not be sent successfully", + 1507 => "Unable to log in to the SMTP server" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::EN::XML diff --git a/lib/Net/FileMaker/Error/EN/XSLT.pm b/lib/Net/FileMaker/Error/EN/XSLT.pm index a7144b6..87a8ebf 100644 --- a/lib/Net/FileMaker/Error/EN/XSLT.pm +++ b/lib/Net/FileMaker/Error/EN/XSLT.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::EN::XSLT; + Net::FileMaker::Error::EN::XSLT; use strict; use warnings; @@ -20,57 +20,57 @@ L my $error_codes = { - '-1' => "Unknown error", - 0 => "No error", - 10000 => "Invalid header name", - 10001 => "Invalid HTTP status code", - 10100 => "Unknown session error", - 10101 => "Requested session name is already used", - 10102 => "Session could not be accessed - maybe it does not exist", - 10103 => "Session has timed out", - 10104 => "Specified session object does not exist", - 10200 => "Unknown messaging error", - 10201 => "Message formatting error", - 10202 => "Message SMTP fields error", - 10203 => "Message “To Field” error", - 10204 => "Message “From Field” error", - 10205 => "Message “CC Field” error", - 10206 => "Message “BCC Field” error", - 10207 => "Message “Subject Field” error", - 10208 => "Message “Reply-To Field” error", - 10209 => "Message body error", - 10210 => "Recursive mail error - attempted to call send_email() inside an email XSLT stylesheet", - 10211 => "SMTP authentication error - either login failed or wrong type of authentication provided", - 10212 => "Invalid function usage - attempted to call set_header(), set_status_code() or set_cookie() inside an email XSLT stylesheet", - 10213 => "SMTP server is invalid or is not working.", - 10300 => "Unknown formatting error", - 10301 => "Invalid date time format", - 10302 => "Invalid date format", - 10303 => "Invalid time format", - 10304 => "Invalid day format", - 10305 => "Improperly formatted date time string", - 10306 => "Improperly formatted date string", - 10307 => "Improperly formatted time string", - 10308 => "Improperly formatted day string", - 10309 => "Unsupported text encoding", - 10310 => "Invalid URL encoding", - 10311 => "Regular expression pattern error" - + '-1' => "Unknown error", + 0 => "No error", + 10000 => "Invalid header name", + 10001 => "Invalid HTTP status code", + 10100 => "Unknown session error", + 10101 => "Requested session name is already used", + 10102 => "Session could not be accessed - maybe it does not exist", + 10103 => "Session has timed out", + 10104 => "Specified session object does not exist", + 10200 => "Unknown messaging error", + 10201 => "Message formatting error", + 10202 => "Message SMTP fields error", + 10203 => "Message “To Field” error", + 10204 => "Message “From Field” error", + 10205 => "Message “CC Field” error", + 10206 => "Message “BCC Field” error", + 10207 => "Message “Subject Field” error", + 10208 => "Message “Reply-To Field” error", + 10209 => "Message body error", + 10210 => "Recursive mail error - attempted to call send_email() inside an email XSLT stylesheet", + 10211 => "SMTP authentication error - either login failed or wrong type of authentication provided", + 10212 => "Invalid function usage - attempted to call set_header(), set_status_code() or set_cookie() inside an email XSLT stylesheet", + 10213 => "SMTP server is invalid or is not working.", + 10300 => "Unknown formatting error", + 10301 => "Invalid date time format", + 10302 => "Invalid date format", + 10303 => "Invalid time format", + 10304 => "Invalid day format", + 10305 => "Improperly formatted date time string", + 10306 => "Improperly formatted date string", + 10307 => "Improperly formatted time string", + 10308 => "Improperly formatted day string", + 10309 => "Unsupported text encoding", + 10310 => "Invalid URL encoding", + 10311 => "Regular expression pattern error" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::EN::XSLT diff --git a/lib/Net/FileMaker/Error/IT/XML.pm b/lib/Net/FileMaker/Error/IT/XML.pm index 7ff1602..ac02aaa 100644 --- a/lib/Net/FileMaker/Error/IT/XML.pm +++ b/lib/Net/FileMaker/Error/IT/XML.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::IT::XML; + Net::FileMaker::Error::IT::XML; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/IT/XSLT.pm b/lib/Net/FileMaker/Error/IT/XSLT.pm index c07fbed..d89b8b2 100644 --- a/lib/Net/FileMaker/Error/IT/XSLT.pm +++ b/lib/Net/FileMaker/Error/IT/XSLT.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::IT::XSLT; + Net::FileMaker::Error::IT::XSLT; use strict; use warnings; diff --git a/lib/Net/FileMaker/Error/JA/XML.pm b/lib/Net/FileMaker/Error/JA/XML.pm index cc2fd01..4ce0662 100644 --- a/lib/Net/FileMaker/Error/JA/XML.pm +++ b/lib/Net/FileMaker/Error/JA/XML.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::JA::XML; + Net::FileMaker::Error::JA::XML; use strict; use warnings; @@ -22,241 +22,241 @@ L my $error_codes = { - '-1' => "原因不明のエラー", - 0 => "エラーなし", - 1 => "ユーザによるキャンセル", - 2 => "メモリエラー", - 3 => "コマンドが使用できません(たとえば誤ったオペレーティングシステム、誤ったモードなど)", - 4 => "コマンドが見つかりません", - 5 => "コマンドが無効です(たとえば、[フィールド設定] スクリプトステップに計算式が指定されていな い場合など)", - 6 => "ファイルが読み取り専用です", - 7 => "メモリ不足", - 8 => "空白の結果", - 9 => "アクセス権が不十分です", - 10 => "要求されたデータが見つかりません", - 11 => "名前が有効ではありません", - 12 => "名前がすでに存在します", - 13 => "ファイルまたはオブジェクトが使用中です", - 14 => "範囲外", - 15 => "0で割ることができません", - 16 => "処理に失敗したため、再試行が必要です(たとえば、ユーザクエリーなど)", - 17 => "外国語の文字セットの UTF-16 への変換に失敗しました", - 18 => "続行するには、クライアントはアカウント情報を指定する必要があります", - 19 => "文字列に A から Z、a から z、0 から 9(ASCII)以外の文字が含まれています", - 20 => "コマンドまたは操作がスクリプトトリガによってキャンセルされました", - 100 => "ファイルが見つかりません", - 101 => "レコードが見つかりません", - 102 => "フィールドが見つかりません", - 103 => "リレーションシップが見つかりません", - 104 => "スクリプトが見つかりません", - 105 => "レイアウトが見つかりません", - 106 => "テーブルが見つかりません", - 107 => "索引が見つかりません", - 108 => "値一覧が見つかりません", - 109 => "アクセス権セットが見つかりません", - 110 => "関連テーブルが見つかりません", - 111 => "フィールドの繰り返しが無効です", - 112 => "ウインドウが見つかりません", - 113 => "関数が見つかりません", - 114 => "ファイル参照が見つかりません", - 115 => "メニューセットが見つかりません", - 116 => "レイアウトオブジェクトが見つかりません", - 117 => "データソースが見つかりません", - 130 => "ファイルが損傷しているか見つからないため、再インストールする必要があります", - 131 => "言語パックファイルが見つかりません(テンプレートなど)", - 200 => "レコードアクセスが拒否されました", - 201 => "フィールドを変更できません", - 202 => "フィールドアクセスが拒否されました", - 203 => "ファイルに印刷するレコードがないか、入力したパスワードでは印刷できません", - 204 => "ソート優先順位に指定されたフィールドにアクセスできません", - 205 => "ユーザに新規レコードを作成するアクセス権がありません。既存のデータはインポートしたデータ で上書きされます", - 206 => "ユーザにパスワードの変更アクセス権がないか、変更可能なファイルではありません", - 207 => "ユーザにデータベーススキーマを変更する十分なアクセス権がないか、変更可能なファイルではあ りません", - 208 => "パスワードに十分な文字が含まれていません", - 209 => "既存のパスワードと新規パスワードを同一にすることはできません", - 210 => "ユーザアカウントが非アクティブです", - 211 => "パスワードが期限切れです", - 212 => "ユーザアカウントまたはパスワードが無効です。再試行してください", - 213 => "ユーザアカウントまたはパスワードが存在しません", - 214 => "ログイン試行回数が多すぎます", - 215 => "管理者権限は複製できません", - 216 => "ゲストアカウントは複製できません", - 217 => "ユーザに管理者アカウントを変更する十分なアクセス権がありません", - 300 => "ファイルがロックされているか、使用中です", - 301 => "別のユーザがレコードを使用中です", - 302 => "別のユーザがテーブルを使用中です", - 303 => "別のユーザがデータベーススキーマを使用中です", - 304 => "別のユーザがレイアウトを使用中です", - 306 => "レコード修正 ID が一致しません", - 400 => "検索条件が空です", - 401 => "検索条件に一致するレコードがありません", - 402 => "選択したフィールドはルックアップの照合フィールドではありません", - 403 => "評価版の FileMaker Pro に設定されている最大レコード数の制限を超過しています", - 404 => "ソート優先順位が無効です", - 405 => "指定したレコード数が除外可能なレコード数を超過しています", - 406 => "全置換またはシリアル番号の再入力に指定された条件が無効です", - 407 => "片方または両方の照合フィールドが欠けています(無効なリレーションシップ)", - 408 => "指定されたフィールドのデータが不適切なため、この処理を実行できません", - 409 => "インポート順が無効です", - 410 => "エスクポート順が無効です", - 412 => "ファイルの修復に、誤ったバージョンの FileMaker Pro が使用されました", - 413 => "指定されたフィールドのフィールドタイプが不適切です", - 414 => "レイアウトに結果を表示できません", - 415 => "1つまたは複数の必要な関連レコードが使用できません", - 416 => "データソーステーブルからプライマリキーが必要です", - 417 => "データベースが、サポートされているデータソースではありません", - 500 => "日付の値が入力値の制限を満たしていません", - 501 => "時刻の値が入力値の制限を満たしていません", - 502 => "数字の値が入力値の制限を満たしていません", - 503 => "フィールドの値が入力値の制限オプションに指定されている範囲内に入っていません", - 504 => "フィールドの値が入力値の制限オプションで要求されているようにユニークな値になっていません", - 505 => "フィールドの値が入力値の制限オプションで要求されているようにデータベースファイル内の既存 値になっていません", - 506 => "フィールドの値が入力値の制限オプションに指定されている値一覧に含まれていません", - 507 => "フィールドの値が入力値の制限オプションに指定されている計算式を満たしません", - 508 => "検索モードに無効な値が入力されました", - 509 => "フィールドに有効な値が必要です", - 510 => "関連する値が空であるか、使用できません", - 511 => "フィールド内の値が最大文字数を超過しました", - 512 => "レコードがすでに別のユーザによって変更されています", - 513 => "レコードを作成するには、レコードの少なくとも1つのフィールドに値がある必要があります", - 600 => "印刷エラーが発生しました", - 601 => "ヘッダとフッタの高さを加算するとページの高さを超えます", - 602 => "現在の段数設定ではボディ部分がページ内に収まりません", - 603 => "印刷接続が遮断されました", - 700 => "インポートできないファイルタイプです", - 706 => "EPSF ファイルにプレビューイメージがありません", - 707 => "グラフィックの変換ファイルが見つかりません", - 708 => "ファイルをインポートできないか、ファイルをインポートするにはカラーのコンピュータが必要で す", - 709 => "QuickTime ムービーのインポートに失敗しました", - 710 => "データベースファイルが読み取り専用になっているため QuickTime ファイルの参照を更新できませ ん", - 711 => "インポートの変換ファイルが見つかりません", - 714 => "入力したパスワードでは設定されている権限が不足しているためこの操作は認められていません", - 715 => "指定された Excel ワークシートまたは名前の付いた範囲がありません", - 716 => "ODBC インポートでは、DELETE、INSERT、または UPDATE を使用する SQL クエリーは使用でき ません", - 717 => "インポートまたはエクスポートを続行するための十分な XML/XSLT 情報がありません", - 718 => "(Xerces からの)XML ファイルの解析エラーです", - 719 => "(Xalan からの)XSL を使用した XML 変換エラーです", - 720 => "エクスポート時のエラー。対象のドキュメントフォーマットでは繰り返しフィールドはサポートさ れていません", - 721 => "パーサまたはトランスフォーマで原因不明のエラーが発生しました", - 722 => "フィールドのないファイルにデータをインポートすることはできません", - 723 => "インポート先のテーブルでレコードを追加または変更する権限がありません", - 724 => "インポート先のテーブルにレコードを追加する権限がありません", - 725 => "インポート先のテーブルでレコードを変更する権限がありません", - 726 => "インポートファイルのレコードの方がインポート先のテーブルのレコードよりも多くなっていま す。一部のレコードはインポートされません", - 727 => "インポート先のテーブルのレコードの方がインポートファイルのレコードよりも多くなっていま す。一部のレコードは更新されません", - 729 => "インポート中にエラーが発生しました。レコードをインポートすることができません", - 730 => "サポートされていない Excel のバージョンです。ファイルを Excel 7.0(Excel 95)、Excel 97、2000、 XPまたは2007 のフォーマットに変換して、もう一度実行してください", - 731 => "インポート元のファイルにデータが含まれていません", - 732 => "このファイルには内部に他のファイルが含まれているため、挿入できません", - 733 => "テーブルをテーブル自体にインポートすることはできません", - 734 => "このファイルタイプをピクチャとして表示することはできません", - 735 => "このファイルタイプをピクチャとして表示することはできません。ファイルとして挿入および表示 されます", - 736 => "この形式にエクスポートするには、データが大きすぎます。データは切り捨てられます", - 800 => "ファイルをディスク上に作成できません", - 801 => "システムディスクにテンポラリファイルを作成できません", - 802 => "ファイルを開くことができません このエラーの原因は、次の1つ以上です 1 無効なデータベース名 1 ファイルが FileMaker Server で閉じられている 1 無効なアクセス権", - 803 => "ファイルが単独使用に設定されているか、またはホストが見つかりません", - 804 => "ファイルは現在の状態では読み取り専用として開くことができません", - 805 => "ファイルが損傷しています。修復コマンドを使用してください", - 806 => "このバージョンの FileMaker Pro ではファイルを開くことができません", - 807 => "ファイルが FileMaker Pro のファイルではないか、重大な損傷があります", - 808 => "アクセス権情報が壊れているため、ファイルを開くことができません", - 809 => "ディスク/ボリュームがいっぱいです", - 810 => "ディスク/ボリュームがロックされています", - 811 => "テンポラリファイルを FileMaker Pro ファイルとして開くことができません", - 813 => "ネットワーク上でレコードの同期エラーが発生しました", - 814 => "最大数のファイルがすでに開いているため、ファイルを開くことができません", - 815 => "ルックアップファイルを開くことができません", - 816 => "ファイルを変換できません", - 817 => "このソリューションに属していないため、ファイルを開くことができません", - 819 => "リモートファイルのローカルコピーを保存できません", - 820 => "ファイルを閉じる途中です", - 821 => "ホストによって接続解除されました", - 822 => "FMI ファイルが見つかりません。見つからないファイルを再インストールしてください", - 823 => "ファイルをシングルユーザに設定できません。ゲストが接続しています", - 824 => "ファイルが損傷しているか、FileMaker のファイルではありません", - 900 => "スペルチェックのエンジンにエラーが発生しています", - 901 => "スペルチェック用のメイン辞書がインストールされていません", - 902 => "ヘルプシステムを起動できませんでした", - 903 => "共有ファイルではコマンドを使用できません", - 904 => "コマンドは、FileMaker Server がホスト管理しているファイル内でのみ使用できます", - 905 => "アクティブなフィールドが選択されていません。アクティブなフィールドが存在する場合のみコマ ンドを使用することができます", - 906 => "現在のファイルは共有されていません。コマンドは、ファイルが共有されている場合のみ使用する ことができます", - 920 => "スペルチェックエンジンを初期化できません", - 921 => "編集するユーザ辞書をロードできません", - 922 => "ユーザ辞書が見つかりません", - 923 => "ユーザ辞書が読み取り専用です", - 951 => "予期しないエラーが発生しました", - 954 => "サポートされていない XML 文法です", - 955 => "データベース名がありません", - 956 => "データベースセッションが最大数を超過しました", - 957 => "コマンドが競合しています", - 958 => "クエリーに引数がありません", - 1200 => "一般的な計算エラーです", - 1201 => "関数の引数が足りません", - 1202 => "関数の引数が多すぎます", - 1203 => "計算式が未完了です", - 1204 => "数字、テキスト、フィールド名、または「(」を入れてください", - 1205 => "コメントは「*/」で終了できません", - 1206 => "テキストは半角のダブルクォーテーションマークで終わらなければなりません", - 1207 => "カッコが一致していません", - 1208 => "演算子または関数が見つからないか、「(」は指定できません", - 1209 => "名前(フィールド名またはレイアウト名)が見つかりません", - 1210 => "プラグイン関数はすでに登録されています", - 1211 => "この関数では一覧を使用できません", - 1212 => "演算子(+、-、* など)を入れてください", - 1213 => "この変数はすでに Let 関数で定義されています", - 1214 => "AVERAGE、COUNT、EXTEND、GETREPETITION、MAX、MIN、NPV、STDEV、SUM、および GETSUMMARY 関数で、フィールドの値を指定できない部分に式が使われています", - 1215 => "この引数は Get 関数の無効な引数です", - 1216 => "GetSummary 関数の1番目の引数は、集計フィールドのみに限られます", - 1217 => "区分けフィールドが無効です", - 1218 => "数字を評価できません", - 1219 => "フィールド固有の式にフィールドは使用できません", - 1220 => "フィールドタイプは標準にするか、計算する必要があります", - 1221 => "データタイプは数字、日付、時刻、またはタイムスタンプでなければなりません", - 1222 => "計算式を保存できません", - 1223 => "指定された関数はまだ実装されていません", - 1224 => "指定された関数は存在しません", - 1225 => "指定された関数は、このコンテキストではサポートされていません", - 1400 => "ODBC クライアントドライバの初期化に失敗しました。ODBC クライアントドライバが適切にイン ストールされていることを確認してください", - 1401 => "環境の割り当てに失敗しました(ODBC)", - 1402 => "環境の解放に失敗しました(ODBC)", - 1403 => "切断に失敗しました(ODBC)", - 1404 => "接続の割り当てに失敗しました(ODBC)", - 1405 => "接続の解放に失敗しました(ODBC)", - 1406 => "SQL API のチェックに失敗しました(ODBC)", - 1407 => "ステートメントの割り当てに失敗しました(ODBC)", - 1408 => "拡張エラー(ODBC)", - 1409 => "拡張エラー(ODBC)", - 1410 => "拡張エラー(ODBC)", - 1411 => "拡張エラー(ODBC)", - 1412 => "拡張エラー(ODBC)", - 1413 => "拡張エラー(ODBC)", - 1450 => "PHP アクセス権を拡張する操作が必要です", - 1451 => "現在のファイルをリモートにする操作が必要です", - 1501 => "SMTP の認証に失敗しました", - 1502 => "SMTP サーバーによって接続が拒否されました", - 1503 => "SSL でエラーが発生しました", - 1504 => "SMTP サーバーの接続を暗号化する必要があります", - 1505 => "指定された認証方法は SMTP サーバーではサポートされていません", - 1506 => "メールは正常に送信されませんでした", - 1507 => "SMTP サーバーにログインできませんでした" - + '-1' => "原因不明のエラー", + 0 => "エラーなし", + 1 => "ユーザによるキャンセル", + 2 => "メモリエラー", + 3 => "コマンドが使用できません(たとえば誤ったオペレーティングシステム、誤ったモードなど)", + 4 => "コマンドが見つかりません", + 5 => "コマンドが無効です(たとえば、[フィールド設定] スクリプトステップに計算式が指定されていな い場合など)", + 6 => "ファイルが読み取り専用です", + 7 => "メモリ不足", + 8 => "空白の結果", + 9 => "アクセス権が不十分です", + 10 => "要求されたデータが見つかりません", + 11 => "名前が有効ではありません", + 12 => "名前がすでに存在します", + 13 => "ファイルまたはオブジェクトが使用中です", + 14 => "範囲外", + 15 => "0で割ることができません", + 16 => "処理に失敗したため、再試行が必要です(たとえば、ユーザクエリーなど)", + 17 => "外国語の文字セットの UTF-16 への変換に失敗しました", + 18 => "続行するには、クライアントはアカウント情報を指定する必要があります", + 19 => "文字列に A から Z、a から z、0 から 9(ASCII)以外の文字が含まれています", + 20 => "コマンドまたは操作がスクリプトトリガによってキャンセルされました", + 100 => "ファイルが見つかりません", + 101 => "レコードが見つかりません", + 102 => "フィールドが見つかりません", + 103 => "リレーションシップが見つかりません", + 104 => "スクリプトが見つかりません", + 105 => "レイアウトが見つかりません", + 106 => "テーブルが見つかりません", + 107 => "索引が見つかりません", + 108 => "値一覧が見つかりません", + 109 => "アクセス権セットが見つかりません", + 110 => "関連テーブルが見つかりません", + 111 => "フィールドの繰り返しが無効です", + 112 => "ウインドウが見つかりません", + 113 => "関数が見つかりません", + 114 => "ファイル参照が見つかりません", + 115 => "メニューセットが見つかりません", + 116 => "レイアウトオブジェクトが見つかりません", + 117 => "データソースが見つかりません", + 130 => "ファイルが損傷しているか見つからないため、再インストールする必要があります", + 131 => "言語パックファイルが見つかりません(テンプレートなど)", + 200 => "レコードアクセスが拒否されました", + 201 => "フィールドを変更できません", + 202 => "フィールドアクセスが拒否されました", + 203 => "ファイルに印刷するレコードがないか、入力したパスワードでは印刷できません", + 204 => "ソート優先順位に指定されたフィールドにアクセスできません", + 205 => "ユーザに新規レコードを作成するアクセス権がありません。既存のデータはインポートしたデータ で上書きされます", + 206 => "ユーザにパスワードの変更アクセス権がないか、変更可能なファイルではありません", + 207 => "ユーザにデータベーススキーマを変更する十分なアクセス権がないか、変更可能なファイルではあ りません", + 208 => "パスワードに十分な文字が含まれていません", + 209 => "既存のパスワードと新規パスワードを同一にすることはできません", + 210 => "ユーザアカウントが非アクティブです", + 211 => "パスワードが期限切れです", + 212 => "ユーザアカウントまたはパスワードが無効です。再試行してください", + 213 => "ユーザアカウントまたはパスワードが存在しません", + 214 => "ログイン試行回数が多すぎます", + 215 => "管理者権限は複製できません", + 216 => "ゲストアカウントは複製できません", + 217 => "ユーザに管理者アカウントを変更する十分なアクセス権がありません", + 300 => "ファイルがロックされているか、使用中です", + 301 => "別のユーザがレコードを使用中です", + 302 => "別のユーザがテーブルを使用中です", + 303 => "別のユーザがデータベーススキーマを使用中です", + 304 => "別のユーザがレイアウトを使用中です", + 306 => "レコード修正 ID が一致しません", + 400 => "検索条件が空です", + 401 => "検索条件に一致するレコードがありません", + 402 => "選択したフィールドはルックアップの照合フィールドではありません", + 403 => "評価版の FileMaker Pro に設定されている最大レコード数の制限を超過しています", + 404 => "ソート優先順位が無効です", + 405 => "指定したレコード数が除外可能なレコード数を超過しています", + 406 => "全置換またはシリアル番号の再入力に指定された条件が無効です", + 407 => "片方または両方の照合フィールドが欠けています(無効なリレーションシップ)", + 408 => "指定されたフィールドのデータが不適切なため、この処理を実行できません", + 409 => "インポート順が無効です", + 410 => "エスクポート順が無効です", + 412 => "ファイルの修復に、誤ったバージョンの FileMaker Pro が使用されました", + 413 => "指定されたフィールドのフィールドタイプが不適切です", + 414 => "レイアウトに結果を表示できません", + 415 => "1つまたは複数の必要な関連レコードが使用できません", + 416 => "データソーステーブルからプライマリキーが必要です", + 417 => "データベースが、サポートされているデータソースではありません", + 500 => "日付の値が入力値の制限を満たしていません", + 501 => "時刻の値が入力値の制限を満たしていません", + 502 => "数字の値が入力値の制限を満たしていません", + 503 => "フィールドの値が入力値の制限オプションに指定されている範囲内に入っていません", + 504 => "フィールドの値が入力値の制限オプションで要求されているようにユニークな値になっていません", + 505 => "フィールドの値が入力値の制限オプションで要求されているようにデータベースファイル内の既存 値になっていません", + 506 => "フィールドの値が入力値の制限オプションに指定されている値一覧に含まれていません", + 507 => "フィールドの値が入力値の制限オプションに指定されている計算式を満たしません", + 508 => "検索モードに無効な値が入力されました", + 509 => "フィールドに有効な値が必要です", + 510 => "関連する値が空であるか、使用できません", + 511 => "フィールド内の値が最大文字数を超過しました", + 512 => "レコードがすでに別のユーザによって変更されています", + 513 => "レコードを作成するには、レコードの少なくとも1つのフィールドに値がある必要があります", + 600 => "印刷エラーが発生しました", + 601 => "ヘッダとフッタの高さを加算するとページの高さを超えます", + 602 => "現在の段数設定ではボディ部分がページ内に収まりません", + 603 => "印刷接続が遮断されました", + 700 => "インポートできないファイルタイプです", + 706 => "EPSF ファイルにプレビューイメージがありません", + 707 => "グラフィックの変換ファイルが見つかりません", + 708 => "ファイルをインポートできないか、ファイルをインポートするにはカラーのコンピュータが必要で す", + 709 => "QuickTime ムービーのインポートに失敗しました", + 710 => "データベースファイルが読み取り専用になっているため QuickTime ファイルの参照を更新できませ ん", + 711 => "インポートの変換ファイルが見つかりません", + 714 => "入力したパスワードでは設定されている権限が不足しているためこの操作は認められていません", + 715 => "指定された Excel ワークシートまたは名前の付いた範囲がありません", + 716 => "ODBC インポートでは、DELETE、INSERT、または UPDATE を使用する SQL クエリーは使用でき ません", + 717 => "インポートまたはエクスポートを続行するための十分な XML/XSLT 情報がありません", + 718 => "(Xerces からの)XML ファイルの解析エラーです", + 719 => "(Xalan からの)XSL を使用した XML 変換エラーです", + 720 => "エクスポート時のエラー。対象のドキュメントフォーマットでは繰り返しフィールドはサポートさ れていません", + 721 => "パーサまたはトランスフォーマで原因不明のエラーが発生しました", + 722 => "フィールドのないファイルにデータをインポートすることはできません", + 723 => "インポート先のテーブルでレコードを追加または変更する権限がありません", + 724 => "インポート先のテーブルにレコードを追加する権限がありません", + 725 => "インポート先のテーブルでレコードを変更する権限がありません", + 726 => "インポートファイルのレコードの方がインポート先のテーブルのレコードよりも多くなっていま す。一部のレコードはインポートされません", + 727 => "インポート先のテーブルのレコードの方がインポートファイルのレコードよりも多くなっていま す。一部のレコードは更新されません", + 729 => "インポート中にエラーが発生しました。レコードをインポートすることができません", + 730 => "サポートされていない Excel のバージョンです。ファイルを Excel 7.0(Excel 95)、Excel 97、2000、 XPまたは2007 のフォーマットに変換して、もう一度実行してください", + 731 => "インポート元のファイルにデータが含まれていません", + 732 => "このファイルには内部に他のファイルが含まれているため、挿入できません", + 733 => "テーブルをテーブル自体にインポートすることはできません", + 734 => "このファイルタイプをピクチャとして表示することはできません", + 735 => "このファイルタイプをピクチャとして表示することはできません。ファイルとして挿入および表示 されます", + 736 => "この形式にエクスポートするには、データが大きすぎます。データは切り捨てられます", + 800 => "ファイルをディスク上に作成できません", + 801 => "システムディスクにテンポラリファイルを作成できません", + 802 => "ファイルを開くことができません このエラーの原因は、次の1つ以上です 1 無効なデータベース名 1 ファイルが FileMaker Server で閉じられている 1 無効なアクセス権", + 803 => "ファイルが単独使用に設定されているか、またはホストが見つかりません", + 804 => "ファイルは現在の状態では読み取り専用として開くことができません", + 805 => "ファイルが損傷しています。修復コマンドを使用してください", + 806 => "このバージョンの FileMaker Pro ではファイルを開くことができません", + 807 => "ファイルが FileMaker Pro のファイルではないか、重大な損傷があります", + 808 => "アクセス権情報が壊れているため、ファイルを開くことができません", + 809 => "ディスク/ボリュームがいっぱいです", + 810 => "ディスク/ボリュームがロックされています", + 811 => "テンポラリファイルを FileMaker Pro ファイルとして開くことができません", + 813 => "ネットワーク上でレコードの同期エラーが発生しました", + 814 => "最大数のファイルがすでに開いているため、ファイルを開くことができません", + 815 => "ルックアップファイルを開くことができません", + 816 => "ファイルを変換できません", + 817 => "このソリューションに属していないため、ファイルを開くことができません", + 819 => "リモートファイルのローカルコピーを保存できません", + 820 => "ファイルを閉じる途中です", + 821 => "ホストによって接続解除されました", + 822 => "FMI ファイルが見つかりません。見つからないファイルを再インストールしてください", + 823 => "ファイルをシングルユーザに設定できません。ゲストが接続しています", + 824 => "ファイルが損傷しているか、FileMaker のファイルではありません", + 900 => "スペルチェックのエンジンにエラーが発生しています", + 901 => "スペルチェック用のメイン辞書がインストールされていません", + 902 => "ヘルプシステムを起動できませんでした", + 903 => "共有ファイルではコマンドを使用できません", + 904 => "コマンドは、FileMaker Server がホスト管理しているファイル内でのみ使用できます", + 905 => "アクティブなフィールドが選択されていません。アクティブなフィールドが存在する場合のみコマ ンドを使用することができます", + 906 => "現在のファイルは共有されていません。コマンドは、ファイルが共有されている場合のみ使用する ことができます", + 920 => "スペルチェックエンジンを初期化できません", + 921 => "編集するユーザ辞書をロードできません", + 922 => "ユーザ辞書が見つかりません", + 923 => "ユーザ辞書が読み取り専用です", + 951 => "予期しないエラーが発生しました", + 954 => "サポートされていない XML 文法です", + 955 => "データベース名がありません", + 956 => "データベースセッションが最大数を超過しました", + 957 => "コマンドが競合しています", + 958 => "クエリーに引数がありません", + 1200 => "一般的な計算エラーです", + 1201 => "関数の引数が足りません", + 1202 => "関数の引数が多すぎます", + 1203 => "計算式が未完了です", + 1204 => "数字、テキスト、フィールド名、または「(」を入れてください", + 1205 => "コメントは「*/」で終了できません", + 1206 => "テキストは半角のダブルクォーテーションマークで終わらなければなりません", + 1207 => "カッコが一致していません", + 1208 => "演算子または関数が見つからないか、「(」は指定できません", + 1209 => "名前(フィールド名またはレイアウト名)が見つかりません", + 1210 => "プラグイン関数はすでに登録されています", + 1211 => "この関数では一覧を使用できません", + 1212 => "演算子(+、-、* など)を入れてください", + 1213 => "この変数はすでに Let 関数で定義されています", + 1214 => "AVERAGE、COUNT、EXTEND、GETREPETITION、MAX、MIN、NPV、STDEV、SUM、および GETSUMMARY 関数で、フィールドの値を指定できない部分に式が使われています", + 1215 => "この引数は Get 関数の無効な引数です", + 1216 => "GetSummary 関数の1番目の引数は、集計フィールドのみに限られます", + 1217 => "区分けフィールドが無効です", + 1218 => "数字を評価できません", + 1219 => "フィールド固有の式にフィールドは使用できません", + 1220 => "フィールドタイプは標準にするか、計算する必要があります", + 1221 => "データタイプは数字、日付、時刻、またはタイムスタンプでなければなりません", + 1222 => "計算式を保存できません", + 1223 => "指定された関数はまだ実装されていません", + 1224 => "指定された関数は存在しません", + 1225 => "指定された関数は、このコンテキストではサポートされていません", + 1400 => "ODBC クライアントドライバの初期化に失敗しました。ODBC クライアントドライバが適切にイン ストールされていることを確認してください", + 1401 => "環境の割り当てに失敗しました(ODBC)", + 1402 => "環境の解放に失敗しました(ODBC)", + 1403 => "切断に失敗しました(ODBC)", + 1404 => "接続の割り当てに失敗しました(ODBC)", + 1405 => "接続の解放に失敗しました(ODBC)", + 1406 => "SQL API のチェックに失敗しました(ODBC)", + 1407 => "ステートメントの割り当てに失敗しました(ODBC)", + 1408 => "拡張エラー(ODBC)", + 1409 => "拡張エラー(ODBC)", + 1410 => "拡張エラー(ODBC)", + 1411 => "拡張エラー(ODBC)", + 1412 => "拡張エラー(ODBC)", + 1413 => "拡張エラー(ODBC)", + 1450 => "PHP アクセス権を拡張する操作が必要です", + 1451 => "現在のファイルをリモートにする操作が必要です", + 1501 => "SMTP の認証に失敗しました", + 1502 => "SMTP サーバーによって接続が拒否されました", + 1503 => "SSL でエラーが発生しました", + 1504 => "SMTP サーバーの接続を暗号化する必要があります", + 1505 => "指定された認証方法は SMTP サーバーではサポートされていません", + 1506 => "メールは正常に送信されませんでした", + 1507 => "SMTP サーバーにログインできませんでした" + }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::JA::XML diff --git a/lib/Net/FileMaker/Error/JA/XSLT.pm b/lib/Net/FileMaker/Error/JA/XSLT.pm index 16b1da2..6af16ae 100644 --- a/lib/Net/FileMaker/Error/JA/XSLT.pm +++ b/lib/Net/FileMaker/Error/JA/XSLT.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::Error::JA::XSLT; + Net::FileMaker::Error::JA::XSLT; use strict; use warnings; @@ -22,57 +22,57 @@ L my $error_codes = { - '-1' => "原因不明のエラー", - 0 => "エラーなし", - 10000 => "無効なヘッダ名", - 10001 => "無効な HTTP ステータスコード", - 10100 => "原因不明のセッションエラー",, - 10101 => "要求されたセッション名はすでに使用されています", - 10102 => "セッションにアクセスできませんでした。存在しない可能性があります", - 10103 => "セッションがタイムアウトしました", - 10104 => "指定されたセッションオブジェクトは存在しません", - 10200 => "原因不明のメッセージングエラー", - 10201 => "メッセージの書式設定エラー", - 10202 => "メッセージの SMTP フィールドのエラー", - 10203 => "メッセージの「To」フィールドのエラー", - 10204 => "メッセージの「From」フィールドのエラー", - 10205 => "メッセージの「CC」フィールドのエラー", - 10206 => "メッセージの「BCC」フィールドのエラー", - 10207 => "メッセージの「Subject」フィールドのエラー", - 10208 => "メッセージの「Reply-To」フィールドのエラー", - 10209 => "メッセージの本文のエラー", - 10210 => "再帰メールエラー - 電子メール用の XSLT スタイルシート内で send_email() を呼び出そうとしました", - 10211 => "SMTP 認証エラー - ログインに失敗したか、間違ったタイプの認証が指定されています", - 10212 => "無効な関数の使用法 - 電子メール用の XSLT スタイルシート内で set_header()、set_status_code()、ま たは set_cookie() を呼び出そうとしました", - 10213 => "SMTP サーバーが無効であるか動作していません", - 10300 => "原因不明の書式設定エラー", - 10301 => "無効な日付または時刻書式", - 10302 => "無効な日付書式", - 10303 => "無効な時刻書式", - 10304 => "無効な曜日書式", - 10305 => "不適切な形式の日付または時刻文字列", - 10306 => "不適切な形式の日付文字列", - 10307 => "不適切な形式の時刻文字列", - 10308 => "不適切な形式の曜日文字列", - 10309 => "サポートされていないテキストエンコード", - 10310 => "無効な URL エンコード", - 10311 => "正規表現パターンのエラー" + '-1' => "原因不明のエラー", + 0 => "エラーなし", + 10000 => "無効なヘッダ名", + 10001 => "無効な HTTP ステータスコード", + 10100 => "原因不明のセッションエラー",, + 10101 => "要求されたセッション名はすでに使用されています", + 10102 => "セッションにアクセスできませんでした。存在しない可能性があります", + 10103 => "セッションがタイムアウトしました", + 10104 => "指定されたセッションオブジェクトは存在しません", + 10200 => "原因不明のメッセージングエラー", + 10201 => "メッセージの書式設定エラー", + 10202 => "メッセージの SMTP フィールドのエラー", + 10203 => "メッセージの「To」フィールドのエラー", + 10204 => "メッセージの「From」フィールドのエラー", + 10205 => "メッセージの「CC」フィールドのエラー", + 10206 => "メッセージの「BCC」フィールドのエラー", + 10207 => "メッセージの「Subject」フィールドのエラー", + 10208 => "メッセージの「Reply-To」フィールドのエラー", + 10209 => "メッセージの本文のエラー", + 10210 => "再帰メールエラー - 電子メール用の XSLT スタイルシート内で send_email() を呼び出そうとしました", + 10211 => "SMTP 認証エラー - ログインに失敗したか、間違ったタイプの認証が指定されています", + 10212 => "無効な関数の使用法 - 電子メール用の XSLT スタイルシート内で set_header()、set_status_code()、ま たは set_cookie() を呼び出そうとしました", + 10213 => "SMTP サーバーが無効であるか動作していません", + 10300 => "原因不明の書式設定エラー", + 10301 => "無効な日付または時刻書式", + 10302 => "無効な日付書式", + 10303 => "無効な時刻書式", + 10304 => "無効な曜日書式", + 10305 => "不適切な形式の日付または時刻文字列", + 10306 => "不適切な形式の日付文字列", + 10307 => "不適切な形式の時刻文字列", + 10308 => "不適切な形式の曜日文字列", + 10309 => "サポートされていないテキストエンコード", + 10310 => "無効な URL エンコード", + 10311 => "正規表現パターンのエラー" }; sub new { - my $class = shift; - $class = ref($class) || $class; + my $class = shift; + $class = ref($class) || $class; - my $self = { }; - return bless $self, $class; + my $self = { }; + return bless $self, $class; } sub get_string { - my ($self, $error_code) = @_; - return $error_codes->{$error_code}; + my ($self, $error_code) = @_; + return $error_codes->{$error_code}; } 1; # End of Net::FileMaker::Error::JA::XSLT diff --git a/lib/Net/FileMaker/XML.pm b/lib/Net/FileMaker/XML.pm index 732c762..c206a75 100644 --- a/lib/Net/FileMaker/XML.pm +++ b/lib/Net/FileMaker/XML.pm @@ -42,29 +42,29 @@ Creates a new object. The specified must be a valid address or host name. sub new { - my($class, %args) = @_; + my($class, %args) = @_; - # If the protocol isn't specified, let's assume it's just HTTP. - if($args{host} !~/^http/x) - { - $args{host} = 'http://'.$args{host}; - } + # If the protocol isn't specified, let's assume it's just HTTP. + if($args{host} !~/^http/x) + { + $args{host} = 'http://'.$args{host}; + } require LWP::UserAgent; - my $self = { - host => $args{host}, - ua => LWP::UserAgent->new, - xml => XML::Twig->new, - uri => URI->new($args{host}), - resultset => '/fmi/xml/fmresultset.xml', # Entirely for dbnames(); - }; - - if($args{error}) - { - $self->{error} = Net::FileMaker::Error->new(lang => $args{error}, type => 'XML'); - } + my $self = { + host => $args{host}, + ua => LWP::UserAgent->new, + xml => XML::Twig->new, + uri => URI->new($args{host}), + resultset => '/fmi/xml/fmresultset.xml', # Entirely for dbnames(); + }; + + if($args{error}) + { + $self->{error} = Net::FileMaker::Error->new(lang => $args{error}, type => 'XML'); + } bless $self , $class; - return $self; + return $self; } @@ -76,15 +76,15 @@ Initiates a new database object for querying data in the databse. sub database { - my($self, %args) = @_; - - require Net::FileMaker::XML::Database; - return Net::FileMaker::XML::Database->new( - host => $self->{host}, - db => $args{db}, - user => $args{user} || '', - pass => $args{pass} || '' - ); + my($self, %args) = @_; + + require Net::FileMaker::XML::Database; + return Net::FileMaker::XML::Database->new( + host => $self->{host}, + db => $args{db}, + user => $args{user} || '', + pass => $args{pass} || '' + ); } @@ -97,13 +97,13 @@ This method requires no authentication. sub dbnames { - my $self = shift; - my $xml = $self->_request( - resultset => $self->{resultset}, - query =>'-dbnames' - ); + my $self = shift; + my $xml = $self->_request( + resultset => $self->{resultset}, + query =>'-dbnames' + ); - return $self->_compose_arrayref('DATABASE_NAME', $xml); + return $self->_compose_arrayref('DATABASE_NAME', $xml); } @@ -133,11 +133,11 @@ sub _request $uri->path($args{resultset}); my $url; - # This kind of defeats the purpose of using URI to begin with, but this - # fault has been reported on rt.cpan.org for over 2 years and many releases - # with no fix. + # This kind of defeats the purpose of using URI to begin with, but this + # fault has been reported on rt.cpan.org for over 2 years and many releases + # with no fix. if($args{params}) - { + { $uri->query_form(%{$args{params}}); $url = $uri->as_string."&".$args{query}; } @@ -155,14 +155,14 @@ sub _request my $res = $self->{ua}->request($req); - my $xml = $self->{xml}->parse($res->content); - my $xml_data = $xml->simplify; + my $xml = $self->{xml}->parse($res->content); + my $xml_data = $xml->simplify; - # Inject localised error message - if($self->{error}) - { - $xml_data->{error}->{message} = $self->{error}->get_string($xml_data->{error}->{code}); - } + # Inject localised error message + if($self->{error}) + { + $xml_data->{error}->{message} = $self->{error}->get_string($xml_data->{error}->{code}); + } $xml_data->{http_response} = $res; return $xml_data; @@ -175,23 +175,23 @@ sub _request # A common occurance is recomposing response data so unnecessary structure is removed. sub _compose_arrayref { - my ($self, $fieldname, $xml) = @_; - - if(ref($xml->{resultset}->{record}) eq 'HASH') - { - return $xml->{resultset}->{record}->{field}->{$fieldname}->{data}; - } - elsif(ref($xml->{resultset}->{record}) eq 'ARRAY') - { - my @output; - - for my $record (@{$xml->{resultset}->{record}}) - { - push @output, $record->{field}->{$fieldname}->{data}; - } - - return \@output; - } + my ($self, $fieldname, $xml) = @_; + + if(ref($xml->{resultset}->{record}) eq 'HASH') + { + return $xml->{resultset}->{record}->{field}->{$fieldname}->{data}; + } + elsif(ref($xml->{resultset}->{record}) eq 'ARRAY') + { + my @output; + + for my $record (@{$xml->{resultset}->{record}}) + { + push @output, $record->{field}->{$fieldname}->{data}; + } + + return \@output; + } } @@ -204,29 +204,29 @@ sub _compose_arrayref sub _assert_param { - my($self, $unclean_param, $acceptable_params) = @_; - my $param; - # if the param is of private type '-something' let's check, otherwise skip - # 'cause it could be the name of a field - # TODO: we might add a strict control to avoid passing others params than - # the ones with "-" like in findall etc + my($self, $unclean_param, $acceptable_params) = @_; + my $param; + # if the param is of private type '-something' let's check, otherwise skip + # 'cause it could be the name of a field + # TODO: we might add a strict control to avoid passing others params than + # the ones with "-" like in findall etc - if($unclean_param =~ /^-.+$/x) - { - if($unclean_param =~/$acceptable_params/x) - { - $param = $unclean_param; - } - else - { - # TODO: Localise this error message - carp "Invalid parameter specified - $unclean_param"; - } + if($unclean_param =~ /^-.+$/x) + { + if($unclean_param =~/$acceptable_params/x) + { + $param = $unclean_param; + } + else + { + # TODO: Localise this error message + carp "Invalid parameter specified - $unclean_param"; + } }else{ - $param = $unclean_param; + $param = $unclean_param; } - return $param; + return $param; } @@ -236,13 +236,13 @@ sub _assert_param sub _assert_params { - my ($self , %args) = @_; - - my $params = $args{def_params}; - my $acceptable_params = $args{acceptable_params}; - my $type = $args{type}; - - if($args{params} && ref($args{params}) eq 'HASH') + my ($self , %args) = @_; + + my $params = $args{def_params}; + my $acceptable_params = $args{acceptable_params}; + my $type = $args{type}; + + if($args{params} && ref($args{params}) eq 'HASH') { for my $param(keys %{$args{params}}) { @@ -254,7 +254,7 @@ sub _assert_params else { $params->{$param} = $args{params}->{$param} - if $self->_assert_param($param, $acceptable_params->{$type}); + if $self->_assert_param($param, $acceptable_params->{$type}); } } } diff --git a/lib/Net/FileMaker/XML/ResultSet.pm b/lib/Net/FileMaker/XML/ResultSet.pm index 309dfbe..1baa8b0 100644 --- a/lib/Net/FileMaker/XML/ResultSet.pm +++ b/lib/Net/FileMaker/XML/ResultSet.pm @@ -212,13 +212,13 @@ sub next_row my $self = shift; # if next row exists let's return it, otherwise undefined if( $self->{next_index} < scalar @{$self->{rows}} ) - { + { my $index = $self->{next_index}; $self->{next_index}++; return @{$self->{rows}}[$index]; } - else - { + else + { return; } } @@ -256,8 +256,8 @@ sub _parse_field_definition my ($self) = @_; require Net::FileMaker::XML::ResultSet::FieldsDefinition; $self->{fields_def} = Net::FileMaker::XML::ResultSet::FieldsDefinition->new( - $self->{result_hash}{metadata}{'field-definition'} - ); + $self->{result_hash}{metadata}{'field-definition'} + ); return; } @@ -269,17 +269,17 @@ sub _parse_rows my $cd = $self->fields_definition; # column definition, I need it for the inflater my $ds = $self->datasource; - # If the fetch size is 1 it returns an hash with the row, if more it returns an array + # If the fetch size is 1 it returns an hash with the row, if more it returns an array if($self->fetch_size == 1) - { + { push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new( - $self->{result_hash}{resultset}{record},$self - ); + $self->{result_hash}{resultset}{record},$self + ); } - else - { + else + { for my $row (@{$self->{result_hash}{resultset}{record}}) - { + { push @{$self->{rows}} , Net::FileMaker::XML::ResultSet::Row->new($row,$self); } } diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm index 34fb9a9..1ec2995 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::XML::ResultSet::FieldsDefinition; + Net::FileMaker::XML::ResultSet::FieldsDefinition; use strict; use warnings; @@ -20,14 +20,14 @@ directly, instead use L. sub new { - my($class, $res_hash) = @_; - - my $self = { - result_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods - }; - bless $self , $class; - $self->_parse; - return $self; + my($class, $res_hash) = @_; + + my $self = { + result_hash => $res_hash, # complete result hash provided by Net::FileMaker::XML search methods + }; + bless $self , $class; + $self->_parse; + return $self; } =head2 get($field_name) @@ -39,8 +39,8 @@ Returns the field definition object sub get { - my ( $self, $field ) = @_; - return $self->{fields}{$field}; + my ( $self, $field ) = @_; + return $self->{fields}{$field}; } =head2 fields @@ -52,8 +52,8 @@ Returns an hash with the field definition objects sub fields { - my ( $self, $field ) = @_; - return $self->{fields}; + my ( $self, $field ) = @_; + return $self->{fields}; } @@ -61,14 +61,14 @@ sub fields # sub _parse { - my $self = shift; - my %fields; - require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; - foreach my $key (sort keys %{$self->{result_hash}}) { - $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{result_hash}{$key}); - } - $self->{fields} = \%fields; - return; + my $self = shift; + my %fields; + require Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + foreach my $key (sort keys %{$self->{result_hash}}) { + $fields{$key} = Net::FileMaker::XML::ResultSet::FieldsDefinition::Field->new($self->{result_hash}{$key}); + } + $self->{fields} = \%fields; + return; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm index 38d0929..6834ccb 100644 --- a/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm +++ b/lib/Net/FileMaker/XML/ResultSet/FieldsDefinition/Field.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; + Net::FileMaker::XML::ResultSet::FieldsDefinition::Field; use strict; use warnings; @@ -21,14 +21,14 @@ instead use L. sub new { - my($class, $res_hash) = @_; - - my $self = { - result_hash => $res_hash - }; - bless $self , $class; - $self->_parse; - return $self; + my($class, $res_hash) = @_; + + my $self = { + result_hash => $res_hash + }; + bless $self , $class; + $self->_parse; + return $self; } =head2 get($field_name) @@ -88,9 +88,9 @@ my @availables = qw( global numeric-only four-digit-year not-empty auto-enter ty sub get { - my ( $self, $par ) = @_; - croak 'this parameter is not defined!' if(! grep { $_ eq $par } @availables); - return $self->{$par}; + my ( $self, $par ) = @_; + croak 'this parameter is not defined!' if(! grep { $_ eq $par } @availables); + return $self->{$par}; } =head2 get_all @@ -101,9 +101,9 @@ Returns a reference to an hash with all the parameters of this field. sub get_all { - my $self = shift; - my %tmp = map { $_ => $self->{$_} } @availables; - return \%tmp; + my $self = shift; + my %tmp = map { $_ => $self->{$_} } @availables; + return \%tmp; } @@ -111,18 +111,18 @@ sub get_all # sub _parse { - my $self = shift; - - # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 - my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); - foreach my $key (keys %{$self->{result_hash}}) { - if(grep {$_ eq $key} @bools){ - $self->{$key} = $self->{result_hash}{$key} eq 'no' ? 0 : 1; - }else{ - $self->{$key} = $self->{result_hash}{$key}; - } - } - return; + my $self = shift; + + # boolean fields ( "yes" or "no" ) to be converted into 1 or 0 + my @bools = qw( global numeric-only four-digit-year not-empty auto-enter time-of-day ); + foreach my $key (keys %{$self->{result_hash}}) { + if(grep {$_ eq $key} @bools){ + $self->{$key} = $self->{result_hash}{$key} eq 'no' ? 0 : 1; + }else{ + $self->{$key} = $self->{result_hash}{$key}; + } + } + return; } 1; diff --git a/lib/Net/FileMaker/XML/ResultSet/Row.pm b/lib/Net/FileMaker/XML/ResultSet/Row.pm index 50cd8a2..ca3bdc8 100644 --- a/lib/Net/FileMaker/XML/ResultSet/Row.pm +++ b/lib/Net/FileMaker/XML/ResultSet/Row.pm @@ -1,5 +1,5 @@ package - Net::FileMaker::XML::ResultSet::Row; + Net::FileMaker::XML::ResultSet::Row; use strict; use warnings; @@ -23,20 +23,20 @@ instead use L. sub new { - my($class, $res_hash , $dataset) = @_; - - my $cd = $dataset->fields_definition; # column definition, I need it for the inflater - my $ds = $dataset->datasource; - my $db = $dataset->{db}; - - my $self = { - columns_def => $cd, - datasource => $ds, - result_hash => $res_hash, - db_ref => $db - }; - bless $self , $class; - return $self; + my($class, $res_hash , $dataset) = @_; + + my $cd = $dataset->fields_definition; # column definition, I need it for the inflater + my $ds = $dataset->datasource; + my $db = $dataset->{db}; + + my $self = { + columns_def => $cd, + datasource => $ds, + result_hash => $res_hash, + db_ref => $db + }; + bless $self , $class; + return $self; } =head2 mod_id @@ -47,8 +47,8 @@ Returns the mod id for this row. sub mod_id { - my $self = shift; - return $self->{result_hash}{'mod-id'}; + my $self = shift; + return $self->{result_hash}{'mod-id'}; } @@ -60,8 +60,8 @@ Returns the record id for this row. sub record_id { - my $self = shift; - return $self->{result_hash}{'record-id'}; + my $self = shift; + return $self->{result_hash}{'record-id'}; } @@ -73,8 +73,8 @@ Returns the value of the selected column for this row. sub get { - my ( $self , $col ) = @_; - return $self->{result_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + return $self->{result_hash}{field}{$col}{data}; } =head2 get_type('colname') @@ -85,8 +85,8 @@ Returns the type of the selected column for this row. sub get_type { - my ( $self , $col ) = @_; - return $self->{columns_def}{$col}{result}; + my ( $self , $col ) = @_; + return $self->{columns_def}{$col}{result}; } =head2 get_max_length('colname') @@ -110,20 +110,20 @@ date, time or datetime returns, it will return a L object. sub get_inflated { - my ( $self , $col ) = @_; - # if the field is a “date”, “time” or “timestamp" - if(defined $self->get_type($col)){ - if($self->get_type($col) =~ m/^(date|time|timestamp)$/xms ){ - # let's convert it to a DateTime - my $pattern = $self->{datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - my $cldr = DateTime::Format::CLDR->new( - pattern => $pattern - ); - return $cldr->parse_datetime($self->{result_hash}{field}{$col}{data}) if(defined $self->{result_hash}{field}{$col}{data}); - } - } - # if the type is one of the ones above let's convert the value in a DateTime - return $self->{result_hash}{field}{$col}{data}; + my ( $self , $col ) = @_; + # if the field is a “date”, “time” or “timestamp" + if(defined $self->get_type($col)){ + if($self->get_type($col) =~ m/^(date|time|timestamp)$/xms ){ + # let's convert it to a DateTime + my $pattern = $self->{datasource}{"$1-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' + my $cldr = DateTime::Format::CLDR->new( + pattern => $pattern + ); + return $cldr->parse_datetime($self->{result_hash}{field}{$col}{data}) if(defined $self->{result_hash}{field}{$col}{data}); + } + } + # if the type is one of the ones above let's convert the value in a DateTime + return $self->{result_hash}{field}{$col}{data}; } =head2 get_columns @@ -133,12 +133,12 @@ Returns an hash with column names & relative values for this row. =cut sub get_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{result_hash}{field}}) { - $res{$k} = $self->get($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{result_hash}{field}}) { + $res{$k} = $self->get($k); + } + return \%res; } =head2 get_inflated_columns @@ -150,12 +150,12 @@ If the type is date, time or datetime returns a L object. sub get_inflated_columns { - my ( $self , $col ) = @_; - my %res; - foreach my $k(sort keys %{$self->{result_hash}{field}}) { - $res{$k} = $self->get_inflated($k); - } - return \%res; + my ( $self , $col ) = @_; + my %res; + foreach my $k(sort keys %{$self->{result_hash}{field}}) { + $res{$k} = $self->get_inflated($k); + } + return \%res; } =head2 update(params => { 'Field Name' => $value , ... }) @@ -193,43 +193,43 @@ $rs->update(params => { 'Field Name[1]' => 'hello' , 'Field Name[3]' => 'world' sub update { - my ( $self , %pars ) = @_; - my $db = $self->{db_ref}; - my $layout = $self->{datasource}{layout}; - - # let's play with DateTimes and arrays if passed - foreach my $key (keys %{$pars{params}}){ - my $value = $pars{params}{$key}; - - # if the type is datetime let's format it right - $pars{params}{$key} = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); - - # let's transform the array into the single params, taking into account the datetimes - if(ref($value) eq 'ARRAY'){ - - # fm's arrays have a predefined number of slots - # throw error if the array is longer than the max size for this field - croak 'the lenght of the array exceeds the max size of the field' if( scalar @$value > $self->get_max_length($key) ); - + my ( $self , %pars ) = @_; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; + + # let's play with DateTimes and arrays if passed + foreach my $key (keys %{$pars{params}}){ + my $value = $pars{params}{$key}; + + # if the type is datetime let's format it right + $pars{params}{$key} = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); + + # let's transform the array into the single params, taking into account the datetimes + if(ref($value) eq 'ARRAY'){ + + # fm's arrays have a predefined number of slots + # throw error if the array is longer than the max size for this field + croak 'the lenght of the array exceeds the max size of the field' if( scalar @$value > $self->get_max_length($key) ); + for(my $i = 0; $i < scalar @$value; $i++) { - # if the user hasn't defined the value of an index it means he doesn't want it to be modified - if(defined $value->[$i]){ - - # manage datetimes - $value->[$i] = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); - - # set the param for the request - $pars{params}{$key."[".($i+1)."]"} = $value->[$i]; - - } + # if the user hasn't defined the value of an index it means he doesn't want it to be modified + if(defined $value->[$i]){ + + # manage datetimes + $value->[$i] = $self->_get_formatted_dt($key,$value) if(ref($value) eq 'DateTime' ); + + # set the param for the request + $pars{params}{$key."[".($i+1)."]"} = $value->[$i]; + + } } #finally let's delete the array from the params delete $pars{params}{$key}; - } - } - my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); - return $result; + } + } + my $result = $db->edit(layout =>$layout , recid => $self->record_id , params => $pars{params} ); + return $result; } # _get_formatted_dt @@ -237,13 +237,13 @@ sub update sub _get_formatted_dt { - my ( $self , $fieldname , $dt ) = @_; + my ( $self , $fieldname , $dt ) = @_; # let's find what kind of field it is my $format = $self->get_type($fieldname); # and then it's format my $pattern = $self->{datasource}{"$format-format"}; # eg. 'MM/dd/yyyy HH:mm:ss' - my $result = DateTime::Format::CLDR->new(pattern => $pattern)->format_datetime($dt); - return $result; + my $result = DateTime::Format::CLDR->new(pattern => $pattern)->format_datetime($dt); + return $result; } =head2 remove(params => { 'Field Name' => $value , ... }) @@ -255,11 +255,11 @@ Deletes this row, returns an L object. sub remove { - my ( $self , %params ) = @_; - my $db = $self->{db_ref}; - my $layout = $self->{datasource}{layout}; - my $result = $db->delete(layout =>$layout , recid => $self->record_id , params => $params{params}); - return $result; + my ( $self , %params ) = @_; + my $db = $self->{db_ref}; + my $layout = $self->{datasource}{layout}; + my $result = $db->delete(layout =>$layout , recid => $self->record_id , params => $params{params}); + return $result; } diff --git a/t/00_load/01-perlcritic.t b/t/00_load/01-perlcritic.t old mode 100755 new mode 100644 diff --git a/t/00_load/02-pod.t b/t/00_load/02-pod.t old mode 100755 new mode 100644 diff --git a/t/02_error/01-en.t b/t/02_error/01-en.t index 5f8ae76..d7ef166 100644 --- a/t/02_error/01-en.t +++ b/t/02_error/01-en.t @@ -6,7 +6,7 @@ use Test::More tests => 7; use_ok('Net::FileMaker::Error'); # -# XML Errors +# XML Errors # my $xml = Net::FileMaker::Error->new(lang => 'en', type => 'xml'); ok($xml, 'Net::FileMaker::Error loaded XML strings in English'); @@ -18,7 +18,7 @@ my $xml_error_minusone = $xml->get_string('-1'); is($xml_error_minusone, 'Unknown error', 'Returned error string on -1'); # -# XSLT Errors +# XSLT Errors # my $xslt = Net::FileMaker::Error->new(lang => 'en', type => 'xslt'); ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in English'); diff --git a/t/02_error/02-ja.t b/t/02_error/02-ja.t index c5abd00..eb6f374 100644 --- a/t/02_error/02-ja.t +++ b/t/02_error/02-ja.t @@ -6,7 +6,7 @@ use Test::More tests => 7; use_ok('Net::FileMaker::Error'); # -# XML Errors +# XML Errors # my $xml = Net::FileMaker::Error->new(lang => 'ja', type => 'xml'); ok($xml, 'Net::FileMaker::Error loaded XML strings in Japanese'); @@ -18,7 +18,7 @@ my $xml_error_minusone = $xml->get_string('-1'); is($xml_error_minusone, '原因不明のエラー', 'Returned error string on -1'); # -# XSLT Errors +# XSLT Errors # my $xslt = Net::FileMaker::Error->new(lang => 'ja', type => 'xslt'); ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in Japanese'); diff --git a/t/02_error/03-it.t b/t/02_error/03-it.t index cb192cd..1a7e937 100644 --- a/t/02_error/03-it.t +++ b/t/02_error/03-it.t @@ -6,7 +6,7 @@ use Test::More tests => 7; use_ok('Net::FileMaker::Error'); # -# XML Errors +# XML Errors # my $xml = Net::FileMaker::Error->new(lang => 'it', type => 'xml'); ok($xml, 'Net::FileMaker::Error loaded XML strings in Italian'); @@ -18,7 +18,7 @@ my $xml_error_minusone = $xml->get_string('-1'); is($xml_error_minusone, 'Errore sconosciuto', 'Returned error string on -1'); # -# XSLT Errors +# XSLT Errors # my $xslt = Net::FileMaker::Error->new(lang => 'it', type => 'xslt'); ok($xslt, 'Net::FileMaker::Error loaded XSLT strings in Italian'); diff --git a/t/03_resultset/01-instantiation.t b/t/03_resultset/01-instantiation.t index 8c9378c..7f31a3e 100644 --- a/t/03_resultset/01-instantiation.t +++ b/t/03_resultset/01-instantiation.t @@ -24,8 +24,8 @@ ok($fmdb,'Logged in'); my $layouts = $fmdb->layoutnames; if(ref($layouts) eq 'ARRAY') { - my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1}); - ok($records, 'Directly constructed Net::FileMaker::XML::ResultSet'); + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1}); + ok($records, 'Directly constructed Net::FileMaker::XML::ResultSet'); } done_testing(); diff --git a/t/03_resultset/02-rows.t b/t/03_resultset/02-rows.t index d9408e0..cfb8a23 100644 --- a/t/03_resultset/02-rows.t +++ b/t/03_resultset/02-rows.t @@ -24,8 +24,8 @@ ok($fmdb,'Logged in'); my $layouts = $fmdb->layoutnames; if(ref($layouts) eq 'ARRAY') { - my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1})->rows; - is(ref(@$records[0]), 'Net::FileMaker::XML::ResultSet::Row', 'the first row of the RS is a Net::FileMaker::XML::ResultSet::Row'); + my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 1})->rows; + is(ref(@$records[0]), 'Net::FileMaker::XML::ResultSet::Row', 'the first row of the RS is a Net::FileMaker::XML::ResultSet::Row'); } done_testing(); diff --git a/t/04_field_definition/01-fields.t b/t/04_field_definition/01-fields.t index e29c6b5..bc6d110 100644 --- a/t/04_field_definition/01-fields.t +++ b/t/04_field_definition/01-fields.t @@ -25,7 +25,7 @@ my $layouts = $fmdb->layoutnames; if(ref($layouts) eq 'ARRAY') { my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 2}); - is(ref($records->fields_definition), 'HASH', 'the fields method returns an Hash'); + is(ref($records->fields_definition), 'HASH', 'the fields method returns an Hash'); } done_testing(); diff --git a/t/05_row/01-inflated.t b/t/05_row/01-inflated.t index 5dc2fd4..82c8374 100644 --- a/t/05_row/01-inflated.t +++ b/t/05_row/01-inflated.t @@ -28,13 +28,13 @@ if(ref($layouts) eq 'ARRAY') my $records = $fmdb->findall(layout => $layouts->[0], params => { '-max' => 2})->rows; for my $row (@$records){ - my $fields = $row->get_inflated_columns; + my $fields = $row->get_inflated_columns; foreach my $key (keys %$fields) { - my $col = $fields->{$key}; - if(defined $col){ - $success = 0 if(ref $col !~ m/^(ARRAY|SCALAR|DateTime)$/xms); - } - } + my $col = $fields->{$key}; + if(defined $col){ + $success = 0 if(ref $col !~ m/^(ARRAY|SCALAR|DateTime)$/xms); + } + } } } From 5a73e3656244916386d59556aecd530edc1340e1 Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 1 Mar 2013 16:33:09 +0000 Subject: [PATCH 89/90] Minor updates to documentation --- lib/Net/FileMaker/Error.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Net/FileMaker/Error.pm b/lib/Net/FileMaker/Error.pm index fe97927..d11f0be 100644 --- a/lib/Net/FileMaker/Error.pm +++ b/lib/Net/FileMaker/Error.pm @@ -10,22 +10,27 @@ Net::FileMaker::Error - Error strings and codes =head1 SYNOPSIS -Classes within this namespace store the applicable error codes, and the localised strings for them. You don't call these modules yourself directly. To enable them, the key "error" must be defined as an ISO 639 short code when you construct your objects with L or a subclass that handles individual interface types like so: +Classes within this namespace store the applicable error codes, and the +localised strings for them. You don't call these modules yourself directly. To +enable them, the key "error" must be defined as an ISO 639 short code when you +construct your objects with L or a subclass that handles +individual interface types like so: use Net::FileMaker; my $fms = Net::FileMaker->new(host => $host, error => 'en'); =head1 LANGUAGES SUPPORTED -English, Japanese and German are presently supported with the aims of covering all languages documented by FileMaker in the future. +English, Italian, Japanese and German are presently supported with the aims of +covering all languages documented by FileMaker in the future. =cut # new( lang => $lang, type => $type) # -# Creates a new object. There is no inheritance in the Error classes, mearly factory objects. -# Both the language (in ISO 639) and type (XML/XSLT/IWP etc) needs be defined. Returns undef if -# fails to load the strings. +# Creates a new object. There is no inheritance in the Error classes, mearly +# factory objects. Both the language (in ISO 639) and type (XML/XSLT/IWP etc) +# needs be defined. Returns undef if fails to load the strings. sub new { my($class, %args) = @_; From 298fcdd65fc950671dbb98543075f25a4595e86a Mon Sep 17 00:00:00 2001 From: Squeeks Date: Fri, 1 Mar 2013 16:33:35 +0000 Subject: [PATCH 90/90] Version 0.064. It's worth noting I can no longer perform any development or maintainence from here on, my new employer does not use FileMaker Server and thus I have no way of testing functionality or adding it in. Only patches, fixes and the trust and goodwill of developers with access to such things can continue. --- Changes | 42 ++++++++++++++++++++++++------------------ dist.ini | 10 +++++----- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Changes b/Changes index f2ab786..a71ef71 100644 --- a/Changes +++ b/Changes @@ -1,27 +1,33 @@ Revision history for Net::FileMaker -0.062 2010-04-07 - + Minor Bugfixes - + Enhancements to the test suite +0.064 2013-03-01 + + Further documentation updates and fixes, switching to Dist::Zilla -0.06 2010-03-15 - + Localised Error strings in English, Japanese and German - + Huge amounts of boilerplate removed +0.063 2011-02-11 + + Various bugfixes and documentation modifications -0.05 2010-03-04 - + Significant changes to the entire structure of the distrobution, and as such the interface has also changed, - So please check the documentation. - + XML::Simple has been dropped for XML::Twig - + Test suite has been restructured. - + More documentation. +0.062 2010-04-07 + + Minor Bugfixes + + Enhancements to the test suite -0.04 2010-02-15 - Minor test bugfix +0.06 2010-03-15 + + Localised Error strings in English, Japanese and German + + Huge amounts of boilerplate removed -0.03 2010-02-14 - Methods renamed - see the deprecated section in the documentation, in addition basic tests are being put in. +0.05 2010-03-04 + + Significant changes to the entire structure of the distrobution, and as such the interface has also changed, + So please check the documentation. + + XML::Simple has been dropped for XML::Twig + + Test suite has been restructured. + + More documentation. -0.02 2010-01-24 - Documentation and pre-requisites fixups. +0.04 2010-02-15 + Minor test bugfix + +0.03 2010-02-14 + Methods renamed - see the deprecated section in the documentation, in addition basic tests are being put in. + +0.02 2010-01-24 + Documentation and pre-requisites fixups. 0.01 2010-01-22 This is the initial release CPANified from the existing codebase. The start of a long journey. diff --git a/dist.ini b/dist.ini index aa460e4..b10e3b7 100644 --- a/dist.ini +++ b/dist.ini @@ -1,13 +1,13 @@ -name = Net-FileMaker -author = Squeeks -license = Perl_5 +name = Net-FileMaker +author = Squeeks +license = Perl_5 copyright_holder = Squeeks copyright_year = 2011 -version = 0.063 +version = 0.064 [Prereqs] -perl = 5.008001 +perl = 5.008001 XML::Twig = 3.33 LWP = 0