DBIx-HTML-LinkedMenus

 view release on metacpan or  search on metacpan

Changelog.ini  view on Meta::CPAN

[Module]
Name=DBIx::HTML::LinkedMenus
Changelog.Creator=Module::Metadata::Changes V 2.12
Changelog.Parser=Config::IniFiles V 3.000003

[V 1.11]
Date=2021-02-04T17:08:00
Comments= <<EOT
- Adopt new repo structure. See
http://savage.net.au/Ron/html/My.Workflow.for.Building.Distros.html.
- Reformat Makefile.PL.
- Change license from artistic_2 to perl.

Changes  view on Meta::CPAN

Revision history for Perl extension DBIx::HTML::LinkedMenus.

1.11  2021-02-04T17:08:00
	- Adopt new repo structure. See
		http://savage.net.au/Ron/html/My.Workflow.for.Building.Distros.html.
	- Reformat Makefile.PL.
	- Change license from artistic_2 to perl.
	- Add t/00.*.
	- Update Makefile.PL and POD to change RT to github.

1.10  Sun Feb 21 12:54:58 2010

MANIFEST  view on Meta::CPAN

Changelog.ini
Changes
examples/bootstrap-menus.pl
examples/test-linked-menus.cgi
lib/DBIx/HTML/LinkedMenus.pm
LICENSE
Makefile.PL
MANIFEST			This list of files
MANIFEST.SKIP
README
t/00.versions.t
t/00.versions.tx
t/test.t
xt/author/pod.t
META.yml                                 Module YAML meta-data (added by MakeMaker)

MANIFEST.SKIP  view on Meta::CPAN

#   Mac OSX SMB mount metadata files
\B\._

# Avoid UltraEdit files.
\.prj$
\.pui$

^MYMETA.yml$
^MYMETA\.json$

^DBIx-HTML-LinkedMenus-.*

META.json  view on Meta::CPAN

   ],
   "dynamic_config" : 1,
   "generated_by" : "ExtUtils::MakeMaker version 7.58, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "DBIx-HTML-LinkedMenus",
   "no_index" : {
      "directory" : [
         "t",
         "inc"
      ]
   },
   "prereqs" : {
      "build" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"

META.json  view on Meta::CPAN

      "test" : {
         "requires" : {
            "Test::More" : "1.001014",
            "Test::Pod" : "1.48"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/ronsavage/DBIx-HTML-LinkedMenus/issues"
      },
      "license" : [
         "http://opensource.org/licenses/Perl"
      ],
      "repository" : {
         "type" : "git",
         "url" : "https://github.com/ronsavage/DBIx-HTML-LinkedMenus.git",
         "web" : "https://github.com/ronsavage/DBIx-HTML-LinkedMenus"
      }
   },
   "version" : "1.11",
   "x_serialization_backend" : "JSON::PP version 4.02"
}

META.yml  view on Meta::CPAN

  Test::More: '1.001014'
  Test::Pod: '1.48'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.58, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: DBIx-HTML-LinkedMenus
no_index:
  directory:
    - t
    - inc
requires:
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://github.com/ronsavage/DBIx-HTML-LinkedMenus/issues
  license: http://opensource.org/licenses/Perl
  repository: https://github.com/ronsavage/DBIx-HTML-LinkedMenus.git
version: '1.11'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Makefile.PL  view on Meta::CPAN


my(%params) =
(
	($] ge '5.005') ?
	(
		'AUTHOR'	=> 'Ron Savage (ron@savage.net.au)',
		'ABSTRACT'	=> 'Convert SQL to 2 linked HTML popup menus',
    ) : (),
	clean =>
	{
		FILES => 'blib/* Makefile MANIFEST DBIx-HTML-LinkedMenus-*'
	},
	dist =>
	{
		COMPRESS	=> 'gzip',
		SUFFIX		=> 'gz'
	},
	DISTNAME	=> 'DBIx-HTML-LinkedMenus',
	LICENSE		=> 'perl',
	NAME		=> 'DBIx::HTML::LinkedMenus',
	PL_FILES	=> {},
	PREREQ_PM	=>
	{
		'strict'	=> 0,
		'warnings'	=> 0,
	},
	TEST_REQUIRES =>
	{
		'Test::More'	=> 1.001014,
		'Test::Pod'		=> 1.48,
	},
	VERSION_FROM	=> 'lib/DBIx/HTML/LinkedMenus.pm',
	INSTALLDIRS		=> 'site',
	EXE_FILES		=> [],
);

if ( ($ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/) && ($ExtUtils::MakeMaker::VERSION > 6.30) )
{
	$params{LICENSE} = 'perl';
}

if ($ExtUtils::MakeMaker::VERSION ge '6.46')

Makefile.PL  view on Meta::CPAN

	$params{META_MERGE} =
	{
		'meta-spec' =>
		{
			version => 2,
		},
		resources   =>
		{
			bugtracker =>
			{
				web => 'https://github.com/ronsavage/DBIx-HTML-LinkedMenus/issues',
			},
			license		=> 'http://opensource.org/licenses/Perl',
			repository	=>
			{
				type	=> 'git',
				url		=> 'https://github.com/ronsavage/DBIx-HTML-LinkedMenus.git',
				web		=> 'https://github.com/ronsavage/DBIx-HTML-LinkedMenus',
			},
		},
	};
}

WriteMakefile(%params);

README  view on Meta::CPAN

README file for DBIx::HTML::LinkedMenus.

See also Changes.txt.

Warning: WinZip 8.1 and 9.0 both contain an 'accidental' bug which stops
them recognizing POSIX-style directory structures in valid tar files.
You are better off using a reliable tool such as InfoZip:
ftp://ftp.info-zip.org/pub/infozip/

1 Installing from a Unix-like distro
------------------------------------
shell>gunzip DBIx-HTML-LinkedMenus-1.06.tgz
shell>tar mxvf DBIx-HTML-LinkedMenus-1.06.tar

On Unix-like systems, assuming you have installed Module::Build V 0.25+:

shell>perl Build.PL
shell>./Build
shell>./Build test
shell>./Build install

On MS Windows-like systems, assuming you have installed Module::Build V 0.25+:

README  view on Meta::CPAN


shell>perl Makefile.PL
shell>make
shell>make test
shell>su              (for Unix-like systems)
shell>make install
shell>exit            (for Unix-like systems)

On all systems:

Run LinkedMenus.pm through you favourite pod2html translator.

If you are using my fancy-pom2.pl, with its 'default.css' file installed in
/apache2/htdocs/css/, you'd do:

shell>perl fancy-pom2.pl html -css LinkedMenus.pm > /apache2/htdocs/LinkedMenus.html

or perhaps something like:

shell>perl fancy-pom2.pl html -css LinkedMenus.pm > /perl/html/site/lib/DBIx/HTML/LinkedMenus.html

2 Installing from an ActiveState distro
---------------------------------------
shell>unzip DBIx-HTML-LinkedMenus-1.06.zip
shell>ppm install --location=. DBIx-HTML-LinkedMenus
shell>del DBIx-HTML-LinkedMenus-1.06.ppd
shell>del PPM-DBIx-HTML-LinkedMenus-1.06.tar.gz

examples/test-linked-menus.cgi  view on Meta::CPAN

#!/usr/bin/perl
#
# Name:
#	test-linked-menus.cgi.

use strict;
use warnings;

use CGI;
use DBI;
use DBIx::HTML::LinkedMenus;
use Error qw/ :try /;

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

my($caption)		= 'Test DBIx::HTML::LinkedMenus';
my($q)				= CGI -> new();
my($form_name)		= 'my_form';
my($base_name)		= 'base';	# Default: 'dbix_base_menu'.
my($linked_name)	= 'linker';	# Default: 'dbix_linked_menu'.
my($base_id)		= $q -> param($base_name)	|| undef;
my($link_id)		= $q -> param($linked_name)	|| undef;

my(@on_load, @html);

try

examples/test-linked-menus.cgi  view on Meta::CPAN

		'pass',
		{
			AutoCommit			=> 1,
			HandleError			=> sub {Error::Simple -> record($_[0]); 0},
			PrintError			=> 0,
			RaiseError			=> 1,
			ShowErrorStatement	=> 1,
		}
	);

	my($linker) = DBIx::HTML::LinkedMenus -> new
	(
		base_menu_name		=> $base_name,
		base_prompt			=> 'Please select an item from both menus',
		base_value			=> 0,
		linked_menu_name	=> $linked_name,
		linked_prompt		=> 'Please select 2 items',
		linked_value		=> 0,
		dbh					=> $dbh,
		form_name			=> $form_name,
		base_sql			=> 'select campus_id, campus_name, campus_id from campus order by campus_name',

lib/DBIx/HTML/LinkedMenus.pm  view on Meta::CPAN

package DBIx::HTML::LinkedMenus;

use strict;
use warnings;

our $VERSION = '1.11';

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

# Encapsulated class data.

lib/DBIx/HTML/LinkedMenus.pm  view on Meta::CPAN

}	# End of size.

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

1;

__END__

=head1 NAME

C<DBIx::HTML::LinkedMenus> - Convert SQL to 2 linked HTML popup menus.

=head1 Synopsis

	use DBIx::HTML::LinkedMenus;

	my($linker) = DBIx::HTML::LinkedMenus -> new
	(
		dbh        => $dbh,
		base_sql   => 'select campus_id, campus_name, campus_id ' .
						'from campus order by campus_name',
		linked_sql => 'select unit_id, unit_code from unit where ' .
						'unit_campus_id = ? order by unit_code',
	);

	# Print as part of a form:

lib/DBIx/HTML/LinkedMenus.pm  view on Meta::CPAN

	print $linker -> javascript_for_db();
	print $linker -> html_for_base_menu();
	print $linker -> html_for_linked_menu();
	print $linker -> javascript_for_init_menu(); # Either this...
	print $q -> end_form();

	# Alternately, print as part of a page:

	my(@on_load) = $linker -> javascript_for_on_load(); # Or these 2...

	print $q -> start_html({title => 'Linked Menus', @on_load}),
	print $q -> start_form...
	print $linker -> javascript_for_db();
	print $linker -> html_for_base_menu();
	print $linker -> html_for_linked_menu();
	print $q -> end_form();

=head1 Description

This module's constructor takes a db handle and 2 SQL statements, and executes the SQL.

lib/DBIx/HTML/LinkedMenus.pm  view on Meta::CPAN

=head1 Usage

You create an object of the class by calling the constructor, 'new'.

Now call four (4) methods to get the HTML and the JavaScript.

Lastly, display the HTML and JavaScript as part of a form.

=head1 Constructor and initialization

C<new(...)> returns a C<DBIx::HTML::LinkedMenus> object.

Here, in alphabetical order, are the parameters accepted by the constructor,
together with their default values.

=over 4

=item base_menu_name => 'dbix_base_menu'

This parameter is optional, since it has a default value.

lib/DBIx/HTML/LinkedMenus.pm  view on Meta::CPAN

modules, so don't be too keen on changing it :-).

=head1 See Also

	CGI::Explorer
	DBIx::HTML::ClientDB
	DBIx::HTML::PopupRadio

=head1 Repository

L<https://github.com/ronsavage/DBIx-HTML-LinkedMenus>

=head1 Support

Bugs should be reported via the CPAN bug tracker at

L<https://github.com/ronsavage/DBIx-HTML-LinkedMenus/issues>

=head1 Author

C<DBIx::HTML::LinkedMenus> was written by Ron Savage I<E<lt>ron@savage.net.auE<gt>> in 2002.

Home page: http://savage.net.au/index.html

=head1 Copyright

Australian copyright (c) 2002, Ron Savage.
	All Programs of mine are 'OSI Certified Open Source Software';
	you can redistribute them and/or modify them under the terms of
	The Artistic License, a copy of which is available at:
	http://www.opensource.org/licenses/index.html

t/00.versions.t  view on Meta::CPAN

#/usr/bin/env perl

use strict;
use warnings;

# I tried 'require'-ing modules but that did not work.

use DBIx::HTML::LinkedMenus; # For the version #.

use Test::More;

use strict;
use warnings;

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

pass('All external modules loaded');

my(@modules) = qw
/
	strict
	warnings
/;

diag "Testing DBIx::HTML::LinkedMenus V $DBIx::HTML::LinkedMenus::VERSION";

for my $module (@modules)
{
	no strict 'refs';

	my($ver) = ${$module . '::VERSION'} || 'N/A';

	diag "Using $module V $ver";
}

t/test.t  view on Meta::CPAN

use Test::More tests => 1;

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

BEGIN{ use_ok('DBIx::HTML::LinkedMenus'); }



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