From: Chris L. <chr...@jb...> - 2006-03-03 20:43:08
|
User: claprun Date: 06/03/03 15:42:53 Modified: wsrp/src/main/org/jboss/portal/wsrp/producer PortalContainerBridge.java Log: - Updated javadoc: we don't do full RFC 3066 support. - Modified method name. - Adapted PortalContainerBridge to code changes. Revision Changes Path 1.3 +8 -11 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/producer/PortalContainerBridge.java (In the diff below, changes in quantity of whitespace are not shown.) Index: PortalContainerBridge.java =================================================================== RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/producer/PortalContainerBridge.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- PortalContainerBridge.java 3 Mar 2006 16:52:13 -0000 1.2 +++ PortalContainerBridge.java 3 Mar 2006 20:42:53 -0000 1.3 @@ -22,6 +22,7 @@ package org.jboss.portal.wsrp.producer; +import org.jboss.portal.common.util.LocaleInfo; import org.jboss.portal.common.util.LocalizedString; import org.jboss.portal.common.util.LocalizedString.Value; import org.jboss.portal.server.app.Component; @@ -33,12 +34,11 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Locale; -import java.util.Map; import java.util.Set; /** * @author <a href="mailto:chr...@jb...">Chris Laprun</a> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class PortalContainerBridge { @@ -84,20 +84,17 @@ // title is generated from display name LocalizedString displayName = component.getDisplayName(); - Value bestMapping = displayName.getMostAppropriateLocalizedMappingFor(desiredLocales); + Value bestMapping = displayName.getPreferredOrBestLocalizedMappingFor(desiredLocales); Locale locale = bestMapping.getLocale(); - /*Map.Entry bestMapping = displayName.getMostAppropriateLocalizedMappingFor(desiredLocales); - Locale locale = (Locale)bestMapping.getKey();*/ - String language = LocalizedString.getRFC3066LanguageTagFromLocale(locale); - desc.setTitle(new org.jboss.portal.wsrp.core.LocalizedString(language, null, (String)bestMapping.getString())); + String language = LocaleInfo.decodeLocaleInfo(locale).getRFC3066LanguageTag(); + desc.setTitle(new org.jboss.portal.wsrp.core.LocalizedString(language, null, bestMapping.getString())); // description LocalizedString description = component.getDescription(); - bestMapping = description.getMostAppropriateLocalizedMappingFor(desiredLocales); + bestMapping = description.getPreferredOrBestLocalizedMappingFor(desiredLocales); locale = bestMapping.getLocale(); - //locale = (Locale)bestMapping.getKey(); - language = LocalizedString.getRFC3066LanguageTagFromLocale(locale); - desc.setDescription(new org.jboss.portal.wsrp.core.LocalizedString(language, null, (String)bestMapping.getString())); + language = LocaleInfo.decodeLocaleInfo(locale).getRFC3066LanguageTag(); + desc.setDescription(new org.jboss.portal.wsrp.core.LocalizedString(language, null, bestMapping.getString())); // MarkupTypes /*ContentTypes contentTypes = component.getContentTypes(); |