checking in... see diffs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 21:46:04 +0000 (21:46 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 21:46:04 +0000 (21:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1559 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
Open-ILS/src/templates/marc/book.xml
OpenSRF/bin/opensrf_ctl

index c11796c..7ed7bfd 100644 (file)
@@ -33,31 +33,30 @@ __PACKAGE__->register_method(
 
 sub retrieve_marc_template {
        my( $self, $client, $type ) = @_;
+
+       return $marctemplates{$type} if defined($marctemplates{$type});
+
        my $xml = _load_marc_template($type);
+
        my $nodes = OpenILS::Utils::FlatXML->new()->xml_to_nodeset( $xml ); 
-       return $utils->nodeset2tree( $nodes->nodeset );
+       $marctemplates{$type} = $utils->nodeset2tree( $nodes->nodeset );
+       return $marctemplates{$type};
 }
 
 sub _load_marc_template {
        my $type = shift;
 
-       if(!defined( $marctemplates{$type} )) {
-               if(!$conf) { $conf = OpenSRF::Utils::SettingsClient->new; }
+       if(!$conf) { $conf = OpenSRF::Utils::SettingsClient->new; }
 
-               my $template = $conf->config_value(                                     
-                       "apps", "open-ils.cat","app_settings", "marctemplates", $type );
-               warn "Opening template file $template\n";
+       my $template = $conf->config_value(                                     
+               "apps", "open-ils.cat","app_settings", "marctemplates", $type );
+       warn "Opening template file $template\n";
 
-               open( F, $template );
-               my @xml = <F>;
-               close(F);
-               $marctemplates{$type} = join('', @xml);
+       open( F, $template );
+       my @xml = <F>;
+       close(F);
+       return join('', @xml);
 
-       }
-
-       warn "Loaded MARC template XML:\n" . $marctemplates{$type} . "\n";
-
-       return $marctemplates{$type};
 }
 
 
index 4064781..a1cd172 100644 (file)
@@ -1,2 +1,2 @@
-<record xmlns="http://www.loc.gov/MARC21/slim"><leader>00881nam a2200193   4500</leader><controlfield tag="001"> </controlfield><controlfield tag="005">19970610140737.0</controlfield><controlfield tag="008">                                        </controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a"> </subfield><subfield code="c"> </subfield></datafield><datafield tag="082" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">,</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a"> </subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">p. :</subfield></datafield><datafield tag="650" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="700" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield></record>
+<record xmlns="http://www.loc.gov/MARC21/slim"><leader>00881nam a2200193   4500</leader><controlfield tag="001"> </controlfield><controlfield tag="005">19970610140737.0</controlfield><controlfield tag="008">                                        </controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="082" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">,</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a"> </subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">p. :</subfield></datafield><datafield tag="650" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield><datafield tag="700" ind1=" " ind2=" "><subfield code="a"> </subfield></datafield></record>
 
index 39a45b8..5449094 100755 (executable)
@@ -32,7 +32,7 @@ function startSystem {
        
                "stop")
                        PID=$(ps ax | grep "[0-9] System$" | awk '{print $1}');
-                       if [ -z $PID ]; then
+                       if [ -z "$PID" ]; then
                                echo "OpenSRF System is not running";
                                exit;
                        fi
@@ -43,7 +43,7 @@ function startSystem {
        
                "status")
                        PID=$(ps ax | grep "[0-9] System$" | awk '{print $1}');
-                       if [ -z $PID ]; then
+                       if [ -z "$PID" ]; then
                                echo "OpenSRF System is not running";
                                exit 0;
                        fi