summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2005-01-13 13:10:01 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2005-01-13 13:10:01 +0000
commit6920717ade85a8d884d75283f79475a406deaf3c (patch)
tree82c2b75e540c1d7b811d9633515415de8b25dcd1
parent4411851ee26ed5edf09c30c3cee6aa76650c5a37 (diff)
downloadlasso-6920717ade85a8d884d75283f79475a406deaf3c.tar.gz
lasso-6920717ade85a8d884d75283f79475a406deaf3c.tar.xz
lasso-6920717ade85a8d884d75283f79475a406deaf3c.zip
Removed specific class LassoPersonalProfileService. Added generic web service class LassoProfileService.
-rw-r--r--lasso/id-wsf/Makefile.am4
-rw-r--r--lasso/id-wsf/personal_profile_service.h122
-rw-r--r--lasso/id-wsf/profile_service.c (renamed from lasso/id-wsf/personal_profile_service.c)177
-rw-r--r--lasso/id-wsf/profile_service.h128
-rw-r--r--swig/Lasso-wsf.i89
5 files changed, 256 insertions, 264 deletions
diff --git a/lasso/id-wsf/Makefile.am b/lasso/id-wsf/Makefile.am
index a5149520..64b562b6 100644
--- a/lasso/id-wsf/Makefile.am
+++ b/lasso/id-wsf/Makefile.am
@@ -12,12 +12,12 @@ liblasso_id_wsf_la_SOURCES = \
abstract_service.c \
discovery.c \
interaction_profile_service.c \
- personal_profile_service.c \
+ profile_service.c \
wsf_profile.c
liblassoinclude_HEADERS = \
abstract_service.h \
discovery.h \
interaction_profile_service.h \
- personal_profile_service.h \
+ profile_service.h \
wsf_profile.h
diff --git a/lasso/id-wsf/personal_profile_service.h b/lasso/id-wsf/personal_profile_service.h
deleted file mode 100644
index eb994b8f..00000000
--- a/lasso/id-wsf/personal_profile_service.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* $Id$
- *
- * Lasso - A free implementation of the Liberty Alliance specifications.
- *
- * Copyright (C) 2004 Entr'ouvert
- * http://lasso.entrouvert.org
- *
- * Authors: Nicolas Clapies <nclapies@entrouvert.com>
- * Valery Febvre <vfebvre@easter-eggs.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __LASSO_PERSONAL_PROFILE_SERVICE_H__
-#define __LASSO_PERSONAL_PROFILE_SERVICE_H__
-
-#ifdef __cplusplus
-extern "C" {
-
-#endif /* __cplusplus */
-
-#include <lasso/id-wsf/abstract_service.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.h>
-#include <lasso/xml/dst_query_item.h>
-#include <lasso/xml/dst_query_response.h>
-#include <lasso/xml/pp_msg_contact.h>
-
-#define LASSO_PP_HREF "urn:liberty:pp:2003-08"
-#define LASSO_PP_PREFIX "pp"
-
-#define LASSO_TYPE_PERSONAL_PROFILE_SERVICE (lasso_personal_profile_service_get_type())
-#define LASSO_PERSONAL_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- 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_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), \
- LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass))
-
-typedef struct _LassoPersonalProfileService LassoPersonalProfileService;
-typedef struct _LassoPersonalProfileServiceClass LassoPersonalProfileServiceClass;
-typedef struct _LassoPersonalProfileServicePrivate LassoPersonalProfileServicePrivate;
-
-struct _LassoPersonalProfileService {
- LassoAbstractService parent;
-
-};
-
-struct _LassoPersonalProfileServiceClass {
- LassoAbstractServiceClass parent;
-};
-
-
-LASSO_EXPORT GType lasso_personal_profile_service_get_type(void);
-
-LASSO_EXPORT LassoPersonalProfileService* lasso_personal_profile_service_new(LassoServer *server);
-
-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 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_query_msg(LassoPersonalProfileService *pp,
- const char *request_soap_msg);
-
-LASSO_EXPORT gint lasso_personal_profile_service_process_query_response_msg(
- LassoPersonalProfileService *pp,
- const char *response_soap_msg);
-
-LASSO_EXPORT gint lasso_personal_profile_service_process_request_msg(
- LassoPersonalProfileService *pp, const char *query_soap_msg);
-
-LASSO_EXPORT gint lasso_personal_profile_service_process_response_msg(
- LassoPersonalProfileService *pp, const char *query_response_soap_msg);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __LASSO_PERSONAL_PROFILE_SERVICE_H__ */
diff --git a/lasso/id-wsf/personal_profile_service.c b/lasso/id-wsf/profile_service.c
index e0c99d2d..ff687547 100644
--- a/lasso/id-wsf/personal_profile_service.c
+++ b/lasso/id-wsf/profile_service.c
@@ -23,31 +23,26 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <lasso/xml/disco_resource_offering.h>
-#include <lasso/xml/dst_data.h>
+#include <lasso/id-wsf/profile_service.h>
#include <lasso/xml/dst_query.h>
#include <lasso/xml/dst_query_response.h>
-#include <lasso/id-wsf/personal_profile_service.h>
-
-struct _LassoPersonalProfileServicePrivate
-{
- gboolean dispose_has_run;
-};
+#include <lasso/xml/dst_modify.h>
+#include <lasso/xml/dst_modify_response.h>
/*****************************************************************************/
/* public methods */
/*****************************************************************************/
gint
-lasso_personal_profile_service_add_data(LassoPersonalProfileService *pp, LassoNode *requested_data)
+lasso_profile_service_add_data(LassoProfileService *service, LassoNode *requested_data)
{
LassoWsfProfile *profile;
LassoDstData *data;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp) == TRUE, -1);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service) == TRUE, -1);
g_return_val_if_fail(LASSO_IS_NODE(requested_data) == TRUE, -1);
- profile = LASSO_WSF_PROFILE(pp);
+ profile = LASSO_WSF_PROFILE(service);
data = lasso_dst_data_new();
data->any = g_list_append(data->any, requested_data);
@@ -59,15 +54,15 @@ lasso_personal_profile_service_add_data(LassoPersonalProfileService *pp, LassoNo
}
LassoDstModification*
-lasso_personal_profile_service_add_modification(LassoPersonalProfileService *pp, const char *select)
+lasso_profile_service_add_modification(LassoProfileService *service, const char *select)
{
LassoWsfProfile *profile;
LassoDstModification *modification;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL);
g_return_val_if_fail(select != NULL, NULL);
- profile = LASSO_WSF_PROFILE(pp);
+ profile = LASSO_WSF_PROFILE(service);
modification = lasso_dst_modification_new(select);
LASSO_DST_MODIFY(profile->request)->Modification = g_list_append(
@@ -77,15 +72,15 @@ lasso_personal_profile_service_add_modification(LassoPersonalProfileService *pp,
}
LassoDstQueryItem*
-lasso_personal_profile_service_add_query_item(LassoPersonalProfileService *pp, const char *select)
+lasso_profile_service_add_query_item(LassoProfileService *service, const char *select)
{
LassoWsfProfile *profile;
LassoDstQueryItem *query_item;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL);
g_return_val_if_fail(select != NULL, NULL);
- profile = LASSO_WSF_PROFILE(pp);
+ profile = LASSO_WSF_PROFILE(service);
query_item = lasso_dst_query_item_new(select);
LASSO_DST_QUERY(profile->request)->QueryItem = g_list_append(
@@ -95,26 +90,27 @@ lasso_personal_profile_service_add_query_item(LassoPersonalProfileService *pp, c
}
LassoDstModification*
-lasso_personal_profile_service_init_modify(LassoPersonalProfileService *pp,
- LassoDiscoResourceOffering *resourceOffering,
- LassoDiscoDescription *description,
- const char *select)
+lasso_profile_service_init_modify(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ 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_PROFILE_SERVICE(service), 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);
+ profile = LASSO_WSF_PROFILE(service);
/* init Modify */
modification = lasso_dst_modification_new(select);
profile->request = LASSO_NODE(lasso_dst_modify_new(modification));
- LASSO_DST_MODIFY(profile->request)->prefixServiceType = LASSO_PP_PREFIX;
- LASSO_DST_MODIFY(profile->request)->hrefServiceType = LASSO_PP_HREF;
+ LASSO_DST_MODIFY(profile->request)->prefixServiceType = g_strdup(prefix);
+ LASSO_DST_MODIFY(profile->request)->hrefServiceType = g_strdup(href);
/* get ResourceID / EncryptedResourceID */
if (resourceOffering->ResourceID != NULL) {
@@ -135,29 +131,29 @@ lasso_personal_profile_service_init_modify(LassoPersonalProfileService *pp,
}
LassoDstQueryItem*
-lasso_personal_profile_service_init_query(LassoPersonalProfileService *pp,
- LassoDiscoResourceOffering *resourceOffering,
- LassoDiscoDescription *description,
- const char *select)
+lasso_profile_service_init_query(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ LassoDiscoResourceOffering *resourceOffering,
+ LassoDiscoDescription *description,
+ const char *select)
{
GList *l_desc;
LassoDstQueryItem *query_item;
LassoWsfProfile *profile;
- LassoAbstractService *service;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), NULL);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL);
g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(resourceOffering), NULL);
g_return_val_if_fail(LASSO_IS_DISCO_DESCRIPTION(description), NULL);
g_return_val_if_fail(select != NULL, NULL);
- profile = LASSO_WSF_PROFILE(pp);
- service = LASSO_ABSTRACT_SERVICE(pp);
+ profile = LASSO_WSF_PROFILE(service);
/* init Query */
query_item = lasso_dst_query_item_new(select);
profile->request = LASSO_NODE(lasso_dst_query_new(query_item));
- LASSO_DST_QUERY(profile->request)->prefixServiceType = LASSO_PP_PREFIX;
- LASSO_DST_QUERY(profile->request)->hrefServiceType = LASSO_PP_HREF;
+ LASSO_DST_QUERY(profile->request)->prefixServiceType = g_strdup(prefix);
+ LASSO_DST_QUERY(profile->request)->hrefServiceType = g_strdup(href);
/* get ResourceID / EncryptedResourceID */
if (resourceOffering->ResourceID != NULL) {
@@ -178,8 +174,10 @@ lasso_personal_profile_service_init_query(LassoPersonalProfileService *pp,
}
gint
-lasso_personal_profile_service_process_modify_msg(LassoPersonalProfileService *pp,
- const char *modify_soap_msg)
+lasso_profile_service_process_modify_msg(LassoProfileService *service,
+ const char *prefix, /* FIXME : must be get from message */
+ const char *href, /* FIXME : must be get from message */
+ const char *modify_soap_msg)
{
LassoDstModify *modify;
LassoDstModification *modification;
@@ -187,39 +185,32 @@ lasso_personal_profile_service_process_modify_msg(LassoPersonalProfileService *p
LassoWsfProfile *profile;
LassoUtilityStatus *status;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), -1);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), -1);
g_return_val_if_fail(modify_soap_msg != NULL, -1);
- profile = LASSO_WSF_PROFILE(pp);
+ profile = LASSO_WSF_PROFILE(service);
modify = g_object_new(LASSO_TYPE_DST_MODIFY, NULL);
lasso_node_init_from_message(LASSO_NODE(modify), modify_soap_msg);
profile->request = LASSO_NODE(modify);
- /* 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;
+ LASSO_WSF_PROFILE(service)->response = LASSO_NODE(lasso_dst_modify_response_new(status));
+ LASSO_DST_MODIFY_RESPONSE(profile->response)->prefixServiceType = \
+ g_strdup(prefix);
+ LASSO_DST_MODIFY_RESPONSE(profile->response)->hrefServiceType = \
+ g_strdup(href);
return 0;
}
gint
-lasso_personal_profile_service_process_query_msg(LassoPersonalProfileService *pp,
- const char *query_soap_msg)
+lasso_profile_service_process_query_msg(LassoProfileService *service,
+ const char *prefix, /* FIXME : must be get from message */
+ const char *href, /* FIXME : must be get from message */
+ const char *query_soap_msg)
{
LassoDstQuery *query;
LassoDstQueryItem *query_item;
@@ -227,130 +218,120 @@ lasso_personal_profile_service_process_query_msg(LassoPersonalProfileService *pp
LassoWsfProfile *profile;
LassoUtilityStatus *status;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), -1);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), -1);
g_return_val_if_fail(query_soap_msg != NULL, -1);
- profile = LASSO_WSF_PROFILE(pp);
+ profile = LASSO_WSF_PROFILE(service);
query = g_object_new(LASSO_TYPE_DST_QUERY, NULL);
lasso_node_init_from_message(LASSO_NODE(query), query_soap_msg);
profile->request = LASSO_NODE(query);
- /* get ResourceIDGroup */
- if (query->ResourceID) {
- LASSO_ABSTRACT_SERVICE(pp)->ResourceID = query->ResourceID;
- }
- else {
- LASSO_ABSTRACT_SERVICE(pp)->EncryptedResourceID = query->EncryptedResourceID;
- }
-
- /* get QueryItems */
- LASSO_ABSTRACT_SERVICE(pp)->queryItem = query->QueryItem;
-
/* init QueryResponse */
status = lasso_utility_status_new(LASSO_DST_STATUS_CODE_OK);
- LASSO_WSF_PROFILE(pp)->response = LASSO_NODE(lasso_dst_query_response_new(status));
- LASSO_DST_QUERY_RESPONSE(profile->response)->prefixServiceType = LASSO_PP_PREFIX;
- LASSO_DST_QUERY_RESPONSE(profile->response)->hrefServiceType = LASSO_PP_HREF;
+ LASSO_WSF_PROFILE(service)->response = LASSO_NODE(lasso_dst_query_response_new(status));
+ LASSO_DST_QUERY_RESPONSE(profile->response)->prefixServiceType = g_strdup(prefix);
+ LASSO_DST_QUERY_RESPONSE(profile->response)->hrefServiceType = g_strdup(href);
return 0;
}
gint
-lasso_personal_profile_service_process_query_response_msg(LassoPersonalProfileService *pp,
- const char *query_response_soap_msg)
+lasso_profile_service_process_query_response_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ const char *query_response_soap_msg)
{
LassoDstQueryResponse *query_response;
GList *Data;
- g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(pp), -1);
+ g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), -1);
g_return_val_if_fail(query_response_soap_msg != NULL, -1);
query_response = g_object_new(LASSO_TYPE_DST_QUERY_RESPONSE, NULL);
lasso_node_init_from_message(LASSO_NODE(query_response), query_response_soap_msg);
- LASSO_WSF_PROFILE(pp)->response = LASSO_NODE(query_response);
-
- LASSO_ABSTRACT_SERVICE(pp)->data = query_response->Data;
+ LASSO_WSF_PROFILE(service)->response = LASSO_NODE(query_response);
return 0;
}
gint
-lasso_personal_profile_service_process_modify_response_msg(LassoPersonalProfileService *pp,
- const char *modify_response_soap_msg)
+lasso_profile_service_process_modify_response_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ 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(LASSO_IS_PROFILE_SERVICE(service), -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);
+ LASSO_WSF_PROFILE(service)->response = LASSO_NODE(modify_response);
return 0;
}
+
/*****************************************************************************/
/* private methods */
/*****************************************************************************/
-static LassoPersonalProfileServiceClass *parent_class = NULL;
-
+static LassoProfileServiceClass *parent_class = NULL;
/*****************************************************************************/
/* instance and class init functions */
/*****************************************************************************/
static void
-instance_init(LassoPersonalProfileService *pp)
+instance_init(LassoProfileService *service)
{
}
static void
-class_init(LassoPersonalProfileServiceClass *klass)
+class_init(LassoProfileServiceClass *klass)
{
- parent_class = g_type_class_peek_parent(klass);
}
GType
-lasso_personal_profile_service_get_type()
+lasso_profile_service_get_type()
{
static GType this_type = 0;
if (!this_type) {
static const GTypeInfo this_info = {
- sizeof(LassoPersonalProfileServiceClass),
+ sizeof(LassoProfileServiceClass),
NULL,
NULL,
(GClassInitFunc) class_init,
NULL,
NULL,
- sizeof(LassoPersonalProfileService),
+ sizeof(LassoProfileService),
0,
(GInstanceInitFunc) instance_init,
};
- this_type = g_type_register_static(LASSO_TYPE_ABSTRACT_SERVICE,
- "LassoPersonalProfileService", &this_info, 0);
+ this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE,
+ "LassoProfileService", &this_info, 0);
}
return this_type;
}
-LassoPersonalProfileService*
-lasso_personal_profile_service_new(LassoServer *server)
+LassoProfileService*
+lasso_profile_service_new(LassoServer *server)
{
- LassoPersonalProfileService *pp = NULL;
+ LassoProfileService *service = NULL;
- g_return_val_if_fail(LASSO_IS_SERVER(server), NULL);
+ g_return_val_if_fail(LASSO_IS_SERVER(server) == TRUE, NULL);
- pp = g_object_new(LASSO_TYPE_PERSONAL_PROFILE_SERVICE, NULL);
+ service = g_object_new(LASSO_TYPE_PROFILE_SERVICE, NULL);
- return pp;
+ return service;
}
diff --git a/lasso/id-wsf/profile_service.h b/lasso/id-wsf/profile_service.h
new file mode 100644
index 00000000..c8d908b5
--- /dev/null
+++ b/lasso/id-wsf/profile_service.h
@@ -0,0 +1,128 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_PROFILE_SERVICE_H__
+#define __LASSO_PROFILE_SERVICE_H__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif /* __cplusplus */
+
+#include <lasso/id-wsf/wsf_profile.h>
+#include <lasso/xml/disco_resource_id.h>
+#include <lasso/xml/disco_encrypted_resource_id.h>
+#include <lasso/xml/dst_data.h>
+#include <lasso/xml/dst_modification.h>
+#include <lasso/xml/dst_query_item.h>
+#include <lasso/xml/disco_resource_offering.h>
+
+#define LASSO_TYPE_PROFILE_SERVICE (lasso_profile_service_get_type())
+#define LASSO_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ LASSO_TYPE_PROFILE_SERVICE, LassoProfileService))
+#define LASSO_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
+ LASSO_TYPE_PROFILE_SERVICE, LassoProfileServiceClass))
+#define LASSO_IS_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ LASSO_TYPE_PROFILE_SERVICE))
+#define LASSO_IS_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ LASSO_TYPE_PROFILE_SERVICE))
+#define LASSO_PROFILE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
+ LASSO_TYPE_PROFILE_SERVICE, LassoProfileServiceClass))
+
+typedef struct _LassoProfileService LassoProfileService;
+typedef struct _LassoProfileServiceClass LassoProfileServiceClass;
+typedef struct _LassoProfileServicePrivate LassoProfileServicePrivate;
+
+struct _LassoProfileService {
+ LassoWsfProfile parent;
+
+ /* ResourceID / EncryptedResourceID being used when processing request message */
+/* LassoDiscoResourceID *ResourceID; */
+/* LassoDiscoEncryptedResourceID *EncryptedResourceID; */
+
+};
+
+struct _LassoProfileServiceClass {
+ LassoWsfProfileClass parent;
+};
+
+
+LASSO_EXPORT GType lasso_profile_service_get_type(void);
+
+LASSO_EXPORT LassoProfileService* lasso_profile_service_new(LassoServer *server);
+
+
+LASSO_EXPORT gint lasso_profile_service_add_data(LassoProfileService *service,
+ LassoNode *requested_data);
+
+LASSO_EXPORT LassoDstModification* lasso_profile_service_add_modification(
+ LassoProfileService *service,
+ const char *select);
+
+LASSO_EXPORT LassoDstQueryItem* lasso_profile_service_add_query_item(LassoProfileService *service,
+ const char *select);
+
+LASSO_EXPORT gint lasso_profile_service_build_request_msg(LassoProfileService *service);
+
+LASSO_EXPORT LassoDstModification* lasso_profile_service_init_modify(
+ LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ LassoDiscoResourceOffering *ro,
+ LassoDiscoDescription *desc,
+ const char *select);
+
+LASSO_EXPORT LassoDstQueryItem* lasso_profile_service_init_query(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ LassoDiscoResourceOffering *ro,
+ LassoDiscoDescription *desc,
+ const char *select);
+
+LASSO_EXPORT gint lasso_profile_service_process_modify_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ const char *soap_msg);
+
+LASSO_EXPORT gint lasso_profile_service_process_modify_response_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ const char *soap_msg);
+
+LASSO_EXPORT gint lasso_profile_service_process_query_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ const char *soap_msg);
+
+LASSO_EXPORT gint lasso_profile_service_process_query_response_msg(LassoProfileService *service,
+ const char *prefix,
+ const char *href,
+ const char *soap_msg);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_PROFILE_SERVICE_H__ */
diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i
index 114d0a3b..5bfb0e71 100644
--- a/swig/Lasso-wsf.i
+++ b/swig/Lasso-wsf.i
@@ -31,7 +31,7 @@
%{
#include <lasso/id-wsf/discovery.h>
-#include <lasso/id-wsf/personal_profile_service.h>
+#include <lasso/id-wsf/profile_service.h>
#include <lasso/xml/dst_new_data.h>
#include <lasso/xml/dst_modify.h>
#include <lasso/xml/dst_modify_response.h>
@@ -992,7 +992,7 @@ void LassoPPMsgContact_msgProvider_set(LassoPPMsgContact *self, char *msgProvide
#define LassoPPMsgContact_get_msgAccount LassoPPMsgContact_msgAccount_get
char *LassoPPMsgContact_msgAccount_get(LassoPPMsgContact *self) {
if (LASSO_IS_PP_MSG_CONTACT(self) == TRUE) {
- return self->MsgProvider;
+ return self->MsgAccount;
}
return NULL;
}
@@ -1236,12 +1236,13 @@ gint LassoDiscovery_buildResponseMsg(LassoDiscovery *self) {
%}
+
/***********************************************************************
- * ID-WSF XML LassoPersonalProfileService
+ * ID-WSF XML LassoProfileService
***********************************************************************/
#ifndef SWIGPHP4
-%rename(PersonalProfileService) LassoPersonalProfileService;
+%rename(ProfileService) LassoProfileService;
#endif
typedef struct {
%extend {
@@ -1265,7 +1266,7 @@ typedef struct {
gchar *msgUrl;
/* Constructor, Destructor & Static Methods */
- LassoPersonalProfileService(LassoServer *server);
+ LassoProfileService(LassoServer *server);
/* Methods inherited from LassoWsfProfile */
void buildRequestMsg();
@@ -1277,116 +1278,120 @@ typedef struct {
LassoDstModification *addModification(char *select);
- LassoDstModification *initModify(LassoDiscoResourceOffering *resourceOffering,
+ LassoDstModification *initModify(char *prefix,
+ char *href,
+ LassoDiscoResourceOffering *resourceOffering,
LassoDiscoDescription *description,
char *select);
- LassoDstQueryItem *initQuery(LassoDiscoResourceOffering *resourceOffering,
+ LassoDstQueryItem *initQuery(char *prefix,
+ char *href,
+ LassoDiscoResourceOffering *resourceOffering,
LassoDiscoDescription *description,
char *select);
THROW_ERROR
- void processModifyMsg(char *modify_msg);
+ void processModifyMsg(char *prefix, char *href, char *soap_msg);
END_THROW_ERROR
THROW_ERROR
- void processModifyResponseMsg(char *modify_response_msg);
+ void processModifyResponseMsg(char *prefix, char *href, char *soap_msg);
END_THROW_ERROR
LassoDstQueryItem *addQueryItem(char *select);
THROW_ERROR
- void processQueryMsg(char *query_msg);
+ void processQueryMsg(char *prefix, char *href, char *soap_msg);
END_THROW_ERROR
THROW_ERROR
- void processQueryResponseMsg(char *query_response_msg);
+ void processQueryResponseMsg(char *prefix, char *href, char *soap_msg);
END_THROW_ERROR
}
-} LassoPersonalProfileService;
+} LassoProfileService;
%{
/* Attributes Implementations */
/* modify */
-#define LassoPersonalProfileService_get_modify LassoPersonalProfileService_modify_get
-LassoDstModify *LassoPersonalProfileService_modify_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_modify LassoProfileService_modify_get
+LassoDstModify *LassoProfileService_modify_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE)
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE)
return LASSO_DST_MODIFY(profile->request);
return NULL;
}
/* modifyResponse */
-#define LassoPersonalProfileService_get_modifyResponse LassoPersonalProfileService_modifyResponse_get
-LassoDstModifyResponse *LassoPersonalProfileService_modifyResponse_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_modifyResponse LassoProfileService_modifyResponse_get
+LassoDstModifyResponse *LassoProfileService_modifyResponse_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE)
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE)
return LASSO_DST_MODIFY_RESPONSE(profile->response);
return NULL;
}
/* msgUrl */
-#define LassoPersonalProfileService_get_msgUrl LassoPersonalProfileService_msgUrl_get
-char *LassoPersonalProfileService_msgUrl_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_msgUrl LassoProfileService_msgUrl_get
+char *LassoProfileService_msgUrl_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE)
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE)
return profile->msg_url;
return NULL;
}
/* msgBody */
-#define LassoPersonalProfileService_get_msgBody LassoPersonalProfileService_msgBody_get
-char *LassoPersonalProfileService_msgBody_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_msgBody LassoProfileService_msgBody_get
+char *LassoProfileService_msgBody_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE)
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE)
return profile->msg_body;
return NULL;
}
/* Query */
-#define LassoPersonalProfileService_get_query LassoPersonalProfileService_query_get
-LassoDstQuery *LassoPersonalProfileService_query_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_query LassoProfileService_query_get
+LassoDstQuery *LassoProfileService_query_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE) {
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE) {
return LASSO_DST_QUERY(profile->request);
}
return NULL;
}
/* QueryResponse */
-#define LassoPersonalProfileService_get_queryResponse LassoPersonalProfileService_queryResponse_get
-LassoDstQueryResponse *LassoPersonalProfileService_queryResponse_get(LassoPersonalProfileService *self) {
+#define LassoProfileService_get_queryResponse LassoProfileService_queryResponse_get
+LassoDstQueryResponse *LassoProfileService_queryResponse_get(LassoProfileService *self) {
LassoWsfProfile *profile = LASSO_WSF_PROFILE(self);
- if (LASSO_IS_PERSONAL_PROFILE_SERVICE(self) == TRUE)
+ if (LASSO_IS_PROFILE_SERVICE(self) == TRUE)
return LASSO_DST_QUERY_RESPONSE(profile->response);
return NULL;
}
/* Constructors, destructors & static methods implementations */
-#define new_LassoPersonalProfileService lasso_personal_profile_service_new
+#define new_LassoProfileService lasso_profile_service_new
/* Methods inherited from LassoWsfProfile implementations */
-void LassoPersonalProfileService_buildRequestMsg(LassoPersonalProfileService *self) {
+void LassoProfileService_buildRequestMsg(LassoProfileService *self) {
lasso_wsf_profile_build_request_msg(LASSO_WSF_PROFILE(self));
}
-void LassoPersonalProfileService_buildResponseMsg(LassoPersonalProfileService *self) {
+void LassoProfileService_buildResponseMsg(LassoProfileService *self) {
lasso_wsf_profile_build_response_msg(LASSO_WSF_PROFILE(self));
}
/* Methods implementations */
-#define LassoPersonalProfileService_addData lasso_personal_profile_service_add_data
-#define LassoPersonalProfileService_addModification lasso_personal_profile_service_add_modification
-#define LassoPersonalProfileService_addQueryItem lasso_personal_profile_service_add_query_item
-#define LassoPersonalProfileService_initModify lasso_personal_profile_service_init_modify
-#define LassoPersonalProfileService_initQuery lasso_personal_profile_service_init_query
-#define LassoPersonalProfileService_processModifyMsg lasso_personal_profile_service_process_modify_msg
-#define LassoPersonalProfileService_processModifyResponseMsg lasso_personal_profile_service_process_modify_response_msg
-#define LassoPersonalProfileService_processQueryMsg lasso_personal_profile_service_process_query_msg
-#define LassoPersonalProfileService_processQueryResponseMsg lasso_personal_profile_service_process_query_response_msg
+#define LassoProfileService_addData lasso_profile_service_add_data
+#define LassoProfileService_addModification lasso_profile_service_add_modification
+#define LassoProfileService_addQueryItem lasso_profile_service_add_query_item
+#define LassoProfileService_initModify lasso_profile_service_init_modify
+#define LassoProfileService_initQuery lasso_profile_service_init_query
+#define LassoProfileService_processModifyMsg lasso_profile_service_process_modify_msg
+#define LassoProfileService_processModifyResponseMsg lasso_profile_service_process_modify_response_msg
+#define LassoProfileService_processQueryMsg lasso_profile_service_process_query_msg
+#define LassoProfileService_processQueryResponseMsg lasso_profile_service_process_query_response_msg
%}