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 2018/11/29 14:34:31 UTC

[myfaces-tobago] branch master updated (cf57a14 -> 809fdeb)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from cf57a14  rat check
     new 4a05361  TOBAGO-1757: Docker example for demo
     new e6d090b  show CDI version
     new 809fdeb  TOBAGO-1757: Docker example for demo

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/test/jetty/override-mojarra-web.xml        |  4 +++
 .../src/test/jetty/override-myfaces-web.xml        |  4 +++
 tobago-example/tobago-example-demo/pom.xml         |  4 ++-
 .../myfaces/tobago/example/demo/DockerServer.java  | 16 ++++++++++
 .../myfaces/tobago/example/demo/ServerInfo.java    | 11 ++++++-
 .../myfaces/tobago/example/demo/Version.java       | 25 +++++++++++++++
 .../src/main/webapp/WEB-INF/web.xml                | 36 ++++++----------------
 .../webapp/content/10-intro/20-docker/docker.js    |  9 ++++--
 .../src/main/webapp/logging-info.xhtml             |  2 +-
 .../tobago-example-demo/src/main/webapp/menu.xhtml |  6 ++--
 .../src/main/webapp/server-info.xhtml              | 26 +++++++++++-----
 11 files changed, 100 insertions(+), 43 deletions(-)


[myfaces-tobago] 03/03: TOBAGO-1757: Docker example for demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 809fdebf9d796c79b6ecdde61c0a2085d0403b9b
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Nov 29 15:34:08 2018 +0100

    TOBAGO-1757: Docker example for demo
    
    * runnable with Websphere Liberty
    * runnable with Wildfly
---
 .../src/test/jetty/override-mojarra-web.xml        |  4 +++
 .../src/test/jetty/override-myfaces-web.xml        |  4 +++
 tobago-example/tobago-example-demo/pom.xml         |  4 ++-
 .../myfaces/tobago/example/demo/DockerServer.java  | 16 ++++++++++
 .../src/main/webapp/WEB-INF/web.xml                | 36 ++++++----------------
 5 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/tobago-example/src/test/jetty/override-mojarra-web.xml b/tobago-example/src/test/jetty/override-mojarra-web.xml
index f75d69f..6458e5f 100644
--- a/tobago-example/src/test/jetty/override-mojarra-web.xml
+++ b/tobago-example/src/test/jetty/override-mojarra-web.xml
@@ -32,4 +32,8 @@
     <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
   </listener>
 
+  <listener>
+    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+  </listener>
+
 </web-app>
diff --git a/tobago-example/src/test/jetty/override-myfaces-web.xml b/tobago-example/src/test/jetty/override-myfaces-web.xml
index c7de889..2e93b21 100644
--- a/tobago-example/src/test/jetty/override-myfaces-web.xml
+++ b/tobago-example/src/test/jetty/override-myfaces-web.xml
@@ -32,4 +32,8 @@
     <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
   </listener>
 
+  <listener>
+    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+  </listener>
+
 </web-app>
diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 0d62817..64c0cf5 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -207,14 +207,16 @@
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-annotation_1.0_spec</artifactId>
       <!-- compile or provided depends on the used server -->
-      <scope>compile</scope>
+      <scope>provided</scope>
     </dependency>
 
+<!--
     <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-validator</artifactId>
       <version>4.3.2.Final</version>
     </dependency>
+-->
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpcore</artifactId>
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DockerServer.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DockerServer.java
index e0716df..27c2745 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DockerServer.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DockerServer.java
@@ -44,6 +44,22 @@ public enum DockerServer implements Serializable {
       new String[]{
           "webProfile7",
           "webProfile8"},
+      true),
+  wildfly(
+      "Wildfly",
+      "/opt/jboss/wildfly/standalone/deployments/demo.war",
+      8080,
+      8443,
+      "jboss/wildfly",
+      new String[]{
+          "8.2.1.Final",
+          "9.0.2.Final",
+          "10.1.0.Final",
+          "11.0.0.Final",
+          "12.0.0.Final",
+          "13.0.0.Final",
+          "14.0.1.Final"
+      },
       true);
 
   private String displayName;
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
index 2b50e21..8bbf9d9 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
@@ -84,37 +84,18 @@
   </listener>
 
   <!-- activate this for some containers -->
-  <!--<listener>
-    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-  </listener>-->
-
-<!-- this is not needed for websphere 8.5 -->
-<!-- and neither for tomcat if setup correctly... but needed for jetty -->
+  <!--
   <listener>
-    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
   </listener>
+  -->
 
-
-<!-- this is an alternative to the WebBeansConfigurationListener
-     you need it e.g. for Tomcat 5.5 or WebSphere 6.1 (see TOBAGO-1043)
--->
-<!--
-  <filter>
-      <filter-name>webbeans</filter-name>
-      <filter-class>org.apache.webbeans.servlet.WebBeansConfigurationFilter</filter-class>
-    </filter>
-
-  <filter-mapping>
-      <filter-name>webbeans</filter-name>
-      <servlet-name>FacesServlet</servlet-name>
-      <dispatcher>REQUEST</dispatcher>
-      <dispatcher>ERROR</dispatcher>
-  </filter-mapping>
-
+  <!-- activate this for some containers -->
+  <!--
   <listener>
-    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationHttpSessionListener</listener-class>
+    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
   </listener>
--->
+  -->
 
   <filter>
     <filter-name>LoggingMdcFilter</filter-name>
@@ -131,7 +112,8 @@
     <servlet-name>FacesServlet</servlet-name>
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
     <load-on-startup>3</load-on-startup>
-    <!-- This is needed, for file upload e.g. <tc:file> with JSF 2.0 or 2.1, JSF 2.2 doesn't need it. -->
+    <!-- This is needed, for file upload e.g. <tc:file> with JSF 2.0 or 2.1.
+     Version JSF 2.2 or higher doesn't need it! -->
     <multipart-config>
       <max-file-size>1000000</max-file-size>
       <max-request-size>20000000</max-request-size>


[myfaces-tobago] 02/03: show CDI version

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit e6d090b6cb5532690550cd8ba4b84d281752c5dc
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Nov 29 15:29:24 2018 +0100

    show CDI version
---
 .../myfaces/tobago/example/demo/ServerInfo.java    | 11 ++++++++-
 .../myfaces/tobago/example/demo/Version.java       | 25 +++++++++++++++++++++
 .../src/main/webapp/logging-info.xhtml             |  2 +-
 .../tobago-example-demo/src/main/webapp/menu.xhtml |  6 ++---
 .../src/main/webapp/server-info.xhtml              | 26 +++++++++++++++-------
 5 files changed, 57 insertions(+), 13 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
index 72ab897..3e0a919 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ServerInfo.java
@@ -23,6 +23,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.NormalScope;
 import javax.faces.context.FacesContext;
 import javax.inject.Named;
 import javax.servlet.ServletContext;
@@ -41,7 +42,7 @@ import java.util.Properties;
  * The file name can be changed with a system property with name <code>{@value #CONFIG_FILE}</code>.
  */
 @ApplicationScoped
-@Named("info")
+@Named
 public class ServerInfo {
 
   private static final Logger LOG = LoggerFactory.getLogger(ServerInfo.class);
@@ -103,6 +104,14 @@ public class ServerInfo {
     return enabled ? FacesContext.class.getPackage().getImplementationVersion() : null;
   }
 
+  public String getCdiTitle() {
+    return enabled ? NormalScope.class.getPackage().getImplementationTitle() : null;
+  }
+
+  public String getCdiVersion() {
+    return enabled ? NormalScope.class.getPackage().getImplementationVersion() : null;
+  }
+
   public boolean isEnabled() {
     return enabled;
   }
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Version.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Version.java
index c34c34e..b3d6536 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Version.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Version.java
@@ -28,6 +28,19 @@ import javax.inject.Named;
 @ApplicationScoped
 public class Version {
 
+  private static final boolean cdi10 = hasClass("javax.enterprise.context.Conversation");
+  private static final boolean cdi1112 = hasClass("javax.enterprise.context.Destroyed");
+  private static final boolean cdi20 = hasClass("javax.enterprise.context.BeforeDestroyed");
+
+  private static boolean hasClass(String clazz) {
+    try {
+      Class.forName(clazz);
+      return true;
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
+  }
+
   public boolean isVersion20() {
     return FacesVersion.supports20() && !FacesVersion.supports21();
   }
@@ -51,4 +64,16 @@ public class Version {
   public boolean isMyfaces() {
     return FacesVersion.isMyfaces();
   }
+
+  public boolean isCdiVersion10() {
+    return cdi10 && !cdi1112;
+  }
+
+  public boolean isCdiVersion1112() {
+    return cdi1112 && !cdi20;
+  }
+
+  public boolean isCdiVersion20() {
+    return cdi20;
+  }
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/logging-info.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/logging-info.xhtml
index c953408..9b6db75 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/logging-info.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/logging-info.xhtml
@@ -24,7 +24,7 @@
                 xmlns="http://www.w3.org/1999/xhtml">
   <ui:param name="title" value="Logging Info"/>
 
-  <tc:gridLayout rows="auto auto auto 1fr" rendered="#{info.enabled}">
+  <tc:gridLayout rows="auto auto auto 1fr" rendered="#{serverInfo.enabled}">
 
     <tc:in label="Test Category" value="#{universalLoggingInfo.testCategory}"/>
     <tc:button label="Update" action="#{universalLoggingInfo.update}"/>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
index 609ec9c..23dca6d 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/menu.xhtml
@@ -94,14 +94,14 @@
 
           <tc:link label="Info" omit="true">
             <tc:link label="About" omit="true">
-              <tc:dataAttribute name="alert-text" value="Tobago Demo - #{info.version}"/>
+              <tc:dataAttribute name="alert-text" value="Tobago Demo - #{serverInfo.version}"/>
             </tc:link>
             <tc:link omit="true" label="Client Info" id="headerInfo">
               <tc:operation name="show" for=":::info"/>
             </tc:link>
-            <tc:link outcome="/server-info.xhtml" immediate="true" label="Server Info" disabled="#{! info.enabled}"/>
+            <tc:link outcome="/server-info.xhtml" immediate="true" label="Server Info" disabled="#{! serverInfo.enabled}"/>
             <tc:link outcome="/logging-info.xhtml" immediate="true" label="Logging Info"
-                     disabled="#{! info.enabled}"/>
+                     disabled="#{! serverInfo.enabled}"/>
             <tc:separator/>
             <tc:link link="http://myfaces.apache.org/tobago" label="Tobago Home"/>
           </tc:link>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml
index 073ca8d..ee94d08 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/server-info.xhtml
@@ -23,27 +23,31 @@
 
   <ui:param name="title" value="Server Info"/>
 
-  <tc:panel rendered="#{info.enabled}">
+  <tc:panel rendered="#{serverInfo.enabled}">
 
     <tc:section label="Main Properties">
 
-      <tc:in value="#{info.version}" readonly="true" label="Tobago Version"/>
+      <tc:in value="#{serverInfo.version}" readonly="true" label="Tobago Version"/>
 
       <tc:in value="#{manifestReader.buildTime}" readonly="true" label="Tobago Build Time">
         <f:convertDateTime type="both"/>
       </tc:in>
 
-      <tc:in value="#{info.jsfTitle}" readonly="true" label="JSF Implementation"/>
+      <tc:in value="#{serverInfo.jsfTitle}" readonly="true" label="JSF Implementation"/>
 
-      <tc:in value="#{info.jsfVersion}" readonly="true" label="JSF Version"/>
+      <tc:in value="#{serverInfo.jsfVersion}" readonly="true" label="JSF Version"/>
 
-      <tc:in value="#{info.serverInfo}" readonly="true" label="Server Info"/>
+      <tc:in value="#{serverInfo.cdiTitle}" readonly="true" label="CDI Implementation"/>
 
-      <tc:in value="#{info.systemProperties['java.runtime.version']} - #{info.systemProperties['java.vm.vendor']}"
+      <tc:in value="#{serverInfo.cdiVersion}" readonly="true" label="CDI Version"/>
+
+      <tc:in value="#{serverInfo.serverInfo}" readonly="true" label="Server Info"/>
+
+      <tc:in value="#{serverInfo.systemProperties['java.runtime.version']} - #{serverInfo.systemProperties['java.vm.vendor']}"
              readonly="true" label="Java"/>
 
       <tc:in
-          value="#{info.systemProperties['os.name']} - #{info.systemProperties['os.version']} - #{info.systemProperties['os.arch']}"
+          value="#{serverInfo.systemProperties['os.name']} - #{serverInfo.systemProperties['os.version']} - #{serverInfo.systemProperties['os.arch']}"
           readonly="true" label="Operating System"/>
 
       <tc:segmentLayout medium="6seg 6seg" large="4seg 4seg 4seg" extraLarge="3seg 3seg 3seg">
@@ -59,6 +63,12 @@
       </tc:segmentLayout>
 
       <tc:segmentLayout medium="6seg 6seg" large="4seg 4seg 4seg" extraLarge="3seg 3seg 3seg">
+        <tc:selectBooleanCheckbox value="#{version.cdiVersion10}" readonly="true" label="CDI 1.0"/>
+        <tc:selectBooleanCheckbox value="#{version.cdiVersion1112}" readonly="true" label="CDI 1.1 or 1.2"/>
+        <tc:selectBooleanCheckbox value="#{version.cdiVersion20}" readonly="true" label="CDI 2.0"/>
+      </tc:segmentLayout>
+
+      <tc:segmentLayout medium="6seg 6seg" large="4seg 4seg 4seg" extraLarge="3seg 3seg 3seg">
         <tc:selectBooleanCheckbox value="#{facesContext.isProjectStage('Production')}" readonly="true" label="Production"/>
         <tc:selectBooleanCheckbox value="#{facesContext.isProjectStage('Development')}" readonly="true" label="Development"/>
         <tc:selectBooleanCheckbox value="#{facesContext.isProjectStage('SystemTest')}" readonly="true" label="SystemTest"/>
@@ -68,7 +78,7 @@
     </tc:section>
 
     <tc:section label="System Properties">
-      <tc:sheet var="entry" value="#{info.systemPropertiesAsList}" rows="1000">
+      <tc:sheet var="entry" value="#{serverInfo.systemPropertiesAsList}" rows="1000">
         <tc:column label="Key">
           <tc:out value="#{entry.key}" labelLayout="skip"/>
         </tc:column>


[myfaces-tobago] 01/03: TOBAGO-1757: Docker example for demo

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 4a0536151c7796f6cdfcfc9c725bad7cc1a6277f
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Nov 29 13:12:43 2018 +0100

    TOBAGO-1757: Docker example for demo
    
    * copy to clipboard button (fixed for AJAX)
---
 .../src/main/webapp/content/10-intro/20-docker/docker.js         | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
index aa54b92..896696e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/20-docker/docker.js
@@ -15,7 +15,9 @@
  * limitations under the License.
  */
 
-document.addEventListener("DOMContentLoaded", function () {
+Tobago.Docker = {};
+
+Tobago.Docker.init = function () {
 
   /* Copy the command lines to the clipboard.
    */
@@ -38,4 +40,7 @@ document.addEventListener("DOMContentLoaded", function () {
       console.error('Copying text not possible');
     }
   });
-});
+};
+
+Tobago.registerListener(Tobago.Docker.init, Tobago.Phase.DOCUMENT_READY);
+Tobago.registerListener(Tobago.Docker.init, Tobago.Phase.AFTER_UPDATE);