NAME

hxjs_make_project.pl - create a project to generate the Perl side of a HeliosX::JSService-based service

SYNOPSIS

# create all the Perl boilerplate for a HeliosX::JSService class
# allowing the developer to focus on JavaScript code
hxjs_make_project.pl --conf=service_desc.xml

# just prints version info
hxjs_make_project.pl --version

DESCRIPTION

Rather than leave the JavaScript developer to figure out the complexities of Perl, Makefiles, and, ExtUtils::MakeMaker on their own, hxjs_make_project.pl can be used to setup all of the Perl side of a HeliosX::JSService-based Helios service, allowing the JavaScript developer to focus on JavaScript code. Developers can create an XML file describing the service class they wish to make and any needed CPAN modules, then run this program to create the project and all the Perl boilerplate.

SERVICE DESCRIPTION XML

Here is an example service descriptor for a Helios::JSService called ExampleService:

 <hxjsDescription>
 	<servicename>ExampleService</servicename>
 	<jssource>example.js</jssource>
 	<PerlModules> 
		<module>DBI</module>
		<module>Solr::Client</module>
 	</PerlModules>
 	<bindVariables>
 		<object>
			<jsvar>DBI</jsvar>
			<perlvar>DBI</perlvar>
		</object>
		<object>
			<jsvar>SolrClient</jsvar>
			<perlvar>Solr::Client</perlvar>
		</object>
 	</bindVariables>

 </hxjsDescription>

Several points: (expand on this before production!) #[]

  • The whole service description should be wrapped in a <hxjsDescription> block.

  • <servicename> is the name of the Perl class and thus, the service's name as it will appear in your Helios collective.

  • <jssource> is the name of the main JavaScript source file for your service

  • The <PerlModules> section lists the name of all of the Perl modules your JavaScript service will need access to. The generated Perl will load the modules listed here for you.

  • The <bindVariables> section lists the Perl-side variables that your JavaScript code will need access to. #[] woefully inadequate documentation here!

FUNCTIONS

parseArgs()

parseServiceConfig()

parseTemplates

createModuleStub(SERVICENAME => $servicename, SCRIPTNAME => $scriptname)

createCJSC

createMakeMakerProject($servicename)

writeModuleStub

writeJSStub

AUTHOR

Andrew Johnson, <lajandy at cpan dot org>

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Andrew Johnson

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.