You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2009/02/20 01:15:49 UTC
svn commit: r746064 - in /myfaces/trinidad/branches/1.2.10.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...
Author: arobinson74
Date: Fri Feb 20 00:15:49 2009
New Revision: 746064
URL: http://svn.apache.org/viewvc?rev=746064&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
This commit is backing out this change, as it was not necessary for the 1.2.10.1 branch
Modified:
myfaces/trinidad/branches/1.2.10.1-branch/ (props changed)
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/ (props changed)
myfaces/trinidad/branches/1.2.10.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/ (props changed)
Propchange: myfaces/trinidad/branches/1.2.10.1-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 20 00:15:49 2009
@@ -1,3 +1,2 @@
/myfaces/trinidad/branches/1.2.9.1-branch:697924,699406,699496
-/myfaces/trinidad/trunk:745151
/myfaces/trinidad/trunk_1.2.x:738664,739156
Modified: myfaces/trinidad/branches/1.2.10.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.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java Fri Feb 20 00:15:49 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,16 +120,6 @@
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";
@@ -143,7 +133,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
@@ -151,6 +141,7 @@
* 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.10.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.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java Fri Feb 20 00:15:49 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,10 +35,10 @@
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.RenderingContext;
import org.apache.myfaces.trinidad.context.RequestContext;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.logging.TrinidadLogger;
/**
* Basic implementation of the core rendering functionality
@@ -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 rc = RenderingContext.getCurrentInstance();
- if (rc == null)
+ RenderingContext arc = RenderingContext.getCurrentInstance();
+ if (arc == null)
throw new IllegalStateException(_LOG.getMessage(
"NO_RENDERINGCONTEXT"));
-
+
FacesBean bean = getFacesBean(component);
-
- beforeEncode(context, rc, component, bean);
- encodeBegin(context, rc, component, bean);
+
+ beforeEncode(context, arc, component, bean);
+ encodeBegin(context, arc, component, bean);
}
}
@@ -323,47 +323,47 @@
public final void encodeEnd(FacesContext context,
UIComponent component) throws IOException
{
- RenderingContext rc = RenderingContext.getCurrentInstance();
- if (rc == null)
+ RenderingContext arc = RenderingContext.getCurrentInstance();
+ if (arc == null)
throw new IllegalStateException(_LOG.getMessage(
"NO_RENDERINGCONTEXT"));
FacesBean bean = getFacesBean(component);
if (getRendersChildren())
{
- beforeEncode(context, rc, component, bean);
- encodeAll(context, rc, component, bean);
+ beforeEncode(context, arc, component, bean);
+ encodeAll(context, arc, component, bean);
}
else
{
- encodeEnd(context, rc, component, bean);
+ encodeEnd(context, arc, component, bean);
}
- afterEncode(context, rc, component, bean);
+ afterEncode(context, arc, 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 rc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ 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 rc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ 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 rc,
- UIComponent component,
- FacesBean bean) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ 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 rc,
- UIComponent component,
- FacesBean bean,
- CoreRenderer renderer) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ UIComponent component,
+ FacesBean bean,
+ CoreRenderer renderer) throws IOException
{
if (renderer.getRendersChildren())
{
- renderer.encodeAll(context, rc, component, bean);
+ renderer.encodeAll(context, arc, component, bean);
}
else
{
throw new IllegalStateException();
}
}
-
+
protected void delegateRendererBegin(
- FacesContext context,
- RenderingContext rc,
- UIComponent component,
- FacesBean bean,
- CoreRenderer renderer) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ UIComponent component,
+ FacesBean bean,
+ CoreRenderer renderer) throws IOException
{
if (renderer.getRendersChildren())
{
@@ -464,16 +464,16 @@
}
else
{
- renderer.encodeBegin(context, rc, component, bean);
+ renderer.encodeBegin(context, arc, component, bean);
}
}
protected void delegateRendererEnd(
- FacesContext context,
- RenderingContext rc,
- UIComponent component,
- FacesBean bean,
- CoreRenderer renderer) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ UIComponent component,
+ FacesBean bean,
+ CoreRenderer renderer) throws IOException
{
if (renderer.getRendersChildren())
{
@@ -481,7 +481,7 @@
}
else
{
- renderer.encodeEnd(context, rc, component, bean);
+ renderer.encodeEnd(context, arc, 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 rc,
- Object key)
+ RenderingContext arc,
+ Object key)
{
- return rc.getProperties().get(key);
+ return arc.getProperties().get(key);
}
static protected final Object setRenderingProperty(
- RenderingContext rc,
- Object key,
- Object value)
+ RenderingContext arc,
+ Object key,
+ Object value)
{
- return rc.getProperties().put(key, value);
+ return arc.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,90 +645,85 @@
// AGENT CAPABILITY CONVENIENCE METHODS
//
- static public boolean isDesktop(RenderingContext rc)
+ static public boolean isDesktop(RenderingContext arc)
{
- return (Agent.TYPE_DESKTOP.equals(rc.getAgent().getType()));
+ return (Agent.TYPE_DESKTOP.equals(arc.getAgent().getType()));
}
- static public boolean isPDA(RenderingContext rc)
+ static public boolean isPDA(RenderingContext arc)
{
- return (Agent.TYPE_PDA.equals(rc.getAgent().getType()));
+ return (Agent.TYPE_PDA.equals(arc.getAgent().getType()));
}
- static public boolean isIE(RenderingContext rc)
+ static public boolean isIE(RenderingContext arc)
{
- return (Agent.AGENT_IE.equals(rc.getAgent().getAgentName()));
+ return (Agent.AGENT_IE.equals(arc.getAgent().getAgentName()));
}
- static public boolean isKonqueror(RenderingContext rc)
+ static public boolean isGecko(RenderingContext arc)
{
- return (Agent.AGENT_KONQUEROR.equals(rc.getAgent().getAgentName()));
+ return (Agent.AGENT_GECKO.equals(arc.getAgent().getAgentName()));
}
- static public boolean isGecko(RenderingContext rc)
+ static public boolean isWebKit(RenderingContext arc)
{
- return (Agent.AGENT_GECKO.equals(rc.getAgent().getAgentName()));
+ return (Agent.AGENT_WEBKIT.equals(arc.getAgent().getAgentName()));
}
- static public boolean isWebKit(RenderingContext rc)
+ static public boolean isIPhone(RenderingContext arc)
{
- return (Agent.AGENT_WEBKIT.equals(rc.getAgent().getAgentName()));
+ return (Agent.PLATFORM_IPHONE.equals(arc.getAgent().getPlatformName()));
}
-
- static public boolean isIPhone(RenderingContext rc)
- {
- return (Agent.PLATFORM_IPHONE.equals(rc.getAgent().getPlatformName()));
- }
-
- static public boolean isGenericPDA(RenderingContext rc)
+
+ static public boolean isGenericPDA(RenderingContext arc)
{
- return (Agent.PLATFORM_GENERICPDA.equals(rc.getAgent().getPlatformName()));
+ return (Agent.PLATFORM_GENERICPDA.equals(arc.getAgent().getPlatformName()));
}
- static public boolean isInaccessibleMode(RenderingContext rc)
+ static public boolean isInaccessibleMode(RenderingContext arc)
{
- return (rc.getAccessibilityMode() ==
+ return (arc.getAccessibilityMode() ==
RequestContext.Accessibility.INACCESSIBLE);
}
- static public boolean isScreenReaderMode(RenderingContext rc)
+ static public boolean isScreenReaderMode(RenderingContext arc)
{
- return (rc.getAccessibilityMode() ==
+ return (arc.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 rc,
+ RenderingContext arc,
UIComponent component,
FacesBean bean)
{
- setupEncodingContext(context, rc, component);
+ setupEncodingContext(context, arc, 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 rc,
+ RenderingContext arc,
UIComponent component,
FacesBean bean)
{
- tearDownEncodingContext(context, rc, component);
+ tearDownEncodingContext(context, arc, component);
}
//
@@ -769,13 +764,13 @@
* @param styleClass the style class
*/
static public void renderStyleClass(
- FacesContext context,
- RenderingContext rc,
- String styleClass) throws IOException
+ FacesContext context,
+ RenderingContext arc,
+ String styleClass) throws IOException
{
if (styleClass != null)
{
- styleClass = rc.getStyleClass(styleClass);
+ styleClass = arc.getStyleClass(styleClass);
context.getResponseWriter().writeAttribute("class", styleClass, null);
}
}
@@ -786,14 +781,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)
@@ -822,7 +817,7 @@
}
}
}
-
+
if (builder.length() == 0)
value = null;
else
Modified: myfaces/trinidad/branches/1.2.10.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.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java Fri Feb 20 00:15:49 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(Agent.AGENT_UNKNOWN);
+ agent.setAgent(_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,13 +783,7 @@
boolean isJDevVE = agent.indexOf("JDeveloper", paren) > 0;
boolean isJDevJSVE = agent.indexOf("JDeveloper JS", paren) > 0;
- 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))
+ if (agent.startsWith("compatible", paren))
{
int ieIndex = agent.indexOf("MSIE", paren);
@@ -850,7 +844,7 @@
agentObj.__addRequestCapability(TrinidadAgent.CAP_IS_JDEV_JAVASCRIPT_VE,
Boolean.TRUE);
}
-
+
}
}
}
@@ -868,7 +862,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.10.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.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java Fri Feb 20 00:15:49 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,11 +92,6 @@
return TrinidadAgent.APPLICATION_GENERICPDA;
}
- if(TrinidadAgent.AGENT_KONQUEROR.equals(agentName))
- {
- return TrinidadAgent.APPLICATION_KONQUEROR;
- }
-
return TrinidadAgent.APPLICATION_UNKNOWN;
}
@@ -142,7 +137,7 @@
{
return TrinidadAgent.OS_PPC;
}
-
+
if (TrinidadAgent.PLATFORM_BLACKBERRY.equals(platformName))
{
return TrinidadAgent.OS_BLACKBERRY;
@@ -192,6 +187,8 @@
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:
@@ -214,13 +211,13 @@
return TrinidadAgent.AGENT_NOKIA_S60;
case TrinidadAgent.APPLICATION_GENERICPDA:
return TrinidadAgent.AGENT_GENERICPDA;
- case TrinidadAgent.APPLICATION_KONQUEROR:
- return TrinidadAgent.AGENT_KONQUEROR;
- default:
- return TrinidadAgent.AGENT_UNKNOWN;
+ default:
+ return null;
}
}
+
+
/**
* utility method to get platform name string from AdfFacesAgent application constant (int)
*
Modified: myfaces/trinidad/branches/1.2.10.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.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java Fri Feb 20 00:15:49 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,10 +330,6 @@
*/
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.
@@ -369,7 +365,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.10.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.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java?rev=746064&r1=746063&r2=746064&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java Fri Feb 20 00:15:49 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,11 +21,14 @@
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;
@@ -35,12 +38,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;
@@ -84,7 +87,7 @@
/**
* @todo Decode the chart drill down event
- *
+ *
*/
@SuppressWarnings("unchecked")
@Override
@@ -92,9 +95,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))
@@ -102,9 +105,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);
@@ -129,7 +132,7 @@
}
}
ChartDrillDownEvent event =
- new ChartDrillDownEvent(component, seriesIndices,
+ new ChartDrillDownEvent(component, seriesIndices,
yValueIndices, yValues, xValues);
event.queue();
}
@@ -139,7 +142,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;
}
@@ -147,10 +150,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
*/
@@ -159,7 +162,7 @@
{
return true;
}
-
+
/**
* Overrriden to always generate an id
*/
@@ -170,7 +173,7 @@
{
return true;
}
-
+
/**
* render all pieces of the chart
*/
@@ -185,7 +188,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
@@ -203,7 +206,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);
}
@@ -223,7 +226,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(
@@ -296,7 +299,7 @@
sw.append("var chartId = ");
_writeJSObject(sw, "svgChart"+clientId);
sw.append(";\n");
-
+
sw.append("var isPerspective = ");
_writeJSObject(sw, isPerspective(bean));
sw.append(";\n");
@@ -341,22 +344,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(TrinidadAgent.AGENT_IE.equals(arc.getAgent().getAgentName()))
+
+ if(arc.getAgent().getAgentName() == TrinidadAgent.AGENT_IE)
{
sw.append("apacheChart.setErrorHtml(");
_writeJSObject(sw, arc.getTranslatedString("af_chart.IE_SVG_PLUGIN_ERROR_HTML"));
@@ -368,15 +371,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,
@@ -539,7 +542,7 @@
{
sw.append(String.valueOf(value));
}
-
+
/**
* Encodes a boolean in JavaScript Object Notation.
*
@@ -583,7 +586,7 @@
sw.append(String.valueOf(color.getBlue()));
sw.append(")\"");
}
-
+
/**
* Encodes a Collection in JavaScript Object Notation.
*
@@ -617,7 +620,7 @@
sw.append(']');
}
}
-
+
private static Object _getProperty(FacesBean bean, PropertyKey key)
{
Object ret = bean.getProperty(key);
@@ -625,7 +628,7 @@
ret = key.getDefault();
return ret;
}
-
+
protected String getType(FacesBean bean)
{
return toString(_getProperty(bean, _typeKey));
@@ -636,7 +639,7 @@
Object ret = bean.getProperty(_templateSourceKey);
String uri;
if (ret==null)
- {
+ {
if(isGradientsUsed(bean))
uri = _TEMPLATE_DOC;
else
@@ -688,12 +691,12 @@
{
return (Integer)_getProperty(bean, _YMinorGridLineCountKey);
}
-
+
protected Integer getMaxPrecision(FacesBean bean)
{
return (Integer)_getProperty(bean, _maxPrecisionKey);
}
-
+
private Scriptlet chartLib;
private PropertyKey _typeKey;
@@ -707,7 +710,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.10.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 20 00:15:49 2009
@@ -1,3 +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
/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:738664,739156
Propchange: myfaces/trinidad/branches/1.2.10.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 20 00:15:49 2009
@@ -1,3 +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
/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:738664,739156