myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r745174 - in /myfaces/trinidad/branches/1.2.11.1-branch: ./ trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/ trinidad-impl/src/main/java/org/apache/myfaces/trinid...
Date Tue, 17 Feb 2009 18:01:51 GMT
Author: arobinson74
Date: Tue Feb 17 18:01:50 2009
New Revision: 745174

URL: http://svn.apache.org/viewvc?rev=745174&view=rev
Log:
TRINIDAD-1109
Add support for the Konqueror browser as an agent. Fixed a problem where an unknown agent
resulted in a null pointer exception

Modified:
    myfaces/trinidad/branches/1.2.11.1-branch/   (props changed)
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/
  (props changed)
    myfaces/trinidad/branches/1.2.11.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/
  (props changed)

Propchange: myfaces/trinidad/branches/1.2.11.1-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 17 18:01:50 2009
@@ -1 +1,2 @@
 /myfaces/trinidad/branches/1.2.9.1-branch:697924,699406,699496
+/myfaces/trinidad/trunk:745151

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -45,7 +45,7 @@
    * Constant for telnet device type
    */
   public static final Object TYPE_TELNET = "telnet";
-  
+
   /**
    * Constant for desktop devices
    */
@@ -102,7 +102,7 @@
    * Constant for pocket pc platform
    */
   public static final String PLATFORM_PPC = "ppc";
-  
+
   /**
    * Constant for blackberry platform
    */
@@ -120,6 +120,16 @@
   public static final String PLATFORM_GENERICPDA = "genericpda";
 
   /**
+   * Constant for when the agent is not supported or not recognized
+   */
+  public static final String AGENT_UNKNOWN = "unknown";
+
+  /**
+   * Constant for Konqueror agent
+   */
+  public static final String AGENT_KONQUEROR = "konqueror";
+
+  /**
    * Constant for Internet Explorer agent
    */
   public static final String AGENT_IE = "ie";
@@ -133,7 +143,7 @@
    * Constant for Apple Webkit agent. Used for all Webkit based agent like Safari
    */
   public static final String AGENT_WEBKIT = "webkit";
-  
+
   /**
    * Constant for BlackBerry Browser agent.  (Note the distinction from the
    * BlackBerry platform.  The BlackBerry Browser agent runs on the
@@ -141,7 +151,6 @@
    * BlackBerry platform.)
    */
   public static final String AGENT_BLACKBERRY = "blackberry";
-   
 
   /**
    * Constant for Symbian Nokia S60 agent. Used for Nokia Series 60

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,11 +35,11 @@
 import org.apache.myfaces.trinidad.component.visit.VisitResult;
 import org.apache.myfaces.trinidad.context.Agent;
 import org.apache.myfaces.trinidad.context.PartialPageContext;
-import org.apache.myfaces.trinidad.context.RequestContext;
-
 import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
+
 /**
  * Basic implementation of the core rendering functionality
  * across render kits.
@@ -47,8 +47,8 @@
 public class CoreRenderer extends Renderer
 {
   // TODO Move elsewhere?
-  static public final char CHAR_UNDEFINED = (char) -1;  
-  static public final int NO_CHILD_INDEX = -1;    
+  static public final char CHAR_UNDEFINED = (char) -1;
+  static public final int NO_CHILD_INDEX = -1;
 
   protected CoreRenderer()
   {
@@ -83,9 +83,9 @@
         partialContext.isPartialTarget(component.getClientId(visitContext.getFacesContext())))
     {
       // visit the component instance
-      return callback.visit(visitContext, component);      
+      return callback.visit(visitContext, component);
     }
-    else      
+    else
     {
       // Not visiting this component, but allow visit to
       // continue into this subtree in case we've got
@@ -148,7 +148,7 @@
     UIXComponent     component)
   {
   }
-  
+
   public void tearDownEncodingContext(
     FacesContext context,
     RenderingContext rc,
@@ -161,7 +161,7 @@
       tearDownEncodingContext(context, rc, (UIXComponent)component);
   }
 
-  
+
   //
   // COERCION HELPERS
   //
@@ -183,9 +183,9 @@
   {
     if (o == null)
       return null;
-    
+
     String uri = o.toString();
-    
+
     // Treat two slashes as server-relative
     if (uri.startsWith("//"))
     {
@@ -204,9 +204,9 @@
   {
     if (o == null)
       return null;
-    
+
     String uri = o.toString();
-    
+
     // Treat two slashes as server-relative
     if (uri.startsWith("//"))
     {
@@ -230,7 +230,7 @@
 
 
   /**
-   * Returns the integer value of an object;  this does 
+   * Returns the integer value of an object;  this does
    * not support null (which must be substituted with a default
    * before calling).
    */
@@ -242,7 +242,7 @@
 
 
   /**
-   * Returns the integer value of an object;  this does 
+   * Returns the integer value of an object;  this does
    * not support null (which must be substituted with a default
    * before calling).
    */
@@ -259,7 +259,7 @@
   {
     if (o == null)
       return CHAR_UNDEFINED;
-    
+
     char c;
     if (o instanceof Character)
     {
@@ -297,18 +297,18 @@
   @Override
   public final void encodeBegin(FacesContext context,
                           UIComponent component) throws IOException
-  {    
+  {
     if (!getRendersChildren())
     {
-      RenderingContext arc = RenderingContext.getCurrentInstance();
-      if (arc == null)
+      RenderingContext rc = RenderingContext.getCurrentInstance();
+      if (rc == null)
         throw new IllegalStateException(_LOG.getMessage(
           "NO_RENDERINGCONTEXT"));
-      
+
       FacesBean bean = getFacesBean(component);
-      
-      beforeEncode(context, arc, component, bean);      
-      encodeBegin(context, arc, component, bean);
+
+      beforeEncode(context, rc, component, bean);
+      encodeBegin(context, rc, component, bean);
     }
   }
 
@@ -323,47 +323,47 @@
   public final void encodeEnd(FacesContext context,
                         UIComponent component) throws IOException
   {
-    RenderingContext arc = RenderingContext.getCurrentInstance();
-    if (arc == null)
+    RenderingContext rc = RenderingContext.getCurrentInstance();
+    if (rc == null)
       throw new IllegalStateException(_LOG.getMessage(
         "NO_RENDERINGCONTEXT"));
 
     FacesBean bean = getFacesBean(component);
     if (getRendersChildren())
     {
-      beforeEncode(context, arc, component, bean);
-      encodeAll(context, arc, component, bean);
+      beforeEncode(context, rc, component, bean);
+      encodeAll(context, rc, component, bean);
     }
     else
     {
-      encodeEnd(context, arc, component, bean);
+      encodeEnd(context, rc, component, bean);
     }
-    afterEncode(context, arc, component, bean);      
+    afterEncode(context, rc, component, bean);
   }
 
   /**
-   * Hook for rendering the start of a component;  only 
+   * Hook for rendering the start of a component;  only
    * called if getRendersChildren() is <em>false</em>.
    */
   protected void encodeBegin(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean) throws IOException
   {
     if (getRendersChildren())
       throw new IllegalStateException();
   }
 
   /**
-   * Hook for rendering the end of a component;  only 
+   * Hook for rendering the end of a component;  only
    * called if getRendersChildren() is <em>false</em>.
    */
   protected void encodeEnd(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean) throws IOException
   {
     if (getRendersChildren())
       throw new IllegalStateException();
@@ -371,14 +371,14 @@
 
 
   /**
-   * Hook for rendering all of a component;  only 
+   * Hook for rendering all of a component;  only
    * called if getRendersChildren() is <em>true</em>.
    */
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean) throws IOException
   {
     if (!getRendersChildren())
       throw new IllegalStateException();
@@ -411,7 +411,7 @@
         }
       }
     }
-    
+
     child.encodeEnd(context);
   }
 
@@ -424,7 +424,7 @@
     int childCount = component.getChildCount();
     if (childCount == 0)
       return;
-    
+
     for(UIComponent child : (List<UIComponent>)component.getChildren())
     {
       if (child.isRendered())
@@ -435,28 +435,28 @@
   }
 
   protected void delegateRenderer(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean,
-    CoreRenderer        renderer) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean,
+    CoreRenderer     renderer) throws IOException
   {
     if (renderer.getRendersChildren())
     {
-      renderer.encodeAll(context, arc, component, bean);
+      renderer.encodeAll(context, rc, component, bean);
     }
     else
     {
       throw new IllegalStateException();
     }
   }
-    
+
   protected void delegateRendererBegin(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean,
-    CoreRenderer        renderer) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean,
+    CoreRenderer     renderer) throws IOException
   {
     if (renderer.getRendersChildren())
     {
@@ -464,16 +464,16 @@
     }
     else
     {
-      renderer.encodeBegin(context, arc, component, bean);
+      renderer.encodeBegin(context, rc, component, bean);
     }
   }
 
   protected void delegateRendererEnd(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean,
-    CoreRenderer        renderer) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean,
+    CoreRenderer     renderer) throws IOException
   {
     if (renderer.getRendersChildren())
     {
@@ -481,7 +481,7 @@
     }
     else
     {
-      renderer.encodeEnd(context, arc, component, bean);
+      renderer.encodeEnd(context, rc, component, bean);
     }
   }
 
@@ -524,7 +524,7 @@
     // Otherwise, if ID isn't set, don't bother
     if (id == null)
       return false;
-    
+
     // ... or if the ID was generated, don't bother
     if (id.startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
       return false;
@@ -543,18 +543,18 @@
   }
 
   static protected final Object getRenderingProperty(
-    RenderingContext arc,
-    Object              key)
+    RenderingContext rc,
+    Object           key)
   {
-    return arc.getProperties().get(key);
+    return rc.getProperties().get(key);
   }
 
   static protected final Object setRenderingProperty(
-    RenderingContext arc,
-    Object              key,
-    Object              value)
+    RenderingContext rc,
+    Object           key,
+    Object           value)
   {
-    return arc.getProperties().put(key, value);
+    return rc.getProperties().put(key, value);
   }
 
   /**
@@ -570,7 +570,7 @@
 
     return facet;
   }
-  
+
   /**
    * Returns true if the component has children and at least
    * one has rendered=="true".
@@ -581,7 +581,7 @@
     int count = component.getChildCount();
     if (count == 0)
       return false;
-      
+
     for(UIComponent child : (List<UIComponent>)component.getChildren())
     {
       if (child.isRendered())
@@ -589,7 +589,7 @@
         return true;
       }
     }
-    
+
     return false;
   }
 
@@ -602,7 +602,7 @@
     int count = component.getChildCount();
     if (count == 0)
       return 0;
-      
+
     int total = 0;
     for(UIComponent child : (List<UIComponent>)component.getChildren())
     {
@@ -611,14 +611,14 @@
         total++;
       }
     }
-    
+
     return total;
   }
 
 
  /**
    * @param afterChildIndex The children coming after this index, will
-   * be considered. 
+   * be considered.
    * @return the index of the next child that must be rendered, or
    * {@link #NO_CHILD_INDEX} if there is none.
    */
@@ -645,85 +645,90 @@
   // AGENT CAPABILITY CONVENIENCE METHODS
   //
 
-  static public boolean isDesktop(RenderingContext arc)
+  static public boolean isDesktop(RenderingContext rc)
   {
-    return (Agent.TYPE_DESKTOP.equals(arc.getAgent().getType()));
+    return (Agent.TYPE_DESKTOP.equals(rc.getAgent().getType()));
   }
 
-  static public boolean isPDA(RenderingContext arc)
+  static public boolean isPDA(RenderingContext rc)
   {
-    return (Agent.TYPE_PDA.equals(arc.getAgent().getType()));
+    return (Agent.TYPE_PDA.equals(rc.getAgent().getType()));
   }
 
-  static public boolean isIE(RenderingContext arc)
+  static public boolean isIE(RenderingContext rc)
   {
-    return (Agent.AGENT_IE.equals(arc.getAgent().getAgentName()));
+    return (Agent.AGENT_IE.equals(rc.getAgent().getAgentName()));
   }
 
-  static public boolean isGecko(RenderingContext arc)
+  static public boolean isKonqueror(RenderingContext rc)
   {
-    return (Agent.AGENT_GECKO.equals(arc.getAgent().getAgentName()));
+    return (Agent.AGENT_KONQUEROR.equals(rc.getAgent().getAgentName()));
   }
 
-  static public boolean isWebKit(RenderingContext arc)
+  static public boolean isGecko(RenderingContext rc)
   {
-    return (Agent.AGENT_WEBKIT.equals(arc.getAgent().getAgentName()));
+    return (Agent.AGENT_GECKO.equals(rc.getAgent().getAgentName()));
   }
 
-  static public boolean isIPhone(RenderingContext arc)
+  static public boolean isWebKit(RenderingContext rc)
   {
-    return (Agent.PLATFORM_IPHONE.equals(arc.getAgent().getPlatformName()));
+    return (Agent.AGENT_WEBKIT.equals(rc.getAgent().getAgentName()));
   }
-  
-  static public boolean isGenericPDA(RenderingContext arc)
+
+  static public boolean isIPhone(RenderingContext rc)
+  {
+    return (Agent.PLATFORM_IPHONE.equals(rc.getAgent().getPlatformName()));
+  }
+
+  static public boolean isGenericPDA(RenderingContext rc)
   {
-    return (Agent.PLATFORM_GENERICPDA.equals(arc.getAgent().getPlatformName()));
+    return (Agent.PLATFORM_GENERICPDA.equals(rc.getAgent().getPlatformName()));
   }
 
-  static public boolean isInaccessibleMode(RenderingContext arc)
+  static public boolean isInaccessibleMode(RenderingContext rc)
   {
-    return (arc.getAccessibilityMode() ==
+    return (rc.getAccessibilityMode() ==
             RequestContext.Accessibility.INACCESSIBLE);
   }
 
-  static public boolean isScreenReaderMode(RenderingContext arc)
+  static public boolean isScreenReaderMode(RenderingContext rc)
   {
-    return (arc.getAccessibilityMode() ==
+    return (rc.getAccessibilityMode() ==
             RequestContext.Accessibility.SCREEN_READER);
   }
 
   //
   // Encoding hook methods for sub-classes
   //
-  
+
   /**
    * Hook method that gets invoked before the component is encoded
-   * 
+   *
    * @see #encodeBegin(FacesContext, RederingContext, UIComponent, FacesBean)
    * @see #encodeAll(FacesContext, RederingContext, UIComponent, FacesBean)
    */
   protected void beforeEncode(
     FacesContext     context,
-    RenderingContext arc,
+    RenderingContext rc,
     UIComponent      component,
     FacesBean        bean)
   {
-    setupEncodingContext(context, arc, component);
+    setupEncodingContext(context, rc, component);
   }
-  
+
   /**
    * Hook method that gets invoked after the component is encoded
-   * 
+   *
    * @see #encodeEnd(FacesContext, RederingContext, UIComponent, FacesBean)
    * @see #encodeAll(FacesContext, RederingContext, UIComponent, FacesBean)
    */
   protected void afterEncode(
     FacesContext     context,
-    RenderingContext arc,
+    RenderingContext rc,
     UIComponent      component,
     FacesBean        bean)
   {
-    tearDownEncodingContext(context, arc, component);
+    tearDownEncodingContext(context, rc, component);
   }
 
   //
@@ -764,13 +769,13 @@
    * @param styleClass the style class
    */
   static public void renderStyleClass(
-    FacesContext        context,
-    RenderingContext arc,
-    String              styleClass) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    String           styleClass) throws IOException
   {
     if (styleClass != null)
     {
-      styleClass = arc.getStyleClass(styleClass);
+      styleClass = rc.getStyleClass(styleClass);
       context.getResponseWriter().writeAttribute("class", styleClass, null);
     }
   }
@@ -781,14 +786,14 @@
    * @param styleClasses the style classes
    */
   static public void renderStyleClasses(
-    FacesContext        context,
-    RenderingContext    rc,
-    String[]            styleClasses) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    String[]         styleClasses) throws IOException
   {
     int length = styleClasses.length;
     if (length == 0)
       return;
-    
+
     String value;
     // Optimize one-element arrays
     if (length == 1)
@@ -817,7 +822,7 @@
           }
         }
       }
-      
+
       if (builder.length() == 0)
         value = null;
       else

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,7 +37,7 @@
   public Agent createAgent(Map<String, String> headerMap)
   {
     // this method primarily exists for use during testing
-    
+
     AgentImpl agent = new AgentImpl();
     _populateAgentImpl(headerMap,agent);
     return agent;
@@ -70,7 +70,7 @@
   // consulted to correctly populate the agent
   private void _populateAgentImpl(Map<String, String> headerMap, AgentImpl agent)
   {
-    
+
     String userAgent = headerMap.get("User-Agent");
 
     if ((userAgent != null) && userAgent.startsWith("PTG"))
@@ -95,7 +95,7 @@
       _populateUnknownAgentImpl(null, agent);
       return;
     }
-    
+
     //the useragent string for telnet and PDA design time will start with
     //OracleJDevMobile because in each of these cases we know we have an
     //exact match in the device repository for the agent name.  This is
@@ -250,7 +250,7 @@
     // Log warning message that we are setting the agent entry to unknown attributes
     _LOG.warning("UNKNOWN_AGENT_ATTRIBUTES_CREATE_WITH_UNKNOWN", userAgent);
     agent.setAgentEntryToNULL();
-    agent.setAgent(_UNKNOWN);
+    agent.setAgent(Agent.AGENT_UNKNOWN);
     agent.setType(_UNKNOWN);
     agent.setAgentVersion(_UNKNOWN);
     agent.setPlatform(_UNKNOWN);
@@ -385,7 +385,7 @@
     agentObj.setAgent(Agent.AGENT_IE);
     agentObj.setAgentVersion(version);
     agentObj.setPlatform(Agent.PLATFORM_PPC);
-    
+
     if(uaPixels != null && uaPixels.length() > 0)
     {
       // UA-pixels is defined as <width>x<height>
@@ -409,7 +409,7 @@
           _LOG.fine(ex);
         }
       }
-      
+
       if(width != null && height != null)
       {
         agentObj.__addRequestCapability(TrinidadAgent.CAP_WIDTH,width);
@@ -421,7 +421,7 @@
       }
     }
   }
-  
+
     /**
      * populates data from a Blackberry browser request
      */
@@ -432,9 +432,9 @@
       // model, e.g. for the BlackBerry browser 4.1.0 on
       // the BlackBerry 8700 device, the User-Agent string begins with
       // BlackBerry8700/4.1.0
-      
+
       int start = agent.indexOf("BlackBerry");
-      
+
       String version = null;
       String makeModel = null;
 
@@ -449,13 +449,13 @@
             // BlackBerry<model> (e.g. BlackBerry8700), which we will
             // use as the Agent hardwareMakeModel
             makeModel = agent.substring(start,slashLoc);
-            
+
             // _getVersion assumes the location of the slash is passed in,
             // and starts looking for the version at the NEXT character
             version = _getVersion(agent, slashLoc);
         }
       }
-      
+
       // note that the agent and platform are both BLACKBERRY
       // this is because it is the BlackBerry Browser running on the
       // BlackBerry device
@@ -610,7 +610,7 @@
     //Change 2008-05-13:
     // We need the rv to support @agent versioning in CSS as the date makes no sense,
     // so look for the rv:, not the Gecko build date
-    
+
     agentObj.setType(Agent.TYPE_DESKTOP);
     agentObj.setAgent(Agent.AGENT_GECKO);
 
@@ -649,11 +649,11 @@
       }
     }
   }
-  
+
   /**
    * Returns an AgentEntry for the Opera browser.
    */
-  
+
   private void _populateOperaAgentImpl(String agent,AgentImpl agentObj)
   {
     int start = agent.indexOf("Opera Mini");
@@ -783,7 +783,13 @@
       boolean isJDevVE = agent.indexOf("JDeveloper", paren) > 0;
       boolean isJDevJSVE = agent.indexOf("JDeveloper JS", paren) > 0;
 
-      if (agent.startsWith("compatible", paren))
+      if (agent.indexOf("Konqueror", paren) >= 0)
+      {
+        agentObj.setType(Agent.TYPE_DESKTOP);
+        agentObj.setAgent(Agent.AGENT_KONQUEROR);
+        agentObj.setAgentVersion(_getVersion(agent, agent.lastIndexOf('/')));
+      }
+      else if (agent.startsWith("compatible", paren))
       {
         int ieIndex = agent.indexOf("MSIE", paren);
 
@@ -844,7 +850,7 @@
           agentObj.__addRequestCapability(TrinidadAgent.CAP_IS_JDEV_JAVASCRIPT_VE,
                                           Boolean.TRUE);
         }
-          
+
       }
     }
   }
@@ -862,7 +868,7 @@
   {
     // start should be the character BEFORE the version portion
     // (typically a slash character after the agent name)
-    
+
     if (start < 0)
     {
       return null;

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -76,7 +76,7 @@
     {
       return TrinidadAgent.APPLICATION_SAFARI;
     }
-    
+
     if(TrinidadAgent.AGENT_BLACKBERRY.equals(agentName))
     {
       return TrinidadAgent.APPLICATION_BLACKBERRY;
@@ -92,6 +92,11 @@
       return TrinidadAgent.APPLICATION_GENERICPDA;
     }
 
+    if(TrinidadAgent.AGENT_KONQUEROR.equals(agentName))
+    {
+      return TrinidadAgent.APPLICATION_KONQUEROR;
+    }
+
     return TrinidadAgent.APPLICATION_UNKNOWN;
   }
 
@@ -137,7 +142,7 @@
     {
       return TrinidadAgent.OS_PPC;
     }
-    
+
     if (TrinidadAgent.PLATFORM_BLACKBERRY.equals(platformName))
     {
         return TrinidadAgent.OS_BLACKBERRY;
@@ -187,8 +192,6 @@
   public static String getAgentName(int agentId)
   {
     switch (agentId) {
-      case TrinidadAgent.APPLICATION_UNKNOWN:
-        return null;
       case TrinidadAgent.APPLICATION_NETSCAPE:
         return TrinidadAgent.AGENT_NETSCAPE;
       case TrinidadAgent.APPLICATION_IEXPLORER:
@@ -211,13 +214,13 @@
         return TrinidadAgent.AGENT_NOKIA_S60;
       case TrinidadAgent.APPLICATION_GENERICPDA:
         return TrinidadAgent.AGENT_GENERICPDA;
-       default:
-        return null;
+      case TrinidadAgent.APPLICATION_KONQUEROR:
+        return TrinidadAgent.AGENT_KONQUEROR;
+      default:
+        return TrinidadAgent.AGENT_UNKNOWN;
     }
   }
 
-
-
   /**
    * utility method to get platform name string from AdfFacesAgent application constant (int)
    *

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,7 +33,7 @@
 
   static public final CapabilityKey CAP_ONCLICK_IMG_INPUT =
           CapabilityKey.getCapabilityKey("-adfinternal-onclickOnImgInput", true);
-            
+
   static public final CapabilityKey CAP_XMLDOM =
           CapabilityKey.getCapabilityKey("-adfinternal-xmldom", true);
 
@@ -124,7 +124,7 @@
   static public final CapabilityKey CAP_SCRIPTING_SPEED =
           CapabilityKey.getCapabilityKey("-adfinternal-scriptingSpeed", true);
 
-  
+
   /**
    * true if multiple windows can be opened
    */
@@ -144,26 +144,26 @@
   // width/height to a percentage.
   static public final CapabilityKey CAP_IMAGE_STRETCH =
           CapabilityKey.getCapabilityKey("-adfinternal-imageStretch", true);
-  
+
   static public final CapabilityKey CAP_GIF_TYPE_IMAGE =
           CapabilityKey.getCapabilityKey("-adfinternal-gifImage", true);
-  
+
   static public final CapabilityKey CAP_JPEG_TYPE_IMAGE =
           CapabilityKey.getCapabilityKey("-adfinternal-jpegImage", true);
-  
-  static public final CapabilityKey CAP_PNG_TYPE_IMAGE = 
+
+  static public final CapabilityKey CAP_PNG_TYPE_IMAGE =
           CapabilityKey.getCapabilityKey("-adfinternal-pngImage", true);
 
   static public final CapabilityKey CAP_TRANSPARENT_PNG_TYPE_IMAGE =
           CapabilityKey.getCapabilityKey("-adfinternal-transparentPngImage", true);
-  
+
   static public final CapabilityKey CAP_BMP_TYPE_IMAGE =
                CapabilityKey.getCapabilityKey("-adfinternal-bmpImage", true);
-  
+
   static public final CapabilityKey CAP_SUPPORTS_DISABLED_OPTIONS = CapabilityKey
     .getCapabilityKey("-adfinternal-supportsDisabledOptions", true);
 
-  
+
   static public final CapabilityKey CAP_IS_JDEV_VE = CapabilityKey
     .getCapabilityKey("-adfinternal-isJDevVE", true);
 
@@ -330,6 +330,10 @@
    */
   static public final int APPLICATION_GENERICPDA = 14;
 
+  /**
+   * Application constant for Konqueror.
+   */
+  static public final int APPLICATION_KONQUEROR = 15;
 
   /**
    * OS constant for an unknown operating system.
@@ -365,7 +369,7 @@
    * OS constant for any Windows Pocket PC
    */
   static public final int OS_PPC = 6;
-  
+
   /**
    * OS constant for any BlackBerry device
    */

Modified: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java?rev=745174&r1=745173&r2=745174&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
(original)
+++ myfaces/trinidad/branches/1.2.11.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
Tue Feb 17 18:01:50 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,14 +21,11 @@
 import java.awt.Color;
 
 import java.io.IOException;
-
 import java.io.StringWriter;
 
 import java.util.Collection;
-
 import java.util.HashMap;
 import java.util.Iterator;
-
 import java.util.Map;
 
 import javax.faces.component.UIComponent;
@@ -38,12 +35,12 @@
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
 import org.apache.myfaces.trinidad.component.core.data.CoreChart;
+import org.apache.myfaces.trinidad.context.FormData;
+import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidad.event.ChartDrillDownEvent;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.model.ChartModel;
 import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent;
-import org.apache.myfaces.trinidad.context.FormData;
-import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PartialPageUtils;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinSelectors;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants;
@@ -87,7 +84,7 @@
 
   /**
    * @todo Decode the chart drill down event
-   * 
+   *
    */
   @SuppressWarnings("unchecked")
   @Override
@@ -95,9 +92,9 @@
     FacesContext context,
     UIComponent component)
   {
-    Map<String, String> parameters =  
+    Map<String, String> parameters =
       context.getExternalContext().getRequestParameterMap();
-    
+
     String source = parameters.get(XhtmlConstants.SOURCE_PARAM);
     String id = component.getClientId(context);
     if (!id.equals(source))
@@ -105,9 +102,9 @@
     Object eventParam = parameters.get(XhtmlConstants.EVENT_PARAM);
     if (XhtmlConstants.CHART_DRILL_DOWN_EVENT.equals(eventParam))
     {
-      int[] seriesIndices = null; 
-      int[] yValueIndices = null; 
-      double[] yValues = null; 
+      int[] seriesIndices = null;
+      int[] yValueIndices = null;
+      double[] yValues = null;
       double[] xValues = null;
       String value = parameters.get(XhtmlConstants.VALUE_PARAM);
       String[] tokens = value.split(_DELIMITER);
@@ -132,7 +129,7 @@
         }
       }
       ChartDrillDownEvent event =
-        new ChartDrillDownEvent(component, seriesIndices, 
+        new ChartDrillDownEvent(component, seriesIndices,
                                 yValueIndices, yValues, xValues);
       event.queue();
     }
@@ -142,7 +139,7 @@
   {
     int[] indices = new int[tokens.length-1];
     for(int i=1; i<tokens.length; ++i)
-      indices[i-1] = Integer.parseInt(tokens[i]);    
+      indices[i-1] = Integer.parseInt(tokens[i]);
     return indices;
   }
 
@@ -150,10 +147,10 @@
   {
     double[] values = new double[tokens.length-1];
     for(int i=1; i<tokens.length; ++i)
-      values[i-1] = Double.parseDouble(tokens[i]);    
+      values[i-1] = Double.parseDouble(tokens[i]);
     return values;
   }
-  
+
    /**
     * @return
     */
@@ -162,7 +159,7 @@
    {
      return true;
    }
- 
+
    /**
     * Overrriden to always generate an id
     */
@@ -173,7 +170,7 @@
   {
     return true;
   }
-   
+
   /**
    * render all pieces of the chart
    */
@@ -188,7 +185,7 @@
       return;
 
     ResponseWriter rw = context.getResponseWriter();
-    rw.startElement(XhtmlConstants.DIV_ELEMENT, component); 
+    rw.startElement(XhtmlConstants.DIV_ELEMENT, component);
     renderId(context, component);
     renderStyleAttributes(context, arc, bean, SkinSelectors.AF_CHART_STYLE_CLASS);
     // We need the number convertor so that we can format numbers on the client
@@ -206,7 +203,7 @@
     renderScriptDeferAttribute(context, arc);
     renderScriptTypeAttribute(context, arc);
     rw.write(sw.toString());
-    rw.endElement(XhtmlConstants.SCRIPT_ELEMENT);    
+    rw.endElement(XhtmlConstants.SCRIPT_ELEMENT);
     rw.endElement(XhtmlConstants.DIV_ELEMENT);
   }
 
@@ -226,7 +223,7 @@
     templateURL = context.getExternalContext().encodeResourceURL(templateURL);
     sw.append(templateURL);
     sw.append("\",\"width:100%; height:100%;\"");
-    sw.append(",null);\n"); 
+    sw.append(",null);\n");
   }
 
   protected void _outputJSChartModel(
@@ -299,7 +296,7 @@
     sw.append("var chartId = ");
     _writeJSObject(sw, "svgChart"+clientId);
     sw.append(";\n");
-    
+
     sw.append("var isPerspective = ");
     _writeJSObject(sw, isPerspective(bean));
     sw.append(";\n");
@@ -344,22 +341,22 @@
       formName =  null;
     else
       formName = fData.getName();
-    
+
     if(formName!=null)
     {
       sw.append("apacheChart.setFormName(");
       _writeJSObject(sw, formName);
       sw.append(");\n");
     }
-    
+
     if(!PartialPageUtils.isPPRActive(context))
     {
       sw.append("apacheChart.setPartialSubmit(");
       _writeJSObject(sw, false);
-      sw.append(");\n");    
+      sw.append(");\n");
     }
-    
-    if(arc.getAgent().getAgentName() == TrinidadAgent.AGENT_IE)
+
+    if(TrinidadAgent.AGENT_IE.equals(arc.getAgent().getAgentName()))
     {
       sw.append("apacheChart.setErrorHtml(");
       _writeJSObject(sw, arc.getTranslatedString("af_chart.IE_SVG_PLUGIN_ERROR_HTML"));
@@ -371,15 +368,15 @@
       _writeJSObject(sw, arc.getTranslatedString("af_chart.SVG_ENABLED_BROWSER_ERROR_HTML"));
       sw.append(");\n");
     }
-    
+
     sw.append("apacheChart.setStatusHtml(");
     _writeJSObject(sw, arc.getTranslatedString("af_chart.SVG_LOADING_STATUS_HTML"));
     sw.append(");\n");
-    
+
     // finally draw the chart
     sw.append("apacheChart.draw();\n");
   }
-  
+
   @SuppressWarnings("unchecked")
   static private void _writeJSObject(
     StringWriter sw,
@@ -542,7 +539,7 @@
   {
     sw.append(String.valueOf(value));
   }
-  
+
   /**
    * Encodes a boolean in JavaScript Object Notation.
    *
@@ -586,7 +583,7 @@
     sw.append(String.valueOf(color.getBlue()));
     sw.append(")\"");
   }
-  
+
   /**
    * Encodes a Collection in JavaScript Object Notation.
    *
@@ -620,7 +617,7 @@
       sw.append(']');
     }
   }
-  
+
   private static Object _getProperty(FacesBean bean, PropertyKey key)
   {
     Object ret = bean.getProperty(key);
@@ -628,7 +625,7 @@
       ret = key.getDefault();
     return ret;
   }
-  
+
   protected String getType(FacesBean bean)
   {
     return toString(_getProperty(bean, _typeKey));
@@ -639,7 +636,7 @@
     Object ret = bean.getProperty(_templateSourceKey);
     String uri;
     if (ret==null)
-    {      
+    {
       if(isGradientsUsed(bean))
         uri = _TEMPLATE_DOC;
       else
@@ -691,12 +688,12 @@
   {
     return (Integer)_getProperty(bean, _YMinorGridLineCountKey);
   }
-  
+
   protected Integer getMaxPrecision(FacesBean bean)
   {
     return (Integer)_getProperty(bean, _maxPrecisionKey);
   }
-  
+
   private Scriptlet chartLib;
 
   private PropertyKey _typeKey;
@@ -710,7 +707,7 @@
   private PropertyKey _XMajorGridLineCountKey;
   private PropertyKey _YMinorGridLineCountKey;
   private PropertyKey _maxPrecisionKey;
-  
+
   private static final String _DELIMITER = "\\$adf\\$";
   private static final String _TEMPLATE_DOC = "/adf/svg/chart.svg";
   private static final String _TEMPLATE_DOC_NOGRADIENT = "/adf/svg/chartNoGradient.svg";

Propchange: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 17 18:01:50 2009
@@ -1 +1,2 @@
 /myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:699406,699496
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:745151

Propchange: myfaces/trinidad/branches/1.2.11.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 17 18:01:50 2009
@@ -1 +1,2 @@
 /myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:699406,699496
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:745151



Mime
View raw message