KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > wsrp > consumer > UserContextExtension


1 /*
2 * Copyright 2005 The Apache Software Foundation or its licensors,
3 * as applicable.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */

17 package org.apache.cocoon.portal.wsrp.consumer;
18
19 import oasis.names.tc.wsrp.v1.types.UserContext;
20
21 /**
22  * Extends the <tt>UserContext</tt>-class with the supportedLocales.
23  * Without these extension the supportedLocales can only be set global for
24  * the consumerEnvironment. In that case all users have the same locale.
25  * Now the supportedLocales can be set per user.<br/>
26  *
27  * The order of the locales is important. If the first entry is not offered
28  * by the portlet the second will be tested and so on. The first match delivers
29  * the used locale.<br/>
30  *
31  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
32  * @author <a HREF="mailto:malessandrini@s-und-n.de">Michel Alessandrini</a>
33  *
34  * @version $Id: UserContextExtension.java 332023 2005-11-09 11:45:47Z crossley $
35  */

36 public class UserContextExtension extends UserContext {
37
38     /** The locales for the user. */
39     protected String JavaDoc[] supportedLocales;
40
41     /** User Authentication. */
42     protected String JavaDoc userAuthentication;
43
44     /**
45      * Default constructor
46      */

47     public UserContextExtension() {
48         super();
49     }
50     
51     /**
52      * Constructor
53      *
54      * @param extensions
55      * @param profile
56      * @param userCategories
57      * @param userContextKey
58      */

59     public UserContextExtension(
60             oasis.names.tc.wsrp.v1.types.Extension[] extensions,
61             oasis.names.tc.wsrp.v1.types.UserProfile profile,
62             java.lang.String JavaDoc[] userCategories,
63             java.lang.String JavaDoc userContextKey) {
64         super(extensions, profile, userCategories, userContextKey);
65     }
66
67     /**
68      * Set the supportedLocales for the current user
69      *
70      * @param supportedLocales
71      */

72     public void setSupportedLocales(String JavaDoc[] supportedLocales) {
73         this.supportedLocales = supportedLocales;
74     }
75     
76     /**
77      * @return all locales the user wants to support
78      */

79     public String JavaDoc[] getSupportedLocales() {
80         return this.supportedLocales;
81     }
82
83     public String JavaDoc getUserAuthentication() {
84         return userAuthentication;
85     }
86
87     public void setUserAuthentication(String JavaDoc userAuthentication) {
88         this.userAuthentication = userAuthentication;
89     }
90 }
91
Popular Tags