01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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 433543 2006-08-22 06:22:54Z crossley $
35: */
36: public class UserContextExtension extends UserContext {
37:
38: /** The locales for the user. */
39: protected String[] supportedLocales;
40:
41: /** User Authentication. */
42: protected String 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[] userCategories,
63: java.lang.String 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[] supportedLocales) {
73: this .supportedLocales = supportedLocales;
74: }
75:
76: /**
77: * @return all locales the user wants to support
78: */
79: public String[] getSupportedLocales() {
80: return this .supportedLocales;
81: }
82:
83: public String getUserAuthentication() {
84: return userAuthentication;
85: }
86:
87: public void setUserAuthentication(String userAuthentication) {
88: this.userAuthentication = userAuthentication;
89: }
90: }
|