openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r831073 - in /incubator/openwebbeans/trunk/samples/ejb-telephone: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/webbeans/ src/main/java/org/apache/webbeans/telephone/ src/main/java/or...
Date Thu, 29 Oct 2009 19:57:05 GMT
Author: gerdogdu
Date: Thu Oct 29 19:57:03 2009
New Revision: 831073

URL: http://svn.apache.org/viewvc?rev=831073&view=rev
Log:
New EJB sample.

Added:
    incubator/openwebbeans/trunk/samples/ejb-telephone/   (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml   (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml 
 (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml
  (with props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/lib/
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml   (with
props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml   (with
props)
    incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html   (with
props)

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 29 19:57:03 2009
@@ -0,0 +1,4 @@
+target
+.settings
+.classpath
+.project

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml (added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml Thu Oct 29 19:57:03 2009
@@ -0,0 +1,143 @@
+<?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.
+	-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<parent>
+		<artifactId>samples</artifactId>
+		<groupId>org.apache.openwebbeans</groupId>
+		<version>1.0.0-incubating-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.apache.openwebbeans.samples</groupId>
+	<artifactId>ejb-telephone</artifactId>
+	<packaging>war</packaging>
+	<name>Apache OpenWebBeans :: Telephone Ejb Demo On OpenEJB in Tomcat</name>
+	<description>Telephone Ejb Demo</description>
+
+	<build>
+		<finalName>ejb-telephone</finalName>
+		<plugins>
+			<plugin>
+			        <groupId>org.codehaus.mojo</groupId>
+			        <artifactId>tomcat-maven-plugin</artifactId>
+					<configuration>
+                		<url>http://localhost:8080/manager</url>
+        			</configuration>			        
+			</plugin>
+		</plugins>
+		
+	</build>
+
+	<dependencies>
+
+		<!-- JSF Facelet -->
+		<dependency>
+			<groupId>com.sun.facelets</groupId>
+			<artifactId>jsf-facelets</artifactId>
+			<version>1.1.14</version>
+		</dependency>
+
+		<!-- JSR-299 API, provided -->
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-api</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		
+		<!-- JSR-299 Implementation -->
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-impl</artifactId>
+			<version>${project.version}</version>
+		</dependency>		
+		
+		<!-- JSF Plugin -->
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-jsf</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+				
+		<!-- MyFaces API -->
+		<dependency>
+			<groupId>org.apache.myfaces.core</groupId>
+			<artifactId>myfaces-api</artifactId>
+			<version>1.2.7</version>
+		</dependency>
+		
+		<!-- Servlet API -->
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-servlet_2.5_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		
+		<!-- MyFaces IMPL -->
+		<dependency>
+			<groupId>org.apache.myfaces.core</groupId>
+			<artifactId>myfaces-impl</artifactId>
+			<version>1.2.7</version>
+		</dependency>
+		
+		<!-- EJB API -->
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-ejb_3.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+					
+		<!-- EJB PLugin-->	
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-ejb</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		
+		<!-- Resource  PLugin-->	
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-resource</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		
+		<!-- Geronimo  PLugin-->	
+		<dependency>
+			<groupId>org.apache.openwebbeans</groupId>
+			<artifactId>openwebbeans-geronimo</artifactId>
+			<version>${project.version}</version>
+		</dependency>		
+				
+		
+		<!-- Interceptor API -->	
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-interceptor_3.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		
+		<!-- JPA API -->
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_3.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		
+
+	</dependencies>
+
+</project>

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,162 @@
+/*
+ * 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.webbeans.telephone;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.application.FacesMessage;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.webbeans.telephone.ejbs.Telephone;
+import org.apache.webbeans.telephone.entity.Record;
+import org.apache.webbeans.telephone.util.FacesMessageUtil;
+
+@Named("operation")
+@RequestScoped
+public class OperationBean
+{
+    private @Inject Telephone operation;
+    
+    private @Inject FacesMessageUtil messageUtil;
+    
+    private String name;
+    
+    private String surname;
+    
+    private String telephone;
+    
+    private boolean business;
+    
+    private List<Record> records = new ArrayList<Record>();
+    
+    public OperationBean()
+    {
+        
+    }
+    
+    @PostConstruct
+    public void afterConstruct()
+    {
+        System.out.println("After instance creation!");
+    }
+    
+    @PreDestroy
+    public void beforeDestroy()
+    {
+        System.out.println("Before instance destroy!");
+    }
+    
+    public String addRecord()
+    {
+        this.operation.addRecord(name, surname, telephone, business);
+        
+        this.messageUtil.addMessage(FacesMessage.SEVERITY_INFO, "Record added", "Record added");
+        
+        return null;
+    }
+    
+    public String showList()
+    {
+        this.records = this.operation.getRecords();
+        
+        return null;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the surname
+     */
+    public String getSurname()
+    {
+        return surname;
+    }
+
+    /**
+     * @param surname the surname to set
+     */
+    public void setSurname(String surname)
+    {
+        this.surname = surname;
+    }
+
+    /**
+     * @return the telephone
+     */
+    public String getTelephone()
+    {
+        return telephone;
+    }
+
+    /**
+     * @param telephone the telephone to set
+     */
+    public void setTelephone(String telephone)
+    {
+        this.telephone = telephone;
+    }
+
+    /**
+     * @return the business
+     */
+    public boolean isBusiness()
+    {
+        return business;
+    }
+
+    /**
+     * @param business the business to set
+     */
+    public void setBusiness(boolean business)
+    {
+        this.business = business;
+    }
+
+    /**
+     * @return the records
+     */
+    public List<Record> getRecords()
+    {
+        return records;
+    }
+
+    /**
+     * @param records the records to set
+     */
+    public void setRecords(List<Record> records)
+    {
+        this.records = records;
+    }
+    
+    
+}

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/OperationBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,28 @@
+/*
+ * 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.webbeans.telephone.ejbs;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import org.apache.webbeans.telephone.entity.Record;
+
+@Local
+public interface Telephone
+{
+    public Record addRecord(String name, String surname, String telephone, boolean business);
+    
+    public List<Record> getRecords();
+}

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/Telephone.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java
Thu Oct 29 19:57:03 2009
@@ -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.webbeans.telephone.ejbs;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.enterprise.context.Dependent;
+import javax.interceptor.Interceptors;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+import org.apache.webbeans.ejb.interceptor.OpenWebBeansEjbInterceptor;
+import org.apache.webbeans.telephone.entity.Record;
+
+@Stateless
+@Dependent
+@Interceptors(value=OpenWebBeansEjbInterceptor.class)
+public class TelephoneBean implements Telephone
+{
+    private @PersistenceContext(name="pu") EntityManager entityManager; 
+
+    @Override
+    public Record addRecord(String name, String surname, String telephone, boolean business)
+    {
+        Record record = new Record();
+        record.setName(name);
+        record.setSurname(surname);
+        record.setNumber(telephone);
+        record.setBusiness(business);
+        
+        entityManager.persist(record);
+        
+        return record;
+    }
+
+    @Override
+    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
+    @SuppressWarnings("unchecked")
+    public List<Record> getRecords()
+    {
+        Query query = this.entityManager.createQuery("select c from Record c");
+        return  (List<Record>)query.getResultList();
+        
+    }
+    
+}

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/ejbs/TelephoneBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,126 @@
+/*
+ * 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.webbeans.telephone.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Record
+{
+    @Id
+    @GeneratedValue
+    private int id;
+    
+    @Column
+    private String name;
+    
+    @Column
+    private String surname;
+    
+    @Column
+    private String number;
+    
+    @Column
+    private boolean business;
+
+    public Record()
+    {
+        
+    }
+
+    /**
+     * @return the id
+     */
+    public int getId()
+    {
+        return id;
+    }
+
+    /**
+     * @param id the id to set
+     */
+    public void setId(int id)
+    {
+        this.id = id;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the surname
+     */
+    public String getSurname()
+    {
+        return surname;
+    }
+
+    /**
+     * @param surname the surname to set
+     */
+    public void setSurname(String surname)
+    {
+        this.surname = surname;
+    }
+
+    /**
+     * @return the number
+     */
+    public String getNumber()
+    {
+        return number;
+    }
+
+    /**
+     * @param number the number to set
+     */
+    public void setNumber(String number)
+    {
+        this.number = number;
+    }
+
+    /**
+     * @return the business
+     */
+    public boolean isBusiness()
+    {
+        return business;
+    }
+
+    /**
+     * @param business the business to set
+     */
+    public void setBusiness(boolean business)
+    {
+        this.business = business;
+    }
+    
+    
+}

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/entity/Record.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,40 @@
+/*
+ *  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.webbeans.telephone.util;
+
+import javax.enterprise.context.Dependent;
+import javax.inject.Named;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.context.FacesContext;
+
+@Named(value="facesMessage")
+@Dependent
+public class FacesMessageUtil
+{
+
+	public FacesMessageUtil()
+	{
+		
+	}
+	
+	public void addMessage(Severity severity,String summary, String detail)
+	{
+		FacesMessage message = new FacesMessage(severity,summary,detail);
+		FacesContext.getCurrentInstance().addMessage(null, message);
+	}
+}

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/java/org/apache/webbeans/telephone/util/FacesMessageUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,20 @@
+<?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.
+-->
+<beans/>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,29 @@
+#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.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+# 
+#---------------------------------------------------------------
+
+#use embedded openejb metadata discovery
+org.apache.webbeans.spi.deployer.UseEjbMetaDataDiscoveryService=true
+
+#use resource service
+org.apache.webbeans.resource.spi.ResourceService=org.apache.webbeans.spi.ee.openejb.resource.OpenEjbResourceServiceImpl
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,35 @@
+<?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.
+-->
+
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+    version="1.0">
+
+    <persistence-unit name="pu" transaction-type="JTA">
+        
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        <jta-data-source>My DataSource</jta-data-source>
+        <class>org.apache.webbeans.telephone.entity.Record</class>        
+        
+        <properties>
+			<property name="openjpa.Log" value="DefaultLevel=TRACE"/>  
+  			<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+        </properties>
+                
+    </persistence-unit>
+</persistence>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,21 @@
+#	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.
+#
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+log4j.rootLogger=info,stdout
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml (added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml Thu
Oct 29 19:57:03 2009
@@ -0,0 +1,20 @@
+<?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.
+-->
+<beans/>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml
(added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml
Thu Oct 29 19:57:03 2009
@@ -0,0 +1,32 @@
+<?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_1_2.xsd"
+    version="1.2">
+    
+    <application>
+        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+    </application>
+    
+    	
+</faces-config>

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/faces-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml Thu
Oct 29 19:57:03 2009
@@ -0,0 +1,54 @@
+<?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 id="WebApp_ID" version="2.5"
+ 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-app_2_5.xsd">
+ <display-name>telephone</display-name>
+ <context-param>
+  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+  <param-value>.xhtml</param-value>
+ </context-param>
+ <filter>
+  <filter-name>webbeans</filter-name>
+  <filter-class>org.apache.webbeans.jsf.WebBeansJSFFilter</filter-class>
+ </filter>
+ <filter-mapping>
+  <filter-name>webbeans</filter-name>
+  <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <listener>
+  <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+ </listener>
+ <servlet>
+  <servlet-name>Faces Servlet</servlet-name>
+  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+  <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+  <servlet-name>Faces Servlet</servlet-name>
+  <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+  <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+ <login-config>
+  <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml (added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml Thu Oct
29 19:57:03 2009
@@ -0,0 +1,116 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:f="http://java.sun.com/jsf/core"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<head>
+  <title>OpenWebBeans :: Examples :: Telephone EJB Sample</title>
+</head>
+
+<body>
+  
+  <div id="container">
+    <div id="content">
+		<h:messages globalOnly="false" showSummary="true" infoStyle="font-weight:bold;color:red;"></h:messages>
+		
+		<h3>OpenEJB, Tomcat and OpenWebBeans Telephone Directory Sample</h3>
+		
+		<h:form id="form">
+						
+			<div style="border:1px solid black;margin: 25px 75px;">
+			
+				<h:panelGrid columns="2">
+					
+					<h:outputLabel for="text">
+						<h:outputText value="Name : "></h:outputText>
+					</h:outputLabel>
+					<h:inputText id="text" value="#{operation.name}" required="true" requiredMessage="Please
give a name!"></h:inputText>
+
+					<h:outputLabel for="surname">
+						<h:outputText value="Surname : "></h:outputText>
+					</h:outputLabel>
+					<h:inputText id="surname" value="#{operation.surname}" required="true" requiredMessage="Please
give a surname!"></h:inputText>
+
+					<h:outputLabel for="telephone">
+						<h:outputText value="Telephone : "></h:outputText>
+					</h:outputLabel>
+					<h:inputText id="telephone" value="#{operation.telephone}" required="true" requiredMessage="Please
give a telephone!"></h:inputText>
+																				
+					<h:outputLabel for="chk">
+						<h:outputText value="Business Telephone : "></h:outputText>
+					</h:outputLabel>
+					<h:selectBooleanCheckbox value="#{operation.business}" />
+										
+					<h:commandButton action="#{operation.addRecord}" value="Add New Record"></h:commandButton>
+					<h:commandButton action="#{operation.showList}" value="Show All Records"></h:commandButton>
+					
+				</h:panelGrid>												
+			</div>
+			
+			<div>
+				<h3>Telephone Lists</h3>
+				<h:dataTable value="#{operation.records}" var="record" cellspacing="5">
+
+					<h:column>
+						<f:facet name="header">
+							<h:outputText value="Record Id" />
+						</f:facet>
+						<h:outputText value="#{record.id}" />
+					</h:column>
+					
+					<h:column>
+						<f:facet name="header">
+							<h:outputText value="Name" />
+						</f:facet>
+						<h:outputText value="#{record.name}" />
+					</h:column>
+					
+					<h:column>
+						<f:facet name="header">
+							<h:outputText value="Surname" />
+						</f:facet>
+						<h:outputText value="#{record.surname}" />
+					</h:column>
+
+					<h:column>
+						<f:facet name="header">
+							<h:outputText value="Telephone" />
+						</f:facet>
+						<h:outputText value="#{record.number}" />
+					</h:column>
+
+					<h:column>
+						<f:facet name="header">
+							<h:outputText value="Business" />
+						</f:facet>
+						<h:selectBooleanCheckbox value="#{record.business}" />
+					</h:column>
+					
+									
+				</h:dataTable>
+			
+			</div>
+			
+		</h:form>
+	    </div>
+    
+  </div>
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/contact.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html?rev=831073&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html (added)
+++ incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html Thu Oct
29 19:57:03 2009
@@ -0,0 +1,21 @@
+<html>
+<!--
+	
+	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.
+-->
+<head>
+  <meta http-equiv="Refresh" content="0; URL=contact.jsf">
+</head>
+</html>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/samples/ejb-telephone/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message