[Catalyst-commits] r8727 - in CatalystX-CRUD/CatalystX-CRUD/trunk:
. lib/CatalystX lib/CatalystX/CRUD
lib/CatalystX/CRUD/Iterator lib/CatalystX/CRUD/Model
lib/CatalystX/CRUD/ModelAdapter lib/CatalystX/CRUD/Object
lib/CatalystX/CRUD/Test
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Fri Dec 5 03:05:29 GMT 2008
Author: karpet
Date: 2008-12-05 03:05:29 +0000 (Fri, 05 Dec 2008)
New Revision: 8727
Modified:
CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Controller.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator/File.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/File.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter/File.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object/File.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/REST.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Results.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Controller.pm
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Form.pm
Log:
release 0.36
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2008-12-05 03:05:29 UTC (rev 8727)
@@ -180,3 +180,7 @@
* call edit() after initializing object and form with passed in params, so that the init_form()
method can have all data already set.
+0.36 4 Dec 2008
+ * add cxc-fuzzy2 feature and document both it and cxc-fuzzy.
+
+
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Controller.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Controller.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Controller.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -36,7 +36,7 @@
naked_results => 0,
);
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator/File.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator/File.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator/File.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -3,7 +3,7 @@
use warnings;
use Carp;
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Iterator.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -4,7 +4,7 @@
use Carp;
use base qw( CatalystX::CRUD );
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/File.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/File.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/File.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -10,7 +10,7 @@
__PACKAGE__->mk_accessors(qw( inc_path ));
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -9,7 +9,7 @@
__PACKAGE__->mk_accessors(qw( use_ilike ne_sign ));
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
@@ -113,6 +113,16 @@
parser object. The default is all I<field_names>. B<NOTE> this param is only
checked if C<cxc-query> has a value.
+=item cxc-fuzzy
+
+If set to a true value triggers the 'fuzzify' feature in
+Search::QueryParser::SQL.
+
+=item cxc-fuzzy2
+
+If set to a true value, overrides cxc-fuzzy and triggers the 'fuzzify2'
+feature in Search::QueryParser::SQL.
+
=back
=cut
@@ -138,9 +148,10 @@
}
sub make_sql_query {
- my $self = shift;
- my $c = $self->context;
- my $field_names = shift
+ my $self = shift;
+ my $c = $self->context;
+ my $field_names
+ = shift
|| $c->req->params->{'cxc-query-fields'}
|| $c->controller->field_names($c)
|| $self->throw_error("field_names required");
@@ -157,12 +168,13 @@
$field_names = [$field_names];
}
- my $p2q = $self->params_to_sql_query($field_names);
- my $params = $c->req->params;
- my $sp = Sort::SQL->string2array( $self->_which_sort($c) );
- my $s = join( ' ', map {%$_} @$sp );
- my $offset = $params->{'cxc-offset'} || $params->{'_offset'};
- my $page_size = $params->{'cxc-page_size'}
+ my $p2q = $self->params_to_sql_query($field_names);
+ my $params = $c->req->params;
+ my $sp = Sort::SQL->string2array( $self->_which_sort($c) );
+ my $s = join( ' ', map {%$_} @$sp );
+ my $offset = $params->{'cxc-offset'} || $params->{'_offset'};
+ my $page_size
+ = $params->{'cxc-page_size'}
|| $params->{'_page_size'}
|| $c->controller->page_size
|| $self->page_size;
@@ -246,6 +258,7 @@
my $params = $c->req->params;
my $oper = $params->{'cxc-op'} || $params->{'_op'} || 'AND';
my $fuzzy = $params->{'cxc-fuzzy'} || $params->{'_fuzzy'} || 0;
+ my $fuzzy2 = $params->{'cxc-fuzzy2'} || 0;
my %columns;
for my $fn (@$field_names) {
@@ -293,12 +306,17 @@
# we don't want to "double encode" $like because it will
# be re-parsed as a word not an op, so we have our a modified
# parser for per-field queries.
- my $parser = Search::QueryParser::SQL->new(
+ my %args = (
like => '=',
fuzzify => $fuzzy,
columns => \%columns,
strict => 1,
);
+ if ($fuzzy2) {
+ delete $args{fuzzify};
+ $args{fuzzify2} = 1;
+ }
+ my $parser = Search::QueryParser::SQL->new(%args);
my $query;
eval {
@@ -318,7 +336,7 @@
if ( length $joined_query ) {
- my $parser = Search::QueryParser::SQL->new(
+ my %args = (
like => $like,
fuzzify => $fuzzy,
columns => \%columns,
@@ -328,7 +346,13 @@
: [ keys %columns ]
),
strict => 1,
+
);
+ if ($fuzzy2) {
+ delete $args{fuzzify};
+ $args{fuzzify2} = 1;
+ }
+ my $parser = Search::QueryParser::SQL->new(%args);
# must eval and re-throw since we run under strict
eval { $query = $parser->parse( $joined_query, uc($oper) eq 'AND' ); };
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -8,7 +8,7 @@
);
use Class::C3;
-our $VERSION = '0.35';
+our $VERSION = '0.36';
__PACKAGE__->mk_accessors(qw( object_class page_size ));
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter/File.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter/File.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/ModelAdapter/File.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -3,7 +3,7 @@
use warnings;
use base qw( CatalystX::CRUD::ModelAdapter );
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object/File.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object/File.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object/File.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -13,7 +13,7 @@
__PACKAGE__->mk_accessors(qw( content file ));
__PACKAGE__->delegate_class('Path::Class::File');
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Object.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -9,7 +9,7 @@
__PACKAGE__->mk_ro_accessors(qw( delegate ));
__PACKAGE__->mk_classdata('delegate_class');
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/REST.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/REST.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/REST.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -9,7 +9,7 @@
__PACKAGE__->mk_accessors(qw( enable_rpc_compat ));
__PACKAGE__->config( enable_rpc_compat => 0 );
-our $VERSION = '0.35';
+our $VERSION = '0.36';
#warn "REST VERSION = $VERSION";
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Results.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Results.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Results.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -7,7 +7,7 @@
__PACKAGE__->mk_ro_accessors(qw( count pager query results ));
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Controller.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Controller.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Controller.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -8,7 +8,7 @@
__PACKAGE__->mk_accessors( qw( form_fields ) );
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Form.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Form.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Test/Form.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -7,7 +7,7 @@
__PACKAGE__->mk_accessors(qw( params fields ));
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD.pm 2008-12-05 01:59:14 UTC (rev 8726)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD.pm 2008-12-05 03:05:29 UTC (rev 8727)
@@ -4,7 +4,7 @@
use strict;
use Carp;
-our $VERSION = '0.35';
+our $VERSION = '0.36';
=head1 NAME
More information about the Catalyst-commits
mailing list