Author: julien(a)jboss.com
Date: 2007-03-24 19:13:11 -0400 (Sat, 24 Mar 2007)
New Revision: 6818
Added:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedPropertyResourceBundle.java
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
trunk/common/src/main/org/jboss/portal/common/i18n/MapResourceBundle.java
trunk/common/src/main/org/jboss/portal/common/i18n/ParentChildResourceBundle.java
Removed:
trunk/common/src/main/org/jboss/portal/common/util/LocalizedPropertyResourceBundle.java
trunk/common/src/main/org/jboss/portal/common/util/LocalizedString.java
trunk/common/src/main/org/jboss/portal/common/util/MapResourceBundle.java
trunk/common/src/main/org/jboss/portal/common/util/ParentChildResourceBundle.java
Modified:
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java
trunk/common/src/main/org/jboss/portal/test/common/DescriptionTestCase.java
trunk/common/src/main/org/jboss/portal/test/common/LocalizedStringTestCase.java
trunk/common/src/main/org/jboss/portal/test/common/ParentChildResourceBundleTestCase.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/GenericContent.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java
trunk/core/src/main/org/jboss/portal/core/model/content/Content.java
trunk/core/src/main/org/jboss/portal/core/model/content/ContentProvider.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java
trunk/format/src/main/org/jboss/portal/test/format/BBCodeHTML2HTMLTestCase.java
trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java
trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java
trunk/portlet-federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/widget/src/main/org/jboss/portal/widget/Widget.java
trunk/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
trunk/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/ServiceObjectFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java
Log:
moved i18n stuff from common.util to common.i18n package
Copied:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedPropertyResourceBundle.java
(from rev 6816,
trunk/common/src/main/org/jboss/portal/common/util/LocalizedPropertyResourceBundle.java)
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedPropertyResourceBundle.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedPropertyResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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 java.util.PropertyResourceBundle;
+import java.util.Locale;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class LocalizedPropertyResourceBundle extends PropertyResourceBundle
+{
+
+ private final Locale locale;
+
+ /**
+ * Create an instanceof of localized property resource bundle.
+ *
+ * @param stream the stream to decode the property file
+ * @param locale the locale to use
+ * @throws IllegalArgumentException if the locale is null
+ */
+ public LocalizedPropertyResourceBundle(InputStream stream, Locale locale) throws
IOException
+ {
+ super(stream);
+ if (locale == null)
+ {
+ throw new IllegalArgumentException("Locale cannot be null");
+ }
+ this.locale = locale;
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+}
Property changes on:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedPropertyResourceBundle.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java (from rev
6816, trunk/common/src/main/org/jboss/portal/common/util/LocalizedString.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -0,0 +1,381 @@
+/******************************************************************************
+ * 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 org.jboss.portal.common.util.LocaleInfo;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * An immutable localized string.
+ *
+ * @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
+{
+
+ /** The logger. */
+ private static final Logger log = Logger.getLogger(LocalizedString.class);
+
+ /** The descriptions. */
+ private final Map values;
+
+ /** The default locale. */
+ private final Locale defaultLocale;
+
+ /**
+ * 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
+ * @since 2.4
+ */
+ public LocalizedString(String defaultValue, Locale defaultLocale) throws
IllegalArgumentException
+ {
+ if (defaultValue == null)
+ {
+ throw new IllegalArgumentException("No null default value allowed");
+ }
+ if (defaultLocale == null)
+ {
+ throw new IllegalArgumentException("No null default locale allowed");
+ }
+
+ //
+ Map values = new HashMap(3);
+ addValueForLocale(values, defaultLocale, defaultValue);
+
+ //
+ this.defaultLocale = defaultLocale;
+ this.values = Collections.unmodifiableMap(values);
+ }
+
+ public LocalizedString(Locale defaultLocale) throws IllegalArgumentException
+ {
+ if (defaultLocale == null)
+ {
+ throw new IllegalArgumentException("No null default locale allowed");
+ }
+
+ //
+ this.defaultLocale = defaultLocale;
+ this.values = Collections.EMPTY_MAP;
+ }
+
+ public LocalizedString(Map values, Locale defaultLocale) throws
IllegalArgumentException
+ {
+ if (values == null)
+ {
+ throw new IllegalArgumentException("No null description map
allowed");
+ }
+ if (defaultLocale == null)
+ {
+ throw new IllegalArgumentException("No null default locale allowed");
+ }
+
+ // Convert strings to value
+ Map tmp = new HashMap(values.size());
+ for (Iterator i = values.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ Object key = entry.getKey();
+ if (!(key instanceof Locale))
+ {
+ throw new IllegalArgumentException("Key not a locale " +
entry.getKey());
+ }
+ Object value = entry.getValue();
+ if (!(value instanceof String))
+ {
+ throw new IllegalArgumentException("Value not a string " +
entry.getValue());
+ }
+ addValueForLocale(tmp, (Locale)key, (String)value);
+ }
+
+ //
+ this.defaultLocale = defaultLocale;
+ this.values = Collections.unmodifiableMap(tmp);
+ }
+
+ /**
+ * Adds a new value for the specified locale to this LocalizedString. Note that if a
value existed for this Locale,
+ * it will be overwritten.
+ *
+ * @param locale the locale of the value
+ * @param value the value
+ * @since 2.4
+ */
+ private void addValueForLocale(Map values, Locale locale, String value)
+ {
+ values.put(locale, new Value(locale, value));
+ }
+
+ /**
+ * Determines if this LocalizedString contains any values.
+ *
+ * @return <code>true</code> if this LocalizedString contains localized
values, <code>false</code> otherwise.
+ * @since 2.4
+ */
+ public boolean hasValues()
+ {
+ return values.isEmpty() == false;
+ }
+
+ /**
+ * Return the string for the default locale.
+ *
+ * @return the string for the default locale
+ */
+ public String getDefaultString()
+ {
+ return getString(defaultLocale, false);
+ }
+
+ /**
+ * Return the value for the default locale.
+ *
+ * @return the value for the default locale
+ */
+ public Value getDefaultValue()
+ {
+ return getValue(defaultLocale, false);
+ }
+
+ /**
+ * Return the string of the localized value of the description.
+ *
+ * @param locale the desired locale for the description
+ * @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
+ */
+ public String getString(Locale locale, boolean resolve)
+ {
+ Value value = getValue(locale, resolve);
+ if (value != null)
+ {
+ return value.getString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Return a localized value of the description.
+ *
+ * @param locale the desired locale for the description
+ * @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
+ */
+ public Value getValue(Locale locale, boolean resolve)
+ {
+ if (locale == null)
+ {
+ throw new IllegalArgumentException("No null locale accepted as
argument");
+ }
+
+ // fail fast is there aren't any values
+ if (values.isEmpty())
+ {
+ return null;
+ }
+
+ if (resolve)
+ {
+ Value desc = (Value)values.get(locale);
+ if (desc == null && !locale.getVariant().equals(""))
+ {
+ desc = (Value)values.get(new Locale(locale.getLanguage(),
locale.getCountry()));
+ }
+ if (desc == null && !locale.getCountry().equals(""))
+ {
+ desc = (Value)values.get(new Locale(locale.getLanguage()));
+ }
+ if (desc == null)
+ {
+ desc = (Value)values.get(defaultLocale);
+ }
+ return desc;
+ }
+ else
+ {
+ return (Value)values.get(locale);
+ }
+ }
+
+ /** Return the default locale of this description. */
+ public Locale getDefaultLocale()
+ {
+ return defaultLocale;
+ }
+
+ /**
+ * Retrieves the localized value most appropriate based on the given desired locales.
+ *
+ * @param desiredLocales an array of compound language tags (as defined by <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF
+ * RFC 3066</a>) ordered according to locale preferences.
+ * @return the most appropriate localized value based on locale preferences.
+ * @throws IllegalArgumentException if the array is null or one of the array string is
null or invalid (see
+ * #getLocaleFromRFC3066LanguageTag(String))
+ * @since 2.4
+ */
+ public String getMostAppropriateValueFor(String[] desiredLocales) throws
IllegalArgumentException
+ {
+ Value mapping = getPreferredOrBestLocalizedMappingFor(desiredLocales);
+ return (mapping == null) ? null : mapping.getString();
+ }
+
+ /**
+ * Retrieves the Locale-String mapping most appropriate based on the given desired
locales, which are ordered
+ * according to locale preferences.
+ *
+ * @param desiredLocales an array of compound language tags (as defined by <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF
+ * RFC 3066</a>) ordered according to locale preferences.
+ * @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)}
+ * @since 2.4
+ */
+ public Value getPreferredOrBestLocalizedMappingFor(String[] desiredLocales) throws
IllegalArgumentException
+ {
+ if (desiredLocales == null)
+ {
+ throw new IllegalArgumentException("No null desired locale array
accepted");
+ }
+
+ if (values.isEmpty())
+ {
+ return null;
+ }
+
+ //
+ 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);
+ Locale locale = info.getLocale();
+ value = getValue(locale, true);
+ }
+ catch (IllegalArgumentException e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Invalid desired locale " + desiredLocale);
+ }
+ }
+ }
+
+ // todo julien
+ // We could have a smarter version of this method but this version requires that
desiredLocales
+ // are ordered by locale preference. Hence the first found is by definition the
best.
+ }
+
+ //
+ if (value == null)
+ {
+ value = getValue(defaultLocale, true);
+ }
+
+ //
+ return value;
+ }
+
+ /** A localized value. */
+ public static class Value
+ {
+
+ private final Locale locale;
+ private final String string;
+
+ public Value(Locale locale, String string)
+ {
+ if (locale == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.locale = locale;
+ this.string = string;
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ public String getString()
+ {
+ 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;
+ }
+}
Property changes on:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/common/src/main/org/jboss/portal/common/i18n/MapResourceBundle.java (from
rev 6816, trunk/common/src/main/org/jboss/portal/common/util/MapResourceBundle.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/MapResourceBundle.java
(rev 0)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/MapResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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 java.util.ResourceBundle;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Enumeration;
+import java.util.Collections;
+
+/**
+ * A resource bundle that use a map as content.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class MapResourceBundle extends ResourceBundle
+{
+
+ protected Map content;
+
+ public MapResourceBundle(Map content)
+ {
+ this.content = new HashMap(content);
+ }
+
+ protected Object handleGetObject(String key)
+ {
+ if (key == null)
+ {
+ throw new NullPointerException();
+ }
+ return content.get(key);
+ }
+
+ public Enumeration getKeys()
+ {
+ return Collections.enumeration(content.keySet());
+ }
+}
Property changes on:
trunk/common/src/main/org/jboss/portal/common/i18n/MapResourceBundle.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/common/src/main/org/jboss/portal/common/i18n/ParentChildResourceBundle.java
(from rev 6816,
trunk/common/src/main/org/jboss/portal/common/util/ParentChildResourceBundle.java)
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/ParentChildResourceBundle.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/i18n/ParentChildResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * 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.jboss.portal.common.util.Tools;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+/**
+ * This resource bundle takes two resource bundle to make one :
+ * - The locale of this resource bundle is given by the child.
+ * - For a given key present in the child and the parent, the child
+ * value overrides the parent value.
+ *
+ * The locale used for the bundle is the child locale.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class ParentChildResourceBundle extends ResourceBundle
+{
+
+ /** The bundle locale. */
+ private Locale locale;
+
+ /** The bundle values. */
+ private Map values;
+
+ /**
+ * Construct a new resource bundle whose content is based on the child
+ * and parent content.
+ *
+ * @param parent the parent eventually null
+ * @param child the child
+ * @throws IllegalArgumentException if the child is null or its locale is null
+ */
+ public ParentChildResourceBundle(ResourceBundle parent, ResourceBundle child) throws
IllegalArgumentException
+ {
+ // Arg check
+ if (child == null)
+ {
+ throw new IllegalArgumentException("Child cannot be null");
+ }
+ if (child.getLocale() == null)
+ {
+ throw new IllegalArgumentException("Child locale must not be null");
+ }
+ this.locale = child.getLocale();
+ this.values = new HashMap();
+
+ // Set the parent content
+ if (parent != null)
+ {
+ for (Enumeration e = parent.getKeys();e.hasMoreElements();)
+ {
+ String key = (String)e.nextElement();
+ Object value = parent.getObject(key);
+ values.put(key, value);
+ }
+ }
+
+ // Set the child content
+ for (Enumeration e = child.getKeys();e.hasMoreElements();)
+ {
+ String key = (String)e.nextElement();
+ Object value = child.getObject(key);
+ values.put(key, value);
+ }
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ protected Object handleGetObject(String key)
+ {
+ return values.get(key);
+ }
+
+ public Enumeration getKeys()
+ {
+ return Tools.toEnumeration(values.keySet().iterator());
+ }
+}
Property changes on:
trunk/common/src/main/org/jboss/portal/common/i18n/ParentChildResourceBundle.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/ResourceBundleManager.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/common/src/main/org/jboss/portal/common/i18n/ResourceBundleManager.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.common.i18n;
import org.apache.log4j.Logger;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Map;
import java.util.ResourceBundle;
Deleted:
trunk/common/src/main/org/jboss/portal/common/util/LocalizedPropertyResourceBundle.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/util/LocalizedPropertyResourceBundle.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/common/src/main/org/jboss/portal/common/util/LocalizedPropertyResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -1,60 +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 java.util.PropertyResourceBundle;
-import java.util.Locale;
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class LocalizedPropertyResourceBundle extends PropertyResourceBundle
-{
-
- private final Locale locale;
-
- /**
- * Create an instanceof of localized property resource bundle.
- *
- * @param stream the stream to decode the property file
- * @param locale the locale to use
- * @throws IllegalArgumentException if the locale is null
- */
- public LocalizedPropertyResourceBundle(InputStream stream, Locale locale) throws
IOException
- {
- super(stream);
- if (locale == null)
- {
- throw new IllegalArgumentException("Locale cannot be null");
- }
- this.locale = locale;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-}
Deleted: trunk/common/src/main/org/jboss/portal/common/util/LocalizedString.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/LocalizedString.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/common/src/main/org/jboss/portal/common/util/LocalizedString.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -1,380 +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.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * An immutable localized string.
- *
- * @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
-{
-
- /** The logger. */
- private static final Logger log = Logger.getLogger(LocalizedString.class);
-
- /** The descriptions. */
- private final Map values;
-
- /** The default locale. */
- private final Locale defaultLocale;
-
- /**
- * 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
- * @since 2.4
- */
- public LocalizedString(String defaultValue, Locale defaultLocale) throws
IllegalArgumentException
- {
- if (defaultValue == null)
- {
- throw new IllegalArgumentException("No null default value allowed");
- }
- if (defaultLocale == null)
- {
- throw new IllegalArgumentException("No null default locale allowed");
- }
-
- //
- Map values = new HashMap(3);
- addValueForLocale(values, defaultLocale, defaultValue);
-
- //
- this.defaultLocale = defaultLocale;
- this.values = Collections.unmodifiableMap(values);
- }
-
- public LocalizedString(Locale defaultLocale) throws IllegalArgumentException
- {
- if (defaultLocale == null)
- {
- throw new IllegalArgumentException("No null default locale allowed");
- }
-
- //
- this.defaultLocale = defaultLocale;
- this.values = Collections.EMPTY_MAP;
- }
-
- public LocalizedString(Map values, Locale defaultLocale) throws
IllegalArgumentException
- {
- if (values == null)
- {
- throw new IllegalArgumentException("No null description map
allowed");
- }
- if (defaultLocale == null)
- {
- throw new IllegalArgumentException("No null default locale allowed");
- }
-
- // Convert strings to value
- Map tmp = new HashMap(values.size());
- for (Iterator i = values.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- Object key = entry.getKey();
- if (!(key instanceof Locale))
- {
- throw new IllegalArgumentException("Key not a locale " +
entry.getKey());
- }
- Object value = entry.getValue();
- if (!(value instanceof String))
- {
- throw new IllegalArgumentException("Value not a string " +
entry.getValue());
- }
- addValueForLocale(tmp, (Locale)key, (String)value);
- }
-
- //
- this.defaultLocale = defaultLocale;
- this.values = Collections.unmodifiableMap(tmp);
- }
-
- /**
- * Adds a new value for the specified locale to this LocalizedString. Note that if a
value existed for this Locale,
- * it will be overwritten.
- *
- * @param locale the locale of the value
- * @param value the value
- * @since 2.4
- */
- private void addValueForLocale(Map values, Locale locale, String value)
- {
- values.put(locale, new Value(locale, value));
- }
-
- /**
- * Determines if this LocalizedString contains any values.
- *
- * @return <code>true</code> if this LocalizedString contains localized
values, <code>false</code> otherwise.
- * @since 2.4
- */
- public boolean hasValues()
- {
- return values.isEmpty() == false;
- }
-
- /**
- * Return the string for the default locale.
- *
- * @return the string for the default locale
- */
- public String getDefaultString()
- {
- return getString(defaultLocale, false);
- }
-
- /**
- * Return the value for the default locale.
- *
- * @return the value for the default locale
- */
- public Value getDefaultValue()
- {
- return getValue(defaultLocale, false);
- }
-
- /**
- * Return the string of the localized value of the description.
- *
- * @param locale the desired locale for the description
- * @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
- */
- public String getString(Locale locale, boolean resolve)
- {
- Value value = getValue(locale, resolve);
- if (value != null)
- {
- return value.getString();
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Return a localized value of the description.
- *
- * @param locale the desired locale for the description
- * @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
- */
- public Value getValue(Locale locale, boolean resolve)
- {
- if (locale == null)
- {
- throw new IllegalArgumentException("No null locale accepted as
argument");
- }
-
- // fail fast is there aren't any values
- if (values.isEmpty())
- {
- return null;
- }
-
- if (resolve)
- {
- Value desc = (Value)values.get(locale);
- if (desc == null && !locale.getVariant().equals(""))
- {
- desc = (Value)values.get(new Locale(locale.getLanguage(),
locale.getCountry()));
- }
- if (desc == null && !locale.getCountry().equals(""))
- {
- desc = (Value)values.get(new Locale(locale.getLanguage()));
- }
- if (desc == null)
- {
- desc = (Value)values.get(defaultLocale);
- }
- return desc;
- }
- else
- {
- return (Value)values.get(locale);
- }
- }
-
- /** Return the default locale of this description. */
- public Locale getDefaultLocale()
- {
- return defaultLocale;
- }
-
- /**
- * Retrieves the localized value most appropriate based on the given desired locales.
- *
- * @param desiredLocales an array of compound language tags (as defined by <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF
- * RFC 3066</a>) ordered according to locale preferences.
- * @return the most appropriate localized value based on locale preferences.
- * @throws IllegalArgumentException if the array is null or one of the array string is
null or invalid (see
- * #getLocaleFromRFC3066LanguageTag(String))
- * @since 2.4
- */
- public String getMostAppropriateValueFor(String[] desiredLocales) throws
IllegalArgumentException
- {
- Value mapping = getPreferredOrBestLocalizedMappingFor(desiredLocales);
- return (mapping == null) ? null : mapping.getString();
- }
-
- /**
- * Retrieves the Locale-String mapping most appropriate based on the given desired
locales, which are ordered
- * according to locale preferences.
- *
- * @param desiredLocales an array of compound language tags (as defined by <a
href="http://www.ietf.org/rfc/rfc3066.txt">IETF
- * RFC 3066</a>) ordered according to locale preferences.
- * @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
- *
LocaleInfo#decodeLocaleInfoFromRFC3066LanguageTag(String)}
- * @since 2.4
- */
- public Value getPreferredOrBestLocalizedMappingFor(String[] desiredLocales) throws
IllegalArgumentException
- {
- if (desiredLocales == null)
- {
- throw new IllegalArgumentException("No null desired locale array
accepted");
- }
-
- if (values.isEmpty())
- {
- return null;
- }
-
- //
- 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);
- Locale locale = info.getLocale();
- value = getValue(locale, true);
- }
- catch (IllegalArgumentException e)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Invalid desired locale " + desiredLocale);
- }
- }
- }
-
- // todo julien
- // We could have a smarter version of this method but this version requires that
desiredLocales
- // are ordered by locale preference. Hence the first found is by definition the
best.
- }
-
- //
- if (value == null)
- {
- value = getValue(defaultLocale, true);
- }
-
- //
- return value;
- }
-
- /** A localized value. */
- public static class Value
- {
-
- private final Locale locale;
- private final String string;
-
- public Value(Locale locale, String string)
- {
- if (locale == null)
- {
- throw new IllegalArgumentException();
- }
- this.locale = locale;
- this.string = string;
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- public String getString()
- {
- 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;
- }
-}
Deleted: trunk/common/src/main/org/jboss/portal/common/util/MapResourceBundle.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/util/MapResourceBundle.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/common/src/main/org/jboss/portal/common/util/MapResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -1,60 +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 java.util.ResourceBundle;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Enumeration;
-import java.util.Collections;
-
-/**
- * A resource bundle that use a map as content.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class MapResourceBundle extends ResourceBundle
-{
-
- protected Map content;
-
- public MapResourceBundle(Map content)
- {
- this.content = new HashMap(content);
- }
-
- protected Object handleGetObject(String key)
- {
- if (key == null)
- {
- throw new NullPointerException();
- }
- return content.get(key);
- }
-
- public Enumeration getKeys()
- {
- return Collections.enumeration(content.keySet());
- }
-}
Deleted:
trunk/common/src/main/org/jboss/portal/common/util/ParentChildResourceBundle.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/common/util/ParentChildResourceBundle.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/common/src/main/org/jboss/portal/common/util/ParentChildResourceBundle.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -1,108 +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 java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-/**
- * This resource bundle takes two resource bundle to make one :
- * - The locale of this resource bundle is given by the child.
- * - For a given key present in the child and the parent, the child
- * value overrides the parent value.
- *
- * The locale used for the bundle is the child locale.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class ParentChildResourceBundle extends ResourceBundle
-{
-
- /** The bundle locale. */
- private Locale locale;
-
- /** The bundle values. */
- private Map values;
-
- /**
- * Construct a new resource bundle whose content is based on the child
- * and parent content.
- *
- * @param parent the parent eventually null
- * @param child the child
- * @throws IllegalArgumentException if the child is null or its locale is null
- */
- public ParentChildResourceBundle(ResourceBundle parent, ResourceBundle child) throws
IllegalArgumentException
- {
- // Arg check
- if (child == null)
- {
- throw new IllegalArgumentException("Child cannot be null");
- }
- if (child.getLocale() == null)
- {
- throw new IllegalArgumentException("Child locale must not be null");
- }
- this.locale = child.getLocale();
- this.values = new HashMap();
-
- // Set the parent content
- if (parent != null)
- {
- for (Enumeration e = parent.getKeys();e.hasMoreElements();)
- {
- String key = (String)e.nextElement();
- Object value = parent.getObject(key);
- values.put(key, value);
- }
- }
-
- // Set the child content
- for (Enumeration e = child.getKeys();e.hasMoreElements();)
- {
- String key = (String)e.nextElement();
- Object value = child.getObject(key);
- values.put(key, value);
- }
- }
-
- public Locale getLocale()
- {
- return locale;
- }
-
- protected Object handleGetObject(String key)
- {
- return values.get(key);
- }
-
- public Enumeration getKeys()
- {
- return Tools.toEnumeration(values.keySet().iterator());
- }
-}
Modified: trunk/common/src/main/org/jboss/portal/test/common/DescriptionTestCase.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/test/common/DescriptionTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/common/src/main/org/jboss/portal/test/common/DescriptionTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -28,7 +28,7 @@
import java.util.HashMap;
import java.util.Locale;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/common/src/main/org/jboss/portal/test/common/LocalizedStringTestCase.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/test/common/LocalizedStringTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/common/src/main/org/jboss/portal/test/common/LocalizedStringTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.common;
import junit.framework.TestCase;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.HashMap;
import java.util.Locale;
Modified:
trunk/common/src/main/org/jboss/portal/test/common/ParentChildResourceBundleTestCase.java
===================================================================
---
trunk/common/src/main/org/jboss/portal/test/common/ParentChildResourceBundleTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/common/src/main/org/jboss/portal/test/common/ParentChildResourceBundleTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -32,7 +32,7 @@
import junit.framework.TestCase;
-import org.jboss.portal.common.util.ParentChildResourceBundle;
+import org.jboss.portal.common.i18n.ParentChildResourceBundle;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/GenericContent.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/GenericContent.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/GenericContent.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.impl.model.content.AbstractContent;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Locale;
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -38,7 +38,7 @@
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Iterator;
import java.util.Map;
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -37,7 +37,7 @@
import org.jboss.portal.core.impl.model.content.InternalContentProvider;
import org.jboss.portal.identity.User;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.ResourceBundle;
import java.util.Locale;
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.impl.model.content.AbstractContent;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Locale;
Modified: trunk/core/src/main/org/jboss/portal/core/model/content/Content.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/content/Content.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/core/src/main/org/jboss/portal/core/model/content/Content.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,11 +22,8 @@
******************************************************************************/
package org.jboss.portal.core.model.content;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collection;
import java.util.Iterator;
/**
Modified: trunk/core/src/main/org/jboss/portal/core/model/content/ContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/content/ContentProvider.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/core/model/content/ContentProvider.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.impl.model.content.AbstractContent;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Locale;
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentProvider.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -26,7 +26,7 @@
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -29,7 +29,7 @@
import org.jboss.portal.faces.el.DelegatingPropertyResolver;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.IteratorStatus;
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.portlet.Portlet;
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.value.Value;
import org.jboss.portal.common.value.StringValue;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.portlet.info.PreferenceInfo;
Modified: trunk/format/src/main/org/jboss/portal/test/format/BBCodeHTML2HTMLTestCase.java
===================================================================
---
trunk/format/src/main/org/jboss/portal/test/format/BBCodeHTML2HTMLTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/format/src/main/org/jboss/portal/test/format/BBCodeHTML2HTMLTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.format;
-import org.jboss.portal.common.util.MapResourceBundle;
+import org.jboss.portal.common.i18n.MapResourceBundle;
import org.jboss.portal.format.parser.bbcode.BBCodeParser;
import org.jboss.portal.format.render.bbcodehtml.ToHTMLConfig;
import org.jboss.portal.format.render.bbcodehtml.ToHTMLRenderer;
Modified:
trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/identity/src/main/org/jboss/portal/identity/config/info/PropertyInfoSupport.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import org.jboss.portal.identity.info.PropertyInfo;
import org.jboss.portal.identity.config.metadata.profile.PropertyMetaData;
import org.jboss.portal.identity.config.metadata.profile.LocalizedValueMetaData;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.identity.IdentityException;
import org.jboss.logging.Logger;
Modified: trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/identity/src/main/org/jboss/portal/identity/info/PropertyInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -21,7 +21,7 @@
*/
package org.jboss.portal.identity.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168;
import org.jboss.portal.common.util.EmptyResourceBundle;
-import org.jboss.portal.common.util.ParentChildResourceBundle;
+import org.jboss.portal.common.i18n.ParentChildResourceBundle;
import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.i18n.ResourceBundleFactory;
import org.jboss.portal.portlet.impl.jsr168.metadata.LanguagesMetaData;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.info.MetaInfo;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
package org.jboss.portal.portlet.impl.jsr168.info;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.ModeInfo;
import java.util.Locale;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.value.Value;
import org.jboss.portal.portlet.info.PreferenceInfo;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;
import org.jboss.portal.common.i18n.ResourceBundleManager;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
package org.jboss.portal.portlet.impl.jsr168.info;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.WindowStateInfo;
import java.util.Locale;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedStringMetaData;
import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedValueMetaData;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.metadata;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java 2007-03-24 22:32:21
UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java 2007-03-24 23:13:11
UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* Portlet metadata (display-name, title, short title, keywords).
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java 2007-03-24 22:32:21
UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java 2007-03-24 23:13:11
UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.info;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.info;
-import org.jboss.portal.common.util.LocalizedString;
-import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* Describes a Portlet preference.
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.info;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.support.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.MetaInfo;
import java.util.HashMap;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.support.info;
import org.jboss.portal.Mode;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.ModeInfo;
import java.util.Locale;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.support.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.PreferenceInfo;
import java.util.Locale;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.support.info;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.info.WindowStateInfo;
import java.util.Locale;
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2007-03-24
22:32:21 UTC (rev 6817)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.PortletInfo;
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
import org.jboss.portal.common.util.CollectionBuilder;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;
import org.jboss.portal.portlet.InvalidPortletIdException;
Modified:
trunk/portlet-federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
===================================================================
---
trunk/portlet-federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/portlet-federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -34,7 +34,7 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.support.info.PortletInfoSupport;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Collection;
import java.util.Set;
Modified: trunk/widget/src/main/org/jboss/portal/widget/Widget.java
===================================================================
--- trunk/widget/src/main/org/jboss/portal/widget/Widget.java 2007-03-24 22:32:21 UTC (rev
6817)
+++ trunk/widget/src/main/org/jboss/portal/widget/Widget.java 2007-03-24 23:13:11 UTC (rev
6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.widget;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import java.util.Map;
Modified: trunk/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
===================================================================
--- trunk/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-03-24 22:32:21
UTC (rev 6817)
+++ trunk/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-03-24 23:13:11
UTC (rev 6818)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.widget.google;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.UUIDGenerator;
import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.widget.Widget;
Modified:
trunk/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java
===================================================================
---
trunk/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -23,7 +23,7 @@
package org.jboss.portal.widget.google.provider;
import org.jboss.portal.common.util.XML;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.common.concurrent.loader.ObjectLoader;
import org.jboss.portal.widget.google.type.DataType;
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/ServiceObjectFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/ServiceObjectFactory.java 2007-03-24
22:32:21 UTC (rev 6817)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/ServiceObjectFactory.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -55,7 +55,7 @@
}
/** Produces String from LocalizedString */
- public static String extractString(org.jboss.portal.common.util.LocalizedString ls)
+ public static String extractString(org.jboss.portal.common.i18n.LocalizedString ls)
{
return ls.getPreferredOrBestLocalizedMappingFor(new
String[]{"en"}).getString();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-24 22:32:21 UTC (rev
6817)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java 2007-03-24 23:13:11 UTC (rev
6818)
@@ -370,7 +370,7 @@
* <code>null</code> if no such value can be found.
* @since 2.6
*/
- public static org.jboss.portal.wsrp.core.LocalizedString
convertToWSRPLocalizedString(org.jboss.portal.common.util.LocalizedString
localizedString,
+ public static org.jboss.portal.wsrp.core.LocalizedString
convertToWSRPLocalizedString(org.jboss.portal.common.i18n.LocalizedString
localizedString,
String[] desiredLocales)
{
if (localizedString == null)
@@ -383,7 +383,7 @@
desiredLocales = new
String[]{LocaleInfo.getRFC3066LanguageTagFor(Locale.getDefault())};
}
- org.jboss.portal.common.util.LocalizedString.Value bestMapping =
localizedString.getPreferredOrBestLocalizedMappingFor(desiredLocales);
+ org.jboss.portal.common.i18n.LocalizedString.Value bestMapping =
localizedString.getPreferredOrBestLocalizedMappingFor(desiredLocales);
if (bestMapping != null)
{
Locale locale = bestMapping.getLocale();
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-24
22:32:21 UTC (rev 6817)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/portlet/info/WSRPPortletInfo.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -304,19 +304,19 @@
}
}
- metaInfos.put(MetaInfo.KEYWORDS, new
org.jboss.portal.common.util.LocalizedString(keywordsString, locale));
+ metaInfos.put(MetaInfo.KEYWORDS, new
org.jboss.portal.common.i18n.LocalizedString(keywordsString, locale));
metaInfo = new WSRPMetaInfo(metaInfos);
}
- private org.jboss.portal.common.util.LocalizedString
createPortalLocalizedStringFrom(LocalizedString wsrpLocalizedString)
+ private org.jboss.portal.common.i18n.LocalizedString
createPortalLocalizedStringFrom(LocalizedString wsrpLocalizedString)
{
if (wsrpLocalizedString == null)
{
- return new org.jboss.portal.common.util.LocalizedString(Locale.ENGLISH);
+ return new org.jboss.portal.common.i18n.LocalizedString(Locale.ENGLISH);
}
- return new
org.jboss.portal.common.util.LocalizedString(wsrpLocalizedString.getValue(),
+ return new
org.jboss.portal.common.i18n.LocalizedString(wsrpLocalizedString.getValue(),
LocaleInfo.decodeLocaleInfoFromRFC3066LanguageTag(wsrpLocalizedString.getLang()).getLocale());
}
@@ -372,9 +372,9 @@
this.state = state;
}
- public org.jboss.portal.common.util.LocalizedString getDescription()
+ public org.jboss.portal.common.i18n.LocalizedString getDescription()
{
- return new org.jboss.portal.common.util.LocalizedString(getWindowStateName() +
" window state", Locale.ENGLISH);
+ return new org.jboss.portal.common.i18n.LocalizedString(getWindowStateName() +
" window state", Locale.ENGLISH);
}
public WindowState getWindowState()
@@ -397,9 +397,9 @@
this.mode = mode;
}
- public org.jboss.portal.common.util.LocalizedString getDescription()
+ public org.jboss.portal.common.i18n.LocalizedString getDescription()
{
- return new org.jboss.portal.common.util.LocalizedString(getModeName() + "
mode", Locale.ENGLISH);
+ return new org.jboss.portal.common.i18n.LocalizedString(getModeName() + "
mode", Locale.ENGLISH);
}
public Mode getMode()
@@ -491,9 +491,9 @@
this.metaInfos = metaInfos;
}
- public org.jboss.portal.common.util.LocalizedString getMetaValue(String key)
+ public org.jboss.portal.common.i18n.LocalizedString getMetaValue(String key)
{
- return (org.jboss.portal.common.util.LocalizedString)metaInfos.get(key);
+ return (org.jboss.portal.common.i18n.LocalizedString)metaInfos.get(key);
}
}
@@ -520,10 +520,10 @@
static class WSRPPreferenceInfo implements PreferenceInfo
{
private String key;
- private org.jboss.portal.common.util.LocalizedString displayName;
- private org.jboss.portal.common.util.LocalizedString description;
+ private org.jboss.portal.common.i18n.LocalizedString displayName;
+ private org.jboss.portal.common.i18n.LocalizedString description;
- public WSRPPreferenceInfo(String key, org.jboss.portal.common.util.LocalizedString
displayName, org.jboss.portal.common.util.LocalizedString description)
+ public WSRPPreferenceInfo(String key, org.jboss.portal.common.i18n.LocalizedString
displayName, org.jboss.portal.common.i18n.LocalizedString description)
{
this.key = key;
this.displayName = displayName;
@@ -535,12 +535,12 @@
return key;
}
- public org.jboss.portal.common.util.LocalizedString getDisplayName()
+ public org.jboss.portal.common.i18n.LocalizedString getDisplayName()
{
return displayName;
}
- public org.jboss.portal.common.util.LocalizedString getDescription()
+ public org.jboss.portal.common.i18n.LocalizedString getDescription()
{
return description;
}
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-24
22:32:21 UTC (rev 6817)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/PortletManagementHandler.java 2007-03-24
23:13:11 UTC (rev 6818)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.util.LocaleInfo;
-import org.jboss.portal.common.util.LocalizedString;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;