Author: andrei_exadel
Date: 2008-09-17 08:31:08 -0400 (Wed, 17 Sep 2008)
New Revision: 10463
Added:
trunk/test-applications/SeamApp/Seam-ear/
trunk/test-applications/SeamApp/Seam-ear/.project
trunk/test-applications/SeamApp/Seam-ear/.settings/
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.component
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/test-applications/SeamApp/Seam-ear/pom.xml
trunk/test-applications/SeamApp/Seam-ear/resources/
trunk/test-applications/SeamApp/Seam-ear/resources/seam-ds.xml
trunk/test-applications/SeamApp/Seam-ear/resources/testng.xml
trunk/test-applications/SeamApp/Seam-ear/src/
trunk/test-applications/SeamApp/Seam-ear/src/main/
trunk/test-applications/SeamApp/Seam-ear/src/main/java/
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/antlr-runtime.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/apms-ds.xml
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-compiler.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-core.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-el.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-seam.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jbpm-jpdl.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/mvel14.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/richfaces-api.jar
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/seam-ds.xml
trunk/test-applications/SeamApp/Seam-ejb/
trunk/test-applications/SeamApp/Seam-ejb/.classpath
trunk/test-applications/SeamApp/Seam-ejb/.project
trunk/test-applications/SeamApp/Seam-ejb/.settings/
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.core.prefs
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.ui.prefs
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.component
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/test-applications/SeamApp/Seam-ejb/pom.xml
trunk/test-applications/SeamApp/Seam-ejb/src/
trunk/test-applications/SeamApp/Seam-ejb/src/main/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/AuthenticateAction.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/User.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/AbstractContentBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ContentViewConstants.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/EditContentBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/HistoryContentBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NodeStatusConverter.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NotEmptyValidator.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ReportContentBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ViewContentBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/FormulaParam.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/GenericFormula.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/History.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/HistoryParam.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Node.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Scheduler.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/User.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/exceptions/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/exceptions/APMSException.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IAPMSCore.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IBeanShellHelper.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/INodeManager.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IUsersManager.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/mainmenu/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/mainmenu/MainMenuBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/APMSCore.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/NodeManager.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpired.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpiredInterceptor.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/UsersManager.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/tree/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/tree/FormTreeNode.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/util/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/util/BeanShellHelper.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/RevisionViewBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/TreeViewBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/UsersBean.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSService.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSServiceRemote.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/Color.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/TreeTypeEnum.java
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/MANIFEST.MF
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/ejb-jar.xml
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/persistence.xml
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/components.properties
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/import.sql
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/seam.properties
trunk/test-applications/SeamApp/Seam-ejb/src/main/test/
trunk/test-applications/SeamApp/Seam-ejb/src/main/test/login/
trunk/test-applications/SeamApp/Seam-ejb/src/main/test/login/TestLogin.java
trunk/test-applications/SeamApp/Seam-web/
trunk/test-applications/SeamApp/Seam-web/.classpath
trunk/test-applications/SeamApp/Seam-web/.project
trunk/test-applications/SeamApp/Seam-web/.settings/
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.jdt.core.prefs
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.component
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/test-applications/SeamApp/Seam-web/pom.xml
trunk/test-applications/SeamApp/Seam-web/src/
trunk/test-applications/SeamApp/Seam-web/src/copy-web-pages1.bat
trunk/test-applications/SeamApp/Seam-web/src/main/
trunk/test-applications/SeamApp/Seam-web/src/main/copy-web-pages.bat
trunk/test-applications/SeamApp/Seam-web/src/main/java/
trunk/test-applications/SeamApp/Seam-web/src/main/java/META-INF/
trunk/test-applications/SeamApp/Seam-web/src/main/java/messages_en.properties
trunk/test-applications/SeamApp/Seam-web/src/main/java/seam.properties
trunk/test-applications/SeamApp/Seam-web/src/main/resources/
trunk/test-applications/SeamApp/Seam-web/src/main/resources/META-INF/
trunk/test-applications/SeamApp/Seam-web/src/main/resources/META-INF/MANIFEST.MF
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/META-INF/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/META-INF/MANIFEST.MF
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.navigation.xml.jsfdia
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/classes/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/classes/META-INF/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/components.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-beanutils.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-digester.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-debug.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ioc.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-mail.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-pdf.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-remoting.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ui.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/postgresql-8.3-603.jdbc3.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-impl.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-ui.jar
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/navigation.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/hello.xhtml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/home.xhtml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/index.html
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/layout/
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/login.xhtml
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/pages/
trunk/test-applications/SeamApp/pom.xml
Log:
Add Seam Test Application
Added: trunk/test-applications/SeamApp/Seam-ear/.project
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/.project (rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/.project 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,20 @@
+<projectDescription>
+ <name>Seam-ear</name>
+ <comment/>
+ <projects>
+ <project>Seam-ejb</project>
+ <project>Seam-web</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.component 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,69 @@
+<project-modules id="moduleCoreId" project-version="2.0">
+ <wb-module deploy-name="Seam-ear">
+ <wb-resource deploy-path="/"
source-path="target/eclipseEar"/>
+ <dependent-module archiveName="../bsh-1.3.0.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/bsh/bsh/1.3.0/bsh-1.3.0.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../commons-beanutils-1.7.0.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../commons-collections-3.2.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../commons-digester-1.8.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../commons-lang-2.3.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../commons-logging-1.0.3.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../dom4j-1.6.1-jboss.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/dom4j/dom4j/1.6.1-jboss/dom4j-1.6.1-jboss.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jboss-el-2.0.1.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/jboss/el/jboss-el/2.0.1.GA/jboss-el-2.0.1.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="jboss-seam-2.0.1.GA.jar"
deploy-path="/"
handle="module:/classpath/var/M2_REPO/org/jboss/seam/jboss-seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jboss-seam-debug-2.0.1.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/jboss/seam/jboss-seam-debug/2.0.1.GA/jboss-seam-debug-2.0.1.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jboss-seam-remoting-2.0.1.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/jboss/seam/jboss-seam-remoting/2.0.1.GA/jboss-seam-remoting-2.0.1.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jboss-seam-ui-2.0.1.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/jboss/seam/jboss-seam-ui/2.0.1.GA/jboss-seam-ui-2.0.1.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jsf-facelets-1.1.14.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../jstl-1.0.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/javax/servlet/jstl/1.0/jstl-1.0.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../log4j-1.2.14.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../richfaces-api-3.1.4.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/richfaces/framework/richfaces-api/3.1.4.GA/richfaces-api-3.1.4.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../richfaces-impl-3.1.4.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/richfaces/framework/richfaces-impl/3.1.4.GA/richfaces-impl-3.1.4.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="../richfaces-ui-3.1.4.GA.jar"
deploy-path="lib"
handle="module:/classpath/var/M2_REPO/org/richfaces/ui/richfaces-ui/3.1.4.GA/richfaces-ui-3.1.4.GA.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="Seam-ejb.ejb" deploy-path="/"
handle="module:/resource/Seam-ejb/Seam-ejb">
+ <dependent-object>EjbModule_21322992</dependent-object>
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="Seam-web.war" deploy-path="/"
handle="module:/resource/Seam-web/Seam-web">
+ <dependent-object>WebModule_14197152</dependent-object>
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <wb-resource deploy-path="/" source-path="src/main/java"/>
+ <wb-resource deploy-path="/"
source-path="src/main/resources"/>
+ </wb-module>
+</project-modules>
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ear/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,6 @@
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.ear"/>
+ <installed facet="jst.ear" version="5.0"/>
+ <installed facet="jst.java" version="1.4"/>
+</faceted-project>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-ear/pom.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/pom.xml (rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/pom.xml 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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.richfaces.test-applications</groupId>
+ <artifactId>SeamApp</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-ear</artifactId>
+ <name>Seam App Ear Module</name>
+ <packaging>ear</packaging>
+
+<!--
+ <distributionManagement>
+ <repository>
+ <id>repo</id>
+ <name>Repository Name</name>
+ <url>scp://repository-int.exadel.com</url>
+ </repository>
+ </distributionManagement>
+-->
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-web</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <!-- EJB -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>2.0.1.GA</version>
+ <type>ejb</type>
+ <exclusions>
+ <exclusion>
+ <artifactId>el-api</artifactId>
+ <groupId>javax.el</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>jboss</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-ejb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>ejb</type>
+ <exclusions>
+ <exclusion>
+ <artifactId>servlet-api</artifactId>
+ <groupId>javax.servlet</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jsf-api</artifactId>
+ <groupId>javax.faces</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jsf-impl</artifactId>
+ <groupId>javax.faces</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>el-api</artifactId>
+ <groupId>javax.el</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>jboss</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>Seam-ear</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <jboss>
+ <version>4</version>
+ <loader-repository>
+ seam.jboss.org:loader=Seam-ear.ear
+ </loader-repository>
+ </jboss>
+ <displayName>Seam-ear</displayName>
+ <defaultLibBundleDir>lib</defaultLibBundleDir>
+ <modules>
+ <webModule>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-web</artifactId>
+ <contextRoot>/Seam-ear</contextRoot>
+ </webModule>
+ </modules>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-jsch</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.29</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+ <!-- <scp file="${project.build.directory}/APMS-ear.ear"
keyfile="/home/cruisecontrol/.ssh/id_dsa"
todir="apms@apms.eltegra.by:/home/apms/work/jboss-4.2.0.GA/bin/"
password="apms"></scp>-->
+ <!-- <scp
+ file="${project.build.directory}/APMS-ear-1.0-SNAPSHOT.ear"
+ keyfile="/home/cruisecontrol/.ssh/id_dsa"
+ todir="apms@apms.eltegra.by:/home/apms/work/jboss-4.2.0.GA/server/default/deploy/"
+ password="apms">
+ </scp> -->
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <testResources>
+ <testResource>
+ <directory>resources</directory>
+ <targetPath>testng</targetPath>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
+ <profiles>
+ <profile>
+ <id>Test</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3.1</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <!--execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution-->
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jboss4x</containerId>
+ <home>D:/Install/Java/jboss-4.2.3.GA</home>
+ <append>false</append>
+ </container>
+ <configuration>
+ <home>D:/Install/Java/jboss-4.2.3.GA/server/default</home>
+ <type>existing</type>
+ <properties>
+ <cargo.hostname>localhost</cargo.hostname>
+
<cargo.jboss.configuration>default</cargo.jboss.configuration>
+ <cargo.rmi.port>1099</cargo.rmi.port>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase
-->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ resources/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: trunk/test-applications/SeamApp/Seam-ear/resources/seam-ds.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/resources/seam-ds.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/resources/seam-ds.xml 2008-09-17 12:31:08 UTC
(rev 10463)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>seamDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ </local-tx-datasource>
+
+</datasources>
+
Added: trunk/test-applications/SeamApp/Seam-ear/resources/testng.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/resources/testng.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/resources/testng.xml 2008-09-17 12:31:08 UTC
(rev 10463)
@@ -0,0 +1,21 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTestDANe">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTestsDANe">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="ALL"/>
+ <parameter name="filterPrefix" value="/faces/NEKO/"/>
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces.testng" />
+ </packages>
+ </test>
+</suite>
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/antlr-runtime.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/antlr-runtime.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/apms-ds.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/src/main/resources/apms-ds.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/src/main/resources/apms-ds.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>apmsDatasource</jndi-name>
+
<connection-url>jdbc:postgresql://apms.eltegra.by:5432/apms</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>apms</user-name>
+ <password>apms</password>
+ </local-tx-datasource>
+
+</datasources>
+
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-compiler.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-compiler.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-core.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/drools-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-el.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-el.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-seam.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jboss-seam.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jbpm-jpdl.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/jbpm-jpdl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/mvel14.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/mvel14.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/richfaces-api.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-ear/src/main/resources/richfaces-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-ear/src/main/resources/seam-ds.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ear/src/main/resources/seam-ds.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ear/src/main/resources/seam-ds.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>seamDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ </local-tx-datasource>
+
+</datasources>
+
Added: trunk/test-applications/SeamApp/Seam-ejb/.classpath
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/.classpath (rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/.classpath 2008-09-17 12:31:08 UTC (rev
10463)
@@ -0,0 +1,60 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"
excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"
sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"
sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/asm/asm/1.5.3/asm-1.5.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/bsh/bsh/1.3.0/bsh-1.3.0.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/cglib/cglib/2.1_3/cglib-2.1_3.jar"
sourcepath="M2_REPO/cglib/cglib/2.1_3/cglib-2.1_3-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"
sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"
sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"
sourcepath="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"
sourcepath="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/dom4j/dom4j/1.6.1-jboss/dom4j-1.6.1-jboss.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar"
sourcepath="M2_REPO/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3-sources.jar">
+ <attributes>
+ <attribute
value="jar:file:/C:/Documents%20and%20Settings/Andrey/.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3-javadoc.jar!/"
name="javadoc_location"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="var"
path="M2_REPO/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar"
sourcepath="M2_REPO/javax/ejb/ejb-api/3.0/ejb-api-3.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"
sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate/3.2.4.sp1/hibernate-3.2.4.sp1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/embedded/hibernate-all/beta3/hibernate-all-beta3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate-annotations/3.3.0.ga/hibernate-annotations-3.3.0.ga.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/hibernate/hibernate-validator/3.0.0.ga/hibernate-validator-3.0.0.ga.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/jboss/javassist/3.3.ga/javassist-3.3.ga.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/el/jboss-el/2.0.1.GA/jboss-el-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-el/2.0.0.GA/jboss-el-2.0.0.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/embedded/jboss-embedded/beta3/jboss-embedded-beta3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/embedded/jboss-embedded-all/beta3/jboss-embedded-all-beta3.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam/2.0.1.GA/jboss-seam-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-debug/2.0.1.GA/jboss-seam-debug-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-remoting/2.0.1.GA/jboss-seam-remoting-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/seam/jboss-seam-ui/2.0.1.GA/jboss-seam-ui-2.0.1.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/faces/jsf-api/1.1_02/jsf-api-1.1_02.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar"
sourcepath="M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/faces/jsf-impl/1.1_02/jsf-impl-1.1_02.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/jstl/1.0/jstl-1.0.jar"
sourcepath="M2_REPO/javax/servlet/jstl/1.0/jstl-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar"
sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-api/3.1.4.GA/richfaces-api-3.1.4.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/framework/richfaces-impl/3.1.4.GA/richfaces-impl-3.1.4.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/richfaces/ui/richfaces-ui/3.1.4.GA/richfaces-ui-3.1.4.GA.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/testng/testng/5.5/testng-5.5-jdk15.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/jboss/embedded/thirdparty-all/beta3/thirdparty-all-beta3.jar"/>
+</classpath>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-ejb/.project
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/.project (rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/.project 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,22 @@
+<projectDescription>
+ <name>Seam-ejb</name>
+ <comment/>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.core.prefs 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,5 @@
+#Wed Sep 17 12:51:10 EEST 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.ui.prefs
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.jdt.ui.prefs 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,3 @@
+#Wed Mar 12 16:53:49 EET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0"
encoding\="UTF-8"?><templates><template autoinsert\="true"
context\="gettercomment_context" deleted\="false"
description\="Comment for getter method" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment"
name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n
*/</template><template autoinsert\="true"
context\="settercomment_context" deleted\="false"
description\="Comment for setter method" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.settercomment"
name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to
set\r\n */</template><template autoinsert\="true"
context\="constructorcomment_context" deleted\="false"
description\="Comment for created constructors" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment"
name\="constructorcomment">/**\r\n * ${tags}\r\n
*/</template><template autoinsert\="true"
context\="filecomment_cont!
ext" deleted\="false" description\="Comment for created Java
files" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.filecomment"
name\="filecomment">/**\r\n * \r\n */</template><template
autoinsert\="true" context\="typecomment_context"
deleted\="false" description\="Comment for created types"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.typecomment"
name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n
*/</template><template autoinsert\="true"
context\="fieldcomment_context" deleted\="false"
description\="Comment for fields" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment"
name\="fieldcomment">/**\r\n * \r\n */</template><template
autoinsert\="true" context\="methodcomment_context"
deleted\="false" description\="Comment for non-overriding methods"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment"
name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template
autoinsert\="true" cont!
ext\="overridecomment_context" deleted\="false"
description\="Comment
for overriding methods" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment"
name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n
*/</template><template autoinsert\="true"
context\="delegatecomment_context" deleted\="false"
description\="Comment for delegate methods" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment"
name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n
*/</template><template autoinsert\="false"
context\="newtype_context" deleted\="false" description\="Newly
created files" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.newtype"
name\="newtype"> /*\r\n * ${file_name}\t\tDate created\: ${date}\r\n * Last
modified by\: $$Author$$\r\n * $$Revision$$\t$$Date$$\r\n
*/\r\n${filecomment}\r\n${package_declaration}\r\n\r\n/**\r\n * ${todo} Class description
goes here.\r\n * @author aareshchanka\r\n *\r\n
*/\r\n\r\n${typecomment}\r\n${type_declaration}</template><template auto!
insert\="true" context\="classbody_context"
deleted\="false" description\="Code in new class type bodies"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody"
name\="classbody">\r\n</template><template
autoinsert\="true" context\="interfacebody_context"
deleted\="false" description\="Code in new interface type bodies"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody"
name\="interfacebody">\r\n</template><template
autoinsert\="true" context\="enumbody_context"
deleted\="false" description\="Code in new enum type bodies"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody"
name\="enumbody">\r\n</template><template
autoinsert\="true" context\="annotationbody_context"
deleted\="false" description\="Code in new annotation type bodies"
enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody"
name\="annotationbody">\r\n</template><template
autoinsert\="true" context\="catchblock_context"
deleted\="false" de!
scription\="Code in new catch blocks" enabled\="true"
id\="org.eclipse
.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo}
Auto-generated catch
block\r\n${exception_var}.printStackTrace();</template><template
autoinsert\="true" context\="methodbody_context"
deleted\="false" description\="Code in created method stubs"
enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody"
name\="methodbody">// ${todo} Auto-generated method
stub\r\n${body_statement}</template><template autoinsert\="true"
context\="constructorbody_context" deleted\="false"
description\="Code in created constructor stubs" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody"
name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated
constructor stub</template><template autoinsert\="true"
context\="getterbody_context" deleted\="false" description\="Code
in created getters" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.getterbody"
name\="getterbody">return ${field};</template><template
autoinsert\="true" !
context\="setterbody_context" deleted\="false"
description\="Code in created setters" enabled\="true"
id\="org.eclipse.jdt.ui.text.codetemplates.setterbody"
name\="setterbody">${field} \= ${param};</template></templates>
Added:
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.component 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,6 @@
+<project-modules id="moduleCoreId" project-version="2.0">
+ <wb-module deploy-name="Seam-ejb">
+ <wb-resource deploy-path="/" source-path="src/main/java"/>
+ <wb-resource deploy-path="/"
source-path="src/main/resources"/>
+ </wb-module>
+</project-modules>
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,6 @@
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.ejb"/>
+ <installed facet="jst.ejb" version="3.0"/>
+ <installed facet="jst.java" version="5.0"/>
+</faceted-project>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-ejb/pom.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/pom.xml (rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/pom.xml 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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.richfaces.test-applications</groupId>
+ <artifactId>SeamApp</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-ejb</artifactId>
+ <name>Seam App EJB Module</name>
+ <packaging>ejb</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-remoting</artifactId>
+ <version>2.0.1.GA</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>jboss</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <version>2.0.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ <version>2.0.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.14</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.1.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.0.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.5</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>jboss-embedded-all</artifactId>
+ <version>beta3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>thirdparty-all</artifactId>
+ <version>beta3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>beta3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>jboss-embedded</artifactId>
+ <version>beta3</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <groupId>org.jboss.microcontainer</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <groupId>org.jboss.microcontainer</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>2.0.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>bsh</groupId>
+ <artifactId>bsh</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <configuration>
+ <ejbVersion>3.0</ejbVersion>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </build>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>exadel-repository</id>
+ <name>Exadel Maven Repository Manager</name>
+ <url>http://maven.eltegra.by:8099/repository</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>eltegra-maven-proxy</id>
+ <name>Exadel Maven Repository Manager</name>
+ <url>http://maven.eltegra.by:8099/repository</url>
+ </pluginRepository>
+ </pluginRepositories>
+ </project>
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/AuthenticateAction.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/AuthenticateAction.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/AuthenticateAction.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,58 @@
+package com.exadel.apms.authentification;
+
+import java.io.Serializable;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.web.Session;
+
+/**
+ * Used to authenticate user.
+ *
+ * @author vgolub
+ */
+@Name("authenticator")
+public class AuthenticateAction implements Serializable {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 3896347934570841355L;
+
+ /**
+ * Log instance.
+ */
+ @Logger
+ private Log log;
+
+ /**
+ * {@link User} instance.
+ */
+ @In(value = "user")
+ private User user;
+
+ /**
+ * Used to reload session.
+ *
+ * @return outcome which redirects to login page
+ */
+ public String reloadSession() {
+ Session.instance().invalidate();
+
+ return "reloaded";
+ }
+
+ /**
+ * Used to authenticate user.
+ *
+ * @return outcome which redirects to home page
+ */
+ public String authenticate() {
+ // TODO: implement
+ log.info("authenticating: " + user.getLogin());
+
+ return "loginned";
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/User.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/User.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/authentification/User.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,109 @@
+package com.exadel.apms.authentification;
+
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * Class represents user session entity.
+ *
+ * @author vgolub
+ */
+@Name("user")
+(a)Scope(ScopeType.SESSION)
+public class User implements Serializable {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = -8534340080474811527L;
+
+ /**
+ * User login.
+ */
+ private String login;
+
+ /**
+ * User password.
+ */
+ private String password;
+
+ /**
+ * Property used to remember user login if true.
+ */
+ private boolean rememberMe;
+
+ /**
+ * Constructor.
+ *
+ * @param login user login
+ *
+ * @param password user password
+ */
+ public User(String login, String password) {
+ this.setLogin(login);
+ this.setPassword(password);
+ }
+
+ /**
+ * Default constructor.
+ */
+ public User() {
+ }
+
+ /**
+ * Setter for the user login.
+ *
+ * @param login the user login.
+ */
+ public void setLogin(String login) {
+ this.login = login;
+ }
+
+ /**
+ * Getter for the user login.
+ *
+ * @return the user login.
+ */
+ public String getLogin() {
+ return login;
+ }
+
+ /**
+ * Setter for the user password.
+ *
+ * @param password the user password.
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * Getter for the user password.
+ *
+ * @return the user password.
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Setter for the user rememberMe property.
+ *
+ * @param rememberMe the user rememberMe flag.
+ */
+ public void setRememberMe(boolean rememberMe) {
+ this.rememberMe = rememberMe;
+ }
+
+ /**
+ * Getter for the user rememberMe property.
+ *
+ * @return the user rememberMe property.
+ */
+ public boolean isRememberMe() {
+ return rememberMe;
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/AbstractContentBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/AbstractContentBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/AbstractContentBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,44 @@
+package com.exadel.apms.contentview;
+
+import java.io.Serializable;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+
+import com.exadel.apms.interfaces.IAPMSCore;
+import com.exadel.apms.tree.FormTreeNode;
+
+/**
+ * Common class for content beans.
+ *
+ * @author vgolub
+ */
+public class AbstractContentBean implements Serializable {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 7242750523482469503L;
+
+ /**
+ * {@link APMSCore} instance injection.
+ */
+ @In(value = "apmsCore", create = true)
+ protected IAPMSCore core;
+
+ /**
+ * {@link TreeViewBean} selected node injection.
+ */
+ @In(value = "#{treeBean.selectedNode}", required = false)
+ @Out(required = false)
+ protected FormTreeNode selectedNode;
+
+ /**
+ * Getter for the Seam outjected selected node.
+ *
+ * @return the Seam outjected selected node.
+ */
+ public FormTreeNode getSelectedNode() {
+ return selectedNode;
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ContentViewConstants.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ContentViewConstants.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ContentViewConstants.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,39 @@
+package com.exadel.apms.contentview;
+
+/**
+ * Interface represents constants for the content include view (see Seam pages.xml for
details).
+ *
+ * @author vgolub
+ */
+public interface ContentViewConstants {
+
+ /**
+ * <code>BLANK</code> constant for the default view include.
+ */
+ String BLANK = "blank_content.xhtml";
+
+ /**
+ * <code>VIEW</code> constant for the node default view include.
+ */
+ String VIEW = "view_content.xhtml";
+
+ /**
+ * <code>EDIT</code> constant for the node edit view include.
+ */
+ String EDIT = "edit_content.xhtml";
+
+ /**
+ * <code>HISTORY</code> constant for the node history view include.
+ */
+ String HISTORY = "history_content.xhtml";
+
+ /**
+ * <code>ADD</code> constant for the add node view include.
+ */
+ String ADD = "add_content.xhtml";
+
+ /**
+ * <code>REPORT</code> constant for the node report view include.
+ */
+ String REPORT = "report_content.xhtml";
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/EditContentBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/EditContentBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/EditContentBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,626 @@
+/*
+ * EditContentBean.java Date created: Mar 11, 2008
+ * Last modified by: $Author: vsoskin $
+ * $Revision: 315 $ $Date: 2008-03-18 22:52:39 +0200 (Tue, 18 Mar 2008) $
+ */
+package com.exadel.apms.contentview;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.component.html.HtmlAjaxCommandButton;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.ui.util.Faces;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.entity.GenericFormula;
+import com.exadel.apms.entity.Scheduler;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.IBeanShellHelper;
+import com.exadel.apms.mainmenu.MainMenuBean;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.tree.FormTreeNode;
+import com.exadel.apms.tree.FormTreeNode.EntryImpl;
+
+/**
+ * Bean represents node edit content view. Bean scope is conversation, it starts
+ * when user clicks edit menu item and finishes when appropriate button is
+ * clicked.
+ *
+ * @author vgolub
+ */
+@Name("editContent")
+(a)Scope(ScopeType.CONVERSATION)
+@SessionExpired
+public class EditContentBean extends AbstractContentBean {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 1064654710962083987L;
+
+ /**
+ * {@link MainMenuBean} injection.
+ */
+ @In
+ private MainMenuBean mainMenu;
+
+ /**
+ * List of {@link Scheduler} instances for UI manipulations.
+ */
+ private List<Scheduler> schedulers;
+
+ /**
+ * Formula function.
+ */
+ private String formulaFunction = null;
+
+ /**
+ * Flag shows if rendering of scheduler panel is needed.
+ */
+ private boolean schedulersRenderNeeded;
+
+ /**
+ * Flag shows if rendering of add formula panel is needed.
+ */
+ private boolean addFormulaRenderNeeded;
+
+ private String beanShellText;
+
+ private String beanShellresult;
+
+ @In(value = "beanShellhelper", create = true)
+ IBeanShellHelper helper;
+
+ @Logger
+ private Log log;
+
+ private List<EditParams> formulaParamsEdit;
+
+ /**
+ * Method used to load schedulers from DB.
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ @Factory(scope = ScopeType.EVENT, autoCreate = true, value = "schedulers")
+ public void loadSchedulers(ActionEvent event) {
+ List<Scheduler> persSched = core.getNodeManager().getNodeById(
+ selectedNode.getNode().getId()).getSchedulers();
+ schedulers = initLazySchedulers(persSched);
+ }
+
+ /**
+ * Used to fetch schedulers because of lazy list fetching.
+ *
+ * @param persScheduler
+ * Scheduler persistence list
+ */
+ private List<Scheduler> initLazySchedulers(List<Scheduler> persScheduler) {
+ if (null != persScheduler) {
+ for (int i = 0; i < persScheduler.size(); i++) {
+ persScheduler.get(i);
+ }
+ }
+ return persScheduler;
+ }
+
+ /**
+ * Used to add new {@link Scheduler}.
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ public void addScheduler(ActionEvent event) {
+ Scheduler newScheduler = new Scheduler();
+ newScheduler.setStartDate(new Date());
+ schedulers.add(newScheduler);
+ }
+
+ /**
+ * Used to add new {@link FormulaParam}.
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ public void addFormulaParamsListener(ActionEvent event) {
+
+ if (formulaParamsEdit == null) {
+ formulaParamsEdit = new ArrayList<EditParams>();
+ selectedNode.getNode().getFormula().setParams(
+ getEditParamsAsList(formulaParamsEdit));
+ }
+ Double[] array = { 0d, 0d, 0d, 0d };
+ formulaParamsEdit.add(new EditParams(new FormulaParam(), array));
+ }
+
+ /**
+ * Used to delete {@link FormulaParam}
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ public void deleteScheduler(ActionEvent event) {
+ HtmlAjaxCommandButton button = (HtmlAjaxCommandButton) event
+ .getSource();
+
+ for (int i = 0; i < schedulers.size(); i++) {
+ if (schedulers.get(i).getId().equals(button.getValue())) {
+ schedulers.remove(i);
+ break;
+ }
+ }
+ }
+
+ /**
+ * JSF listener for submit actions.
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ public void submitChanges(ActionEvent event) {
+
+ // update schedulers
+ if (isSchedulersRenderNeeded()) {
+ updateSchedulers();
+ }
+
+ // update formula
+ if (formulaFunction != null) {
+ updateFormula();
+ } else {
+ if(selectedNode.getNode().getFormula()!=null){
+ formulaFunction = selectedNode.getNode().getFormula().getFormula();
+ List<FormulaParam> l = selectedNode.getNode().getFormula().getParams();
+ formulaParamsEdit.clear();
+ for(FormulaParam fp : l){
+ formulaParamsEdit.add(new EditParams(fp, new Double[4]));
+ }
+ }
+ updateFormula();
+ }
+ formulaFunction = null;
+
+ // update node
+ try {
+ core.getNodeManager().updateNode(selectedNode.getNode());
+
+ FacesMessages.instance().add(
+ "Node #{selectedNode.node.name} was successfully updated.");
+
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+ stopEditConversation();
+ } catch (APMSException e) {
+ log.error("EditContentBean submitChanges error : ", "e");
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR,
+ e.getMessage());
+ }
+ }
+
+ /**
+ * Method used to stop edit conversation.
+ */
+ public void stopEditConversation() {
+ Conversation.instance().end();
+ }
+
+ /**
+ * Method used to update schedulers.
+ */
+ private void updateSchedulers() {
+ selectedNode.getNode().getSchedulers().clear();
+ if (schedulers != null) {
+ selectedNode.getNode().getSchedulers().addAll(schedulers);
+ }
+ }
+
+ /**
+ * Method used to update formula.
+ */
+ private void updateFormula() {
+ GenericFormula newFormula = selectedNode.getNode().getFormula();
+
+ if (null == formulaFunction) {
+ // set the default value
+ formulaFunction = "max";
+ }
+ if (!"exp".equals(formulaFunction)) {
+ newFormula.setEvaluate(null);
+ }
+ newFormula.setFormula(formulaFunction);
+ if (selectedNode.getNode().getCountChilds() == 0) {
+ for (EditParams fp : formulaParamsEdit) {
+ newFormula.addFormulaParam(fp.getEditParam());
+ }
+ if (formulaFunction.equals("max")) {
+ newFormula.setEvaluate(helper
+ .createMaxFormula(formulaParamsEdit));
+ newFormula.setFormula("max");
+ }
+ }
+
+ }
+
+ /**
+ * evaluates BeanShell expression
+ *
+ * @param event
+ * current JSF event
+ */
+ public void evaluateBeanShell(ActionEvent event) {
+ try {
+ beanShellresult = helper.evaluate(
+ selectedNode.getNode().getFormula().getEvaluate(),
+ getEditParamsAsList(formulaParamsEdit)).toString();
+ } catch (Exception e) {
+ log.error("evaluateBeanShell method : ", e);
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR,
+ e.getMessage());
+ }
+ }
+
+ /**
+ * evaluates BeanShell expression
+ *
+ * @param event
+ * current JSF event
+ */
+ public void evaluateBeanShellChild(ActionEvent event) {
+ try {
+ List<FormulaParam> paramList = new ArrayList<FormulaParam>();
+ for (Iterator it = selectedNode.getChildren(); it.hasNext();) {
+ EntryImpl n = (EntryImpl) it.next();
+ FormulaParam fp = new FormulaParam();
+ fp.setName(((FormTreeNode) n.getValue()).getNode().getName());
+ fp
+ .setValue(((FormTreeNode) n.getValue()).getNode()
+ .getStatus());
+ paramList.add(fp);
+ }
+ beanShellresult = helper.evaluate(
+ selectedNode.getNode().getFormula().getEvaluate(),
+ paramList).toString();
+ } catch (Exception e) {
+ log.error("evaluateBeanShell method : ", e);
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(e.getMessage()));
+ }
+ }
+
+ /**
+ * generates random values for editFormulaParams
+ *
+ * @param event
+ * current JSF event
+ */
+ public void generateValues(ActionEvent event) {
+ if (selectedNode.isLeaf()) {
+ for (FormulaParam param : getEditParamsAsList(formulaParamsEdit)) {
+ param.setValue(Double.valueOf(Integer.valueOf((int) (Math
+ .random() * 100))));
+ }
+ } else {
+ for (Iterator it = selectedNode.getChildren(); it.hasNext();) {
+ EntryImpl entry = (EntryImpl) it.next();
+ ((FormTreeNode) entry.getValue()).getNode().setStatus(
+ Double.valueOf(Integer
+ .valueOf((int) (Math.random() * 100))));
+ }
+
+ }
+ }
+
+ /**
+ * Used to delete {@link FormulaParam}
+ *
+ * @param event
+ * the event of {@link ActionEvent}
+ */
+ public void deleteParam(ActionEvent event) {
+ HtmlAjaxCommandButton button = (HtmlAjaxCommandButton) event
+ .getSource();
+
+ for (int i = 0; i < formulaParamsEdit.size(); i++) {
+ if (formulaParamsEdit.get(i).getEditParam().getName().equals(
+ button.getValue())) {
+ selectedNode.getNode().getFormula().removeFormulaParam(
+ formulaParamsEdit.get(i).getEditParam());
+ formulaParamsEdit.remove(i);
+ break;
+ }
+ }
+ }
+
+ /**
+ * Method used to switch scheduler panel rendering state.
+ */
+ public void switchSchedulersState() {
+ schedulersRenderNeeded = !schedulersRenderNeeded;
+ }
+
+ /**
+ * Method used to switch formula panel rendering state.
+ */
+ public void switchAddFormulaState() {
+ addFormulaRenderNeeded = !addFormulaRenderNeeded;
+ }
+
+ /**
+ * Cancel logic.
+ */
+ public void cancelChanges(ActionEvent event) {
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+ stopEditConversation();
+ }
+
+ /*
+ * probably will need in the future
+ *
+ * public void setNodeTypes(List<SelectItem> nodeTypes) { this.nodeTypes =
+ * nodeTypes; }
+ *
+ * public List<SelectItem> getNodeTypes() { if (null == nodeTypes) {
+ * nodeTypes = new ArrayList<SelectItem>();
+ *
+ * for (APMSTreeNodeTypeEnum enumObj : APMSTreeNodeTypeEnum.values()) {
+ * nodeTypes.add(new SelectItem(enumObj)); } } return nodeTypes; }
+ */
+
+ /**
+ * Setter for scheduler panel rendering state flag.
+ *
+ * @param schedulersRenderNeeded
+ * the scheduler panel rendering state flag.
+ */
+ public void setSchedulersRenderNeeded(boolean schedulersRenderNeeded) {
+ this.schedulersRenderNeeded = schedulersRenderNeeded;
+ }
+
+ /**
+ * Getter for scheduler panel rendering state flag.
+ *
+ * @return the scheduler panel rendering state flag.
+ */
+ public boolean isSchedulersRenderNeeded() {
+ return schedulersRenderNeeded;
+ }
+
+ /**
+ * Setter for {@link Scheduler} list.
+ *
+ * @param schedulers
+ * {@link Scheduler} list.
+ */
+ public void setSchedulers(List<Scheduler> schedulers) {
+ this.schedulers = schedulers;
+ }
+
+ /**
+ * Getter for {@link Scheduler} list.
+ *
+ * @return the {@link Scheduler} list.
+ */
+ public List<Scheduler> getSchedulers() {
+ return schedulers;
+ }
+
+ /**
+ * Setter for formula panel rendering state flag.
+ *
+ * @param addFormulaRenderNeeded
+ * the formula panel rendering state flag.
+ */
+ public void setAddFormulaRenderNeeded(boolean addFormulaRenderNeeded) {
+ this.addFormulaRenderNeeded = addFormulaRenderNeeded;
+ }
+
+ /**
+ * Getter for formula panel rendering state flag.
+ *
+ * @return the formula panel rendering state flag.
+ */
+ public boolean isAddFormulaRenderNeeded() {
+ return addFormulaRenderNeeded;
+ }
+
+ /**
+ * Method returns flag which shows if formula toggle panel render needed.
+ *
+ * @return flag if formula toggle panel render needed.
+ */
+ public boolean isAddFormulaAvailableForNode() {
+ return selectedNode.isLeaf();
+ }
+
+ /**
+ * Setter for the formula function.
+ *
+ * @param formulaFunction
+ * the formula function.
+ */
+ public void setFormulaFunction(String formulaFunction) {
+ this.formulaFunction = formulaFunction;
+ }
+
+ /**
+ * Getter for the formula function.
+ *
+ * @return the formula function.
+ */
+ public String getFormulaFunction() {
+ if (formulaFunction == null) {
+ if (getSelectedNode().getNode().getFormula() != null)
+ formulaFunction = getSelectedNode().getNode().getFormula()
+ .getFormula();
+ }
+ return formulaFunction == null ? "max" : formulaFunction;
+ }
+
+ /**
+ * Getter for the formula parameters.
+ *
+ * @return the formula parameters.
+ */
+
+ /**
+ * @return the beanShellText
+ */
+ public String getBeanShellText() {
+ return beanShellText;
+ }
+
+ /**
+ * @param beanShellText
+ * the beanShellText to set
+ */
+ public void setBeanShellText(String beanShellText) {
+ this.beanShellText = beanShellText;
+ }
+
+ /**
+ * @return the beanShellresult
+ */
+ public String getBeanShellresult() {
+ return beanShellresult;
+ }
+
+ /**
+ * @param beanShellresult
+ * the beanShellresult to set
+ */
+ public void setBeanShellresult(String beanShellresult) {
+ this.beanShellresult = beanShellresult;
+ }
+
+ private List<FormulaParam> getEditParamsAsList(List<EditParams> params) {
+ List<FormulaParam> tmp = new ArrayList<FormulaParam>();
+ for (EditParams fp : params) {
+ tmp.add(fp.getEditParam());
+ }
+ return tmp;
+ }
+
+ /** Class wrapper for representation data for FormulaParams on UI */
+ public class EditParams {
+
+ FormulaParam editParam;
+
+ Double[] boundParams;
+
+ /**
+ * Full Constructor
+ * @param fp FormulaParam instance
+ * @param doubles array of Doubles
+ * */
+ public EditParams(FormulaParam fp, Double[] doubles) {
+ this.editParam = fp;
+ this.boundParams = doubles;
+ }
+
+ /**
+ * Default constructor
+ * */
+ public EditParams() {
+ super();
+ }
+
+ /**
+ * @return the editParam
+ */
+ public FormulaParam getEditParam() {
+ return editParam;
+ }
+
+ /**
+ * @param editParam
+ * the editParam to set
+ */
+ public void setEditParam(FormulaParam editParam) {
+ this.editParam = editParam;
+ }
+
+ /**
+ * @return the boundParams
+ */
+ public Double[] getBoundParams() {
+ return boundParams;
+ }
+
+ /**
+ * @param boundParams
+ * the boundParams to set
+ */
+ public void setBoundParams(Double[] boundParams) {
+ this.boundParams = boundParams;
+ }
+
+ }
+
+ /**
+ * @return the formulaParamsEdit
+ */
+ public List<EditParams> getFormulaParamsEdit() {
+ if (null == formulaParamsEdit) {
+ Conversation.instance().begin();
+ if (selectedNode.getNode().getFormula() == null) {
+ selectedNode.getNode().setFormula(new GenericFormula());
+ formulaParamsEdit = new ArrayList<EditParams>();
+ } else if (helper.unparseMaxParams(selectedNode.getNode()
+ .getFormula().getEvaluate()) != null) {
+ Map<String, Double[]> tmp = helper
+ .unparseMaxParams(selectedNode.getNode().getFormula()
+ .getEvaluate());
+ formulaParamsEdit = new ArrayList<EditParams>();
+ for (FormulaParam fp : selectedNode.getNode().getFormula()
+ .getParams()) {
+ formulaParamsEdit.add(new EditParams(fp, tmp.get(fp
+ .getName())));
+ }
+
+ } else {
+ formulaParamsEdit = new ArrayList<EditParams>();
+ for (FormulaParam fp : selectedNode.getNode().getFormula()
+ .getParams()) {
+ Double[] array = { 0d, 0d, 0d, 0d };
+ formulaParamsEdit.add(new EditParams(fp, array));
+ }
+ }
+ }
+ return formulaParamsEdit;
+ }
+
+ private void validateParams(List<EditParams> params){
+ for(EditParams p : params){
+ if(!( (p.getBoundParams()[0] <= p.getBoundParams()[1]) &&
+ (p.getBoundParams()[1] <= p.getBoundParams()[2]) &&
+ (p.getBoundParams()[2] <= p.getBoundParams()[3])) ){
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR,
+ "Parametrs must obey following rule : Y- <= G- <= G+ <= Y+");
+ }
+ }
+ }
+
+ /**
+ * @param formulaParamsEdit
+ * the formulaParamsEdit to set
+ */
+ public void setFormulaParamsEdit(List<EditParams> formulaParamsEdit) {
+ this.formulaParamsEdit = formulaParamsEdit;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/HistoryContentBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/HistoryContentBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/HistoryContentBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,317 @@
+package com.exadel.apms.contentview;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIColumn;
+import javax.faces.component.html.HtmlDataTable;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.html.HtmlPanelBar;
+import org.richfaces.component.html.HtmlPanelBarItem;
+
+import com.exadel.apms.entity.History;
+import com.exadel.apms.session.SessionExpired;
+
+/**
+ * Bean represents history content. Bean scope is request.
+ *
+ * @author vgolub
+ */
+@Name("historyContent")
+(a)Scope(ScopeType.EVENT)
+@SessionExpired
+public class HistoryContentBean extends AbstractContentBean {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 4608033386303416329L;
+
+ /**
+ * Component <rich:panelBar /> binding. Used to manipulate panel bar dynamically.
+ */
+ private HtmlPanelBar panelBar;
+
+ /**
+ * List of {@link History} instances.
+ */
+ private List<History> historyList;
+
+ /**
+ * All events which happened on one date.
+ */
+ private HashMap<Date, List<History>> oneDayGroup;
+
+ /**
+ * Used to create HtmlPanelBar component
+ */
+ @SuppressWarnings("all")
+ public void loadPanelBar() {
+ panelBar = new HtmlPanelBar();
+ loadOneDayGroup();
+
+ if (null != oneDayGroup) {
+ Set<Date> dates = oneDayGroup.keySet();
+ if (dates.size() == 0) {
+ panelBar.setRendered(false);
+ return;
+ }
+
+ for (Date date : dates) {
+ HtmlPanelBarItem pBarItem = new HtmlPanelBarItem();
+ pBarItem.setLabel(createGroupDisplayValue(date));
+
+ HtmlDataTable table = createHistoryDataTable(oneDayGroup.get(date));
+
+ pBarItem.getChildren().add(table);
+ panelBar.getChildren().add(pBarItem);
+ }
+ }
+ }
+
+ @SuppressWarnings("all")
+ private HtmlDataTable createHistoryDataTable(List<History> values) {
+ Application application = FacesContext.getCurrentInstance().getApplication();
+
+ HtmlDataTable table = new HtmlDataTable();
+ table.setCellpadding("0");
+ table.setCellspacing("0");
+ table.setBorder(1);
+ table.setStyle("vertical-align:top; width: 100%;");
+ table.setValue(values);
+ table.setVar("item");
+
+ UIColumn column = null;
+ HtmlOutputText colHeader = null;
+ HtmlOutputText colText = null;
+ ValueBinding vb = null;
+
+ column = new UIColumn();
+ colHeader = new HtmlOutputText();
+ colText = new HtmlOutputText();
+
+ colHeader.setValue("Date");
+ column.setHeader(colHeader);
+ vb = application.createValueBinding("#{item.inserted}");
+ colText.setValueBinding("value", vb);
+ column.getChildren().add(colText);
+ table.getChildren().add(column);
+
+ column = new UIColumn();
+ colHeader = new HtmlOutputText();
+ colText = new HtmlOutputText();
+
+ colHeader.setValue("Status");
+ column.setHeader(colHeader);
+ vb = application.createValueBinding("#{item.status}");
+ colText.setValueBinding("value", vb);
+ column.getChildren().add(colText);
+ table.getChildren().add(column);
+
+ column = new UIColumn();
+ colHeader = new HtmlOutputText();
+ HtmlDataTable innerTable = null;
+
+ colHeader.setValue("Data");
+ column.setHeader(colHeader);
+ vb = application.createValueBinding("#{item.params}");
+ ValueBinding vb2 = application.createValueBinding("#{item.params.size >
0}");
+ innerTable = createParamsInnerTable(vb, vb2);
+ column.getChildren().add(innerTable);
+ table.getChildren().add(column);
+
+ return table;
+ }
+
+ @SuppressWarnings("all")
+ private HtmlDataTable createParamsInnerTable(ValueBinding values, ValueBinding rendered)
{
+ Application application = FacesContext.getCurrentInstance().getApplication();
+
+ HtmlDataTable table = new HtmlDataTable();
+ table.setValueBinding("value", values);
+ table.setValueBinding("rendered", rendered);
+ table.setCellpadding("0");
+ table.setCellspacing("0");
+ table.setBorder(1);
+ table.setStyle("vertical-align:top; width: 100%;");
+ table.setVar("paramValue");
+
+ UIColumn column = null;
+ HtmlOutputText colHeader = null;
+ HtmlOutputText colText = null;
+ ValueBinding vb = null;
+
+ column = new UIColumn();
+ colHeader = new HtmlOutputText();
+ colText = new HtmlOutputText();
+
+ colHeader.setValue("Name");
+ column.setHeader(colHeader);
+ vb = application.createValueBinding("#{paramValue.name}");
+ colText.setValueBinding("value", vb);
+ column.getChildren().add(colText);
+ table.getChildren().add(column);
+
+ column = new UIColumn();
+ colHeader = new HtmlOutputText();
+ colText = new HtmlOutputText();
+
+ colHeader.setValue("Value");
+ column.setHeader(colHeader);
+ vb = application.createValueBinding("#{paramValue.value}");
+ colText.setValueBinding("value", vb);
+ column.getChildren().add(colText);
+ table.getChildren().add(column);
+
+ return table;
+ }
+
+ private String createGroupDisplayValue(Date date) {
+ String result = "";
+ GregorianCalendar calendar = new GregorianCalendar();
+ calendar.setTime(date);
+
+ if (null != date) {
+ result += (calendar.get(GregorianCalendar.YEAR) + "/" +
(calendar.get(GregorianCalendar.MONTH) + 1) + "/" +
calendar.get(GregorianCalendar.DAY_OF_MONTH));
+ }
+
+ return result;
+ }
+
+ /**
+ * Getter for the history list.
+ *
+ * @return the history list
+ */
+ public List<History> getHistoryList() {
+ if (null == historyList) {
+ loadHistoryList();
+ }
+ return historyList;
+ }
+
+ /**
+ * Loads the history list.
+ */
+ private void loadHistoryList() {
+ this.historyList =
core.getNodeManager().getHistoryById(selectedNode.getNode().getId());
+ }
+
+ /**
+ * Setter for the history list.
+ *
+ * @param historyList the history list to set
+ */
+ public void setHistoryList(List<History> historyList) {
+ this.historyList = historyList;
+ }
+
+ /**
+ * Create groups with one date.
+ */
+ private void loadOneDayGroup() {
+ if (getHistoryList() != null) {
+ oneDayGroup = new HashMap<Date, List<History>>();
+
+ List<History> savedValues = new ArrayList<History>();
+ for (History history : historyList) {
+ Date date = history.getInserted();
+ if (isHistoryDateListContainsCurrent(savedValues, date)) {
+ // if we've already added the date we should omit that iteration
+ continue;
+ }
+ List<History> dateGroup = new ArrayList<History>();
+
+ for (History historyToAdd : historyList) {
+ if (areDatesAppropriate(historyToAdd.getInserted(), date)) {
+ dateGroup.add(historyToAdd);
+ savedValues.add(historyToAdd);
+ }
+ }
+
+ oneDayGroup.put(date, dateGroup);
+ }
+ }
+ }
+
+ /**
+ * Method used to check if there is a history in the history list which contains passed
date.
+ *
+ * @param hList the history list
+ *
+ * @param curDate the current date
+ *
+ * @return true if there is a history in the history list which contains passed date.
+ */
+ private boolean isHistoryDateListContainsCurrent(List<History> hList, Date
curDate) {
+ boolean result = false;
+
+ for (History history : hList) {
+ if (areDatesAppropriate(history.getInserted(), curDate)) {
+ result = true;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Used to compare two dates on some used criteria.
+ *
+ * @param date1 the first date
+ *
+ * @param date2 the second date
+ *
+ * @return true if criteria is carried out
+ */
+ private boolean areDatesAppropriate(Date date1, Date date2) {
+ boolean isApprop = false;
+ GregorianCalendar calendar1 = new GregorianCalendar();
+ GregorianCalendar calendar2 = new GregorianCalendar();
+ calendar1.setTime(date1);
+ calendar2.setTime(date2);
+
+ if (calendar1.get(GregorianCalendar.YEAR) == calendar2.get(GregorianCalendar.YEAR)
+ && calendar1.get(GregorianCalendar.MONTH) ==
calendar2.get(GregorianCalendar.MONTH)
+ && calendar1.get(GregorianCalendar.DAY_OF_MONTH) ==
calendar2.get(GregorianCalendar.DAY_OF_MONTH)) {
+ isApprop = true;
+ }
+
+ return isApprop;
+ }
+
+ /**
+ * Setter for the panel bar binding.
+ *
+ * @param panelBar the panel bar to set.
+ */
+ public void setPanelBar(HtmlPanelBar panelBar) {
+ this.panelBar = panelBar;
+ }
+
+ /**
+ * Getter for the panel bar binding.
+ *
+ * @return panel bar to UI
+ */
+ public HtmlPanelBar getPanelBar() {
+ if (panelBar == null) {
+ loadPanelBar();
+ }
+ return panelBar;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NodeStatusConverter.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NodeStatusConverter.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NodeStatusConverter.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,51 @@
+package com.exadel.apms.contentview;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.domain.seam.constants.TreeTypeEnum;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.faces.Converter;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+
+/**
+ * Used to convert {@link TreeTypeEnum} to UI representation and vice versa.
+ *
+ * @author vgolub
+ */
+@Name("nodeStatusConverter")
+@BypassInterceptors
+@Converter
+public class NodeStatusConverter implements javax.faces.convert.Converter {
+
+ /**
+ * Used from JSF to convert from UI representation string to {@link TreeTypeEnum}
constant.
+ *
+ * @param ctx FacesContenxt instance.
+ *
+ * @param comp UIComponent.
+ *
+ * @param value string value of constant.
+ *
+ * @return {@link TreeTypeEnum} constant.
+ */
+ public Object getAsObject(FacesContext ctx, UIComponent comp, String value) {
+ return TreeTypeEnum.valueOf(value);
+ }
+
+ /**
+ * Used from JSF to convert from {@link TreeTypeEnum} constant to UI representation
string.
+ *
+ * @param ctx FacesContenxt instance.
+ *
+ * @param comp UIComponent.
+ *
+ * @param value <code>TreeTypeEnum</code> value of constant.
+ *
+ * @return string for UI representation.
+ */
+ public String getAsString(FacesContext ctx, UIComponent comp, Object value) {
+ return value != null ? value.toString() : null;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NotEmptyValidator.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NotEmptyValidator.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/NotEmptyValidator.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,58 @@
+package com.exadel.apms.contentview;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.ConverterException;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.faces.Converter;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+
+/**
+ * Converter used to prevent empty fields. That converter used as validator because
+ * JSF doesn't validate fields with empty content.
+ *
+ * @author vgolub
+ *
+ */
+@Name("validateNotEmpty")
+@BypassInterceptors
+@Converter
+public class NotEmptyValidator implements javax.faces.convert.Converter {
+
+ /**
+ * Used to throw an exception if value is missing.
+ *
+ * @param ctx JSF context
+ *
+ * @param comp UI component
+ *
+ * @param value UI value to convert
+ */
+ public Object getAsObject(FacesContext ctx, UIComponent comp, String value) {
+ if (value == null || "".equals(value.trim())) {
+ FacesMessage message = new FacesMessage();
+ message.setDetail("Input field is empty.");
+ message.setSummary("It should be filled.");
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+
+ throw new ConverterException(message);
+ }
+ return value;
+ }
+
+ /**
+ * Just returns the string back to UI.
+ *
+ * @param ctx JSF context
+ *
+ * @param comp UI component
+ *
+ * @param value server value to convert
+ */
+ public String getAsString(FacesContext ctx, UIComponent comp, Object value) {
+ return value != null ? value.toString() : "";
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ReportContentBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ReportContentBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ReportContentBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,115 @@
+ /*
+ * ReportContentBean.java Date created: Mar 11, 2008
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 261 $ $Date: 2008-03-17 16:39:41 +0200 (Mon, 17 Mar 2008) $
+ */
+package com.exadel.apms.contentview;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.component.html.HtmlAjaxCommandButton;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.mainmenu.MainMenuBean;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.view.TreeViewBean;
+
+/**
+ * Bean represents report content view. Bean scope is request.
+ *
+ * @author vgolub
+ */
+@Scope(value = ScopeType.EVENT)
+@Name("reportContent")
+@SessionExpired
+public class ReportContentBean extends AbstractContentBean {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = -3764337274482044369L;
+
+ @Logger
+ private Log log;
+
+ /**
+ * List of {@link FormulaParam} instances for UI manipulations.
+ */
+ private List<FormulaParam> formulaParams;
+
+ /**
+ * {@link TreeViewBean} instance injection.
+ */
+ @In(value = "treeBean")
+ private TreeViewBean treeBean;
+
+ /**
+ * {@link MainMenuBean} instance injection.
+ */
+ @In
+ private MainMenuBean mainMenu;
+
+ /**
+ * JSF listener for submit actions.
+ *
+ * @param event the event of {@link ActionEvent}
+ */
+ public void submitListener(ActionEvent event) {
+ HtmlAjaxCommandButton button = (HtmlAjaxCommandButton) event.getSource();
+
+ if ("reportSubmit".equals(button.getId())) {
+ List<Double> doubleParams = new ArrayList<Double>();
+ if (formulaParams != null) {
+ for (FormulaParam param : formulaParams) {
+ doubleParams.add(param.getValue());
+ }
+ }
+ try {
+ core.recalculate(treeBean.getSelectedNode().getNode().getId(), doubleParams);
+ treeBean.changeStatus(treeBean.getSelectedNode());
+
+ FacesMessages.instance().add("Formula params for node
#{treeBean.selectedNode.node.name} were successfully submitted.");
+ } catch (APMSException e) {
+ e.printStackTrace();
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, e.getMessage());
+ return;
+ }
+ } // else if ("reportCancel".equals(button.getId())) {}
+
+ // redirect to view content
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+ }
+
+ /**
+ * Getter for the {@link FormulaParam} list, used also to load them.
+ *
+ * @return the list of {@link FormulaParam}.
+ */
+ @Factory(value = "formulaParams", scope = ScopeType.EVENT, autoCreate = true)
+ public List<FormulaParam> getFormulaParams() {
+ if (null == formulaParams) {
+ try {
+ formulaParams = core.getFormulaParams(treeBean.getSelectedNode().getNode().getId());
+ } catch (APMSException e) {
+ log.debug(e.getMessage());
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, e.getMessage());
+ }
+ }
+ return formulaParams;
+ }
+
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ViewContentBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ViewContentBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/contentview/ViewContentBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,103 @@
+package com.exadel.apms.contentview;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.html.HtmlTree;
+import org.richfaces.component.state.TreeState;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeRowKey;
+
+import com.exadel.apms.mainmenu.MainMenuBean;
+import com.exadel.apms.tree.FormTreeNode;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.tree.FormTreeNode.EntryImpl;
+import com.exadel.apms.view.TreeViewBean;
+
+/**
+ * Bean represents view content. Bean scope is request.
+ *
+ * @author vgolub
+ */
+@Name("viewContent")
+(a)Scope(ScopeType.EVENT)
+@SessionExpired
+public class ViewContentBean extends AbstractContentBean {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 7756699635858884663L;
+
+ /**
+ * {@link TreeNode} list to get content.
+ */
+ private List<TreeNode> nodes;
+
+ /**
+ * {@link TreeViewBean} instance injection.
+ */
+ @In(value = "treeBean")
+ private TreeViewBean treeBean;
+
+ /**
+ * {@link MainMenuBean} instance injection.
+ */
+ @In
+ private MainMenuBean mainMenu;
+
+ /**
+ * Default constructor.
+ */
+ public ViewContentBean() {
+ }
+
+ /**
+ * Setter for the list of nodes.
+ *
+ * @param nodes the list of nodes.
+ */
+ public void setNodes(List<TreeNode> nodes) {
+ this.nodes = nodes;
+ }
+
+ /**
+ * Getter for the list of nodes.
+ *
+ * @return the list of nodes.
+ */
+ @SuppressWarnings("unchecked")
+ public List<TreeNode> getNodes() {
+ if (null == nodes) {
+ nodes = new ArrayList<TreeNode>();
+ Iterator<EntryImpl> it = selectedNode.getChildren();
+
+ while (it.hasNext()) {
+ EntryImpl tentry = it.next();
+ nodes.add((TreeNode) tentry.getValue());
+ }
+ }
+
+ return nodes;
+ }
+
+ public void openNode(ActionEvent event) {
+ treeBean.setNewNode(getChildValue(event.getComponent()));
+ }
+
+ private FormTreeNode getChildValue(UIComponent component) {
+ Map<String, Object> attrs = component.getAttributes();
+ return (FormTreeNode) attrs.get("childValue");
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/FormulaParam.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/FormulaParam.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/FormulaParam.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,135 @@
+/*
+ * FormulaParam.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+/**
+ * Class represented FormulaParam Entity EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("formulaParam")
+@Table(name = "FormulaParameters")
+public class FormulaParam implements Serializable {
+
+ private static final long serialVersionUID = 8439205429387833709L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "FORMULA_PARAM_ID")
+ private Long id;
+
+ @Column(name = "name")
+ @NotNull
+ private String name;
+
+ @Transient
+ private Double value;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "FORMULA_ID", insertable = false, updatable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_FORMULA_PARAM_ID")
+ private GenericFormula parent;
+
+ /**
+ * Default Constructor, needed by JavaBean specification
+ */
+ public FormulaParam() {
+ }
+
+ /**
+ * Getter for property parent
+ *
+ * @return parent of current formula parameter
+ */
+ public GenericFormula getParent() {
+ return parent;
+ }
+
+ /**
+ * Setter for property parent
+ *
+ * @param parent - parent of this formula parameter
+ */
+ public void setParent(GenericFormula parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current formula parameter
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property version
+ *
+ * @return version of current node
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @param name - name of this formula parameter
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @return name of current formula parameter
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for property value
+ *
+ * @param value - value of this formula parameter
+ */
+ public void setValue(Double value) {
+ this.value = value;
+ }
+
+ /**
+ * Getter for property value
+ *
+ * @return value of current formula parameter
+ */
+ public Double getValue() {
+ return value;
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/GenericFormula.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/GenericFormula.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/GenericFormula.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,309 @@
+/*
+ * GenericFormula.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 329 $ $Date: 2008-03-20 10:46:07 +0200 (Thu, 20 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.util.BeanShellHelper;
+
+/**
+ * Class represented GenericFormula Entity EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Table(name = "Formulas")
+public class GenericFormula implements Serializable {
+
+ private static final int GRAY_STATUS = 999;
+
+ private static final long serialVersionUID = 7307074028627893048L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "Formula_ID")
+ private Long id = null;
+
+ @Column(name = "name")
+ private String name;
+
+ @Column(name = "formula")
+ @NotNull
+ private String formula;
+
+ @Column(name = "evaluate", length = 1024)
+ private String evaluate;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @OneToOne(mappedBy = "formula")
+ private Node parent;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ @JoinColumn(name = "FORMULA_ID", nullable = false)
+ private List<FormulaParam> params = new ArrayList<FormulaParam>();
+
+ @Transient
+ private List<Double> resultArray;
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public GenericFormula() {
+ }
+
+ // ********************** Accessor Methods ********************** //
+
+ /**
+ * Getter for property resultArray
+ *
+ * @return resultArray of current formula
+ */
+ public List<Double> getResultArray() {
+ return resultArray;
+ }
+
+ /**
+ * Getter for property version
+ *
+ * @return version of current node
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * Setter for property resultArray
+ *
+ * @param resultArray -
+ * list doubles to set
+ */
+ public void setResultArray(List<Double> resultArray) {
+ this.resultArray = resultArray;
+ }
+
+ /**
+ * Getter for property params
+ *
+ * @return List of FormulaParam of current formula
+ */
+ public List<FormulaParam> getParams() {
+ return params;
+ }
+
+ /**
+ * Setter for property params
+ *
+ * @param params -
+ * list FormulaParam to set
+ */
+ public void setParams(List<FormulaParam> params) {
+ this.params = params;
+ }
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current formula
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property parent
+ *
+ * @return parent of current formula
+ */
+ public Node getParent() {
+ return parent;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @return name of current formula
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @param name
+ * to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Getter for property formula
+ *
+ * @return formula of current formula
+ */
+ public String getFormula() {
+ return formula;
+ }
+
+ /**
+ * Getter for property formula
+ *
+ * @param formula
+ * to set
+ */
+ public void setFormula(String formula) {
+ this.formula = formula;
+ }
+
+ /**
+ * Getter for property evaluate
+ *
+ * @return evaluate of current formula
+ */
+ public String getEvaluate() {
+ return evaluate;
+ }
+
+ /**
+ * Getter for property evaluate
+ *
+ * @param formula
+ * to set
+ */
+ public void setEvaluate(String evaluate) {
+ this.evaluate = evaluate;
+ }
+
+ // ********************** Common Methods ********************** //
+
+ /**
+ * Add formula parameter for current node
+ *
+ * @param param -
+ * formulaParam to add
+ */
+ public void addFormulaParam(FormulaParam param) {
+ if (param == null) {
+ throw new IllegalArgumentException("Null child!");
+ }
+ if (param.getParent() != null) {
+ param.getParent().getParams().remove(param);
+ }
+ param.setParent(this);
+ params.add(param);
+ }
+
+ /**
+ * Remove formula parameter of current node
+ *
+ * @param param -
+ * formulaParam to remove
+ */
+ public void removeFormulaParam(FormulaParam param) {
+ if (param == null) {
+ throw new IllegalArgumentException("Null child");
+ }
+ param.setParent(null);
+ params.remove(param);
+ }
+
+ /**
+ * Clear resultArray
+ *
+ */
+ public void clearResultArray() {
+ this.resultArray = new ArrayList<Double>();
+ }
+
+ /**
+ * Add to resultArray double value
+ *
+ * @param param -
+ * double value to add in resultArray
+ */
+ public void addToResultArray(Double param) {
+ this.getResultArray().add(param);
+ }
+
+ /**
+ * This method perform calculations of current status of node, which have
+ * current formula
+ *
+ * @return -double value of status nested node
+ */
+ public double calculate() {
+ double temp = 0;
+ // If resultArray yet not prepared then return GRAY_STATUS
+ if (getResultArray() != null) {
+ int size = getResultArray().size();
+ if (this.getFormula().equals("avg")) {
+ for (int i = 0; i < getResultArray().size(); i++) {
+ temp += getResultArray().get(i);
+ }
+ return temp > 0 ? temp / size : 0;
+ } else if (this.getFormula().equals("sum")) {
+ for (int i = 0; i < getResultArray().size(); i++) {
+ temp += getResultArray().get(i);
+ }
+ return temp;
+ } else if (this.getFormula().equals("max")
+ && (this.getEvaluate() == null || "".equals(this
+ .getEvaluate()))) {
+ if (size > 0) {
+ temp = getResultArray().get(0);
+ for (int i = 0; i < getResultArray().size(); i++) {
+ if (temp < getResultArray().get(i)) {
+ temp = getResultArray().get(i);
+ }
+ }
+ return temp;
+ }
+ } else {
+ if (this.getEvaluate() != null
+ && !"".equals(this.getEvaluate())) {
+ BeanShellHelper bsh = new BeanShellHelper();
+ try {
+ return bsh.evaluate(this.getEvaluate(), getParams());
+ } catch (APMSException e) {
+ e.printStackTrace();
+ return -9999.0;
+ }
+ }else{
+ return -9998.0;
+ }
+ }
+ }
+
+ return GRAY_STATUS;
+ }
+
+ public void setParent(Node parent) {
+ this.parent = parent;
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/History.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/History.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/History.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,157 @@
+/*
+ * History.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+/**
+ * Class represented History Entity
+ * EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("history")
+@Table(name = "History")
+public class History implements Serializable {
+
+ private static final long serialVersionUID = 4563484589602593598L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "HISTORY_ID")
+ private Long id = null;
+
+ @ManyToOne
+ @JoinColumn(name = "NODE_ID", nullable = false, updatable = false,
insertable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_PARENT_NODE_HISTORY_ID")
+ private Node parentNode;
+
+ @Column(name = "Status")
+ @NotNull
+ private double status;
+
+ @Temporal(value = TemporalType.TIMESTAMP)
+ private Date inserted;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "HISTORY_ID", nullable = false)
+ private List<HistoryParam> params = new ArrayList<HistoryParam>();
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public History() {
+ }
+
+ /**
+ * Getter for property params
+ *
+ * @return List of HistoryParam of current history item
+ */
+ public List<HistoryParam> getParams() {
+ return params;
+ }
+
+ /**
+ * Setter for property params
+ *
+ * @param params - list HistoryParam to set
+ */
+ public void setParams(List<HistoryParam> params) {
+ this.params = params;
+ }
+
+ // ********************** Accessor Methods ********************** //
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current history item
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property parent
+ *
+ * @return parent of current history item
+ */
+ public Node getParentNode() {
+ return parentNode;
+ }
+
+ // ********************** Common Methods ********************** //
+
+ /**
+ * Getter for property status
+ *
+ * @return status of current history item
+ */
+ public Double getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for property status
+ *
+ * @param status - status to set of current history item
+ */
+ public void setStatus(Double status) {
+ this.status = status;
+ }
+
+ /**
+ * Getter for property inserted
+ *
+ * @return inserted - time of inserting of current history item
+ */
+ public Date getInserted() {
+ return inserted;
+ }
+
+ /**
+ * Setter for property inserted
+ *
+ * @param inserted - time of inserting current history item
+ */
+ public void setInserted(Date inserted) {
+ this.inserted = inserted;
+ }
+
+ /**
+ * Setter for property parent
+ *
+ * @param parentNode - parent of current history item
+ */
+ public void setParentNode(Node parentNode) {
+ this.parentNode = parentNode;
+ }
+
+ // ********************** Business Methods ********************** //
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/HistoryParam.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/HistoryParam.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/HistoryParam.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,120 @@
+/*
+ * HistoryParam.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+/**
+ * Class represented HistoryParam Entity EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("historyParam")
+@Table(name = "HistoryParameters")
+public class HistoryParam implements Serializable {
+
+ private static final long serialVersionUID = 8439205429387833709L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "History_PARAM_ID")
+ private Long id;
+
+ @Column(name = "name")
+ @NotNull
+ private String name;
+
+ @Column(name = "value")
+ private Double value;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "HISTORY_ID", insertable = false, updatable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_HISTORY_PARAM_ID")
+ private History parent;
+
+ /**
+ * Default Constructor, needed by JavaBean specification
+ */
+ public HistoryParam() {
+ }
+
+ /**
+ * Getter for property parent
+ *
+ * @return parent of current history parameter
+ */
+ public History getParent() {
+ return parent;
+ }
+
+ /**
+ * Setter for property parent
+ *
+ * @param parent - parent of this history parameter
+ */
+ public void setParent(History parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current history parameter
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @param name of current history parameter
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @return name - name of this history parameter
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for property value
+ *
+ * @param value - value of this history parameter
+ */
+ public void setValue(Double value) {
+ this.value = value;
+ }
+
+ /**
+ * Getter for property value
+ *
+ * @return value of current history parameter
+ */
+ public Double getValue() {
+ return value;
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Node.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Node.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Node.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,483 @@
+/*
+ * Node.java
+ * Last modified by: $Author: vsoskin $
+ * $Revision: 336 $ $Date: 2008-03-21 18:49:10 +0200 (Fri, 21 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.UniqueConstraint;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.TransactionPropagationType;
+import org.jboss.seam.annotations.Transactional;
+
+/**
+ * Class represented Node Entity
+ * EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("node")
+(a)Scope(ScopeType.SESSION)
+@Table(name = "Nodes", uniqueConstraints = @UniqueConstraint(columnNames = {
+ "NAME", "PARENT_ID" }))
+public class Node implements Serializable {
+
+ private static final double GRAY_COLOR = 999.0;
+
+ private static final long serialVersionUID = -7042878411608396483L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "NODE_ID")
+ private Long id = null;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @Column(name = "NAME", length = 255, nullable = false)
+ @NotNull
+ private String name;
+
+ @Column(name = "DESCRIPTION", length = 1024)
+ @NotNull
+ private String description;
+
+ @OneToMany(mappedBy = "parentNode", cascade = { CascadeType.ALL })
+
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
+ @org.hibernate.annotations.OrderBy(clause = "NAME asc")
+ private List<Node> childNodes = new ArrayList<Node>();
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "NODE_ID", nullable = false)
+ private List<History> history = new ArrayList<History>();
+
+ @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+ @JoinColumn(name="FORMULA_ID" , nullable = false)
+ private GenericFormula formula;
+
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "NODE_ID", nullable = true)
+ private List<Scheduler> schedulers = new ArrayList<Scheduler>();
+
+ @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
+ @JoinColumn(name = "PARENT_ID", nullable = true)
+ @org.hibernate.annotations.ForeignKey(name = "FK_PARENT_ID")
+ private Node parentNode;
+
+ @Temporal(value = TemporalType.TIMESTAMP)
+ @Column(name = "validPeriod")
+ private Date validPeriod;
+
+ @Column(name = "Status")
+ @NotNull
+ private Double status;
+
+ @Temporal(value = TemporalType.TIMESTAMP)
+ @NotNull
+ private Date lastUpdated;
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public Node() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name - name of instantiated node
+ * @param parentNode - parent of instantiated node
+ */
+ public Node(String name, Node parentNode) {
+ this.name = name;
+ this.parentNode = parentNode;
+ }
+
+ // ********************** Accessor Methods ********************** //
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current node
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @return name of current node
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Getter for property version
+ *
+ * @return version of current node
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @param name - name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Getter for property childNodes
+ *
+ * @return list of childs of current node
+ */
+ public List<Node> getChildNodes() {
+ return childNodes;
+ }
+
+ /**
+ * Getter for property history
+ *
+ * @return list of history items of current node
+ */
+ public List<History> getHistory() {
+ return history;
+ }
+
+ /**
+ * Getter for property parentNode
+ *
+ * @return parent of current node
+ */
+ public Node getParentNode() {
+ return parentNode;
+ }
+
+ /**
+ * Setter for property parentNode
+ */
+ private void setParentNode(Node parentNode) {
+ this.parentNode = parentNode;
+ }
+
+ /**
+ * Getter for property validPeriod
+ *
+ * @return time during which node was valid
+ */
+ public Date getValidPeriod() {
+ return validPeriod;
+ }
+
+ /**
+ * Setter for property validPeriod
+ *
+ * @param validPeriod - date to set
+ */
+ public void setValidPeriod(Date validPeriod) {
+ this.validPeriod = validPeriod;
+ }
+
+ /**
+ * Getter for property status
+ *
+ * @return status of current node
+ */
+ public Double getStatus() {
+ return status;
+ }
+
+ /**
+ * Setter for property status
+ *
+ * @param status - status to set
+ */
+ public void setStatus(Double status) {
+ this.status = status;
+ }
+
+ /**
+ * Getter for property lastUpdated
+ *
+ * @return time of last updating this node
+ */
+ public Date getLastUpdated() {
+ return lastUpdated;
+ }
+
+ /**
+ * Setter for property lastUpdated
+ *
+ * @param lastUpdated - date to set
+ */
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ /**
+ * Getter for property description
+ *
+ * @return description of current node
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Setter for property description
+ *
+ * @param description - description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Getter for property schedulers
+ *
+ * @return list of schedulers of current node
+ */
+ public List<Scheduler> getSchedulers() {
+ return schedulers;
+ }
+
+ /**
+ * Getter for property formula
+ *
+ * @return formula of current node
+ */
+ public GenericFormula getFormula() {
+ return formula;
+ }
+
+ /**
+ * Setter for property formula
+ *
+ * @param formula - formula to set
+ */
+ public void setFormula(GenericFormula formula) {
+ this.formula = formula;
+ formula.setParent(this);
+ }
+
+ // ********************** Business Methods ********************** //
+
+ /**
+ * This method add History Item to collection of history items of current node and
persist them
+ *
+ * @param item - history item to add
+ */
+ public void addHistoryItem(History item) {
+ if (item == null) {
+ throw new IllegalArgumentException("Null history!");
+ }
+ if (item.getParentNode() != null) {
+ item.getParentNode().getChildNodes().remove(item);
+ }
+ item.setParentNode(parentNode);
+ history.add(item);
+ }
+
+ /**
+ * This method add child Node to collection of childs of current node and persist them
+ *
+ * @param child - node to add
+ */
+ public void addChildNode(Node child) {
+ if (child == null) {
+ throw new IllegalArgumentException("Null child!");
+ }
+ if (child.getParentNode() != null && !this.equals(child.getParentNode()))
{
+ child.getParentNode().getChildNodes().remove(child);
+ }
+ child.setParentNode(this);
+ childNodes.add(child);
+ }
+
+ /**
+ * This method remove child Node from collection of childs of current node
+ *
+ * @param child - node to remove
+ */
+ public void removeChildNode(Node child) {
+ if (child == null) {
+ throw new IllegalArgumentException("Null child");
+ }
+ child.setParentNode(null);
+ childNodes.remove(child);
+ }
+
+ /**
+ * This method return count of childs of current node
+ *
+ * @return count of childs of this node
+ */
+ public int getCountChilds() {
+ if (this.getChildNodes() != null && this.getChildNodes().toArray().length
> 0) {
+ return this.getChildNodes().toArray().length;
+ }
+ return 0;
+ }
+
+ /**
+ * This method checks if current node need to recalculating
+ *
+ * @return boolean value indicated should we recalculate current node or not
+ */
+ public boolean isOutdated() {
+ return (this.getValidPeriod() != null)
+ && (new Date().after(this.getValidPeriod()));
+ }
+
+ /**
+ * This method calculate and set status for current node
+ *
+ * @param forceUpdate - if set to true - node will recalculated always, even if
scheduler correct
+ */
+ @Transactional(TransactionPropagationType.REQUIRED)
+ public void calculateStatus(boolean forceUpdate) {
+ if (this.isOutdated() || forceUpdate) {
+ calculate();
+ calculateParents(this);
+ }
+ }
+
+ private void calculate() {
+ List<Double> formulaParams = new ArrayList<Double>();
+ // If this node has childs, first calculate them
+ if (this.getCountChilds() > 0) {
+ for (Node child : this.getChildNodes()) {
+ child.calculateStatus(false);
+ formulaParams.add(child.getStatus());
+ }
+ } else {
+ // Calculate current node
+ if (formulaValid()) {
+ for (FormulaParam param : this.getFormula().getParams()) {
+ if (param.getValue() != null) {
+ formulaParams.add(param.getValue());
+ }
+ }
+ }
+ }
+ if(this.getFormula() == null){
+ GenericFormula f = new GenericFormula();
+ f.setFormula("max");
+ this.setFormula(f);
+ }
+ // Preparing ResultArray of formula assigned to current node
+ this.getFormula().setResultArray(formulaParams);
+ // Calculate and set status
+ this.setStatus(this.getFormula().calculate());
+ // Calculate next scheduler time
+ this.calculateValidPeriod();
+ // Save history
+ this.saveHistory();
+ }
+
+ private boolean formulaValid() {
+ return this.getFormula() != null
+ && this.getFormula().getParams() != null
+ && this.getFormula().getParams().size() > 0;
+ }
+
+ private void saveHistory() {
+ History hist = new History();
+ hist.setInserted(new Date());
+ hist.setStatus(this.getStatus());
+ if (this.getFormula().getParams() != null) {
+ saveHistoryParams(hist);
+ }
+ this.addHistoryItem(hist);
+ }
+
+ private void saveHistoryParams(History history) {
+ List<HistoryParam> histParams = new ArrayList<HistoryParam>();
+ for (FormulaParam param : this.getFormula().getParams()) {
+ HistoryParam p = new HistoryParam();
+ p.setName(param.getName());
+ p.setValue(param.getValue());
+ p.setParent(history);
+ histParams.add(p);
+ }
+ history.setParams(histParams);
+ }
+
+ private void calculateValidPeriod() {
+ // Delete all outdated schedulers
+ deleteOutdatedSchedulers();
+ // Calculate next scheduler time and set it
+ this.setValidPeriod(getNearestSchedulerDate());
+ this.setLastUpdated(new Date());
+ }
+
+ private void deleteOutdatedSchedulers() {
+ if (this.getSchedulers() != null) {
+ Date current = new Date();
+ List<Scheduler> temp = new ArrayList<Scheduler>();
+ for (Scheduler sch : this.getSchedulers()) {
+ Date startDate = sch.getStartDate();
+ if ((startDate.after(current))) {
+ temp.add(sch);
+ }
+ }
+ this.getSchedulers().clear();
+ this.getSchedulers().addAll(temp);
+ }
+ }
+
+ private Date getNearestSchedulerDate() {
+ if (this.getSchedulers() != null && this.getSchedulers().size() > 0)
{
+ Date current = new Date();
+ Date temp = this.getSchedulers().get(0).getStartDate();
+ for (Scheduler sch : this.getSchedulers()) {
+ Date startDate = sch.getStartDate();
+ if ((startDate.after(current) && ((startDate.before(temp))))) {
+ temp = startDate;
+ }
+ }
+ return temp;
+ } else {
+ return null;
+ }
+
+ }
+
+ private void calculateParents(Node node) {
+ if (node.getParentNode() != null) {
+ Node n = node.getParentNode();
+ n.calculateStatus(true);
+// calculateParents(n);
+ }
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Scheduler.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Scheduler.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/Scheduler.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,100 @@
+/*
+ * Scheduler.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.entity;
+
+import org.jboss.seam.annotations.Name;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+/**
+ * Class represented Scheduler Entity
+ * EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("Scheduler")
+@Table(name = "Schedulers")
+public class Scheduler implements Serializable {
+
+ /**
+ * Serial version ID
+ */
+ private static final long serialVersionUID = -7042878411608396483L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "SCHEDULER_ID")
+ private Long id = null;
+
+ @Temporal(value = TemporalType.TIMESTAMP)
+ @Column(name = "START_DATE")
+ private Date startDate;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "NODE_ID", insertable = false, updatable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_SCHEDULER_NODE_ID")
+ private Node parent;
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public Scheduler() {
+ }
+
+ // ********************** Accessor Methods ********************** //
+ /**
+ * Getter for property parent
+ *
+ * @return parent of current scheduler
+ */
+ public Node getParent() {
+ return parent;
+ }
+
+ /**
+ * Getter for property id
+ *
+ * @return id of current scheduler
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property startDate
+ *
+ * @return startDate of current scheduler
+ */
+ public Date getStartDate() {
+ return startDate;
+ }
+
+ /**
+ * Setter for property startDate
+ *
+ * @param startDate - date to set
+ */
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+
+ // ********************** Common Methods ********************** //
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/User.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/User.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/entity/User.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,104 @@
+ /*
+ * User.java Date created: 17.09.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package com.exadel.apms.entity;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Entity
+@Name("User")
+(a)Scope(ScopeType.SESSION)
+@Table(name = "Users")
+
+public class User implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1454874159504838399L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "id")
+ private Long id;
+
+ @Column(name = "Firstname", length = 50, nullable = false)
+ private String firstName;
+
+ @Column(name = "Lastname", length = 50, nullable = false)
+ private String lastName;
+
+ @Column(name = "Age")
+ private Integer age;
+
+ /**
+ * @return the firstName
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * @param firstName the firstName to set
+ */
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ /**
+ * @return the lastName
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * @param lastName the lastName to set
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ /**
+ * @return the age
+ */
+ public Integer getAge() {
+ return age;
+ }
+
+ /**
+ * @param age the age to set
+ */
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ /**
+ * @return the id
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/exceptions/APMSException.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/exceptions/APMSException.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/exceptions/APMSException.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,30 @@
+/*
+ * InvisionApplicationException.java Date created: Dec 4, 2007
+ * Last modified by: : aantonovich $
+ * : $ : $
+ */
+
+package com.exadel.apms.exceptions;
+
+/**
+ * Used for all exceptions in APMS. Each APMS exception should be subclass of it.
+ *
+ * @author Andrey Markhel
+ */
+public class APMSException extends Exception {
+
+ /** {@inheritDoc} */
+ public APMSException(Throwable e) {
+ super(e);
+ }
+
+ /** {@inheritDoc} */
+ public APMSException(String msg, Throwable e) {
+ super(msg, e);
+ }
+
+ /** {@inheritDoc} */
+ public APMSException(String msg) {
+ super(msg);
+ }
+}
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IAPMSCore.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IAPMSCore.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IAPMSCore.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,79 @@
+/*
+ * IAPMSCore.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.interfaces;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.entity.History;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.exceptions.APMSException;
+
+/**
+ * Main interface for APMS project. It is single entry-point for web-services and UI
beans
+ * <p>
+ * Responsibilities:
+ * <li>Get hierarchy of nodes for populating tree</li>
+ * <li>Get instance of NodeManager, responsible for node management</li>
+ * <li>Get history for certain node</li>
+ * <li>Get formula for certain node</li>
+ * <li>Get formula parameters for certain node</li>
+ * <li>Get schedulers for certain node</li>
+ * <li>Recalculating of status certain node and it;s parents</li>
+ * @author Andrey Markhel
+ */
+@Local
+public interface IAPMSCore {
+
+ /**
+ * Get root of hierarchy of nodes for populating first tier of tree
+ *
+ * @return List of Nodes of nodes, hasn't parent
+ */
+ List<Node> getHierarchy();
+
+ /**
+ * Get instance of NodeManager, responsible for node management
+ *
+ * @return nodeManager
+ */
+ INodeManager getNodeManager();
+
+ /**
+ * Get history for certain node by node id
+ *
+ * @param id - id of node item to retrieve history
+ * @return List - list of History objects for certain node
+ */
+ List<History> getHistoryById(Long id);
+
+ /**
+ * Get formula parameters for certain node
+ *
+ * @param id - id of node item to retrieve formula parameters
+ * @return List - list of FormulaParam objects for certain node
+ * @throws APMSException
+ */
+ List<FormulaParam> getFormulaParams(Long id) throws APMSException;
+
+ /**
+ * Recalculate status of certain node and their parents
+ *
+ * @param nodeId - id of node item to recalculate
+ * @param formulaParams - List of Double parameters, reflecting current status of node
+ * @throws APMSException
+ *
+ */
+ void recalculate(long nodeId, List<Double> formulaParams) throws
APMSException;
+
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3 specification)
+ *
+ */
+ void destroy();
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IBeanShellHelper.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IBeanShellHelper.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IBeanShellHelper.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,46 @@
+ /*
+ * IBeanShellHelper.java Date created: Mar 14, 2008
+ * Last modified by: $Author: aareshchanka $
+ * $Revision: 302 $ $Date: 2008-03-18 17:55:02 +0200 (Tue, 18 Mar 2008) $
+ */
+package com.exadel.apms.interfaces;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Local;
+
+import com.exadel.apms.contentview.EditContentBean.EditParams;
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.exceptions.APMSException;
+
+/**
+ * BeanShellHelper interface.
+ * @author aareshchanka
+ *
+ */
+
+@Local
+public interface IBeanShellHelper {
+
+ /**
+ * evaluates BeanShell expressions
+ * @param expression String BeanShell expression to be evaluated
+ * @param editFormulaParams collection of {@link FormulaParam} instances to evaluate
expression
+ * @return current result
+ * @throws APMSException custom exception if any error occured
+ * */
+ public Double evaluate(String expression, List<FormulaParam> editFormulaParams)
throws APMSException;
+
+
+ public String createMaxFormula(List<EditParams> formulaParamsEdit);
+
+ public Map<String, Double[]> unparseMaxParams(String formula);
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3
+ * specification)
+ *
+ */
+ public void destroy();
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/INodeManager.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/INodeManager.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/INodeManager.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,116 @@
+/*
+ * INodeManager.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 238 $ $Date: 2008-03-14 16:11:41 +0200 (Fri, 14 Mar 2008) $
+ */
+package com.exadel.apms.interfaces;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.entity.History;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.exceptions.APMSException;
+
+/**
+ * Interface for APMS project. It is single entry-point for node management
+ * <p>
+ * Responsibilities:
+ * <li>Get root hierarchy of nodes for populating tree</li>
+ * <li>Delete node</li>
+ * <li>Update node</li>
+ * <li>Create node</li>
+ * <li>Get childs of node</li>
+ * <li>Get node by id</li>
+ * <li>Recalculating of status certain node and it;s parents</li>
+ * <li>Get history for certain node</li>
+ * <li>Get formula parameters for certain node</li>
+ * @author Andrey Markhel
+ */
+@Local
+public interface INodeManager {
+
+ /**
+ * Get root of hierarchy of nodes for populating first tier of tree
+ *
+ * @return List of nodes, hasn't parent
+ */
+ List<Node> getRoot();
+
+ /**
+ * Delete specified node from database
+ *
+ * @param n - node to delete
+ * @throws APMSException
+ */
+ void deleteNode(Node n) throws APMSException;
+
+ /**
+ * Update specified node
+ *
+ * @param n - node to update
+ * @throws APMSException
+ */
+ void updateNode(Node n) throws APMSException;
+
+ /**
+ * Create and save new node in database
+ *
+ * @param n - node to save
+ * @throws APMSException
+ */
+ void addNode(Node n) throws APMSException;
+
+ /**
+ * Get node by it's id
+ *
+ * @param id - id to lookup
+ *
+ * @return node instance
+ */
+ Node getNodeById(Long id);
+
+ /**
+ * Get childs of node for populating next tier of tree
+ *
+ * @param id - id of node item to retrieve history
+ *
+ * @return List of childs for specified node
+ */
+ List<Node> getChilds(Long id);
+
+ /**
+ * Get history for certain node by node id
+ *
+ * @param id - id of node item to retrieve history
+ * @return List - list of History objects for certain node
+ */
+ List<History> getHistoryById(Long id);
+
+ /**
+ * Get formula parameters for certain node
+ *
+ * @param id - id of node item to retrieve formula parameters
+ * @return List - list of FormulaParam objects for certain node
+ * @throws APMSException
+ */
+ List<FormulaParam> getFormulaParams(Long id) throws APMSException;
+
+ /**
+ * Recalculate status of certain node and their parents
+ *
+ * @param nodeId - id of node item to recalculate
+ * @param formulaParams - List of Double parameters, reflecting current status of node
+ * @throws APMSException
+ *
+ */
+ void recalculate(long nodeId, List<Double> formulaParams) throws
APMSException;
+
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3 specification)
+ *
+ */
+ void destroy();
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IUsersManager.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IUsersManager.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/interfaces/IUsersManager.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,29 @@
+ /*
+ * UsersManager.java Date created: 17.09.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package com.exadel.apms.interfaces;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import com.exadel.apms.entity.User;
+
+/**
+ * TODO Class description goes here.
+ * @author aareshchanka
+ *
+ */
+
+@Local
+public interface IUsersManager {
+
+ public List<User> getUsers() ;
+
+ public void addUser(User user);
+
+ public void destroy();
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/mainmenu/MainMenuBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/mainmenu/MainMenuBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/mainmenu/MainMenuBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,186 @@
+package com.exadel.apms.mainmenu;
+
+import java.io.Serializable;
+
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.web.Session;
+import org.richfaces.component.html.HtmlMenuItem;
+
+import com.exadel.apms.authentification.User;
+import com.exadel.apms.contentview.ContentViewConstants;
+import com.exadel.apms.contentview.EditContentBean;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.view.TreeViewBean;
+
+/**
+ * Bean represents main menu. Bean scope is session.
+ *
+ * @author vgolub
+ */
+@Name("mainMenu")
+(a)Scope(ScopeType.SESSION)
+@SessionExpired
+public class MainMenuBean implements Serializable {
+
+ /**
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = -168958038461724140L;
+
+ /**
+ * {@link User} instance injection.
+ */
+ @In
+ private User user;
+
+ /**
+ * {@link TreeViewBean} instance injection.
+ */
+ @In(required = false)
+ private TreeViewBean treeBean;
+
+ /**
+ * {@link EditContentBean} instance injection.
+ */
+ @In(required = false)
+ private EditContentBean editContent;
+
+ /**
+ * Represents current content constant to include.
+ */
+ private String currentContentView = ContentViewConstants.VIEW;
+
+ public String doNavigationRoot() {
+ treeBean.setTreeCollapseNeeded(true);
+ treeBean.setNewNode(treeBean.getRootNode());
+ return null;
+ }
+
+ /**
+ * Empty action.
+ *
+ * @return the same view
+ */
+ public String doOption() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * JSF listener. Used to switch content views.
+ *
+ * @param event the event of {@link ActionEvent}
+ */
+ public void widgetListener(ActionEvent event) {
+ final Object source = event.getSource();
+
+ if (source instanceof HtmlMenuItem) {
+ HtmlMenuItem menuItem = (HtmlMenuItem) source;
+
+ if ("view".equals(menuItem.getId())) {
+ currentContentView = ContentViewConstants.VIEW;
+ } else if ("edit".equals(menuItem.getId())) {
+ currentContentView = ContentViewConstants.EDIT;
+ } else if ("history".equals(menuItem.getId())) {
+ currentContentView = ContentViewConstants.HISTORY;
+ } else if ("add".equals(menuItem.getId())) {
+ currentContentView = ContentViewConstants.ADD;
+ } else if ("report".equals(menuItem.getId())) {
+ currentContentView = ContentViewConstants.REPORT;
+ }
+
+ // stop edit content conversation
+ if (!"edit".equals(menuItem.getId()) && editContent != null) {
+ editContent.stopEditConversation();
+ }
+ }
+ }
+
+ /**
+ * Method checks if node was selected to have an ability to perform actions.
+ *
+ * @return flag which shows an ability to perform actions on selected node.
+ */
+ public boolean isToolbarItemsAvailable() {
+ return treeBean != null && treeBean.getSelectedNode() != null &&
treeBean.getSelectedNode().getParent() != null;
+ }
+
+ /**
+ * Method that used to disable clicked menu item.
+ *
+ * @param viewId content view id
+ *
+ * @return true if menu item was clicked.
+ */
+ public boolean isTollbarItemClicked(String viewId) {
+ if ("add".equals(viewId) &&
currentContentView.equals(ContentViewConstants.ADD)
+ || "view".equals(viewId) &&
currentContentView.equals(ContentViewConstants.VIEW)
+ || "edit".equals(viewId) &&
currentContentView.equals(ContentViewConstants.EDIT)
+ || "history".equals(viewId) &&
currentContentView.equals(ContentViewConstants.HISTORY)
+ || "report".equals(viewId) &&
currentContentView.equals(ContentViewConstants.REPORT)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public String getFullNodeName() {
+ String result = "";
+
+ Node currentNode = treeBean.getSelectedNode().getNode();
+ if (currentNode != null) {
+ result += (currentNode.getName());
+ Node parent = currentNode.getParentNode();
+ while (parent != null) {
+ result = parent.getName() + " - " + result;
+ parent = parent.getParentNode();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Logout from session.
+ *
+ * @return outcome which redirects to login page.
+ */
+ public String logout() {
+ Session.instance().invalidate();
+
+ return "reloaded";
+ }
+
+ /**
+ * Setter for the current content.
+ *
+ * @param currentContentView the current content.
+ */
+ public void setCurrentContentView(String currentContentView) {
+ this.currentContentView = currentContentView;
+ }
+
+ /**
+ * Getter for the current content.
+ *
+ * @return the current content.
+ */
+ public String getCurrentContentView() {
+ return currentContentView;
+ }
+
+ /**
+ * Method returns loginned user login.
+ *
+ * @return the user login.
+ */
+ public String getLoginnedUser() {
+ return user.getLogin();
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/APMSCore.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/APMSCore.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/APMSCore.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,115 @@
+/*
+ * APMSCore.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 262 $ $Date: 2008-03-17 16:40:12 +0200 (Mon, 17 Mar 2008) $
+ */
+package com.exadel.apms.session;
+
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.entity.History;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.IAPMSCore;
+import com.exadel.apms.interfaces.INodeManager;
+
+/**
+ * Main service class for APMS project(application scope). It is single entry-point for
web-services and UI beans
+ * <p>Implement com.exadel.apms.interfaces.IAPMSCore</p>
+ * <p>
+ * Responsibilities:
+ * <li>Get hierarchy of nodes for populating tree</li>
+ * <li>Get instance of NodeManager, responsible for node management</li>
+ * <li>Get history for certain node</li>
+ * <li>Get formula for certain node</li>
+ * <li>Get formula parameters for certain node</li>
+ * <li>Get schedulers for certain node</li>
+ * <li>Recalculating of status certain node and it;s parents</li>
+ * </p>
+ * @author Andrey Markhel
+ */
+@Stateful
+@Name("apmsCore")
+(a)Scope(ScopeType.APPLICATION)
+@SessionExpired
+public class APMSCore implements IAPMSCore {
+
+ @Logger
+ private Log log;
+
+ @In(create = true, required = true)
+ private INodeManager manager;
+
+ /**
+ * Get instance of NodeManager, responsible for node management
+ *
+ * @return nodeManager
+ */
+ public INodeManager getNodeManager() {
+ return manager;
+ }
+
+ /**
+ * Get root of hierarchy of nodes for populating first tier of tree
+ *
+ * @return List of nodes, hasn't parent
+ */
+ public List<Node> getHierarchy() {
+ List<Node> root = this.getNodeManager().getRoot();
+ return root;
+ }
+
+ /**
+ * Get history for certain node by node id
+ *
+ * @param id - id of node item to retrieve history
+ * @return List - list of History objects for certain node
+ */
+ public List<History> getHistoryById(Long id) {
+ return this.getNodeManager().getHistoryById(id);
+ }
+
+ /**
+ * Get formula parameters for certain node
+ *
+ * @param nodeId - id of node item to retrieve formula parameters
+ * @return List - list of FormulaParam objects for certain node
+ * @throws APMSException
+ */
+ public List<FormulaParam> getFormulaParams(Long nodeId) throws APMSException {
+ return this.getNodeManager().getFormulaParams(nodeId);
+ }
+
+ /**
+ * Recalculate status of certain node and their parents
+ *
+ * @param nodeId - id of node item to recalculate
+ * @param formulaParams - List of Double parameters, reflecting current status of node
+ * @throws APMSException
+ *
+ */
+ public void recalculate(long nodeId, List<Double> formulaParams) throws
APMSException {
+ this.getNodeManager().recalculate(nodeId, formulaParams);
+ }
+
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3 specification)
+ *
+ */
+ @Remove
+ @Destroy
+ public void destroy() {
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/NodeManager.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/NodeManager.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/NodeManager.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,300 @@
+/*
+ * NodeManager.java
+ * Last modified by: $Author: amarkhel $
+ * $Revision: 332 $ $Date: 2008-03-20 13:57:50 +0200 (Thu, 20 Mar 2008) $
+ */
+package com.exadel.apms.session;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.hibernate.StaleObjectStateException;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.entity.GenericFormula;
+import com.exadel.apms.entity.History;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.INodeManager;
+
+/**
+ * Node management service for APMS project. It is single entry-point for node
+ * management
+ * <p>
+ * Implement com.exadel.apms.interfaces.INodeManager
+ * </p>
+ * <p>
+ * Responsibilities:
+ * <li>Get root hierarchy of nodes for populating tree</li>
+ * <li>Delete node</li>
+ * <li>Update node</li>
+ * <li>Create node</li>
+ * <li>Get childs of node</li>
+ * <li>Get node by id</li>
+ * <li>Recalculating of status certain node and it;s parents</li>
+ * <li>Get history for certain node</li>
+ * <li>Get formula parameters for certain node</li>
+ *
+ * @author Andrey Markhel
+ */
+@Stateful
+@Name("manager")
+(a)Scope(ScopeType.APPLICATION)
+@AutoCreate
+@SessionExpired
+public class NodeManager implements INodeManager {
+
+ @PersistenceContext(unitName = "seam", type =
PersistenceContextType.EXTENDED)
+ private EntityManager em;
+
+ @Logger
+ private Log log;
+
+ /**
+ * Get root of hierarchy of nodes for populating first tier of tree
+ *
+ * @return List of nodes, hasn't parent
+ */
+ @SuppressWarnings("unchecked")
+ public List<Node> getRoot() {
+ List<Node> root = em.createQuery(
+ "select n from Node n where n.parentNode = null")
+ .getResultList();
+ for (Node node : root) {
+ updateNodeStatusIfNeeded(node);
+ }
+ return root;
+ }
+
+ /**
+ * Get childs of node for populating next tier of tree
+ *
+ * @param id -
+ * id to lookup
+ * @return List of childs for specified node
+ */
+ @SuppressWarnings("unchecked")
+ public List<Node> getChilds(Long id) {
+ List<Node> childs = em.createQuery(
+ "select n.childNodes from Node n where n.id =:id ")
+ .setParameter("id", id).getResultList();
+ for (Node node : childs) {
+ updateNodeStatusIfNeeded(node);
+ }
+ return childs;
+ }
+
+ /**
+ * Create and save new node in database
+ *
+ * @param n -
+ * node to save
+ * @throws APMSException
+ */
+ public void addNode(Node n) throws APMSException {
+ try {
+ n.setLastUpdated(new Date());
+ addFormulaIfNeeded(n);
+ if(n.getParentNode()!=null){
+ GenericFormula f = new GenericFormula();
+ f.setEvaluate(null);
+ f.setFormula("max");
+ n.getParentNode().setFormula(f);
+ n.getParentNode().addChildNode(n);
+ }
+ //em.persist(n.getFormula());
+ em.persist(n);
+ em.flush();
+ } catch (Exception e) {
+ log
+ .debug("This node is not correct. Please, provide correct information");
+ APMSException ae = new APMSException(
+ "This node is not correct. Please, provide correct information",
+ e);
+ throw ae;
+ }
+ }
+
+ /**
+ * Delete specified node from database
+ *
+ * @param n -
+ * node to delete
+ * @throws APMSException
+ */
+ public void deleteNode(Node n) throws APMSException {
+ try {
+ em.remove(n);
+ em.flush();
+ } catch (Exception e) {
+ log.debug("This node was updated by another user");
+ APMSException ae = new APMSException(
+ "This node was updated by another user", e);
+ throw ae;
+ }
+ }
+
+ /**
+ * Update specified node
+ *
+ * @param n -
+ * node to update
+ * @throws APMSException
+ */
+ public void updateNode(Node n) throws APMSException {
+ try {
+ em.merge(n);
+ n.setLastUpdated(new Date());
+ em.flush();
+ } catch (StaleObjectStateException e) {
+ log.debug("This node was updated by another user");
+ APMSException ae = new APMSException(
+ "This node was updated by another user", e);
+ throw ae;
+ }
+ }
+
+ /**
+ * Get node by it's id
+ *
+ * @param id -
+ * id to lookup
+ *
+ * @return node instance
+ */
+ public Node getNodeById(Long id) {
+ Node node = (Node) em.createQuery(
+ "select n from Node n where n.id =:id").setParameter("id", id)
+ .getSingleResult();
+ updateNodeStatusIfNeeded(node);
+ return node;
+ }
+
+ /**
+ * Get history for certain node by node id
+ *
+ * @param id -
+ * id of node item to retrieve history
+ * @return List - list of History objects for certain node
+ */
+ @SuppressWarnings("unchecked")
+ public List<History> getHistoryById(Long id) {
+ return em.createQuery(
+ "select h from History h where h.parentNode.id =:id")
+ .setParameter("id", id).getResultList();
+ }
+
+ /**
+ * Get formula parameters for certain node
+ *
+ * @param id -
+ * id of node item to retrieve formula parameters
+ * @return List - list of FormulaParam objects for certain node
+ * @throws APMSException
+ */
+ public List<FormulaParam> getFormulaParams(Long id) throws APMSException {
+ Node node = em.find(Node.class, id);
+ if (node != null) {
+ if (isFormulaValid(node)) {
+ return node.getFormula().getParams();
+ }
+ return null;
+ } else {
+ log.debug("The node with id = " + id + " not exist ");
+ APMSException ae = new APMSException("The node with id = " + id
+ + " not exist ");
+ throw ae;
+ }
+ }
+
+ /**
+ * Recalculate status of certain node and their parents
+ *
+ * @param nodeId -
+ * id of node item to recalculate
+ * @param formulaParams -
+ * List of Double parameters, reflecting current status of node
+ * @throws APMSException
+ *
+ */
+ public void recalculate(long nodeId, List<Double> formulaParams)
+ throws APMSException {
+ try {
+ em.flush();
+ Node node = em.find(Node.class, nodeId);
+ if (node != null) {
+ prepareFormulaParams(formulaParams, node);
+ node.calculateStatus(true);
+ em.flush();
+ } else {
+ log.debug("The node with id = " + nodeId + " not exist ");
+ APMSException ae = new APMSException("The node with id = "
+ + nodeId + " not exist ");
+ throw ae;
+ }
+ } catch (Exception e) {
+ log.debug(e);
+ APMSException ae = new APMSException(
+ "Problem encountered during recalculating process. See log for details",
+ e);
+ throw ae;
+ }
+ }
+
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3
+ * specification)
+ *
+ */
+ @Remove
+ @Destroy
+ public void destroy() {
+ }
+
+ private void addFormulaIfNeeded(Node n) {
+ if (!(n.getFormula() != null)) {
+ GenericFormula formula = new GenericFormula();
+ formula.setName("Formula");
+ formula.setFormula("max");
+ n.setFormula(formula);
+ }
+ }
+
+ private boolean isFormulaValid(Node node) {
+ return null != node.getFormula()
+ && null != node.getFormula().getParams()
+ && node.getFormula().getParams().size() > 0;
+ }
+
+ private void updateNodeStatusIfNeeded(Node node) {
+ if (node.isOutdated()) {
+ calculateStatus(node);
+ }
+ }
+
+ private void calculateStatus(Node node) {
+ node.calculateStatus(false);
+ }
+
+ private void prepareFormulaParams(List<Double> formulaParams, Node node) {
+ if (node != null && node.getFormula() != null) {
+ List<FormulaParam> array = node.getFormula().getParams();
+ for (int i = 0; i < array.size(); i++) {
+ array.get(i).setValue(formulaParams.get(i));
+ }
+ }
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpired.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpired.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpired.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,13 @@
+package com.exadel.apms.session;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+import org.jboss.seam.annotations.intercept.Interceptors;
+
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Interceptors(SessionExpiredInterceptor.class)
+public @interface SessionExpired {}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpiredInterceptor.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpiredInterceptor.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/SessionExpiredInterceptor.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,28 @@
+package com.exadel.apms.session;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.jboss.seam.annotations.intercept.AroundInvoke;
+import org.jboss.seam.intercept.InvocationContext;
+
+public class SessionExpiredInterceptor {
+
+ @AroundInvoke
+ public Object checkLoggedIn(InvocationContext invocation) throws Exception {
+ HttpServletRequest request = (HttpServletRequest) FacesContext
+ .getCurrentInstance().getExternalContext().getRequest();
+
+ if (request.getRequestedSessionId() != null
+ && request.getSession().isNew()) {
+
+ // the user is not logged in, fwd to login page
+ return "login";
+
+ } else {
+ // the user is already logged in
+ return invocation.proceed();
+ }
+ }
+
+}
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/UsersManager.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/UsersManager.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/session/UsersManager.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,52 @@
+ /*
+ * UsersManager.java Date created: 17.09.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package com.exadel.apms.session;
+
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import com.exadel.apms.entity.User;
+import com.exadel.apms.interfaces.IUsersManager;
+
+@Stateful
+@Name("usersManager")
+(a)Scope(ScopeType.APPLICATION)
+@SessionExpired
+public class UsersManager implements IUsersManager {
+
+ @PersistenceContext(unitName = "seam", type =
PersistenceContextType.EXTENDED)
+ private EntityManager em;
+
+ @SuppressWarnings("unchecked")
+ public List<User> getUsers() {
+ List<User> users = em.createQuery(
+ "select from Users")
+ .getResultList();
+ return users;
+ }
+
+ public void addUser(User user) {
+ em.persist(user);
+ em.flush();
+ }
+
+ @Remove
+ @Destroy
+ public void destroy() {
+
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/tree/FormTreeNode.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/tree/FormTreeNode.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/tree/FormTreeNode.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,272 @@
+/*
+ * FormTreeNode.java Date created: Mar 3, 2008
+ * Last modified by: $Author: aareshchanka $
+ * $Revision: 209 $ $Date: 2008-03-13 13:55:53 +0200 (Thu, 13 Mar 2008) $
+ */
+package com.exadel.apms.tree;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.domain.seam.constants.TreeTypeEnum;
+import org.richfaces.model.TreeNode;
+
+import com.exadel.apms.entity.Node;
+
+/**
+ * Class for representation of tree model.
+ *
+ * @author aareshchanka
+ */
+
+public class FormTreeNode implements TreeNode {
+
+ private static final long serialVersionUID = -5498990493803705085L;
+ private int formIndex;
+ private int totalInstances = -1;
+ private Object data;
+ private TreeNode parent;
+ private List<Map.Entry> childrenList = new LinkedList<Map.Entry>();
+ private TreeTypeEnum iconEnum;
+ private Node node;
+
+ /**
+ * minimal constructor
+ *
+ * @param data {@link Object} instance to populate data field
+ * @param status {@link TreeTypeEnum} instance to define color status
+ * */
+ public FormTreeNode(Object data, TreeTypeEnum status) {
+ super();
+ this.data = data;
+ this.iconEnum = status;
+ }
+
+ /**
+ * default constructor
+ * */
+ public FormTreeNode() {
+ super();
+ }
+
+ /**
+ * public constructor
+ *
+ * @param node {@link Node} instance to populate node field
+ * @param currentRootNode {@link FormTreeNode} instance to define parent field
+ * */
+ public FormTreeNode(Node node, FormTreeNode currentRootNode) {
+ super();
+ this.node = node;
+ this.parent = (TreeNode) currentRootNode;
+ }
+
+ /**
+ * adds child node
+ *
+ * @param childNode instance of child node to be added
+ * */
+ public void addChildNode(FormTreeNode childNode) {
+ addChild(childNode.getKey(), childNode);
+ }
+
+ /**
+ * @return the formIndex
+ */
+ public int getFormIndex() {
+ return formIndex;
+ }
+
+ /**
+ * @return the totalInstances
+ */
+ public int getTotalInstances() {
+ return totalInstances;
+ }
+
+ /**
+ * @param totalInstances the totalInstances to set
+ */
+ public void setTotalInstances(int totalInstances) {
+ this.totalInstances = totalInstances;
+ }
+
+ /**
+ * @return the data
+ */
+ public Object getData() {
+ return this;
+ }
+
+ /**
+ * returns child instance by id
+ *
+ * @param identifier id of child
+ * @return {@link TreeNode} instance of child, can be casted to {@link FormTreeNode}
+ * */
+ public TreeNode getChild(Object identifier) {
+ for (Map.Entry e : childrenList) {
+ if (e.getKey().equals(identifier)) {
+ return (FormTreeNode) e.getValue();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * adds child into current node
+ *
+ * @param identifier id of child to be added
+ * @param child instance of child to be added
+ * */
+ public void addChild(Object identifier, TreeNode child) {
+ if (!(child instanceof FormTreeNode)) {
+ throw new IllegalArgumentException(
+ "child should be instanceof FormTreeNode");
+ }
+ child.setParent(this);
+ childrenList.add(new EntryImpl(identifier, child));
+ }
+
+ /**
+ * removes child from current node
+ *
+ * @param identifier id of child to be removed
+ * */
+ public void removeChild(Object identifier) {
+ for (int i = 0; i < childrenList.size(); i++) {
+ FormTreeNode f = (FormTreeNode) childrenList.get(i).getValue();
+ if (f == null) {
+ continue;
+ }
+ if (childrenList.get(i).getKey().equals(identifier)) {
+ childrenList.remove(i);
+ }
+ }
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ /**
+ * @return the parent
+ */
+ public TreeNode getParent() {
+ return parent;
+ }
+
+ /**
+ * @param parent the parent to set
+ */
+ public void setParent(TreeNode parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * @return {@link Iterator} of current childrenList
+ * */
+ public Iterator getChildren() {
+ return childrenList.iterator();
+ }
+
+ /**
+ * return true if current Node is leaf, otherwise false
+ * */
+ public boolean isLeaf() {
+ return childrenList.isEmpty();
+ }
+
+ /**
+ * @return key for current node
+ * */
+ public String getKey() {
+ if (getNode() == null) {
+ return "_" + getFormIndex();
+ }
+ return getNode().getId() + "_" + getFormIndex();
+ }
+
+ /**
+ * inner class for iteration through children list
+ * */
+ public class EntryImpl implements Map.Entry {
+ private Object key = null;
+ private Object value = null;
+
+ /**
+ * public full constructor
+ *
+ * @param key key value
+ * @param value
+ * */
+ public EntryImpl(Object key, Object value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ /**
+ * @return the key
+ */
+ public Object getKey() {
+ return key;
+ }
+
+ /**
+ * @return the value
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public Object setValue(Object value) {
+ Object tmpV = value;
+ this.value = value;
+ return tmpV;
+ }
+ }
+
+ /**
+ * @return the childrenList
+ */
+ public List<Map.Entry> getChildrenList() {
+ return childrenList;
+ }
+
+ /**
+ * @return the iconEnum
+ */
+ public TreeTypeEnum getIconEnum() {
+ return iconEnum;
+ }
+
+ /**
+ * @param iconEnum the iconEnum to set
+ */
+ public void setIconEnum(TreeTypeEnum iconEnum) {
+ this.iconEnum = iconEnum;
+ }
+
+ /**
+ * @return the node
+ */
+ public Node getNode() {
+ return node;
+ }
+
+ /**
+ * @param node the node to set
+ */
+ public void setNode(Node node) {
+ this.node = node;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/util/BeanShellHelper.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/util/BeanShellHelper.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/util/BeanShellHelper.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,160 @@
+/*
+ * BeanShellHelper.java Date created: Mar 14, 2008
+ * Last modified by: $Author: vsoskin $
+ * $Revision: 315 $ $Date: 2008-03-18 22:52:39 +0200 (Tue, 18 Mar 2008) $
+ */
+package com.exadel.apms.util;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.apache.commons.lang.StringUtils;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+import bsh.Interpreter;
+
+import com.exadel.apms.contentview.EditContentBean.EditParams;
+import com.exadel.apms.entity.FormulaParam;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.IBeanShellHelper;
+
+/**
+ * Class for executing operations with BeanShell evaluations.
+ *
+ * @author aareshchanka
+ *
+ */
+@Stateful
+@Name("beanShellhelper")
+(a)Scope(ScopeType.SESSION)
+@AutoCreate
+public class BeanShellHelper implements IBeanShellHelper {
+ /* private class logger */
+ @Logger
+ private Log log;
+
+ /**
+ * evaluates BeanShell expressions
+ *
+ * @param expression
+ * String BeanShell expression to be evaluated
+ * @param editFormulaParams
+ * collection of {@link FormulaParam} instances to evaluate
+ * expression
+ * @return current result
+ * @throws APMSException
+ * custom exception if any error occured
+ */
+ public Double evaluate(String expression,
+ List<FormulaParam> editFormulaParams) throws APMSException {
+ try {
+ Interpreter i = new Interpreter();
+ double[] input = new double[editFormulaParams.size()];
+ for (int k = 0; k < editFormulaParams.size(); k++) {
+ FormulaParam par = editFormulaParams.get(k);
+ input[k] = par.getValue() == null ? 0.0 : par.getValue()
+ .doubleValue();
+ i.set(par.getName().trim().replace(' ', '_'),
+ par.getValue() == null ? 0.0 : par.getValue()
+ .doubleValue());
+ }
+ i.set("input", input);
+ i.set("inputMap", editFormulaParams);
+ i.getClassManager().classForName(
+ "com.exadel.apms.entity.FormulaParam");
+
+ return Double.valueOf(i.eval(expression).toString());
+
+ } catch (Exception e) {
+ log.error("BeanShellHelper evaluate method exception: ", e);
+ throw new APMSException("Could not evaluate expression: "
+ + e.getMessage());
+ }
+ }
+
+ public String createMaxFormula(List<EditParams> editFormulaParams) {
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("//@+++MAX\n");
+ for (EditParams fp : editFormulaParams) {
+ Double[] param = fp.getBoundParams();
+ sb.append("//@" + fp.getEditParam().getName() + ";" + param[0]
+ + ";" + param[1] + ";" + param[2] + ";" + param[3] +
";\n");
+ }
+ sb.append("//END;\n");
+ int k = 0;
+ for (EditParams fp : editFormulaParams) {
+ Double[] param = fp.getBoundParams();
+ sb.append("if (input[" + k + "] > " + param[1] + "
&& input[" + k
+ + "] < " + param[2] + " )\n");
+ sb.append("input[" + k + "] = 1.0;\n");
+ sb.append("else if (input[" + k + "] > " + param[0] + "
&& input["
+ + k + "] < " + param[3] + ")\n");
+ sb.append("input[" + k + "] = 51.0;\n");
+ sb.append("else input[" + k + "] = 201.0;\n");
+ k++;
+ }
+
+ sb.append("double result = -99999.0;\n");
+ sb.append("for(int i=0; i< input.length;i++){\n");
+ sb.append(" if(result<input[i])\n");
+ sb.append("result=input[i];\n");
+ sb.append("}\nreturn result;\n");
+
+ return sb.toString();
+
+ }
+
+ public Map<String, Double[]> unparseMaxParams(String formula) {
+ if (!StringUtils.isEmpty(formula)) {
+ try {
+ if (formula.startsWith("//@+++MAX\n")) {
+ Map<String, Double[]> tmpMap = new HashMap<String, Double[]>();
+ formula.replace("//@+++MAX", "");
+ String tmpEval = formula.substring(9, formula
+ .indexOf("//END;\n"));
+ StringTokenizer st = new StringTokenizer(tmpEval, "\n//@");
+ while (st.hasMoreTokens()) {
+ String name = st.nextToken();
+ StringTokenizer innerSt = new StringTokenizer(name, ";");
+ while (innerSt.hasMoreTokens()) {
+ String innerTmp = innerSt.nextToken();
+ Double[] array = {
+ Double.valueOf(innerSt.nextToken()),
+ Double.valueOf(innerSt.nextToken()),
+ Double.valueOf(innerSt.nextToken()),
+ Double.valueOf(innerSt.nextToken()) };
+ tmpMap.put(innerTmp, array);
+ }
+ }
+ return tmpMap;
+ }
+ } catch (Exception e) {
+ log.info("", e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Marker method, needed for marker end of conversation(by EJB3
+ * specification)
+ *
+ */
+ @Remove
+ @Destroy
+ public void destroy() {
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/RevisionViewBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/RevisionViewBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/RevisionViewBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,72 @@
+ /*
+ * RevisionViewBean.java Date created: Mar 19, 2008
+ * Last modified by: $Author: vgolub $
+ * $Revision: 328 $ $Date: 2008-03-19 18:42:15 +0200 (Wed, 19 Mar 2008) $
+ */
+package com.exadel.apms.view;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
+
+
+/**
+ * Class creates revision number record.
+ * @author aareshchanka
+ *
+ */
+(a)Scope(ScopeType.SESSION)
+@Name("revisionBean")
+public class RevisionViewBean {
+
+ @Logger Log log;
+ /* property for storing revision number */
+ private String revision;
+
+ /** Default constructor. Receives SVN version from revision.info file */
+ public RevisionViewBean() {
+ Properties revisionProperties = new Properties();
+ try {
+
+ InputStream Istream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("revision.info");
+ //revision = revisionProperties.getProperty("Implementation-Version") +
"." + slurp(Istream) ;
+ revision = slurp(Istream) ;
+ } catch (IOException e) {
+ log.info(e);
+ }
+ }
+
+ private static String slurp (InputStream in) throws IOException {
+ StringBuffer out = new StringBuffer();
+ byte[] b = new byte[4096];
+
+ if (null != in) {
+ for (int n; (n = in.read(b)) != -1;) {
+ out.append(new String(b, 0, n));
+ }
+ }
+ return out.toString();
+ }
+
+
+ /**
+ * @return the revision
+ */
+ public String getRevision() {
+ return revision;
+ }
+
+ /**
+ * @param revision the revision to set
+ */
+ public void setRevision(String revision) {
+ this.revision = revision;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/TreeViewBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/TreeViewBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/TreeViewBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,456 @@
+/*
+ * TreeViewBean.java Date created: Mar 3, 2008
+ * Last modified by: $Author: vgolub $
+ * $Revision: 333 $ $Date: 2008-03-21 15:53:56 +0200 (Fri, 21 Mar 2008) $
+ */
+package com.exadel.apms.view;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.FacesEvent;
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.component.html.HtmlAjaxCommandButton;
+import org.domain.seam.constants.TreeTypeEnum;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.component.html.HtmlTree;
+import org.richfaces.component.state.TreeState;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeRowKey;
+
+import com.exadel.apms.contentview.ContentViewConstants;
+import com.exadel.apms.contentview.EditContentBean;
+import com.exadel.apms.entity.Node;
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.IAPMSCore;
+import com.exadel.apms.mainmenu.MainMenuBean;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.tree.FormTreeNode;
+
+/**
+ * Managed bean for representation of tree.
+ *
+ * @author aareshchanka
+ *
+ */
+@Name("treeBean")
+(a)Scope(ScopeType.SESSION)
+@SessionExpired
+public class TreeViewBean implements Serializable {
+
+ /*
+ * Serialization constant.
+ */
+ private static final long serialVersionUID = 2217000814051804282L;
+
+ static final String TREE_ID = "treeComponent";
+
+ /*
+ * Log instance.
+ */
+ @Logger
+ private Log log;
+
+ /* FormTreeNode instace for keeping data about tree */
+ private FormTreeNode rootNode;
+
+ /*
+ * {@link TreeViewBean} current selected node.
+ */
+ @Out(scope = ScopeType.SESSION, required = false)
+ private FormTreeNode selectedNode;
+
+ /*
+ * {@link MainMenuBean} current MainMenu instance.
+ */
+ @In
+ private MainMenuBean mainMenu;
+
+ /*
+ * {@link APMSCore} instance injection.
+ */
+ @In(value = "apmsCore", create = true)
+ private IAPMSCore core;
+
+ /**
+ * {@link EditContentBean} injection.
+ */
+ @In(required = false)
+ private EditContentBean editContent;
+
+ /*
+ * {@link Node} instance for newly created nodes.
+ */
+ private Node node_to_add = new Node();
+
+ /* list of possible node statuses */
+ private List<SelectItem> nodeStatuses;
+ /* enumeration of node statuses */
+ private TreeTypeEnum nodeStatus;
+
+ private boolean isTreeCollapseNeeded;
+
+ /**
+ * performs delete node action
+ *
+ * @param e current ActionEvent from UI button
+ *
+ */
+ public void deleteNode(ActionEvent e) {
+ try {
+ core.getNodeManager().deleteNode(selectedNode.getNode());
+ ((FormTreeNode) selectedNode).getParent().removeChild(selectedNode.getKey());
+
+ if (null != editContent) {
+ editContent.stopEditConversation();
+ }
+ FacesMessages.instance().add("Node " + selectedNode.getNode().getName() +
" was successfully deleted.");
+ } catch (APMSException e1) {
+ e1.printStackTrace();
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, e1.getMessage());
+ }
+ selectedNode = (FormTreeNode) selectedNode.getParent();
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+ }
+
+ /**
+ * performs add node action
+ *
+ * @param event current ActionEvent from UI button
+ *
+ */
+ public void addNode(ActionEvent event) {
+ HtmlAjaxCommandButton button = (HtmlAjaxCommandButton) event.getSource();
+
+ if ("addNodeButton".equals(button.getId())) {
+ Node node = new Node(this.node_to_add.getName(),
+ null == selectedNode ? null : selectedNode.getNode());
+ node.setStatus(TreeTypeEnum.BLACK_ID);
+ node.setDescription(this.node_to_add.getDescription());
+
+ FormTreeNode treeNode = new FormTreeNode(node, selectedNode);
+ treeNode.setParent(selectedNode);
+ treeNode.setIconEnum(TreeTypeEnum.BLACK);
+ try {
+ core.getNodeManager().addNode(node);
+ selectedNode.addChildNode(treeNode);
+
+ FacesMessages.instance().add("Node " + node_to_add.getName() + " was
successfully added.");
+ } catch (APMSException e) {
+ log.info(e);
+ FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, e.getMessage());
+ return;
+ }
+ } // else if ("cancelChangesButton".equals(button.getId())) {}
+
+ this.node_to_add = new Node();
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+ }
+
+ /**
+ * method that populates rooteNode instances for representation of tree on
+ * the page
+ */
+ public void populateTree() {
+ List<Node> nodeList = core.getHierarchy();
+ rootNode = new FormTreeNode();
+ rootNode.setIconEnum(TreeTypeEnum.BLACK);
+
+ addNodes(rootNode, nodeList);
+
+ selectedNode = rootNode;
+ }
+
+ /*
+ * Adds children for currentRootNode
+ *
+ * @param currentRootNode rootNode that is populated with children
+ * @param childNodes nodes for population
+ */
+ private void addNodes(FormTreeNode currentRootNode, List<Node> childNodes) {
+
+ for (Node node : childNodes) {
+ FormTreeNode tempNode = new FormTreeNode(node, currentRootNode);
+ tempNode.setIconEnum(TreeTypeEnum.getColor(node.getStatus()));
+ for (int i = 0; i < node.getCountChilds(); i++) {
+ tempNode.addChildNode(new FormTreeNode());
+ }
+ currentRootNode.addChildNode(tempNode);
+ }
+ }
+
+ /**
+ * changes status for the whole branch of current node
+ *
+ * @param parent current node to be changed
+ */
+ public void changeStatus(FormTreeNode parent) {
+ if ((parent.getParent() != null) && (parent.getNode() != null)) {
+ parent.setIconEnum(TreeTypeEnum.getColor(core.getNodeManager()
+ .getNodeById(parent.getNode().getId()).getStatus()));
+ changeStatus((FormTreeNode) parent.getParent());
+ }
+
+ }
+
+ /**
+ * Listener that performs on the tree expand action. Populates children of
+ * selected node
+ *
+ * @param e NodeExpandedEvent from UI TreeNode component
+ */
+ public void changeExpandListener(NodeExpandedEvent e) {
+ setTreeCollapseNeeded(false);
+ if (getTree(e).getTreeNode() != null) {
+ FormTreeNode node = (FormTreeNode) (getTree(e).getTreeNode());
+ if (node.getChildren().hasNext()
+ && ((FormTreeNode) ((Map.Entry) node.getChildren().next())
+ .getValue()).getNode() == null) {
+ node.getChildrenList().clear();
+ addNodes(node, core.getNodeManager().getChilds(
+ node.getNode().getId()));
+ }
+
+// if (node.getNode().isOutdated()) {
+// changeStatus((FormTreeNode) node.getParent());
+// }
+
+ }
+ }
+
+ /**
+ * Listener that performs on the tree select action. Populates children of
+ * selected node.
+ *
+ * @param e NodeExpandedEvent from UI TreeNode component
+ */
+ public void nodeSelectionListener(NodeSelectedEvent e) {
+ setTreeCollapseNeeded(false);
+ // end conversation on edit content
+ if (null != editContent) {
+ editContent.stopEditConversation();
+ }
+
+ if (getTree(e).getTreeNode() != null) {
+ setNewNode((FormTreeNode) getTree(e).getTreeNode());
+ }
+ }
+
+ public void setNewNode(FormTreeNode node) {
+ selectedNode = node;
+ mainMenu.setCurrentContentView(ContentViewConstants.VIEW);
+
+ if (selectedNode.getChildren().hasNext()
+ && ((FormTreeNode) ((Map.Entry) selectedNode.getChildren()
+ .next()).getValue()).getNode() == null) {
+ selectedNode.getChildrenList().clear();
+ addNodes(selectedNode, core.getNodeManager().getChilds(
+ selectedNode.getNode().getId()));
+ }
+ }
+
+ public HtmlTree findTreeComp() {
+ HtmlTree result = null;
+
+ FacesContext fContext = FacesContext.getCurrentInstance();
+ result = (HtmlTree) fContext.getViewRoot().findComponent(TREE_ID);
+
+
+ return result;
+ }
+
+ public Boolean adviseNodeSelected(UITree tree) {
+ if (null != selectedNode && null != selectedNode.getNode()) {
+ TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
+ FormTreeNode treeNode = (FormTreeNode) tree.getRowData(treeRowKey);
+ if (treeNode.equals(selectedNode)) {
+ return Boolean.TRUE;
+ }
+ } else if (null != selectedNode && null == selectedNode.getNode()) {
+ return Boolean.FALSE;
+ }
+
+ return null;
+ }
+
+ public Boolean adviseNodeOpened(UITree tree) {
+ if (null != selectedNode && null != selectedNode.getNode() && null !=
selectedNode.getNode().getParentNode()) {
+ TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
+ FormTreeNode treeNode = (FormTreeNode) tree.getRowData(treeRowKey);
+ if (isSelectedNodeAncestor(treeNode)) {
+ return Boolean.TRUE;
+ }
+ } else if (null != selectedNode && null == selectedNode.getNode()) {
+ // Could be only if selectedNode equals to rootNode.
+ if (isTreeCollapseNeeded) {
+ return Boolean.FALSE;
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isSelectedNodeAncestor(FormTreeNode treeNode) {
+ Node selectedNodeAncestor = selectedNode.getNode().getParentNode();
+ while (null != selectedNodeAncestor) {
+ if (treeNode.getNode().equals(selectedNodeAncestor)) {
+ return true;
+ }
+
+ selectedNodeAncestor = selectedNodeAncestor.getParentNode();
+ }
+
+ return false;
+ }
+
+ /**
+ *
+ * @param event current JSF event
+ * @return instance of UITree ,depends on component type, otherwise null.
+ */
+ private UITree getTree(FacesEvent event) {
+ UIComponent component = event.getComponent();
+ if (component instanceof UITree) {
+ return ((UITree) component);
+ }
+ if (component instanceof UITreeNode) {
+ return ((UITree) component.getParent());
+ }
+ return null;
+ }
+
+ /**
+ * @return the rootNode
+ */
+ public FormTreeNode getRootNode() {
+ if (rootNode == null) {
+ populateTree();
+ }
+ return rootNode;
+ }
+
+ /**
+ * @param rootNode the rootNode to set
+ */
+ public void setRootNode(FormTreeNode rootNode) {
+ this.rootNode = rootNode;
+ }
+
+ /**
+ * @return the node_to_add
+ */
+ public Node getNode_to_add() {
+ return node_to_add;
+ }
+
+ /**
+ * @param node_to_add the node_to_add to set
+ */
+ public void setNode_to_add(Node node_to_add) {
+ this.node_to_add = node_to_add;
+ }
+
+ /**
+ * @return the currentNodeStatus
+ */
+ public TreeTypeEnum getCurrentNodeStatus() {
+ return selectedNode.getIconEnum();
+ }
+
+ /**
+ * @param currentNodeStatus the currentNodeStatus to set
+ */
+ public void setCurrentNodeStatus(TreeTypeEnum currentNodeStatus) {
+ selectedNode.setIconEnum(currentNodeStatus);
+ }
+
+ /**
+ * @param nodeStatuses the nodeStatuses to set
+ */
+ public void setNodeStatuses(List<SelectItem> nodeStatuses) {
+ this.nodeStatuses = nodeStatuses;
+ }
+
+ /**
+ * @return the nodeStatus
+ */
+ public List<SelectItem> getNodeStatuses() {
+ if (null == nodeStatuses) {
+ nodeStatuses = new ArrayList<SelectItem>();
+
+ for (TreeTypeEnum enumObj : TreeTypeEnum.values()) {
+ nodeStatuses.add(new SelectItem(enumObj));
+ }
+ }
+ return nodeStatuses;
+ }
+
+ /**
+ * @return the nodeStatus
+ */
+ public TreeTypeEnum getNodeStatus() {
+ return nodeStatus;
+ }
+
+ /**
+ * @param nodeStatus
+ * the nodeStatus to set
+ */
+ public void setNodeStatus(TreeTypeEnum nodeStatus) {
+ this.nodeStatus = nodeStatus;
+ }
+
+ /**
+ * @param reportContentRendered the reportContentRendered to set
+ */
+ public void setReportContentRendered(boolean reportContentRendered) {
+ // Stub for jsf
+ }
+
+ /**
+ * @return true if selectedNode is not null and is leaf, otherwise false
+ */
+ public boolean isReportContentRendered() {
+ return null != getSelectedNode() && getSelectedNode().isLeaf();
+ }
+
+ /**
+ * @return the selectedNode
+ */
+ public FormTreeNode getSelectedNode() {
+ return selectedNode;
+ }
+
+ /**
+ * @param selectedNode the selectedNode to set
+ */
+ public void setSelectedNode(FormTreeNode selectedNode) {
+ this.selectedNode = selectedNode;
+ }
+
+ public void setTreeCollapseNeeded(boolean isTreeCollapseNeeded) {
+ this.isTreeCollapseNeeded = isTreeCollapseNeeded;
+ }
+
+ public boolean isTreeCollapseNeeded() {
+ return isTreeCollapseNeeded;
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/UsersBean.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/UsersBean.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/view/UsersBean.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,35 @@
+ /*
+ * UsersBean.java Date created: 17.09.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package com.exadel.apms.view;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import com.exadel.apms.entity.User;
+import com.exadel.apms.session.SessionExpired;
+import com.exadel.apms.session.UsersManager;
+
+
+@Name("usersBean")
+(a)Scope(ScopeType.SESSION)
+@SessionExpired
+public class UsersBean implements Serializable{
+
+ private static final long serialVersionUID = 7995101372160589746L;
+
+ @In(value="UsersManager", create=true, required=true)
+ private UsersManager manager;
+
+ public List<User> getUsers() {
+ return manager.getUsers();
+ }
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSService.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSService.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSService.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,60 @@
+package com.exadel.apms.webservice;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.naming.InitialContext;
+
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+
+import com.exadel.apms.exceptions.APMSException;
+import com.exadel.apms.interfaces.IAPMSCore;
+
+@Stateless
+@WebService(name = "APMSService", serviceName = "APMSService")
+public class APMSService implements APMSServiceRemote {
+
+ @Logger
+ private Log log;
+
+ @WebMethod
+ public boolean login(String username, String password) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ @WebMethod
+ public boolean logout() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ @WebMethod
+ public void reportData(long nodeId, double[] formulaParams) {
+ List<Double> list = new ArrayList<Double>();
+ for (double d : formulaParams) {
+ list.add(new Double(d));
+ }
+ try {
+ getCore().recalculate(nodeId, list);
+ } catch (APMSException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private IAPMSCore getCore() {
+ try {
+ InitialContext ctx = new InitialContext();
+ IAPMSCore core = (IAPMSCore)
ctx.lookup("APMS-ear-1.0-SNAPSHOT/APMSCore/local");
+ return core;
+ } catch (Exception e) {
+ log.error("TreeViewBean: couldn't load APMSCore", e);
+ return null;
+ }
+ }
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSServiceRemote.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSServiceRemote.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/com/exadel/apms/webservice/APMSServiceRemote.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,13 @@
+package com.exadel.apms.webservice;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface APMSServiceRemote {
+
+ boolean login(String username, String password);
+
+ boolean logout();
+
+ void reportData(long nodeId, double[] formulaParams);
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/Color.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/Color.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/Color.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,29 @@
+ /*
+ * Color.java Date created: Feb 28, 2008
+ * Last modified by: $Author: vgolub $
+ * $Revision: 207 $ $Date: 2008-03-13 13:34:16 +0200 (Thu, 13 Mar 2008) $
+ */
+package org.domain.seam.constants;
+
+/**
+ * Interface that keeps constants for node color representation.
+ * @author aareshchanka
+ *
+ */
+
+public interface Color {
+ /* color names */
+ String GREEN_COLOR = "green";
+ String YELLOW_COLOR = "yellow";
+ String RED_COLOR = "red";
+ String BLACK_COLOR = "black";
+ String WHITE_COLOR = "white";
+
+ /* color id's*/
+ Double GREEN_ID = 0d;
+ Double YELLOW_ID = 1d;
+ Double RED_ID = 2d;
+ Double BLACK_ID = 3d;
+ Double WHITE_ID = 4d;
+
+}
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/TreeTypeEnum.java
===================================================================
---
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/TreeTypeEnum.java
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/java/org/domain/seam/constants/TreeTypeEnum.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,90 @@
+ /*
+ * ColorEnum.java Date created: Feb 28, 2008
+ * Last modified by: $Author: aareshchanka $
+ * $Revision: 232 $ $Date: 2008-03-14 14:29:40 +0200 (Fri, 14 Mar 2008) $
+ */
+package org.domain.seam.constants;
+
+/**
+ * Enumeration for representation of node color.
+ * @author aareshchanka
+ *
+ */
+
+public enum TreeTypeEnum implements Color {
+ GREEN(GREEN_ID, GREEN_COLOR, 0.10001d, 50.0d),
+ BLACK(BLACK_ID, BLACK_COLOR, 500.00001d, 999.0d),
+ RED(RED_ID, RED_COLOR, 200.00001d, 500.0d),
+ YELLOW(YELLOW_ID, YELLOW_COLOR, 50.00001d, 200.0d),
+ WHITE(WHITE_ID, WHITE_COLOR, 0.0d, 0.1d);
+
+ /* This field keep identifier of color */
+ private Double id = null;
+ /* This field keep name of color */
+ private String name = null;
+ private final double min;
+ private final double max;
+
+
+ /*
+ * Private full constructor
+ */
+ private TreeTypeEnum(Double id, String name, double min, double max) {
+ this.id = id;
+ this.name = name;
+ this.min = min;
+ this.max = max;
+ }
+
+ /**
+ * This method is used for get enum instance by key
+ *
+ * @param key we use this key for search needful role
+ * @return UserRoles object
+ */
+ public static TreeTypeEnum getInstanceByIdentifier(Double key) {
+ TreeTypeEnum[] subColorValues = TreeTypeEnum.values();
+ TreeTypeEnum subColorNeeded = null;
+
+ if (key == null) {
+ return subColorNeeded;
+ }
+
+ for (TreeTypeEnum subRole : subColorValues) {
+ if (subRole.getId().equals(key)) {
+ subColorNeeded = subRole;
+ break;
+ }
+ }
+
+ return subColorNeeded;
+ }
+
+ public static TreeTypeEnum getColor(double d) {
+ for (TreeTypeEnum e : TreeTypeEnum.values()) {
+ if ((d > e.min()) && (d <= e.max())) {
+ return e;
+ }
+ }
+ return TreeTypeEnum.BLACK;
+ }
+
+ public Double getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+
+ public double min() {
+ return min;
+ }
+
+ public double max() {
+ return max;
+ }
+
+
+}
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/MANIFEST.MF 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Class-Path: bsh-1.3.0.jar commons-beanutils-1.7.0.jar commons-collecti
+ ons-3.2.jar commons-digester-1.8.jar commons-lang-2.3.jar commons-log
+ ging-1.0.4.jar dom4j-1.6.1-jboss.jar el-api-1.0.jar javassist-3.3.ga.
+ jar jboss-el-2.0.1.GA.jar jboss-seam-2.0.1.GA.jar jboss-seam-debug-2.
+ 0.1.GA.jar jboss-seam-remoting-2.0.1.GA.jar jboss-seam-ui-2.0.1.GA.ja
+ r jsf-api-1.1_02.jar jsf-facelets-1.1.14.jar jsf-impl-1.1_02.jar jstl
+ -1.0.jar log4j-1.2.14.jar richfaces-api-3.1.4.GA.jar richfaces-impl-3
+ .1.4.GA.jar richfaces-ui-3.1.4.GA.jar servlet-api-2.4.jar
+
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/ejb-jar.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/ejb-jar.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
+ <interceptors>
+ <interceptor>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+</ejb-jar>
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/persistence.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/META-INF/persistence.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Persistence deployment descriptor for dev profile -->
+<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="seam">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/seamDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.hbm2ddl.auto"
value="update"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.format_sql" value="true"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/components.properties
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/components.properties
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/components.properties 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,4 @@
+#
+#Wed Feb 27 12:58:12 EET 2008
+jndiPattern=Seam-ear/\#{ejbName}/local
+embeddedEjb=true
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/import.sql
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/import.sql 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,10 @@
+CREATE TABLE Users
+(
+id INT IDENTITY PRIMARY KEY NOT NULL,
+Lastname VARCHAR(50),
+Firstname VARCHAR(50),
+Age INT
+);
+
+INSERT INTO Users(Lastname, Firstname, Age)
values('Markavstov','Andrey',23);
+INSERT INTO Users(Lastname, Firstname, Age)
values('Belaevski','Nick',23);
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/resources/seam.properties
===================================================================
Added: trunk/test-applications/SeamApp/Seam-ejb/src/main/test/login/TestLogin.java
===================================================================
--- trunk/test-applications/SeamApp/Seam-ejb/src/main/test/login/TestLogin.java
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-ejb/src/main/test/login/TestLogin.java 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,107 @@
+ /*
+ * TestLogin.java Date created: May 15, 2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package login;
+
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.mock.SeamTest;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.web.Session;
+import org.testng.annotations.Test;
+
+/**
+ * TODO Class description goes here.
+ * @author aareshchanka
+ *
+ */
+
+public class TestLogin extends SeamTest {
+
+ @Test
+ public void testAuthenticateComponent() throws Exception {
+ new ComponentTest() {
+ protected void testComponents() throws Exception {
+ setValue("#{identity.username}", "admin");
+ setValue("#{identity.password}", "admin");
+ Identity.instance().setPassword("admin");
+ Identity.instance().setUsername("admin");
+ setField(Identity.instance(), "password", "admin");
+ setField(Identity.instance(), "username", "admin");
+ invokeMethod("#{identity.login}");
+ assert invokeMethod("#{identity.login}").equals(true);
+ assert
getValue("#{identity.username}").equals("admin");
+ assert
getValue("#{identity.password}").equals("admin");
+ }
+ }.run();
+ }
+
+ @Test
+ public void testLogin() throws Exception {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ assert !isSessionInvalid();
+ setValue("#{identity.username}", "admin");
+ setValue("#{identity.password}", "admin");
+ }
+
+ @Override
+ protected void invokeApplication() {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() {
+ assert
getValue("#{user.username}").equals("admin");
+ assert
getValue("#{user.password}").equals("admin");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() {
+ assert !Manager.instance().isLongRunningConversation();
+ assert !isSessionInvalid();
+ invokeMethod("#{identity.logout}");
+ assert Session.instance().isInvalid();
+ }
+
+ @Override
+ protected void renderResponse() {
+ assert getValue("#{identity.loggedIn}").equals(false);
+ assert Session.instance().isInvalid();
+ }
+
+ }.run();
+
+ }
+
+}
Added: trunk/test-applications/SeamApp/Seam-web/.classpath
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/.classpath (rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/.classpath 2008-09-17 12:31:08 UTC (rev
10463)
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"
excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/testng/testng/5.5/testng-5.5-jdk15.jar"/>
+</classpath>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/.project
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/.project (rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/.project 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,22 @@
+<projectDescription>
+ <name>Seam-web</name>
+ <comment/>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.jdt.core.prefs 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,5 @@
+#Wed Sep 17 12:51:11 EEST 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added:
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.component 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,9 @@
+<project-modules id="moduleCoreId" project-version="2.0">
+ <wb-module deploy-name="Seam-web">
+ <property name="context-root" value="/SeamApp"/>
+ <wb-resource deploy-path="/"
source-path="src/main/webapp"/>
+ <property name="java-output-path"
value="/target/classes"/>
+ <wb-resource deploy-path="/WEB-INF/classes"
source-path="src/main/java"/>
+ <wb-resource deploy-path="/WEB-INF/classes"
source-path="src/main/resources"/>
+ </wb-module>
+</project-modules>
\ No newline at end of file
Added:
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,6 @@
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.web" version="2.4"/>
+ <installed facet="jst.java" version="5.0"/>
+</faceted-project>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/pom.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/pom.xml (rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/pom.xml 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,48 @@
+<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.richfaces.test-applications</groupId>
+ <artifactId>SeamApp</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.richfaces.test-applications.SeamApp</groupId>
+ <artifactId>Seam-web</artifactId>
+ <name>Seam App Web Module</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.5</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+
<directory>${project.build.directory}</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+</project>
Added: trunk/test-applications/SeamApp/Seam-web/src/copy-web-pages1.bat
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/copy-web-pages1.bat
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/copy-web-pages1.bat 2008-09-17 12:31:08
UTC (rev 10463)
@@ -0,0 +1,2 @@
+xcopy "main/webapp"
"h:/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/APMS-ear.ear/APMS.war/"
/D /S /E /Y
+
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/src/main/copy-web-pages.bat
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/copy-web-pages.bat
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/copy-web-pages.bat 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,2 @@
+xcopy "webapp"
"H:\\jbdevstudio\\jboss-eap\\jboss-as\\server\\default\\deploy\\APMS-ear-1.0-SNAPSHOT.ear\\APMS-1.0-SNAPSHOT.war"
/D /S /E /Y
+
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/src/main/java/messages_en.properties
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/java/messages_en.properties
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/java/messages_en.properties 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,90 @@
+up=\u2191
+down=\u2193
+left=\u2039
+right=\u203A
+
+validator.assertFalse=validation failed
+validator.assertTrue=validation failed
+validator.future=must be a future date
+validator.length=length must be between {min} and {max}
+validator.max=must be less than or equal to {value}
+validator.min=must be greater than or equal to {value}
+validator.notNull=may not be null
+validator.past=must be a past date
+validator.pattern=must match "{regex}"
+validator.range=must be between {min} and {max}
+validator.size=size must be between {min} and {max}
+validator.email=must be a well-formed email address
+
+org.jboss.seam.loginFailed=Login failed
+org.jboss.seam.loginSuccessful=Welcome, #0
+
+org.jboss.seam.TransactionFailed=Transaction failed
+org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another
request
+org.jboss.seam.IllegalNavigation=Illegal navigation
+org.jboss.seam.ProcessEnded=Process #0 already ended
+org.jboss.seam.ProcessNotFound=Process #0 not found
+org.jboss.seam.TaskEnded=Task #0 already ended
+org.jboss.seam.TaskNotFound=Task #0 not found
+org.jboss.seam.NotLoggedIn=Please log in first
+
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected
type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted
information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal
number consisting of zero or more digits, optionally followed by a decimal point and
fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed
integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any
value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII
character
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,
eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be
specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between
4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or
from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or
from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an
enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45
and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be an integer
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number
between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be an integer
+javax.faces.converter.LongConverter.LONG_detail=must be an integer number between
-9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount,
eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount,
eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be an integer
+javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between
-32768 and 32767
+
+javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to
{0}
+javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to
{0}
+javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and
{1}
+javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
+javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to
{0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to
{0} characters
+javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to
{0}
+javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type
+
+javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.converter.STRING=value could not be converted to a string
+
Added: trunk/test-applications/SeamApp/Seam-web/src/main/java/seam.properties
===================================================================
Added: trunk/test-applications/SeamApp/Seam-web/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/resources/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/resources/META-INF/MANIFEST.MF 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/META-INF/MANIFEST.MF 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
---
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.navigation.xml.jsfdia
===================================================================
---
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.navigation.xml.jsfdia
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/.navigation.xml.jsfdia 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/components.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/components.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:core="http://jboss.com/products/seam/core"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/persistence
http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd">
+ <core:init debug="true" jndi-pattern="Seam-ear/#{ejbName}/local"
/>
+ <core:manager concurrent-request-timeout="10000"
conversation-timeout="120000"/>
+</components>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/faces-config.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,8 @@
+<faces-config version="1.2"
+
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">
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+</faces-config>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/jboss-web.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,12 @@
+ <!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>
+ seam.jboss.org:loader=Seam-web
+
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
+ </loader-repository>
+ </class-loading>
+</jboss-web>
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-beanutils.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-beanutils.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-digester.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/commons-digester.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-debug.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-debug.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ioc.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ioc.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-mail.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-mail.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-pdf.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-pdf.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-remoting.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-remoting.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ui.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jboss-seam-ui.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/postgresql-8.3-603.jdbc3.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/postgresql-8.3-603.jdbc3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-impl.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-impl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-ui.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/lib/richfaces-ui.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/navigation.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/navigation.xml
(rev 0)
+++
trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/navigation.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE faces-config
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>
+ <navigation-rule>
+ <from-view-id>login.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>loginned</from-outcome>
+ <to-view-id>home.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/pages.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/pages.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages
xmlns="http://jboss.com/products/seam/pages"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.0.xsd"
+
+ no-conversation-view-id="/home.xhtml"
+ login-view-id="/login.xhtml">
+
+ <page view-id="*">
+ <navigation>
+ <rule if-outcome="loginned">
+ <redirect view-id="/home.xhtml" />
+ </rule>
+ <rule if-outcome="reloaded">
+ <redirect view-id="/login.xhtml" />
+ </rule>
+ </navigation>
+ </page>
+
+</pages>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/WEB-INF/web.xml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/navigation.xml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+
<servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/hello.xhtml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/hello.xhtml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/hello.xhtml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+<body>
+<h:form>
+Enter node name:<br />
+ <h:inputText value="#{person.name}" size="15" />
+ <br />
+ <br />
+ <br />
+ <br />
+ <h:commandButton type="submit" value="Create Node"
+ action="#{manager.addChild(person)}" />
+ <h:commandButton type="submit" value="Delete all"
+ action="#{manager.deleteAll()}" />
+</h:form>
+<f:subview id="childs" rendered="#{!empty(childs)}">
+ <h:dataTable value="#{childs}" var="child">
+ <h:column>
+ <h:outputText value="Name: #{child.name}" />
+ <br />
+ <h:outputText value="Id: #{child.id}" />
+ <br />
+ <h:outputText value="Type: #{child.type}" />
+ <br />
+ <h:outputText value="Status: #{child.status}" />
+ <br />
+ <h:outputText value="Valid Period: #{child.validPeriod}" />
+ <br />
+ <h:outputText value="Last Updated: #{child.lastUpdated}" />
+ <br />
+ <h:outputText value="Parent: #{child.parentNode.id}" />
+ <br />
+ </h:column>
+ </h:dataTable>
+</f:subview>
+</body>
+</html>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/home.xhtml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/home.xhtml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/home.xhtml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,45 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+<head>
+<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+<title>APMS</title>
+</head>
+<body id="pgHome">
+<f:view>
+ <h:form>
+ <h:panelGrid columns="2" columnClasses="col1,col2">
+
+ <rich:dataTable value="#{UsersBean.users}"
var="user">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="LastName"></h:outputText>
+ </f:facet>
+ <h:outputText
value="#{user.lastName}"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="FirstName"></h:outputText>
+ </f:facet>
+ <h:outputText
value="#{user.firstName}"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Age"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{user.age}"></h:outputText>
+ </rich:column>
+ </rich:dataTable>
+
+ <div class="more_right" align="right">© 2008
Exadel, Inc.</div>
+ </h:panelGrid>
+ </h:form>
+</f:view>
+</body>
+</html>
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/index.html
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/index.html
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/index.html 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=login.seam">
+</head>
+</html>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/Seam-web/src/main/webapp/login.xhtml
===================================================================
--- trunk/test-applications/SeamApp/Seam-web/src/main/webapp/login.xhtml
(rev 0)
+++ trunk/test-applications/SeamApp/Seam-web/src/main/webapp/login.xhtml 2008-09-17
12:31:08 UTC (rev 10463)
@@ -0,0 +1,48 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head><title>Login panel</title></head>
+
+<body>
+ <h:messages styleClass="message"/>
+
+ <h:form id="login">
+
+ <rich:panel>
+ <f:facet name="header">Login</f:facet>
+
+ <p>Please login here</p>
+
+ <div class="dialog">
+ <h:panelGrid columns="2" rowClasses="prop"
columnClasses="name,value">
+ <h:outputLabel
for="username">Login</h:outputLabel>
+ <h:inputText id="username"
value="#{user.login}"/>
+
+ <h:outputLabel
for="password">Password</h:outputLabel>
+ <h:inputSecret id="password"
value="#{user.password}"/>
+
+ <h:outputLabel for="rememberMe">Remember
me</h:outputLabel>
+ <h:selectBooleanCheckbox id="rememberMe"
value="#{user.rememberMe}"/>
+ </h:panelGrid>
+ </div>
+
+ </rich:panel>
+
+ <div class="actionButtons">
+ <h:commandButton value="Login"
action="#{authenticator.authenticate}" />
+ </div>
+
+ <div id="temp" align="right">
+ <h:commandButton action="#{authenticator.reloadSession}"
value="Reload session" />
+ </div>
+
+ </h:form>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/test-applications/SeamApp/pom.xml
===================================================================
--- trunk/test-applications/SeamApp/pom.xml (rev 0)
+++ trunk/test-applications/SeamApp/pom.xml 2008-09-17 12:31:08 UTC (rev 10463)
@@ -0,0 +1,66 @@
+<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>
+ <groupId>org.richfaces.test-applications</groupId>
+ <artifactId>SeamApp</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>Seam Applicationt</name>
+ <properties>
+ </properties>
+ <repositories>
+
+ <repository>
+ <id>exadel-repository</id>
+ <name>Exadel Maven Repository Manager</name>
+ <url>http://maven.eltegra.by:8099/repository</url>
+ </repository>
+ <repository>
+ <id>eltegra-maven-proxy</id>
+ <name>Exadel Maven Repository Manager</name>
+ <url>http://maven.eltegra.by:8099/repository</url>
+
+ </repository>
+ </repositories>
+
+ <modules>
+ <module>Seam-ejb</module>
+ <module>Seam-web</module>
+ <module>Seam-ear</module>
+ </modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <wtpmanifest>true</wtpmanifest>
+ <wtpapplicationxml>true</wtpapplicationxml>
+ <wtpversion>2.0</wtpversion>
+ <manifest>
+ ${basedir}/src/main/resources/META-INF/MANIFEST.MF
+ </manifest>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+
+ </plugins>
+ </build>
+<pluginRepositories>
+ <pluginRepository>
+ <id>people.apache.org</id>
+ <
url>http://people.apache.org/repo/m2-snapshot-repository/</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>repository-int.exadel.com</id>
+ <
url>http://repository-int.exadel.com/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+</project>
\ No newline at end of file