[OPEN-ILS-DEV] How to query coded_value_map via OSRF
Jason Stephenson
jason at sigio.com
Thu Jul 11 04:20:58 EDT 2019
Ken,
Do you know how to do a CStore search? It's the same as pcrud. You put
the search terms in a JSON object. The main difference is that with
pcrud you always need an "authtoken," even it if it just the word
ANONYMOUS. Here's an example that works in srfsh to do what you want:
request open-ils.pcrud open-ils.pcrud.search.ccvm.atomic "ANONYMOUS",
{"ctype": [ "icon_format", "search_format" ]}
If your user is logged in, you can use your authtoken instead of
ANONYMOUS in the example.
HtH,
Jason
On 7/10/19 10:26 PM, Ken Cox wrote:
> Jason,
>
> Thank you, that is a great hint, but I'm not close enough to get it
> yet. In the past I've looked at OSRF methods registered in perl
> modules, and they were wrapped with some decorations that told me how
> they were supposed to be called (__PACKAGE__->register_method and look
> at the params array). In this case (sub init_ro_object_cache) I don't
> recognize any methods being registered at all. I tried to
>
> srfsh# introspect open-ils.pcrud "open-ils.pcrud.search.ccvm"
>
> but it didn't provide any help. I tried calling it in a lot of
> different ways but all I get is
>
> https://gapines.org/osrf-gateway-v1?service=open-ils.pcrud&method=open-ils.pcrud.search.ccvm¶m=%22ANONYMOUS%22¶m=*
> {"payload":[],"debug": "osrfMethodException : Severe query error --
> see error log for more details","status":500}
>
> One more clue please?
>
> Thanks,
> Ken
>
>
> On Wed, Jul 10, 2019 at 6:52 AM Jason Stephenson <jason at sigio.com> wrote:
>>
>> On 7/9/19 8:34 PM, Ken Cox wrote:
>>> Is there a way to query the coded_value_map via OSRF? I want to list
>>> the search_format and icon_format values for use in the mobile app. I
>>> see a call to ctx.search_ccvm in coded_value_selector.tt2, but I can't
>>> find that code anywhere. I am swinging wildly using pcrud but haven't
>>> hit anything yet, and could use a clue.
>>
>> ctx.search_ccvm is added, along with a bunch of methods, in a loop
>> beginning at line 77 of
>> Open-ILS/src/perlmods/lib/OpenILS/WWW/EGcatLoader/Util.pm. It's doing a
>> CStoreEditor search.
>>
>> Since ccvm has a pcrud controller, you should be able to achieve a
>> similar search with open-ils.pcrud.search.ccvm.
>>
>> HtH,
>> Jason
>>
>>>
>>> Thanks,
>>> Ken
>>>
>
>
>
More information about the Open-ils-dev
mailing list