Bigtop
view release on metacpan or search on metacpan
lib/Bigtop/Docs/TentRef.pod view on Meta::CPAN
dependent on an engine. Some of those choices are in controller code
you wrote by hand, but others are in the backend statements (see below).
That's really all there is to see here (aside from seeing the raw
bigtop source).
=head1 App Body
The heart of tentmaker is the App Body tab. If you have a single table
called address and a controller to go with it, should look like this:
=for html <img src='http://www.usegantry.org/images/tenttut/appbody.png' alt='tentmaker app body screen' />
http://www.usegantry.org/images/tenttut/appbody.png
The tutorial shows off some of the features on the tab. Here we will
take a more systematic approach.
In addition to having tentmaker create or augment the bigtop file during
startup, you can create things within the app body tab. You may make any
of these things in the app body: a table (which also makes its controller),
a controller, a literal, a join table, and a sequence (which also makes
its table and controller).
Once you have the App Body elements, tentmaker makes it easy to customize
them. Here's how.
=over 4
=item Table
An SQL table, these are the heart of an app. If you make one, tentmaker
will make a controller to go with it. Once you have a table, click
'edit' next to the Table label. It will expand to look something like this:
=for html <img src='http://www.usegantry.org/images/tenttut/tableedit.png' alt='tentmaker table expanded for editing' />
http://www.usegantry.org/images/tenttut/tableedit.png
There are five statements which affect a whole table:
=over 4
=item not_for
Should you need to hide this table from your Model or SQL backend (or both),
select from the list. Indicated backends will pass over this table
as if it were not in the bigtop file.
We use this occasionally when we want to build models for our auth tables
within the app, but actually point to an external database for the data.
Then, we select not_for SQL.
=item foreign_display
This controls two things: the sort order of items from this table in its
controller's do_main method and the appearance of rows from this table when
other tables' controllers refer to them. Suppose your table stores data
about people and you want foreign tables to summarize rows with the names
of the people. You could use this foreign_display: C<%last, %first>.
Anything abutted to the left of a percent sign must be a column in the
table. Anything else is taken literally.
=item refered_to_by
If other tables have foreign keys to this table, list them here. Doing
so earns you a has_many relationship, if you use DBIx::Class as your ORM.
The has many name is optional and defaults to the name of the other table
with an 's' appended.
=item model_base_class
Most table models inherit from the default base class prefered by their
backend. In the backend block, you can change that default for all the
tables in the app. Sometimes one table needs a special parent. This
statement allows you to pick such a parent on a table by table basis.
=item sequence
If you use sequences to generate your primary keys in PostgreSQL, fill in
the sequence name here. You should get a good value by default, if you
created the sequence with tentmaker.
=back
Below the statements which apply to the whole table is the Field Quick Edit
table which was featured so heavily in the tutorial. It looks like this:
=for html <img src='http://www.usegantry.org/images/tenttut/quickedit.png' alt='tentmaker quick edit field' />
http://www.usegantry.org/images/tenttut/quickedit.png
There are seven columns in the quick edit table (you'll probably have to
use horizontal scrolling to see them all):
=over 4
=item Column Name
The name of the column in the database table, but also the name of the input
element when the field appears on an add/edit form.
Changing the name of the field will change all references to it in other
parts of the bigtop file.
=item SQL Type
The type of the column in SQL. In the quick edit box you may only supply
one type phrase. In the full edit table, you may include as many phrases
as you like.
If you change the type to date, tentmaker will do all the needed work to
make a popup calendar for easy date selection.
Note that int4 and varchar are magical. Each database backend does something
reasonable to turn these into integers and strings respectively. All other
types are taken literally and must be understood by the database you
actually use.
=item Label
( run in 1.650 second using v1.01-cache-2.11-cpan-c221a9de4ec )