[seam-commits] Seam SVN: r14285 - in branches/community/Seam_2_3: jboss-seam-mail/src/main/java/org/jboss/seam/mail/ui/context and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Feb 1 17:32:52 EST 2012


Author: manaRH
Date: 2012-02-01 17:32:52 -0500 (Wed, 01 Feb 2012)
New Revision: 14285

Modified:
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/DelegatingFacesContext.java
   branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java
   branches/community/Seam_2_3/jboss-seam-mail/src/main/java/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java
   branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/FaceletCompiler.java
   branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
Log:
JBSEAM-4893 fixing jboss-seam-mail and relevant infra in jboss-seam-ui/jboss-seam for JSF2

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/DelegatingFacesContext.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/DelegatingFacesContext.java	2012-02-01 13:24:53 UTC (rev 14284)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/DelegatingFacesContext.java	2012-02-01 22:32:52 UTC (rev 14285)
@@ -1,6 +1,5 @@
 package org.jboss.seam.jsf;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -47,11 +46,9 @@
    }
    
    
-   public Map<Object, Object> getAttributes() {
-      // FIXME: due JSF 2 new method for
-      // javax.faces.context.FacesContext.getAttributes() and non existent
-      // JSF 1.2 equivalent method it returns empty Map without delegating call
-      return new HashMap<Object, Object>();
+   public Map<Object, Object> getAttributes() 
+   {
+      return delegate.getAttributes();
    }
 
    @Override

Modified: branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java	2012-02-01 13:24:53 UTC (rev 14284)
+++ branches/community/Seam_2_3/jboss-seam-jsf2/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java	2012-02-01 22:32:52 UTC (rev 14285)
@@ -1,16 +1,13 @@
 package org.jboss.seam.jsf;
 
 import java.io.IOException;
-import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
 import javax.faces.FacesException;
 import javax.faces.application.ViewHandler;
 import javax.faces.application.ViewHandlerWrapper;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
-import javax.faces.view.ViewDeclarationLanguage;
 
 import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.international.LocaleSelector;

Modified: branches/community/Seam_2_3/jboss-seam-mail/src/main/java/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-mail/src/main/java/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java	2012-02-01 13:24:53 UTC (rev 14284)
+++ branches/community/Seam_2_3/jboss-seam-mail/src/main/java/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java	2012-02-01 22:32:52 UTC (rev 14285)
@@ -6,6 +6,8 @@
 import javax.faces.context.ResponseWriter;
 
 import org.jboss.seam.jsf.DelegatingFacesContext;
+import org.jboss.seam.mail.ui.context.MailExternalContextImpl;
+import org.jboss.seam.mail.ui.context.MailResponseWriter;
 
 
 public class MailFacesContextImpl extends DelegatingFacesContext

Modified: branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/FaceletCompiler.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/FaceletCompiler.java	2012-02-01 13:24:53 UTC (rev 14284)
+++ branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/FaceletCompiler.java	2012-02-01 22:32:52 UTC (rev 14285)
@@ -13,9 +13,6 @@
 import org.jboss.seam.annotations.intercept.BypassInterceptors;
 import org.jboss.seam.contexts.Contexts;
 
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
 import com.sun.faces.application.ApplicationAssociate;
 import com.sun.faces.facelets.compiler.SAXCompiler;
 
@@ -27,26 +24,24 @@
 public class FaceletCompiler
 {
    
-   private LogProvider log = Logging.getLogProvider(FaceletCompiler.class);
    private com.sun.faces.facelets.compiler.Compiler compiler;
    
    @Create
    public void create()
    {
-      compiler = new SAXCompiler();
-     // fill the necessary parameters 
-      initializeCompiler(compiler);
+	   ApplicationAssociate applicationAssociate = ApplicationAssociate.getCurrentInstance();
+	   if (applicationAssociate != null)
+	   {
+		   compiler = applicationAssociate.getCompiler();
+	   }
+	   else 
+	   {
+		   // TODO: this requires to initialize custom tag library
+		   compiler = new SAXCompiler();
+	   }
    }
+     
    
-   /*
-    * This method cribbed from FaceletViewHandler 
-    */
-   protected void initializeCompiler(com.sun.faces.facelets.compiler.Compiler compiler) 
-   {
-      compiler = ApplicationAssociate.getCurrentInstance().getCompiler();
-    }
-
-   
    @Unwrap
    public com.sun.faces.facelets.compiler.Compiler unwrap()
    {

Modified: branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java	2012-02-01 13:24:53 UTC (rev 14284)
+++ branches/community/Seam_2_3/jboss-seam-ui-jsf2/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java	2012-02-01 22:32:52 UTC (rev 14285)
@@ -10,16 +10,15 @@
 import javax.servlet.ServletContext;
 
 import org.jboss.seam.core.ResourceLoader;
+import org.jboss.seam.jsf.DelegatingFacesContext;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
-import org.jboss.seam.jsf.DelegatingFacesContext;
 import org.jboss.seam.mock.MockHttpServletRequest;
 import org.jboss.seam.mock.MockHttpServletResponse;
 import org.jboss.seam.ui.util.JSF;
 
+import com.sun.faces.application.ApplicationAssociate;
 import com.sun.faces.facelets.Facelet;
-import com.sun.faces.facelets.impl.DefaultFaceletFactory;
-import com.sun.faces.facelets.impl.DefaultResourceResolver;
 
 public class RendererRequest
 {
@@ -126,8 +125,7 @@
       {
          throw new IllegalArgumentException("resource doesn't exist: " + viewId);
       }
-      return new DefaultFaceletFactory(FaceletCompiler.instance(), new DefaultResourceResolver())
-               .getFacelet(url);
+      return ApplicationAssociate.getCurrentInstance().getFaceletFactory().getFacelet(url);
    }
 
    /**



More information about the seam-commits mailing list