summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-12-15 13:12:56 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-12-15 13:12:56 +0000
commit6ed1fbe7bedb8ea5639f34fe473447fcf5a6c654 (patch)
tree1b5ee9a5cf8528d572a059ea1f1baa9ac6d0d919
parentbe7a74a3482ca07624206c9fde54948c8be1d238 (diff)
downloadlasso-6ed1fbe7bedb8ea5639f34fe473447fcf5a6c654.tar.gz
lasso-6ed1fbe7bedb8ea5639f34fe473447fcf5a6c654.tar.xz
lasso-6ed1fbe7bedb8ea5639f34fe473447fcf5a6c654.zip
Added support of modify request from a SP to AP : updated element's class in level 1 (Modify and ModifyResponse) and implemented modify request in level 2 id wsf.
-rw-r--r--lasso/id-wsf/abstract_service.h5
-rw-r--r--lasso/id-wsf/personal_profile_service.c126
-rw-r--r--lasso/id-wsf/personal_profile_service.h31
-rw-r--r--lasso/xml/dst_modification.h2
-rw-r--r--lasso/xml/dst_modify.c8
-rw-r--r--lasso/xml/dst_modify.h4
-rw-r--r--lasso/xml/dst_modify_response.c6
-rw-r--r--lasso/xml/dst_modify_response.h2
8 files changed, 164 insertions, 20 deletions
diff --git a/lasso/id-wsf/abstract_service.h b/lasso/id-wsf/abstract_service.h
index 4b67efb6..a96d15d4 100644
--- a/lasso/id-wsf/abstract_service.h
+++ b/lasso/id-wsf/abstract_service.h
@@ -61,9 +61,12 @@ struct _LassoAbstractService {
/* Data being used when processing a query response message */
GList *data;
- /* QueryItem being used when processing a query request message */
+ /* QueryItems being used when processing a query request message */
GList *queryItem;
+ /* Modifications being used when processing a modify request message */
+ GList *modification;
+
};
struct _LassoAbstractServiceClass {
diff --git a/lasso/id-wsf/personal_profile_service.c b/lasso/id-wsf/personal_profile_service.c
index 4780f2c8..bf0ae4f3 100644
--- a/lasso/id-wsf/personal_profile_service.c
+++ b/lasso/id-wsf/personal_profile_service.c
@@ -58,6 +58,24 @@ lasso_personal_profile_service_add_data(LassoPersonalProfileService *pp, LassoNo
return 0;
}
+LassoDstModification*
+lasso_personal_profile_service_add_modification(LassoPersonalProfileService *pp, const char *select)
+{
+ LassoWsfProfile *profile;
+ LassoDstModification *modification;
+
+ g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
+ g_return_val_if_fail(select != NULL, NULL);
+
+ profile = LASSO_WSF_PROFILE(pp);
+
+ modification = lasso_dst_modification_new(select);
+ LASSO_DST_MODIFY(profile->request)->Modification = g_list_append(
+ LASSO_DST_MODIFY(profile->request)->Modification, (gpointer)modification);
+
+ return modification;
+}
+
LassoDstQueryItem*
lasso_personal_profile_service_add_query_item(LassoPersonalProfileService *pp, const char *select)
{
@@ -76,16 +94,54 @@ lasso_personal_profile_service_add_query_item(LassoPersonalProfileService *pp, c
return query_item;
}
+LassoDstModification*
+lasso_personal_profile_service_init_modify(LassoPersonalProfileService *pp,
+ LassoDiscoResourceOffering *resourceOffering,
+ LassoDiscoDescription *description,
+ const char *select)
+{
+ LassoDstModification *modification;
+ LassoWsfProfile *profile;
+ LassoAbstractService *service;
+
+ g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
+ g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(resourceOffering), NULL);
+ g_return_val_if_fail(LASSO_IS_DISCO_DESCRIPTION(description), NULL);
+
+ profile = LASSO_WSF_PROFILE(pp);
+
+ /* init Modify */
+ modification = lasso_dst_modification_new(select);
+ profile->request = LASSO_NODE(lasso_dst_modify_new(modification));
+
+ /* get ResourceID / EncryptedResourceID */
+ if (resourceOffering->ResourceID != NULL) {
+ LASSO_DST_MODIFY(profile->request)->ResourceID = resourceOffering->ResourceID;
+ }
+ else {
+ LASSO_DST_MODIFY(profile->request)->EncryptedResourceID = \
+ resourceOffering->EncryptedResourceID;
+ }
+
+ /* set msg_url */
+ /* TODO : implement WSDLRef */
+ if (description->Endpoint) {
+ profile->msg_url = g_strdup(description->Endpoint);
+ }
+
+ return modification;
+}
+
LassoDstQueryItem*
lasso_personal_profile_service_init_query(LassoPersonalProfileService *pp,
LassoDiscoResourceOffering *resourceOffering,
LassoDiscoDescription *description,
const char *select)
{
+ GList *l_desc;
LassoDstQueryItem *query_item;
LassoWsfProfile *profile;
LassoAbstractService *service;
- GList *l_desc;
g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(resourceOffering), NULL);
@@ -112,10 +168,6 @@ lasso_personal_profile_service_init_query(LassoPersonalProfileService *pp,
/* set msg_url */
/* TODO : implement WSDLRef */
- l_desc = resourceOffering->ServiceInstance->Description;
- while (l_desc != NULL) {
- l_desc = l_desc->next;
- }
if (description->Endpoint) {
profile->msg_url = g_strdup(description->Endpoint);
}
@@ -124,8 +176,46 @@ lasso_personal_profile_service_init_query(LassoPersonalProfileService *pp,
}
gint
-lasso_personal_profile_service_process_request_msg(LassoPersonalProfileService *pp,
- const char *query_soap_msg)
+lasso_personal_profile_service_process_modify_msg(LassoPersonalProfileService *pp,
+ const char *modify_soap_msg)
+{
+ LassoDstModify *modify;
+ LassoDstModification *modification;
+ LassoDstModifyResponse *modification_response;
+ LassoWsfProfile *profile;
+ LassoUtilityStatus *status;
+
+ g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), -1);
+ g_return_val_if_fail(modify_soap_msg != NULL, -1);
+
+ profile = LASSO_WSF_PROFILE(pp);
+
+ modify = g_object_new(LASSO_TYPE_DST_MODIFY, NULL);
+ lasso_node_init_from_message(LASSO_NODE(modify), modify_soap_msg);
+
+ /* get ResourceIDGroup */
+ if (modify->ResourceID) {
+ LASSO_ABSTRACT_SERVICE(pp)->ResourceID = modify->ResourceID;
+ }
+ else {
+ LASSO_ABSTRACT_SERVICE(pp)->EncryptedResourceID = modify->EncryptedResourceID;
+ }
+
+ /* get QueryItems */
+ LASSO_ABSTRACT_SERVICE(pp)->modification = modify->Modification;
+
+ /* init QueryResponse */
+ status = lasso_utility_status_new(LASSO_DST_STATUS_CODE_OK);
+ LASSO_WSF_PROFILE(pp)->response = LASSO_NODE(lasso_dst_modify_response_new(status));
+ LASSO_DST_MODIFY_RESPONSE(profile->response)->prefixServiceType = LASSO_PP_PREFIX;
+ LASSO_DST_MODIFY_RESPONSE(profile->response)->hrefServiceType = LASSO_PP_HREF;
+
+ return 0;
+}
+
+gint
+lasso_personal_profile_service_process_query_msg(LassoPersonalProfileService *pp,
+ const char *query_soap_msg)
{
LassoDstQuery *query;
LassoDstQueryItem *query_item;
@@ -162,8 +252,8 @@ lasso_personal_profile_service_process_request_msg(LassoPersonalProfileService *
}
gint
-lasso_personal_profile_service_process_response_msg(LassoPersonalProfileService *pp,
- const char *query_response_soap_msg)
+lasso_personal_profile_service_process_query_response_msg(LassoPersonalProfileService *pp,
+ const char *query_response_soap_msg)
{
LassoDstQueryResponse *query_response;
GList *Data;
@@ -181,6 +271,24 @@ lasso_personal_profile_service_process_response_msg(LassoPersonalProfileService
return 0;
}
+gint
+lasso_personal_profile_service_process_modify_response_msg(LassoPersonalProfileService *pp,
+ const char *modify_response_soap_msg)
+{
+ LassoDstModifyResponse *modify_response;
+ GList *Data;
+
+ g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), -1);
+ g_return_val_if_fail(modify_response_soap_msg != NULL, -1);
+
+ modify_response = g_object_new(LASSO_TYPE_DST_MODIFY_RESPONSE, NULL);
+ lasso_node_init_from_message(LASSO_NODE(modify_response), modify_response_soap_msg);
+
+ LASSO_WSF_PROFILE(pp)->response = LASSO_NODE(modify_response);
+
+ return 0;
+}
+
/*****************************************************************************/
/* private methods */
/*****************************************************************************/
diff --git a/lasso/id-wsf/personal_profile_service.h b/lasso/id-wsf/personal_profile_service.h
index c21478e4..46e1bd9f 100644
--- a/lasso/id-wsf/personal_profile_service.h
+++ b/lasso/id-wsf/personal_profile_service.h
@@ -32,8 +32,11 @@ extern "C" {
#endif /* __cplusplus */
#include <lasso/id-wsf/abstract_service.h>
-#include <lasso/xml/dst_query_item.h>
#include <lasso/xml/disco_resource_offering.h>
+#include <lasso/xml/dst_modification.h>
+#include <lasso/xml/dst_modify.h>
+#include <lasso/xml/dst_modify_response.h>
+#include <lasso/xml/dst_query_item.h>
#define LASSO_PP_HREF "urn:liberty:pp:2003-08"
#define LASSO_PP_PREFIX "pp"
@@ -43,8 +46,8 @@ extern "C" {
LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileService))
#define LASSO_PERSONAL_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass))
-#define LASSO_IS_PERSONAL_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- LASSO_TYPE_PERSONAL_PROFILE_SERVICE))
+#define LASSO_IS_PERSONAL_PROFILE_SERVICE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_PERSONAL_PROFILE_SERVICE))
#define LASSO_IS_PERSONAL_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
LASSO_TYPE_PERSONAL_PROFILE_SERVICE))
#define LASSO_PERSONAL_PROFILE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
@@ -69,17 +72,39 @@ LASSO_EXPORT GType lasso_personal_profile_service_get_type(void);
LASSO_EXPORT gint lasso_personal_profile_service_add_data(
LassoPersonalProfileService *pp, LassoNode *requested_data);
+LASSO_EXPORT LassoDstModification* lasso_personal_profile_service_add_modification(
+ LassoPersonalProfileService *pp, const char *select);
+
LASSO_EXPORT LassoDstQueryItem* lasso_personal_profile_service_add_query_item(
LassoPersonalProfileService *pp, const char *select);
+LASSO_EXPORT LassoDstModification* lasso_personal_profile_service_init_modify(
+ LassoPersonalProfileService *pp,
+ LassoDiscoResourceOffering *ro,
+ LassoDiscoDescription *description,
+ const char *select);
+
LASSO_EXPORT LassoDstQueryItem* lasso_personal_profile_service_init_query(
LassoPersonalProfileService *pp,
LassoDiscoResourceOffering *ro,
LassoDiscoDescription *description,
const char *select);
+LASSO_EXPORT gint lasso_personal_profile_service_process_modify_msg(LassoPersonalProfileService *pp,
+ const char *modify_soap_msg);
+
LASSO_EXPORT LassoPersonalProfileService* lasso_personal_profile_service_new(LassoServer *server);
+LASSO_EXPORT gint lasso_personal_profile_process_query_msg(LassoPersonalProfileService *pp,
+ const char *request_soap_msg);
+
+LASSO_EXPORT gint lasso_personal_profile_process_query_response_msg(LassoPersonalProfileService *pp,
+ const char *response_soap_msg);
+
+LASSO_EXPORT gint lasso_personal_profile_service_process_modify_response_msg(
+ LassoPersonalProfileService *pp,
+ const char *modify_response_soap_msg);
+
LASSO_EXPORT gint lasso_personal_profile_service_process_request_msg(
LassoPersonalProfileService *pp, const char *query_soap_msg);
diff --git a/lasso/xml/dst_modification.h b/lasso/xml/dst_modification.h
index ea8d2769..82ba3a2d 100644
--- a/lasso/xml/dst_modification.h
+++ b/lasso/xml/dst_modification.h
@@ -52,7 +52,7 @@ struct _LassoDstModification {
LassoNode parent;
char *Select;
- LassoDstNewData *NewData;
+ GList *NewData;
char *id;
char *notChangedSince;
diff --git a/lasso/xml/dst_modify.c b/lasso/xml/dst_modify.c
index 801b9917..545504f6 100644
--- a/lasso/xml/dst_modify.c
+++ b/lasso/xml/dst_modify.c
@@ -64,7 +64,7 @@ static struct XmlSnippet schema_snippets[] = {
{ "ResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDstModify, ResourceID) },
{ "EncryptedResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDstModify,
EncryptedResourceID) },
- { "Modification", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDstModify,
+ { "Modification", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoDstModify,
Modification) },
/* FIXME : implement Extension element */
{ "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDstModify, id) },
@@ -155,12 +155,16 @@ lasso_dst_modify_get_type()
}
LassoDstModify*
-lasso_dst_modify_new()
+lasso_dst_modify_new(LassoDstModification *modification)
{
LassoDstModify *modify;
+ g_return_val_if_fail(LASSO_IS_DST_MODIFICATION(modification) == TRUE, NULL);
+
modify = g_object_new(LASSO_TYPE_DST_MODIFY, NULL);
+ modify->Modification = g_list_append(modify->Modification, modification);
+
return modify;
}
diff --git a/lasso/xml/dst_modify.h b/lasso/xml/dst_modify.h
index ab98cc13..689cfddc 100644
--- a/lasso/xml/dst_modify.h
+++ b/lasso/xml/dst_modify.h
@@ -53,7 +53,7 @@ struct _LassoDstModify {
LassoDiscoResourceID *ResourceID;
LassoDiscoEncryptedResourceID *EncryptedResourceID;
- LassoDstModification *Modification;
+ GList *Modification;
/* FIXME : implement Extension element */
char *id;
@@ -69,7 +69,7 @@ struct _LassoDstModifyClass {
LASSO_EXPORT GType lasso_dst_modify_get_type(void);
-LASSO_EXPORT LassoDstModify* lasso_dst_modify_new(void);
+LASSO_EXPORT LassoDstModify* lasso_dst_modify_new(LassoDstModification *modification);
#ifdef __cplusplus
}
diff --git a/lasso/xml/dst_modify_response.c b/lasso/xml/dst_modify_response.c
index 7708bac1..6619dd72 100644
--- a/lasso/xml/dst_modify_response.c
+++ b/lasso/xml/dst_modify_response.c
@@ -136,12 +136,16 @@ lasso_dst_modify_response_get_type()
}
LassoDstModifyResponse*
-lasso_dst_modify_response_new()
+lasso_dst_modify_response_new(LassoUtilityStatus *status)
{
LassoDstModifyResponse *modify_response;
+ g_return_val_if_fail(LASSO_IS_UTILITY_STATUS(status) == TRUE, NULL);
+
modify_response = g_object_new(LASSO_TYPE_DST_MODIFY_RESPONSE, NULL);
+ modify_response->Status = status;
+
return modify_response;
}
diff --git a/lasso/xml/dst_modify_response.h b/lasso/xml/dst_modify_response.h
index 9ba53bfe..4100a5a6 100644
--- a/lasso/xml/dst_modify_response.h
+++ b/lasso/xml/dst_modify_response.h
@@ -67,7 +67,7 @@ struct _LassoDstModifyResponseClass {
LASSO_EXPORT GType lasso_dst_modify_response_get_type(void);
-LASSO_EXPORT LassoDstModifyResponse* lasso_dst_modify_response_new(void);
+LASSO_EXPORT LassoDstModifyResponse* lasso_dst_modify_response_new(LassoUtilityStatus *status);
#ifdef __cplusplus
}