portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request JetspeedRequestContext.java
Date Mon, 16 Aug 2004 18:31:53 GMT
taylor      2004/08/16 11:31:53

  Modified:    portal/src/java/org/apache/jetspeed/request
                        JetspeedRequestContext.java
  Log:
  adding support for full language support for JSR 168, contribution from Shinsuke
  
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.28      +14 -16    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
  
  Index: JetspeedRequestContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JetspeedRequestContext.java	5 Aug 2004 04:50:28 -0000	1.27
  +++ JetspeedRequestContext.java	16 Aug 2004 18:31:52 -0000	1.28
  @@ -26,7 +26,6 @@
   import javax.servlet.ServletConfig;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  -import javax.servlet.http.HttpSession;
   
   import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.aggregator.ContentDispatcher;
  @@ -483,34 +482,33 @@
        * @param portlet
        * @return
        */
  -    public Language getPreferedLanguage( PortletDefinition portlet )
  +    public Language getPreferedLanguage(PortletDefinition portlet)
       {
  -        HttpSession session = request.getSession();
  -        Map languageMap = (Map) session.getAttribute(PREFERED_LANGUAGE_SESSION_KEY);
  -        Language language = (Language) languageMap.get(portlet);
  -        if(language != null)
  -        {
  -            return language;
  -        }
  -        
  +        // TODO cannot get a proper Language when changing a locale by Locale Selector
  +        // HttpSession session = request.getSession();
  +        // Map languageMap = (Map) session.getAttribute(PREFERED_LANGUAGE_SESSION_KEY);
  +        // Language language = (Language) languageMap.get(portlet);
  +        // if(language != null)
  +        // {
  +        //     return language;
  +        // }
           LanguageSet languageSet = portlet.getLanguageSet();
  -        language = languageSet.get(locale);        
  +        Language language = languageSet.get(locale);
           
           Enumeration locales = request.getLocales();
  -        while (locales.hasMoreElements() && language != null)
  +        while (locales.hasMoreElements() && language == null)
           {
               Locale aLocale = (Locale) locales.nextElement();
               language = languageSet.get(aLocale);            
           }
   
           Iterator langItr = languageSet.iterator();
  -        if (langItr.hasNext() && language != null)
  +        if (langItr.hasNext() && language == null)
           {
               language = (Language) langItr.next();
  -            
           }
           
  -        if(language == null)
  +        if (language == null)
           {
               MutableLanguage languageCtl = new LanguageImpl();
               languageCtl.setLocale(locale);
  @@ -519,7 +517,7 @@
               language = languageCtl;
           }
           
  -        languageMap.put(portlet, language);
  +        // languageMap.put(portlet, language);
           return language;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message