1 #include "objson/object.h"
2 #include "opensrf/log.h"
3 #include "openils/fieldmapper_lookup.h"
4 #include "oils_event.h"
5 #include "oils_constants.h"
6 #include "opensrf/osrf_app_session.h"
9 Returns the string value for field 'field' in the given object.
10 This method calls jsonObjectToSimpleString so numbers will be
12 @param object The object to inspect
13 @param field The field whose value is requsted
14 @return The string at the given position, if none exists,
15 then NULL is returned. The caller must free the returned string
17 char* oilsFMGetString( jsonObject* object, char* field );
21 Returns the jsonObject found at the specified field in the
23 @param object The object to inspect
24 @param field The field whose value is requsted
25 @return The found object or NULL if none exists. Do NOT free the
28 jsonObject* oilsFMGetObject( jsonObject* object, char* field );
31 Sets the given field in the given object to the given string
32 @param object The object to update
33 @param field The field to change
34 @param string The new data
35 @return 0 if the field was updated successfully, -1 on error
37 int oilsFMSetString( jsonObject* object, char* field, char* string );
40 * Returns the data stored in the id field of the object if it exists
41 * returns -1 if the id field or the id value is not found
43 long oilsFMGetObjectId( jsonObject* obj );
47 * Checks if the user has each permission at the given org unit
48 * Passing in a -1 for the orgid means to use the top level org unit
49 * The first permission that fails causes the corresponding permission
50 * failure event to be returned
51 * returns NULL if all permissions succeed
53 oilsEvent* oilsUtilsCheckPerms( int userid, int orgid, char* permissions[], int size );
57 * Performs a single request and returns the resulting data
58 * Caller is responsible for freeing the returned response object
60 jsonObject* oilsUtilsQuickReq( char* service, char* method, jsonObject* params );
62 jsonObject* oilsUtilsStorageReq( char* method, jsonObject* params );
65 * Searches the storage server for a user with the given username
66 * Caller is responsible for freeing the returned object
68 jsonObject* oilsUtilsFetchUserByUsername( char* name );
72 * Returns the setting value
73 * Caller must free the returned string
75 char* oilsUtilsFetchOrgSetting( int orgid, char* setting );
79 * Logs into the auth server with the given username and password
80 * @return The authtoken string which must be de-allocated by the caller
82 char* oilsUtilsLogin( char* uname, char* passwd, char* type, int orgId );
86 * Fetches the requested workstation object by id
88 jsonObject* oilsUtilsFetchWorkstation( long id );
90 jsonObject* oilsUtilsFetchUserByBarcode(char* barcode);
92 jsonObject* oilsUtilsFetchWorkstationByName( char* name );