empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject empire-db git commit: EMPIREDB-235
Date Thu, 28 Jan 2016 13:28:19 GMT
Repository: empire-db
Updated Branches:
  refs/heads/master eef9350d5 -> 1a095b4b4


EMPIREDB-235

Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo
Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/1a095b4b
Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/1a095b4b
Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/1a095b4b

Branch: refs/heads/master
Commit: 1a095b4b44ea1a0f28427823c402a90bdaf5bebd
Parents: eef9350
Author: Rainer Döbele <doebele@apache.org>
Authored: Thu Jan 28 14:28:13 2016 +0100
Committer: Rainer Döbele <doebele@apache.org>
Committed: Thu Jan 28 14:28:13 2016 +0100

----------------------------------------------------------------------
 empire-db-examples/empire-db-example-jsf2/pom.xml     |  2 +-
 .../empire/jsf2/websample/web/SampleApplication.java  |  5 ++---
 .../empire/jsf2/websample/web/SampleConfig.java       | 11 +++++++----
 .../src/main/webapp/css/content.css                   | 14 ++++++++++++++
 .../org/apache/empire/jsf2/app/FacesApplication.java  | 11 +++++++++--
 .../apache/empire/jsf2/app/FacesStartupListener.java  |  9 ++++++++-
 .../empire/jsf2/app/impl/MyFacesImplementation.java   |  7 +++----
 empire-db-spring/.gitignore                           |  1 +
 pom.xml                                               |  8 ++++----
 9 files changed, 49 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-examples/empire-db-example-jsf2/pom.xml
----------------------------------------------------------------------
diff --git a/empire-db-examples/empire-db-example-jsf2/pom.xml b/empire-db-examples/empire-db-example-jsf2/pom.xml
index 0ea81fc..98f1131 100644
--- a/empire-db-examples/empire-db-example-jsf2/pom.xml
+++ b/empire-db-examples/empire-db-example-jsf2/pom.xml
@@ -50,7 +50,7 @@
 		</dependency>
 
 		<!-- Sun Mojarra -->
-		<!-- 		
+		<!-- 
 		<dependency>
 			<groupId>com.sun.faces</groupId>
 			<artifactId>jsf-api</artifactId>

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleApplication.java
----------------------------------------------------------------------
diff --git a/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleApplication.java
b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleApplication.java
index bc13c50..57de916 100644
--- a/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleApplication.java
+++ b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleApplication.java
@@ -92,7 +92,6 @@ public class SampleApplication extends FacesApplication {
 		servletContext.setAttribute("db", sampleDB);
 
 		// Done
-		log.info("Application initialized ");
 	}
 
 	/*
@@ -131,16 +130,16 @@ public class SampleApplication extends FacesApplication {
 		sampleDB = new SampleDB();
 
 		// Open Database (and create if not existing)
-		log.info("*** open database ***");
 		String driverProvider = config.getDatabaseProvider();
 		DBDatabaseDriver driver = getDatabaseDriver(driverProvider);
+        log.info("Opening database '{}' using driver '{}'", sampleDB.getClass().getSimpleName(),
driver.getClass().getSimpleName());
 		Connection conn = null;
 		try {
 			conn = getConnection(sampleDB);
 			sampleDB.open(driver, conn);
 			if (!databaseExists(conn)) {
 				// STEP 4: Create Database
-				log.info("*** create Database ***");
+				log.info("Creating database {}", sampleDB.getClass().getSimpleName());
 				createSampleDatabase(driver, conn);
 			}
 		} finally {

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleConfig.java
----------------------------------------------------------------------
diff --git a/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleConfig.java
b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleConfig.java
index 8fe212c..3ace407 100644
--- a/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleConfig.java
+++ b/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleConfig.java
@@ -57,13 +57,16 @@ public class SampleConfig extends XMLConfiguration
     public boolean init(String filename)
     {
         try
-        {
-            // Read the properties file
+        {   // init
             super.init(filename, false);
-            // Done
-            readProperties(this, "properties");
+            // Init Logging
             if (initLogging() == false)
                 return false;
+            // Read config
+            log.info("*** init Configuration ***");
+            log.info("Config file is '{}'", filename);
+            // Read the properties
+            readProperties(this, "properties");
             readProperties(this, "properties-" + databaseProvider);
         } catch (Exception e)
         {

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
----------------------------------------------------------------------
diff --git a/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css b/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
index 57ba12f..585006e 100644
--- a/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
+++ b/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
@@ -114,3 +114,17 @@ span.eInpDis {
 	padding-left: 4px;
 	font-style: italic;
 }
+div.eTypeBoolFalse {
+	width: 12px;
+	height: 12px;
+	background-image:url('../img/boxes.gif');
+	background-repeat: no-repeat;
+	background-position: 0 0;
+}
+div.eTypeBoolTrue {
+	width: 12px;
+	height: 12px;
+	background-image:url('../img/boxes.gif');
+	background-repeat: no-repeat;
+	background-position: -12px 0;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
----------------------------------------------------------------------
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
index ec0e28f..3a5e759 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesApplication.java
@@ -96,10 +96,11 @@ public abstract class FacesApplication
      */
     public final void init(FacesImplementation facesImpl, FacesContext startupContext)
     {
-        this.facesImpl = facesImpl;
         // Only call once!
-        if (webRoot!=null)
+        if (this.facesImpl!=null || this.webRoot!=null)
             throw new NotSupportedException(this, "init");
+        // set imppl
+        this.facesImpl = facesImpl;
         // webRoot
         ServletContext servletContext = (ServletContext) startupContext.getExternalContext().getContext();
         webRoot = servletContext.getContextPath();
@@ -108,9 +109,14 @@ public abstract class FacesApplication
         // Init
         init(servletContext);
         // text resolvers
+        log.info("*** initTextResolvers() ***");
         ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
         Application app = appFactory.getApplication();
         initTextResolvers(app);
+        // Log info
+        log.info("*** FacesApplication initialization complete ***");
+        log.info("JSF-Implementation is '{}'", facesImpl.getClass().getName());
+        log.info("WebRoot is '{}'", webRoot);
     }
 
     /* Context handling */
@@ -366,6 +372,7 @@ public abstract class FacesApplication
         {
             Locale locale = locales.next();
             textResolvers[i] = new TextResolver(ResourceBundle.getBundle(messageBundle, locale));
+            log.info("added TextResolver for {} bundle='{}'", locale.getLanguage(), messageBundle);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesStartupListener.java
----------------------------------------------------------------------
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesStartupListener.java
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesStartupListener.java
index a9044f3..9c37549 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesStartupListener.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesStartupListener.java
@@ -72,8 +72,14 @@ public class FacesStartupListener implements SystemEventListener
 
     }
 
-    private static FacesImplementation detectFacesImplementation()
+    /**
+     * Detects the JSF Implementation and returns an implmentation handler class.
+     * Supported Implementations are Sun Mojarra (2.2.x) and Apache MyFaces (2.2.x) 
+     * @return
+     */
+    protected FacesImplementation detectFacesImplementation()
     {
+        log.debug("Detecting JSF-Implementation...");
         // Test for Apache MyFaces
         try {
             Class.forName("org.apache.myfaces.application.ApplicationFactoryImpl");
@@ -89,6 +95,7 @@ public class FacesStartupListener implements SystemEventListener
             // It's not Mojarra
         }
         // Not found
+        log.error("JSF-Implementation missing or unknown. Please make sure either Apache
MyFaces or Sun Mojarra implementation is provided");
         throw new UnsupportedOperationException(); 
     }
     

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/impl/MyFacesImplementation.java
----------------------------------------------------------------------
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/impl/MyFacesImplementation.java
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/impl/MyFacesImplementation.java
index bbb2a63..3d00caa 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/impl/MyFacesImplementation.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/impl/MyFacesImplementation.java
@@ -25,11 +25,9 @@ import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
 import org.apache.empire.exceptions.ItemExistsException;
-import org.apache.empire.jsf2.app.FacesApplication;
 import org.apache.empire.jsf2.app.FacesImplementation;
-import org.apache.myfaces.application.ApplicationFactoryImpl;
 import org.apache.myfaces.config.RuntimeConfig;
-import org.apache.myfaces.config.impl.digester.elements.ManagedBean;
+import org.apache.myfaces.config.impl.digester.elements.ManagedBeanImpl;
 
 public class MyFacesImplementation implements FacesImplementation 
 {
@@ -56,7 +54,8 @@ public class MyFacesImplementation implements FacesImplementation
             throw new ItemExistsException(beanName);
         }
         // register now
-        ManagedBean mbi = new ManagedBean(); 
+        // ManagedBean mbi = new ManagedBean();   --> Use this for Myfaces 2.1.x 
+        ManagedBeanImpl mbi = new ManagedBeanImpl();  // new since Myfaces 2.2.x
         mbi.setName(beanName);
         mbi.setBeanClass(beanClass);
         mbi.setScope(scope);

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/empire-db-spring/.gitignore
----------------------------------------------------------------------
diff --git a/empire-db-spring/.gitignore b/empire-db-spring/.gitignore
index ae3c172..5c0bdd6 100644
--- a/empire-db-spring/.gitignore
+++ b/empire-db-spring/.gitignore
@@ -1 +1,2 @@
 /bin/
+/.project

http://git-wip-us.apache.org/repos/asf/empire-db/blob/1a095b4b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 997fb6a..7eb8451 100644
--- a/pom.xml
+++ b/pom.xml
@@ -315,23 +315,23 @@
 			<dependency>
 				<groupId>com.sun.faces</groupId>
 				<artifactId>jsf-api</artifactId>
-				<version>2.1.6</version>
+				<version>2.2.12</version>
 			</dependency>
 			<dependency>
 				<groupId>com.sun.faces</groupId>
 				<artifactId>jsf-impl</artifactId>
-				<version>2.1.6</version>
+				<version>2.2.12</version>
 			</dependency>
 			<!-- Apache MyFaces -->
 			<dependency>
 				<groupId>org.apache.myfaces.core</groupId>
 				<artifactId>myfaces-api</artifactId>
-				<version>2.1.10</version>
+				<version>2.2.8</version>
 			</dependency>
 			<dependency>
 				<groupId>org.apache.myfaces.core</groupId>
 				<artifactId>myfaces-impl</artifactId>
-				<version>2.1.10</version>
+				<version>2.2.8</version>
 			</dependency>
 	        <!-- Misc -->
 			<dependency>


Mime
View raw message