lasso/lasso/id-wsf/personal_profile_service.c

156 lines
4.3 KiB
C
Raw Normal View History

/* $Id$
*
* Lasso - A free implementation of the Liberty Alliance specifications.
*
2007-05-30 19:17:45 +02:00
* Copyright (C) 2004-2007 Entr'ouvert
* http://lasso.entrouvert.org
2008-09-12 17:06:58 +02:00
*
* Authors: See AUTHORS file in top-level directory.
*
* 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.
2008-09-12 17:06:58 +02:00
*
* 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.
2008-09-12 17:06:58 +02:00
*
* 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
*/
#include "../xml/private.h"
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
#include "./personal_profile_service.h"
#include "./data_service.h"
#include "./wsf_profile_private.h"
#include "./discovery.h"
#include "../utils.h"
Docs: change the doc production and lot of other fixes * lasso/Makefile.am: distribute extract_sections.py * docs/references/lasso/lasso.types.in: add missing class (mainly SAML2 and ID-WSF 1.0/2.0) from docs/references/lasso.types.in * lasso/xml/strings.h: add lots of documentation, or at least documentation template to strings constants. * id-ff/login.h: * saml-2.0/assertion_query.h: * xml/xml.h: document undocumented enumerations. * lasso/errors.h: add proper documentation about error codes. * lasso/errors.c: new version of the lasso_strerror function * lasso/build_strerror.py: update the script that generater lasso_strerror from the documentation comments. Remove usage of OFTYPE * lasso/id-ff/session.c: * lasso/id-ff/session.h: remove usage of oftype, prefer gtk-introspection annotations instead. * lasso/id-wsf/data_service.h: * lasso/id-wsf/data_service.c: do the same. Add a script to build lasso-sections.txt * lasso/extract_sections.py: this script parses header files and generated lasso-sections.txt content for GObject class descriptions. Add a template file for the lasso-section.txt file * docs/references/lasso-sections.txt.in: this file serves as a base for the generation of lasso-sections.txt Update docs/references/Makefile.am for generating lasso-sections.txt * docs/references/Makefile.am: always rebuild template, using out of source build directory is too weird without it. call new script extract_sections.py to regenerate lasso-sections.txt if header files changed. Update lasso.sgml file with all missing sections * docs/reference/lasso.sgml: add all missing sections, mainly objects from XML schemas. * docs/reference/lasso-sections.txt: update it * *.c: add section documentation to some files. * lasso/xml/strings.h: fix bad usage or docbook markup
2009-08-26 17:15:07 +02:00
/**
* SECTION:personal_profile_service
* @short_description: a subclass of LassoDataService to access Personal Profile datas
* @stability: Unstable
*/
/*****************************************************************************/
/* public methods */
/*****************************************************************************/
2005-08-12 18:32:05 +02:00
char*
lasso_personal_profile_service_get_email(LassoPersonalProfileService *service)
{
2005-08-12 18:32:05 +02:00
xmlNode *xmlnode, *child;
xmlChar *msgAccount = NULL, *msgProvider = NULL;
char *email;
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
GList *answers = NULL;
gint rc = 0;
g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(service) == TRUE, NULL);
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
rc = lasso_data_service_get_answers_by_select(LASSO_DATA_SERVICE(service),
"/pp:PP/pp:MsgContact", &answers);
lasso_foreach(answers, answers)
{
xmlnode = (xmlNode*)answers->data;
child = xmlnode->children;
while (child != NULL) {
if (child->type != XML_ELEMENT_NODE) {
child = child->next;
continue;
}
if (strcmp((char *)child->name, "MsgAccount") == 0) {
msgAccount = xmlNodeGetContent(child);
} else if (strcmp((char *)child->name, "MsgProvider") == 0) {
msgProvider = xmlNodeGetContent(child);
}
if (msgAccount != NULL && msgProvider != NULL) {
break;
}
2005-08-12 18:32:05 +02:00
child = child->next;
}
2008-09-12 17:06:58 +02:00
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
if (msgAccount && msgProvider) {
email = g_strdup_printf("%s@%s", msgAccount, msgProvider);
break;
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
} else {
email = NULL;
}
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
lasso_release_xml_string(msgAccount);
lasso_release_xml_string(msgProvider);
lasso_release_xml_node(xmlnode);
}
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
lasso_release_xml_string(msgAccount);
lasso_release_xml_string(msgProvider);
lasso_release_xml_node(xmlnode);
return email;
}
/*****************************************************************************/
/* instance and class init functions */
/*****************************************************************************/
GType
lasso_personal_profile_service_get_type()
{
static GType this_type = 0;
if (!this_type) {
2008-09-12 17:06:58 +02:00
lasso_discovery_register_constructor_for_service_type(LASSO_PP_HREF,
(LassoWsfProfileConstructor)lasso_personal_profile_service_new_full);
static const GTypeInfo this_info = {
sizeof(LassoPersonalProfileServiceClass),
NULL,
NULL,
NULL,
NULL,
NULL,
sizeof(LassoPersonalProfileService),
0,
NULL,
NULL
};
this_type = g_type_register_static(LASSO_TYPE_DATA_SERVICE,
"LassoPersonalProfileService", &this_info, 0);
}
return this_type;
}
LassoPersonalProfileService*
lasso_personal_profile_service_new(LassoServer *server)
{
2005-08-12 18:32:05 +02:00
LassoPersonalProfileService *service;
g_return_val_if_fail(LASSO_IS_SERVER(server), NULL);
2005-08-12 18:32:05 +02:00
service = g_object_new(LASSO_TYPE_PERSONAL_PROFILE_SERVICE, NULL);
LASSO_WSF_PROFILE(service)->server = g_object_ref(server);
return service;
}
LassoPersonalProfileService*
lasso_personal_profile_service_new_full(LassoServer *server, LassoDiscoResourceOffering *offering)
{
LassoPersonalProfileService *service = lasso_personal_profile_service_new(server);
g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(offering), NULL);
2008-09-12 17:06:58 +02:00
if (service == NULL) {
return NULL;
}
ID-WSF: Lots of modifications Migrate lots of code to use new utility macros. Try to simplify most code paths or to factorize with LassoWsfProfile. * lasso/id-wsf/wsf_profile.c: Add API: - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for Lasso errors, - lasso_wsf_profile_set_msg_url_from_description, to set the destination URL using the chosen LassoDiscoDescription (with respect to the security mechanism), - lasso_wsf_profile_init_soap_response to initialize a response to the current request, to use in sub classes, - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP binding corresponding information, - lasso_wsf_profile_get_remote_provider, simplification of lasso_wsf_profile_get_remote_provider_id, - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP fault, used by sub classes, - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned by the next call by lasso_wsf_profile_build_soap_response_msg, to use in sub classes, - lasso_wsf_profile_set/get_status_code, set/get the stored status code, to use in the next lasso_xxx_build_response_message, to use in sub classes. Change name lasso_wsf_profile_get_description_autos to lasso_wsf_profile_get_description_auto. Do not access directly the session is_dirty field (it has been sealed). * lasso/id-wsf/wsf_profile.h: Add helper macro lasso_wsf_profile_helper_set_status to set status code of an ID-WSF response message containing a Status element using the stored status code. * lasso/id-wsf/wsf_profile_private.h: Add new fields (moved public fields). Add lasso_wsf_profile_set_msg_url_from_description, lasso_wsf_profile_build_soap_fault_response_msg. * lasso/id-wsf/data_service_private.h: Remove file. * lasso/id-wsf/data_service.h: Remove all public fields. * lasso/id-wsf/data_service.c: Remove private structure. Use the equivalents LassoWsfProfile private fields. Update documentation. Use LassoWsfProfile generic functions for initializing requests. Add API lasso_data_service_get_query_item, lasso_data_service_get_answers, lasso_data_service_get_answer, lasso_data_service_get_answers_by_select, lasso_data_service_get_answer_for_item_id, lasso_data_service_add_modification. Remove lasso_data_service_need_redirect_user use equivalent function lasso_interaction_profile_service_build_redirect_response_msg. Remove lasso_data_service_get_resource_offering, lasso_data_service_set_offering. * lasso/id-wsf/discovery.c: Add documentation. Change some signatures. Remove lasso_discovery_get_description_auto. Change name of lasso_discovery_init_insert to lasso_discovery_init_modify. Add a generic lasso_discovery_process_request_msg. Add internal function lasso_discovery_init_offering, to get automatically an offering if possible. Remove useless init_from_xml. Rework lasso_discovery_build_credential implementation. overloading. Remove lasso_discovery_destroy. * lasso/id-wsf/discovery.h: Remove lasso_discovery_destroy. * lasso/id-wsf/interaction_profile_service.c: Add lasso_interaction_profile_service_build_redirect_response_msg. * lasso/id-wsf/personal_profile_service.c: Update lasso_personal_profile_service_get_email to use lasso_data_service_get_answers_by_select. * lasso/xml/dst_modify.c: make modification parameter optional to the constructor.
2009-08-26 17:13:46 +02:00
lasso_wsf_profile_set_resource_offering(&service->parent.parent, offering);
2005-08-12 18:32:05 +02:00
return service;
}