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 2010/09/02 16:35:43 UTC

svn commit: r991952 - in /myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main: java/org/apache/myfaces/tobago/example/addressbook/web/ resources/META-INF/resources/addressbook/admin/ resources/META-INF/resources/addressbook/layout/

Author: lofwyr
Date: Thu Sep  2 14:35:42 2010
New Revision: 991952

URL: http://svn.apache.org/viewvc?rev=991952&view=rev
Log:
 - using tc:attribute for binding (is compatible for JSP and Facelets)
 - minor changes

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/logging.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/memory.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/layout/basic.xhtml

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java?rev=991952&r1=991951&r2=991952&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java Thu Sep  2 14:35:42 2010
@@ -86,7 +86,7 @@ public class Controller {
   private boolean renderPopup;
   private boolean renderFirstName = true;
   private boolean renderLastName = true;
-  private boolean renderDayOfBirth;
+  private boolean renderDayOfBirth = true;
 
   @Resource(name = "addressDao")
   private AddressDao addressDao;
@@ -298,6 +298,10 @@ public class Controller {
     return "logout";
   }
 
+  public String getVersion() {
+    return getClass().getPackage().getImplementationVersion();
+  }
+
   public Locale getLanguage() {
     return language;
   }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/logging.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/logging.xhtml?rev=991952&r1=991951&r2=991952&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/logging.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/logging.xhtml Thu Sep  2 14:35:42 2010
@@ -17,82 +17,86 @@
  * limitations under the License.
 -->
 
-<tc:panel xmlns:tc="http://myfaces.apache.org/tobago/component"
-          xmlns:tx="http://myfaces.apache.org/tobago/extension"
-          xmlns:ui="http://java.sun.com/jsf/facelets"
-          xmlns:f="http://java.sun.com/jsf/core">
-  <f:facet name="layout">
-    <tc:gridLayout rows="2*;3*;fixed" margin="10"/>
-  </f:facet>
-
-  <tc:box label="Appenders">
-    <tc:sheet columns="*;*;*;2*" var="appender" value="#{logging.appenders}">
-      <tc:column label="Class">
-        <tc:out value="#{appender.className}"/>
-      </tc:column>
-      <tc:column label="Name">
-        <tc:out value="#{appender.name}"/>
-      </tc:column>
-      <tc:column label="File">
-        <tc:link inline="true" action="#{logging.downloadLogFile}" tip="Download Log File"
-                 target="_blank" rendered="#{! empty appender.file}">
-          <f:param value="#{appender}" binding="#{logging.currentAppender}"/>
-          <tc:out value="#{appender.file}"/>
-        </tc:link>
-      </tc:column>
-      <tc:column label="Layout">
-        <tc:out value="#{appender.layout}"/>
-      </tc:column>
-    </tc:sheet>
-  </tc:box>
-
-  <tc:box label="Categories">
+<f:subview id="memory"
+           xmlns:tc="http://myfaces.apache.org/tobago/component"
+           xmlns:tx="http://myfaces.apache.org/tobago/extension"
+           xmlns:ui="http://java.sun.com/jsf/facelets"
+           xmlns:f="http://java.sun.com/jsf/core">
+  <tc:panel>
     <f:facet name="layout">
-      <tc:gridLayout rows="*;fixed"/>
+      <tc:gridLayout rows="2*;3*;fixed" margin="10"/>
     </f:facet>
-    <tc:sheet columns="5*;25px;*" var="category"
-              value="#{logging.categories}" showDirectLinks="left" showPageRange="right"
-              first="#{logging.catergoriesFirst}" rows="#{logging.catergoriesRows}">
-      <tc:column label="Name" sortable="true">
-        <tc:link inline="true" action="#{logging.selectCategory}" immediate="true">
-          <f:param value="#{category}" binding="#{logging.currentCategory}"/>
-          <tc:out value="#{category.name}"/>
-          <tc:attribute name="renderedPartially" value=":page:addCategory"/>
-        </tc:link>
-      </tc:column>
-      <tc:column label="Inh" tip="Inherited" sortable="true">
-        <tc:selectBooleanCheckbox readonly="true" value="#{category.inherited}"/>
-      </tc:column>
-      <tc:column label="Level" sortable="true">
-        <tc:selectOneChoice value="#{category.level}">
-          <tc:selectItems value="#{logging.levels}"/>
-        </tc:selectOneChoice>
-      </tc:column>
-    </tc:sheet>
-    <tc:panel>
+
+    <tc:box label="Appenders">
+      <tc:sheet columns="*;*;*;2*" var="appender" value="#{logging.appenders}">
+        <tc:column label="Class">
+          <tc:out value="#{appender.className}"/>
+        </tc:column>
+        <tc:column label="Name">
+          <tc:out value="#{appender.name}"/>
+        </tc:column>
+        <tc:column label="File">
+          <tc:link inline="true" action="#{logging.downloadLogFile}" tip="Download Log File"
+                   target="_blank" rendered="#{! empty appender.file}">
+            <f:param value="#{appender}" binding="#{logging.currentAppender}"/>
+            <tc:out value="#{appender.file}"/>
+          </tc:link>
+        </tc:column>
+        <tc:column label="Layout">
+          <tc:out value="#{appender.layout}"/>
+        </tc:column>
+      </tc:sheet>
+    </tc:box>
+
+    <tc:box label="Categories">
       <f:facet name="layout">
-        <tc:gridLayout columns="*;fixed"/>
+        <tc:gridLayout rows="*;fixed"/>
       </f:facet>
-      <tc:cell/>
-      <tc:button label="Update" action="#{logging.updateCategories}"/>
-    </tc:panel>
-  </tc:box>
+      <tc:sheet columns="5*;25px;*" var="category"
+                value="#{logging.categories}" showDirectLinks="left" showPageRange="right" showRowRange="none"
+                first="#{logging.catergoriesFirst}" rows="#{logging.catergoriesRows}">
+        <tc:column label="Name" sortable="true">
+          <tc:link inline="true" action="#{logging.selectCategory}" immediate="true">
+            <f:param value="#{category}" binding="#{logging.currentCategory}"/>
+            <tc:out value="#{category.name}"/>
+            <tc:attribute name="renderedPartially" value=":page:addCategory"/>
+          </tc:link>
+        </tc:column>
+        <tc:column label="Inh" tip="Inherited" sortable="true">
+          <tc:selectBooleanCheckbox readonly="true" value="#{category.inherited}"/>
+        </tc:column>
+        <tc:column label="Level" sortable="true">
+          <tc:selectOneChoice value="#{category.level}">
+            <tc:selectItems value="#{logging.levels}"/>
+          </tc:selectOneChoice>
+        </tc:column>
+      </tc:sheet>
+      <tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;fixed"/>
+        </f:facet>
+        <tc:cell/>
+        <tc:button label="Update" action="#{logging.updateCategories}"/>
+      </tc:panel>
+    </tc:box>
 
-  <tc:box label="Add Category" id="addCategory">
-    <f:facet name="layout">
-      <tc:gridLayout rows="fixed"/>
-    </f:facet>
-    <tc:panel>
+    <tc:box label="Add Category" id="addCategory">
       <f:facet name="layout">
-        <tc:gridLayout columns="*;*;fixed"/>
+        <tc:gridLayout rows="fixed"/>
       </f:facet>
-      <tx:in label="Category" value="#{logging.category}"
-             binding="#{logging.categoryControl}"/>
-      <tx:selectOneChoice label="Level" value="#{logging.level}">
-        <tc:selectItems value="#{logging.levels}"/>
-      </tx:selectOneChoice>
-      <tc:button label="Set Level" action="#{logging.addCategory}"/>
-    </tc:panel>
-  </tc:box>
+      <tc:panel>
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;*;fixed"/>
+        </f:facet>
+        <tx:in label="Category" value="#{logging.category}">
+          <tc:attribute name="binding" value="#{logging.categoryControl}"/>
+        </tx:in>
+        <tx:selectOneChoice label="Level" value="#{logging.level}">
+          <tc:selectItems value="#{logging.levels}"/>
+        </tx:selectOneChoice>
+        <tc:button label="Set Level" action="#{logging.addCategory}"/>
+      </tc:panel>
+    </tc:box>
 
-</tc:panel>
+  </tc:panel>
+</f:subview>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/memory.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/memory.xhtml?rev=991952&r1=991951&r2=991952&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/memory.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/admin/memory.xhtml Thu Sep  2 14:35:42 2010
@@ -17,27 +17,31 @@
  * limitations under the License.
 -->
 
-<tc:panel xmlns:tc="http://myfaces.apache.org/tobago/component"
-          xmlns:tx="http://myfaces.apache.org/tobago/extension"
-          xmlns:ui="http://java.sun.com/jsf/facelets"
-          xmlns:f="http://java.sun.com/jsf/core">
-
-  <f:facet name="layout">
-    <tc:gridLayout margin="10px" rows="fixed;fixed;fixed;*" columns="300px;*"/>
-  </f:facet>
-  <f:facet name="reload">
-    <tc:reload frequency="5000" update="#{admin.updateMemory}" />
-  </f:facet>
-
-  <tc:label value="Memory:" />
-  <tc:cell/>
-
-  <tc:progress value="#{admin.memory}" markup="#{admin.state}" />
-  <tc:cell/>
+<f:subview id="memory"
+           xmlns:tc="http://myfaces.apache.org/tobago/component"
+           xmlns:tx="http://myfaces.apache.org/tobago/extension"
+           xmlns:ui="http://java.sun.com/jsf/facelets"
+           xmlns:f="http://java.sun.com/jsf/core">
+  <tc:panel>
+
+    <f:facet name="layout">
+      <tc:gridLayout margin="10px" rows="fixed;fixed;fixed;*" columns="300px;*"/>
+    </f:facet>
+    <f:facet name="reload">
+      <tc:reload frequency="5000" update="#{admin.updateMemory}"/>
+    </f:facet>
+
+    <tc:label value="Memory:"/>
+    <tc:cell/>
+
+    <tc:progress value="#{admin.memory}" markup="#{admin.state}"/>
+    <tc:cell/>
 
-  <tc:label value="Current: #{admin.memory.value} kB Max: #{admin.memory.maximum} kB" />
-  <tc:cell/>
+    <tc:label value="Current: #{admin.memory.value} kB Max: #{admin.memory.maximum} kB"/>
+    <tc:cell/>
 
-  <tc:cell spanX="2"/>
+    <tc:cell spanX="2"/>
+
+  </tc:panel>
+</f:subview>
 
-</tc:panel>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/layout/basic.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/layout/basic.xhtml?rev=991952&r1=991951&r2=991952&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/layout/basic.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-lib/src/main/resources/META-INF/resources/addressbook/layout/basic.xhtml Thu Sep  2 14:35:42 2010
@@ -24,8 +24,7 @@
   <f:view locale="#{controller.language}">
     <tc:loadBundle basename="resource" var="bundle"/>
 
-    <tc:page applicationIcon="icon/favicon.ico" label="${title}" state="#{layout}" width="#{layout.width}"
-             height="#{layout.height}" id="page">
+    <tc:page applicationIcon="icon/favicon.ico" label="${title}" id="page">
       <f:facet name="menuBar">
         <tc:menuBar>
           <tc:form>
@@ -71,7 +70,7 @@
         <ui:insert/>
       </tc:cell>
 
-      <tc:popup id="about" width="300" height="220" left="200" top="200">
+      <tc:popup id="about" width="400" height="220" left="200" top="200">
         <tc:box label="About">
           <f:facet name="layout">
             <tc:gridLayout rows="150px;*;fixed" columns="150px;*"/>
@@ -86,7 +85,7 @@
 
             <tc:out markup="strong" value="Addressbook Demo"/>
             <tc:cell/>
-            <tc:out value="Version 1.0"/>
+            <tc:out value="Version #{controller.version}"/>
             <tc:cell/>
           </tc:panel>