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 2017/03/08 16:49:54 UTC

svn commit: r1786023 - in /myfaces/tobago/trunk/tobago-example: tobago-example-addressbook/ tobago-example-addressbook/src/main/webapp/auth/ tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/

Author: lofwyr
Date: Wed Mar  8 16:49:54 2017
New Revision: 1786023

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

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml?rev=1786023&r1=1786022&r2=1786023&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/pom.xml Wed Mar  8 16:49:54 2017
@@ -79,6 +79,21 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.myfaces.tobago</groupId>
+      <artifactId>tobago-theme-scarborough</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.myfaces.tobago</groupId>
+      <artifactId>tobago-theme-richmond</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.myfaces.tobago</groupId>
+      <artifactId>tobago-theme-charlotteville</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-jcdi_1.0_spec</artifactId>
       <version>1.0</version>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.xhtml?rev=1786023&r1=1786022&r2=1786023&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/auth/login.xhtml Wed Mar  8 16:49:54 2017
@@ -32,36 +32,33 @@
           <tc:out/>
 
           <tc:box label="Login">
-            <f:facet name="layout">
-              <tc:gridLayout rows="auto;auto;auto;auto"/>
-            </f:facet>
-
-            <tc:flowLayout>
-              <tc:out value="#{bundle.loginIntro}"/>
-              (
-              <tc:link label="guest/guest" image="fa-user"
-                       omit="true">
-                <tc:dataAttribute name="login" value='{"username": "guest", "password": "guest"}'/>
-              </tc:link>
-              or
-              <tc:link label="admin/admin" image="fa-user"
-                       omit="true">
-                <tc:dataAttribute name="login" value='{"username": "admin", "password": "admin"}'/>
-              </tc:link>
-              )
-            </tc:flowLayout>
-
-            <tc:in id="j_username" label="#{bundle.loginUser}"/>
-            <tc:in id="j_password" password="true" label="#{bundle.loginPassword}"/>
-
-            <tc:panel>
-              <f:facet name="layout">
-                <tc:gridLayout columns="*;auto"/>
-              </f:facet>
-
-              <tc:panel/>
-              <tc:button label="#{bundle.loginLogin}" defaultCommand="true"/>
-            </tc:panel>
+            <tc:gridLayout rows="auto;auto;auto;auto">
+
+              <tc:flowLayout>
+                <tc:out value="#{bundle.loginIntro}"/>
+                (
+                <tc:link label="guest/guest" image="fa-user"
+                         omit="true">
+                  <tc:dataAttribute name="login" value='{"username": "guest", "password": "guest"}'/>
+                </tc:link>
+                or
+                <tc:link label="admin/admin" image="fa-user"
+                         omit="true">
+                  <tc:dataAttribute name="login" value='{"username": "admin", "password": "admin"}'/>
+                </tc:link>
+                )
+              </tc:flowLayout>
+
+              <tc:in id="j_username" label="#{bundle.loginUser}"/>
+              <tc:in id="j_password" password="true" label="#{bundle.loginPassword}"/>
+
+              <tc:gridLayout columns="*;auto">
+
+                <tc:panel/>
+                <tc:button label="#{bundle.loginLogin}" defaultCommand="true"/>
+              </tc:gridLayout>
+
+            </tc:gridLayout>
           </tc:box>
 
           <tc:out/>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java?rev=1786023&r1=1786022&r2=1786023&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java Wed Mar  8 16:49:54 2017
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.faces.application.Application;
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.model.SelectItem;
 import java.util.ArrayList;
@@ -60,7 +61,12 @@ public class ClientConfigController {
 
     // locale
 
-    locale = facesContext.getViewRoot().getLocale();
+    final UIViewRoot viewRoot = facesContext.getViewRoot();
+    if (viewRoot != null) {
+      locale = viewRoot.getLocale();
+    } else {
+      locale = facesContext.getApplication().getDefaultLocale();
+    }
 
     // load