You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/01/02 22:45:41 UTC

svn commit: r365444 - in /incubator/tobago/trunk/tobago-core/src/main: java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd

Author: weber
Date: Mon Jan  2 13:45:34 2006
New Revision: 365444

URL: http://svn.apache.org/viewcvs?rev=365444&view=rev
Log:
working on ajax lifecycle

Modified:
    incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
    incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
    incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd

Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java?rev=365444&r1=365443&r2=365444&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java Mon Jan  2 13:45:34 2006
@@ -48,7 +48,7 @@
  */
 public class AjaxPhaseListener implements PhaseListener
 {
-  private static Log log= LogFactory.getLog(AjaxPhaseListener.class);
+  private static Log LOG = LogFactory.getLog(AjaxPhaseListener.class);
   public static final String AJAX_COMPONENT_ID = "affectedAjaxComponent";
 
 
@@ -77,7 +77,7 @@
       }
       else
       {
-        log.error("No value found for this component : "+possibleClientId);
+        LOG.error("No value found for this component : "+possibleClientId);
         return null;
       }
     }
@@ -96,8 +96,8 @@
     if(externalContext.getRequestParameterMap().containsKey(AJAX_COMPONENT_ID))
     {
       try {
-        if (log.isDebugEnabled()) {
-          log.debug("AJAX: componentID gefunden :"
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("AJAX: componentID gefunden :"
               + externalContext.getRequestParameterMap().get(AJAX_COMPONENT_ID));
         }
 
@@ -116,6 +116,11 @@
 
         StringBuffer buf = new StringBuffer(content.toString());
 
+
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("Size of AjaxResponse:\n" + buf.length());
+        }
+
         buf.insert(0,Integer.toHexString(buf.length())+"\r\n");
         buf.append("\r\n"+0+"\r\n\r\n");
 
@@ -141,7 +146,7 @@
         facesContext.responseComplete();
 
       } catch (IOException e) {
-        log.error("Exception while processing Ajax", e);
+        LOG.error("Exception while processing Ajax", e);
       }
     }
   }
@@ -198,12 +203,12 @@
 //        }
 //        catch (IOException e)
 //        {
-//          log.error("Exception while rendering ajax-response",e);
+//          LOG.error("Exception while rendering ajax-response",e);
 //        }
 //      }
 //      else
 //      {
-//        log.error("Found component is no ajaxComponent : "
+//        LOG.error("Found component is no ajaxComponent : "
 //            + ajaxComponent.getClass().getName()
 //            + "  ID =" + ajaxComponent.getClientId(facesContext));
 //      }
@@ -228,7 +233,7 @@
     final Map requestParameterMap = externalContext.getRequestParameterMap();
     if(requestParameterMap.containsKey(AJAX_COMPONENT_ID)) {
       // TODO: error handling when ajax request came after session has expired
-      log.error("Ignoring AjaxRequest without valid component tree!");
+      LOG.error("Ignoring AjaxRequest without valid component tree!");
       facesContext.responseComplete();
     }
   }

Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java?rev=365444&r1=365443&r2=365444&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java Mon Jan  2 13:45:34 2006
@@ -105,15 +105,17 @@
 
     if (component instanceof AjaxComponent) {
 
+      // TODO: handle phaseListeners ??
+
       component.processValidators(facesContext);
 
       if (! facesContext.getRenderResponse()) {
         component.processUpdates(facesContext);
       }
 
-/*      if (! facesContext.getRenderResponse()) {
-  // TODO: what about invokeApplication ??
-}*/
+      if (! facesContext.getRenderResponse()) {
+        facesContext.getViewRoot().processApplication(facesContext);
+      }
 
       ((AjaxComponent)component).encodeAjax(facesContext);
     } else {

Modified: incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd?rev=365444&r1=365443&r2=365444&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd (original)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd Mon Jan  2 13:45:34 2006
@@ -38,4 +38,4 @@
 <!ELEMENT key (#PCDATA)>
 <!ELEMENT value (#PCDATA)>
 
-<!ELEMENT ajax-enabled (#PCDATA)>
+<!ELEMENT enable-ajax (#PCDATA)>