Author: julien(a)jboss.com
Date: 2007-03-25 09:20:26 -0400 (Sun, 25 Mar 2007)
New Revision: 6821
Added:
trunk/common/src/main/org/jboss/portal/common/i18n/LocaleInfo.java
Removed:
trunk/common/src/main/org/jboss/portal/common/util/LocaleInfo.java
Modified:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
trunk/common/src/main/org/jboss/portal/test/common/LocaleInfoTestCase.java
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/identity/src/main/org/jboss/portal/identity/config/metadata/profile/ProfileMetaDataFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupRequest.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
Log:
- moved LocaleInfo to i18n package too
- javadoc improvements
- cache LocalizedString hashCode and toString
- made LocalizedString final
Copied: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleInfo.java (from rev 6816,
trunk/common/src/main/org/jboss/portal/common/util/LocaleInfo.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocaleInfo.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocaleInfo.java 2007-03-25 13:20:26
UTC (rev 6821)
@@ -0,0 +1,460 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.common.i18n;
+
+import org.apache.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Additional infos about a locale.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ * @noinspection ALL
+ */
+public final class LocaleInfo
+{
+
+ // Static fields
****************************************************************************************************
+
+ /**
+ * The logger.
+ */
+ private static Logger log = Logger.getLogger(LocaleInfo.class);
+
+ /**
+ * The locale info map.
+ */
+ private static volatile Infos sharedInfos = createFromAvailableLocales();
+
+ /**
+ * Separator.
+ */
+ private static final String RFC3066_SEPARATOR = "-";
+
+ /**
+ * Valid language tag matcher (see <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>).
+ */
+ private static final Pattern RFC3066_COMPOUND_LANG_PATTERN =
Pattern.compile("(\\p{Lower}{2})(-(\\p{Upper}{2}))?");
+
+ /**
+ * Sorted valid ISO country codes (needed for Arrays.binarySearch).
+ */
+ private static final String[] SORTED_ISO_COUNTRIES = Locale.getISOCountries();
+
+ /**
+ * Sorted valid ISO language codes (needed for Arrays.binarySearch).
+ */
+ private static final String[] SORTED_ISO_LANGUAGES = Locale.getISOLanguages();
+
+ private static final Comparator c = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ String s1 = ((LocaleInfo)o1).getTrailingName();
+ String s2 = ((LocaleInfo)o2).getTrailingName();
+ return s1.compareTo(s2);
+ }
+ };
+
+
+ static
+ {
+ // should already be sorted but in case they're not...
+ Arrays.sort(SORTED_ISO_COUNTRIES);
+ Arrays.sort(SORTED_ISO_LANGUAGES);
+ }
+
+ // Fields
***********************************************************************************************************
+
+ /**
+ * The parent locale info or null if no parent.
+ */
+ private LocaleInfo parent;
+
+ /**
+ * The relaled locale.
+ */
+ private Locale locale;
+
+ /**
+ * The trailing name used to compute resource bundle name.
+ */
+ private String trailingName;
+
+ /**
+ * The RFC3066 language tag.
+ */
+ private String rfc3066LangageTag;
+
+ // Constructor
******************************************************************************************************
+
+ private LocaleInfo(LocaleInfo parent, Locale locale)
+ {
+ this.locale = locale;
+ this.trailingName = computeTrailingName(locale);
+ this.parent = parent;
+
+ //
+ this.rfc3066LangageTag = getRFC3066LanguageTagFor(locale);
+ }
+
+ // Public
***********************************************************************************************************
+
+ public LocaleInfo getParent()
+ {
+ return parent;
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ public String getTrailingName()
+ {
+ return trailingName;
+ }
+
+ /**
+ * Retrieves the language identification tag associated to this LocaleInfo as defined
by
+ * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
+ * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
+ * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
+ * British English, etc.
+ *
+ * @return a <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a>-compatible language tag.
+ * @throws IllegalArgumentException if the given locale is not valid
+ * @since 2.4
+ */
+ public String getRFC3066LanguageTag()
+ {
+ return rfc3066LangageTag;
+ }
+
+ /**
+ * Retrieves the language identification tag associated to the specified Locale as
defined by
+ * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
+ * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
+ * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
+ * British English, etc.
+ *
+ * @param locale the locale which language tag is wanted
+ * @return a <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a>-compatible language tag.
+ * @throws IllegalArgumentException if the given locale is not valid
+ * @since 2.4
+ */
+ public static String getRFC3066LanguageTagFor(Locale locale)
+ {
+ String country = locale.getCountry(); // country will be empty if no country was
specified in the locale
+ return locale.getLanguage() + ((country.length() == 2) ? RFC3066_SEPARATOR +
country : country);
+ }
+
+ // Object override
**************************************************************************************************
+
+ public String toString()
+ {
+ return locale.toString();
+ }
+
+ // Static
***********************************************************************************************************
+
+ /**
+ * Compute the trailing name for a given locale.
+ *
+ * @param locale the locale
+ * @return the trailing name
+ * @throws IllegalArgumentException if locale is null
+ */
+ public static String computeTrailingName(Locale locale) throws
IllegalArgumentException
+ {
+ if (locale == null)
+ {
+ throw new IllegalArgumentException("locale parameter is null");
+ }
+ StringBuffer tmp = new StringBuffer();
+ if (locale.getLanguage() != null && locale.getLanguage().length() > 0)
+ {
+ tmp.append('_').append(locale.getLanguage());
+ if (locale.getCountry() != null && locale.getCountry().length() > 0)
+ {
+ tmp.append('_').append(locale.getCountry());
+ {
+ if (locale.getVariant() != null && locale.getVariant().length()
> 0)
+ {
+ tmp.append('_').append(locale.getVariant());
+ }
+ }
+ }
+ }
+ return tmp.toString();
+ }
+
+ /**
+ * <p>Get an info object.</p>
+ * <p/>
+ * <p>Whenever the info object cannot be found then it creates a new one and
possibly several
+ * since each info object may have a non null parent.</p>
+ * <p/>
+ * <p>If the infos argument is null, then the static shared infos is used to
perform a lookup.
+ * If the lookup returns null then the shared infos is cloned and updated with the
newly created
+ * info objects. The operation performed is a copy on write and is thread safe. Note
that concurrent
+ * updates may cause the lost of info object in the shared infos.</p>
+ * <p/>
+ * <p>If the infos argument is not null, then it is used to perform a lookup
first. If the lookup returns null
+ * then the infos object udpated with the newly created info objects. Note that no
cloning of the infos object
+ * is performed.</p>
+ *
+ * @param locale the locale
+ * @param infos the infos
+ * @return A info object for the given locale
+ */
+ private static LocaleInfo getInfo(Locale locale, final Infos infos)
+ {
+ // Perform a lookup first
+ Infos workInfos = null;
+ if (infos != null)
+ {
+ workInfos = infos;
+ }
+ else
+ {
+ workInfos = sharedInfos;
+ }
+ LocaleInfo info = (LocaleInfo)workInfos.byLocaleCode.get(locale.toString());
+
+ // If the lookup fail we create a new object
+ if (info == null)
+ {
+ // Clone if it is shared
+ if (infos == null)
+ {
+ workInfos = new Infos(workInfos);
+ }
+
+ // Perform parent resolution
+ LocaleInfo parent = null;
+ if (locale.getVariant() != null && locale.getVariant().length() > 0)
+ {
+ // If this is a language/country/variant, try to get language/country
+ Locale parentLocale = new Locale(locale.getLanguage(), locale.getCountry());
+ parent = getInfo(parentLocale, workInfos);
+ }
+ else if (locale.getCountry() != null && locale.getCountry().length()
> 0)
+ {
+ // If this is a language/country, try to get language
+ Locale parentLocale = new Locale(locale.getLanguage());
+ parent = getInfo(parentLocale, workInfos);
+ }
+ else
+ {
+ // When it is language then the parent is null
+ parent = null;
+ }
+
+ //
+ info = new LocaleInfo(parent, locale);
+ log.debug("LocaleInfo " + locale.toString() + "
initialized");
+
+ // Add to map
+ workInfos.byLocale.put(info.getLocale(), info);
+ workInfos.byLocaleCode.put(info.getLocale().toString(), info);
+ workInfos.byRFC3066LanguageTag.put(info.getRFC3066LanguageTag(), info);
+ workInfos.list.add(info);
+// Collections.sort(workInfos.list, c);
+
+ // Replace if we have cloned
+ if (infos == null)
+ {
+ sharedInfos = workInfos;
+ }
+ }
+ return info;
+ }
+
+
+ /**
+ * Create an infos object from the set of locales returned by
<code>Locale.getAvailableLocales()</code>.
+ */
+ private static Infos createFromAvailableLocales()
+ {
+ // Initialize all objects
+ Infos workInfos = new Infos();
+ Locale[] temp = Locale.getAvailableLocales();
+ for (int i = 0; i < temp.length; i++)
+ {
+ Locale locale = temp[i];
+ getInfo(locale, workInfos);
+ }
+ return workInfos;
+ }
+
+ /**
+ * Return a collection of all available locale info for the platform.
+ */
+ public static Collection getAll()
+ {
+ return sharedInfos.unmodifiableList;
+ }
+
+ /**
+ * Return the locale info for a specific code.
+ *
+ * @throws IllegalArgumentException if the locale info is not found for the code
+ */
+ public static LocaleInfo decodeLocaleInfo(String code) throws
IllegalArgumentException
+ {
+ LocaleInfo info = (LocaleInfo)sharedInfos.byLocaleCode.get(code);
+ if (info == null)
+ {
+ throw new IllegalArgumentException("No locale info found for " +
code);
+ }
+ return info;
+ }
+
+ /**
+ * Return the locale info for a specific locale.
+ *
+ * @throws IllegalArgumentException if the locale is not found for the code
+ */
+ public static LocaleInfo decodeLocaleInfo(Locale locale)
+ {
+ LocaleInfo info = (LocaleInfo)sharedInfos.byLocale.get(locale);
+ if (info == null)
+ {
+ throw new IllegalArgumentException("No locale info found for " +
locale);
+ }
+ return info;
+ }
+
+ /**
+ * Returns an info object based on the given language identification tag as defined
by
+ * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
+ * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
+ * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
+ * British English, etc.
+ *
+ * @param languageIdentificationTag the language tag to build the Locale from
+ * @return a LocaleInfo associated to the given compound language tag
+ * @throws IllegalArgumentException if the given compound language is not a valid one
or null
+ * @since 2.4
+ */
+ public static LocaleInfo decodeLocaleInfoFromRFC3066LanguageTag(String
languageIdentificationTag)
+ {
+ if (languageIdentificationTag == null)
+ {
+ throw new IllegalArgumentException("Null language identification tag not
accepted");
+ }
+
+ LocaleInfo info =
(LocaleInfo)sharedInfos.byRFC3066LanguageTag.get(languageIdentificationTag);
+ if (info == null)
+ {
+ Matcher matcher =
RFC3066_COMPOUND_LANG_PATTERN.matcher(languageIdentificationTag);
+ if (matcher.matches())
+ {
+ String language = matcher.group(1);
+ if (Arrays.binarySearch(SORTED_ISO_LANGUAGES, language) < 0)
+ {
+ throw new IllegalArgumentException("Invalid ISO language code: "
+ language);
+ }
+ String country = matcher.group(3);
+ if (country != null && Arrays.binarySearch(SORTED_ISO_COUNTRIES,
country) < 0)
+ {
+ throw new IllegalArgumentException("Invalid ISO country code: "
+ country);
+ }
+ return new LocaleInfo(LocaleInfo.decodeLocaleInfo(language), new
Locale(language, country));
+ }
+ throw new IllegalArgumentException(languageIdentificationTag + " is not a
valid compound language : accepted " +
+ "format is xx-YY where xx is a valid ISO language code and YY is a valid
country code. See " +
+ "java.util.Locale javadoc for more info.");
+ }
+ return info;
+ }
+
+
+ /**
+ * Hold the several ways to retrieve infos object.
+ */
+ private static class Infos
+ {
+ /**
+ * The info by locale.
+ */
+ private Map byLocale;
+
+ /**
+ * The info by locale#toString() code.
+ */
+ private Map byLocaleCode;
+
+ /**
+ * The info by locale RFC3066 language tag.
+ */
+ private Map byRFC3066LanguageTag;
+
+ /**
+ * All the infos.
+ */
+ private List list;
+
+ /**
+ * All the infos as an unmodifiable list.
+ */
+ private List unmodifiableList;
+
+ /**
+ * Construct a new info object.
+ */
+ public Infos()
+ {
+ this.byLocale = new HashMap();
+ this.byLocaleCode = new HashMap();
+ this.byRFC3066LanguageTag = new HashMap();
+ this.list = new ArrayList();
+ this.unmodifiableList = Collections.unmodifiableList(list);
+ }
+
+ /**
+ * Clone the info object state passed as argument.
+ */
+ public Infos(Infos that)
+ {
+ this.byLocale = new HashMap(that.byLocale);
+ this.byLocaleCode = new HashMap(that.byLocaleCode);
+ this.byRFC3066LanguageTag = new HashMap(that.byRFC3066LanguageTag);
+ this.list = new ArrayList(that.list);
+ this.unmodifiableList = Collections.unmodifiableList(list);
+ }
+ }
+}
Property changes on: trunk/common/src/main/org/jboss/portal/common/i18n/LocaleInfo.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.common.i18n;
import org.apache.log4j.Logger;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import java.util.Collections;
import java.util.HashMap;
@@ -32,29 +32,36 @@
import java.util.Map;
/**
- * An immutable localized string.
+ * An immutable locale sensitive object that returns strings.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
*/
-public class LocalizedString
+public final class LocalizedString
{
/** The logger. */
private static final Logger log = Logger.getLogger(LocalizedString.class);
- /** The descriptions. */
+ /** An unmodifiable <Locale,String>Map. */
private final Map values;
/** The default locale. */
private final Locale defaultLocale;
+ /** The cached hashCode. */
+ private Integer hashCode;
+
+ /** The cached toString. */
+ private String cachedToString;
+
/**
* Convenience constructor for simple localized strings with only one value using the
default locale.
*
* @param defaultValue the localized value using the specified default locale
* @param defaultLocale the default locale
+ * @throws IllegalArgumentException if no default value or locale is provided
* @since 2.4
*/
public LocalizedString(String defaultValue, Locale defaultLocale) throws
IllegalArgumentException
@@ -69,7 +76,7 @@
}
//
- Map values = new HashMap(3);
+ Map values = new HashMap(1);
addValueForLocale(values, defaultLocale, defaultValue);
//
@@ -77,6 +84,12 @@
this.values = Collections.unmodifiableMap(values);
}
+ /**
+ * Build an empty localized string.
+ *
+ * @param defaultLocale the default locale
+ * @throws IllegalArgumentException if no default locale is provided
+ */
public LocalizedString(Locale defaultLocale) throws IllegalArgumentException
{
if (defaultLocale == null)
@@ -89,6 +102,13 @@
this.values = Collections.EMPTY_MAP;
}
+ /**
+ * Build a localized string using a <Locale,String>Map object.
+ *
+ * @param values the <Locale,String>Map
+ * @param defaultLocale
+ * @throws IllegalArgumentException if one argument if null or if the map entries are
different from <Locale,String>Map.Entry
+ */
public LocalizedString(Map values, Locale defaultLocale) throws
IllegalArgumentException
{
if (values == null)
@@ -131,7 +151,7 @@
* @param value the value
* @since 2.4
*/
- private void addValueForLocale(Map values, Locale locale, String value)
+ private static void addValueForLocale(Map values, Locale locale, String value)
{
values.put(locale, new Value(locale, value));
}
@@ -158,7 +178,7 @@
}
/**
- * Return the value for the default locale.
+ * Returns the value for the default locale.
*
* @return the value for the default locale
*/
@@ -168,11 +188,11 @@
}
/**
- * Return the string of the localized value of the description.
+ * Returns a string value.
*
- * @param locale the desired locale for the description
+ * @param locale the desired locale
* @param resolve true if the locale must be resolved to the most appropriate
- * @return the description string or null if it is not found when resolving is false
+ * @return the description string or null if it is not found
*/
public String getString(Locale locale, boolean resolve)
{
@@ -188,11 +208,13 @@
}
/**
- * Return a localized value of the description.
+ * Returns a localized value. The lookup operation can be done without resolution
which
+ * means that the locale is just used as a key during the lookup. If the lookup
operation is done with
+ * resolution then the different parts of the locale will be used during the
operation.
*
- * @param locale the desired locale for the description
+ * @param locale the desired locale
* @param resolve true if the locale must be resolved to the most appropriate
- * @return the description value or null if it is not found when resolving is false
+ * @return the value or null if it is not found
*/
public Value getValue(Locale locale, boolean resolve)
{
@@ -209,20 +231,20 @@
if (resolve)
{
- Value desc = (Value)values.get(locale);
- if (desc == null && !locale.getVariant().equals(""))
+ Value value = (Value)values.get(locale);
+ if (value == null && !locale.getVariant().equals(""))
{
- desc = (Value)values.get(new Locale(locale.getLanguage(),
locale.getCountry()));
+ value = (Value)values.get(new Locale(locale.getLanguage(),
locale.getCountry()));
}
- if (desc == null && !locale.getCountry().equals(""))
+ if (value == null && !locale.getCountry().equals(""))
{
- desc = (Value)values.get(new Locale(locale.getLanguage()));
+ value = (Value)values.get(new Locale(locale.getLanguage()));
}
- if (desc == null)
+ if (value == null)
{
- desc = (Value)values.get(defaultLocale);
+ value = (Value)values.get(defaultLocale);
}
- return desc;
+ return value;
}
else
{
@@ -230,7 +252,11 @@
}
}
- /** Return the default locale of this description. */
+ /**
+ * Return the default locale of this localized string.
+ *
+ * @return the default locale
+ */
public Locale getDefaultLocale()
{
return defaultLocale;
@@ -261,7 +287,7 @@
* @return a Map.Entry representing the most appropriate mapping between Locale and
localized value, based on locale
* preferences.
* @throws IllegalArgumentException if the array is null or one of the array string is
null or invalid (see {@link
- *
org.jboss.portal.common.util.LocaleInfo#decodeLocaleInfoFromRFC3066LanguageTag(String)}
+ *
LocaleInfo#decodeLocaleInfoFromRFC3066LanguageTag(String)}
* @since 2.4
*/
public Value getPreferredOrBestLocalizedMappingFor(String[] desiredLocales) throws
IllegalArgumentException
@@ -271,6 +297,7 @@
throw new IllegalArgumentException("No null desired locale array
accepted");
}
+ //
if (values.isEmpty())
{
return null;
@@ -278,21 +305,22 @@
//
Value value = null;
-
- //
if (desiredLocales.length > 0)
{
- LocaleInfo info;
for (int i = 0; value == null && i < desiredLocales.length; i++)
{
String desiredLocale = desiredLocales[i];
+
+ //
if (desiredLocale == null)
{
throw new IllegalArgumentException("Null desired locale not
accepted");
}
+
+ //
try
{
- info = LocaleInfo.decodeLocaleInfoFromRFC3066LanguageTag(desiredLocale);
+ LocaleInfo info =
LocaleInfo.decodeLocaleInfoFromRFC3066LanguageTag(desiredLocale);
Locale locale = info.getLocale();
value = getValue(locale, true);
}
@@ -320,19 +348,67 @@
return value;
}
- /** A localized value. */
+ public String toString()
+ {
+ if (cachedToString == null)
+ {
+ cachedToString = "LocalizedString: '" +
getMostAppropriateValueFor(new String[0]) + "' default: " +
getDefaultLocale();
+ }
+ return cachedToString;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || LocalizedString.class != o.getClass())
+ {
+ return false;
+ }
+
+ //
+ LocalizedString that = (LocalizedString)o;
+ return defaultLocale.equals(that.defaultLocale) &&
getMostAppropriateValueFor(new String[0]).equals(that.getMostAppropriateValueFor(new
String[0]));
+ }
+
+ public int hashCode()
+ {
+ if (hashCode == null)
+ {
+ hashCode = new Integer(31 * getMostAppropriateValueFor(new String[0]).hashCode()
+ defaultLocale.hashCode());
+ }
+ return hashCode.intValue();
+ }
+
+ /**
+ * A localized string value.
+ */
public static class Value
{
+ /** The locale that describes the string. */
private final Locale locale;
+
+ /** the string value. */
private final String string;
- public Value(Locale locale, String string)
+ /**
+ * @param locale the locale
+ * @param string the string
+ * @throws IllegalArgumentException if one argument is null
+ */
+ public Value(Locale locale, String string) throws IllegalArgumentException
{
if (locale == null)
{
throw new IllegalArgumentException();
}
+ if (string == null)
+ {
+ throw new IllegalArgumentException();
+ }
this.locale = locale;
this.string = string;
}
@@ -347,35 +423,4 @@
return string;
}
}
-
- public String toString()
- {
- return "LocalizedString: '" + getMostAppropriateValueFor(new
String[0]) + "' default: " + getDefaultLocale();
- }
-
-
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- LocalizedString that = (LocalizedString)o;
-
- return getMostAppropriateValueFor(new
String[0]).equals(that.getMostAppropriateValueFor(new String[0]))
- && defaultLocale.equals(that.defaultLocale);
- }
-
- public int hashCode()
- {
- int result;
- result = getMostAppropriateValueFor(new String[0]).hashCode();
- result = 31 * result + defaultLocale.hashCode();
- return result;
- }
}
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -77,7 +77,8 @@
/**
* Return a localized value constructed from the various resource bundles. The
supported locales of the manager are
* used in combination with the specified key. The default value is used if no value
is found for the
- * <code>Locale.ENGLISH</code>.
+ * <code>Locale.ENGLISH</code>. Two successive calls to this method may
not return identical results since the
+ * returned <code>LocalizedString</code> is built using the bundles known
by the manager.
*
* @param key the key to lookup in the bundles
* @param defaultValue the default value
Deleted: trunk/common/src/main/org/jboss/portal/common/util/LocaleInfo.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/LocaleInfo.java 2007-03-25 12:48:44
UTC (rev 6820)
+++ trunk/common/src/main/org/jboss/portal/common/util/LocaleInfo.java 2007-03-25 13:20:26
UTC (rev 6821)
@@ -1,460 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.common.util;
-
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Additional infos about a locale.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- * @noinspection ALL
- */
-public final class LocaleInfo
-{
-
- // Static fields
****************************************************************************************************
-
- /**
- * The logger.
- */
- private static Logger log = Logger.getLogger(LocaleInfo.class);
-
- /**
- * The locale info map.
- */
- private static volatile Infos sharedInfos = createFromAvailableLocales();
-
- /**
- * Separator.
- */
- private static final String RFC3066_SEPARATOR = "-";
-
- /**
- * Valid language tag matcher (see <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC 3066</a>).
- */
- private static final Pattern RFC3066_COMPOUND_LANG_PATTERN =
Pattern.compile("(\\p{Lower}{2})(-(\\p{Upper}{2}))?");
-
- /**
- * Sorted valid ISO country codes (needed for Arrays.binarySearch).
- */
- private static final String[] SORTED_ISO_COUNTRIES = Locale.getISOCountries();
-
- /**
- * Sorted valid ISO language codes (needed for Arrays.binarySearch).
- */
- private static final String[] SORTED_ISO_LANGUAGES = Locale.getISOLanguages();
-
- private static final Comparator c = new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- String s1 = ((LocaleInfo)o1).getTrailingName();
- String s2 = ((LocaleInfo)o2).getTrailingName();
- return s1.compareTo(s2);
- }
- };
-
-
- static
- {
- // should already be sorted but in case they're not...
- Arrays.sort(SORTED_ISO_COUNTRIES);
- Arrays.sort(SORTED_ISO_LANGUAGES);
- }
-
- // Fields
***********************************************************************************************************
-
- /**
- * The parent locale info or null if no parent.
- */
- private LocaleInfo parent;
-
- /**
- * The relaled locale.
- */
- private Locale locale;
-
- /**
- * The trailing name used to compute resource bundle name.
- */
- private String trailingName;
-
- /**
- * The RFC3066 language tag.
- */
- private String rfc3066LangageTag;
-
- // Constructor
******************************************************************************************************
-
- private LocaleInfo(LocaleInfo parent, Locale locale)
- {
- this.locale = locale;
- this.trailingName = computeTrailingName(locale);
- this.parent = parent;
-
- //
- this.rfc3066LangageTag = getRFC3066LanguageTagFor(locale);
- }
-
- // Public
***********************************************************************************************************
-
- public LocaleInfo getParent()
- {
- return parent;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public String getTrailingName()
- {
- return trailingName;
- }
-
- /**
- * Retrieves the language identification tag associated to this LocaleInfo as defined
by
- * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
- * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
- * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
- * British English, etc.
- *
- * @return a <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a>-compatible language tag.
- * @throws IllegalArgumentException if the given locale is not valid
- * @since 2.4
- */
- public String getRFC3066LanguageTag()
- {
- return rfc3066LangageTag;
- }
-
- /**
- * Retrieves the language identification tag associated to the specified Locale as
defined by
- * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
- * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
- * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
- * British English, etc.
- *
- * @param locale the locale which language tag is wanted
- * @return a <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a>-compatible language tag.
- * @throws IllegalArgumentException if the given locale is not valid
- * @since 2.4
- */
- public static String getRFC3066LanguageTagFor(Locale locale)
- {
- String country = locale.getCountry(); // country will be empty if no country was
specified in the locale
- return locale.getLanguage() + ((country.length() == 2) ? RFC3066_SEPARATOR +
country : country);
- }
-
- // Object override
**************************************************************************************************
-
- public String toString()
- {
- return locale.toString();
- }
-
- // Static
***********************************************************************************************************
-
- /**
- * Compute the trailing name for a given locale.
- *
- * @param locale the locale
- * @return the trailing name
- * @throws IllegalArgumentException if locale is null
- */
- public static String computeTrailingName(Locale locale) throws
IllegalArgumentException
- {
- if (locale == null)
- {
- throw new IllegalArgumentException("locale parameter is null");
- }
- StringBuffer tmp = new StringBuffer();
- if (locale.getLanguage() != null && locale.getLanguage().length() > 0)
- {
- tmp.append('_').append(locale.getLanguage());
- if (locale.getCountry() != null && locale.getCountry().length() > 0)
- {
- tmp.append('_').append(locale.getCountry());
- {
- if (locale.getVariant() != null && locale.getVariant().length()
> 0)
- {
- tmp.append('_').append(locale.getVariant());
- }
- }
- }
- }
- return tmp.toString();
- }
-
- /**
- * <p>Get an info object.</p>
- * <p/>
- * <p>Whenever the info object cannot be found then it creates a new one and
possibly several
- * since each info object may have a non null parent.</p>
- * <p/>
- * <p>If the infos argument is null, then the static shared infos is used to
perform a lookup.
- * If the lookup returns null then the shared infos is cloned and updated with the
newly created
- * info objects. The operation performed is a copy on write and is thread safe. Note
that concurrent
- * updates may cause the lost of info object in the shared infos.</p>
- * <p/>
- * <p>If the infos argument is not null, then it is used to perform a lookup
first. If the lookup returns null
- * then the infos object udpated with the newly created info objects. Note that no
cloning of the infos object
- * is performed.</p>
- *
- * @param locale the locale
- * @param infos the infos
- * @return A info object for the given locale
- */
- private static LocaleInfo getInfo(Locale locale, final Infos infos)
- {
- // Perform a lookup first
- Infos workInfos = null;
- if (infos != null)
- {
- workInfos = infos;
- }
- else
- {
- workInfos = sharedInfos;
- }
- LocaleInfo info = (LocaleInfo)workInfos.byLocaleCode.get(locale.toString());
-
- // If the lookup fail we create a new object
- if (info == null)
- {
- // Clone if it is shared
- if (infos == null)
- {
- workInfos = new Infos(workInfos);
- }
-
- // Perform parent resolution
- LocaleInfo parent = null;
- if (locale.getVariant() != null && locale.getVariant().length() > 0)
- {
- // If this is a language/country/variant, try to get language/country
- Locale parentLocale = new Locale(locale.getLanguage(), locale.getCountry());
- parent = getInfo(parentLocale, workInfos);
- }
- else if (locale.getCountry() != null && locale.getCountry().length()
> 0)
- {
- // If this is a language/country, try to get language
- Locale parentLocale = new Locale(locale.getLanguage());
- parent = getInfo(parentLocale, workInfos);
- }
- else
- {
- // When it is language then the parent is null
- parent = null;
- }
-
- //
- info = new LocaleInfo(parent, locale);
- log.debug("LocaleInfo " + locale.toString() + "
initialized");
-
- // Add to map
- workInfos.byLocale.put(info.getLocale(), info);
- workInfos.byLocaleCode.put(info.getLocale().toString(), info);
- workInfos.byRFC3066LanguageTag.put(info.getRFC3066LanguageTag(), info);
- workInfos.list.add(info);
-// Collections.sort(workInfos.list, c);
-
- // Replace if we have cloned
- if (infos == null)
- {
- sharedInfos = workInfos;
- }
- }
- return info;
- }
-
-
- /**
- * Create an infos object from the set of locales returned by
<code>Locale.getAvailableLocales()</code>.
- */
- private static Infos createFromAvailableLocales()
- {
- // Initialize all objects
- Infos workInfos = new Infos();
- Locale[] temp = Locale.getAvailableLocales();
- for (int i = 0; i < temp.length; i++)
- {
- Locale locale = temp[i];
- getInfo(locale, workInfos);
- }
- return workInfos;
- }
-
- /**
- * Return a collection of all available locale info for the platform.
- */
- public static Collection getAll()
- {
- return sharedInfos.unmodifiableList;
- }
-
- /**
- * Return the locale info for a specific code.
- *
- * @throws IllegalArgumentException if the locale info is not found for the code
- */
- public static LocaleInfo decodeLocaleInfo(String code) throws
IllegalArgumentException
- {
- LocaleInfo info = (LocaleInfo)sharedInfos.byLocaleCode.get(code);
- if (info == null)
- {
- throw new IllegalArgumentException("No locale info found for " +
code);
- }
- return info;
- }
-
- /**
- * Return the locale info for a specific locale.
- *
- * @throws IllegalArgumentException if the locale is not found for the code
- */
- public static LocaleInfo decodeLocaleInfo(Locale locale)
- {
- LocaleInfo info = (LocaleInfo)sharedInfos.byLocale.get(locale);
- if (info == null)
- {
- throw new IllegalArgumentException("No locale info found for " +
locale);
- }
- return info;
- }
-
- /**
- * Returns an info object based on the given language identification tag as defined
by
- * <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF RFC
3066</a> limited to 2-letter
- * language code per ISO standard 639, a "-" (dash) and a 2-letter country
code per
- * ISO 3166 alpha-2 country codes. E.g. "en-US" for American English,
"en-GB" for
- * British English, etc.
- *
- * @param languageIdentificationTag the language tag to build the Locale from
- * @return a LocaleInfo associated to the given compound language tag
- * @throws IllegalArgumentException if the given compound language is not a valid one
or null
- * @since 2.4
- */
- public static LocaleInfo decodeLocaleInfoFromRFC3066LanguageTag(String
languageIdentificationTag)
- {
- if (languageIdentificationTag == null)
- {
- throw new IllegalArgumentException("Null language identification tag not
accepted");
- }
-
- LocaleInfo info =
(LocaleInfo)sharedInfos.byRFC3066LanguageTag.get(languageIdentificationTag);
- if (info == null)
- {
- Matcher matcher =
RFC3066_COMPOUND_LANG_PATTERN.matcher(languageIdentificationTag);
- if (matcher.matches())
- {
- String language = matcher.group(1);
- if (Arrays.binarySearch(SORTED_ISO_LANGUAGES, language) < 0)
- {
- throw new IllegalArgumentException("Invalid ISO language code: "
+ language);
- }
- String country = matcher.group(3);
- if (country != null && Arrays.binarySearch(SORTED_ISO_COUNTRIES,
country) < 0)
- {
- throw new IllegalArgumentException("Invalid ISO country code: "
+ country);
- }
- return new LocaleInfo(LocaleInfo.decodeLocaleInfo(language), new
Locale(language, country));
- }
- throw new IllegalArgumentException(languageIdentificationTag + " is not a
valid compound language : accepted " +
- "format is xx-YY where xx is a valid ISO language code and YY is a valid
country code. See " +
- "java.util.Locale javadoc for more info.");
- }
- return info;
- }
-
-
- /**
- * Hold the several ways to retrieve infos object.
- */
- private static class Infos
- {
- /**
- * The info by locale.
- */
- private Map byLocale;
-
- /**
- * The info by locale#toString() code.
- */
- private Map byLocaleCode;
-
- /**
- * The info by locale RFC3066 language tag.
- */
- private Map byRFC3066LanguageTag;
-
- /**
- * All the infos.
- */
- private List list;
-
- /**
- * All the infos as an unmodifiable list.
- */
- private List unmodifiableList;
-
- /**
- * Construct a new info object.
- */
- public Infos()
- {
- this.byLocale = new HashMap();
- this.byLocaleCode = new HashMap();
- this.byRFC3066LanguageTag = new HashMap();
- this.list = new ArrayList();
- this.unmodifiableList = Collections.unmodifiableList(list);
- }
-
- /**
- * Clone the info object state passed as argument.
- */
- public Infos(Infos that)
- {
- this.byLocale = new HashMap(that.byLocale);
- this.byLocaleCode = new HashMap(that.byLocaleCode);
- this.byRFC3066LanguageTag = new HashMap(that.byRFC3066LanguageTag);
- this.list = new ArrayList(that.list);
- this.unmodifiableList = Collections.unmodifiableList(list);
- }
- }
-}
Modified: trunk/common/src/main/org/jboss/portal/test/common/LocaleInfoTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/LocaleInfoTestCase.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/common/src/main/org/jboss/portal/test/common/LocaleInfoTestCase.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.common;
import junit.framework.TestCase;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import java.util.Iterator;
import java.util.Locale;
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -49,7 +49,7 @@
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
import org.jboss.portal.common.p3p.P3PConstants;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.core.aspects.controller.node.Navigation;
Modified:
trunk/identity/src/main/org/jboss/portal/identity/config/metadata/profile/ProfileMetaDataFactory.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/config/metadata/profile/ProfileMetaDataFactory.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/identity/src/main/org/jboss/portal/identity/config/metadata/profile/ProfileMetaDataFactory.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
import org.jboss.xb.binding.GenericObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.xml.sax.Attributes;
import java.util.Locale;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.deployment;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.impl.jsr168.metadata.CacheConfigMetaData;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/UserContextConverter.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -24,7 +24,7 @@
package org.jboss.portal.wsrp;
import org.jboss.portal.common.p3p.P3PConstants;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.wsrp.core.Contact;
import org.jboss.portal.wsrp.core.EmployerInfo;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-25 12:48:44 UTC (rev
6820)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-25 13:20:26 UTC (rev
6821)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.PortletContext;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.wsrp.consumer;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.jems.as.system.AbstractJBossService;
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -25,7 +25,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupRequest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupRequest.java 2007-03-25
12:48:44 UTC (rev 6820)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupRequest.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.wsrp.producer;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.wsrp.WSRPUtils;
import org.jboss.portal.wsrp.core.MarkupType;
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -24,7 +24,7 @@
package org.jboss.portal.wsrp.producer;
import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.value.StringValue;
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -24,7 +24,7 @@
package org.jboss.portal.wsrp.producer;
import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-03-25
12:48:44 UTC (rev 6820)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-03-25
13:20:26 UTC (rev 6821)
@@ -23,7 +23,7 @@
package org.jboss.portal.wsrp.producer.config;
-import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationImpl;
import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;