[OPEN-ILS-DEV] fm_IDL.xml and open-ils.cstore

Bill Erickson erickson at esilibrary.com
Tue Oct 4 12:08:34 EDT 2011


On Tue, Oct 04, 2011 at 01:01:32PM +0100, Mark Gavillet wrote:
> Hi
> 
> I've created a new table in the Evergreen database which I'd like to set up CRUD services for. The table structure is:
> 
> ---
>                                                 Table "stockrotation.rota_statuses"
>  Column |          Type          |                               Modifiers                                | Storage  | Description 
> --------+------------------------+------------------------------------------------------------------------+----------+-------------
>  id     | integer                | not null default nextval('stockrotation.rota_status_id_seq'::regclass) | plain    | 
>  name   | character varying(255) | not null                                                               | extended | 
> Indexes:
>     "rota_statuses_pkey" PRIMARY KEY, btree (id)
> Check constraints:
>     "rotaname" CHECK (name::text <> ''::text)
> Referenced by:
>     TABLE "stockrotation.rotas" CONSTRAINT "status_exists" FOREIGN KEY (status_id) REFERENCES stockrotation.rota_statuses(id)
> Has OIDs: no
> ---
> 
> I've added the following lines to /openils/conf/fm_IDL.xml (retrieve permission set to a known value for testing):
> 
> ---
> 	<class id="srrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="stockrotation::rota_statuses" oils_persist:tablename="stockrotation.rota_statuses" reporter:label="Stock Rotation Statuses">
> 		<fields oils_persist:primary="id" oils_persist:sequence="stockrotation.rota_status_id_seq">
> 			<field reporter:label="Stock Rotation Status ID" name="id" reporter:datatype="id"/>
> 			<field reporter:label="Stock Rotation Status Name" name="name" reporter:datatype="text"/>
> 		</fields>
>         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
>         	<actions>
>                 <retrieve permission="CREATE_ORG_UNIT UPDATE_ORG_UNIT DELETE_ORG_UNIT">
>                     <context field="id"/>
>                     <context field="name"/>
> 				</retrieve>
> 			</actions>
>         </permacrud>
> 	</class>
> ---
> 
> After restarting the opensrf service I get the following error in srfsh:
> 
> ---
> srfsh# request open-ils.cstore open-ils.cstore.direct.stockrotation.rota_statuses 1
> 
> Received Exception:
> Name: osrfMethodException
> Status: Method [open-ils.cstore.direct.stockrotation.rota_statuses] not found for service open-ils.cstore
> Status: 404
> ------------------------------------
> Request Completed Successfully
> Request Time in seconds: 0.001693
> ------------------------------------

Hi Mark,

Try adding ".retrieve" to your API call:

srfsh# request open-ils.cstore open-ils.cstore.direct.stockrotation.rota_statuses.retrieve 1

-b 

-- 
Bill Erickson
| Senior Software Developer
| Equinox Software, Inc. / Your Library's Guide to Open Source
| phone: 877-OPEN-ILS (673-6457)
| email: erickson at esilibrary.com
| web: http://esilibrary.com 


More information about the Open-ils-dev mailing list