lib/Rapi/Blog/Model/DB.pm untested

filter: Statementstmt 0.0% 0 / 134 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 8 totaltotal 0.0% 0 / 184 CC 4 SCAR 14.1
CC
4
Cov
0%
_migrate_and_diff_deployed
12.0
_migrate_for_schemsum
6.0
_sqlt_db_path
2.0
CRAP 4.1
1 package Rapi::Blog::Model::DB;
2 use Moo;
3 extends 'Catalyst::Model::DBIC::Schema';
4 with 'RapidApp::Util::Role::ModelDBIC';
5  
6 use strict;
7 use warnings;
8  
9 use Path::Class qw(file);
10 use RapidApp::Util ':all';
11 my $db_path = file( RapidApp::Util::find_app_home('Rapi::Blog'), 'rapi_blog.db' );
12 sub _sqlt_db_path { "$db_path" }; # exposed for use by the regen devel script
13  
14 use Rapi::Blog::Util;
15 use DBIx::Class::Schema::Diff 1.05;
16  
17 #<<< tell perltidy not to mess with this
18 before 'setup' => sub {
19 my $self = shift;
20  
21 my $db_path = $self->_get_sqlite_db_path
22 or die "Couldn't determine SQLite db path (currently only SQLite is supported)";
23  
24 unless ( -f $db_path ) {
25 warn " ** Auto-Deploy $db_path **\n";
26 my $db = $self->_one_off_connect;
27 $db->deploy;
28 # Make sure the built-in uid:0 system account exists:
29 $db->resultset('User')->find_or_create(
30 { id => 0, username => '(system)', full_name => '[System Acount]', admin => 1 },
31 { key => 'primary' }
32 );
33 # Need to insert the default rows:
34 my @inserts = (
35 q~INSERT INTO [preauth_action_type] VALUES('enable_account','Enable a disabled user account')~,
36 q~INSERT INTO [preauth_action_type] VALUES('password_reset','Change a user password')~,
37 q~INSERT INTO [preauth_action_type] VALUES('login','Single-use login')~,
38 q~INSERT INTO [preauth_event_type] VALUES(1,'Valid', 'Pre-Authorization Action accessed and is valid')~,
39 q~INSERT INTO [preauth_event_type] VALUES(2,'Invalid', 'Pre-Authorization Action exists but is invalid')~,
40 q~INSERT INTO [preauth_event_type] VALUES(3,'Deactivate','Pre-Authorization Action deactivated')~,
41 q~INSERT INTO [preauth_event_type] VALUES(4,'Executed', 'Pre-Authorization Action executed')~,
42 q~INSERT INTO [preauth_event_type] VALUES(5,'Sealed', 'Action sealed - can no longer be accessed with key, except by admins')~
43 );
44 $db->storage->dbh->do($_) for (@inserts);
45 }
46
47 my ($DiffObj,$schemsum) = $self->_migrate_and_diff_deployed;
48
49 my $fn = (reverse split(/\//,$db_path))[0];
50 warn ' ** ' . __PACKAGE__ . " - loaded $fn [$schemsum]\n";
51  
52 my $diff = $DiffObj
53 ->filter_out('*:relationships')
54 ->filter_out('*:constraints')
55 ->filter_out('*:isa')
56 ->filter_out('*:columns/*._inflate_info')
57 ->filter_out('*:columns/*._ic_dt_method')
58 ->filter_out('*:columns/*.is_numeric') # this apparently can get set later on
59 ->diff;
60  
61 if ($diff) {
62 die join( "\n",
63 '', '', '', '**** ' . __PACKAGE__ . ' - column differences found in deployed database! ****',
64 '', 'Dump (DBIx::Class::Schema::Diff): ',
65 Dumper($diff), '', '', '' );
66 }
67 };
68  
69 sub _get_sqlite_db_path {
70 my $self = shift;
71
72 # extract path from dsn because the app reaches in to set it
73 my $dsn = $self->connect_info->{dsn};
74 my ( $pre, $db_path ) = split( /\:SQLite\:/, $dsn, 2 );
75  
76 return $db_path
77 }
78  
79  
80 sub _migrate_and_diff_deployed {
81 my ($self, $seen) = @_;
82 $seen ||= {};
83
84 my $DiffObj = $self->_diff_deployed_schema;
85  
86 my $schemsum = $DiffObj->_schema_diff->new_schema
87 ->prune('isa')
88 ->prune('relationships')
89 ->prune('private_col_attrs')
90 ->fingerprint;
91
92 if($seen->{$schemsum}++) {
93 die "looping/failing migrations detected! Already saw schema signature $schemsum";
94 }
95  
96 $self->_migrate_for_schemsum($schemsum)
97 ? $self->_migrate_and_diff_deployed($seen)
98 : ($DiffObj,$schemsum)
99 }
100  
101 # Dynamic, signature-based migrations
102 sub _migrate_for_schemsum {
103 my ($self, $schemsum) = @_;
104
105 # Failsafe to only process for SQLite in this version
106 my $db_path = $self->_get_sqlite_db_path or return 0;
107
108 my $meth = join('_','','run','migrate',$schemsum);
109 $meth =~ s/\-/\_/g;
110
111 if($self->can($meth)) {
112 warn " ** detected known schema signature '$schemsum' -- running migration ...\n";
113
114 my $Db = file($db_path);
115 my $BkpDir = $Db->parent->subdir(join('.','','bkp',$Db->basename));
116 my $Bkp = $BkpDir->file(join('.',$schemsum,'db'));
117
118 warn join('',
119 " [backing up '",$Db->basename,"' to '",
120 $Bkp->relative($Db->parent)->stringify,"']\n"
121 );
122
123 -d $BkpDir or $BkpDir->mkpath();
124 $Bkp->spew(scalar $Db->slurp);
125
126 warn " ++ calling ->$meth():\n";
127  
128 $self->$meth or warn " warning: migration method $meth did not return a true value ... \n";
129
130 # We return true regardless to indicate that the migration was run:
131 return 1;
132 }
133 else {
134 # Unknown schema signature:
135 return 0;
136 }
137 }
138  
139  
140 ###############################################################################
141 ###################### SCHEMA MIGRATION METHODS #####################
142 ###############################################################################
143  
144  
145 ######################################
146 ### Migration from pre-v1 ###
147 ######################################
148 # This is the migration from the last dev state before public 1.000 release... was
149 # never seen in the wild (this entry made for test/dev as we never expect to see it)
150 sub _run_migrate_schemsum_7ef8b36d22d6c7d {
151 my $self = shift;
152
153 my @statements = (
154 'PRAGMA foreign_keys=off',
155 'BEGIN TRANSACTION',
156
157 'ALTER TABLE [post] RENAME TO [temp_post]',q~
158 CREATE TABLE [post] (
159 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
160 [name] varchar(255) UNIQUE NOT NULL,
161 [title] varchar(255) DEFAULT NULL,
162 [image] varchar(255) DEFAULT NULL,
163 [ts] datetime NOT NULL,
164 [create_ts] datetime NOT NULL,
165 [update_ts] datetime NOT NULL,
166 [author_id] INTEGER NOT NULL,
167 [creator_id] INTEGER NOT NULL,
168 [updater_id] INTEGER NOT NULL,
169 [published] BOOLEAN NOT NULL DEFAULT 0,
170 [publish_ts] datetime DEFAULT NULL,
171 [size] INTEGER DEFAULT NULL,
172 [tag_names] text default NULL,
173 [custom_summary] text default NULL,
174 [summary] text default NULL,
175 [body] text default '',
176
177 FOREIGN KEY ([author_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
178 FOREIGN KEY ([creator_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
179 FOREIGN KEY ([updater_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE
180 )~, q~
181 INSERT INTO [post] SELECT
182 [id],[name],[title],[image],[ts],[create_ts],[update_ts],[author_id],[creator_id],
183 [updater_id],[published],[publish_ts],[size],null,[custom_summary],[summary],[body]
184 FROM [temp_post]
185 ~,
186 'DROP TABLE [temp_post]',
187
188
189 'ALTER TABLE [user] RENAME TO [temp_user]', q~
190 CREATE TABLE [user] (
191 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
192 [username] varchar(32) UNIQUE NOT NULL,
193 [full_name] varchar(64) UNIQUE DEFAULT NULL,
194 [image] varchar(255) DEFAULT NULL,
195 [email] varchar(255) DEFAULT NULL,
196 [admin] BOOLEAN NOT NULL DEFAULT 0,
197 [author] BOOLEAN NOT NULL DEFAULT 0,
198 [comment] BOOLEAN NOT NULL DEFAULT 1
199 )~, q~
200 INSERT INTO [user] SELECT
201 [id],[username],[full_name],null,null,[admin],[author],[comment]
202 FROM [temp_user]
203 ~,
204 'DROP TABLE [temp_user]',
205
206 'COMMIT',
207 'PRAGMA foreign_keys=on',
208 );
209
210 my $db = $self->_one_off_connect;
211
212 $db->storage->dbh->do($_) for (@statements);
213
214 # Must trigger biz-logic to update new tag_names column for every row
215 # (note: calling this here causes some column attr 'is_numeric' to get applied, not sure why)
216 for my $Post ($db->resultset('Post')->all) {
217 $Post->make_column_dirty('body');
218 $Post->update
219 }
220
221 return 1
222 }
223 ######################################
224  
225  
226 ######################################
227 ### Migration from v1.0000 ###
228 ######################################
229  
230 #sub _run_migrate_schemsum_8955354febf5675 {
231 # my $self = shift;
232 # scream('[1] WE WOULD RUN MIGRATION FOR schemsum-8955354febf5675 !!!');
233 #}
234  
235 # This is the first public migration, adds categories
236 sub _run_migrate_schemsum_8955354febf5675 {
237 my $self = shift;
238
239 my @statements = (
240 'PRAGMA foreign_keys=off',
241 'BEGIN TRANSACTION',q~
242 CREATE TABLE [category] (
243 [name] varchar(64) PRIMARY KEY NOT NULL,
244 [description] varchar(1024) DEFAULT NULL
245 )~,
246  
247 q~CREATE TABLE [post_category] (
248 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
249 [post_id] INTEGER NOT NULL,
250 [category_name] varchar(64) NOT NULL,
251
252 FOREIGN KEY ([post_id]) REFERENCES [post] ([id]) ON DELETE CASCADE ON UPDATE CASCADE,
253 FOREIGN KEY ([category_name]) REFERENCES [category] ([name]) ON DELETE RESTRICT ON UPDATE RESTRICT
254 )~,
255  
256 'COMMIT',
257 'PRAGMA foreign_keys=on',
258 );
259
260 my $db = $self->_one_off_connect;
261
262 $db->storage->dbh->do($_) for (@statements);
263
264 return 1
265 }
266 ######################################
267  
268  
269 ######################################
270 ### Migration from v1.0101 ###
271 ######################################
272 # This is the second public migration from the schema as of v1.0101 release...
273 sub _run_migrate_schemsum_6c99c16bdcb0fab {
274 my $self = shift;
275
276 my @statements = (
277 'PRAGMA foreign_keys=off',
278 'BEGIN TRANSACTION',
279
280 q~CREATE TABLE [section] (
281 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
282 [name] varchar(64) NOT NULL,
283 [description] varchar(1024) DEFAULT NULL,
284 [parent_id] INTEGER DEFAULT NULL,
285
286 FOREIGN KEY ([parent_id]) REFERENCES [section] ([id]) ON DELETE CASCADE ON UPDATE CASCADE
287 )~,
288 'CREATE UNIQUE INDEX [unique_subsection] ON [section] ([parent_id],[name])',
289  
290 'ALTER TABLE [post] RENAME TO [temp_post]',q~
291 CREATE TABLE [post] (
292 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
293 [name] varchar(255) UNIQUE NOT NULL,
294 [title] varchar(255) DEFAULT NULL,
295 [image] varchar(255) DEFAULT NULL,
296 [ts] datetime NOT NULL,
297 [create_ts] datetime NOT NULL,
298 [update_ts] datetime NOT NULL,
299 [author_id] INTEGER NOT NULL,
300 [creator_id] INTEGER NOT NULL,
301 [updater_id] INTEGER NOT NULL,
302 [section_id] INTEGER DEFAULT NULL,
303 [published] BOOLEAN NOT NULL DEFAULT 0,
304 [publish_ts] datetime DEFAULT NULL,
305 [size] INTEGER DEFAULT NULL,
306 [tag_names] text default NULL,
307 [custom_summary] text default NULL,
308 [summary] text default NULL,
309 [body] text default '',
310
311 FOREIGN KEY ([author_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
312 FOREIGN KEY ([creator_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
313 FOREIGN KEY ([updater_id]) REFERENCES [user] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
314 FOREIGN KEY ([section_id]) REFERENCES [section] ([id]) ON DELETE SET DEFAULT ON UPDATE CASCADE
315 )~, q~
316 INSERT INTO [post] SELECT
317 [id],[name],[title],[image],[ts],[create_ts],[update_ts],[author_id],[creator_id],
318 [updater_id],null,[published],[publish_ts],[size],[tag_names],[custom_summary],[summary],[body]
319 FROM [temp_post]
320 ~,
321 'DROP TABLE [temp_post]',
322
323 q~CREATE TABLE [trk_section_posts] (
324 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
325 [section_id] INTEGER NOT NULL,
326 [post_id] INTEGER NOT NULL,
327 [depth] INTEGER NOT NULL,
328
329 FOREIGN KEY ([section_id]) REFERENCES [section] ([id]) ON DELETE CASCADE ON UPDATE CASCADE,
330 FOREIGN KEY ([post_id]) REFERENCES [post] ([id]) ON DELETE CASCADE ON UPDATE CASCADE
331 )~,
332  
333 q~CREATE TABLE [trk_section_sections] (
334 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
335 [section_id] INTEGER NOT NULL,
336 [subsection_id] INTEGER NOT NULL,
337 [depth] INTEGER NOT NULL,
338
339 FOREIGN KEY ([section_id]) REFERENCES [section] ([id]) ON DELETE CASCADE ON UPDATE CASCADE,
340 FOREIGN KEY ([subsection_id]) REFERENCES [section] ([id]) ON DELETE CASCADE ON UPDATE CASCADE
341 )~,
342
343 'COMMIT',
344 'PRAGMA foreign_keys=on',
345 );
346
347 my $db = $self->_one_off_connect;
348
349 $db->storage->dbh->do($_) for (@statements);
350
351 return 1
352 }
353 ######################################
354  
355  
356 ######################################
357 ### Migration from v1.0200 ###
358 ######################################
359 sub _run_migrate_schemsum_fea65238f92786e {
360 my $self = shift;
361
362 # All this just so we can change hit.post_id from not null to nullable:
363 my @modify_hit = (
364 'PRAGMA foreign_keys=off', 'BEGIN TRANSACTION',
365
366 'ALTER TABLE [hit] RENAME TO [temp_hit]',q~
367 CREATE TABLE [hit] (
368 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
369 [post_id] INTEGER,
370 [ts] datetime NOT NULL,
371 [client_ip] varchar(16),
372 [client_hostname] varchar(255),
373 [uri] varchar(512),
374 [method] varchar(8),
375 [user_agent] varchar(1024),
376 [referer] varchar(512),
377 [serialized_request] text,
378
379 FOREIGN KEY ([post_id]) REFERENCES [post] ([id]) ON DELETE CASCADE ON UPDATE CASCADE
380 )~, q~
381 INSERT INTO [hit]
382 SELECT [id],[post_id],[ts],[client_ip],[client_hostname],[uri], [method],[user_agent],[referer],[serialized_request]
383 FROM [temp_hit]
384 ~,
385 'DROP TABLE [temp_hit]',
386
387 'COMMIT', 'PRAGMA foreign_keys=on'
388 );
389
390
391 my @statements = (
392
393 @modify_hit,
394
395 'ALTER TABLE [user] ADD COLUMN [disabled] BOOLEAN NOT NULL DEFAULT 0',
396
397 q~CREATE TABLE [preauth_action_type] (
398 [name] varchar(16) PRIMARY KEY NOT NULL,
399 [description] varchar(1024) DEFAULT NULL
400 )~,
401 q~INSERT INTO [preauth_action_type] VALUES('enable_account','Enable a disabled user account')~,
402 q~INSERT INTO [preauth_action_type] VALUES('password_reset','Change a user password')~,
403  
404 q~CREATE TABLE [preauth_action] (
405 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
406 [type] varchar(16) NOT NULL,
407 [active] BOOLEAN NOT NULL DEFAULT 1,
408 [sealed] BOOLEAN NOT NULL DEFAULT 0,
409 [create_ts] datetime NOT NULL,
410 [expire_ts] datetime NOT NULL,
411 [user_id] INTEGER,
412 [auth_key] varchar(128) UNIQUE NOT NULL,
413 [json_data] text,
414
415 FOREIGN KEY ([type]) REFERENCES [preauth_action_type] ([name]) ON DELETE CASCADE ON UPDATE CASCADE,
416 FOREIGN KEY ([user_id]) REFERENCES [user] ([id]) ON DELETE CASCADE ON UPDATE CASCADE
417 )~,
418
419 q~CREATE TABLE [preauth_event_type] (
420 [id] INTEGER PRIMARY KEY NOT NULL,
421 [name] varchar(16) UNIQUE NOT NULL,
422 [description] varchar(1024) DEFAULT NULL
423 )~,
424 q~INSERT INTO [preauth_event_type] VALUES(1,'Valid', 'Pre-Authorization Action accessed and is valid')~,
425 q~INSERT INTO [preauth_event_type] VALUES(2,'Invalid', 'Pre-Authorization Action exists but is invalid')~,
426 q~INSERT INTO [preauth_event_type] VALUES(3,'Deactivate','Pre-Authorization Action deactivated')~,
427 q~INSERT INTO [preauth_event_type] VALUES(4,'Executed', 'Pre-Authorization Action executed')~,
428 q~INSERT INTO [preauth_event_type] VALUES(5,'Sealed', 'Action sealed - can no longer be accessed with key, except by admins')~,
429
430 q~CREATE TABLE [preauth_action_event] (
431 [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
432 [ts] datetime NOT NULL,
433 [type_id] INTEGER NOT NULL,
434 [action_id] INTEGER NOT NULL,
435 [hit_id] INTEGER,
436 [info] text,
437
438 FOREIGN KEY ([type_id]) REFERENCES [preauth_event_type] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
439 FOREIGN KEY ([action_id]) REFERENCES [preauth_action] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE,
440 FOREIGN KEY ([hit_id]) REFERENCES [hit] ([id]) ON DELETE RESTRICT ON UPDATE CASCADE
441 )~
442
443 );
444
445 my $db = $self->_one_off_connect;
446
447 $db->storage->dbh->do($_) for (@statements);
448
449 return 1
450 }
451 ######################################
452  
453  
454  
455 ###############################################################################
456 ###################### END MIGRATION METHODS #####################
457 ###############################################################################
458  
459  
460  
461 #>>>
462  
463 __PACKAGE__->config(
464 schema_class => 'Rapi::Blog::DB',
465  
466 connect_info => {
467 dsn => "dbi:SQLite:$db_path",
468 user => '',
469 password => '',
470 quote_names => q{1},
471 sqlite_unicode => q{1},
472 on_connect_call => q{use_foreign_keys},
473 },
474  
475 # Configs for the RapidApp::RapidDbic Catalyst Plugin:
476 RapidDbic => {
477  
478 # use only the relationship column of a foreign-key and hide the
479 # redundant literal column when the names are different:
480 hide_fk_columns => 1,
481  
482 # The grid_class is used to automatically setup a module for each source in the
483 # navtree with the grid_params for each source supplied as its options.
484 grid_class => 'Rapi::Blog::Module::GridBase',
485 menu_require_role => 'administrator',
486 grid_params => {
487 # The special '*defaults' key applies to all sources at once
488 '*defaults' => {
489 page_class => 'Rapi::Blog::Module::PageBase',
490 include_colspec => ['*'], #<-- default already ['*']
491 ## uncomment these lines to turn on editing in all grids
492 updatable_colspec => ['*'],
493 creatable_colspec => ['*'],
494 destroyable_relspec => ['*'],
495 extra_extconfig => {
496 store_button_cnf => {
497 save => { showtext => 1 },
498 undo => { showtext => 1 }
499 }
500 }
501 },
502 Post => {
503 page_class => 'Rapi::Blog::Module::PostPage'
504 },
505 PostKeyword => {
506 include_colspec => [ '*', '*.*' ],
507 },
508 Hit => {
509 updatable_colspec => undef,
510 creatable_colspec => undef,
511 require_role => 'administrator'
512 },
513 PreauthAction => { require_role => 'administrator' },
514 PreauthActionEvent => { require_role => 'administrator' },
515 PreauthActionType => { require_role => 'administrator' },
516 PreauthEventType => { require_role => 'administrator' },
517 },
518  
519 # TableSpecs define extra RapidApp-specific metadata for each source
520 # and is used/available to all modules which interact with them
521 TableSpecs => {
522 Tag => {
523 display_column => 'name',
524 title => 'Tag',
525 title_multi => 'Tags',
526 iconCls => 'icon-tag-blue',
527 multiIconCls => 'icon-tags-blue',
528 columns => {
529 name => {
530 header => 'Tag Name',
531 width => 180,
532 #renderer => 'RA.ux.App.someJsFunc',
533 #profiles => [],
534 },
535 post_tags => {
536 header => 'Posts with Tag',
537 width => 170,
538 #sortable => 1,
539 #renderer => 'RA.ux.App.someJsFunc',
540 #profiles => [],
541 },
542 },
543 },
544 Post => {
545 display_column => 'title',
546 title_multi => 'Posts',
547 iconCls => 'icon-post',
548 multiIconCls => 'icon-posts',
549 columns => {
550 id => {
551 allow_add => 0,
552 header => 'Id',
553 width => 55,
554 #renderer => 'RA.ux.App.someJsFunc',
555 #profiles => [],
556 },
557 name => {
558 header => 'Name',
559 extra_properties => {
560 editor => {
561 vtype => 'rablPostName',
562 }
563 },
564 width => 170,
565 #documentation => 'Unique post name, used in the URL -- can only contain lowercase/digit characters',
566 hidden => 1
567 #renderer => 'RA.ux.App.someJsFunc',
568 #profiles => [],
569 },
570 title => {
571 header => 'Title',
572 width => 220,
573 #documentation => 'Human-frendly post title. If not set, defaults to the same value as Name'
574 #renderer => 'RA.ux.App.someJsFunc',
575 #profiles => [],
576 },
577 image => {
578 header => 'Image',
579 hidden => 1,
580 #width => 100,
581 #renderer => 'RA.ux.App.someJsFunc',
582 profiles => ['cas_img'],
583 #documentation => 'Post-specific image. It is up to the scaffold to decide how (or if) to use it.'
584 },
585 create_ts => {
586 header => 'Created',
587 allow_add => \0,
588 allow_edit => \0,
589 documentation => 'Timestamp of when the post was created (inserted)',
590 hidden => 1
591 #width => 100,
592 #renderer => 'RA.ux.App.someJsFunc',
593 #profiles => [],
594 },
595 update_ts => {
596 header => 'Updated',
597 allow_add => \0,
598 allow_edit => \0,
599 documentation => 'Timestamp updated automatically every time the post is modified',
600 hidden => 1
601 #width => 100,
602 #renderer => 'RA.ux.App.someJsFunc',
603 #profiles => [],
604 },
605 published => {
606 header => '<i style="font-size:1.3em;" class="fa fa-eye" title="Published?"></i>',
607 width => 45,
608 documentation => 'Published yes or no. Post will not be listed unless this is yes/true',
609 #documentation => join('',
610 # 'True/false value which determines if a post should be made publically available. ',
611 # 'If false, external users will receive a 404 when trying to access the URL and the post ',
612 # 'will not show up in any list_posts() calls. However, admins and the author will still ',
613 # 'be able to access the post via its public URL.'
614 #),
615 #renderer => 'RA.ux.App.someJsFunc',
616 #profiles => [],
617 },
618 publish_ts => {
619 header => 'Published at',
620 allow_add => \0,
621 allow_edit => \0,
622 documentation => join( '',
623 'Timestamp updated automatically every time the published flag changes from 0 to 1 ',
624 'and is cleared when it changes from 1 back to 0.' ),
625 hidden => 1
626 #width => 100,
627 #renderer => 'RA.ux.App.someJsFunc',
628 #profiles => [],
629 },
630 body => {
631 header => 'Body',
632 hidden => 1,
633 width => 400,
634 #renderer => 'RA.ux.App.someJsFunc',
635 profiles => ['markdown'],
636 documentation => 'The main content body of the post stored in Markdown/HTML format'
637 },
638 post_tags => {
639 header => 'Post/Tag Links',
640 width => 160,
641 documentaton => join( '',
642 'Multi-rel which links this post to 0 or more Tags. These links are automatically created ',
643 'and destroyed according to #hashtag values found (or not found) in the body text on create/update.'
644 )
645 #sortable => 1,
646 #renderer => 'RA.ux.App.someJsFunc',
647 #profiles => [],
648 },
649 ts => {
650 header => 'Date/Time',
651 # extra_properties get merged instead of replaced, so we don't clobber the rest of
652 # the 'editor' properties
653 #documentation => join('',
654 # 'The official date/time of the post. Defaults (i.e. pre-populates) to the current time ',
655 # 'in the add post form, however, the author is allowed to set a manual value by default'
656 #),
657 extra_properties => {
658 editor => {
659 value => sub { Rapi::Blog::Util->now_ts }
660 }
661 }
662 #width => 100,
663 #renderer => 'RA.ux.App.someJsFunc',
664 #profiles => [],
665 },
666 author_id => {
667 header => 'author_id',
668 #width => 100,
669 #renderer => 'RA.ux.App.someJsFunc',
670 profiles => ['hidden'],
671 },
672 creator_id => {
673 header => 'creator_id',
674 #width => 100,
675 #renderer => 'RA.ux.App.someJsFunc',
676 profiles => ['hidden'],
677 },
678 updater_id => {
679 header => 'updater_id',
680 #width => 100,
681 #renderer => 'RA.ux.App.someJsFunc',
682 profiles => ['hidden'],
683 },
684 author => {
685 header => 'Author',
686 width => 100,
687 #documentation => join('',
688 # 'The user listed as the author of the post. The author has special permissions to modify ',
689 # 'and/or delete the post. Admin users are able to select any user as the author, but normal ',
690 # 'users have no control over the setting other than to create new posts (which they will ',
691 # 'automatically be set as the author)'
692 #),
693 #renderer => 'RA.ux.App.someJsFunc',
694 #profiles => [],
695 editor => {
696 value => sub {
697 return Rapi::Blog::Util->get_uid;
698 }
699 }
700 },
701 creator => {
702 header => 'Creator',
703 allow_add => \0,
704 allow_edit => \0,
705 documentation => join( '',
706 'The user which created the post. This will be the same as the author unless an admin ',
707 'manually selects a different author.' ),
708 hidden => 1
709 #width => 100,
710 #renderer => 'RA.ux.App.someJsFunc',
711 #profiles => [],
712 },
713 updater => {
714 header => 'Updater',
715 allow_add => \0,
716 allow_edit => \0,
717 documentation => 'The last user to modify the post.',
718 hidden => 1
719 #width => 100,
720 #renderer => 'RA.ux.App.someJsFunc',
721 #profiles => [],
722 },
723 size => {
724 header => 'Size of body',
725 allow_add => \0,
726 allow_edit => \0,
727 width => 80,
728 #renderer => 'RA.ux.App.someJsFunc',
729 profiles => ['filesize'],
730 documentation => 'Size (in bytes) of the body content.'
731 },
732 comments => {
733 header => 'Comments',
734 width => 135,
735 documentation => 'Comments on this post, including comments on comments.',
736 #sortable => 1,
737 #renderer => 'RA.ux.App.someJsFunc',
738 #profiles => [],
739 },
740 direct_comments => {
741 header => 'Direct Comments',
742 width => 140,
743 documentation =>
744 'Comments on this post, limited to comments on the post itself (i.e. not subcomments)',
745 hidden => 1
746 #sortable => 1,
747 #renderer => 'RA.ux.App.someJsFunc',
748 #profiles => [],
749 },
750 custom_summary => {
751 header => 'Custom Summary (optional)',
752 width => 200,
753 #documentation => join('',
754 # 'Summary text can be supplied here to be able to control the summary. If this field is ',
755 # 'left blank, the summary will be autogenerated using a built-in algorithm'
756 #),
757 hidden => 1
758 #renderer => 'RA.ux.App.someJsFunc',
759 #profiles => [],
760 },
761 summary => {
762 header => 'Post Summary',
763 width => 160,
764 allow_add => 0,
765 allow_edit => 0,
766 hidden => 1,
767 documentation =>
768 'Summary blurb on the post. Either uses Custom Summary or an auto-generated value',
769 #renderer => 'RA.ux.App.someJsFunc',
770 #profiles => [],
771 },
772 hits => {
773 header => 'Recorded Hits',
774 width => 90,
775 documentation => join( '',
776 'Multi-rel to "Hits" table which records web requests to each post. Currently ',
777 'relies on the scaffold view_wrapper to call [% Post.record_hit %]' ),
778 hidden => 1
779 #sortable => 1,
780 #renderer => 'RA.ux.App.someJsFunc',
781 #profiles => [],
782 },
783 tag_names => {
784 header => 'Tag Names',
785 width => 200,
786 hidden => 1,
787 allow_add => 0,
788 allow_edit => 0,
789 renderer => 'rablTagNamesColumnRenderer',
790 #profiles => [],
791 },
792 post_categories => {
793 header => 'Post/Category Links',
794 width => 180,
795 hidden => 1,
796 #sortable => 1,
797 #renderer => 'RA.ux.App.someJsFunc',
798 #profiles => [],
799 },
800 categories => {
801 header => 'Categories',
802 width => 180,
803 #sortable => 1,
804 #renderer => 'RA.ux.App.someJsFunc',
805 #profiles => [],
806 },
807 section_id => {
808 header => 'section_id',
809 #width => 100,
810 #renderer => 'RA.ux.App.someJsFunc',
811 profiles => ['hidden'],
812 },
813 section => {
814 header => 'Section',
815 width => 140,
816 #renderer => 'RA.ux.App.someJsFunc',
817 #profiles => [],
818 },
819 trk_section_posts => {
820 header => 'Track Section-Posts',
821 width => 180,
822 hidden => 1,
823 #sortable => 1,
824 #renderer => 'RA.ux.App.someJsFunc',
825 #profiles => [],
826 },
827 },
828 },
829 PostTag => {
830 display_column => 'id',
831 title => 'Post-Tag Link',
832 title_multi => 'Post-Tag Links',
833 iconCls => 'icon-node',
834 multiIconCls => 'icon-logic-and-blue',
835 columns => {
836 id => {
837 allow_add => 0,
838 header => 'Id',
839 #width => 100,
840 #renderer => 'RA.ux.App.someJsFunc',
841 #profiles => [],
842 },
843 post_id => {
844 header => 'post_id',
845 #width => 100,
846 #renderer => 'RA.ux.App.someJsFunc',
847 profiles => ['hidden'],
848 },
849 tag_name => {
850 header => 'Tag',
851 width => 160,
852 #renderer => 'RA.ux.App.someJsFunc',
853 #profiles => [],
854 },
855 post => {
856 header => 'Post',
857 width => 350,
858 #renderer => 'RA.ux.App.someJsFunc',
859 #profiles => [],
860 },
861 },
862 },
863 User => {
864 display_column => 'username',
865 title => 'User Account',
866 title_multi => 'User Accounts',
867 iconCls => 'icon-user',
868 multiIconCls => 'icon-users',
869 columns => {
870 id => {
871 allow_add => 0,
872 header => 'Id',
873 width => 45,
874 #renderer => 'RA.ux.App.someJsFunc',
875 #profiles => [],
876 },
877 username => {
878 header => 'Username',
879 width => 120,
880 #renderer => 'RA.ux.App.someJsFunc',
881 #profiles => [],
882 },
883 full_name => {
884 header => 'Full Name',
885 width => 150,
886 #renderer => 'RA.ux.App.someJsFunc',
887 #profiles => [],
888 },
889 post_authors => {
890 header => 'Author of',
891 width => 120,
892 #sortable => 1,
893 #renderer => 'RA.ux.App.someJsFunc',
894 #profiles => [],
895 },
896 post_creators => {
897 header => 'Creator of',
898 width => 120,
899 #sortable => 1,
900 #renderer => 'RA.ux.App.someJsFunc',
901 #profiles => [],
902 },
903 post_updaters => {
904 header => 'Last Updater of',
905 width => 120,
906 #sortable => 1,
907 #renderer => 'RA.ux.App.someJsFunc',
908 #profiles => [],
909 },
910 admin => {
911 header => 'admin',
912 #width => 100,
913 #renderer => 'RA.ux.App.someJsFunc',
914 #profiles => [],
915 },
916 author => {
917 header => 'author',
918 #width => 100,
919 #renderer => 'RA.ux.App.someJsFunc',
920 #profiles => [],
921 },
922 comment => {
923 header => 'comment',
924 #width => 100,
925 #renderer => 'RA.ux.App.someJsFunc',
926 #profiles => [],
927 },
928 set_pw => {
929 header => 'Set Password*',
930 width => 130,
931 hidden => 1,
932 editor => { xtype => 'ra-change-password-field' },
933 renderer => 'Ext.ux.RapidApp.renderSetPwValue'
934 },
935 comments => {
936 header => 'Comments',
937 width => 130,
938 #sortable => 1,
939 #renderer => 'RA.ux.App.someJsFunc',
940 #profiles => [],
941 },
942 image => {
943 header => 'Image',
944 profiles => ['cas_img'],
945 width => 55,
946 #renderer => 'RA.ux.App.someJsFunc',
947 #profiles => [],
948 },
949 email => {
950 header => 'E-Mail',
951 width => 180,
952 #renderer => 'RA.ux.App.someJsFunc',
953 #profiles => [],
954 },
955 disabled => {
956 header => 'disabled',
957 #width => 100,
958 #renderer => 'RA.ux.App.someJsFunc',
959 #profiles => [],
960 },
961 preauth_actions => {
962 header => 'Pre Authorizations',
963 hidden => 1
964 #width => 100,
965 #sortable => 1,
966 #renderer => 'RA.ux.App.someJsFunc',
967 #profiles => [],
968 },
969 },
970 },
971 Comment => {
972 display_column => 'id',
973 title => 'Comment',
974 title_multi => 'Comments',
975 iconCls => 'icon-comment',
976 multiIconCls => 'icon-comments',
977 columns => {
978 id => {
979 allow_add => 0,
980 header => 'Id',
981 width => 65,
982 #renderer => 'RA.ux.App.someJsFunc',
983 #profiles => [],
984 },
985 post_id => {
986 header => 'post_id',
987 #width => 100,
988 #renderer => 'RA.ux.App.someJsFunc',
989 profiles => ['hidden'],
990 },
991 user_id => {
992 header => 'user_id',
993 #width => 100,
994 #renderer => 'RA.ux.App.someJsFunc',
995 profiles => ['hidden'],
996 },
997 ts => {
998 header => 'Timestamp',
999 width => 120,
1000 #renderer => 'RA.ux.App.someJsFunc',
1001 #profiles => [],
1002 extra_properties => {
1003 editor => {
1004 value => sub { Rapi::Blog::Util->now_ts }
1005 }
1006 }
1007 },
1008 body => {
1009 header => 'Comment body',
1010 width => 180,
1011 #renderer => 'RA.ux.App.someJsFunc',
1012 #profiles => [],
1013 },
1014 comments => {
1015 header => 'Sub-comments',
1016 width => 130,
1017 #sortable => 1,
1018 #renderer => 'RA.ux.App.someJsFunc',
1019 #profiles => [],
1020 },
1021 post => {
1022 header => 'Post',
1023 width => 180,
1024 #renderer => 'RA.ux.App.someJsFunc',
1025 #profiles => [],
1026 },
1027 user => {
1028 header => 'Commenter',
1029 width => 120,
1030 #renderer => 'RA.ux.App.someJsFunc',
1031 #profiles => [],
1032 editor => {
1033 value => sub {
1034 return Rapi::Blog::Util->get_uid;
1035 }
1036 }
1037 },
1038 parent_id => {
1039 header => 'parent_id',
1040 #width => 100,
1041 #renderer => 'RA.ux.App.someJsFunc',
1042 profiles => ['hidden'],
1043 },
1044 parent => {
1045 header => 'Replies to',
1046 width => 120,
1047 #renderer => 'RA.ux.App.someJsFunc',
1048 #profiles => [],
1049 },
1050 },
1051 },
1052 Hit => {
1053 display_column => 'id',
1054 title => 'Hit',
1055 title_multi => 'Hits',
1056 iconCls => 'icon-world-go',
1057 multiIconCls => 'icon-world-gos',
1058 columns => {
1059 id => {
1060 allow_add => 0,
1061 header => 'Id',
1062 width => 60,
1063 #renderer => 'RA.ux.App.someJsFunc',
1064 #profiles => [],
1065 },
1066 post_id => {
1067 header => 'post_id',
1068 #width => 100,
1069 #renderer => 'RA.ux.App.someJsFunc',
1070 profiles => ['hidden'],
1071 },
1072 ts => {
1073 header => 'Request Timestamp',
1074 width => 130,
1075 #renderer => 'RA.ux.App.someJsFunc',
1076 #profiles => [],
1077 },
1078 client_ip => {
1079 header => 'IP Addr',
1080 width => 100,
1081 #renderer => 'RA.ux.App.someJsFunc',
1082 #profiles => [],
1083 },
1084 client_hostname => {
1085 header => 'Hostname (if resolved)',
1086 hidden => 1,
1087 width => 160,
1088 #renderer => 'RA.ux.App.someJsFunc',
1089 #profiles => [],
1090 },
1091 uri => {
1092 header => 'URI Accessed',
1093 width => 250,
1094 #renderer => 'RA.ux.App.someJsFunc',
1095 #profiles => [],
1096 },
1097 method => {
1098 header => 'HTTP Method',
1099 width => 90,
1100 #renderer => 'RA.ux.App.someJsFunc',
1101 #profiles => [],
1102 },
1103 user_agent => {
1104 header => 'User Agent String',
1105 width => 250,
1106 #renderer => 'RA.ux.App.someJsFunc',
1107 #profiles => [],
1108 },
1109 referer => {
1110 header => 'Referer URL',
1111 width => 250,
1112 hidden => 1
1113 #renderer => 'RA.ux.App.someJsFunc',
1114 #profiles => [],
1115 },
1116 serialized_request => {
1117 header => 'Serialized Request',
1118 width => 200,
1119 hidden => 1,
1120 allow_add => 0,
1121 allow_edit => 0,
1122 #renderer => 'RA.ux.App.someJsFunc',
1123 #profiles => [],
1124 },
1125 post => {
1126 header => 'Accessed Post',
1127 width => 180,
1128 #renderer => 'RA.ux.App.someJsFunc',
1129 #profiles => [],
1130 },
1131 preauth_action_events => {
1132 header => 'Pre-Auth Events',
1133 hidden => 1,
1134 #width => 100,
1135 #sortable => 1,
1136 #renderer => 'RA.ux.App.someJsFunc',
1137 #profiles => [],
1138 },
1139 },
1140 },
1141 Category => {
1142 display_column => 'name',
1143 title => 'Category',
1144 title_multi => 'Categories',
1145 iconCls => 'icon-image',
1146 multiIconCls => 'icon-images',
1147 columns => {
1148 name => {
1149 header => 'Name',
1150 width => 140,
1151 #renderer => 'RA.ux.App.someJsFunc',
1152 #profiles => [],
1153 },
1154 description => {
1155 header => 'Description',
1156 width => 280,
1157 #renderer => 'RA.ux.App.someJsFunc',
1158 #profiles => [],
1159 },
1160 post_categories => {
1161 header => 'Posts in Category',
1162 width => 190,
1163 #sortable => 1,
1164 #renderer => 'RA.ux.App.someJsFunc',
1165 #profiles => [],
1166 },
1167 },
1168 },
1169 PostCategory => {
1170 display_column => 'id',
1171 title => 'Post-Category Link',
1172 title_multi => 'Post-Category Links',
1173 iconCls => 'icon-node',
1174 multiIconCls => 'icon-logic-and',
1175 columns => {
1176 id => {
1177 allow_add => 0,
1178 header => 'Id',
1179 width => 45,
1180 #renderer => 'RA.ux.App.someJsFunc',
1181 #profiles => [],
1182 },
1183 post_id => {
1184 header => 'post_id',
1185 #width => 100,
1186 #renderer => 'RA.ux.App.someJsFunc',
1187 profiles => ['hidden'],
1188 },
1189 category_name => {
1190 header => 'Category',
1191 width => 180,
1192 #renderer => 'RA.ux.App.someJsFunc',
1193 #profiles => [ 'hidden' ],
1194 },
1195 post => {
1196 header => 'Post',
1197 width => 350,
1198 #renderer => 'RA.ux.App.someJsFunc',
1199 #profiles => [],
1200 },
1201 },
1202 },
1203 Section => {
1204 display_column => 'name',
1205 title => 'Section',
1206 title_multi => 'Sections',
1207 iconCls => 'icon-element',
1208 multiIconCls => 'icon-chart-organisation',
1209 columns => {
1210 id => {
1211 allow_add => 0,
1212 header => 'Id',
1213 width => 45,
1214 hidden => 1,
1215 #renderer => 'RA.ux.App.someJsFunc',
1216 #profiles => [],
1217 },
1218 parent_id => {
1219 header => 'parent_id',
1220 #width => 100,
1221 #renderer => 'RA.ux.App.someJsFunc',
1222 profiles => ['hidden'],
1223 },
1224 name => {
1225 header => 'Name',
1226 width => 180,
1227 #renderer => 'RA.ux.App.someJsFunc',
1228 #profiles => [],
1229 },
1230 description => {
1231 header => 'Description',
1232 width => 280,
1233 #renderer => 'RA.ux.App.someJsFunc',
1234 #profiles => [],
1235 },
1236 parent => {
1237 header => 'Parent Section',
1238 width => 160,
1239 #renderer => 'RA.ux.App.someJsFunc',
1240 #profiles => [],
1241 },
1242 posts => {
1243 header => 'Posts',
1244 width => 120,
1245 #sortable => 1,
1246 #renderer => 'RA.ux.App.someJsFunc',
1247 #profiles => [],
1248 },
1249 sections => {
1250 header => 'Sub-sections (one-level)',
1251 width => 150,
1252 #sortable => 1,
1253 #renderer => 'RA.ux.App.someJsFunc',
1254 #profiles => [],
1255 },
1256 trk_section_posts => {
1257 header => 'Posts in Section/Sub-sections',
1258 width => 180,
1259 #sortable => 1,
1260 #renderer => 'RA.ux.App.someJsFunc',
1261 #profiles => [],
1262 },
1263 trk_section_sections_sections => {
1264 header => 'Sub-sections (deep)',
1265 width => 200,
1266 #sortable => 1,
1267 #renderer => 'RA.ux.App.someJsFunc',
1268 #profiles => [],
1269 },
1270 trk_section_sections_subsections => {
1271 header => 'All Parent Sections',
1272 width => 200,
1273 #sortable => 1,
1274 #renderer => 'RA.ux.App.someJsFunc',
1275 #profiles => [],
1276 },
1277 },
1278 },
1279 TrkSectionPost => {
1280 display_column => 'id',
1281 title => 'Section-Post Link',
1282 title_multi => 'Section-Post Links',
1283 iconCls => 'icon-table-relationship',
1284 multiIconCls => 'icon-table-relationship',
1285 columns => {
1286 id => {
1287 allow_add => 0,
1288 header => 'Id',
1289 width => 45,
1290 hidden => 1,
1291 #renderer => 'RA.ux.App.someJsFunc',
1292 #profiles => [],
1293 },
1294 section_id => {
1295 header => 'section_id',
1296 #width => 100,
1297 #renderer => 'RA.ux.App.someJsFunc',
1298 profiles => ['hidden'],
1299 },
1300 post_id => {
1301 header => 'post_id',
1302 #width => 100,
1303 #renderer => 'RA.ux.App.someJsFunc',
1304 profiles => ['hidden'],
1305 },
1306 depth => {
1307 header => 'Depth',
1308 #width => 100,
1309 #renderer => 'RA.ux.App.someJsFunc',
1310 #profiles => [],
1311 },
1312 post => {
1313 header => 'Post',
1314 width => 300,
1315 #renderer => 'RA.ux.App.someJsFunc',
1316 #profiles => [],
1317 },
1318 section => {
1319 header => 'Section',
1320 width => 150,
1321 #renderer => 'RA.ux.App.someJsFunc',
1322 #profiles => [],
1323 },
1324 },
1325 },
1326 TrkSectionSection => {
1327 display_column => 'id',
1328 title => 'Section-Subsection Link',
1329 title_multi => 'Section-Subsection Links',
1330 iconCls => 'icon-table-relationship',
1331 multiIconCls => 'icon-table-relationship',
1332 columns => {
1333 id => {
1334 allow_add => 0,
1335 header => 'Id',
1336 width => 45,
1337 hidden => 1,
1338 #renderer => 'RA.ux.App.someJsFunc',
1339 #profiles => [],
1340 },
1341 section_id => {
1342 header => 'section_id',
1343 #width => 100,
1344 #renderer => 'RA.ux.App.someJsFunc',
1345 profiles => ['hidden'],
1346 },
1347 subsection_id => {
1348 header => 'subsection_id',
1349 #width => 100,
1350 #renderer => 'RA.ux.App.someJsFunc',
1351 profiles => ['hidden'],
1352 },
1353 depth => {
1354 header => 'Depth',
1355 #width => 100,
1356 #renderer => 'RA.ux.App.someJsFunc',
1357 #profiles => [],
1358 },
1359 section => {
1360 header => 'Section',
1361 width => 180,
1362 #renderer => 'RA.ux.App.someJsFunc',
1363 #profiles => [],
1364 },
1365 subsection => {
1366 header => 'Sub-section',
1367 width => 180,
1368 #renderer => 'RA.ux.App.someJsFunc',
1369 #profiles => [],
1370 },
1371 },
1372 },
1373 PreauthAction => {
1374 display_column => 'id',
1375 title => 'Pre Authorization',
1376 title_multi => 'Pre Authorizations',
1377 iconCls => 'icon-preauth-action',
1378 multiIconCls => 'icon-preauth-actions',
1379 columns => {
1380 id => {
1381 allow_add => 0,
1382 header => 'Id',
1383 width => 55,
1384 #renderer => 'RA.ux.App.someJsFunc',
1385 #profiles => [],
1386 },
1387 type => {
1388 header => 'Type',
1389 #width => 100,
1390 #renderer => 'RA.ux.App.someJsFunc',
1391 #profiles => [],
1392 },
1393 active => {
1394 header => 'Active?',
1395 #width => 100,
1396 #renderer => 'RA.ux.App.someJsFunc',
1397 #profiles => [],
1398 },
1399 sealed => {
1400 header => 'Sealed?',
1401 #width => 100,
1402 #renderer => 'RA.ux.App.someJsFunc',
1403 #profiles => [],
1404 },
1405 create_ts => {
1406 header => 'Created',
1407 #width => 100,
1408 #renderer => 'RA.ux.App.someJsFunc',
1409 #profiles => [],
1410 },
1411 expire_ts => {
1412 header => 'Expires at',
1413 #width => 100,
1414 #renderer => 'RA.ux.App.someJsFunc',
1415 #profiles => [],
1416 },
1417 user_id => {
1418 header => 'user_id',
1419 #width => 100,
1420 #renderer => 'RA.ux.App.someJsFunc',
1421 profiles => ['hidden'],
1422 },
1423 auth_key => {
1424 header => 'Auth Key',
1425 width => 250,
1426 #renderer => 'RA.ux.App.someJsFunc',
1427 #profiles => [],
1428 },
1429 json_data => {
1430 header => 'JSON Data',
1431 width => 300,
1432 hidden => 1,
1433 profiles => ['monotext'],
1434 #renderer => 'RA.ux.App.someJsFunc',
1435 #profiles => [],
1436 },
1437 user => {
1438 header => 'User',
1439 #width => 100,
1440 #renderer => 'RA.ux.App.someJsFunc',
1441 #profiles => [],
1442 },
1443 preauth_action_events => {
1444 header => 'Events',
1445 #width => 100,
1446 #sortable => 1,
1447 #renderer => 'RA.ux.App.someJsFunc',
1448 #profiles => [],
1449 },
1450 },
1451 },
1452 PreauthActionType => {
1453 display_column => 'name',
1454 title => 'Pre-Auth Type',
1455 title_multi => 'Pre-Auth Types',
1456 iconCls => 'icon-preauth-action-type',
1457 multiIconCls => 'icon-preauth-action-types',
1458 columns => {
1459 name => {
1460 header => 'Name',
1461 width => 150,
1462 #renderer => 'RA.ux.App.someJsFunc',
1463 #profiles => [],
1464 },
1465 description => {
1466 header => 'Description',
1467 width => 300,
1468 #renderer => 'RA.ux.App.someJsFunc',
1469 #profiles => [],
1470 },
1471 preauth_actions => {
1472 header => 'Pre Authorizations',
1473 #width => 100,
1474 #sortable => 1,
1475 #renderer => 'RA.ux.App.someJsFunc',
1476 #profiles => [],
1477 },
1478 },
1479 },
1480 PreauthActionEvent => {
1481 display_column => 'id',
1482 title => 'Pre-Auth Event',
1483 title_multi => 'Pre-Auth Events',
1484 iconCls => 'icon-preauth-event',
1485 multiIconCls => 'icon-preauth-events',
1486 columns => {
1487 id => {
1488 allow_add => 0,
1489 header => 'Id',
1490 width => 55,
1491 #renderer => 'RA.ux.App.someJsFunc',
1492 #profiles => [],
1493 },
1494 ts => {
1495 header => 'Timestamp',
1496 #width => 100,
1497 #renderer => 'RA.ux.App.someJsFunc',
1498 #profiles => [],
1499 },
1500 type_id => {
1501 header => 'type_id',
1502 #width => 100,
1503 #renderer => 'RA.ux.App.someJsFunc',
1504 profiles => ['hidden'],
1505 },
1506 action_id => {
1507 header => 'action_id',
1508 #width => 100,
1509 #renderer => 'RA.ux.App.someJsFunc',
1510 profiles => ['hidden'],
1511 },
1512 hit_id => {
1513 header => 'hit_id',
1514 #width => 100,
1515 #renderer => 'RA.ux.App.someJsFunc',
1516 profiles => ['hidden'],
1517 },
1518 info => {
1519 header => 'Info',
1520 width => 380,
1521 profiles => ['monotext']
1522 #renderer => 'RA.ux.App.someJsFunc',
1523 #profiles => [],
1524 },
1525 action => {
1526 header => 'Action',
1527 #width => 100,
1528 #renderer => 'RA.ux.App.someJsFunc',
1529 #profiles => [],
1530 },
1531 hit => {
1532 header => 'Hit',
1533 #width => 100,
1534 #renderer => 'RA.ux.App.someJsFunc',
1535 #profiles => [],
1536 },
1537 type => {
1538 header => 'Event Type',
1539 width => 120,
1540 #renderer => 'RA.ux.App.someJsFunc',
1541 #profiles => [],
1542 },
1543 },
1544 },
1545 PreauthEventType => {
1546 display_column => 'name',
1547 title => 'Pre-Auth Event Type',
1548 title_multi => 'Pre-Auth Event Types',
1549 iconCls => 'icon-preauth-event-type',
1550 multiIconCls => 'icon-preauth-event-types',
1551 columns => {
1552 id => {
1553 allow_add => 0,
1554 header => 'Id',
1555 width => 40,
1556 hidden => 1
1557 #renderer => 'RA.ux.App.someJsFunc',
1558 #profiles => [],
1559 },
1560 name => {
1561 header => 'Name',
1562 #width => 100,
1563 #renderer => 'RA.ux.App.someJsFunc',
1564 #profiles => [],
1565 },
1566 description => {
1567 header => 'Description',
1568 width => 380,
1569 #renderer => 'RA.ux.App.someJsFunc',
1570 #profiles => [],
1571 },
1572 preauth_action_events => {
1573 header => 'Events',
1574 width => 160,
1575 #sortable => 1,
1576 #renderer => 'RA.ux.App.someJsFunc',
1577 #profiles => [],
1578 },
1579 },
1580 },
1581 }
1582 },
1583  
1584 );
1585  
1586 =head1 NAME
1587  
1588 Rapi::Blog::Model::DB - Catalyst/RapidApp DBIC Schema Model
1589  
1590 =head1 SYNOPSIS
1591  
1592 See L<Rapi::Blog>
1593  
1594 =head1 DESCRIPTION
1595  
1596 L<Catalyst::Model::DBIC::Schema> Model using schema L<Rapi::Blog::DB>
1597  
1598 =head1 GENERATED BY
1599  
1600 Catalyst::Helper::Model::DBIC::Schema::ForRapidDbic - 0.65
1601  
1602 =head1 AUTHOR
1603  
1604 root
1605  
1606 =head1 LICENSE
1607  
1608 This library is free software, you can redistribute it and/or modify
1609 it under the same terms as Perl itself.
1610  
1611 =cut
1612  
1613 1;