]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm
moving to UNIVERSAL::require to suck in implementation modules
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Application / Storage / Publisher.pm
1 package OpenILS::Application::Storage::Publisher;
2 use base qw/OpenILS::Application::Storage/;
3 our $VERSION = 1;
4
5 use Digest::MD5 qw/md5_hex/;
6 use OpenSRF::EX qw/:try/;
7 use OpenSRF::Utils;
8 use OpenSRF::Utils::Logger qw/:level/;
9 use OpenILS::Utils::Fieldmapper;
10
11 my $log = 'OpenSRF::Utils::Logger';
12
13
14 sub register_method {
15         my $class = shift;
16         my %args = @_;
17         my %dup_args = %args;
18
19         $class = ref($class) || $class;
20
21         $args{package} ||= $class;
22         __PACKAGE__->SUPER::register_method( %args );
23
24         if (exists($dup_args{cachable}) and $dup_args{cachable}) {
25                 (my $name = $dup_args{api_name}) =~ s/^open-ils\.storage/open-ils.storage.cachable/o;
26                 if ($name ne $dup_args{api_name}) {
27                         $dup_args{real_api_name} = $dup_args{api_name};
28                         $dup_args{method} = 'cachable_wrapper';
29                         $dup_args{api_name} = $name;
30                         $dup_args{package} = __PACKAGE__;
31                         __PACKAGE__->SUPER::register_method( %dup_args );
32                 }
33         }
34 }
35
36 sub cachable_wrapper {
37         my $self = shift;
38         my $client = shift;
39         my @args = @_;
40
41         my %cache_args = (
42                 limit           => 100,
43                 offset          => 0,
44                 timeout         => 7200,
45                 cache_page_size => 1000,
46         );
47
48         my @real_args;
49         my $key_string = $self->api_name;
50         for (my $ind = 0; $ind < scalar(@args); $ind++) {
51                 if (    $args[$ind] eq 'limit' ||
52                         $args[$ind] eq 'offset' ||
53                         $args[$ind] eq 'cache_page_size' ||
54                         $args[$ind] eq 'timeout' ) {
55
56                         my $key_ind = $ind;
57                         $ind++;
58                         my $value_ind = $ind;
59                         $cache_args{$args[$key_ind]} = $args[$value_ind];
60                         $log->debug("Cache limiter value for $args[$key_ind] is $args[$value_ind]", INTERNAL);
61                         next;
62                 }
63                 $key_string .= $args[$ind];
64                 $log->debug("Partial cache key value is $args[$ind]", INTERNAL);
65                 push @real_args, $args[$ind];
66         }
67
68         my $cache_page = int($cache_args{offset} / $cache_args{cache_page_size});
69         my $cache_key;
70         {       use bytes;
71                 $cache_key = md5_hex($key_string.$cache_page);
72         }
73
74         $log->debug("Key string for cache lookup is $key_string -> $cache_key", DEBUG);
75         $log->debug("Cache page is $cache_page", DEBUG);
76
77         my $cached_res = OpenSRF::Utils::Cache->new->get_cache( $cache_key );
78         if (defined $cached_res) {
79                 $log->debug("Found ".scalar(@$cached_res)." records in the cache", INFO);
80                 $log->debug("Values from cache: ".join(', ', @$cached_res), INTERNAL);
81                 my $start = int($cache_args{offset} - ($cache_page * $cache_args{cache_page_size}));
82                 my $end = int($start + $cache_args{limit} - 1);
83                 $log->debug("Responding with values from ".$start.' to '.$end,DEBUG);
84                 $client->respond( $_ ) for ( grep { defined } @$cached_res[ $start .. $end ]);
85                 return undef;
86         }
87
88         my $method = $self->method_lookup($self->{real_api_name});
89         my @res = $method->run(@real_args);
90
91
92         $client->respond( $_ ) for ( grep { defined } @res[$cache_args{offset} .. int($cache_args{offset} + $cache_args{limit} - 1)] );
93
94         $log->debug("Saving values from ".int($cache_page * $cache_args{cache_page_size})." to ".
95                 int(($cache_page + 1) * $cache_args{cache_page_size}). "to the cache", INTERNAL);
96         try {
97                 OpenSRF::Utils::Cache->new->put_cache(
98                         $cache_key =>
99                         [@res[int($cache_page * $cache_args{cache_page_size}) .. int(($cache_page + 1) * $cache_args{cache_page_size}) ]] =>
100                         OpenSRF::Utils->interval_to_seconds( $cache_args{timeout} )
101                 );
102         } catch Error with {
103                 my $e = shift;
104                 $log->error("Cache seems to be down, $e");
105         };
106
107         return undef;
108 }
109
110 sub retrieve_node {
111         my $self = shift;
112         my $client = shift;
113         my @ids = @_;
114
115         my $cdbi = $self->{cdbi};
116
117         for my $id ( @ids ) {
118                 next unless ($id);
119
120                 my ($rec) = $cdbi->fast_fieldmapper($id);
121                 if ($self->api_name !~ /batch/o) {
122                         return $rec if ($rec);
123                 }
124                 $client->respond($rec);
125         }
126         return undef;
127 }
128
129 sub search_where {
130         my $self = shift;
131         my $client = shift;
132         my @args = @_;
133
134         my $cdbi = $self->{cdbi};
135
136         for my $obj ($cdbi->search_where(@args)) {
137                 next unless ref($obj);
138                 $client->respond( $obj->to_fieldmapper );
139         }
140         return undef;
141 }
142
143 sub search {
144         my $self = shift;
145         my $client = shift;
146         my @args = @_;
147
148         my $cdbi = $self->{cdbi};
149
150         (my $search_type = $self->api_name) =~ s/.*\.(search[^.]*).*/$1/o;
151
152         for my $obj ($cdbi->$search_type(@args)) {
153                 next unless ref($obj);
154                 $client->respond( $obj->to_fieldmapper );
155         }
156         return undef;
157 }
158
159 sub search_one_field {
160         my $self = shift;
161         my $client = shift;
162         my @args = @_;
163
164         (my $field = $self->api_name) =~ s/.*\.([^\.]+)$/$1/o;
165
166         return search( $self, $client, $field, @args );
167 }
168
169 sub old_search_one_field {
170         my $self = shift;
171         my $client = shift;
172         my @terms = @_;
173
174         (my $search_type = $self->api_name) =~ s/.*\.(search[^.]*).*/$1/o;
175         (my $col = $self->api_name) =~ s/.*\.$search_type\.([^.]+).*/$1/;
176         my $cdbi = $self->{cdbi};
177
178         my $like = 0;
179         $like = 1 if ($search_type =~ /like$/o);
180         $like = 2 if ($search_type =~ /fts$/o);
181         $like = 3 if ($search_type =~ /regex$/o);
182
183         for my $term (@terms) {
184                 $log->debug("Searching $cdbi for $col using type $search_type, value '$term'",DEBUG);
185                 if (@terms == 1) {
186                         return [ $cdbi->fast_fieldmapper($term,$col,$like) ];
187                 }
188                 $client->respond( [ $cdbi->fast_fieldmapper($term,$col,$like) ] );
189         }
190         return undef;
191 }
192
193
194 sub create_node {
195         my $self = shift;
196         my $client = shift;
197         my $node = shift;
198
199         my $cdbi = $self->{cdbi};
200
201         my $success;
202         try {
203                 my $rec = $cdbi->create($node);
204                 $success = $rec->id if ($rec);
205         } catch Error with {
206                 $success = 0;
207         };
208
209         return $success;
210 }
211
212 sub update_node {
213         my $self = shift;
214         my $client = shift;
215         my $node = shift;
216
217         my $cdbi = $self->{cdbi};
218
219         return $cdbi->update($node);
220 }
221
222 sub mass_delete {
223         my $self = shift;
224         my $client = shift;
225         my $search = shift;
226
227         my $where = 'WHERE ';
228
229         my $cdbi = $self->{cdbi};
230         my $table = $cdbi->table;
231
232         my @keys = sort keys %$search;
233         
234         my @binds;
235         my @wheres;
236         for my $col ( @keys ) {
237                 if (ref($$search{$col}) and ref($$search{$col}) =~ /ARRAY/o) {
238                         push @wheres, "$col IN (" . join(',', map { '?' } @{ $$search{$col} }) . ')';
239                         push @binds, map { "$_" } @{ $$search{$col} };
240                 } else {
241                         push @wheres, "$col = ?";
242                         push @binds, $$search{$col};
243                 }
244         }
245         $where .= join ' AND ', @wheres;
246
247         my $delete = "DELETE FROM $table $where";
248
249         $log->debug("Performing MASS deletion : $delete",DEBUG);
250
251         my $dbh = $cdbi->db_Main;
252         my $success = 1;
253         try {
254                 my $sth = $dbh->prepare($delete);
255                 $sth->execute( @binds );
256                 $sth->finish;
257                 $log->debug("MASS Delete succeeded",DEBUG);
258         } catch Error with {
259                 $log->debug("MASS Delete FAILED : ".shift(),DEBUG);
260                 $success = 0;
261         };
262         return $success;
263 }
264
265 sub remote_update_node {
266         my $self = shift;
267         my $client = shift;
268         my $keys = shift;
269         my $vals = shift;
270
271         my $cdbi = $self->{cdbi};
272
273         my $success = 1;
274         try {
275                 $success = $cdbi->remote_update($keys,$vals);
276         } catch Error with {
277                 $success = 0;
278         };
279         return $success;
280 }
281
282 sub merge_node {
283         my $self = shift;
284         my $client = shift;
285         my $keys = shift;
286         my $vals = shift;
287
288         my $cdbi = $self->{cdbi};
289
290         my $success = 1;
291         try {
292                 $success = $cdbi->merge($keys,$vals)->id;
293         } catch Error with {
294                 $success = 0;
295         };
296         return $success;
297 }
298
299 sub delete_node {
300         my $self = shift;
301         my $client = shift;
302         my $node = shift;
303
304         my $cdbi = $self->{cdbi};
305
306         my $success = 1;
307         try {
308                 $success = $cdbi->delete($node);
309         } catch Error with {
310                 $success = 0;
311         };
312         return $success;
313 }
314
315 sub batch_call {
316         my $self = shift;
317         my $client = shift;
318         my @nodes = @_;
319
320         my $unwrap = $self->{unwrap};
321
322         my $cdbi = $self->{cdbi};
323         my $api_name = $self->api_name;
324         (my $single_call_api_name = $api_name) =~ s/batch\.//o;
325
326         $log->debug("Default $api_name looking up $single_call_api_name...",INTERNAL);
327         my $method = $self->method_lookup($single_call_api_name);
328
329         my @success;
330         while ( my $node = shift(@nodes) ) {
331                 my ($res) = $method->run( ($unwrap ? (@$node) : ($node)) ); 
332                 push(@success, 1) if ($res >= 0);
333         }
334
335         my $insert_total = 0;
336         $insert_total += $_ for (@success);
337
338         return $insert_total;
339 }
340
341 OpenILS::Application::Storage::Publisher::actor->use;
342 if ($@) {
343         $log->debug("ARG! Couldn't load actor class Publisher: $@", ERROR);
344         throw OpenSRF::EX::ERROR ("ARG! Couldn't load actor class Publisher: $@");
345 }
346
347 OpenILS::Application::Storage::Publisher::action->use;
348 if ($@) {
349         $log->debug("ARG! Couldn't load action class Publisher: $@", ERROR);
350         throw OpenSRF::EX::ERROR ("ARG! Couldn't load action class Publisher: $@");
351 }
352
353 OpenILS::Application::Storage::Publisher::asset->use;
354 if ($@) {
355         $log->debug("ARG! Couldn't load asset class Publisher: $@", ERROR);
356         throw OpenSRF::EX::ERROR ("ARG! Couldn't load asset class Publisher: $@");
357 }
358
359 OpenILS::Application::Storage::Publisher::biblio->use;
360 if ($@) {
361         $log->debug("ARG! Couldn't load biblio class Publisher: $@", ERROR);
362         throw OpenSRF::EX::ERROR ("ARG! Couldn't load biblio class Publisher: $@");
363 }
364
365 OpenILS::Application::Storage::Publisher::config->use;
366 if ($@) {
367         $log->debug("ARG! Couldn't load config class Publisher: $@", ERROR);
368         throw OpenSRF::EX::ERROR ("ARG! Couldn't load config class Publisher: $@");
369 }
370
371 OpenILS::Application::Storage::Publisher::metabib->use;
372 if ($@) {
373         $log->debug("ARG! Couldn't load metabib class Publisher: $@", ERROR);
374         throw OpenSRF::EX::ERROR ("ARG! Couldn't load metabib class Publisher: $@");
375 }
376
377 OpenILS::Application::Storage::Publisher::authority->use;
378 if ($@) {
379         $log->debug("ARG! Couldn't load authority class Publisher: $@", ERROR);
380         throw OpenSRF::EX::ERROR ("ARG! Couldn't load authority class Publisher: $@");
381 }
382
383 OpenILS::Application::Storage::Publisher::money->use;
384 if ($@) {
385         $log->debug("ARG! Couldn't load money class Publisher: $@", ERROR);
386         throw OpenSRF::EX::ERROR ("ARG! Couldn't load money class Publisher: $@");
387 }
388
389 OpenILS::Application::Storage::Publisher::permission->use;
390 if ($@) {
391         $log->debug("ARG! Couldn't load permission class Publisher: $@", ERROR);
392         throw OpenSRF::EX::ERROR ("ARG! Couldn't load permission class Publisher: $@");
393 }
394
395 OpenILS::Application::Storage::Publisher::container->use;
396 if ($@) {
397         $log->debug("ARG! Couldn't load container class Publisher: $@", ERROR);
398         throw OpenSRF::EX::ERROR ("ARG! Couldn't load container class Publisher: $@");
399 }
400
401
402
403 for my $fmclass ( (Fieldmapper->classes) ) {
404
405         $log->debug("Generating methods for Fieldmapper class $fmclass", DEBUG);
406
407         next if ($fmclass->is_virtual);
408
409         (my $cdbi = $fmclass) =~ s/^Fieldmapper:://o;
410         (my $class = $cdbi) =~ s/::.*//o;
411         (my $api_class = $cdbi) =~ s/::/./go;
412         my $registration_class = __PACKAGE__ . "::$class";
413         my $api_prefix = 'open-ils.storage.direct.'.$api_class;
414
415         # Create the search methods
416         unless ( __PACKAGE__->is_registered( $api_prefix.'.search' ) ) {
417                 __PACKAGE__->register_method(
418                         api_name        => $api_prefix.'.search',
419                         method          => 'search',
420                         api_level       => 1,
421                         argc            => 2,
422                         stream          => 1,
423                         cdbi            => $cdbi,
424                         cachable        => 1,
425                 );
426         }
427
428         unless ( __PACKAGE__->is_registered( $api_prefix.'.search_where' ) ) {
429                 __PACKAGE__->register_method(
430                         api_name        => $api_prefix.'.search_where',
431                         method          => 'search_where',
432                         api_level       => 1,
433                         stream          => 1,
434                         argc            => 1,
435                         cdbi            => $cdbi,
436                         cachable        => 1,
437                 );
438         }
439
440         unless ( __PACKAGE__->is_registered( $api_prefix.'.search_like' ) ) {
441                 __PACKAGE__->register_method(
442                         api_name        => $api_prefix.'.search_like',
443                         method          => 'search',
444                         api_level       => 1,
445                         stream          => 1,
446                         cdbi            => $cdbi,
447                         cachable        => 1,
448                         argc            => 2,
449                 );
450         }
451
452         if (\&Class::DBI::search_fts) {
453                 unless ( __PACKAGE__->is_registered( $api_prefix.'.search_fts' ) ) {
454                         __PACKAGE__->register_method(
455                                 api_name        => $api_prefix.'.search_fts',
456                                 method          => 'search',
457                                 api_level       => 1,
458                                 stream          => 1,
459                                 cdbi            => $cdbi,
460                                 cachable        => 1,
461                                 argc            => 2,
462                         );
463                 }
464         }
465
466         if (\&Class::DBI::search_regex) {
467                 unless ( __PACKAGE__->is_registered( $api_prefix.'.search_regex' ) ) {
468                         __PACKAGE__->register_method(
469                                 api_name        => $api_prefix.'.search_regex',
470                                 method          => 'search',
471                                 api_level       => 1,
472                                 stream          => 1,
473                                 cdbi            => $cdbi,
474                                 cachable        => 1,
475                                 argc            => 2,
476                         );
477                 }
478         }
479
480         if (\&Class::DBI::search_ilike) {
481                 unless ( __PACKAGE__->is_registered( $api_prefix.'.search_ilike' ) ) {
482                         __PACKAGE__->register_method(
483                                 api_name        => $api_prefix.'.search_ilike',
484                                 method          => 'search',
485                                 api_level       => 1,
486                                 stream          => 1,
487                                 cdbi            => $cdbi,
488                                 cachable        => 1,
489                                 argc            => 2,
490                         );
491                 }
492         }
493
494         # Create the retrieve method
495         unless ( __PACKAGE__->is_registered( $api_prefix.'.retrieve' ) ) {
496                 __PACKAGE__->register_method(
497                         api_name        => $api_prefix.'.retrieve',
498                         method          => 'retrieve_node',
499                         api_level       => 1,
500                         cdbi            => $cdbi,
501                         cachable        => 1,
502                         argc            => 1,
503                 );
504         }
505
506         # Create the batch retrieve method
507         unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.retrieve' ) ) {
508                 __PACKAGE__->register_method(
509                         api_name        => $api_prefix.'.batch.retrieve',
510                         method          => 'retrieve_node',
511                         api_level       => 1,
512                         stream          => 1,
513                         cdbi            => $cdbi,
514                         cachable        => 1,
515                         argc            => 1,
516                 );
517         }
518
519         for my $field ($fmclass->real_fields) {
520                 unless ( __PACKAGE__->is_registered( $api_prefix.'.search.'.$field ) ) {
521                         __PACKAGE__->register_method(
522                                 api_name        => $api_prefix.'.search.'.$field,
523                                 method          => 'search_one_field',
524                                 api_level       => 1,
525                                 cdbi            => $cdbi,
526                                 cachable        => 1,
527                                 stream          => 1,
528                                 argc            => 1,
529                         );
530                 }
531                 unless ( __PACKAGE__->is_registered( $api_prefix.'.search_like.'.$field ) ) {
532                         __PACKAGE__->register_method(
533                                 api_name        => $api_prefix.'.search_like.'.$field,
534                                 method          => 'search_one_field',
535                                 api_level       => 1,
536                                 cdbi            => $cdbi,
537                                 cachable        => 1,
538                                 stream          => 1,
539                                 argc            => 1,
540                         );
541                 }
542                 if (\&Class::DBI::search_fts) {
543                         unless ( __PACKAGE__->is_registered( $api_prefix.'.search_fts.'.$field ) ) {
544                                 __PACKAGE__->register_method(
545                                         api_name        => $api_prefix.'.search_fts.'.$field,
546                                         method          => 'search_one_field',
547                                         api_level       => 1,
548                                         cdbi            => $cdbi,
549                                         cachable        => 1,
550                                         stream          => 1,
551                                         argc            => 1,
552                                 );
553                         }
554                 }
555                 if (\&Class::DBI::search_regex) {
556                         unless ( __PACKAGE__->is_registered( $api_prefix.'.search_regex.'.$field ) ) {
557                                 __PACKAGE__->register_method(
558                                         api_name        => $api_prefix.'.search_regex.'.$field,
559                                         method          => 'search_one_field',
560                                         api_level       => 1,
561                                         cdbi            => $cdbi,
562                                         cachable        => 1,
563                                         stream          => 1,
564                                         argc            => 1,
565                                 );
566                         }
567                 }
568                 if (\&Class::DBI::search_ilike) {
569                         unless ( __PACKAGE__->is_registered( $api_prefix.'.search_ilike.'.$field ) ) {
570                                 __PACKAGE__->register_method(
571                                         api_name        => $api_prefix.'.search_ilike.'.$field,
572                                         method          => 'search_one_field',
573                                         api_level       => 1,
574                                         cdbi            => $cdbi,
575                                         cachable        => 1,
576                                         stream          => 1,
577                                         argc            => 1,
578                                 );
579                         }
580                 }
581         }
582
583
584         unless ($fmclass->is_readonly) {
585                 # Create the create method
586                 unless ( __PACKAGE__->is_registered( $api_prefix.'.create' ) ) {
587                         __PACKAGE__->register_method(
588                                 api_name        => $api_prefix.'.create',
589                                 method          => 'create_node',
590                                 api_level       => 1,
591                                 cdbi            => $cdbi,
592                                 argc            => 1,
593                         );
594                 }
595
596                 # Create the batch create method
597                 unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.create' ) ) {
598                         __PACKAGE__->register_method(
599                                 api_name        => $api_prefix.'.batch.create',
600                                 method          => 'batch_call',
601                                 api_level       => 1,
602                                 cdbi            => $cdbi,
603                                 argc            => 1,
604                         );
605                 }
606
607                 # Create the update method
608                 unless ( __PACKAGE__->is_registered( $api_prefix.'.update' ) ) {
609                         __PACKAGE__->register_method(
610                                 api_name        => $api_prefix.'.update',
611                                 method          => 'update_node',
612                                 api_level       => 1,
613                                 cdbi            => $cdbi,
614                                 argc            => 1,
615                         );
616                 }
617
618                 # Create the batch update method
619                 unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.update' ) ) {
620                         __PACKAGE__->register_method(
621                                 api_name        => $api_prefix.'.batch.update',
622                                 method          => 'batch_call',
623                                 api_level       => 1,
624                                 cdbi            => $cdbi,
625                                 argc            => 1,
626                         );
627                 }
628
629                 # Create the delete method
630                 unless ( __PACKAGE__->is_registered( $api_prefix.'.delete' ) ) {
631                         __PACKAGE__->register_method(
632                                 api_name        => $api_prefix.'.delete',
633                                 method          => 'delete_node',
634                                 api_level       => 1,
635                                 cdbi            => $cdbi,
636                                 argc            => 1,
637                         );
638                 }
639
640                 # Create the batch delete method
641                 unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.delete' ) ) {
642                         __PACKAGE__->register_method(
643                                 api_name        => $api_prefix.'.batch.delete',
644                                 method          => 'batch_call',
645                                 api_level       => 1,
646                                 cdbi            => $cdbi,
647                                 argc            => 1,
648                         );
649                 }
650
651                 # Create the merge method
652                 unless ( __PACKAGE__->is_registered( $api_prefix.'.merge' ) ) {
653                         __PACKAGE__->register_method(
654                                 api_name        => $api_prefix.'.merge',
655                                 method          => 'merge_node',
656                                 api_level       => 1,
657                                 cdbi            => $cdbi,
658                                 argc            => 1,
659                         );
660                 }
661
662                 # Create the batch merge method
663                 unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.merge' ) ) {
664                         __PACKAGE__->register_method(
665                                 api_name        => $api_prefix.'.batch.merge',
666                                 method          => 'batch_call',
667                                 unwrap          => 1,
668                                 api_level       => 1,
669                                 cdbi            => $cdbi,
670                                 argc            => 1,
671                         );
672                 }
673
674                 # Create the remote_update method
675                 unless ( __PACKAGE__->is_registered( $api_prefix.'.remote_update' ) ) {
676                         __PACKAGE__->register_method(
677                                 api_name        => $api_prefix.'.remote_update',
678                                 method          => 'remote_update_node',
679                                 api_level       => 1,
680                                 cdbi            => $cdbi,
681                                 argc            => 1,
682                         );
683                 }
684
685                 # Create the batch remote_update method
686                 unless ( __PACKAGE__->is_registered( $api_prefix.'.batch.remote_update' ) ) {
687                         __PACKAGE__->register_method(
688                                 api_name        => $api_prefix.'.batch.remote_update',
689                                 method          => 'batch_call',
690                                 api_level       => 1,
691                                 unwrap          => 1,
692                                 cdbi            => $cdbi,
693                                 argc            => 1,
694                         );
695                 }
696
697                 # Create the search-based mass delete method
698                 unless ( __PACKAGE__->is_registered( $api_prefix.'.mass_delete' ) ) {
699                         __PACKAGE__->register_method(
700                                 api_name        => $api_prefix.'.mass_delete',
701                                 method          => 'mass_delete',
702                                 api_level       => 1,
703                                 cdbi            => $cdbi,
704                                 argc            => 1,
705                         );
706                 }
707         }
708 }
709
710 1;