JSAN::Index::Library - A JavaScript Archive Network (JSAN) Software Library
This class provides objects for the various libraries (software components) in the JSAN.
In addition to the general methods provided by ORLite, it has the following methods
The name accessor returns the name (possibly including the use of pseudo-namespaces) of the library. e.g. "Test.Simple.Container.Browser"
name
The release method returns the JSAN::Index::Release object for the release that the library is defined in.
release
The version accessor returns the version of the library.
version
The doc accessor returns the root-relative location of the documentation for this library on the http://openjsan.org/ website.
doc
The distribution method is a shortcut for $library->release->distribution and returns the JSAN::Index::Distribution for the distribution that this library is of.
distribution
$library->release->distribution
The extract_libs method will extract the libraries for a release (i.e. the contents of the lib directory> to the local filesystem.
extract_libs
lib
It takes named parameters to control its behaviour.
The to parameter specifies the destination for the files to be extracted to. When passed as a single string, this is taken to be a directory on the local host.
to
No other destination options other than the local filesystem are available at this time, but more destination options are expected at a later date.
Returns the number of files extracted, or dies on error.
The extract_tests method will extract the test scripts for a release (i.e. the contents of the tests directory> to the local filesystem.
extract_tests
tests
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=JSAN-Client
For other issues, contact the author.
Adam Kennedy <adamk@cpan.org>
JSAN::Index, JSAN::Shell, http://openjsan.org
Copyright 2005 - 2007 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
JSAN::Index::Library - JSAN::Index class for the library table
TO BE COMPLETED
# Get all objects in list context my @list = JSAN::Index::Library->select; # Get a subset of objects in scalar context my $array_ref = JSAN::Index::Library->select( 'where name > ? order by name', 1000, );
The select method executes a typical SQL SELECT query on the library table.
select
SELECT
It takes an optional argument of a SQL phrase to be added after the FROM library section of the query, followed by variables to be bound to the placeholders in the SQL phrase. Any SQL that is compatible with SQLite can be used in the parameter.
FROM library
Returns a list of JSAN::Index::Library objects when called in list context, or a reference to an ARRAY of JSAN::Index::Library objects when called in scalar context.
ARRAY
Throws an exception on error, typically directly from the DBI layer.
# How many objects are in the table my $rows = JSAN::Index::Library->count; # How many objects my $small = JSAN::Index::Library->count( 'where name > ?', 1000, );
The count method executes a SELECT COUNT(*) query on the library table.
count
SELECT COUNT(*)
Returns the number of objects that match the condition.
if ( $object->name ) { print "Object has been inserted\n"; } else { print "Object has not been inserted\n"; }
Returns true, or throws an exception on error.
REMAINING ACCESSORS TO BE COMPLETED
The library table was originally created with the following SQL command.
CREATE TABLE library ( name varchar ( 100 ) NOT NULL, distribution varchar ( 100 ) NOT NULL, release int ( 11 ) NOT NULL, version varchar ( 100 ) , doc varchar ( 100 ) NOT NULL, PRIMARY KEY ( name ) )
JSAN::Index::Library is part of the JSAN::Index API.
See the documentation for JSAN::Index for more information.
Copyright 2009 - 2010 Adam Kennedy.
To install JSAN::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSAN::Client
CPAN shell
perl -MCPAN -e shell install JSAN::Client
For more information on module installation, please visit the detailed CPAN module installation guide.