myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r770507 - in /myfaces/trinidad/branches/1.2.11.3-branch: ./ trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/ trinidad-examples/trinidad-demo/src/main/webapp/demos/ trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/...
Date Fri, 01 May 2009 01:19:05 GMT
Author: jwaldman
Date: Fri May  1 01:19:05 2009
New Revision: 770507

URL: http://svn.apache.org/viewvc?rev=770507&view=rev
Log:
merge in email agent code from Trinidad trunk to 1.2.11.3-branch
This does not affect any golden files and I consider this a safe check-in.
This allows @agent email to be used in skinning css files.

Added:
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/email.xml
      - copied, changed from r765711, myfaces/trinidad/trunk/trinidad-impl/src/main/resources/META-INF/agent/email.xml
Modified:
    myfaces/trinidad/branches/1.2.11.3-branch/   (props changed)
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreRenderingContext.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
    myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/capabilities.xml

Propchange: myfaces/trinidad/branches/1.2.11.3-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May  1 01:19:05 2009
@@ -1,3 +1,3 @@
 /myfaces/trinidad/branches/1.2.9.1-branch:697924,699406,699496
 /myfaces/trinidad/branches/TRINIDAD-1402:745675
-/myfaces/trinidad/trunk:745151,755794,758112,758415-758416
+/myfaces/trinidad/trunk:745151,755794,758112,758415-758416,765711,765745,766910,767634

Modified: myfaces/trinidad/branches/1.2.11.3-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.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/Agent.java
Fri May  1 01:19:05 2009
@@ -140,6 +140,12 @@
   public static final String AGENT_GECKO = "gecko";
 
   /**
+   * Constant for email agent. Used for all email agents like Outlook 2007
+   * and Thunderbird
+   */
+  public static final String AGENT_EMAIL = "email";
+  
+  /**
    * Constant for Apple Webkit agent. Used for all Webkit based agent like Safari
    */
   public static final String AGENT_WEBKIT = "webkit";

Modified: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
Fri May  1 01:19:05 2009
@@ -88,6 +88,9 @@
                   <tr:selectItem label="suede" value="suede"/>
                 </tr:selectOneChoice>
                 <tr:commandButton text="Go"/>
+                <tr:goLink id="goLinkId" text="EmailablePageMode" 
+                  destination="panelPageSkinDemo.jspx?org.apache.myfaces.trinidad.agent.email=true"
/>
+                <tr:selectBooleanCheckbox text="true" label="Label (red in purple skin
+ email mode):" value="true"/>
               </tr:panelGroupLayout>
               <tr:panelGroupLayout layout="horizontal" styleClass="welcomePanel">
                 <tr:outputFormatted styleUsage="instruction"

Modified: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
Fri May  1 01:19:05 2009
@@ -906,3 +906,8 @@
   -tr-show-lines:false;
 }
 }
+
+@agent email
+{
+  af|selectBooleanCheckbox::label {color: red}
+}

Modified: myfaces/trinidad/branches/1.2.11.3-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.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
Fri May  1 01:19:05 2009
@@ -39,7 +39,7 @@
     // this method primarily exists for use during testing
 
     AgentImpl agent = new AgentImpl();
-    _populateAgentImpl(headerMap,agent);
+    _populateAgentImpl(null, headerMap,agent);
     return agent;
   }
 
@@ -61,17 +61,30 @@
 
     //TODO: Add declarative and extensible means for populating AgentImpl object
     // the RequestHeaderMap helps populate the agent
-    _populateAgentImpl(headerMap, agent);
+    _populateAgentImpl(facesContext, headerMap, agent);
 
     return agent;
   }
 
   // The headerMap is the RequestHeaderMap from the externalContext. It is
   // consulted to correctly populate the agent
-  private void _populateAgentImpl(Map<String, String> headerMap, AgentImpl agent)
+  private void _populateAgentImpl(
+    FacesContext facesContext,
+    Map<String, String> headerMap, 
+    AgentImpl agent)
   {
-
+  
     String userAgent = headerMap.get("User-Agent");
+    String isEmail = null;
+    if (facesContext != null)
+      isEmail = facesContext.getExternalContext().getRequestParameterMap().
+                        get(_EMAIL_PARAM);
+ 
+    if ("true".equals(isEmail))
+    {
+      _populateEmailAgentImpl(agent);
+      return;
+    }
 
     if ((userAgent != null) && userAgent.startsWith("PTG"))
     {
@@ -854,6 +867,23 @@
       }
     }
   }
+  
+  /**
+   * Returns an AgentEntry for the email agents like Outlook 2007 and
+   * Thunderbird
+   */
+  private void _populateEmailAgentImpl(AgentImpl agentObj)
+  {
+   
+    agentObj.setType(Agent.TYPE_DESKTOP);
+
+    agentObj.setAgent(Agent.AGENT_EMAIL);
+    agentObj.setAgentVersion("0.0");
+    agentObj.setPlatform(_UNKNOWN);
+    agentObj.setPlatformVersion(_UNKNOWN);
+    agentObj.setMakeModel(_UNKNOWN);
+
+  }  
 
 
   /**
@@ -912,7 +942,8 @@
 
     return null;
   }
-
+  static private final String _EMAIL_PARAM =
+    "org.apache.myfaces.trinidad.agent.email";
   static final private String _IASW_DEVICE_HINT_PARAM = "X-Oracle-Device.Class";
   static final private String _UNKNOWN = "unknown";
   static final private TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(AgentFactoryImpl.class);

Modified: myfaces/trinidad/branches/1.2.11.3-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.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentNameUtil.java
Fri May  1 01:19:05 2009
@@ -51,6 +51,11 @@
       return TrinidadAgent.APPLICATION_GECKO;
     }
 
+    if (TrinidadAgent.AGENT_EMAIL.equals(agentName))
+    {
+      return TrinidadAgent.APPLICATION_EMAIL;
+    }    
+    
     if (TrinidadAgent.AGENT_ELAINE.equals(agentName))
     {
       return TrinidadAgent.APPLICATION_WEB_CLIPPING;
@@ -216,6 +221,8 @@
         return TrinidadAgent.AGENT_GENERICPDA;
       case TrinidadAgent.APPLICATION_KONQUEROR:
         return TrinidadAgent.AGENT_KONQUEROR;
+      case TrinidadAgent.APPLICATION_EMAIL:
+        return TrinidadAgent.AGENT_EMAIL;
       default:
         return TrinidadAgent.AGENT_UNKNOWN;
     }

Modified: myfaces/trinidad/branches/1.2.11.3-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.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
Fri May  1 01:19:05 2009
@@ -336,6 +336,10 @@
   static public final int APPLICATION_KONQUEROR = 15;
 
   /**
+   * Application constant for email.
+   */
+  static public final int APPLICATION_EMAIL = 16;
+  /**
    * OS constant for an unknown operating system.
    */
   static public final int OS_UNKNOWN = 0;

Modified: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreRenderingContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreRenderingContext.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreRenderingContext.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreRenderingContext.java
Fri May  1 01:19:05 2009
@@ -808,8 +808,6 @@
                             TrinidadAgent.SCRIPTING_SPEED_CAP_NONE);
     _EMAIL_CAPABILITIES.put(TrinidadAgent.CAP_EDITING,
                             Boolean.FALSE);
-    _EMAIL_CAPABILITIES.put(TrinidadAgent.CAP_STYLE_ATTRIBUTES,
-                            TrinidadAgent.STYLES_INTERNAL);
     _EMAIL_CAPABILITIES.put(TrinidadAgent.CAP_PARTIAL_RENDERING,
                             Boolean.FALSE);
 

Modified: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
Fri May  1 01:19:05 2009
@@ -67,6 +67,8 @@
       browser = TrinidadAgent.APPLICATION_NOKIA_S60;
     else if (_BROWSER_GENERICPDA.equals(browserName))
       browser = TrinidadAgent.APPLICATION_GENERICPDA;
+    else if (_BROWSER_EMAIL.equals(browserName))
+      browser = TrinidadAgent.APPLICATION_EMAIL;    
     else
     {
       // Either a new or an invalid browser
@@ -755,6 +757,7 @@
 
   private static final String _BROWSER_GENERICPDA = "genericpda";
 
+  private static final String _BROWSER_EMAIL = "email";
   // Platform constants
   private static final String _PLATFORM_WINDOWS = "windows";
 

Modified: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/capabilities.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/capabilities.xml?rev=770507&r1=770506&r2=770507&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/capabilities.xml
(original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/capabilities.xml
Fri May  1 01:19:05 2009
@@ -58,6 +58,12 @@
       <include refid="html" />
       <include src="gecko.xml" />
     </capabilities>
+    
+    
+    <capabilities id="email" agents="email">
+      <include refid="html" />
+      <include src="email.xml" />
+    </capabilities>
 
     <capabilities id="webkit" agents="webkit">
       <include refid="html" />

Copied: myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/email.xml
(from r765711, myfaces/trinidad/trunk/trinidad-impl/src/main/resources/META-INF/agent/email.xml)
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/email.xml?p2=myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/email.xml&p1=myfaces/trinidad/trunk/trinidad-impl/src/main/resources/META-INF/agent/email.xml&r1=765711&r2=770507&rev=770507&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/resources/META-INF/agent/email.xml (original)
+++ myfaces/trinidad/branches/1.2.11.3-branch/trinidad-impl/src/main/resources/META-INF/agent/email.xml
Fri May  1 01:19:05 2009
@@ -22,6 +22,8 @@
   <capability name="-adfinternal-scriptingSpeed" value="none"/>
   <capability name="-adfinternal-editing" value="false"/>
   <capability name="-adfinternal-intrinsicEvents" value="false"/>
+  <!-- comment out until we write the styles in the page for email mode
   <capability name="-adfinternal-styleAttributes" value="internal"/>
+   -->
   <capability name="-adfinternal-partialRendering" value="false"/>
 </capabilityData>



Mime
View raw message