empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rei...@apache.org
Subject svn commit: r1195598 [2/2] - in /incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2: ./ src/ src/main/ src/main/java/ src/main/java/components/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/empire/ src/main/java...
Date Mon, 31 Oct 2011 18:26:51 GMT
Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SamplePhaseListener.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SamplePhaseListener.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SamplePhaseListener.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SamplePhaseListener.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,61 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class SamplePhaseListener implements PhaseListener
+{
+    private static final long serialVersionUID = 1L;
+    final Log                 log              = LogFactory.getLog(SamplePhaseListener.class);
+
+    public PhaseId getPhaseId()
+    {
+        return PhaseId.RESTORE_VIEW;
+    }
+
+    public void beforePhase(PhaseEvent pe)
+    {
+
+        String path = pe.getFacesContext().getExternalContext().getRequestServletPath();
+        if (path.startsWith("/pages/") && path.length() > "/pages".length())
+        {
+            int lastSlash = path.lastIndexOf("/");
+            path = path.substring(lastSlash + 1);
+            path = path.replace(".iface", "");
+            path = path.replace("WithPreview", "");
+            ((SampleSession) FacesUtils.getManagedBean("sampleSession")).setPage(path);
+        }
+        else
+        {
+            ((SampleSession) FacesUtils.getManagedBean("sampleSession")).setPage("loginPage");
+        }
+    }
+
+    public void afterPhase(PhaseEvent pe)
+    {
+
+    }
+
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequest.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequest.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequest.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,157 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web;
+
+import java.sql.Connection;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SampleRequest
+{
+    private static final Logger                  log         = LoggerFactory.getLogger(SampleRequest.class);
+    private static int                           instIdCount = 1000;
+
+    // The HashMap of error objects for the local thread
+    private static final ThreadLocal<SampleRequest> requestMap  = new ThreadLocal<SampleRequest>();
+
+    public static SampleRequest get()
+    {
+        return SampleRequest.requestMap.get();
+    }
+
+    public static final String REQUEST_ATTRIBUTE_NAME = "sampleRequest";
+
+    private ServletRequest     httpRequest;
+    private ServletResponse    httpResponse;
+    private SampleApplication        app                    = null;
+    private Connection         conn                   = null;
+    private boolean            commit                 = true;
+    private int                instId                 = -1;
+
+    SampleRequest(ServletRequest request, ServletResponse response)
+    {
+        this.httpRequest = request;
+        this.httpResponse = response;
+        SampleRequest.requestMap.set(this);
+        // Count instances
+        this.instId = SampleRequest.instIdCount++;
+        if (SampleRequest.log.isDebugEnabled())
+        {
+        	SampleRequest.log.debug("REQUEST {}: Created.", this.instId);
+        }
+    }
+
+    /**
+     * Makes sure, the Request is valid and has not already been disposed!
+     */
+    public void checkDisposed(boolean throwException)
+    {
+        if (this.httpRequest != null)
+        {
+            return;
+        }
+        // Should never happen
+        SampleRequest.log.warn("REQUEST {}: Already disposed!", this.instId);
+        if (throwException)
+        {
+            throw new RuntimeException("FWSRequest has aready been disposed.");
+        }
+    }
+
+    public HttpServletRequest getHttpRequest()
+    {
+        checkDisposed(true);
+        return (HttpServletRequest) this.httpRequest;
+    }
+
+    public HttpServletResponse getHttpResponse()
+    {
+        checkDisposed(true);
+        return (HttpServletResponse) this.httpResponse;
+    }
+
+    public int getId()
+    {
+        return this.instId;
+    }
+
+    public SampleApplication getApplication()
+    {
+        checkDisposed(true);
+        if (this.app == null)
+        {
+            this.app = (SampleApplication) FacesContext.getCurrentInstance().getExternalContext().getApplicationMap()
+            .get("app");
+        }
+        return this.app;
+    }
+
+    Connection getConnection()
+    {
+        checkDisposed(true);
+        if (this.conn == null)
+        {
+            this.conn = getApplication().getPooledConnection();
+        }
+        SampleRequest.log.info("REQUEST {}: connection obtained.", this.instId);
+        return this.conn;
+    }
+
+    public void setFailure(Throwable e)
+    {
+        checkDisposed(true);
+        SampleRequest.log.error("REQUEST " + String.valueOf(this.instId)
+                             + ": failed due to exception. Database operations will be rolled back!", e);
+        this.commit = false;
+    }
+
+    public void dispose()
+    {
+        checkDisposed(true);
+        try
+        {
+            // Dispose
+            if (SampleRequest.log.isDebugEnabled())
+            {
+            	SampleRequest.log.info("REQUEST {}: disposing.", getId());
+            }
+            // Cleanup
+            if (this.conn != null)
+            { // Commit or rollback connection depending on the exit code
+                this.app.releaseConnection(this.conn, this.commit);
+                this.conn = null;
+            }
+            // Count instances
+        }
+        finally
+        {
+        	SampleRequest.requestMap.remove();
+            this.httpRequest = null;
+            this.httpResponse = null;
+        }
+    }
+
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequestFilter.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequestFilter.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleRequestFilter.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,91 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SampleRequestFilter implements Filter
+{
+    private static final Logger log = LoggerFactory.getLogger(SampleRequestFilter.class);
+
+    public void init(FilterConfig filterConfig)
+    throws ServletException
+    {
+        SampleRequestFilter.log.info("SampleRequestFilter.init");
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+    throws IOException, ServletException
+    {
+        // Perform checks (should never fail)
+        // Code may be removed later
+    	SampleRequest check = (SampleRequest) request.getAttribute(SampleRequest.REQUEST_ATTRIBUTE_NAME);
+        if (check != null)
+        { // HttpRequest already has an attribute for FWSRequest
+            SampleRequestFilter.log.error("HttpRequest already has a SampleRequest.");
+            throw new RuntimeException("HttpRequest already has an SampleRequest.");
+        }
+        check = SampleRequest.get();
+        if (check != null)
+        { // Thread already has an attribute for AppRequest
+            SampleRequestFilter.log.error("Thread already has an AppRequest.");
+            throw new RuntimeException("Thread already has an AppRequest.");
+        }
+
+        // Handle request
+        SampleRequest appRequest = new SampleRequest(request, response);
+        try
+        {
+            request.setAttribute(SampleRequest.REQUEST_ATTRIBUTE_NAME, appRequest);
+            if (SampleRequestFilter.log.isDebugEnabled())
+            {
+                SampleRequestFilter.log.debug("Serving request {}.", appRequest.getId());
+            }
+            // Process chain
+            chain.doFilter(request, response);
+        }
+        catch (Throwable e)
+        {
+            appRequest.setFailure(e);
+            // Forward exception
+            throw new RuntimeException(e);
+        }
+        finally
+        {
+            // Dispose
+            request.removeAttribute(SampleRequest.REQUEST_ATTRIBUTE_NAME);
+            appRequest.dispose();
+        }
+    }
+
+    public void destroy()
+    {
+        SampleRequestFilter.log.info("SampleRequestFilter.destroy");
+    }
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleSession.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleSession.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleSession.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleSession.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,79 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ManagedBean
+@SessionScoped
+public class SampleSession implements Serializable
+{
+    /**
+     * Comment for <code>serialVersionUID</code>
+     */
+    private static final long   serialVersionUID   = 72284452358425878L;
+
+    private static final Logger log                = LoggerFactory.getLogger(SampleSession.class);
+
+    private SampleUser user;
+
+	private String              page               = "loginPage";
+
+    private Throwable           rootCause;
+
+    public SampleSession()
+    {
+    	SampleSession.log.info("SESSION: created.");
+    }
+
+    public void setPage(String page)
+    {
+        this.page = page;
+    }
+
+    public String getPage()
+    {
+        return this.page;
+    }
+
+    public void setError(Throwable rootCause)
+    {
+        this.rootCause = rootCause;
+    }
+
+    public Throwable getError()
+    {
+        return this.rootCause;
+    }
+
+    public SampleUser getUser() {
+		return user;
+	}
+
+	public void setUser(SampleUser user) {
+		this.user = user;
+	}
+
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleUser.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleUser.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleUser.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/SampleUser.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web;
+
+public class SampleUser
+{
+    private String userName;
+    private String password;
+    
+    public SampleUser(String userName, String password)
+    {
+        this.userName = userName;
+        this.password = password;
+    }
+    
+    public String getPassword()
+    {
+        return password;
+    }
+    public String getUserName()
+    {
+        return userName;
+    }
+    
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearch.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearch.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearch.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearch.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,67 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.objects;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean
+@SessionScoped
+public class EmployeeSearch implements Serializable {
+	private static final long serialVersionUID = 1291348787217293255L;
+
+	private Integer employeeId;
+	private String firstName;
+	private String lastName;
+	private Integer departmentId;
+
+	public Integer getEmployeeId() {
+		return employeeId;
+	}
+
+	public void setEmployeeId(Integer employeeId) {
+		this.employeeId = employeeId;
+	}
+
+	public Integer getDepartmentId() {
+		return departmentId;
+	}
+
+	public void setDepartmentId(Integer departmentId) {
+		this.departmentId = departmentId;
+	}
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/User.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/User.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/User.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/User.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,51 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.objects;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class User implements Serializable
+{
+	private static final long serialVersionUID = -3099402366604009203L;
+
+    private String name;
+	
+    private String password;
+    public String getName()
+    {
+        return name;
+    }
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    public String getPassword()
+    {
+        return password;
+    }
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeDetailPage.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeDetailPage.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeDetailPage.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeDetailPage.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,91 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.apache.empire.jsf2.websample.db.SampleDB;
+import org.apache.empire.jsf2.websample.db.records.EmployeeRecord;
+import org.apache.empire.jsf2.websample.web.FacesUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ManagedBean
+@ViewScoped
+public class EmployeeDetailPage extends Page implements Serializable {
+	// Logger
+	private static final Logger log = LoggerFactory
+			.getLogger(EmployeeDetailPage.class);
+
+	private EmployeeRecord employeeRecord;
+
+	public EmployeeRecord getEmployeeRecord() {
+		return employeeRecord;
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 7880544317192692309L;
+
+	public String save() {
+		try {
+			employeeRecord.update(FacesUtils.getConnection());
+		} catch (Exception e) {
+			FacesUtils.addErrorMessage(e.getMessage());
+			return "";
+		}
+		return new EmployeeListPage().name();
+	}
+
+	public String delete() {
+		try {
+			employeeRecord.delete(FacesUtils.getConnection());
+		} catch (Exception e) {
+			FacesUtils.addErrorMessage(e.getMessage());
+		}
+		return new EmployeeListPage().name();
+	}
+
+	public String cancel() {
+		return new EmployeeListPage().name();
+	}
+
+	@Override
+	public void preRenderViewAction() {
+		if (employeeRecord == null) {
+			employeeRecord = new EmployeeRecord();
+			SampleDB sampleDB = FacesUtils.getDatabase();
+			String id = FacesUtils.getHttpRequest().getParameter("id");
+			if (id != null) {
+				try {
+					employeeRecord.read(sampleDB.T_EMPLOYEES,
+							new String[] { id }, FacesUtils.getConnection());
+				} catch (Exception e) {
+					FacesUtils.addErrorMessage(e.getMessage());
+				}
+			} else {
+				employeeRecord.create(sampleDB.T_EMPLOYEES);
+			}
+		}
+	}
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeListPage.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeListPage.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeListPage.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeListPage.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,142 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.apache.empire.commons.StringUtils;
+import org.apache.empire.db.DBColumnExpr;
+import org.apache.empire.db.DBCommand;
+import org.apache.empire.db.DBReader;
+import org.apache.empire.jsf2.websample.db.SampleDB;
+import org.apache.empire.jsf2.websample.web.FacesUtils;
+import org.apache.empire.jsf2.websample.web.objects.EmployeeSearch;
+
+@ManagedBean
+@ViewScoped
+public class EmployeeListPage extends Page implements Serializable {
+	private static final long serialVersionUID = 1944555691727940966L;
+
+	private List<EmployeeListItem> employeeList;
+
+	public List<EmployeeListItem> getEmployeeList() {
+		return employeeList;
+	}
+
+	public static class EmployeeListItem {
+		private int employeeId;
+		private String name;
+		private String gender;
+		private Date dateOfBirth;
+		private String department;
+
+		public int getEmployeeId() {
+			return employeeId;
+		}
+
+		public void setEmployeeId(int employeeId) {
+			this.employeeId = employeeId;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+		public String getGender() {
+			return gender;
+		}
+
+		public void setGender(String gender) {
+			this.gender = gender;
+		}
+
+		public Date getDateOfBirth() {
+			return dateOfBirth;
+		}
+
+		public void setDateOfBirth(Date dateOfBirth) {
+			this.dateOfBirth = dateOfBirth;
+		}
+
+		public String getDepartment() {
+			return department;
+		}
+
+		public void setDepartment(String department) {
+			this.department = department;
+		}
+	}
+
+	public EmployeeListPage() {
+	}
+
+	@Override
+	public void preRenderViewAction() {
+		SampleDB sampleDB = FacesUtils.getDatabase();
+
+		DBColumnExpr C_FULL_NAME = sampleDB.T_EMPLOYEES.C_LAST_NAME.append(", ")
+				.append(sampleDB.T_EMPLOYEES.C_FIRST_NAME).as("NAME");
+		DBColumnExpr C_DEPARTMENT = sampleDB.T_DEPARTMENTS.C_NAME
+				.as("DEPARTMENT");
+		// lade Liste aus der Datenbank
+
+		SampleDB.Employees EMP = sampleDB.T_EMPLOYEES;
+		SampleDB.Departments DEP = sampleDB.T_DEPARTMENTS;
+
+		DBCommand cmd = sampleDB.createCommand();
+		cmd.select(EMP.C_EMPLOYEE_ID);
+		cmd.select(C_FULL_NAME, EMP.C_GENDER, EMP.C_DATE_OF_BIRTH);
+		cmd.select(C_DEPARTMENT);
+		cmd.join(DEP.C_DEPARTMENT_ID, EMP.C_DEPARTMENT_ID);
+
+		// Set filter constraints
+		EmployeeSearch employeeSearch = (EmployeeSearch) FacesUtils
+				.getManagedBean(EmployeeSearch.class);
+		if (employeeSearch.getDepartmentId() != null)
+			cmd.where(EMP.C_DEPARTMENT_ID.is(employeeSearch.getDepartmentId()));
+		if (StringUtils.isValid(employeeSearch.getFirstName()))
+			cmd.where(EMP.C_FIRST_NAME.likeUpper(
+					employeeSearch.getFirstName() + "%").or(
+					EMP.C_FIRST_NAME.is(null)));
+		if (StringUtils.isValid(employeeSearch.getLastName()))
+			cmd.where(EMP.C_LAST_NAME.likeUpper(employeeSearch.getLastName()
+					+ "%"));
+
+		cmd.orderBy(EMP.C_LAST_NAME);
+		cmd.orderBy(EMP.C_FIRST_NAME);
+
+		// set DataTable
+		DBReader reader = new DBReader();
+		try {
+			reader.open(cmd, FacesUtils.getConnection());
+			employeeList = reader.getBeanList(EmployeeListItem.class);
+		} finally {
+			reader.close();
+		}
+	}
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeSearchPage.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeSearchPage.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeSearchPage.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/EmployeeSearchPage.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,35 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class EmployeeSearchPage extends Page implements Serializable
+{
+	public String search()
+	{
+		
+		return new EmployeeListPage().name();
+	}
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/ErrorPage.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/ErrorPage.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/ErrorPage.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/ErrorPage.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,79 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean(name = "error")
+@ViewScoped
+public class ErrorPage extends Page implements Serializable
+{
+    private boolean showDetails = false;
+
+    public boolean isShowDetails()
+    {
+        return this.showDetails;
+    }
+
+    public void setShowDetails(boolean showDetails)
+    {
+        this.showDetails = showDetails;
+    }
+
+    public void toggleShowDetails()
+    {
+        this.showDetails = !this.showDetails;
+    }
+
+    public String getMessage()
+    {
+        if (getSampleSession().getError() != null)
+        {
+            return getSampleSession().getError().getMessage();
+        }
+        return "NULL";
+    }
+
+    public String getType()
+    {
+        if (getSampleSession().getError() != null)
+        {
+            return getSampleSession().getError().getClass().getName();
+        }
+        return "NULL";
+    }
+
+    public List<String> getTrace()
+    {
+        List<String> trace = new ArrayList<String>();
+        if (getSampleSession().getError() != null && getSampleSession().getError().getStackTrace() != null)
+        {
+            for (StackTraceElement element : getSampleSession().getError().getStackTrace())
+            {
+                trace.add(element.toString());
+            }
+        }
+        return trace;
+    }
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/LoginPage.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/LoginPage.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/LoginPage.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/LoginPage.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,48 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.apache.empire.jsf2.websample.web.FacesUtils;
+import org.apache.empire.jsf2.websample.web.SampleUser;
+import org.apache.empire.jsf2.websample.web.objects.User;
+
+@ManagedBean
+@ViewScoped
+public class LoginPage extends Page implements Serializable
+{
+	public String logout()
+	{
+        return new LoginPage().name();		
+	}
+	
+	public String login()
+	{
+		User user = (User)FacesUtils.getManagedBean(User.class);
+
+		// Erzeuge Session User Objekt und setze es in der Session
+		SampleUser sampleUser = new SampleUser(user.getName(), user.getPassword());
+		
+		return new EmployeeSearchPage().name();
+	}
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/Page.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/Page.java?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/Page.java (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/pages/Page.java Mon Oct 31 18:26:48 2011
@@ -0,0 +1,56 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+package org.apache.empire.jsf2.websample.web.pages;
+
+import org.apache.empire.jsf2.websample.web.FacesUtils;
+import org.apache.empire.jsf2.websample.web.SampleSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class Page
+{
+    private static final Logger log = LoggerFactory.getLogger(Page.class);
+
+    protected String name()
+    {
+        String name = this.getClass().getSimpleName();
+        name = name.substring(0, 1).toLowerCase() + name.substring(1);
+        Page.log.info("Showing page {}.", name);
+        return name;
+    }
+    
+    public void preRenderViewAction()
+    {    	
+    }
+
+    public String doInit()
+    {
+        return name();
+    }
+
+    public SampleSession getSampleSession()
+    {
+        return FacesUtils.getSampleSession();
+    }
+
+    public void listen() {
+        Page.log.warn("A page's listen method has been called without handling anything.");
+    }
+
+}

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties Mon Oct 31 18:26:48 2011
@@ -0,0 +1,132 @@
+# 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.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, 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.
+
+# fields
+EMPLOYEES.EMPLOYEE_ID=Mitarbeiter ID
+EMPLOYEES.SALUTATION=Anrede
+EMPLOYEES.FIRST_NAME=Vorname
+EMPLOYEES.LAST_NAME=Nachname
+EMPLOYEES.DATE_OF_BIRTH=Geburtsdatum
+EMPLOYEES.DEPARTMENT_ID=Abteilung
+EMPLOYEES.GENDER=Geschlecht
+EMPLOYEES.PHONE=Telefon
+EMPLOYEES.EMAIL=Email
+EMPLOYEES.RETIRED=im Ruhestand
+EMPLOYEES.UPDATE_TIMESTAMP=Letzte Änderung
+
+#options
+option.employee.gender.male=Männlich
+option.employee.gender.female=Weiblich
+
+#application
+application_title = Mitarbeiterverwaltungsanwendung
+application_todo = Noch zu implementieren
+application_logout = Abmelden
+
+#pages
+login_title = Anmeldung
+login_login = anmelden
+login_field_name = Benutzername
+login_field_password = Passwort
+
+employeeSearch_title = Mitarbeitersuche
+employeeSearch_field_employeeId = Mitarbeiter ID
+employeeSearch_field_firstName = Vorname
+employeeSearch_field_lastName = Nachname
+employeeSearch_field_departmentId = Abteilung
+employeeSearch_search = Suchen
+
+employeeList_title = Mitarbeiterübersicht
+employeeList_create = Neuen Mitarbeiter erstellen
+employeeList_field_employeeId = ID
+employeeList_field_name = Name
+employeeList_field_gender = Geschlecht
+employeeList_field_dateOfBirth = Geburtsdatum
+employeeList_field_department = Abteilung
+employeeList_search = Suchen
+
+employeeDetail_title = Mitarbeiterdetails
+employeeDetail_save = Speichern
+employeeDetail_cancel = Abbrechen
+employeeDetail_delete = Löschen
+employeeDetail_field_employeeId = Mitarbeiter ID
+employeeDetail_field_salutation = Anrede
+employeeDetail_field_firstName = Vorname
+employeeDetail_field_lastName = Nachname
+employeeDetail_field_gender = Geschlecht
+employeeDetail_field_dateOfBirth = Geburtstag
+employeeDetail_field_phone = Telefon
+employeeDetail_field_email = Emailadresse
+employeeDetail_field_department = Abteilung
+employeeDetail_field_retired = im Ruhestand
+employeeDetail_field_updateTimestamp = Letzte Änderung
+
+## Old stuff
+
+#labels
+application.title=Mitarbeiterverwaltung (Empire-db)
+label.employees=Mitarbeiterliste
+label.employees.beanList=Mitarbeiterliste (Bean-Liste)
+label.employees.reader=Mitarbeiterliste (DBReader)
+label.delete=Löschen
+label.edit=Bearbeiten
+label.employee.edit=Eintrag bearbeiten
+label.employee.add=Eintrag hinzufügen
+label.name=Name
+label.gender=Geschlecht
+label.age=Alter
+label.department=Abteilung
+label.user.Name=Name
+label.user.Pwd=Passwort
+
+page.label.login=Anmelden
+page.label.loginHint=Hinweis: Geben Sie einen beliebigen Benutzernamen und Kennwort an.
+page.label.logininfo=Sie sind angemeldet als:
+page.label.search=Mitarbeiter suchen
+page.label.list=Mitarbeiter auswählen
+page.label.update=Mitarbeiter bearbeiten
+page.label.add=Mitarbeiter hinzufügen
+
+#button labels
+button.label.login=Anmelden
+button.label.search=Suchen...
+button.label.save=Speichern
+button.label.cancel=Abbrechen
+button.label.delete=Löschen
+
+#link labels
+link.label.addemployee=Neuen Eintrag anlegen
+link.label.edit=Bearbeiten
+link.label.delete=Löschen
+link.label.logout=Logout
+link.label.search=Suchen
+
+##-- errors
+errors.prefix=<span style="color:red;font-weight:bold;">
+errors.suffix=</span>
+
+error.invalidpassword=Der eingegebene Benutzername ist ungültig (Es ist mindestens ein Zeichen erforderlich!)
+error.web.recordsDontMatch=The form submitted is invalid for the current context.
+error.web.columnNotFound=Die Spalte {0} wurde nicht gefunden!
+error.web.fieldError=Feld {0}: {1}
+error.web.input.integerFormat=Ungültiges Zahlenformat
+error.web.input.numberFormat=Ungültiges Zahlenformat
+error.web.input.dateFormat=Ungültiges Datumsformat
+error.web.input.date.notime=Es wurde keine Zeit angegeben
+error.web.input.required=Das Feld ist eingabepflichtig 
+error.web.input.outOfRange=Der Wert muss zwischen {0} und {1} liegen.
+error.web.input.textTooShort=Der Wert muss mindestens {0} Zeichen enthalten. 

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties Mon Oct 31 18:26:48 2011
@@ -0,0 +1,119 @@
+# 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.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, 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.
+
+# fields
+EMPLOYEES.EMPLOYEE_ID=Employee ID
+EMPLOYEES.SALUTATION=Salutation
+EMPLOYEES.FIRST_NAME=Firstname
+EMPLOYEES.LAST_NAME=Lastname
+EMPLOYEES.DATE_OF_BIRTH=Date of Birth
+EMPLOYEES.DEPARTMENT_ID=Department
+EMPLOYEES.GENDER=Gender
+EMPLOYEES.PHONE=Phone
+EMPLOYEES.EMAIL=Email
+EMPLOYEES.RETIRED=Retired
+EMPLOYEES.UPDATE_TIMESTAMP=Last change
+
+#options
+option.employee.gender.male=Male
+option.employee.gender.female=Female
+
+
+#application
+application_title = Employee Management Application
+application_todo = To do...
+application_logout = Logout
+
+#pages
+login_title = Login
+login_login = login
+login_field_name = User name
+login_field_password = Password
+
+employeeSearch_title = Search employee
+employeeSearch_search = Search
+employeeSearch_field_employeeId = Employee ID
+employeeSearch_field_firstName = First name
+employeeSearch_field_lastName = Last name
+employeeSearch_field_departmentId = Department
+
+employeeList_title = Employee List
+employeeList_create = Create employee
+employeeList_field_employeeId = ID
+employeeList_field_name = Name
+employeeList_field_gender = Gender
+employeeList_field_dateOfBirth = Date of Birth
+employeeList_field_department = Department
+employeeList_search = Search
+
+employeeDetail_title = Employee Detail
+employeeDetail_save = Save
+employeeDetail_cancel = Cancel
+employeeDetail_delete = Delete
+
+# Old stuff
+
+#labels
+application.title=Employee Management Application
+label.employees=List of employees
+label.employees.beanList=Employees (Bean-List)
+label.employees.reader=Employees (DBReader)
+label.delete=Delete
+label.edit=Edit
+label.employee.edit=Employee details
+label.employee.add=Add employee
+label.department=Department
+label.user.Name=Name
+label.user.Pwd=Password
+
+page.label.login=Login
+page.label.loginHint=Hint: enter any non null username and password.
+page.label.logininfo=You are logged in as:
+page.label.search=Search employee
+page.label.list=Select employee
+page.label.update=Edit employee details
+page.label.add=Add new employee
+
+#button labels
+button.label.login=Login
+button.label.search=Search
+button.label.save=Save
+button.label.cancel=Cancel
+button.label.delete=Delete
+
+#link labels
+link.label.addemployee=Add new employee
+link.label.edit=Edit
+link.label.delete=Delete
+link.label.logout=Logout
+link.label.search=Search
+
+##-- errors
+errors.prefix=<span style="color:red;font-weight:bold;">
+errors.suffix=</span>
+
+error.invalidpassword=The username is invalid (At least one character is required!)
+error.web.recordsDontMatch=The form submitted is invalid for the current context.
+error.web.columnNotFound=The column {0} has not been found!
+error.web.fieldError=Field {0}: {1}
+error.web.input.integerFormat=Invalid Integer format
+error.web.input.numberFormat=Invalid number format
+error.web.input.dateFormat=Invalid date format
+error.web.input.date.notime=No time specified.
+error.web.input.required=This field is required 
+error.web.input.outOfRange=The value must be in the range of {0} and {1}.
+error.web.input.textTooShort=The value must contain at least {0} characters. 

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/config.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/config.xml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/config.xml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/config.xml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,122 @@
+<?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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<config>
+
+	<properties>
+		<!-- provider name must match the property-section containing the connection data -->
+		<databaseProvider>hsqldb</databaseProvider>
+	</properties>
+
+	<properties-hsqldb>
+		<!-- JDBC properties for a HSQLDB Database connection -->
+		<!-- Required jar file: hsqldb.jar -->
+		<jdbcClass>org.hsqldb.jdbcDriver</jdbcClass>
+		<jdbcURL>jdbc:hsqldb:file:hsqldb/sample;shutdown=true</jdbcURL>
+		<jdbcUser>sa</jdbcUser>
+		<jdbcPwd></jdbcPwd>
+		<schemaName>DBSAMPLE</schemaName>
+	</properties-hsqldb>
+
+	<properties-mysql>
+		<!-- JDBC properties for a MySQL Database connection -->
+		<!-- Required jar file: mysql-connector-java-5.1.6-bin.jar -->
+		<jdbcClass>com.mysql.jdbc.Driver</jdbcClass>
+		<jdbcURL>jdbc:mysql://localhost</jdbcURL>
+		<jdbcUser>root</jdbcUser>
+		<jdbcPwd>empire-db</jdbcPwd>
+		<schemaName>DBSAMPLE</schemaName>
+	</properties-mysql>
+
+	<properties-oracle>
+		<!-- JDBC properties for an Oracle Database connection -->
+		<!-- Required jar file: ojdbc14.jar -->
+		<jdbcClass>oracle.jdbc.driver.OracleDriver</jdbcClass>
+		<jdbcURL>jdbc:oracle:thin:@192.168.0.2:1521:ora10</jdbcURL>
+		<jdbcUser>DBSAMPLE</jdbcUser>
+		<jdbcPwd>DBSAMPLE</jdbcPwd>
+		<schemaName>DBSAMPLE</schemaName>
+	</properties-oracle>
+
+	<properties-sqlserver>
+		<!-- JDBC properties for a Microsoft SQL-Server Database connection -->
+		<!-- Required jar file: sqljdbc.jar -->
+		<jdbcClass>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbcClass>
+		<jdbcURL>jdbc:sqlserver://192.168.0.2:1433</jdbcURL>
+		<jdbcUser>sa</jdbcUser>
+		<jdbcPwd>empire-db</jdbcPwd>
+		<schemaName>DBSAMPLE</schemaName>
+	</properties-sqlserver>
+	
+	<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+		<appender name="default" class="org.apache.log4j.ConsoleAppender">
+			<!-- layout class="org.apache.log4j.TTCCLayout"/ -->
+			<layout class="org.apache.log4j.PatternLayout">
+				<!-- param name="ConversionPattern" value="NSB(%c) %-5p %m	at %l%n"/ -->
+				<param name="ConversionPattern" value="%-5p [%d{yyyy/MM/dd HH:mm}]: %m		at %l %n" />
+			</layout>
+		</appender>
+
+		<!-- log detail configuration -->
+
+		<logger name="org.apache.myfaces" additivity="false">
+			<level value="info" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<logger name="org.apache.empire.xml" additivity="false">
+			<level value="info" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<logger name="org.apache.empire.commons" additivity="false">
+			<level value="warn" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<logger name="org.apache.empire.db" additivity="false">
+			<level value="warn" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<!-- Set this level to "debug" to log all SQL-Statements -->
+		<logger name="org.apache.empire.db.DBDatabase" additivity="false">
+			<level value="debug" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<logger name="de.volkswagen.fws" additivity="false">
+			<level value="debug" />
+			<appender-ref ref="default" />	
+		</logger>
+		
+		<logger name="de.volkswagen.fws.webapp" additivity="false">
+			<level value="info" />
+			<appender-ref ref="default" />
+		</logger>
+
+		<root>
+			<priority value="info" />
+			<appender-ref ref="default" />
+		</root>
+
+	</log4j:configuration>
+
+</config>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,35 @@
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<ice:panelGroup id="header" xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:f="http://java.sun.com/jsf/core">
+
+	<!-- title & logo line -->
+	<ice:panelGroup id="titleLogoLine">	
+		
+		<!-- title box -->
+		<ice:panelGroup id="titleBox">	
+			<h1>
+				<ice:outputText value="#{msg.application_title} - #{pageTitle}" />
+			</h1>
+		</ice:panelGroup>
+
+	</ice:panelGroup>
+
+</ice:panelGroup>
\ No newline at end of file

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:ice="http://www.icesoft.com/icefaces/component">
+
+<!-- internationalization -->
+<ice:loadBundle basename="lang.messages" var="msg" />
+
+<!-- Prerender event used to init page, e.g. for loading data from db -->
+<f:metadata>
+  <f:event type="preRenderView" listener="#{page.preRenderViewAction}"/>
+</f:metadata>
+
+<h:head>
+
+	<!-- dynamic page title -->
+	<title>#{msg.application_title} - #{pageTitle}</title>
+
+	<!-- meta information -->
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta http-equiv="Content-Language" content="en" />
+	<meta http-equiv="imagetoolbar" content="no" />
+	<meta name="keywords" content="" />
+	<meta name="description" content="" />
+
+	<!-- global stylesheets -->
+    <link rel="stylesheet" type="text/css" href="../xmlhttp/css/rime/rime.css"/>
+<!-- 
+	<link href="../css/sample.css" rel="stylesheet" media="all"
+		type="text/css" />
+ -->
+	<!-- custom page stylesheets -->
+	<ui:insert name="pageCss" />
+
+	<!-- javascript -->
+
+	<!-- custom page script -->
+	<ui:insert name="pageScript" />
+</h:head>
+
+<h:body>
+
+	<!-- header -->
+	<ui:include src="header.xhtml" />
+
+	<!-- (error) messages -->
+	<ice:messages />
+	
+	<!-- content -->
+	<ice:panelGroup id="content" styleClass="#{contentStyle}">
+		<ui:insert name="content" />
+	</ice:panelGroup>
+
+	<!-- content footer -->
+	<ice:panelGroup id="contentFooter" rendered="#{contentFooter}">
+		<ui:insert name="contentFooter" />
+	</ice:panelGroup>
+
+</h:body>
+</html>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/faces-config.xml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/faces-config.xml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,38 @@
+<?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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+	version="2.0">
+	<application>
+		<locale-config>
+			<default-locale>en</default-locale>
+			<supported-locale>en</supported-locale>
+			<supported-locale>de</supported-locale>
+		</locale-config>
+		<message-bundle>lang.messages</message-bundle>
+		<navigation-handler>org.apache.empire.jsf2.websample.web.SampleNavigationHandler</navigation-handler>
+		<el-resolver>org.apache.empire.jsf2.websample.web.PageELResolver</el-resolver>
+	</application>
+
+	<lifecycle>
+		<phase-listener>org.apache.empire.jsf2.websample.web.SamplePhaseListener</phase-listener>
+	</lifecycle>
+</faces-config>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/web.xml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/web.xml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,67 @@
+<?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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+	id="JSF2Sample" version="2.5">
+    <display-name>Empire DBWebSample</display-name>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+	<servlet>
+		<servlet-name>Faces Servlet</servlet-name>
+		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>Faces Servlet</servlet-name>
+		<url-pattern>*.iface</url-pattern>
+		<url-pattern>*.xhtml</url-pattern>
+	    <url-pattern>*.jsf</url-pattern>
+		<url-pattern>/icefaces/*</url-pattern>
+	</servlet-mapping>
+	 <servlet>
+	   <servlet-name>Resource Servlet</servlet-name>
+	   <servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
+	   <load-on-startup>1</load-on-startup>
+	 </servlet>
+	 <servlet-mapping>
+	   <servlet-name>Resource Servlet</servlet-name>
+	   <url-pattern>/xmlhttp/*</url-pattern>
+	 </servlet-mapping>
+	<filter>
+		<filter-name>Sample Request Filter</filter-name>
+		<filter-class>org.apache.empire.jsf2.websample.web.SampleRequestFilter</filter-class>
+	</filter>
+	<filter-mapping>
+		<filter-name>Sample Request Filter</filter-name>
+		<servlet-name>Faces Servlet</servlet-name>
+	</filter-mapping>
+	<listener>
+		<listener-class>org.apache.empire.jsf2.websample.web.SampleEventListener</listener-class>
+	</listener>
+
+	<context-param>
+		<param-name>javax.faces.PROJECT_STAGE</param-name>
+		<param-value>Development</param-value>
+	</context-param>
+
+</web-app>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/sample.css
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/sample.css?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/sample.css (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/sample.css Mon Oct 31 18:26:48 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+html, body  {
+    margin-left: 10px;
+    margin-right: 10px;
+    margin-bottom: 5px;
+    color: black;
+    background-color: white;
+    font-family: Verdana, Arial, sans-serif;
+    font-size:12px;
+}
+.titleDiv {
+    background-color: #EFFBEF;
+    font-weight:bold;
+    font-size:18px;
+    text-align:left;
+    padding-left:10px;
+    padding-top:10px;
+    padding-bottom:10px;
+    border:2px solid #8F99EF;
+}
+h1 { font-weight:bold; color: brown; font-size:15px; text-align:left;}
+
+td { font-size:12px; padding-right:10px; }
+th { text-align:left; font-weight:bold; font-size:13px; padding-right:10px; }
+.tdLabel { font-weight: bold; white-space:nowrap; vertical-align:top;}
+
+A { color:#4A825A; text-decoration:none;}
+A:link { text-decoration:none;}
+A:visited { text-decoration:none;}
+A:hover { text-decoration:none; color: red;}
+
+.borderAll {
+    border: 2px solid #8F99EF;
+}
+
+.butStnd {
+    font-family:arial,sans-serif;
+    font-size:11px;
+    width:105px;
+    background-color:#DCDFFA ;color:#4A825A;font-weight:bold;
+}
+
+.error {
+    color: red;
+    font-weight: bold;
+}
+.errorSection {
+    padding-left:18px;
+    padding-top:2px;
+    padding-bottom:10px;
+    padding-right:5px;
+}
+
+.even { background-color: #EFFBEF; }
+.odd { background-color: white; }
+
+.nowrap { white-space:nowrap; }

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/index.html?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/index.html (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/index.html Mon Oct 31 18:26:48 2011
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<html>
+<head>
+<title>Redirecting</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<META HTTP-EQUIV="Refresh" CONTENT="0; URL=pages/loginPage.iface">
+</head>
+<body>
+
+</body>
+</html>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,61 @@
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<ui:composition template="/WEB-INF/facelets/templates/layout.xhtml"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:e="http://java.sun.com/jsf/composite/components"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:ace="http://www.icefaces.org/icefaces/components"
+	xmlns:h="http://java.sun.com/jsf/html">
+
+	<!-- parameter for page title-->
+	<ui:param name="pageTitle" value="#{msg.employeeDetail_title}" />
+	<ui:param name="contentFooter" value="true" />
+	<ui:param name="contentStyle" value="unstyled" />
+
+	<!-- content -->
+	<ui:define name="content">
+		<ice:form id="employeeDetail">
+			<ice:panelGrid id="panel" columns="1" border="0">
+				<e:record value="#{page.employeeRecord}">
+					<e:control column="EMPLOYEE_ID" />
+					<e:control column="SALUTATION" />
+					<e:control column="FIRST_NAME" />
+					<e:control column="LAST_NAME" />
+					<e:control column="DATE_OF_BIRTH" />
+					<e:control column="DEPARTMENT_ID" />
+					<e:control column="GENDER" />
+					<e:control column="PHONE" />
+					<e:control column="EMAIL" />
+					<e:control column="RETIRED" />
+					<e:control column="UPDATE_TIMESTAMP" readonly="true" />
+				</e:record>
+				<ice:panelGroup>
+					<ice:commandButton value="#{msg.employeeDetail_save}"
+						action="#{page.save}" />
+					<ice:commandButton value="#{msg.employeeDetail_cancel}"
+						immediate="true" action="#{page.cancel}" />
+					<ice:commandButton value="#{msg.employeeDetail_delete}"
+						immediate="true" action="#{page.delete}" />
+				</ice:panelGroup>
+			</ice:panelGrid>
+		</ice:form>
+	</ui:define>
+</ui:composition>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,71 @@
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<ui:composition template="/WEB-INF/facelets/templates/layout.xhtml"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:ace="http://www.icefaces.org/icefaces/components"
+	xmlns:h="http://java.sun.com/jsf/html">
+
+	<!-- parameter for page title-->
+	<ui:param name="pageTitle" value="#{msg.employeeList_title}" />
+	<ui:param name="contentFooter" value="true" />
+	<ui:param name="contentStyle" value="unstyled" />
+
+	<!-- content -->
+	<ui:define name="content">
+		<h:link outcome="employeeDetailPage" value="#{msg.employeeList_create}" />		
+		<ice:dataTable value="#{page.employeeList}" var="item">
+			<h:column>
+				<f:facet name="header">
+					<ice:outputText value="#{msg.employeeList_field_employeeId}" />
+				</f:facet>
+				<ice:outputText value="#{item.employeeId}" />
+			</h:column>
+			<h:column>
+				<f:facet name="header">
+					<ice:outputText value="#{msg.employeeList_field_name}" />
+				</f:facet>
+				<h:link outcome="employeeDetailPage" value="#{item.name}">
+					<f:param name="id" value="#{item.employeeId}" />
+				</h:link>
+			</h:column>
+			<h:column>
+				<f:facet name="header">
+					<ice:outputText value="#{msg.employeeList_field_gender}" />
+				</f:facet>
+				<ice:outputText value="#{item.gender}" />
+			</h:column>
+			<h:column>
+				<f:facet name="header">
+					<ice:outputText value="#{msg.employeeList_field_dateOfBirth}" />
+				</f:facet>
+				<ice:outputText value="#{item.dateOfBirth}" />
+			</h:column>
+			<h:column>
+				<f:facet name="header">
+					<ice:outputText value="#{msg.employeeList_field_department}" />
+				</f:facet>
+				<ice:outputText value="#{item.department}" />
+			</h:column>
+		</ice:dataTable>
+		<h:link outcome="employeeSearchPage" value="#{msg.employeeList_search}" />		
+	</ui:define>
+</ui:composition>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeSearchPage.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeSearchPage.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeSearchPage.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeSearchPage.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,54 @@
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<ui:composition
+	template="/WEB-INF/facelets/templates/layout.xhtml"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:ace="http://www.icefaces.org/icefaces/components"
+	xmlns:h="http://java.sun.com/jsf/html">
+
+	<!-- parameter for page title-->
+	<ui:param name="pageTitle" value="#{msg.employeeSearch_title}" />
+	<ui:param name="contentFooter" value="true" />
+	<ui:param name="contentStyle" value="unstyled" />
+
+	<!-- content -->
+	<ui:define name="content">
+		<ice:form id="login">
+			<ice:panelGrid id="panel" columns="2" border="0">
+				<ice:outputLabel for="employeeId" value="#{msg.employeeSearch_field_employeeId}" />
+				<ice:inputText id="employeeId" value="#{employeeSearch.employeeId}" />
+
+				<ice:outputLabel for="firstName" value="#{msg.employeeSearch_field_firstName}" />
+				<ice:inputText id="firstName" value="#{employeeSearch.firstName}" />
+
+				<ice:outputLabel for="lastName" value="#{msg.employeeSearch_field_lastName}" />
+				<ice:inputText id="lastName" value="#{employeeSearch.lastName}" />
+
+				<ice:outputLabel for="departmentId" value="#{msg.employeeSearch_field_departmentId}" />
+				<ice:inputText id="departmentId" value="#{employeeSearch.departmentId}" />
+				
+				<ice:commandButton colspan="2" value="#{msg.employeeSearch_search}" action="#{page.search}" />
+				<ice:commandLink action="#{loginPage.logout}" value="#{msg.application_logout}" />
+			</ice:panelGrid>
+		</ice:form>
+	</ui:define>
+</ui:composition>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,45 @@
+<!-- 
+  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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<ui:composition
+	template="/WEB-INF/facelets/templates/layout.xhtml"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:ace="http://www.icefaces.org/icefaces/components"
+	xmlns:h="http://java.sun.com/jsf/html">
+
+	<!-- parameter for page title-->
+	<ui:param name="pageTitle" value="#{msg.login_title}" />
+	<ui:param name="contentFooter" value="true" />
+	<ui:param name="contentStyle" value="unstyled" />
+
+	<!-- content -->
+	<ui:define name="content">
+		<ice:form id="login">
+			<ice:panelGrid id="panel" columns="2" border="0">
+				<ice:outputLabel for="name" value="#{msg.login_field_name}" />
+				<ice:inputText id="name" value="#{user.name}" />
+				<ice:outputLabel for="name" value="#{msg.login_field_password}" />
+				<ice:inputSecret id="password" value="#{user.password}" />
+				<ice:commandButton value="#{msg.login_login}" action="#{page.login}" />
+			</ice:panelGrid>
+		</ice:form>
+	</ui:define>
+</ui:composition>

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/control.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/control.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/control.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/control.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,34 @@
+<?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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:c="http://java.sun.com/jsp/jstl/core"
+	xmlns:composite="http://java.sun.com/jsf/composite">
+<composite:interface>
+	<composite:attribute name="record" />
+	<composite:attribute name="column" required="true" />	
+	<composite:attribute name="readonly" />	
+</composite:interface>
+<composite:implementation>
+</composite:implementation>
+</html>
\ No newline at end of file

Added: incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/record.xhtml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/record.xhtml?rev=1195598&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/record.xhtml (added)
+++ incubator/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/record.xhtml Mon Oct 31 18:26:48 2011
@@ -0,0 +1,33 @@
+<?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.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, 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.
+ --> 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:c="http://java.sun.com/jsp/jstl/core"
+	xmlns:composite="http://java.sun.com/jsf/composite">
+<composite:interface>
+	<composite:attribute name="value" />
+</composite:interface>
+<composite:implementation>
+	<composite:insertChildren/>
+</composite:implementation>
+</html>
\ No newline at end of file



Mime
View raw message