summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2005-09-10 19:36:33 +0000
committerFrederic Peters <fpeters@entrouvert.com>2005-09-10 19:36:33 +0000
commit27e9d0edcd1d0fb088bba0b2927ec06f45bac0b3 (patch)
tree7580d8e1a7806397a22b9e4f56104efa87c56f63
parent196dd4f534580e4dee78580a112e3b01a6abf953 (diff)
downloadlasso-27e9d0edcd1d0fb088bba0b2927ec06f45bac0b3.tar.gz
lasso-27e9d0edcd1d0fb088bba0b2927ec06f45bac0b3.tar.xz
lasso-27e9d0edcd1d0fb088bba0b2927ec06f45bac0b3.zip
data_service_init_query may be called without parameters.
-rw-r--r--lasso/id-wsf/data_service.c9
-rw-r--r--lasso/xml/dst_query.c15
-rw-r--r--lasso/xml/dst_query.h2
-rw-r--r--swig/Lasso-wsf.i8
4 files changed, 27 insertions, 7 deletions
diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c
index 6d43c0d2..456951c5 100644
--- a/lasso/id-wsf/data_service.c
+++ b/lasso/id-wsf/data_service.c
@@ -116,6 +116,9 @@ lasso_data_service_add_query_item(LassoDataService *service,
* optional itemID set to @item_id). @item_id may be NULL only if the query
* won't contain other query items.
*
+ * If both @select and @item_id are NULL, only a skeleton request is created
+ * and calls to lasso_data_service_add_query_item() will need to be done.
+ *
* Return value: 0 on success; or a negative value otherwise.
**/
gint
@@ -129,7 +132,11 @@ lasso_data_service_init_query(LassoDataService *service, const char *select,
profile = LASSO_WSF_PROFILE(service);
- query = lasso_dst_query_new(lasso_dst_query_item_new(select, item_id));
+ if (select) {
+ query = lasso_dst_query_new(lasso_dst_query_item_new(select, item_id));
+ } else {
+ query = lasso_dst_query_new(NULL);
+ }
profile->request = LASSO_NODE(query);
offering = service->private_data->offering;
diff --git a/lasso/xml/dst_query.c b/lasso/xml/dst_query.c
index 91541532..1f68b061 100644
--- a/lasso/xml/dst_query.c
+++ b/lasso/xml/dst_query.c
@@ -166,16 +166,25 @@ lasso_dst_query_get_type()
return this_type;
}
+
+/**
+ * lasso_dst_query_new:
+ * @query_item: query item to embed in request (optional)
+ *
+ * Creates a new #LassoDstQuery object. If @query_item is set it is added to
+ * the requested query items.
+ *
+ * Return value: a newly created #LassoDstQuery object.
+ **/
LassoDstQuery*
lasso_dst_query_new(LassoDstQueryItem *queryItem)
{
LassoDstQuery *query;
- g_return_val_if_fail(LASSO_IS_DST_QUERY_ITEM(queryItem), NULL);
-
query = g_object_new(LASSO_TYPE_DST_QUERY, NULL);
- query->QueryItem = g_list_append(query->QueryItem, queryItem);
+ if (queryItem)
+ query->QueryItem = g_list_append(query->QueryItem, queryItem);
return query;
}
diff --git a/lasso/xml/dst_query.h b/lasso/xml/dst_query.h
index 8676b7bf..c4918da4 100644
--- a/lasso/xml/dst_query.h
+++ b/lasso/xml/dst_query.h
@@ -69,7 +69,7 @@ struct _LassoDstQueryClass {
};
LASSO_EXPORT GType lasso_dst_query_get_type(void);
-LASSO_EXPORT LassoDstQuery* lasso_dst_query_new(LassoDstQueryItem *queryItem);
+LASSO_EXPORT LassoDstQuery* lasso_dst_query_new(LassoDstQueryItem *query_item);
#ifdef __cplusplus
}
diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i
index e97f7176..bc9af184 100644
--- a/swig/Lasso-wsf.i
+++ b/swig/Lasso-wsf.i
@@ -591,7 +591,7 @@ typedef struct {
/* Methods inherited from ProfileService */
THROW_ERROR
- gint initQuery(const char *select, const char *item_id = NULL);
+ gint initQuery(const char *select = NULL, const char *item_id = NULL);
END_THROW_ERROR
LassoDstQueryItem *addQueryItem(const char *select, const char *item_id);
@@ -779,7 +779,7 @@ typedef struct {
/* Methods */
THROW_ERROR
- gint initQuery(const char *select, const char *item_id = NULL);
+ gint initQuery(const char *select = NULL, const char *item_id = NULL);
END_THROW_ERROR
LassoDstQueryItem *addQueryItem(const char *select, const char *item_id);
@@ -803,6 +803,9 @@ typedef struct {
%newobject getAnswer;
char* getAnswer(const char *select = NULL);
+ %newobject getAnswerForItemId;
+ char* getAnswerForItemId(const char *itemId);
+
int initModify(char *select, const char *xmlString);
LassoDstModification *addModification(char *select);
@@ -902,6 +905,7 @@ typedef struct {
#define LassoDataService_processQueryResponseMsg lasso_data_service_process_query_response_msg
#define LassoDataService_validateQuery lasso_data_service_validate_query
#define LassoDataService_getAnswer(self,select) get_xml_string(lasso_data_service_get_answer(self, select))
+#define LassoDataService_getAnswerForItemId(self,itemId) get_xml_string(lasso_data_service_get_answer_for_item_id(self, itemId))
%}