# rm -f JobProvenanceTypes.wsdl
# ${gsoap_prefix}/bin/soapcpp2 -w -c -p env_ env.xh
-check:
- -echo nothing yet
+check:
+ ../test/run-test.sh
doc:
soap_ops.o: soap_ops.c jpis_H.h jpis_.nsmap soap_version.h db_ops.h ws_ps_typeref.h ws_is_typeref.h context.h
ws_ps_typeref.o: ws_ps_typeref.c jpis_H.h ws_typemap.h ws_ps_typeref.h
ws_is_typeref.o: ws_is_typeref.c jpis_H.h ws_typemap.h ws_is_typeref.h
+comon_server.o: common_server.c common_server.h
.PHONY: default all compile check doc stage dist distsrc distbin install clean
#create table attr_<attrid> (
# jobid char(32) binary not null,
# value varchar(255) binary not null,
-# full_value mediumblob not null,
+# full_value mediumblob not null,
+# origin int not null,
#
# index (jobid),
# index (value)
glite_jp_get_conf(0, NULL, NULL, &conf);
if (default_server) strcpy(server, default_server);
else snprintf(server, sizeof(server), "http://localhost:%s", conf->port ? conf->port : GLITE_JPIS_DEFAULT_PORT_STR);
+ printf("JP index server: %s\n", server);
+
glite_jpis_init_context(&isctx, ctx, conf);
if (glite_jpis_init_db(isctx) != 0) {
fprintf(stderr, "Connect DB failed: %s (%s)\n",
jobid CHAR(32) BINARY NOT NULL,\n\
value %s BINARY NOT NULL,\n\
full_value %s NOT NULL,\n\
+ origin INT NOT NULL,\n\
\n\
INDEX (jobid),\n\
INDEX (value)\n\
);"
-#define SQLCMD_INSERT_ATTRVAL "INSERT INTO " TABLE_PREFIX_DATA "%s (jobid, value, full_value) VALUES (\n\
+#define SQLCMD_INSERT_ATTRVAL "INSERT INTO " TABLE_PREFIX_DATA "%s (jobid, value, full_value, origin) VALUES (\n\
'%s',\n\
'%s',\n\
- '%s'\n\
+ '%s',\n\
+ '%d'\n\
)"
#define INDEX_LENGTH 255
int glite_jpis_insertAttrVal(glite_jpis_context_t ctx, const char *jobid, glite_jp_attrval_t *av) {
char *sql, *table, *value, *full_value, *md5_jobid;
+ long int origin;
table = glite_jpis_attr_name2id(av->name);
value = glite_jp_attrval_to_db_index(ctx->jpctx, av, INDEX_LENGTH);
full_value = glite_jp_attrval_to_db_full(ctx->jpctx, av);
md5_jobid = str2md5(jobid);
- asprintf(&sql, SQLCMD_INSERT_ATTRVAL, table, md5_jobid, value, full_value);
+ origin = av->origin;
+ asprintf(&sql, SQLCMD_INSERT_ATTRVAL, table, md5_jobid, value, full_value, origin);
free(md5_jobid);
free(table);
free(value);