getting perl fieldmapper class name from idl
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Apr 2008 17:17:22 +0000 (17:17 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Apr 2008 17:17:22 +0000 (17:17 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9365 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Fielder.pm

index 25d1343..c541345 100644 (file)
@@ -62,9 +62,10 @@ sub fielder_fetch {
     my $fields = $obj->{fields};
 
     my $obj_class = $self->{class_hint};
+    my $fm_class = $self->{class_name};
 
     if (!$fields) {
-        $fields = [ "Fieldmapper::$obj_class"->real_fields ];
+        $fields = [ $fm_class->real_fields ];
     }
 
     $log->debug( 'Field list: '. OpenSRF::Utils::JSON->perl2JSON( $fields ) );
@@ -96,12 +97,14 @@ sub generate_methods {
     try {
         for my $class_node ( $xpc->findnodes( '//idl:class[@oils_persist:field_safe="true"]', $idl->documentElement ) ) {
             my $hint = $class_node->getAttribute('id');
+            my $fm = $class_node->getAttributeNS('http://open-ils.org/spec/opensrf/IDL/objects/v1','fieldmapper');
             $log->debug("Fielder class_node $hint");
         
             __PACKAGE__->register_method(
                 method          => 'fielder_fetch',
                 api_name        => 'open-ils.fielder.' . $hint,
                 class_hint      => $hint,
+                class_name      => "Fieldmapper::$fm",
                 stream          => 1,
                 argc            => 1
             );