From 0fc7c3d9e3b48169cff2d8381b0d2aca71656175 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 3 Feb 2010 14:26:11 +0100 Subject: [PATCH] Implement CreateDataBoxPFOInfo as isds_add_pfoinfo() --- doc/maintanance_web_services | 12 ++++++++++++ src/isds.c | 40 ++++++++++++++++++++++++++++++++++++++-- src/isds.h | 16 ++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/doc/maintanance_web_services b/doc/maintanance_web_services index 4ff4dcd..c3cdc79 100644 --- a/doc/maintanance_web_services +++ b/doc/maintanance_web_services @@ -117,6 +117,18 @@ CreateDataBox Returns ID of new box. +CreateDataBoxPFOInfo +==================== + +Report PFO insert into external registry. + +This service is only for sake of legislation. ISDS does use provided data +anyhow. + +It does not create a box nor return new box ID. See CreateDataBox for more +details. + + DeleteDataBox ============= diff --git a/src/isds.c b/src/isds.c index 27c4ca0..29f6783 100644 --- a/src/isds.c +++ b/src/isds.c @@ -4302,7 +4302,6 @@ isds_error isds_add_box(struct isds_ctx *context, isds_error err = IE_SUCCESS; xmlNodePtr request = NULL; xmlDocPtr response = NULL; - xmlChar *string = NULL; xmlXPathContextPtr xpath_ctx = NULL; xmlXPathObjectPtr result = NULL; @@ -4342,7 +4341,6 @@ leave: xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(response); xmlFreeNode(request); - free(string); if (!err) { isds_log(ILF_ISDS, ILL_DEBUG, @@ -4353,6 +4351,44 @@ leave: } +/* Notify ISDS about new PFO entity. + * This function has no real effect. + * @context is session context + * @box is PFO description including single primary user. + * @users is list of struct isds_DbUserInfo (contact address of PFO box owner) + * @former_names is optional undocumented string. Pass NULL if you don't care. + * @upper_box_id is optional ID of supper box if currently created box is + * subordinated. + * @ceo_label is optional title of OVM box owner (e.g. mayor) + * @refnumber is reallocated serial number of request assigned by ISDS. Use + * NULL, if you don't care.*/ +isds_error isds_add_pfoinfo(struct isds_ctx *context, + const struct isds_DbOwnerInfo *box, const struct isds_list *users, + const char *former_names, const char *upper_box_id, + const char *ceo_label, char **refnumber) { + isds_error err = IE_SUCCESS; + xmlNodePtr request = NULL; + + if (!context) return IE_INVALID_CONTEXT; + if (!box) return IE_INVAL; + + /* Build CreateDataBoxPFOInfo request */ + err = build_CreateDBInput_request(context, + &request, BAD_CAST "CreateDataBoxPFOInfo", + box, users, (xmlChar *) former_names, (xmlChar *) upper_box_id, + (xmlChar *) ceo_label); + if (err) goto leave; + + /* Send it to server and process response */ + err = send_request_check_drop_response(context, + SERVICE_DB_MANIPULATION, BAD_CAST "CreateDataBox", &request, + (xmlChar **) refnumber); +leave: + xmlFreeNode(request); + return err; +} + + /* Remove given given box permanetly. * @context is session context * @box is box description to delete diff --git a/src/isds.h b/src/isds.h index c9a14c4..d85a9c6 100644 --- a/src/isds.h +++ b/src/isds.h @@ -602,6 +602,22 @@ isds_error isds_add_box(struct isds_ctx *context, const char *former_names, const char *upper_box_id, const char *ceo_label, char **refnumber); +/* Notify ISDS about new PFO entity. + * This function has no real effect. + * @context is session context + * @box is PFO description including single primary user. + * @users is list of struct isds_DbUserInfo (contact address of PFO box owner) + * @former_names is optional undocumented string. Pass NULL if you don't care. + * @upper_box_id is optional ID of supper box if currently created box is + * subordinated. + * @ceo_label is optional title of OVM box owner (e.g. mayor) + * @refnumber is reallocated serial number of request assigned by ISDS. Use + * NULL, if you don't care.*/ +isds_error isds_add_pfoinfo(struct isds_ctx *context, + const struct isds_DbOwnerInfo *box, const struct isds_list *users, + const char *former_names, const char *upper_box_id, + const char *ceo_label, char **refnumber); + /* Remove given given box permanetly. * @context is session context * @box is box description to delete -- 2.11.4.GIT