1 package OpenILS::DomainObject::oilsMethod;
2 use OpenILS::DOM::Element::params;
3 use OpenILS::DOM::Element::param;
5 use base 'OpenILS::DomainObject';
9 OpenILS::DomainObject::oilsMethod
13 use OpenILS::DomainObject::oilsMethod;
15 my $method = OpenILS::DomainObject::oilsMethod->new( method => 'search' );
17 $method->return_type( 'mods' );
19 $method->params( 'title:harry potter' );
21 $client->send( 'REQUEST', $method );
25 =head2 OpenILS::DomainObject::oilsMethod->method( [$new_method_name] )
29 Sets or gets the method name that will be called on the server. As above,
30 this can be specified as a build attribute as well as added to a prebuilt
39 return $self->_attr_get_set( method => shift );
42 =head2 OpenILS::DomainObject::oilsMethod->return_type( [$new_return_type] )
46 Sets or gets the return type for this method call. This can also be supplied as
49 This option does not require that the server return the type you request. It is
50 used as a suggestion when more than one return type or format is possible.
59 return $self->_attr_get_set( return_type => shift );
62 =head2 OpenILS::DomainObject::oilsMethod->params( [@new_params] )
66 Sets or gets the parameters for this method call. Just pass in either text
67 parameters, or DOM nodes of any type.
78 my ($old_params) = $self->getChildrenByTagName('oils:params');
83 $self->removeChild($old_params) if ($old_params);
85 my $params = OpenILS::DOM::Element::params->new;
86 $self->appendChild($params);
87 $params->appendTextNode( JSON->perl2JSON( \@args );
89 $old_params = $params unless ($old_params);
93 $params = JSON->JSON2perl( $old_params->textContent );