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 2011/06/08 23:34:41 UTC

svn commit: r1133562 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main: java/org/apache/myfaces/tobago/example/demo/ java/org/apache/myfaces/tobago/example/demo/bestpractice/ webapp/WEB-INF/ webapp/best-practice/ webapp/content/12/...

Author: lofwyr
Date: Wed Jun  8 21:34:41 2011
New Revision: 1133562

URL: http://svn.apache.org/viewvc?rev=1133562&view=rev
Log:
refactor the demo

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml   (contents, props changed)
      - copied, changed from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml   (contents, props changed)
      - copied, changed from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition-after-sleep.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml   (contents, props changed)
      - copied, changed from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/non-faces-response.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/x-sample.pdf   (props changed)
      - copied unchanged from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/sample.pdf
Removed:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/non-faces-response.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/sample.pdf
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition-after-sleep.jsp
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition.jsp
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/BestPracticeController.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java?rev=1133562&r1=1133561&r2=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java Wed Jun  8 21:34:41 2011
@@ -67,6 +67,7 @@ public class Navigation {
       for (String path : resourcePaths) {
 
         if (path.endsWith("/.svn/")) {
+          // ignoring svn files
           continue;
         }
 
@@ -75,6 +76,11 @@ public class Navigation {
           continue;
         }
 
+        if (path.contains("/x-")) {
+          // ignoring excluded files
+          continue;
+        }
+
         result.add(path);
 
       }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/BestPracticeController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/BestPracticeController.java?rev=1133562&r1=1133561&r2=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/BestPracticeController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/bestpractice/BestPracticeController.java Wed Jun  8 21:34:41 2011
@@ -65,14 +65,14 @@ public class BestPracticeController {
 
     InputStream inputStream = null;
     try {
-      inputStream = facesContext.getExternalContext().getResourceAsStream("best-practice/sample.pdf");
+      inputStream = facesContext.getExternalContext().getResourceAsStream("content/12/03/x-sample.pdf");
       if (inputStream == null) {
-        inputStream = facesContext.getExternalContext().getResourceAsStream("/best-practice/sample.pdf");
+        inputStream = facesContext.getExternalContext().getResourceAsStream("/content/12/03/x-sample.pdf");
       }
       HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
       response.setContentType("application/pdf");
       if (outside) {
-        response.setHeader("Content-Disposition", "attachment; filename=sample.pdf");
+        response.setHeader("Content-Disposition", "attachment; filename=x-sample.pdf");
       }
       IOUtils.copy(inputStream, response.getOutputStream());
     } catch (IOException e) {

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=1133562&r1=1133561&r2=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml Wed Jun  8 21:34:41 2011
@@ -187,15 +187,15 @@
     </navigation-case>
     <navigation-case>
       <from-outcome>best-practice/transition</from-outcome>
-      <to-view-id>/best-practice/transition.jsp</to-view-id>
+      <to-view-id>/content/12/02/transition.xhtml</to-view-id>
     </navigation-case>
     <navigation-case>
       <from-outcome>best-practice/transition-after-sleep</from-outcome>
-      <to-view-id>/best-practice/transition-after-sleep.jsp</to-view-id>
+      <to-view-id>/content/12/02/x-transition-after-sleep.xhtml</to-view-id>
     </navigation-case>
     <navigation-case>
       <from-outcome>best-practice/non-faces-response</from-outcome>
-      <to-view-id>/best-practice/non-faces-response.jsp</to-view-id>
+      <to-view-id>/content/12/03/non-faces-response.xhtml</to-view-id>
     </navigation-case>
     <navigation-case>
       <from-outcome>best-practice/tool-bar-customizer</from-outcome>

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml (from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition.jsp)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition.jsp&r1=1133539&r2=1133562&rev=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition.jsp (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml Wed Jun  8 21:34:41 2011
@@ -1,4 +1,6 @@
-<%--
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -13,24 +15,22 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
---%>
-<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
+-->
+
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                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="Transitions between pages"/>
 
-<layout:overview>
-  <jsp:body>
-    <tc:box label="Transitions between pages">
+    <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout rows="fixed;fixed;fixed;*" />
+        <tc:gridLayout rows="auto;auto;auto" />
       </f:facet>
 
       <tc:out value="Prevent double-clicks" />
       <tc:button label="Sleep 5 s (transition=true)" action="#{transitionController.sleep5s}"/>
       <tc:button label="Sleep 5 s (transition=false)" action="#{transitionController.sleep5s}" transition="false"/>
 
-      <tc:cell />
-
-    </tc:box>
-  </jsp:body>
-</layout:overview>
+    </tc:panel>
+  </ui:composition>

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/transition.xhtml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml (from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition-after-sleep.jsp)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition-after-sleep.jsp&r1=1133539&r2=1133562&rev=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/transition-after-sleep.jsp (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml Wed Jun  8 21:34:41 2011
@@ -1,4 +1,6 @@
-<%--
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -13,22 +15,19 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
---%>
-<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
-
-<layout:overview>
-  <jsp:body>
-    <tc:box label="Transition after sleep">
-      <f:facet name="layout">
-        <tc:gridLayout rows="fixed;*" />
-      </f:facet>
+-->
 
-      <tc:button label="Back" action="best-practice/transition" />
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                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="Transition after sleep"/>
+  <tc:panel>
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto"/>
+    </f:facet>
 
-      <tc:cell />
+    <tc:button label="Back" action="best-practice/transition"/>
 
-    </tc:box>
-  </jsp:body>
-</layout:overview>
+  </tc:panel>
+</ui:composition>

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/02/x-transition-after-sleep.xhtml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml (from r1133539, myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/non-faces-response.jsp)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/non-faces-response.jsp&r1=1133539&r2=1133562&rev=1133562&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/best-practice/non-faces-response.jsp (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml Wed Jun  8 21:34:41 2011
@@ -1,4 +1,6 @@
-<%--
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -13,25 +15,25 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
---%>
-<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
+-->
+
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                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 Response (e. g. a download link)"/>
 
-<layout:overview>
-  <jsp:body>
-      <tc:box label="Non Faces Response (e. g. a download link)">
-        <f:facet name="layout">
-          <tc:gridLayout rows="35px;35px;*" columns="*;100px" />
-        </f:facet>
+  <tc:panel>
+    <f:facet name="layout">
+      <tc:gridLayout rows="35px;35px;*" columns="*;100px"/>
+    </f:facet>
 
-        <tc:out value="A faces request to a non-faces-response. Inside of the Browser." />
-        <tc:button action="#{bestPracticeController.viewPdfInBrowser}" label="View Pdf" />
-        <tc:out value="A faces request to a non-faces-response. Outside of the Browser." />
-        <tc:button action="#{bestPracticeController.viewPdfOutsideOfBrowser}" label="View Pdf" transition="false" />
-        <tc:cell />
-        <tc:cell />
+    <tc:out value="A faces request to a non-faces-response. Inside of the Browser."/>
+    <tc:button action="#{bestPracticeController.viewPdfInBrowser}" label="View Pdf"/>
+    <tc:out value="A faces request to a non-faces-response. Outside of the Browser."/>
+    <tc:button action="#{bestPracticeController.viewPdfOutsideOfBrowser}" label="View Pdf" transition="false"/>
+    <tc:cell/>
+    <tc:cell/>
 
-      </tc:box>
-  </jsp:body>
-</layout:overview>
+  </tc:panel>
+</ui:composition>

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/non-faces-response.xhtml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/12/03/x-sample.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/pdf