myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcoo...@apache.org
Subject svn commit: r696423 - in /myfaces/trinidad/trunk_1.2.x: trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadintern...
Date Wed, 17 Sep 2008 20:03:39 GMT
Author: mcooper
Date: Wed Sep 17 13:03:38 2008
New Revision: 696423

URL: http://svn.apache.org/viewvc?rev=696423&view=rev
Log:
TRINIDAD-1232 Agent support for iPhone

Thank you Andy Schwartz for your patch.

Added the following new Agent constants:

1. org.apache.myfaces.trinidad.context.Agent.PLATFORM_IPHONE
2. org.apache.myfaces.trinidadinternal.agent.TrinidadAgent.OS_IPHONE

And also provided the AgentFactoryImpl changes required to recognize iPhone agents.

Modified:
    myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java?rev=696423&r1=696422&r2=696423&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
Wed Sep 17 13:03:38 2008
@@ -84,6 +84,11 @@
   public static final String  PLATFORM_MAC = PLATFORM_MACOS;
 
   /**
+   * Constant for iPhone platform
+   */
+  public static final String  PLATFORM_IPHONE = "iphone";
+
+  /**
    * Constant for plam platform
    */
   public static final String  PLATFORM_PALM = "palm";

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java?rev=696423&r1=696422&r2=696423&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
Wed Sep 17 13:03:38 2008
@@ -714,11 +714,16 @@
       start = agent.indexOf('/', start);
     }
 
+    // At the moment all known iPhone agent strings contain "iPhone".
+    String platform = (agent.indexOf("iPhone") < 0) ? 
+                        Agent.PLATFORM_MACOS :
+                        Agent.PLATFORM_IPHONE;
+
     String version = _getVersion(agent, start);
     agentObj.setType(Agent.TYPE_DESKTOP);
     agentObj.setAgent(Agent.AGENT_WEBKIT);
     agentObj.setAgentVersion(version);
-    agentObj.setPlatform(Agent.PLATFORM_MACOS);
+    agentObj.setPlatform(platform);
   }
 
   /**

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java?rev=696423&r1=696422&r2=696423&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
Wed Sep 17 13:03:38 2008
@@ -103,6 +103,11 @@
       return TrinidadAgent.OS_MACOS;
     }
 
+    if (TrinidadAgent.PLATFORM_IPHONE.equals(platformName))
+    {
+      return TrinidadAgent.OS_IPHONE;
+    }
+
     if (TrinidadAgent.PLATFORM_LINUX.equals(platformName))
     {
       return TrinidadAgent.OS_LINUX;
@@ -204,6 +209,8 @@
         return TrinidadAgent.PLATFORM_WINDOWS;
       case TrinidadAgent.OS_MACOS:
         return TrinidadAgent.PLATFORM_MACOS;
+      case TrinidadAgent.OS_IPHONE:
+        return TrinidadAgent.PLATFORM_IPHONE;
       case TrinidadAgent.OS_LINUX:
         return TrinidadAgent.PLATFORM_LINUX;
       case TrinidadAgent.OS_SOLARIS:

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java?rev=696423&r1=696422&r2=696423&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
Wed Sep 17 13:03:38 2008
@@ -361,6 +361,10 @@
    */
   static public final int OS_BLACKBERRY = 7;
 
+  /**
+   * OS constant for iPhone
+   */
+  static public final int OS_IPHONE   = 8;
 
 
   /**

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java?rev=696423&r1=696422&r2=696423&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
Wed Sep 17 13:03:38 2008
@@ -188,6 +188,8 @@
       platform = TrinidadAgent.OS_WINDOWS;
     else if (_PLATFORM_MACOS.equals(platformName))
       platform = TrinidadAgent.OS_MACOS;
+    else if (_PLATFORM_IPHONE.equals(platformName))
+      platform = TrinidadAgent.OS_IPHONE;
     else if (_PLATFORM_LINUX.equals(platformName))
       platform = TrinidadAgent.OS_LINUX;
     else if (_PLATFORM_SOLARIS.equals(platformName))
@@ -220,6 +222,9 @@
     case TrinidadAgent.OS_MACOS:
       name = _PLATFORM_MACOS;
       break;
+    case TrinidadAgent.OS_IPHONE:
+      name = _PLATFORM_IPHONE;
+      break;
     case TrinidadAgent.OS_LINUX:
       name = _PLATFORM_LINUX;
       break;
@@ -729,6 +734,8 @@
 
   private static final String _PLATFORM_MACOS = "macos";
 
+  private static final String _PLATFORM_IPHONE = "iphone";
+
   private static final String _PLATFORM_LINUX = "linux";
 
   private static final String _PLATFORM_SOLARIS = "solaris";



Mime
View raw message