Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

rename Backend to StorageEngine

  • Loading branch information...
commit f448981bba9cc7a2ff26107737040f6416b28987 1 parent 64704fe
Oliver Gorwits authored
10 lib/Catalyst/Plugin/AutoCRUD.pm
@@ -20,7 +20,7 @@ sub setup_components {
20 20 Controller::AJAX
21 21 Controller::DisplayEngine::ExtJS2
22 22 Controller::DisplayEngine::Skinny
23   - Model::Backend::DBIC
  23 + Model::StorageEngine::DBIC
24 24 View::JSON
25 25 View::TT
26 26 );
@@ -70,16 +70,16 @@ sub setup_components {
70 70 : @{ $class->config->{$config_key}->{backends} };
71 71
72 72 # they will be componentized below
73   - push @packages, map {'Model::Backend::' . $_} @backends;
  73 + push @packages, map {'Model::StorageEngine::' . $_} @backends;
74 74
75 75 # this so that they can be forwarded to in the controller
76   - my %m = map {('Model::AutoCRUD::Backend::' . $_) => 1} @backends;
77   - ++$m{'Model::AutoCRUD::Backend::DBIC'};
  76 + my %m = map {('Model::AutoCRUD::StorageEngine::' . $_) => 1} @backends;
  77 + ++$m{'Model::AutoCRUD::StorageEngine::DBIC'};
78 78 $class->config->{$config_key}->{backends} = [ keys %m ];
79 79 }
80 80 else {
81 81 $class->config->{$config_key}->{backends} =
82   - [ 'Model::AutoCRUD::Backend::DBIC' ];
  82 + [ 'Model::AutoCRUD::StorageEngine::DBIC' ];
83 83 }
84 84
85 85 foreach my $orig (@packages) {
13 lib/Catalyst/Plugin/AutoCRUD/Model/Backend/DBIC.pm
... ... @@ -1,13 +0,0 @@
1   -package Catalyst::Plugin::AutoCRUD::Model::Backend::DBIC;
2   -
3   -use strict;
4   -use warnings FATAL => 'all';
5   -
6   -use base 'Catalyst::Model';
7   -
8   -__PACKAGE__->mk_classdata(_schema_cache => {});
9   -
10   -use Catalyst::Plugin::AutoCRUD::Model::Backend::DBIC::Store;
11   -use Catalyst::Plugin::AutoCRUD::Model::Backend::DBIC::Metadata;
12   -
13   -1;
13 lib/Catalyst/Plugin/AutoCRUD/Model/StorageEngine/DBIC.pm
... ... @@ -0,0 +1,13 @@
  1 +package Catalyst::Plugin::AutoCRUD::Model::StorageEngine::DBIC;
  2 +
  3 +use strict;
  4 +use warnings FATAL => 'all';
  5 +
  6 +use base 'Catalyst::Model';
  7 +
  8 +__PACKAGE__->mk_classdata(_schema_cache => {});
  9 +
  10 +use Catalyst::Plugin::AutoCRUD::Model::StorageEngine::DBIC::CRUD;
  11 +use Catalyst::Plugin::AutoCRUD::Model::StorageEngine::DBIC::Metadata;
  12 +
  13 +1;
2  ...alyst/Plugin/AutoCRUD/Model/Backend/DBIC/Store.pm → .../Plugin/AutoCRUD/Model/StorageEngine/DBIC/CRUD.pm
... ... @@ -1,4 +1,4 @@
1   -package Catalyst::Plugin::AutoCRUD::Model::Backend::DBIC::Store;
  1 +package Catalyst::Plugin::AutoCRUD::Model::StorageEngine::DBIC::CRUD;
2 2
3 3 use strict;
4 4 use warnings FATAL => 'all';
12 ...st/Plugin/AutoCRUD/Model/Backend/DBIC/Metadata.pm → ...gin/AutoCRUD/Model/StorageEngine/DBIC/Metadata.pm
... ... @@ -1,4 +1,4 @@
1   -package Catalyst::Plugin::AutoCRUD::Model::Backend::DBIC::Metadata;
  1 +package Catalyst::Plugin::AutoCRUD::Model::StorageEngine::DBIC::Metadata;
2 2
3 3 use strict;
4 4 use warnings FATAL => 'all';
@@ -130,16 +130,16 @@ sub schema_metadata {
130 130 parser => 'SQL::Translator::Parser::DBIx::Class',
131 131 parser_args => { package => $dbic },
132 132 filters => [
133   - ['AutoCRUD::Backend::DBIC::ViewsAsTables', $dbic],
134   - ['AutoCRUD::Backend::DBIC::Relationships', $dbic],
135   - ['AutoCRUD::Backend::DBIC::DynamicDefault', $dbic],
  133 + ['AutoCRUD::StorageEngine::DBIC::ViewsAsTables', $dbic],
  134 + ['AutoCRUD::StorageEngine::DBIC::Relationships', $dbic],
  135 + ['AutoCRUD::StorageEngine::DBIC::DynamicDefault', $dbic],
136 136 ['AutoCRUD::CatalystModel',
137 137 $self->_schema_cache->{handles}->{$db}->{sources}],
138   - ['AutoCRUD::Backend::DBIC::ProxyColumns', $dbic],
  138 + ['AutoCRUD::StorageEngine::DBIC::ProxyColumns', $dbic],
139 139 'AutoCRUD::ColumnsAndPKs',
140 140 'AutoCRUD::DisplayName',
141 141 'AutoCRUD::ExtJSxType',
142   - ['AutoCRUD::Backend::DBIC::AccessorDisplayName', $dbic],
  142 + ['AutoCRUD::StorageEngine::DBIC::AccessorDisplayName', $dbic],
143 143 ],
144 144 producer => 'SQL::Translator::Producer::POD', # something cheap
145 145 ) or die SQL::Translator->error;
2  ...lter/AutoCRUD/Backend/DBIC/AccessorDisplayName.pm → ...utoCRUD/StorageEngine/DBIC/AccessorDisplayName.pm
... ... @@ -1,4 +1,4 @@
1   -package SQL::Translator::Filter::AutoCRUD::Backend::DBIC::AccessorDisplayName;
  1 +package SQL::Translator::Filter::AutoCRUD::StorageEngine::DBIC::AccessorDisplayName;
2 2
3 3 # Although AutoCRUD is "safe" for columns of any weird name you like,
4 4 # if the user has specified a DBIC Column accessor then it's nice
2  ...or/Filter/AutoCRUD/Backend/DBIC/DynamicDefault.pm → ...ter/AutoCRUD/StorageEngine/DBIC/DynamicDefault.pm
... ... @@ -1,4 +1,4 @@
1   -package SQL::Translator::Filter::AutoCRUD::Backend::DBIC::DynamicDefault;
  1 +package SQL::Translator::Filter::AutoCRUD::StorageEngine::DBIC::DynamicDefault;
2 2
3 3 # DBIx:Class extensions such as DBIx::Class::TimeStamp or
4 4 # DBIx::Class::DynamicDefault will set column values on create/update.
2  ...ator/Filter/AutoCRUD/Backend/DBIC/ProxyColumns.pm → ...ilter/AutoCRUD/StorageEngine/DBIC/ProxyColumns.pm
... ... @@ -1,4 +1,4 @@
1   -package SQL::Translator::Filter::AutoCRUD::Backend::DBIC::ProxyColumns;
  1 +package SQL::Translator::Filter::AutoCRUD::StorageEngine::DBIC::ProxyColumns;
2 2
3 3 # The DBIC Relation proxy atribute can be used to import accessors from
4 4 # related tables. This filter parses the attribute and installs columns
2  ...tor/Filter/AutoCRUD/Backend/DBIC/Relationships.pm → ...lter/AutoCRUD/StorageEngine/DBIC/Relationships.pm
... ... @@ -1,4 +1,4 @@
1   -package SQL::Translator::Filter::AutoCRUD::Backend::DBIC::Relationships;
  1 +package SQL::Translator::Filter::AutoCRUD::StorageEngine::DBIC::Relationships;
2 2
3 3 use strict;
4 4 use warnings FATAL => 'all';
2  ...tor/Filter/AutoCRUD/Backend/DBIC/ViewsAsTables.pm → ...lter/AutoCRUD/StorageEngine/DBIC/ViewsAsTables.pm
... ... @@ -1,4 +1,4 @@
1   -package SQL::Translator::Filter::AutoCRUD::Backend::DBIC::ViewsAsTables;
  1 +package SQL::Translator::Filter::AutoCRUD::StorageEngine::DBIC::ViewsAsTables;
2 2
3 3 # SQLT doesn't provide for proper Field objects in Views
4 4 # instead, there is simply an ordered list of field names.
4 t/20-music-metadata.t
@@ -31,12 +31,12 @@ my $expected_json = <<'END_JSON';
31 31 "frontend":"extjs2",
32 32 "site":"default",
33 33 "db":"dbic",
34   - "backend":"Model::AutoCRUD::Backend::DBIC",
  34 + "backend":"Model::AutoCRUD::StorageEngine::DBIC",
35 35 "table":"album"
36 36 },
37 37 "conf":{
38 38 "dbic":{
39   - "backend":"Model::AutoCRUD::Backend::DBIC",
  39 + "backend":"Model::AutoCRUD::StorageEngine::DBIC",
40 40 "hidden":"no",
41 41 "display_name":"Dbic",
42 42 "t":{
2  t/44-m2m-metadata.t
@@ -24,7 +24,7 @@ my $response = JSON::XS::decode_json( $mech->content );
24 24 #print STDERR Dumper $mech->content;
25 25
26 26 my $expected = <<'END_EXPECTED';
27   -{"cpac":{"global":{"default_sort":"id","frontend":"extjs2","site":"default","db":"dbic","backend":"Model::AutoCRUD::Backend::DBIC","table":"album"},"conf":{"dbic":{"backend":"Model::AutoCRUD::Backend::DBIC","hidden":"no","display_name":"Dbic","t":{"album":{"headings":{"artist_albums":"Artist Albums","artist":"Artists","title":"Title","recorded":"Recorded","deleted":"Deleted","id":"Id"},"display_name":"Album","hidden_cols":{"artist_albums":1},"cols":["id","deleted","recorded","title","artist_albums","artist"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"},"artist_album":{"headings":{"album_id":"Album","artist_id":"Artist","id":"Id"},"display_name":"Artist Album","cols":["id","album_id","artist_id"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"},"artist":{"headings":{"artist_albums":"Artist Albums","album":"Albums","pseudonym":"Pseudonym","forename":"Forename","born":"Born","id":"Id","surname":"Surname"},"display_name":"Artist","hidden_cols":{"artist_albums":1},"cols":["id","born","forename","pseudonym","surname","artist_albums","album"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"}}}},"meta":{"display_name":"Test App M 2 Mschema V 1 X","t":{"album":{"pks":["id"],"fields":["id","deleted","recorded","title","artist_albums","artist"],"model":"AutoCRUD::DBIC::Album","f":{"artist_albums":{"ref_fields":["album_id"],"fields":["id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artist Albums","ref_table":"artist_album","rel_type":"has_many"},"artist":{"via":["artist_albums","artist_id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artists","rel_type":"many_to_many"},"id":{"extjs_xtype":"numberfield","display_name":"Id"},"title":{"extjs_xtype":"textarea","display_name":"Title"},"recorded":{"extjs_xtype":"datefield","display_name":"Recorded"},"deleted":{"extjs_xtype":"checkbox","display_name":"Deleted"}},"display_name":"Album"},"artist":{"pks":["id"],"fields":["id","born","forename","pseudonym","surname","artist_albums","album"],"model":"AutoCRUD::DBIC::Artist","f":{"artist_albums":{"ref_fields":["artist_id"],"fields":["id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artist Albums","ref_table":"artist_album","rel_type":"has_many"},"album":{"via":["artist_albums","album_id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Albums","rel_type":"many_to_many"},"pseudonym":{"extjs_xtype":"textarea","display_name":"Pseudonym"},"forename":{"extjs_xtype":"textarea","display_name":"Forename"},"id":{"extjs_xtype":"numberfield","display_name":"Id"},"born":{"extjs_xtype":"datefield","display_name":"Born"},"surname":{"extjs_xtype":"textarea","display_name":"Surname"}},"display_name":"Artist"},"artist_album":{"pks":["id"],"fields":["id","album_id","artist_id"],"model":"AutoCRUD::DBIC::ArtistAlbum","f":{"album_id":{"ref_fields":["id"],"fields":["album_id"],"extjs_xtype":"numberfield","rel_type":"belongs_to","ref_table":"album","display_name":"Album"},"artist_id":{"ref_fields":["id"],"fields":["artist_id"],"extjs_xtype":"numberfield","rel_type":"belongs_to","ref_table":"artist","display_name":"Artist"},"id":{"extjs_xtype":"numberfield","display_name":"Id"}},"display_name":"Artist Album"}}}}}
  27 +{"cpac":{"global":{"default_sort":"id","frontend":"extjs2","site":"default","db":"dbic","backend":"Model::AutoCRUD::StorageEngine::DBIC","table":"album"},"conf":{"dbic":{"backend":"Model::AutoCRUD::StorageEngine::DBIC","hidden":"no","display_name":"Dbic","t":{"album":{"headings":{"artist_albums":"Artist Albums","artist":"Artists","title":"Title","recorded":"Recorded","deleted":"Deleted","id":"Id"},"display_name":"Album","hidden_cols":{"artist_albums":1},"cols":["id","deleted","recorded","title","artist_albums","artist"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"},"artist_album":{"headings":{"album_id":"Album","artist_id":"Artist","id":"Id"},"display_name":"Artist Album","cols":["id","album_id","artist_id"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"},"artist":{"headings":{"artist_albums":"Artist Albums","album":"Albums","pseudonym":"Pseudonym","forename":"Forename","born":"Born","id":"Id","surname":"Surname"},"display_name":"Artist","hidden_cols":{"artist_albums":1},"cols":["id","born","forename","pseudonym","surname","artist_albums","album"],"create_allowed":"yes","delete_allowed":"yes","update_allowed":"yes","dumpmeta_allowed":"yes","hidden":"no"}}}},"meta":{"display_name":"Test App M 2 Mschema V 1 X","t":{"album":{"pks":["id"],"fields":["id","deleted","recorded","title","artist_albums","artist"],"model":"AutoCRUD::DBIC::Album","f":{"artist_albums":{"ref_fields":["album_id"],"fields":["id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artist Albums","ref_table":"artist_album","rel_type":"has_many"},"artist":{"via":["artist_albums","artist_id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artists","rel_type":"many_to_many"},"id":{"extjs_xtype":"numberfield","display_name":"Id"},"title":{"extjs_xtype":"textarea","display_name":"Title"},"recorded":{"extjs_xtype":"datefield","display_name":"Recorded"},"deleted":{"extjs_xtype":"checkbox","display_name":"Deleted"}},"display_name":"Album"},"artist":{"pks":["id"],"fields":["id","born","forename","pseudonym","surname","artist_albums","album"],"model":"AutoCRUD::DBIC::Artist","f":{"artist_albums":{"ref_fields":["artist_id"],"fields":["id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Artist Albums","ref_table":"artist_album","rel_type":"has_many"},"album":{"via":["artist_albums","album_id"],"extjs_xtype":"textfield","is_reverse":1,"display_name":"Albums","rel_type":"many_to_many"},"pseudonym":{"extjs_xtype":"textarea","display_name":"Pseudonym"},"forename":{"extjs_xtype":"textarea","display_name":"Forename"},"id":{"extjs_xtype":"numberfield","display_name":"Id"},"born":{"extjs_xtype":"datefield","display_name":"Born"},"surname":{"extjs_xtype":"textarea","display_name":"Surname"}},"display_name":"Artist"},"artist_album":{"pks":["id"],"fields":["id","album_id","artist_id"],"model":"AutoCRUD::DBIC::ArtistAlbum","f":{"album_id":{"ref_fields":["id"],"fields":["album_id"],"extjs_xtype":"numberfield","rel_type":"belongs_to","ref_table":"album","display_name":"Album"},"artist_id":{"ref_fields":["id"],"fields":["artist_id"],"extjs_xtype":"numberfield","rel_type":"belongs_to","ref_table":"artist","display_name":"Artist"},"id":{"extjs_xtype":"numberfield","display_name":"Id"}},"display_name":"Artist Album"}}}}}
28 28 END_EXPECTED
29 29
30 30 is_deeply( $response, JSON::XS::decode_json($expected), 'Metadata is as we expect' );

0 comments on commit f448981

Please sign in to comment.
Something went wrong with that request. Please try again.