config { engine MP20; template_engine TT; plugins AuthCookie; Conf Gantry { conffile `/etc/gantry.conf`; instance blogger; } HttpdConf Gantry { gantry_conf 1; } Init Std { } SQL SQLite { } SQL Postgres { } SQL MySQL { } CGI Gantry { with_server 1; flex_db 1; gantry_conf 1; } Control Gantry { dbix 1; } Model GantryDBIxClass { } SiteLook GantryDefault { } } app Apps::Blogger { config { dbconn `dbi:SQLite:dbname=app.db` => no_accessor; template_wrapper `wrapper.tt` => no_accessor; show_dev_navigation `1`; doc_rootp `/static` => no_accessor; doc_root html => no_accessor; app_name `A Blogging Space`; admin_wrapper `moxie/gantry_wrapper.tt`; root `html:html/templates:moxie:/home/tkeefer/httpd/html/gantry/moxie:/Users/tkeefer/httpd/html/gantry/moxie`; file_archive `html/archive`; identify_bin `/sw/bin/identify`; convert_bin `/sw/bin/convert`; auth_user_field `username`; auth_group_table `user_group`; auth_group_join_table `user_user_group`; auth_optional `yes`; } config prod { dbconn `dbi:mysql:dbname=blogger` => no_accessor; dbuser `blogger`; dbpass `blogger`; doc_rootp `/Apps-Blogger` => no_accessor; doc_root html => no_accessor; root `/var/www/timkeefer.com/html/Apps-Blogger:/var/www/timkeefer.com/html/Apps-Blogger/templates:/var/www/gantry/moxie`; file_archive `/var/www/timkeefer.com/html/Apps-Blogger/archive`; identify_bin `/usr/bin/identify`; convert_bin `/usr/bin/convert`; } controller is base_controller { method do_main is base_links { } method site_links is links { } method controller_config is hashref { authed_methods do_edit => ``, do_delete => ``, do_add => ``; } } table user { field id { is int4, primary_key, auto; } field username { is varchar; label Username; searchable 1; html_form_type text; } field password { is varchar; label Password; html_form_type password; } field email { is varchar; label Email; html_form_type text; html_form_optional 1; searchable 1; } field fname { is varchar; label Fname; html_form_type text; searchable 1; html_form_optional 1; } field lname { is varchar; label Lname; html_form_type text; searchable 1; html_form_optional 1; } field created { is datetime; } field modified { is datetime; } foreign_display `%username`; data username => demo, password => changeme, email => `mars@imapi.com`, fname => `Veronica`, lname => `Mars`; } controller Admin::User is AutoCRUD { controls_table user; rel_location `admin/user`; text_description user; page_link_label User; method controller_config is hashref { authed_methods do_edit => `admin`, do_delete => `admin`, do_add => `admin`, do_groups => `admin`; } method do_main is main_listing { cols username, email, lname; header_options Add; row_options Groups, Edit, Delete; order_by username; title User; livesearch 1; } method do_groups is stub { } method form is AutoCRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`, submit_and_add_another => 1; } } table user_group { field id { is int4, primary_key, auto; } field ident { is varchar; label `Group Name`; html_form_type text; } field description { is varchar; label Description; html_form_type text; html_form_optional 1; } field created { is datetime; } field modified { is datetime; } foreign_display `%ident`; data ident => `admin`, description => `my admin group`; } controller Admin::User::Group is CRUD { controls_table user_group; rel_location `admin/user/group`; text_description `user group`; page_link_label `User Group`; method do_main is main_listing { cols ident, description; header_options Add; row_options Edit, Delete; title `User Group`; } method controller_config is hashref { authed_methods do_edit => `admin`, do_delete => `admin`, do_add => `admin`; } method form is CRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`; } } join_table user_user_group { joins user => user_group; } table blog { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_type select; html_form_optional 1; html_form_options Yes => 1, No => 0; } field ident { is varchar; label Ident; html_form_type text; html_form_display_size 20; html_form_hint `unique word to pull up blog`; searchable 1; } field title { is varchar; label Title; searchable 1; html_form_type text; } field subtitle { is varchar; label Subtitle; html_form_optional 1; searchable 1; html_form_type text; } field blurb { is varchar; label Blurb; html_form_type textarea; html_form_rows 4; html_form_cols 80; searchable 1; html_form_optional 1; } field body { is varchar; label Body; html_form_rows 10; html_form_cols 80; html_form_optional 1; searchable 1; html_form_type textarea; } field section { is int4; label `Section`; refers_to `section` => id; html_form_type select; html_form_optional 1; } field comments_enabled { is int4; label `Comments`; html_form_options Yes => 1, No => 0; html_form_type select; html_form_hint `Allow Comments`; } field tagging { is varchar; label Tags; html_form_optional 1; searchable 1; html_form_type text; } field gps { is varchar; label Gps; html_form_optional 1; searchable 1; html_form_type text; } field rank { is int4; label Rank; html_form_optional 1; html_form_display_size 4; html_form_type text; } field username { is varchar; label Username; html_form_optional 1; html_form_type display; } field created { is datetime; } field modified { is datetime; } foreign_display `%title`; refered_to_by `image`; refered_to_by `attachment`; refered_to_by `comment`; data active => 1, title => `My Title`, subtitle => `My Subtitle`, blurb => `This is the blurb`, body => `This is the body`, tagging => `sample`, ident => `2007/04/mytitle`, section => 1; } controller Blog is AutoCRUD { controls_table `blog`; rel_location blog; text_description `blog`; page_link_label `Blog`; method do_main is main_listing { cols active, title, ident, section; header_options Add; livesearch 1; row_options Edit, View, Author, Image, Attachment, Comment, Delete; title `Blog`; } method controller_config is hashref { authed_methods do_edit => `admin, user`, do_delete => `admin, user`, do_add => `admin, user`; } method form is AutoCRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit Blog Entry' : 'Add Blog Entry'`, submit_and_add_another => 1; } method controller_config is hashref { authed_methods do_edit => `admin`, do_add => `admin`, do_delete => `admin`; } } table attachment { field id { is int4, primary_key, auto; } field name { is varchar; label Name; html_form_type text; } field descr { is varchar; label Description; html_form_optional 1; html_form_type text; } field file { is varchar; label File; html_form_optional 1; html_form_type file; } field file_directory { is varchar; label `File Directory`; html_form_type display; } field file_ident { is varchar; label `File Ident`; html_form_type display; } field file_name { is varchar; label `File Name`; html_form_type display; } field file_size { is int4; label `File Size`; html_form_type display; } field file_mime { is varchar; label `File Mime`; html_form_type display; } field file_suffix { is varchar; label `File Suffix`; html_form_type display; } field created { is datetime; html_form_optional 1; label Created; html_form_type display; } field modified { is datetime; } foreign_display `%name`; field blog { is int4; label `Blog`; refers_to `blog` => id; html_form_type select; } } controller Blog::Attachment is CRUD { controls_table `attachment`; rel_location `blog/attachment`; text_description `attachment`; page_link_label `Attachment`; method do_main is main_listing { cols name, descr, blog; header_options Add; row_options Edit, Delete; title `Attachment`; limit_by blog; } method controller_config is hashref { authed_methods do_edit => `admin, user`, do_delete => `admin, user`, do_add => `admin, user`; } method form is CRUD_form { all_fields_but id, modified, created; extra_keys no_cancel => 1, legend => `$self->path_info =~ /edit/i ? 'Edit Attachment' : 'Add Attachment'`, submit_and_add_another => 1, enctype => `'multipart/form-data'`; } } table comment { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_type select; html_form_optional 1; html_form_options Yes => 1, No => 0; } field blog { is int4; label `Blog`; refers_to `blog` => id; html_form_type select; } field rejected { is int4; label Rejected; html_form_type select; html_form_optional 1; html_form_options No => 0,Yes => 1; } field name { is varchar; label Name; html_form_type text; } field email { is varchar; label Email; html_form_optional 1; html_form_type text; } field url { is varchar; label Url; html_form_optional 1; html_form_type text; } field subject { is varchar; label Subject; html_form_optional 1; html_form_type text; } field body { is varchar; label Body; html_form_optional 1; html_form_type textarea; html_form_rows 10; html_form_cols 25; } field created { is datetime; html_form_optional 1; label Created; html_form_type display; } field modified { is datetime; } foreign_display `%name`; data active => 1, rejected => 0, name => `Tim`, subject => `my subject`, body => `huzzah`, blog => 1; } controller Blog::Comment is CRUD { controls_table `comment`; rel_location `blog/comment`; text_description `comment`; page_link_label `Comment`; method do_main is main_listing { cols subject, active, rejected, name, blog; header_options Add; row_options Edit, Delete; title `Comment`; # limit_by blog; } method controller_config is hashref { authed_methods do_edit => `admin, user`, do_delete => `admin, user`; } method form is CRUD_form { all_fields_but id, created, modified; extra_keys no_cancel => 1, legend => `$self->path_info =~ /edit/i ? 'Edit Comment' : 'Post a Comment'`; } } table author { field id { is int4, primary_key, auto; } field name { is varchar; label Name; html_form_type text; } field address { is varchar; label Address; html_form_optional 1; html_form_type text; } field city { is varchar; label City; html_form_optional 1; html_form_type text; } field state { is varchar; label State; html_form_optional 1; html_form_type text; } field country { is varchar; label Country; html_form_optional 1; html_form_type text; } field gps { is varchar; label Gps; html_form_optional 1; html_form_type text; } field created { is datetime; } field modified { is datetime; } foreign_display `%name`; field blog { is int4; label `Blog`; refers_to `blog` => id; html_form_type select; } data name => `Tim Keefer`, city => `Lawrence`, blog => 1; } controller Blog::Author is AutoCRUD { controls_table `author`; rel_location `blog/author`; text_description `author`; page_link_label `Author`; method do_main is main_listing { cols blog, name, address; header_options Add; row_options Edit, Delete; title `Author`; limit_by blog; } method controller_config is hashref { authed_methods do_edit => `admin, user`, do_delete => `admin, user`, do_add => `admin, user`; } method form is CRUD_form { all_fields_but id, created, modified; extra_keys no_cancel => 1, legend => `$self->path_info =~ /edit/i ? 'Edit Author' : 'Add Author'`, submit_and_add_another => 1; } } table image { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_optional 1; html_form_type select; html_form_optional 1; html_form_options Yes => 1, No => 0; } field label { is varchar; label Label; html_form_type text; } field descr { is varchar; label Descr; html_form_type text; html_form_optional 1; } field file { is varchar; label File; html_form_optional 1; html_form_type file; } field file_directory { is varchar; label `File Directory`; html_form_type display; } field file_ident { is varchar; label `File Ident`; html_form_type display; } field file_name { is varchar; label `File Name`; html_form_type display; } field file_size { is int4; label `File Size`; html_form_type display; } field file_mime { is varchar; label `File Mime`; html_form_type display; } field file_suffix { is varchar; label `File Suffix`; html_form_type display; } field created { is datetime; } field modified { is datetime; } foreign_display `%label`; field blog { is int4; label `Blog`; refers_to `blog` => id; html_form_type select; } } controller Blog::Image is CRUD { controls_table `image`; rel_location `blog/image`; text_description `image`; page_link_label `Image`; method do_main is main_listing { cols blog, label; header_options Add; row_options Edit, Delete; title `Image`; limit_by blog; } method controller_config is hashref { authed_methods do_edit => `admin, user`, do_delete => `admin, user`, do_add => `admin, user`; } method form is CRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit Image' : 'Add Image'`, submit_and_add_another => 1, no_cancel => 1, enctype => `'multipart/form-data'`; } } table link { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_optional 1; html_form_type select; html_form_optional 1; html_form_options Yes => 1, No => 0; } field label { is varchar; label Label; html_form_type text; searchable 1; } field location { is varchar; label Location; searchable 1; html_form_type text; } field score { is varchar; label Score; html_form_optional 1; html_form_type text; } field username { is varchar; label Username; html_form_type display; html_form_optional 1; } field created { is datetime; } field modified { is datetime; } foreign_display `%label`; } controller Link is AutoCRUD { controls_table `link`; rel_location link; text_description `link`; page_link_label `Link`; method do_main is main_listing { cols active, label, location; header_options Add; row_options Edit, Delete; livesearch 1; title `Link`; } method controller_config is hashref { authed_methods do_edit => `admin`, do_delete => `admin`, do_add => `admin`; } method form is AutoCRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit Link' : 'Add Link'`, submit_and_add_another => 1; } } table tag { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_optional 1; html_form_type select; html_form_optional 1; html_form_options Yes => 1, No => 0; } field label { is varchar; label Label; html_form_type text; } field rank { is int4; label Rank; html_form_optional 1; html_form_display_size 4; html_form_type text; } field created { is datetime; } field modified { is datetime; } foreign_display `%label`; } controller Tag is AutoCRUD { controls_table `tag`; rel_location tag; text_description `tag`; page_link_label `Tag`; method do_main is main_listing { cols active, label; header_options Add; row_options Edit, Delete; title `Tag`; } method form is AutoCRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit Tag' : 'Add Tag'`, submit_and_add_another => 1; } } table section { field id { is int4, primary_key, auto; } field active { is int4; label Active; html_form_optional 1; html_form_type select; html_form_options Yes => 1, No => 0; } field label { is varchar; label Label; html_form_type text; } field created { is datetime; } field modified { is datetime; } foreign_display `%label`; data active => 1, label => `default`; } controller Section is AutoCRUD { controls_table `section`; rel_location section; text_description `section`; page_link_label `Section`; method do_main is main_listing { cols active, label; header_options Add; row_options Edit, Delete; title `Section`; } method controller_config is hashref { authed_methods do_edit => `admin`, do_delete => `admin`, do_add => `admin`; } method form is AutoCRUD_form { all_fields_but id, created, modified; extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit Section' : 'Add Section'`, submit_and_add_another => 1; } } join_table link_tag { joins link => tag; } join_table blog_tag { joins blog => tag; } join_table blog_section { joins blog => section; } literal SQL `insert into user_user_group ( user, user_group ) values ( 1, 1 );`; }