Just to be clear, there are 2 layers to the legacy JSON support. There is the
low-level osrf_legacy_json.* code which provides a translation between old
and new-style JSON object hints. There is also a higher level objson API
compatibility layer.
The attached patch:
* removes the objson compat layer. Note that Evergreen trunk (a.k.a 1.4) has
already been updated to remove any dependence on the legacy API layer
* Sets the default JSON gateway protocol to non-legacy json
What it does not do:
* it does not remove or disable the osrf_legacy_json.* code
* it does not remove the ability for the gateway to toggle between legacy and
non-legacy json
Finally, I only removed just enough of the legacy JSON parts of the
Makefile.am, etc. (aka autotools) to prevent the building and installation of
the objson compat layer. We no longer need any of the legacy JSON handling
bits in the autotools files and I've discussed its removal with Kevin B, who
is handling the autotools-ification.
This patch is running on acq.open-ils.org... also, so far so good. If there
are no objections, I'll commit soon.
Thanks,
-b
--
Bill Erickson
| VP, Software Development & Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: [EMAIL PROTECTED]
| web: http://esilibrary.com
Index: include/objson/json2xml.h
===================================================================
--- include/objson/json2xml.h (revision 1372)
+++ include/objson/json2xml.h (working copy)
@@ -1,10 +0,0 @@
-/*
- * Header to support legacy objson library
- */
-#ifndef OBJSON_JSON2XML_H
-#define OBJSON_JSON2XML_H
-#include <opensrf/osrf_json.h>
-#include <opensrf/osrf_json_xml.h>
-#include <opensrf/osrf_legacy_json.h>
-#endif
-
Index: include/objson/xml2json.h
===================================================================
--- include/objson/xml2json.h (revision 1372)
+++ include/objson/xml2json.h (working copy)
@@ -1,11 +0,0 @@
-/*
- * Header to support legacy objson library
- */
-#ifndef OBJSON_XML2JSON_H
-#define OBJSON_XML2JSON_H
-#include <opensrf/osrf_json.h>
-#include <opensrf/osrf_json_xml.h>
-#include <opensrf/osrf_legacy_json.h>
-#endif
-
-
Index: include/objson/json_parser.h
===================================================================
--- include/objson/json_parser.h (revision 1372)
+++ include/objson/json_parser.h (working copy)
@@ -1,9 +0,0 @@
-/*
- * Header to support legacy objson library
- */
-#ifndef OBJSON_XML2JSON_H
-#define OBJSON_XML2JSON_H
-#include <opensrf/osrf_json.h>
-#include <opensrf/osrf_json_xml.h>
-#include <opensrf/osrf_legacy_json.h>
-#endif
Index: include/objson/object.h
===================================================================
--- include/objson/object.h (revision 1372)
+++ include/objson/object.h (working copy)
@@ -1,8 +0,0 @@
-/*
- * Header to support legacy objson library
- */
-#ifndef OBJSON_OBJECT_H
-#define OBJSON_OBJECT_H
-#include <opensrf/osrf_json.h>
-#include <opensrf/osrf_legacy_json.h>
-#endif
Index: include/opensrf/osrfConfig.h
===================================================================
--- include/opensrf/osrfConfig.h (revision 1372)
+++ include/opensrf/osrfConfig.h (working copy)
@@ -45,11 +45,11 @@
int osrfConfigHasDefaultConfig();
/**
- Replaces the config object's objson object. This is useful
+ Replaces the config object's json object. This is useful
if you have an ojbson object already and not an XML config
file to parse.
@param cfg The config object to alter
- @param obj The objson objet to use when searching values
+ @param obj The json objet to use when searching values
*/
void osrfConfigReplaceConfig(osrfConfig* cfg, const jsonObject* obj);
Index: src/gateway/osrf_json_gateway.c
===================================================================
--- src/gateway/osrf_json_gateway.c (revision 1372)
+++ src/gateway/osrf_json_gateway.c (working copy)
@@ -16,14 +16,9 @@
#define DEFAULT_LOCALE "OSRFDefaultLocale"
#define CONFIG_CONTEXT "gateway"
#define JSON_PROTOCOL "OSRFGatewayLegacyJSON"
-#define GATEWAY_USE_LEGACY_JSON 1
+#define GATEWAY_USE_LEGACY_JSON 0
-/* our config structure */
typedef struct {
- char* configfile; /* our bootstrap config file */
-} osrf_json_gateway_config;
-
-typedef struct {
int legacyJSON;
} osrf_json_gateway_dir_config;
@@ -43,16 +38,13 @@
}
static const char* osrf_json_gateway_set_config(cmd_parms *parms, void *config, const char *arg) {
- osrf_json_gateway_config *cfg;
- cfg = ap_get_module_config(parms->server->module_config, &osrf_json_gateway_module);
- cfg->configfile = (char*) arg;
osrf_json_gateway_config_file = (char*) arg;
return NULL;
}
static const char* osrf_json_gateway_set_json_proto(cmd_parms *parms, void *config, const char *arg) {
osrf_json_gateway_dir_config* cfg = (osrf_json_gateway_dir_config*) config;
- cfg->legacyJSON = (!strcasecmp((char*) arg, "false")) ? 0 : 1;
+ cfg->legacyJSON = (!strcasecmp((char*) arg, "true")) ? 1 : 0;
return NULL;
}
@@ -125,10 +117,9 @@
char* (*jsonToStringFunc) (const jsonObject*) = legacy_jsonObjectToJSON;
if(dir_conf->legacyJSON) {
- ap_log_rerror( APLOG_MARK, APLOG_INFO, 0, r, "Using legacy JSON");
+ ap_log_rerror( APLOG_MARK, APLOG_DEBUG, 0, r, "Using legacy JSON");
} else {
- ap_log_rerror( APLOG_MARK, APLOG_INFO, 0, r, "Not using legacy JSON");
parseJSONFunc = jsonParseString;
jsonToStringFunc = jsonObjectToJSON;
}
Index: src/gateway/Makefile.am
===================================================================
--- src/gateway/Makefile.am (revision 1372)
+++ src/gateway/Makefile.am (working copy)
@@ -19,9 +19,9 @@
cur_LTLIBRARIES = libosrf_json_gateway.la libosrf_http_translator.la
libosrf_json_gateway_la_SOURCES = apachetools.c apachetools.h osrf_json_gateway.c
-libosrf_json_gateway_la_LIBADD = -lobjson -lopensrf
+libosrf_json_gateway_la_LIBADD = -lopensrf
libosrf_http_translator_la_SOURCES = apachetools.c apachetools.h osrf_http_translator.c
-libosrf_http_translator_la_LIBADD = -lobjson -lopensrf
+libosrf_http_translator_la_LIBADD = -lopensrf
include_HEADERS = apachetools.h
Index: src/c-apps/Makefile.am
===================================================================
--- src/c-apps/Makefile.am (revision 1372)
+++ src/c-apps/Makefile.am (working copy)
@@ -19,10 +19,10 @@
lib_LTLIBRARIES = libosrf_dbmath.la libosrf_math.la libosrf_version.la
timejson_SOURCES = timejson.c
-timejson_LDADD = -lobjson -lopensrf
+timejson_LDADD = -lopensrf
libosrf_dbmath_la_SOURCES = osrf_dbmath.c
-libosrf_dbmath_la_LIBADD = -lobjson -lopensrf
+libosrf_dbmath_la_LIBADD = -lopensrf
libosrf_math_la_SOURCES = osrf_math.c
-libosrf_math_la_LIBADD = -lobjson -lopensrf
+libosrf_math_la_LIBADD = -lopensrf
libosrf_version_la_SOURCES = osrf_version.c
-libosrf_version_la_LIBADD = -lobjson -lopensrf
+libosrf_version_la_LIBADD = -lopensrf
Index: src/libopensrf/Makefile.json
===================================================================
--- src/libopensrf/Makefile.json (revision 1372)
+++ src/libopensrf/Makefile.json (working copy)
@@ -13,9 +13,6 @@
EXT_TARGETS = osrf_list.o osrf_hash.o utils.o log.o md5.o string_array.o
all: $(TARGETS)
- if [ ! -z "$(OSRF_LEGACY_JSON)" ]; then \
- $(CC) -shared -W1 $(LDFLAGS) $(TARGETS) -o $(TMPDIR)/libobjson.so;\
- fi;
standalone: $(TARGETS) $(EXT_TARGETS)
$(CC) -shared -W1 $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(TARGETS) $(EXT_TARGETS) -o libosrf_json.so
Index: src/libopensrf/Makefile.am
===================================================================
--- src/libopensrf/Makefile.am (revision 1372)
+++ src/libopensrf/Makefile.am (working copy)
@@ -14,7 +14,7 @@
AM_CFLAGS = $(DEF_CFLAGS) -DASSUME_STATELESS -DOSRF_STRICT_PARAMS -rdynamic -fno-strict-aliasing -DOSRF_JSON_ENABLE_XML_UTILS
AM_LDFLAGS = $(DEF_LDFLAGS)
-LDADD = -lxml2 -ldl -lmemcache -lopensrf -lobjson
+LDADD = -lxml2 -ldl -lmemcache -lopensrf
OSRF_INC = @top_srcdir@/include/opensrf
@@ -97,20 +97,11 @@
osrf_json_test_SOURCES = osrf_json_test.c $(JSON_TARGS) $(JSON_DEP) $(JSON_TARGS_HEADS) $(JSON_DEP_HEADS)
noinst_LTLIBRARIES = libosrf_json.la
-lib_LTLIBRARIES = libobjson.la libopensrf.la
+lib_LTLIBRARIES = libopensrf.la
-if BUILDJSON
-libobjson_la_SOURCES = $(JSON_TARGS) $(JSON_DEP) $(JSON_TARGS_HEADS) $(JSON_DEP_HEADS)
-libobjson_la_CFLAGS = $(AM_CFLAGS)
-endif
-
libosrf_json_la_SOURCES = $(JSON_TARGS) $(JSON_DEP) $(JSON_TARGS_HEADS) $(JSON_DEP_HEADS)
libosrf_json_la_CFLAGS = $(AM_CFLAGS)
-if BUILDJSON
-libosrf_json_la_DEPENDENCIES = libobjson.la
-endif
-
libopensrf_la_CFLAGS = $(AM_CFLAGS)
libopensrf_la_DEPENDENCIES = libosrf_json.la
Index: src/Makefile.am
===================================================================
--- src/Makefile.am (revision 1372)
+++ src/Makefile.am (working copy)
@@ -28,11 +28,6 @@
AM_LDFLAGS = $(DEF_LDFLAGS)
AM_CFLAGS = $(DEF_CFLAGS)
-if BUILDJSON
-LDADD = -lobjson
-BJSON=1
-endif
-
if BUILDPYTHON
MAYBE_PY = python
endif
Index: Makefile.am
===================================================================
--- Makefile.am (revision 1372)
+++ Makefile.am (working copy)
@@ -24,7 +24,7 @@
export APXS2 = @APXS2@
export APACHE2_HEADERS = @APACHE2_HEADERS@
export DEF_CFLAGS = -D_LARGEFILE64_SOURCE $(MAYBE_DEBUG) -pipe -g -Wall -O2 -fPIC [EMAIL PROTECTED]@/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) @INCLUDES@
-export DEF_LDLIBS = -lobjson -lopensrf
+export DEF_LDLIBS = -lopensrf
export VAR = @localstatedir@
export PID = @localstatedir@/run/opensrf
export SOCK = @localstatedir@/lock/opensrf
@@ -72,10 +72,8 @@
EXTRA_DIST = $(DOC_FILES) $(EXAMPLES_FILES) $(libosrf_FILES) $(strn_compat_FILES) $(python_FILES) $(java_FILES) autogen.sh src/extras src/gateway/fieldmapper-c-xml-out.pl DCO-1.1.txt LICENSE.txt src/perlmods src/javascript
-objsonincludedir = @includedir@/objson
opensrfincludedir = @includedir@/opensrf
[EMAIL PROTECTED]@/include/objson
[EMAIL PROTECTED]@/include/opensrf
opensrfinclude_HEADERS = $(OSRFINC)/log.h \
@@ -107,7 +105,6 @@
$(OSRFINC)/utils.h \
$(OSRFINC)/xml_utils.h
-objsoninclude_HEADERS = $(OBJINC)/json2xml.h $(OBJINC)/json_parser.h $(OBJINC)/object.h $(OBJINC)/xml2json.h
SUBDIRS = src