From: Bill Erickson Date: Wed, 7 May 2014 14:25:49 +0000 (-0400) Subject: build docs cont. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b8120d593c760972e37eb867546e7312e696e2a1;p=working%2FEvergreen.git build docs cont. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/README.install b/Open-ILS/web/js/ui/default/staff/README.install index 064ffabbad..bc299d8224 100644 --- a/Open-ILS/web/js/ui/default/staff/README.install +++ b/Open-ILS/web/js/ui/default/staff/README.install @@ -7,6 +7,11 @@ === Install Node.js === +http://gruntjs.com/[Grunt] and http://jasmine.github.io/[Jasmine] (and +related bits) allow us to retrieve JS dependencies, run unit tests, and +concatenate + minify JS files on the server. They are both Node.js +plugins. + Node.js does not have have Debian Wheezy build target. For now, I've opted to install from source. For more, see also https://github.com/joyent/node/wiki/installation[Node.js Installation] @@ -37,7 +42,7 @@ The remaining steps all take place within the staff JS web root: [source,sh] ------------------------------------------------------------------------------ -% cd Open-ILS/web/js/ui/default/staff/ +% cd $EVERGREEN_ROOT/Open-ILS/web/js/ui/default/staff/ ------------------------------------------------------------------------------ === Install Project-local Dependencies === @@ -52,13 +57,13 @@ from the Node package network. === Generate test IDL2js Output === -Unit tests require mock data. The IDL is needed for practically all tests, -so there's a script to generate IDL2js output from the in-repo IDL. +Unit tests require mock data. Some data is provided as static content, +but the IDL JS is generated from the in-repo fm_IDL.xml file via a script: [source,sh] ------------------------------------------------------------------------------ % cd test/data -% ./translate_idl2js.pl +% ./idl2js.pl % cd ../../ ------------------------------------------------------------------------------ diff --git a/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl b/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl new file mode 100755 index 0000000000..fbf998fdbb --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/test/data/idl2js.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl +use strict; use warnings; +use XML::LibXML; +use XML::LibXSLT; +my $out_file = 'IDL2js.js'; +my $idl_file = '../../../../../../../examples/fm_IDL.xml'; +my $xsl_file = '/openils/var/xsl/fm_IDL2js.xsl'; # FIXME: hard-coded path + +my $xslt = XML::LibXSLT->new(); +my $style_doc = XML::LibXML->load_xml(location => $xsl_file, no_cdata=>1); +my $stylesheet = $xslt->parse_stylesheet($style_doc); +my $idl_doc = XML::LibXML->load_xml(location => $idl_file); +my $results = $stylesheet->transform($idl_doc); +my $output = $stylesheet->output_as_bytes($results); + +open(IDL, ">$out_file") or die "Cannot open IDL2js file $out_file : $!\n"; + +print IDL $output; + +close(IDL); + + diff --git a/Open-ILS/web/js/ui/default/staff/test/data/translate_idl2js.pl b/Open-ILS/web/js/ui/default/staff/test/data/translate_idl2js.pl deleted file mode 100755 index fbf998fdbb..0000000000 --- a/Open-ILS/web/js/ui/default/staff/test/data/translate_idl2js.pl +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/perl -use strict; use warnings; -use XML::LibXML; -use XML::LibXSLT; -my $out_file = 'IDL2js.js'; -my $idl_file = '../../../../../../../examples/fm_IDL.xml'; -my $xsl_file = '/openils/var/xsl/fm_IDL2js.xsl'; # FIXME: hard-coded path - -my $xslt = XML::LibXSLT->new(); -my $style_doc = XML::LibXML->load_xml(location => $xsl_file, no_cdata=>1); -my $stylesheet = $xslt->parse_stylesheet($style_doc); -my $idl_doc = XML::LibXML->load_xml(location => $idl_file); -my $results = $stylesheet->transform($idl_doc); -my $output = $stylesheet->output_as_bytes($results); - -open(IDL, ">$out_file") or die "Cannot open IDL2js file $out_file : $!\n"; - -print IDL $output; - -close(IDL); - -