You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/01/30 10:54:16 UTC
svn commit: r1440322 [1/3] - in
/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi: ./
resource/ src/ src/main/ src/main/appended-resources/
src/main/appended-resources/META-INF/ src/main/java/ src/main/java/org/
src/main/java/org/apac...
Author: lofwyr
Date: Wed Jan 30 09:54:14 2013
New Revision: 1440322
URL: http://svn.apache.org/viewvc?rev=1440322&view=rev
Log:
addressbook with CDI
- first working (with jetty:run) app
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/empty_portrait.psd (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/LICENSE
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/NOTICE
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LoggingController.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/RandomAddressGenerator.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/StartupPhaseListener.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/resources/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/resources/META-INF/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/resources/META-INF/persistence.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/resources/META-INF/resources/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/resources/log4j.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/META-INF/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/META-INF/context.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/applicationContext.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/beans.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/tobago-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/scarborough/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/scarborough/standard/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/scarborough/standard/style/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/scarborough/standard/style/tobago.css
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/speyside/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/speyside/standard/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/speyside/standard/style/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/speyside/standard/style/tobago.css
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/addressbook/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/addressbook/icon/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/addressbook/icon/flag-de.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/addressbook/icon/flag-gb.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/addressbook/icon/flag-us.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/empty-portrait.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/empty-portrait_de.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/16x16/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/16x16/categories/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/16x16/categories/preferences-systemDisabled.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/32x32/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/32x32/categories/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/32x32/categories/preferences-systemDisabled.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/32x32/mimetypes/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/32x32/mimetypes/x-office-address-bookDisabled.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/image/org/tango-project/tango-icon-theme/address-book-splash-screen.png (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/addressbook.properties.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/addressbook_de.properties.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/error/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/error/messages.properties
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/resource.properties
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/resource_de.properties
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/resource_en_GB.properties
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook-resource/html/standard/standard/property/resource_en_US.properties
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/logging.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/memory.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/editor.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/layout/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/layout/basic.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/list.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/start.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/tab/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/tab/business.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/tab/misc.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/tab/personal.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/error.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/login.js
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/login.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/logout.js
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/auth/logout.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/error.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/icon/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/icon/favicon.ico (with props)
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/index.jsp
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/test/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/test/resources/
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/test/resources/realm.properties
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml Wed Jan 30 09:54:14 2013
@@ -0,0 +1,678 @@
+<?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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-example</artifactId>
+ <version>1.6.0-beta-3-SNAPSHOT</version>
+ </parent>
+ <artifactId>tobago-example-addressbook-cdi</artifactId>
+ <packaging>war</packaging>
+ <name>Tobago Example Addressbook CDI</name>
+ <description>A simple, but full functional application with persistence.</description>
+
+ <properties>
+ <openjpa.version>1.0.4</openjpa.version>
+ <spring.version>2.5.3</spring.version>
+ <openwebbeans.version>1.1.6</openwebbeans.version>
+ <myfaces-extcdi.version>1.0.5</myfaces-extcdi.version>
+ </properties>
+ <build>
+ <finalName>tobago-example-addressbook-cdi</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <java classname="org.apache.openjpa.enhance.PCEnhancer" classpathref="maven.runtime.classpath" dir="target/classes" fork="true" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <loginServices>
+ <loginService implementation="org.eclipse.jetty.security.HashLoginService">
+ <name>addressbook-realm</name>
+ <config>src/test/resources/realm.properties</config>
+ </loginService>
+ </loginServices>
+ <stopKey>stopKey</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <dependencies>
+ <!-- <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.1</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.1</version>
+ <type>jar</type>
+ </dependency>-->
+ <!--dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jcl</artifactId>
+ <version>1.0.1</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <type>jar</type>
+ </dependency-->
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.tango-project</groupId>
+ <artifactId>tango-icon-theme</artifactId>
+ <version>0.8.0</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>
+ ${project.build.directory}/${project.build.finalName}/image
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-validation_1.0_spec</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.1_spec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.12.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-resource</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
+ <artifactId>myfaces-extcdi-core-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
+ <artifactId>myfaces-extcdi-core-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+<!-- which repository-->
+ <dependency>
+ <groupId>org.apacheExtras.myfaces.codi.addon</groupId>
+ <artifactId>controlled-owb-bootstrapping-addon</artifactId>
+ <version>1.0.0</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.tango-project</groupId>
+ <artifactId>tango-icon-theme</artifactId>
+ <version>0.8.0</version>
+ </dependency>
+ <!-- <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>${openjpa.version}</version>
+ </dependency>-->
+ <!--dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-persistence</artifactId>
+ <version>${openjpa.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-persistence-jdbc</artifactId>
+ <version>${openjpa.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!--dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-xmlstore</artifactId>
+ <version>${openjpa.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-fileupload</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-theme-charlotteville</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-theme-richmond</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-core</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-security</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>tobago-facelets</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.3.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+
+ <profile>
+ <id>myfaces-1.2</id>
+ <activation>
+ <property>
+ <name>!jsf</name>
+ </property>
+ </activation>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf12</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf12-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>myfaces-2.0</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>myfaces-2.0</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+<!-- for JSF 2.0 and Bean Validation (JSR-303) -->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>myfaces-2.1</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>myfaces-2.1</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+<!-- for JSF 2.0 and Bean Validation (JSR-303) -->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>websphere-provided</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>websphere-provided</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>mojarra-1.2</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>mojarra-1.2</value>
+ </property>
+ </activation>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf12</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf12-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>mojarra-2.0</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>mojarra-2.0</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+<!-- for JSF 2.0 and Bean Validation (JSR-303) -->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>mojarra-2.1</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>mojarra-2.1</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+<!-- for JSF 2.0 and Bean Validation (JSR-303) -->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>mojarra-2.2</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>mojarra-2.2</value>
+ </property>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jvnet-nexus-snapshots</id>
+ <name>jvnet-nexus-snapshots</name>
+ <url>https://maven.java.net/content/repositories/snapshots/</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf</artifactId>
+ <version>${openwebbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
+ <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
+ <version>${myfaces-extcdi.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+<!-- for JSF 2.0 and Bean Validation (JSR-303) -->
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/empty_portrait.psd
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/empty_portrait.psd?rev=1440322&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/empty_portrait.psd
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/LICENSE
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/LICENSE?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/LICENSE (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/LICENSE Wed Jan 30 09:54:14 2013
@@ -0,0 +1,4 @@
+For the FLAG ICONS
+
+ These flag icons are available for free use
+ for any purpose with no requirement for attribution.
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/NOTICE?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/NOTICE (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/appended-resources/META-INF/NOTICE Wed Jan 30 09:54:14 2013
@@ -0,0 +1,2 @@
+This product includes flag icons developed by
+Mark James (http://www.famfamfam.com/lab/icons/flags/)
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,327 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToOne;
+import javax.persistence.PostLoad;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Locale;
+
+@Entity
+public class Address implements Serializable {
+ private static final long serialVersionUID = 1833416321633117657L;
+ private static final Logger LOG = LoggerFactory.getLogger(Address.class);
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer id;
+ @Version
+ private Integer revision;
+ private String firstName;
+ private String lastName;
+ private String street;
+ private String houseNumber;
+ private String city;
+ private String zipCode;
+ @Transient
+ private Locale country;
+ private String languageCode;
+ private String countryCode;
+ private String phone;
+ private String mobile;
+ private String fax;
+ @Transient
+ private EmailAddress email;
+ private String emailStr;
+ private String icq;
+ private String homePage;
+ @Temporal(TemporalType.DATE)
+ private Date dayOfBirth;
+ private String note;
+ private String company;
+ private String jobTitle;
+ private String jobPhone;
+ @Transient
+ private EmailAddress jobEmail;
+ private String jobEmailStr;
+ private String jobHomePage;
+ @OneToOne(cascade = {CascadeType.ALL})
+ private Picture picture;
+
+
+ public Address() {
+ LOG.debug("Creating new Address");
+ }
+
+ public void fill(Address fromAddress) {
+ id = fromAddress.getId();
+ firstName = fromAddress.getFirstName();
+ lastName = fromAddress.getLastName();
+ street = fromAddress.getStreet();
+ houseNumber = fromAddress.getHouseNumber();
+ city = fromAddress.getCity();
+ zipCode = fromAddress.getZipCode();
+ country = fromAddress.getCountry();
+ phone = fromAddress.getPhone();
+ mobile = fromAddress.getMobile();
+ fax = fromAddress.getFax();
+ email = fromAddress.getEmail();
+ dayOfBirth = fromAddress.getDayOfBirth();
+ homePage = fromAddress.getHomePage();
+ note = fromAddress.getNote();
+ company = fromAddress.getCompany();
+ jobTitle = fromAddress.getJobTitle();
+ jobPhone = fromAddress.getJobPhone();
+ jobEmail = fromAddress.getJobEmail();
+ jobHomePage = fromAddress.getJobHomePage();
+ }
+
+ @PrePersist
+ @PreUpdate
+ private void store() {
+ if (country != null) {
+ countryCode = country.getCountry();
+ languageCode = country.getLanguage();
+ }
+ if (email != null) {
+ emailStr = email.getEmail();
+ }
+ if (jobEmail != null) {
+ jobEmailStr = jobEmail.getEmail();
+ }
+ }
+
+ @PostLoad
+ private void load() {
+ if (countryCode != null && languageCode != null) {
+ country = new Locale(languageCode, countryCode);
+ }
+ if (emailStr != null) {
+ email = new EmailAddress(emailStr);
+ }
+ if (jobEmailStr != null) {
+ jobEmail = new EmailAddress(jobEmailStr);
+ }
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ 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;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getHouseNumber() {
+ return houseNumber;
+ }
+
+ public void setHouseNumber(String houseNumber) {
+ this.houseNumber = houseNumber;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getZipCode() {
+ return zipCode;
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public Locale getCountry() {
+ return country;
+ }
+
+ public void setCountry(Locale country) {
+ this.country = country;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getMobile() {
+ return mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ public String getFax() {
+ return fax;
+ }
+
+ public void setFax(String fax) {
+ this.fax = fax;
+ }
+
+ public EmailAddress getEmail() {
+ return email;
+ }
+
+ public void setEmail(EmailAddress email) {
+ if (email != null) {
+ emailStr = email.getEmail();
+ }
+ this.email = email;
+ }
+
+ public String getIcq() {
+ return icq;
+ }
+
+ public void setIcq(String icq) {
+ this.icq = icq;
+ }
+
+ public String getHomePage() {
+ return homePage;
+ }
+
+ public void setHomePage(String homePage) {
+ this.homePage = homePage;
+ }
+
+ public Date getDayOfBirth() {
+ return dayOfBirth;
+ }
+
+ public void setDayOfBirth(Date dayOfBirth) {
+ this.dayOfBirth = dayOfBirth;
+ }
+
+ public String getNote() {
+ return note;
+ }
+
+ public void setNote(String note) {
+ this.note = note;
+ }
+
+ public String getCompany() {
+ return company;
+ }
+
+ public void setCompany(String company) {
+ this.company = company;
+ }
+
+ public String getJobTitle() {
+ return jobTitle;
+ }
+
+ public void setJobTitle(String jobTitle) {
+ this.jobTitle = jobTitle;
+ }
+
+ public String getJobPhone() {
+ return jobPhone;
+ }
+
+ public void setJobPhone(String jobPhone) {
+ this.jobPhone = jobPhone;
+ }
+
+ public EmailAddress getJobEmail() {
+ return jobEmail;
+ }
+
+ public void setJobEmail(EmailAddress jobEmail) {
+ if (jobEmail != null) {
+ jobEmailStr = jobEmail.getEmail();
+ }
+ this.jobEmail = jobEmail;
+ }
+
+ public String getJobHomePage() {
+ return jobHomePage;
+ }
+
+ public void setJobHomePage(String jobHomePage) {
+ this.jobHomePage = jobHomePage;
+ }
+
+ public boolean hasPicture() {
+ return picture != null;
+ }
+
+ public Picture getPicture() {
+ return picture;
+ }
+
+ public void setPicture(Picture picture) {
+ this.picture = picture;
+ }
+
+ public String toString() {
+ return id + ": " + firstName + " " + lastName;
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java Wed Jan 30 09:54:14 2013
@@ -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.myfaces.tobago.example.addressbook;
+
+/*
+ * Created 29.11.2004 17:36:20.
+ * $Id: AddressDao.java 1368242 2012-08-01 20:47:33Z lofwyr $
+ */
+
+import java.util.List;
+
+public interface AddressDao {
+
+ Address updateAddress(Address address);
+
+ List<Address> findAddresses(String filter);
+
+ List<Address> findAddresses(String filter, String column, boolean order);
+
+ void removeAddress(Address address);
+
+ Address getAddress(Integer id);
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.sql.DriverManager;
+
+/*
+ * User: bommel
+ * Date: Mar 17, 2007
+ * Time: 9:18:20 AM
+ */
+public class DerbyShutdownServletContextListener implements ServletContextListener {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DerbyShutdownServletContextListener.class);
+
+ public void contextInitialized(ServletContextEvent servletContextEvent) {
+
+ }
+
+ public void contextDestroyed(ServletContextEvent servletContextEvent) {
+ try {
+ DriverManager.getConnection("jdbc:derby:target/addressDB;shutdown=true");
+ } catch (Exception e) {
+ LOG.error("", e);
+ }
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,75 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+
+public class EmailAddress {
+
+ private String email;
+
+ public EmailAddress(String email) {
+ this.email = email;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getLocalPart() {
+ String[] parts = email.split("@");
+ return parts[0];
+ }
+
+ public String getDomain() {
+ String[] parts = email.split("@");
+ return parts[1];
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ EmailAddress that = (EmailAddress) o;
+
+ if (email != null ? !email.equals(that.email) : that.email != null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return (email != null ? email.hashCode() : 0);
+ }
+
+ @Override
+ public String toString() {
+ return email;
+ }
+
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,86 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Alternative;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+@Alternative
+@ApplicationScoped
+public class InMemoryAddressDao implements AddressDao, Serializable {
+
+ private static final Logger LOG = LoggerFactory.getLogger(InMemoryAddressDao.class);
+
+ private List<Address> addresses;
+
+ public InMemoryAddressDao() {
+ addresses = new ArrayList<Address>();
+ }
+
+ public synchronized Address updateAddress(Address address) {
+ LOG.debug("Trying address: "+address);
+ Address storedAddress = getAddress(address.getId());
+ if (storedAddress == null) {
+ address.setId(addresses.size()+1);
+ LOG.debug("Creating address: "+address);
+ addresses.add(address);
+ } else {
+ LOG.debug("Updating address : "+address);
+ LOG.debug("Stored address is: "+storedAddress);
+ storedAddress.fill(address);
+ }
+ return address;
+ }
+
+ public List<Address> findAddresses(String filter, String column, boolean order) {
+ return findAddresses(filter);
+ }
+
+ public synchronized List<Address> findAddresses(String filter) {
+ LOG.debug("Find addresses: "+addresses);
+ return Collections.unmodifiableList(addresses);
+ }
+
+ public synchronized void removeAddress(Address address) {
+ Iterator<Address> it = addresses.iterator();
+ while (it.hasNext()) {
+ if (it.next().getId().equals(address.getId())) {
+ it.remove();
+ }
+ }
+ }
+
+ public Address getAddress(Integer id) {
+ for (Address address : addresses) {
+ if (address.getId().equals(id)) {
+ return address;
+ }
+ }
+ return null;
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,97 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.sql.DataSourceDefinition;
+import javax.enterprise.context.ApplicationScoped;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import java.io.Serializable;
+import java.util.List;
+
+@DataSourceDefinition(
+ name = "addressBookDataSource",
+ url = "jdbc:derby:target/addressDB;create=true",
+ className = "org.apache.derby.jdbc.EmbeddedDriver"
+)
+@Transactional
+@ApplicationScoped
+public class JpaAddressDao implements AddressDao, Serializable {
+
+ private static final Logger LOG = LoggerFactory.getLogger(JpaAddressDao.class);
+
+ @PersistenceContext(unitName = "addressBook")
+ private EntityManager entityManager;
+
+ public Address updateAddress(Address address) {
+ if (address.getId() == null) {
+ entityManager.persist(address);
+ } else {
+ Picture picture = address.getPicture();
+ if (picture != null && picture.getId() == null) {
+ entityManager.persist(picture);
+ }
+ entityManager.merge(address);
+ }
+ return address;
+ }
+ @Transactional(readOnly = true)
+ public List<Address> findAddresses(String filter) {
+ return findAddresses(filter, null, true);
+ }
+
+ @Transactional(readOnly = true)
+ @SuppressWarnings("unchecked")
+ public List<Address> findAddresses(String filter, String column, boolean order) {
+ StringBuilder builder = new StringBuilder();
+ builder.append("select a from Address a");
+ if (filter != null) {
+ if (filter.indexOf('_') == -1 && filter.indexOf('%') == -1) {
+ filter = "%" + filter + "%";
+ }
+ builder.append(" where a.firstName like '");
+ builder.append(filter);
+ builder.append("' or a.lastName like '");
+ builder.append(filter);
+ builder.append("'");
+ }
+ if (column != null) {
+ builder.append(" order by a.");
+ builder.append(column);
+ builder.append(order ? " desc" : " asc");
+ }
+ Query query = entityManager.createQuery(builder.toString());
+ return query.getResultList();
+ }
+
+ public void removeAddress(Address address) {
+ address = getAddress(address.getId());
+ entityManager.remove(address);
+ }
+ @Transactional(readOnly = true)
+ public Address getAddress(Integer id) {
+ return entityManager.find(Address.class, id);
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java Wed Jan 30 09:54:14 2013
@@ -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.myfaces.tobago.example.addressbook;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+
+public class KillSession extends HttpServlet {
+
+ private static final Logger LOG = LoggerFactory.getLogger(KillSession.class);
+
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ final HttpSession session = request.getSession(false);
+ if (session != null) {
+ session.invalidate();
+ LOG.info("session killed");
+ } else {
+ LOG.info("no session to kill");
+ }
+ response.getOutputStream().write("session killed".getBytes());
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,85 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.FileAppender;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggerRepository;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * User: idus
+ * Date: 12.04.2007
+ * Time: 22:41:11
+ */
+public class Log4jUtils {
+
+ public static Set<Appender> getAllAppenders() {
+ return getAllAppenders(LogManager.getLoggerRepository());
+ }
+
+ /**
+ * @return all appenders currently in use
+ */
+ public static Set<Appender> getAllAppenders(LoggerRepository repository) {
+ Enumeration loggers = repository.getCurrentLoggers();
+ Set<Appender> allAppenders = getAllAppenders(loggers);
+ addAppenders(repository.getRootLogger(), allAppenders);
+ return allAppenders;
+ }
+
+ public static Set<Appender> getAllAppenders(Enumeration loggers) {
+ Set<Appender> allAppenders = new HashSet<Appender>();
+ while (loggers.hasMoreElements()) {
+ Logger logger = (Logger) loggers.nextElement();
+ addAppenders(logger, allAppenders);
+ }
+ return allAppenders;
+ }
+
+ private static void addAppenders(Logger logger, Set<Appender> allAppenders) {
+ Enumeration appenders = logger.getAllAppenders();
+ while (appenders.hasMoreElements()) {
+ Appender appender = (Appender) appenders.nextElement();
+ allAppenders.add(appender);
+ }
+ }
+
+ public static FileAppender getFileAppender(String name, LoggerRepository repository) {
+ Set allAppenders = getAllAppenders(repository);
+ for (Object allAppender : allAppenders) {
+ Appender appender = (Appender) allAppender;
+ if (appender instanceof FileAppender) {
+ FileAppender fileAppender = (FileAppender) appender;
+ if (fileAppender.getName() != null
+ && fileAppender.getName().equals(name)) {
+ return fileAppender;
+ }
+ }
+ }
+ return null;
+ }
+
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/OpenJpaLoadTimeWeaver.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,68 @@
+/*
+ * 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.myfaces.tobago.example.addressbook;
+
+import org.springframework.instrument.classloading.SimpleInstrumentableClassLoader;
+import org.springframework.instrument.classloading.SimpleLoadTimeWeaver;
+
+
+/**
+ * <a href ="https://issues.apache.org/jira/browse/OPENJPA-40">COPY FROM OPENJPA-40</a>
+ * OpenJPA-specific SimpleLoadTimeWeaver which excludes all the core
+ * <em>org.apache.openjpa</em> packages from being instrumented. This
+ * is important, since enhanced classes will wind up implementing
+ * <em>org.apache.openjpa.enhance.PersistenceCapable</em>, so it there
+ * is a mismatch between the PersistenceCapable that is loaded by the
+ * system classloader and the one that is loaded by the
+ * instrumenting ClassLoader, then OpenJPA will not function properly.
+ *
+ * <p>
+ *
+ * This loader can be specific by including the following in the
+ * spring configuration XML as follows:
+ *
+ * <p>
+ *
+ * <code>
+ * <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&rt;
+ * ...
+ * <property name="loadTimeWeaver"&rt;
+ * <bean class="org.apache.myfaces.tobago.example.addressbook.OpenJpaLoadTimeWeaver"/&rt;
+ * </property&rt;
+ * </bean&rt;
+ * </code>
+ *
+ * author Marc Prud'hommeaux
+ * @since 2.0
+ */
+public class OpenJpaLoadTimeWeaver extends SimpleLoadTimeWeaver {
+
+ public OpenJpaLoadTimeWeaver() {
+ super();
+ ((SimpleInstrumentableClassLoader) getInstrumentableClassLoader()).
+ excludePackage("org.apache.openjpa");
+ }
+
+ public OpenJpaLoadTimeWeaver(SimpleInstrumentableClassLoader loader) {
+ super(loader);
+ ((SimpleInstrumentableClassLoader) getInstrumentableClassLoader()).
+ excludePackage("org.apache.openjpa");
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Picture.java Wed Jan 30 09:54:14 2013
@@ -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.myfaces.tobago.example.addressbook;
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import java.io.Serializable;
+
+/*
+ * Date: Feb 19, 2007
+ * Time: 7:45:33 PM
+ */
+@Entity
+public class Picture implements Serializable {
+ private static final long serialVersionUID = -7637551581782102682L;
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer id;
+ private String contentType;
+ @Lob
+ @Basic(fetch = FetchType.EAGER)
+ private byte [] content;
+
+
+ public Picture() {
+ }
+
+ public Picture(String contentType, byte[] content) {
+ this.contentType = contentType;
+ this.content = content;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public byte[] getContent() {
+ return content;
+ }
+
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,19 @@
+package org.apache.myfaces.tobago.example.addressbook;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+
+@Named("test")
+@RequestScoped
+public class Test {
+
+ private String test = "test";
+
+ public String getTest() {
+ return test;
+ }
+
+ public void setTest(String test) {
+ this.test = test;
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AdminController.java Wed Jan 30 09:54:14 2013
@@ -0,0 +1,75 @@
+/*
+ * 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.myfaces.tobago.example.addressbook.web;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.security.RolesAllowed;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+import javax.swing.BoundedRangeModel;
+import javax.swing.DefaultBoundedRangeModel;
+import java.io.Serializable;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryUsage;
+
+@Named("admin")
+@ApplicationScoped
+public class AdminController implements Serializable {
+
+ private static final String OUTCOME_ADMIN = "admin";
+
+ private BoundedRangeModel memoryUsage;
+ private String state;
+
+ @RolesAllowed("admin")
+ public String admin() {
+ return OUTCOME_ADMIN;
+ }
+
+ @PostConstruct
+ public void update() {
+ MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
+ MemoryUsage memory = memoryBean.getHeapMemoryUsage();
+ memoryUsage = new DefaultBoundedRangeModel(Long.valueOf(memory.getUsed() / 1024).intValue(),
+ 0, 0, Long.valueOf(memory.getMax() / 1024).intValue());
+ int percentValue = memoryUsage.getValue() / (memoryUsage.getMaximum() * 100);
+ if (percentValue <= 80) {
+ state = "ok";
+ } else if (percentValue > 95) {
+ state = "error";
+ } else {
+ state = "warn";
+ }
+ }
+
+ public boolean getUpdateMemory() {
+ update();
+ return true;
+ }
+
+ public BoundedRangeModel getMemory() {
+ return memoryUsage;
+ }
+
+ public String getState() {
+ return state;
+ }
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java Wed Jan 30 09:54:14 2013
@@ -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.myfaces.tobago.example.addressbook.web;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.FileAppender;
+import org.apache.log4j.PatternLayout;
+
+/**
+ * User: idus
+ * Date: 12.04.2007
+ * Time: 22:39:46
+ */
+public class AppenderModel {
+
+ private Appender appender;
+
+ public AppenderModel(Appender appender) {
+ this.appender = appender;
+ }
+
+ public String getClassName() {
+ return appender.getClass().getSimpleName();
+ }
+
+ public String getName() {
+ return appender.getName();
+ }
+
+ public String getFile() {
+ return (appender instanceof FileAppender)
+ ? ((FileAppender) appender).getFile() : "";
+ }
+
+ public String getLayout() {
+ org.apache.log4j.Layout layout = appender.getLayout();
+ if (layout instanceof PatternLayout) {
+ PatternLayout patternLayout = (PatternLayout) layout;
+ return patternLayout.getConversionPattern();
+ }
+ return String.valueOf(layout);
+ }
+
+}
Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java?rev=1440322&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java Wed Jan 30 09:54:14 2013
@@ -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.
+ */
+
+package org.apache.myfaces.tobago.example.addressbook.web;
+
+import org.apache.log4j.Logger;
+
+/**
+ * User: idus
+ * Date: 12.04.2007
+ * Time: 22:40:06
+ */
+public class CategoryModel {
+
+ private Logger logger;
+ private String level;
+
+ public CategoryModel(Logger logger) {
+ this.logger = logger;
+ }
+
+ public Logger getLogger() {
+ return logger;
+ }
+
+ public String getName() {
+ return logger.getName();
+ }
+
+ public boolean isInherited() {
+ return logger.getLevel() == null;
+ }
+
+ public boolean isLevelUpdated() {
+ return level != null;
+ }
+
+ public String getLevel() {
+ if (level == null) {
+ return getLevelFromLogger();
+ } else {
+ return level;
+ }
+ }
+
+ private String getLevelFromLogger() {
+ return isInherited()
+ ? logger.getEffectiveLevel().toString()
+ : logger.getLevel().toString();
+ }
+
+ public void setLevel(String level) {
+ if (!getLevel().equals(level)) {
+ this.level = level;
+ }
+ }
+
+}