CGI-Application-Bouquet-Rose

 view release on metacpan or  search on metacpan

bin/cgi.app.gen.pl  view on Meta::CPAN

=item -module A module name, e.g. Local::Wine

Generate a set of modules under this name. So, Local::Wine would result in:

=over 4

=item ./lib/Local/Wine/CGIApp.pm

=item ./lib/Local/Wine/Dispatcher.pm

=item ./lib/Local/Wine/MainMenu.pm

=item ./lib/Local/Wine/CGIApp/*.pm (1 per table)

=back

This option defaults to 'Local::Wine', because the CGI::Application::Bouquet::Rose distro
uses the Local::Wine distro in all its documentation. See examples/Local-Wine-1.06.tgz.

This option is mandatory.

lib/CGI/Application/Bouquet/Rose.pm  view on Meta::CPAN

	$template			= HTML::Template -> new(filename => File::Spec -> catfile($self -> tmpl_path, 'dispatcher.pm.tmpl') );

	$template -> param(prefix => $self -> prefix);

	$self -> log("Creating $output_file_name");

	open(OUT, "> $output_file_name") || die "Can't open(> $output_file_name):$ !";
	print OUT $template -> output();
	close OUT;

	# Process: CGI/MainMenu.pm.

	$output_file_name	= File::Spec -> catfile($self -> dir_name, 'MainMenu.pm');
	$template			= HTML::Template -> new(filename => File::Spec -> catfile($self -> tmpl_path, 'main.menu.pm.tmpl') );

	$template -> param(prefix => $self -> prefix);

	$self -> log("Creating $output_file_name");

	open(OUT, "> $output_file_name") || die "Can't open(> $output_file_name):$ !";
	print OUT $template -> output();
	close OUT;

lib/CGI/Application/Bouquet/Rose.pm  view on Meta::CPAN

	Creating htdocs/assets/templates/local/wine
	Copying htdocs/assets/templates/local/wine/content.tmpl
	Copying htdocs/assets/templates/local/wine/main.menu.tmpl
	Copying htdocs/assets/templates/local/wine/search.form.tmpl
	Copying htdocs/assets/templates/local/wine/web.page.tmpl
	Creating htdocs/search
	Creating htdocs/search/wine.fcgi
	Creating lib/Local/Wine/CGI
	Creating lib/Local/Wine/CGI/CGIApp.pm
	Creating lib/Local/Wine/CGI/Dispatcher.pm
	Creating lib/Local/Wine/CGI/MainMenu.pm
	Creating lib/Local/Wine/CGI/CGIApp
	Success

	Step 5: Run the fourth code generator:
	shell> perl -Ilib scripts/run.cgi.pl

	Step 6: This is the log from run.cgi.pl:
	Processing CGI::Application-based modules:
	Updating htdocs/assets/templates/local/wine/main.menu.tmpl
	Generated lib/Local/Wine/CGI/CGIApp/Grape.pm

templates/main.menu.pm.tmpl  view on Meta::CPAN

package <tmpl_var name=prefix>::MainMenu;

use base '<tmpl_var name=prefix>::CGIApp';
use strict;
use warnings;

our $VERSION = '1.00';

# -----------------------------------------------

sub cgiapp_init

templates/web.page.tmpl  view on Meta::CPAN

  <script type="text/javascript" src="<tmpl_var name=js_path>/build/element/element-beta-min.js"></script>
  <script type="text/javascript" src="<tmpl_var name=js_path>/build/datasource/datasource-beta-min.js"></script>

  <!-- Source files -->
  <script type="text/javascript" src="<tmpl_var name=js_path>/build/datatable/datatable-beta-min.js"></script>
</head>

<body>
<h3 align="center" style="{color: #80c0ff;}">Bouquet Search Engine</h3>
<tmpl_if name=main_menu>
  <h5 align="center" style="{color: #80c0ff;}"><a href="<tmpl_var name=main_menu>">Main Menu</a></h5>
</tmpl_if>
<tmpl_if name=table_name>
  <h5 align="center" style="{color: #80c0ff;}">Table: <tmpl_var name=table_name></h5>
</tmpl_if>
<tmpl_if name=results>
  <div align="center" class="yui-skin-sam"><div id="myContainer"></div></div>
  <script type="text/javascript">
	<tmpl_var name=results>
	  var myDataTable = new YAHOO.widget.DataTable("myContainer", myColumnDefs, myDataSource, oConfigs);
  </script>



( run in 1.240 second using v1.01-cache-2.11-cpan-49f99fa48dc )