~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to lasso/xml/lib_idp_list.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: lib_idp_list.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: Nicolas Clapies <nclapies@entrouvert.com>
 
9
 *          Valery Febvre <vfebvre@easter-eggs.com>
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 * 
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 * 
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#include <lasso/xml/lib_idp_list.h>
 
27
 
 
28
/*
 
29
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
 
30
 
 
31
<xs:element name="IDPList" type="IDPListType"/>
 
32
<xs:complexType name="IDPListType">
 
33
  <xs:sequence>
 
34
    <xs:element ref="IDPEntries"/>
 
35
    <xs:element ref="GetComplete" minOccurs="0"/>
 
36
  </xs:sequence>
 
37
</xs:complexType>
 
38
 
 
39
<xs:element name="GetComplete" type="xs:anyURI"/>
 
40
*/
 
41
 
 
42
/*****************************************************************************/
 
43
/* public methods                                                            */
 
44
/*****************************************************************************/
 
45
 
 
46
/**
 
47
 * lasso_lib_idp_list_set_getComplete:
 
48
 * @node: the pointer to <lib:IDPList/> node object
 
49
 * @getComplete: the value of "GetComplete" element.
 
50
 * 
 
51
 * Sets the "GetComplete" element [optional].
 
52
 *
 
53
 * If the identity provider list is not complete, this element may be included
 
54
 * with a URI that points to where the complete list can be retrieved.
 
55
 **/
 
56
void
 
57
lasso_lib_idp_list_set_getComplete(LassoLibIDPList *node,
 
58
                                   const xmlChar *getComplete)
 
59
{
 
60
  LassoNodeClass *class;
 
61
  g_assert(LASSO_IS_LIB_IDP_LIST(node));
 
62
  g_assert(getComplete != NULL);
 
63
 
 
64
  class = LASSO_NODE_GET_CLASS(node);
 
65
  class->new_child(LASSO_NODE (node), "GetComplete", getComplete, FALSE);
 
66
}
 
67
 
 
68
/**
 
69
 * lasso_lib_idp_list_set_idpEntries:
 
70
 * @node: the pointer to <lib:IDPList/> node object
 
71
 * @idpEntries: the pointer to <lib:IDPEntries/> node object
 
72
 * 
 
73
 * Set the "IDPEntries" element [required].
 
74
 *
 
75
 * It contains a list of identity provider entries.
 
76
 **/
 
77
void
 
78
lasso_lib_idp_list_set_idpEntries(LassoLibIDPList *node,
 
79
                                  LassoLibIDPEntries *idpEntries)
 
80
{
 
81
  LassoNodeClass *class;
 
82
  g_assert(LASSO_IS_LIB_IDP_LIST(node));
 
83
  g_assert(LASSO_IS_LIB_IDP_ENTRIES(idpEntries));
 
84
 
 
85
  class = LASSO_NODE_GET_CLASS(node);
 
86
  class->add_child(LASSO_NODE (node), LASSO_NODE(idpEntries), FALSE);
 
87
}
 
88
 
 
89
/*****************************************************************************/
 
90
/* instance and class init functions                                         */
 
91
/*****************************************************************************/
 
92
 
 
93
static void
 
94
lasso_lib_idp_list_instance_init(LassoLibIDPList *node)
 
95
{
 
96
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
97
 
 
98
  class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
 
99
  class->set_name(LASSO_NODE(node), "IDPList");
 
100
}
 
101
 
 
102
static void
 
103
lasso_lib_idp_list_class_init(LassoLibIDPListClass *klass)
 
104
{
 
105
}
 
106
 
 
107
GType lasso_lib_idp_list_get_type() {
 
108
  static GType this_type = 0;
 
109
 
 
110
  if (!this_type) {
 
111
    static const GTypeInfo this_info = {
 
112
      sizeof (LassoLibIDPListClass),
 
113
      NULL,
 
114
      NULL,
 
115
      (GClassInitFunc) lasso_lib_idp_list_class_init,
 
116
      NULL,
 
117
      NULL,
 
118
      sizeof(LassoLibIDPList),
 
119
      0,
 
120
      (GInstanceInitFunc) lasso_lib_idp_list_instance_init,
 
121
    };
 
122
    
 
123
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
124
                                       "LassoLibIDPList",
 
125
                                       &this_info, 0);
 
126
  }
 
127
  return this_type;
 
128
}
 
129
 
 
130
/**
 
131
 * lasso_lib_idp_list_new:
 
132
 * 
 
133
 * Creates a new <lib:IDPList/> node object.
 
134
 *
 
135
 * In the request envelope, some profiles may wish to allow the service
 
136
 * provider to transport a list of identity providers to the user agent. This
 
137
 * specification provides a schema that profiles SHOULD use for this purpose.
 
138
 * 
 
139
 * Return value: the new @LassoLibIDPList
 
140
 **/
 
141
LassoNode* lasso_lib_idp_list_new()
 
142
{
 
143
  return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_IDP_LIST, NULL));
 
144
}