1 /* $Id: ps_add_entity_request.c,v 1.0 2005/10/14 15:17:55 fpeters Exp $
2  *
3  * Lasso - A free implementation of the Liberty Alliance specifications.
4  *
5  * Copyright (C) 2004-2007 Entr'ouvert
6  * http://lasso.entrouvert.org
7  *
8  * Authors: See AUTHORS file in top-level directory.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "../private.h"
25 #include "ps_add_entity_request.h"
26 #include "idwsf2_strings.h"
27 
28 /**
29  * SECTION:ps_add_entity_request
30  * @short_description: &lt;ps:AddEntityRequest&gt;
31  *
32  * <figure><title>Schema fragment for ps:AddEntityRequest</title>
33  * <programlisting><![CDATA[
34  *
35  * <xs:complexType name="AddEntityRequestType">
36  *   <xs:complexContent>
37  *     <xs:extension base="RequestAbstractType">
38  *       <xs:sequence>
39  *         <xs:element ref="Object"/>
40  *         <xs:element ref="PStoSPRedirectURL" minOccurs="0"/>
41  *         <xs:element ref="CreatePSObject" minOccurs="0"/>
42  *         <xs:element ref="Subscription" minOccurs="0"/>
43  *         <xs:element ref="sec:TokenPolicy" minOccurs="0"/>
44  *       </xs:sequence>
45  *     </xs:extension>
46  *   </xs:complexContent>
47  * </xs:complexType>
48  * ]]></programlisting>
49  * </figure>
50  */
51 
52 /*****************************************************************************/
53 /* private methods                                                           */
54 /*****************************************************************************/
55 
56 
57 static struct XmlSnippet schema_snippets[] = {
58 	{ "Object", SNIPPET_NODE,
59 		G_STRUCT_OFFSET(LassoIdWsf2PsAddEntityRequest, Object), NULL, NULL, NULL},
60 	{ "PStoSPRedirectURL", SNIPPET_NODE,
61 		G_STRUCT_OFFSET(LassoIdWsf2PsAddEntityRequest, PStoSPRedirectURL), NULL, NULL, NULL},
62 	{ "CreatePSObject", SNIPPET_CONTENT,
63 		G_STRUCT_OFFSET(LassoIdWsf2PsAddEntityRequest, CreatePSObject), NULL, NULL, NULL},
64 	{ "Subscription", SNIPPET_NODE,
65 		G_STRUCT_OFFSET(LassoIdWsf2PsAddEntityRequest, Subscription), NULL, NULL, NULL},
66 	{ "TokenPolicy", SNIPPET_NODE,
67 		G_STRUCT_OFFSET(LassoIdWsf2PsAddEntityRequest, TokenPolicy), NULL,
68 		LASSO_IDWSF2_UTIL_PREFIX, LASSO_IDWSF2_UTIL_HREF},
69 	{NULL, 0, 0, NULL, NULL, NULL}
70 };
71 
72 static LassoNodeClass *parent_class = NULL;
73 
74 
75 /*****************************************************************************/
76 /* instance and class init functions                                         */
77 /*****************************************************************************/
78 
79 
80 static void
class_init(LassoIdWsf2PsAddEntityRequestClass * klass,void * unused G_GNUC_UNUSED)81 class_init(LassoIdWsf2PsAddEntityRequestClass *klass, void *unused G_GNUC_UNUSED)
82 {
83 	LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
84 
85 	parent_class = g_type_class_peek_parent(klass);
86 	nclass->node_data = g_new0(LassoNodeClassData, 1);
87 	lasso_node_class_set_nodename(nclass, "AddEntityRequest");
88 	lasso_node_class_set_ns(nclass, LASSO_IDWSF2_PS_HREF, LASSO_IDWSF2_PS_PREFIX);
89 	lasso_node_class_add_snippets(nclass, schema_snippets);
90 }
91 
92 GType
lasso_idwsf2_ps_add_entity_request_get_type()93 lasso_idwsf2_ps_add_entity_request_get_type()
94 {
95 	static GType this_type = 0;
96 
97 	if (!this_type) {
98 		static const GTypeInfo this_info = {
99 			sizeof (LassoIdWsf2PsAddEntityRequestClass),
100 			NULL,
101 			NULL,
102 			(GClassInitFunc) class_init,
103 			NULL,
104 			NULL,
105 			sizeof(LassoIdWsf2PsAddEntityRequest),
106 			0,
107 			NULL,
108 			NULL
109 		};
110 
111 		this_type = g_type_register_static(LASSO_TYPE_IDWSF2_PS_REQUEST_ABSTRACT,
112 				"LassoIdWsf2PsAddEntityRequest", &this_info, 0);
113 	}
114 	return this_type;
115 }
116 
117 /**
118  * lasso_idwsf2_ps_add_entity_request_new:
119  *
120  * Creates a new #LassoIdWsf2PsAddEntityRequest object.
121  *
122  * Return value: a newly created #LassoIdWsf2PsAddEntityRequest object
123  **/
124 LassoIdWsf2PsAddEntityRequest*
lasso_idwsf2_ps_add_entity_request_new()125 lasso_idwsf2_ps_add_entity_request_new()
126 {
127 	return g_object_new(LASSO_TYPE_IDWSF2_PS_ADD_ENTITY_REQUEST, NULL);
128 }
129