--- /dev/null
+/* This set of macros will emulate the old style libfieldmapper api
+ * using the new liboils_idl interface. You MUST initiallize liboils_idl!
+ */
+
+#ifndef FIELDMAPPER_API
+
+#ifndef OILS_IDL_API
+#include "oils_idl.h"
+#endif
+
+#define FIELDMAPPER_API
+
+#define fm_pton(x,y) oilsIDL_pton(x,y)
+#define fm_ntop(x,y) oilsIDL_ntop(x,y)
+#define isFieldmapper(x) oilsIDL_classIsFieldmapper(x)
+
+#endif
+
--- /dev/null
+
+
+/* Settings ------------------------------------------------------ */
+#define OILS_ORG_SETTING_OPAC_TIMEOUT "auth.opac_timeout"
+#define OILS_ORG_SETTING_STAFF_TIMEOUT "auth.staff_timeout"
+#define OILS_ORG_SETTING_TEMP_TIMEOUT "auth.temp_timeout"
+
+
+/* Events ------------------------------------------------------ */
+#define OILS_EVENT_SUCCESS "SUCCESS"
+#define OILS_EVENT_AUTH_FAILED "LOGIN_FAILED"
+#define OILS_EVENT_PERM_FAILURE "PERM_FAILURE"
+#define OILS_EVENT_NO_SESSION "NO_SESSION"
+
--- /dev/null
+#ifndef OILS_EVENT_HEADER
+#define OILS_EVENT_HEADER
+#include "objson/object.h"
+#include "opensrf/utils.h"
+#include "opensrf/log.h"
+#include "opensrf/osrf_hash.h"
+
+
+/* OILS Event structure */
+struct _oilsEventStruct {
+ char* event; /* the event name */
+ char* perm; /* the permission error name */
+ int permloc; /* the permission location id */
+ jsonObject* payload; /* the payload */
+ jsonObject* json; /* the event as a jsonObject */
+ char* file;
+ int line;
+};
+typedef struct _oilsEventStruct oilsEvent;
+
+
+/** Creates a new event. User is responsible for freeing event with oilsEventFree */
+oilsEvent* oilsNewEvent( char* file, int line, char* event );
+
+/** Creates a new event with payload.
+ * User is responsible for freeing event with oilsEventFree */
+oilsEvent* oilsNewEvent2( char* file, int line, char* event, jsonObject* payload );
+
+/** Creates a new event with permission and permission location.
+ * User is responsible for freeing event with oilsEventFree */
+oilsEvent* oilsNewEvent3( char* file, int line, char* event, char* perm, int permloc );
+
+/** Creates a new event with permission, permission location, and payload.
+ * User is responsible for freeing event with oilsEventFree */
+oilsEvent* oilsNewEvent4( char* file, int line,
+ char* event, char* perm, int permloc, jsonObject* payload );
+
+/** Sets the permission info for the event */
+void oilsEventSetPermission( oilsEvent* event, char* perm, int permloc );
+
+/* Sets the payload for the event
+ * This clones the payload, so the user is responsible
+ * for handling the payload object's memory
+ * */
+void oilsEventSetPayload( oilsEvent* event, jsonObject* payload );
+
+/** Creates the JSON associated with an event. The JSON should NOT be
+ * freed by the user. It will be freed by oilsEventFree */
+jsonObject* oilsEventToJSON( oilsEvent* event );
+
+/* Parses the events file */
+void _oilsEventParseEvents();
+
+/* Frees an event object */
+void oilsEventFree( oilsEvent* event );
+
+
+
+#endif
--- /dev/null
+#include "opensrf/log.h"
+#include "opensrf/utils.h"
+#include "opensrf/osrf_hash.h"
+
+#ifndef OILS_IDL_API
+#define OILS_IDL_API
+
+osrfHash* oilsIDLInit( const char* );
+osrfHash* oilsIDL(void);
+osrfHash* oilsIDLFindPath( const char*, ... );
+
+/* The oilsIDL hash looks like this:
+
+{ aws : {
+ classname : "aws",
+ fieldmapper : "actor::workstation",
+ tablename : "actor.workstation", optional
+ sequence : "actor.workstation_id_seq", optional
+ primarykey : "id",
+ virtual : "true", optional, "true" | "false"
+ fields : {
+ isnew : {
+ name : "isnew",
+ array_position : "0",
+ virtual : "true", "true" | "false"
+ primitive : "number" optional, JSON primitive (number, string, array,
+ object, bool)
+ },
+ ...
+ },
+ links : {
+ record : {
+ field : "owning_lib", field above that links to another class
+ rel_type : "has_a", link type, "has_a" | "has_many" | "might_have"
+ class : "aou", the foreign class that is linked
+ key : "id", the foreign class's key that creates the link to "field"
+ map : [] osrfStringArray used by cstore in "has_many" rel_types to
+ point through a linking class
+ },
+ ...
+ },
+ ...
+}
+
+*/
+
+int oilsIDL_classIsFieldmapper(const char*);
+char * oilsIDL_pton(const char *, int);
+int oilsIDL_ntop(const char *, const char *);
+
+#endif
--- /dev/null
+#include "objson/object.h"
+#include "opensrf/log.h"
+
+// XXX replacing this with liboils_idl implementation
+// #include "openils/fieldmapper_lookup.h"
+
+#include "openils/idl_fieldmapper.h"
+
+#include "oils_event.h"
+#include "oils_constants.h"
+#include "opensrf/osrf_app_session.h"
+#include "opensrf/osrf_settings.h"
+
+/**
+ Loads the IDL. Returns NULL on failure
+ or a pointer to the IDL data structure on success.
+ @param idl_filename If not provided, we'll fetch the
+ filename from the settings server
+ */
+osrfHash* oilsInitIDL( char* idl_filename );
+
+/**
+ Returns the string value for field 'field' in the given object.
+ This method calls jsonObjectToSimpleString so numbers will be
+ returned as strings.
+ @param object The object to inspect
+ @param field The field whose value is requsted
+ @return The string at the given position, if none exists,
+ then NULL is returned. The caller must free the returned string
+ */
+char* oilsFMGetString( const jsonObject* object, const char* field );
+
+
+/**
+ Returns the jsonObject found at the specified field in the
+ given object.
+ @param object The object to inspect
+ @param field The field whose value is requsted
+ @return The found object or NULL if none exists. Do NOT free the
+ returned object.
+ */
+const jsonObject* oilsFMGetObject( const jsonObject* object, const char* field );
+
+/**
+ Sets the given field in the given object to the given string
+ @param object The object to update
+ @param field The field to change
+ @param string The new data
+ @return 0 if the field was updated successfully, -1 on error
+ */
+int oilsFMSetString( jsonObject* object, const char* field, const char* string );
+
+/**
+ * Returns the data stored in the id field of the object if it exists
+ * returns -1 if the id field or the id value is not found
+ */
+long oilsFMGetObjectId( const jsonObject* obj );
+
+
+/**
+ * Checks if the user has each permission at the given org unit
+ * Passing in a -1 for the orgid means to use the top level org unit
+ * The first permission that fails causes the corresponding permission
+ * failure event to be returned
+ * returns NULL if all permissions succeed
+ */
+oilsEvent* oilsUtilsCheckPerms( int userid, int orgid, char* permissions[], int size );
+
+
+/**
+ * Performs a single request and returns the resulting data
+ * Caller is responsible for freeing the returned response object
+ */
+jsonObject* oilsUtilsQuickReq( const char* service, const char* method,
+ const jsonObject* params );
+
+jsonObject* oilsUtilsStorageReq( const char* method, const jsonObject* params );
+
+jsonObject* oilsUtilsCStoreReq( const char* method, const jsonObject* params );
+
+/**
+ * Searches the storage server for a user with the given username
+ * Caller is responsible for freeing the returned object
+ */
+jsonObject* oilsUtilsFetchUserByUsername( const char* name );
+
+
+/**
+ * Returns the setting value
+ * Caller must free the returned string
+ */
+char* oilsUtilsFetchOrgSetting( int orgid, const char* setting );
+
+
+/**
+ * Logs into the auth server with the given username and password
+ * @return The authtoken string which must be de-allocated by the caller
+ */
+char* oilsUtilsLogin( const char* uname, const char* passwd, const char* type, int orgId );
+
+
+/**
+ * Fetches the requested workstation object by id
+ */
+jsonObject* oilsUtilsFetchWorkstation( long id );
+
+jsonObject* oilsUtilsFetchUserByBarcode(const char* barcode);
+
+jsonObject* oilsUtilsFetchWorkstationByName( const char* name );
+
+
+int oilsUtilsIsDBTrue( const char* val );
export LDFLAGS += -L . -L$(TMP) -L $(OPENSRF_LIBS)
export CFLAGS += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
- -D_LARGEFILE64_SOURCE -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(OPENSRF_HEADERS)
+ -D_LARGEFILE64_SOURCE -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(OPENSRF_HEADERS)
export INCDIR = "$(INCLUDEDIR)/openils/"
LDLIBS += -lobjson -lopensrf #-lfieldmapper
LDFLAGS += -Wl,-rpath=$(LIBDIR) -L$(DBI_LIBS)
-CFLAGS += -DOSRF_LOG_PARAMS
+CFLAGS += -DOSRF_LOG_PARAMS -I../../include
#all: oils_auth.so oils_fetch.so oils_cstore.so
all: liboils_idl.so oils_auth.so oils_cstore.so oils_rstore.so oils_dataloader
$(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) -loils_idl -ldbi -loils_utils -ldbdpgsql oils_cstore.o -o $@
oils_rstore.o: oils_cstore.c
- $(CC) $(CFLAGS) -I$(TMP) -DRSTORE -c -o $@ oils_cstore.c
+ $(CC) $(CFLAGS) -DRSTORE -c -o $@ oils_cstore.c
oils_rstore.so: oils_rstore.o liboils_utils.so liboils_idl.so
@echo $@
liboils_idl.so: oils_idl-core.o
@echo $@
- $(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) oils_idl-core.o -o $@
-# cp $@ $(TMP)/
-# mkdir -p $(TMP)/openils/
-# cp oils_idl.h $(TMP)/openils/
-# cp idl_fieldmapper.h $(TMP)/openils/
+ $(CC) $(CFLAGS) -shared -W1 $(LDLIBS) $(LDFLAGS) oils_idl-core.o -o $@
oils_auth.so: oils_auth.o liboils_utils.so
@echo $@
liboils_utils.so: oils_utils.o oils_event.o
@echo $@
$(CC) -shared -W1 $(LDLIBS) $(LDFLAGS) oils_utils.o oils_event.o -o $@
-# cp $@ $(TMP)/
-# mkdir -p $(TMP)/openils/
-# cp oils_event.h $(TMP)/openils/
-# cp oils_utils.h $(TMP)/openils/
-# cp oils_constants.h $(TMP)/openils/
install:
@echo $@;
cp oils_auth.so $(LIBDIR)/
- #cp $(TMP)/oils_fetch.so $(LIBDIR)/
cp oils_cstore.so $(LIBDIR)/
cp oils_rstore.so $(LIBDIR)/
cp liboils_utils.so $(LIBDIR)/
+++ /dev/null
-/* This set of macros will emulate the old style libfieldmapper api
- * using the new liboils_idl interface. You MUST initiallize liboils_idl!
- */
-
-#ifndef FIELDMAPPER_API
-
-#ifndef OILS_IDL_API
-#include "oils_idl.h"
-#endif
-
-#define FIELDMAPPER_API
-
-#define fm_pton(x,y) oilsIDL_pton(x,y)
-#define fm_ntop(x,y) oilsIDL_ntop(x,y)
-#define isFieldmapper(x) oilsIDL_classIsFieldmapper(x)
-
-#endif
-
+++ /dev/null
-
-
-/* Settings ------------------------------------------------------ */
-#define OILS_ORG_SETTING_OPAC_TIMEOUT "auth.opac_timeout"
-#define OILS_ORG_SETTING_STAFF_TIMEOUT "auth.staff_timeout"
-#define OILS_ORG_SETTING_TEMP_TIMEOUT "auth.temp_timeout"
-
-
-/* Events ------------------------------------------------------ */
-#define OILS_EVENT_SUCCESS "SUCCESS"
-#define OILS_EVENT_AUTH_FAILED "LOGIN_FAILED"
-#define OILS_EVENT_PERM_FAILURE "PERM_FAILURE"
-#define OILS_EVENT_NO_SESSION "NO_SESSION"
-
+++ /dev/null
-#ifndef OILS_EVENT_HEADER
-#define OILS_EVENT_HEADER
-#include "objson/object.h"
-#include "opensrf/utils.h"
-#include "opensrf/log.h"
-#include "opensrf/osrf_hash.h"
-
-
-/* OILS Event structure */
-struct _oilsEventStruct {
- char* event; /* the event name */
- char* perm; /* the permission error name */
- int permloc; /* the permission location id */
- jsonObject* payload; /* the payload */
- jsonObject* json; /* the event as a jsonObject */
- char* file;
- int line;
-};
-typedef struct _oilsEventStruct oilsEvent;
-
-
-/** Creates a new event. User is responsible for freeing event with oilsEventFree */
-oilsEvent* oilsNewEvent( char* file, int line, char* event );
-
-/** Creates a new event with payload.
- * User is responsible for freeing event with oilsEventFree */
-oilsEvent* oilsNewEvent2( char* file, int line, char* event, jsonObject* payload );
-
-/** Creates a new event with permission and permission location.
- * User is responsible for freeing event with oilsEventFree */
-oilsEvent* oilsNewEvent3( char* file, int line, char* event, char* perm, int permloc );
-
-/** Creates a new event with permission, permission location, and payload.
- * User is responsible for freeing event with oilsEventFree */
-oilsEvent* oilsNewEvent4( char* file, int line,
- char* event, char* perm, int permloc, jsonObject* payload );
-
-/** Sets the permission info for the event */
-void oilsEventSetPermission( oilsEvent* event, char* perm, int permloc );
-
-/* Sets the payload for the event
- * This clones the payload, so the user is responsible
- * for handling the payload object's memory
- * */
-void oilsEventSetPayload( oilsEvent* event, jsonObject* payload );
-
-/** Creates the JSON associated with an event. The JSON should NOT be
- * freed by the user. It will be freed by oilsEventFree */
-jsonObject* oilsEventToJSON( oilsEvent* event );
-
-/* Parses the events file */
-void _oilsEventParseEvents();
-
-/* Frees an event object */
-void oilsEventFree( oilsEvent* event );
-
-
-
-#endif
+++ /dev/null
-#include "opensrf/log.h"
-#include "opensrf/utils.h"
-#include "opensrf/osrf_hash.h"
-
-#ifndef OILS_IDL_API
-#define OILS_IDL_API
-
-osrfHash* oilsIDLInit( const char* );
-osrfHash* oilsIDL(void);
-osrfHash* oilsIDLFindPath( const char*, ... );
-
-/* The oilsIDL hash looks like this:
-
-{ aws : {
- classname : "aws",
- fieldmapper : "actor::workstation",
- tablename : "actor.workstation", optional
- sequence : "actor.workstation_id_seq", optional
- primarykey : "id",
- virtual : "true", optional, "true" | "false"
- fields : {
- isnew : {
- name : "isnew",
- array_position : "0",
- virtual : "true", "true" | "false"
- primitive : "number" optional, JSON primitive (number, string, array,
- object, bool)
- },
- ...
- },
- links : {
- record : {
- field : "owning_lib", field above that links to another class
- rel_type : "has_a", link type, "has_a" | "has_many" | "might_have"
- class : "aou", the foreign class that is linked
- key : "id", the foreign class's key that creates the link to "field"
- map : [] osrfStringArray used by cstore in "has_many" rel_types to
- point through a linking class
- },
- ...
- },
- ...
-}
-
-*/
-
-int oilsIDL_classIsFieldmapper(const char*);
-char * oilsIDL_pton(const char *, int);
-int oilsIDL_ntop(const char *, const char *);
-
-#endif
+++ /dev/null
-#include "objson/object.h"
-#include "opensrf/log.h"
-
-// XXX replacing this with liboils_idl implementation
-// #include "openils/fieldmapper_lookup.h"
-
-#include "openils/idl_fieldmapper.h"
-
-#include "oils_event.h"
-#include "oils_constants.h"
-#include "opensrf/osrf_app_session.h"
-#include "opensrf/osrf_settings.h"
-
-/**
- Loads the IDL. Returns NULL on failure
- or a pointer to the IDL data structure on success.
- @param idl_filename If not provided, we'll fetch the
- filename from the settings server
- */
-osrfHash* oilsInitIDL( char* idl_filename );
-
-/**
- Returns the string value for field 'field' in the given object.
- This method calls jsonObjectToSimpleString so numbers will be
- returned as strings.
- @param object The object to inspect
- @param field The field whose value is requsted
- @return The string at the given position, if none exists,
- then NULL is returned. The caller must free the returned string
- */
-char* oilsFMGetString( const jsonObject* object, const char* field );
-
-
-/**
- Returns the jsonObject found at the specified field in the
- given object.
- @param object The object to inspect
- @param field The field whose value is requsted
- @return The found object or NULL if none exists. Do NOT free the
- returned object.
- */
-const jsonObject* oilsFMGetObject( const jsonObject* object, const char* field );
-
-/**
- Sets the given field in the given object to the given string
- @param object The object to update
- @param field The field to change
- @param string The new data
- @return 0 if the field was updated successfully, -1 on error
- */
-int oilsFMSetString( jsonObject* object, const char* field, const char* string );
-
-/**
- * Returns the data stored in the id field of the object if it exists
- * returns -1 if the id field or the id value is not found
- */
-long oilsFMGetObjectId( const jsonObject* obj );
-
-
-/**
- * Checks if the user has each permission at the given org unit
- * Passing in a -1 for the orgid means to use the top level org unit
- * The first permission that fails causes the corresponding permission
- * failure event to be returned
- * returns NULL if all permissions succeed
- */
-oilsEvent* oilsUtilsCheckPerms( int userid, int orgid, char* permissions[], int size );
-
-
-/**
- * Performs a single request and returns the resulting data
- * Caller is responsible for freeing the returned response object
- */
-jsonObject* oilsUtilsQuickReq( const char* service, const char* method,
- const jsonObject* params );
-
-jsonObject* oilsUtilsStorageReq( const char* method, const jsonObject* params );
-
-jsonObject* oilsUtilsCStoreReq( const char* method, const jsonObject* params );
-
-/**
- * Searches the storage server for a user with the given username
- * Caller is responsible for freeing the returned object
- */
-jsonObject* oilsUtilsFetchUserByUsername( const char* name );
-
-
-/**
- * Returns the setting value
- * Caller must free the returned string
- */
-char* oilsUtilsFetchOrgSetting( int orgid, const char* setting );
-
-
-/**
- * Logs into the auth server with the given username and password
- * @return The authtoken string which must be de-allocated by the caller
- */
-char* oilsUtilsLogin( const char* uname, const char* passwd, const char* type, int orgId );
-
-
-/**
- * Fetches the requested workstation object by id
- */
-jsonObject* oilsUtilsFetchWorkstation( long id );
-
-jsonObject* oilsUtilsFetchUserByBarcode(const char* barcode);
-
-jsonObject* oilsUtilsFetchWorkstationByName( const char* name );
-
-
-int oilsUtilsIsDBTrue( const char* val );
-LDLIBS += -lreadline -loils_utils -lopensrf -lobjson -lxml2 -loils_idl
+LDLIBS += -lreadline -loils_utils -lopensrf -lobjson -lxml2 -loils_idl -L../c-apps
+CFLAGS += -I../../include
all: oils_requestor
oils_requestor: oils_requestor.o
# not require fetching the sources externally ... needs testing/updating in here
-LIBJS=js-1.60
-LIBJS_PERL=JavaScript-SpiderMonkey-0.17
+LIBJS=js-1.7.0
+LIBJS_PERL=JavaScript-SpiderMonkey-0.19
LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
# used for installing libjs lib and header files
libreadline5-dev\
libtext-csv-perl\
libspreadsheet-writeexcel-perl\
- libtie-ixhash-perl
-
+ libtie-ixhash-perl\
+ python-setuptools
GENTOOS = \
cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
- cd JavaScript-SpiderMonkey-0.17 && perl Makefile.PL -E4X && make && make test && make install
+ cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
# Install libdbi and the postgres drivers