myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r544656 - in /myfaces/tomahawk/branches/tomahawk_next_20070528/core: ./ src/main/java/org/apache/myfaces/component/html/ext/ src/main/java/org/apache/myfaces/custom/inputHtml/ src/main/java/org/apache/myfaces/custom/savestate/ src/main/java...
Date Tue, 05 Jun 2007 22:07:56 GMT
Author: baranda
Date: Tue Jun  5 15:07:55 2007
New Revision: 544656

URL: http://svn.apache.org/viewvc?view=rev&rev=544656
Log:
Some fixing to work with myfaces 1.2

Modified:
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/pom.xml
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/stylesheet/TextResourceFilter.java
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java
    myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/pom.xml?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/pom.xml (original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/pom.xml Tue Jun  5 15:07:55 2007
@@ -9,7 +9,7 @@
   <parent>
     <groupId>org.apache.myfaces.tomahawk</groupId>
     <artifactId>tomahawk-project</artifactId>
-    <version>1.1.6-SNAPSHOT</version>
+    <version>2.0-SNAPSHOT</version>
   </parent>
 
   <scm>
@@ -107,21 +107,20 @@
       <scope>provided</scope> <!-- because we add all classes to the jar directly
-->
     </dependency>
 
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>jsp-api</artifactId>
-      <version>2.0</version>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>2.3</version>
-      <scope>provided</scope>
-    </dependency>
+      <dependency>
+          <groupId>javax.servlet</groupId>
+          <artifactId>servlet-api</artifactId>
+          <version>2.5</version>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>javax.servlet.jsp</groupId>
+          <artifactId>jsp-api</artifactId>
+          <version>2.1</version>
+          <scope>provided</scope>
+      </dependency>
 
-    <dependency>
+      <dependency>
       <groupId>portlet-api</groupId>
       <artifactId>portlet-api</artifactId>
       <version>1.0</version>
@@ -172,7 +171,7 @@
     <dependency>
       <groupId>org.apache.shale</groupId>
       <artifactId>shale-test</artifactId>
-      <version>1.0.3</version>
+      <version>1.0.4</version>
       <scope>test</scope>
       <exclusions>
         <exclusion>

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
Tue Jun  5 15:07:55 2007
@@ -291,7 +291,7 @@
         //
         Object facet = getFacets().remove(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME);
         super.processDecodes(context);
-        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, facet);
+        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, (UIComponent)
facet);
 
         setRowIndex(-1);
         processColumns(context, PROCESS_DECODES);
@@ -427,7 +427,7 @@
         //
         Object facet = getFacets().remove(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME);
         super.processValidators(context);
-        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, facet);
+        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, (UIComponent)
facet);
 
         processColumns(context, PROCESS_VALIDATORS);
         setRowIndex(-1);
@@ -452,7 +452,7 @@
         //
         Object facet = getFacets().remove(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME);
         super.processUpdates(context);
-        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, facet);
+        if ( facet != null ) getFacets().put(HtmlTableRenderer.DETAIL_STAMP_FACET_NAME, (UIComponent)
facet);
 
         processColumns(context, PROCESS_UPDATES);
         setRowIndex(-1);

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java
Tue Jun  5 15:07:55 2007
@@ -100,11 +100,11 @@
     }
 
     static private boolean hasThisPageAlreadyRenderedAnInputHtml(FacesContext context){
-            return context.getExternalContext().getRequestMap().containsKey( InputHtmlRenderer.class
);
+            return context.getExternalContext().getRequestMap().containsKey( InputHtmlRenderer.class.getName()
);
     }
 
     static private void setThisPageAlreadyRenderedAnInputHtml(FacesContext context){
-        context.getExternalContext().getRequestMap().put(InputHtmlRenderer.class, Boolean.TRUE);
+        context.getExternalContext().getRequestMap().put(InputHtmlRenderer.class.getName(),
Boolean.TRUE);
     }
 
     /**

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
Tue Jun  5 15:07:55 2007
@@ -22,6 +22,7 @@
 import javax.faces.component.UIParameter;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
+import javax.el.ValueExpression;
 
 /**
  * Provides the ability to store a model value inside the view's component tree.
@@ -95,10 +96,10 @@
         {
         	savedObject = values[2];
         }
-        ValueBinding vb = getValueBinding("value");
-        if (vb != null)
+        ValueExpression ve = getValueExpression("value");
+        if (ve != null)
         {
-            vb.setValue(context, savedObject);
+            ve.setValue(context.getELContext(), savedObject);
         }
     }
 

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/stylesheet/TextResourceFilter.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/stylesheet/TextResourceFilter.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/stylesheet/TextResourceFilter.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/main/java/org/apache/myfaces/custom/stylesheet/TextResourceFilter.java
Tue Jun  5 15:07:55 2007
@@ -154,7 +154,7 @@
 			return filteredResource;
 		}
 
-		String text = RendererUtils.loadResourceFile(context, path);
+		String text = (String) RendererUtils.loadResourceFile(context, path);
 		if (text == null)
 		{
 			// avoid loading the errorneous resource over and over again

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/custom/savestate/UISaveStateTest.java
Tue Jun  5 15:07:55 2007
@@ -21,6 +21,7 @@
 import java.util.LinkedList;
 
 import javax.faces.el.ValueBinding;
+import javax.el.ValueExpression;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -58,10 +59,10 @@
 	}
 
 	public void testWorksWithLinkedList() {
-		ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{testBean.linkedList}");
-		saveState.setValueBinding("value", valueBinding);
+        ValueExpression valueExpression = createValueExpression("#{testBean.linkedList}",
Object.class);
+		saveState.setValueExpression("value", valueExpression);
 
-		LinkedList linkedList = (LinkedList) valueBinding.getValue(facesContext);
+        LinkedList linkedList = (LinkedList) valueExpression.getValue(facesContext.getELContext());
 
 		try {
 			Object state = saveState.saveState(facesContext);
@@ -76,10 +77,10 @@
 	}
 
 	public void testWorksWithStateHolder() {
-		ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{testBean}");
-		saveState.setValueBinding("value", valueBinding);
+		ValueExpression valueExpression = createValueExpression("#{testBean}", SaveStateTestBean.class);
+		saveState.setValueExpression("value", valueExpression);
 
-		SaveStateTestBean testBean = (SaveStateTestBean) valueBinding.getValue(facesContext);
+        SaveStateTestBean testBean = (SaveStateTestBean) valueExpression.getValue(facesContext.getELContext());
 
 		try {
 			Object state = saveState.saveState(facesContext);
@@ -88,8 +89,13 @@
 
 			saveState.restoreState(facesContext, state);
 		}catch(Exception exception) {
-			fail();
+            exception.printStackTrace();
+            fail();
 		}
 	}
+
+    private ValueExpression createValueExpression(String expression, Class returnType) {
+        return facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(),
expression, returnType);
+    }
 
 }

Modified: myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java?view=diff&rev=544656&r1=544655&r2=544656
==============================================================================
--- myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
(original)
+++ myfaces/tomahawk/branches/tomahawk_next_20070528/core/src/test/java/org/apache/myfaces/renderkit/html/util/AddResourceTest.java
Tue Jun  5 15:07:55 2007
@@ -20,9 +20,9 @@
 
 import junit.framework.TestCase;
 import org.apache.myfaces.application.ApplicationFactoryImpl;
-import org.apache.myfaces.context.servlet.ServletFacesContextImpl;
 import org.apache.myfaces.renderkit.RenderKitFactoryImpl;
 import org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlResponseWriterImpl;
+import org.apache.myfaces.context.servlet.FacesContextImpl;
 import org.easymock.MockControl;
 
 import javax.faces.FactoryFinder;
@@ -161,7 +161,7 @@
             FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY, RenderKitFactoryImpl.class.getName());
 
             // Now create a FacesContext....
-            _facesContext = new ServletFacesContextImpl(null,
+            _facesContext = new FacesContextImpl(null,
                     _servletRequest, _servletResponse);
             _facesContext.setResponseWriter(_htmlResponseWriter);
         }



Mime
View raw message