You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2015/04/23 15:27:54 UTC

svn commit: r1675610 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/ tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ tobago-example/tobago-example-demo/sr...

Author: lofwyr
Date: Thu Apr 23 13:27:53 2015
New Revision: 1675610

URL: http://svn.apache.org/r1675610
Log:
Merge from trunk
TOBAGO-1456: Mark NonFacesRequestServlet as deprecated

Removed:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HtmlEditor.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml   (contents, props changed)

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java Thu Apr 23 13:27:53 2015
@@ -36,6 +36,10 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
+/**
+ * @deprecated since Tobago 2.0.8 - Please use <f:initParam> instead - see also TOBAGO-1456
+ */
+@Deprecated
 public abstract class NonFacesRequestServlet extends HttpServlet {
 
   private static final long serialVersionUID = -7448621953821447997L;

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HtmlEditor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HtmlEditor.java?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HtmlEditor.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/HtmlEditor.java Thu Apr 23 13:27:53 2015
@@ -43,6 +43,8 @@ public class HtmlEditor implements Seria
         FacesContext.getCurrentInstance(),
         "content/35-wysiwyg/00-tinymce/tinymce/js/tinymce/tinymce.min.js")
         .size() != 0;
+    text = "<h1>Sonne</h1>"
+        + "<p>Die Sonne ist ein Stern in der Galaxie Milchstraße.</p>";
   }
 
   public String getText() {

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java Thu Apr 23 13:27:53 2015
@@ -22,48 +22,57 @@ package org.apache.myfaces.tobago.exampl
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Random;
 
 public class FishPond {
 
   private static final Logger LOG = LoggerFactory.getLogger(FishPond.class);
 
-  private Map<String, String> fishes;
+  private Map<Integer, String> fishes;
 
-  private String selectedFish;
+  private Integer selectedFishId = null;
 
   public FishPond() {
-    fishes = new HashMap<String, String>();
-    fishes.put("0", "Scholle");
-    fishes.put("1", "Hai");
-    fishes.put("2", "Luce");
-    fishes.put("3", "Halibut");
-    fishes.put("4", "Tamboril");
+    fishes = new HashMap<Integer, String>();
+    fishes.put(0, "Scholle");
+    fishes.put(1, "Hai");
+    fishes.put(2, "Luce");
+    fishes.put(3, "Halibut");
+    fishes.put(4, "Tamboril");
+  }
+
+  public void action() {
+    LOG.info("Event is called! selectedFishId='{}'", selectedFishId);
+    // not needed for this example
   }
 
   public String random() {
     final Random random = new Random(System.currentTimeMillis());
+    selectedFishId = random.nextInt(fishes.size());
 
-    selectedFish = fishes.get("" + random.nextInt(fishes.size()));
-
-    LOG.info("select via random: '" + selectedFish + "'");
+    LOG.info("select via random: '" + getSelectedFish() + "'");
 
-    return "/content/90-non-faces-request/x-fish-pond.xhtml";
+    return null; // is AJAX
   }
 
-  public String select(final String id) {
-    selectedFish = fishes.get(id);
-
-    LOG.info("select via id: '" + selectedFish + "'");
-
+  public String select(final Integer fishId) {
+    selectedFishId = fishId;
+    LOG.info("select via id: '" + getSelectedFish() + "'");
     return "/content/90-non-faces-request/x-fish-pond.xhtml";
   }
 
   public String getSelectedFish() {
-    return selectedFish;
+    return fishes.get(selectedFishId);
   }
 
+  public Integer getSelectedFishId() {
+    return selectedFishId;
+  }
 
+  public void setSelectedFishId(Integer selectedFishId) {
+    this.selectedFishId = selectedFishId;
+    LOG.info("setSelectedFishId via setter: '" + selectedFishId + "'");
+  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Thu Apr 23 13:27:53 2015
@@ -158,19 +158,6 @@
     <url-pattern>/org/apache/myfaces/tobago/sandbox/*</url-pattern>
   </servlet-mapping>
 
-  <!-- Non-Faces-Request Demo -->
-
-  <servlet>
-    <servlet-name>FishServlet</servlet-name>
-    <servlet-class>org.apache.myfaces.tobago.example.demo.nonfacesrequest.FishServlet</servlet-class>
-    <load-on-startup>3</load-on-startup>
-  </servlet>
-
-  <servlet-mapping>
-    <servlet-name>FishServlet</servlet-name>
-    <url-pattern>/FishServlet</url-pattern>
-  </servlet-mapping>
-
   <!-- Error Page -->
 
   <error-page>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml Thu Apr 23 13:27:53 2015
@@ -21,20 +21,27 @@
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:f="http://java.sun.com/jsf/core">
-    <ui:param name="title" value="Non-Faces-Request Demo: Start"/>
+  <ui:param name="title" value="Non-Faces-Request Demo: Start"/>
 
-    <tc:panel>
-      <tc:out value="todo: check why this content will not be rendered..."/>
-        <p>
-            Use these external links:<br/>
-
-            <a href="#{request.contextPath}/FishServlet?id=0">#{request.contextPath}/FishServlet?id=0</a><br/>
-            <a href="#{request.contextPath}/FishServlet?id=1">#{request.contextPath}/FishServlet?id=1</a><br/>
-            <a href="#{request.contextPath}/FishServlet?id=2">#{request.contextPath}/FishServlet?id=2</a><br/>
-            <a href="#{request.contextPath}/FishServlet?id=3">#{request.contextPath}/FishServlet?id=3</a><br/>
-            <a href="#{request.contextPath}/FishServlet?id=4">#{request.contextPath}/FishServlet?id=4</a><br/>
-        </p>
+  <tc:panel>
+    <f:facet name="layout">
+      <tc:flowLayout/>
+    </f:facet>
 
-    </tc:panel>
+    <p>
+      This demo works with &lt;f:viewParam>.<br/>
+    </p>
+
+    <p>
+      Use these links from external applications:<br/>
+
+      <a href="#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=0&amp;dswid=#{request.parameterMap['dswid'][0]}">#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=0&amp;dswid=#{request.parameterMap['dswid'][0]}</a><br/>
+      <a href="#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=1&amp;dswid=#{request.parameterMap['dswid'][0]}">#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=1&amp;dswid=#{request.parameterMap['dswid'][0]}</a><br/>
+      <a href="#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=2&amp;dswid=#{request.parameterMap['dswid'][0]}">#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=2&amp;dswid=#{request.parameterMap['dswid'][0]}</a><br/>
+      <a href="#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=3&amp;dswid=#{request.parameterMap['dswid'][0]}">#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=3&amp;dswid=#{request.parameterMap['dswid'][0]}</a><br/>
+      <a href="#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=4&amp;dswid=#{request.parameterMap['dswid'][0]}">#{request.contextPath}/faces/content/90-non-faces-request/x-fish-pond.xhtml?fishId=4&amp;dswid=#{request.parameterMap['dswid'][0]}</a><br/>
+    </p>
+
+  </tc:panel>
 
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml Thu Apr 23 13:27:53 2015
@@ -22,23 +22,31 @@
                 xmlns:tx="http://myfaces.apache.org/tobago/extension"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:f="http://java.sun.com/jsf/core">
-    <ui:param name="title" value="Non-Faces-Request Demo: Fish Pont"/>
+  <ui:param name="title" value="Non-Faces-Request Demo: Fish Pont"/>
 
-    <tc:panel>
+  <ui:define name="metadata">
+    <f:metadata>
+      <f:viewParam name="fishId" value="#{fishPond.selectedFishId}" />
+      <f:event type="preRenderView" listener="#{fishPond.action}"/>
+    </f:metadata>
+  </ui:define>
+
+  <tc:panel id="pond">
+
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto;auto" margin="20px"/>
+    </f:facet>
 
-        <f:facet name="layout">
-            <tc:gridLayout rows="auto;auto" margin="20px"/>
-        </f:facet>
-
-        <tx:in label="Selected:" value="#{fishPond.selectedFish}" readonly="true"/>
-
-        <tc:panel>
-            <f:facet name="layout">
-                <tc:gridLayout columns="auto;*"/>
-            </f:facet>
-            <tc:button label="random" action="#{fishPond.random}"/>
-        </tc:panel>
+    <tx:in label="Selected:" value="#{fishPond.selectedFish}" readonly="true"/>
 
+    <tc:panel>
+      <f:facet name="layout">
+        <tc:gridLayout columns="auto;auto;*"/>
+      </f:facet>
+      <tc:button label="random" action="#{fishPond.random}" renderedPartially="pond :page:header:headerInfo"/>
+      <tc:button label="back to start" action="/content/90-non-faces-request/non-faces-request.xhtml"/>
     </tc:panel>
 
+  </tc:panel>
+
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml?rev=1675610&r1=1675609&r2=1675610&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml Thu Apr 23 13:27:53 2015
@@ -59,6 +59,7 @@
   <entry key="nonFacesResponse">Non Faces Resp.</entry>
   <entry key="toolBarCustomizer">User Customized UI</entry>
   <entry key="faceletsAsResources">Facelets As Resource</entry>
+  <entry key="non-faces-request">Non Faces Request</entry>
 
   <entry key="reference_intro">Ref. (under constr.)</entry>
   <entry key="reference_command">Command</entry>

Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 23 13:27:53 2015
@@ -1,3 +1,3 @@
 /myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1356585,1357124
 /myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1226794-1341423
-/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590288,1666464
+/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1590288,1666464,1675588-1675589