Simexplorer-si-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- 1607 discussions
Author: glandais
Date: 2008-01-08 15:41:16 +0000 (Tue, 08 Jan 2008)
New Revision: 102
Added:
trunk/simexplorer-is-entities/
Log:
Entities split
1
0
Author: glandais
Date: 2008-01-08 15:40:30 +0000 (Tue, 08 Jan 2008)
New Revision: 101
Added:
trunk/simexplorer-is-service/
Log:
Service split
1
0
Author: glandais
Date: 2008-01-08 15:30:58 +0000 (Tue, 08 Jan 2008)
New Revision: 100
Removed:
trunk/simexplorer-is-web/build/
Log:
1
0
r99 - in trunk/simexplorer-is-web: . .settings .svn.ok .svn.ok/text-base .svn.ok/tmp build src src/main src/main/java src/main/java/fr src/main/java/fr/cemagref src/main/java/fr/cemagref/simexplorer src/main/java/fr/cemagref/simexplorer/is src/main/java/fr/cemagref/simexplorer/is/ui src/main/java/fr/cemagref/simexplorer/is/ui/web src/main/java/fr/cemagref/simexplorer/is/ui/web/base src/main/java/fr/cemagref/simexplorer/is/ui/web/components src/main/java/fr/cemagref/simexplorer/is/ui
by glandais@users.labs.libre-entreprise.org 08 Jan '08
by glandais@users.labs.libre-entreprise.org 08 Jan '08
08 Jan '08
Author: glandais
Date: 2008-01-08 15:28:20 +0000 (Tue, 08 Jan 2008)
New Revision: 99
Added:
trunk/simexplorer-is-web/.classpath
trunk/simexplorer-is-web/.classpath.tmp
trunk/simexplorer-is-web/.project
trunk/simexplorer-is-web/.settings/
trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs
trunk/simexplorer-is-web/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/simexplorer-is-web/.svn.ok/
trunk/simexplorer-is-web/.svn.ok/dir-prop-base
trunk/simexplorer-is-web/.svn.ok/entries
trunk/simexplorer-is-web/.svn.ok/format
trunk/simexplorer-is-web/.svn.ok/prop-base/
trunk/simexplorer-is-web/.svn.ok/props/
trunk/simexplorer-is-web/.svn.ok/text-base/
trunk/simexplorer-is-web/.svn.ok/text-base/.classpath.svn-base
trunk/simexplorer-is-web/.svn.ok/text-base/.project.svn-base
trunk/simexplorer-is-web/.svn.ok/text-base/pom.xml.svn-base
trunk/simexplorer-is-web/.svn.ok/tmp/
trunk/simexplorer-is-web/.svn.ok/tmp/prop-base/
trunk/simexplorer-is-web/.svn.ok/tmp/props/
trunk/simexplorer-is-web/.svn.ok/tmp/text-base/
trunk/simexplorer-is-web/build/
trunk/simexplorer-is-web/build/classes/
trunk/simexplorer-is-web/pom.xml
trunk/simexplorer-is-web/src/
trunk/simexplorer-is-web/src/main/
trunk/simexplorer-is-web/src/main/java/
trunk/simexplorer-is-web/src/main/java/fr/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCaseMap.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCasePage.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/beans/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/components/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/errors/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/grid/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationDetail.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationExport.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationImport.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupEdit.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserEdit.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/services/
trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
trunk/simexplorer-is-web/src/main/resources/
trunk/simexplorer-is-web/src/main/resources/fr/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/css/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties
trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties
trunk/simexplorer-is-web/src/main/webapp/
trunk/simexplorer-is-web/src/main/webapp/ApplicationDetail.tml
trunk/simexplorer-is-web/src/main/webapp/ApplicationExport.tml
trunk/simexplorer-is-web/src/main/webapp/ApplicationImport.tml
trunk/simexplorer-is-web/src/main/webapp/ApplicationList.tml
trunk/simexplorer-is-web/src/main/webapp/GroupEdit.tml
trunk/simexplorer-is-web/src/main/webapp/GroupList.tml
trunk/simexplorer-is-web/src/main/webapp/META-INF/
trunk/simexplorer-is-web/src/main/webapp/META-INF/MANIFEST.MF
trunk/simexplorer-is-web/src/main/webapp/UserEdit.tml
trunk/simexplorer-is-web/src/main/webapp/UserList.tml
trunk/simexplorer-is-web/src/main/webapp/WEB-INF/
trunk/simexplorer-is-web/src/main/webapp/WEB-INF/lib/
trunk/simexplorer-is-web/src/main/webapp/WEB-INF/web.xml
trunk/simexplorer-is-web/src/main/webapp/images/
trunk/simexplorer-is-web/src/main/webapp/index.html
trunk/simexplorer-is-web/src/main/webapp/js/
trunk/simexplorer-is-web/src/main/webapp/js/dftree.js
trunk/simexplorer-is-web/src/main/webapp/js/treeLoader.js
trunk/simexplorer-is-web/xmi/
trunk/simexplorer-is-web/xmi/simexplorer-is-web.zargo
Log:
Re import (changed web path)
Added: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath (rev 0)
+++ trunk/simexplorer-is-web/.classpath 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-entities"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-service"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/tapestry5-treegrid"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/simexplorer-is-web/.classpath.tmp
===================================================================
--- trunk/simexplorer-is-web/.classpath.tmp (rev 0)
+++ trunk/simexplorer-is-web/.classpath.tmp 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-entities"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-service"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/tapestry5-treegrid"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/simexplorer-is-web/.project
===================================================================
--- trunk/simexplorer-is-web/.project (rev 0)
+++ trunk/simexplorer-is-web/.project 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>simexplorer-is-web</name>
+ <comment></comment>
+ <projects>
+ <project>tapestry5-treegrid</project>
+ <project>simexplorer-is-entities</project>
+ <project>simexplorer-is-service</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,7 @@
+#Tue Jan 08 15:35:48 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/simexplorer-is-web/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,4 @@
+#Tue Jan 08 15:35:52 CET 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:6.0
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.tomcat.runtimeTarget\:\:Apache\ Tomcat\ v5.5/owners=jst.web\:2.4
+eclipse.preferences.version=1
Added: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="simexplorer-is-web">
+ <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+ <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/tapestry5-treegrid/tapestry5-treegrid">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/simexplorer-is-entities/simexplorer-is-entities">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/simexplorer-is-service/simexplorer-is-service">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <property name="context-root" value="simexplorer-is-web"/>
+ <property name="java-output-path" value="build/classes"/>
+ </wb-module>
+</project-modules>
Added: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="Apache Tomcat v5.5"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="6.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Added: trunk/simexplorer-is-web/.svn.ok/dir-prop-base
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/dir-prop-base (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/dir-prop-base 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,6 @@
+K 10
+svn:ignore
+V 7
+target
+
+END
Added: trunk/simexplorer-is-web/.svn.ok/entries
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/entries (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/entries 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,70 @@
+8
+
+dir
+96
+svn+ssh://glandais at labs.libre-entreprise.org/svnroot/simexplorer-si/trunk/simexplorer-is-web
+svn+ssh://glandais at labs.libre-entreprise.org/svnroot/simexplorer-si
+
+
+
+2008-01-04T16:55:38.241469Z
+96
+glandais
+has-props
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+722d4ed1-5654-48f2-973c-fc5317711c57
+
+.classpath
+file
+
+
+
+
+2008-01-08T15:09:45.000000Z
+48b49a178b38b7786930ac3cf87c5b12
+2008-01-04T16:00:46.830564Z
+95
+glandais
+
+.project
+file
+
+
+
+
+2008-01-08T15:09:45.000000Z
+6590a14bf77fc6cf4faa599574bea248
+2007-12-28T16:00:25.257635Z
+91
+glandais
+
+.settings
+dir
+
+pom.xml
+file
+
+
+
+
+2008-01-08T15:10:06.000000Z
+290bf2374d7135771d3a64bfcb9a831d
+2008-01-04T16:00:46.830564Z
+95
+glandais
+
+src
+dir
+
Added: trunk/simexplorer-is-web/.svn.ok/format
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/format (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/format 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1 @@
+8
Added: trunk/simexplorer-is-web/.svn.ok/text-base/.classpath.svn-base
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/text-base/.classpath.svn-base (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/text-base/.classpath.svn-base 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="src" path="target/gen/java"/>
+ <classpathentry kind="src" path="src/ressources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/simexplorer-is-web/.svn.ok/text-base/.project.svn-base
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/text-base/.project.svn-base (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/text-base/.project.svn-base 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>simexplorer-is-web</name>
+ <comment>simexploreris web</comment>
+ <projects>
+ <project>simexplorer-is-storage</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/simexplorer-is-web/.svn.ok/text-base/pom.xml.svn-base
===================================================================
--- trunk/simexplorer-is-web/.svn.ok/text-base/pom.xml.svn-base (rev 0)
+++ trunk/simexplorer-is-web/.svn.ok/text-base/pom.xml.svn-base 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,163 @@
+<?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">
+ <parent>
+ <artifactId>lutinproject</artifactId>
+ <groupId>lutinlib</groupId>
+ <version>2.2</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>simexplorer-is-web</groupId>
+ <artifactId>simexplorer-is-web</artifactId>
+ <packaging>war</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <description></description>
+
+ <profiles>
+ <profile>
+ <id>project</id>
+
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <properties>
+ <!--Source base dir-->
+ <maven.src.dir>
+ ${basedir}/target/src-build
+ </maven.src.dir>
+
+ <!--Test-->
+ <maven.test.skip>true</maven.test.skip>
+
+ <!--Compile with ?-->
+ <maven.compile.source>1.5</maven.compile.source>
+ <maven.compile.target>1.5</maven.compile.target>
+
+ <!--Verbose-->
+ <maven.verbose>false</maven.verbose>
+ </properties>
+ </profile>
+ </profiles>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${maven.src.dir}/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>lutinplugin</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ <version>0.12</version>
+ <executions>
+ <execution>
+ <id>Processor</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <srcDir>${basedir}/src</srcDir>
+ <destDir>${maven.src.dir}</destDir>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ <filters>
+ org.codelutin.processor.filters.GeneratorTemplatesFilter,
+ org.codelutin.processor.filters.ActiveLogsCodeFilter
+ </filters>
+ <verbose>${maven.verbose}</verbose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>lutinplugin</groupId>
+ <artifactId>maven-generator-plugin</artifactId>
+ <version>0.51-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>Generator</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>zargo2xmi</goal>
+ <goal>xmi2statemodel</goal>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <srcDirZuml>src/xmi</srcDirZuml>
+ <srcXmiDest>target/gen/xmi/</srcXmiDest>
+ <srcGenDest>target/gen/models/</srcGenDest>
+ <includes>**/*.*model</includes>
+ <templates>
+ org.codelutin.topia.generator.TapestryWebGenerator
+ </templates>
+ <destDirGen>target/gen/java</destDirGen>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>lutinlib</groupId>
+ <artifactId>topia</artifactId>
+ <version>2.0.26-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>CopyGenJavaVersSrcBuild</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy
+ todir="${basedir}/target/src-build/java"
+ verbose="${maven.verbose}" overwrite="false">
+ <fileset
+ dir="${basedir}/target/gen/java" />
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-upload</artifactId>
+ <version>5.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.healthmarketscience.rmiio</groupId>
+ <artifactId>rmiio</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.directwebremoting</groupId>
+ <artifactId>dwr</artifactId>
+ <version>2.0.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/simexplorer-is-web/pom.xml
===================================================================
--- trunk/simexplorer-is-web/pom.xml (rev 0)
+++ trunk/simexplorer-is-web/pom.xml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>simexplorer-is</groupId>
+ <artifactId>simexplorer-is-web</artifactId>
+ <packaging>war</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <description></description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.1</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>simexplorer-is</groupId>
+ <artifactId>simexplorer-is-entities</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>simexplorer-is</groupId>
+ <artifactId>simexplorer-is-service</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>tapestry5-treegrid</groupId>
+ <artifactId>tapestry5-treegrid</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbossall-client</artifactId>
+ <version>3.2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-upload</artifactId>
+ <version>5.0.7</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,26 @@
+package fr.cemagref.simexplorer.is.ui.web;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
+
+public class ContextListener implements ServletContextListener {
+
+ public void contextDestroyed(ServletContextEvent arg0) {
+ try {
+ StorageServiceFactory.getService().close();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void contextInitialized(ServletContextEvent arg0) {
+ try {
+ StorageServiceFactory.getService().open();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCaseMap.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCaseMap.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCaseMap.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,36 @@
+package fr.cemagref.simexplorer.is.ui.web.base;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class UseCaseMap {
+
+ /**
+ * Map (state name -> state instance)
+ */
+ private Map<String,Object[]> mapUseCase;
+
+ /**
+ * Constructor
+ */
+ public UseCaseMap () {
+ mapUseCase = new HashMap<String,Object[]>();
+ }
+
+ /**
+ * New sub use case
+ */
+ public void enterSubUseCase(String newUseCaseName, String previousUseCaseName, Object state) {
+ mapUseCase.put(newUseCaseName,new Object[]{previousUseCaseName,state});
+ }
+
+ /**
+ * Finish a subusecase
+ *
+ * Return the state that init the subuse case
+ * @return a state
+ */
+ public Object[] leaveUseCase(String useCaseName) {
+ return mapUseCase.get(useCaseName);
+ }
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCasePage.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCasePage.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/base/UseCasePage.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,107 @@
+package fr.cemagref.simexplorer.is.ui.web.base;
+
+import org.apache.tapestry.Link;
+import org.apache.tapestry.annotations.ApplicationState;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.annotations.Service;
+import org.apache.tapestry.internal.services.LinkFactory;
+import org.apache.tapestry.internal.services.LinkFactoryListener;
+import org.apache.tapestry.services.Request;
+
+public abstract class UseCasePage implements LinkFactoryListener {
+
+ private static final String UC_PARAMETER_NAME = "UC";
+ private static final String UC_PARAMETER_SEPARATOR = ":";
+
+ @ApplicationState
+ private UseCaseMap useCaseManager;
+ private boolean useCaseManagerExists;
+
+ @Inject
+ @Service("LinkFactory")
+ private LinkFactory _linkFactory;
+
+ @Inject
+ @Service("Request")
+ private Request _request;
+
+ private String UCName;
+
+ public void onActivate() {
+ _linkFactory.addListener(this);
+
+ UCName = _request.getParameter(UC_PARAMETER_NAME);
+ }
+
+ protected abstract String getUseCaseName();
+
+ /**
+ * Create stack if not exists
+ */
+ protected void init() {
+ if(!useCaseManagerExists) {
+ useCaseManager = new UseCaseMap();
+ }
+ }
+ /**
+ * Enter in a new sub use case
+ */
+ protected void enterUseCase() {
+ init();
+ // current
+ String currentUCN = UCName;
+ // new
+ UCName = (currentUCN == null) ? getUseCaseName() : currentUCN + UC_PARAMETER_SEPARATOR + getUseCaseName();
+ useCaseManager.enterSubUseCase(UCName, currentUCN, this);
+ }
+
+ /**
+ * Leave a sub use case
+ */
+ protected UseCasePage leaveUseCase() {
+ init();
+
+ UseCasePage nextPage = null;
+
+ // current UCN
+ String UC = UCName;
+
+ // get state
+ Object[] response = useCaseManager.leaveUseCase(UC);
+
+ // if null, return null, don't change page
+ if(response != null) {
+ // get UCN before enter this one
+ UCName = (String) response[0];
+
+ nextPage = (UseCasePage) response[1];
+ }
+
+ return nextPage;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tapestry.internal.services.LinkFactoryListener#createdActionLink(org.apache.tapestry.Link)
+ */
+ public void createdActionLink(Link _link) {
+ addUCParameter(_link);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.tapestry.internal.services.LinkFactoryListener#createdPageLink(org.apache.tapestry.Link)
+ */
+ public void createdPageLink(Link _link) {
+ // PageLink englobe ausssi les redirects envoyᅵs au client apres une
+ // action
+ addUCParameter(_link);
+ }
+
+ protected void addUCParameter(Link _link) {
+ if(_link.getParameterValue(UC_PARAMETER_NAME) == null) {
+
+ if(UCName != null) {
+ _link.addParameter(UC_PARAMETER_NAME, UCName);
+ }
+ }
+ }
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,95 @@
+/* *##%
+ * Copyright (C) 2006 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.cemagref.simexplorer.is.ui.web.components;
+
+import java.util.Locale;
+
+import org.apache.tapestry.Asset;
+import org.apache.tapestry.annotations.IncludeStylesheet;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Path;
+import org.apache.tapestry.annotations.Service;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.services.PersistentLocale;
+
+import fr.cemagref.simexplorer.is.ui.web.pages.UserList;
+
+/**
+ * AbstractPage.java
+ *
+ * @author chatellier
+ * @version $Revision: 1.1 $
+ *
+ * Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $
+ */
+ at IncludeStylesheet("css/Layout.css")
+public class Layout {
+
+ /* linked state "UserList" */
+ @InjectPage
+ private UserList userList;
+
+ /**
+ * page title
+ */
+ @Parameter("defaulttitle")
+ private String title;
+
+ public Layout() {
+ super();
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set default title
+ */
+ void getDefaultTitle() {
+ title = "";
+ }
+
+ @Inject
+ @Service("PersistentLocale")
+ private PersistentLocale persistentLocale;
+
+ Object onActionFromSwitchLocaleFr() {
+ persistentLocale.set(new Locale("fr"));
+ return null;
+ }
+
+ Object onActionFromSwitchLocaleEn() {
+ persistentLocale.set(new Locale("en"));
+ return null;
+ }
+
+ Object onActionFromAdministration() {
+ return userList;
+ }
+
+ public boolean getAdministrator() {
+ return true;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,87 @@
+package fr.cemagref.simexplorer.is.ui.web.grid;
+
+import javax.naming.NamingException;
+
+import org.apache.tapestry.beaneditor.PropertyModel;
+import org.apache.tapestry.grid.GridDataSource;
+
+import fr.cemagref.simexplorer.is.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
+
+public class ApplicationDataSource implements GridDataSource {
+
+ private String query = "";
+ private int indexStart = 0;
+ private MetaDataEntity[] entities = null;
+
+ public ApplicationDataSource(String query) {
+ super();
+ this.query = query;
+ }
+
+ public ApplicationDataSource() {
+ super();
+ this.query = "";
+ }
+
+ public int getAvailableRows() {
+ int result = 0;
+ try {
+ if (query.isEmpty()) {
+ result = StorageServiceFactory.getService()
+ .findApplicationsCount(false);
+ } else {
+ result = StorageServiceFactory.getService().findFullTextCount(
+ query, false);
+ }
+ } catch (NamingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ public Class getRowType() {
+ return MetaDataEntity.class;
+ }
+
+ public Object getRowValue(int index) {
+ return entities[index - indexStart];
+ }
+
+ public void prepare(int startIndex, int endIndex, PropertyModel sortModel,
+ boolean ascending) {
+ try {
+ this.indexStart = startIndex;
+
+ int dateOrder = 0;
+ if (sortModel != null
+ && "creationDate".equals(sortModel.getPropertyName())) {
+ if (ascending) {
+ dateOrder = 1;
+ } else {
+ dateOrder = -1;
+ }
+ }
+
+ if (query.isEmpty()) {
+ entities = StorageServiceFactory.getService()
+ .findApplications(false, startIndex,
+ 1 + endIndex - startIndex, dateOrder);
+ } else {
+ entities = StorageServiceFactory.getService().findFullText(
+ query, false, startIndex, 1 + endIndex - startIndex,
+ dateOrder);
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ this.indexStart = 0;
+ entities = new MetaDataEntity[0];
+ }
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationDetail.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationDetail.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationDetail.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,30 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractApplicationDetail
+ */
+public abstract class AbstractApplicationDetail extends UseCasePage {
+
+ /* linked state "ApplicationList" */
+ @InjectPage
+ private ApplicationList applicationList;
+
+ /* getter for state "ApplicationList" */
+ protected ApplicationList getApplicationList() {
+ return applicationList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return applicationList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ad";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationExport.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationExport.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationExport.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,30 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractApplicationExport
+ */
+public abstract class AbstractApplicationExport extends UseCasePage {
+
+ /* linked state "ApplicationList" */
+ @InjectPage
+ private ApplicationList applicationList;
+
+ /* getter for state "ApplicationList" */
+ protected ApplicationList getApplicationList() {
+ return applicationList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return applicationList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ae";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationImport.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationImport.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationImport.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,30 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractApplicationImport
+ */
+public abstract class AbstractApplicationImport extends UseCasePage {
+
+ /* linked state "ApplicationList" */
+ @InjectPage
+ private ApplicationList applicationList;
+
+ /* getter for state "ApplicationList" */
+ protected ApplicationList getApplicationList() {
+ return applicationList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return applicationList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ai";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractApplicationList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,73 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractApplicationList
+ */
+public abstract class AbstractApplicationList extends UseCasePage {
+
+ /* linked state "ApplicationDetail" */
+ @InjectPage
+ private ApplicationDetail applicationDetail;
+
+ /* getter for state "ApplicationDetail" */
+ protected ApplicationDetail getApplicationDetail() {
+ return applicationDetail;
+ }
+
+ /* transition on "detail" event */
+ public Object onActionFromDetail() {
+ return applicationDetail;
+ }
+
+ /* linked state "ApplicationImport" */
+ @InjectPage
+ private ApplicationImport applicationImport;
+
+ /* getter for state "ApplicationImport" */
+ protected ApplicationImport getApplicationImport() {
+ return applicationImport;
+ }
+
+ /* transition on "importer" event */
+ public Object onActionFromImporter() {
+ return applicationImport;
+ }
+
+ /* linked state "ApplicationExport" */
+ @InjectPage
+ private ApplicationExport applicationExport;
+
+ /* getter for state "ApplicationExport" */
+ protected ApplicationExport getApplicationExport() {
+ return applicationExport;
+ }
+
+ /* transition on "export" event */
+ public Object onActionFromExport() {
+ return applicationExport;
+ }
+
+ /* linked state "UserAdministration" */
+ @InjectPage
+ private UserList userList;
+
+ /* getter for state "UserAdministration" */
+ protected UserList getUserList() {
+ return userList;
+ }
+
+ /* transition on administration event */
+ public Object onActionFromAdministration() {
+ enterUseCase();
+ return userList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "al";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupEdit.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,30 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractGroupEdit
+ */
+public abstract class AbstractGroupEdit extends UseCasePage {
+
+ /* linked state "GroupList" */
+ @InjectPage
+ private GroupList groupList;
+
+ /* getter for state "GroupList" */
+ protected GroupList getGroupList() {
+ return groupList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return groupList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ge";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractGroupList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,58 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractGroupList
+ */
+public abstract class AbstractGroupList extends UseCasePage {
+
+ /* linked state "UserList" */
+ @InjectPage
+ private UserList userList;
+
+ /* getter for state "UserList" */
+ protected UserList getUserList() {
+ return userList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return userList;
+ }
+
+ /* linked state "GroupEdit" */
+ @InjectPage
+ private GroupEdit groupEdit;
+
+ /* getter for state "GroupEdit" */
+ protected GroupEdit getGroupEdit() {
+ return groupEdit;
+ }
+
+ /* transition on "edit" event */
+ public Object onActionFromEdit() {
+ return groupEdit;
+ }
+
+ /* linked state "UserEdit" */
+ @InjectPage
+ private UserEdit userEdit;
+
+ /* getter for state "UserEdit" */
+ protected UserEdit getUserEdit() {
+ return userEdit;
+ }
+
+ /* transition on "usergroup" event */
+ public Object onActionFromUsergroup() {
+ return userEdit;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "gl";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserEdit.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,44 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractUserEdit
+ */
+public abstract class AbstractUserEdit extends UseCasePage {
+
+ /* linked state "UserList" */
+ @InjectPage
+ private UserList userList;
+
+ /* getter for state "UserList" */
+ protected UserList getUserList() {
+ return userList;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return userList;
+ }
+
+ /* linked state "GroupList" */
+ @InjectPage
+ private GroupList groupList;
+
+ /* getter for state "GroupList" */
+ protected GroupList getGroupList() {
+ return groupList;
+ }
+
+ /* transition on "" event */
+ public Object onActionFrom() {
+ return groupList;
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ue";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/AbstractUserList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,49 @@
+// Automatically generated by LutinGenerator
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+import fr.cemagref.simexplorer.is.ui.web.base.UseCasePage;
+
+/*
+ * State AbstractUserList
+ */
+public abstract class AbstractUserList extends UseCasePage {
+
+ /* linked state "GroupList" */
+ @InjectPage
+ private GroupList groupList;
+
+ /* getter for state "GroupList" */
+ protected GroupList getGroupList() {
+ return groupList;
+ }
+
+ /* transition on "group" event */
+ public Object onActionFromGroup() {
+ return groupList;
+ }
+
+ /* linked state "UserEdit" */
+ @InjectPage
+ private UserEdit userEdit;
+
+ /* getter for state "UserEdit" */
+ protected UserEdit getUserEdit() {
+ return userEdit;
+ }
+
+ /* transition on "edit" event */
+ public Object onActionFromEdit() {
+ return userEdit;
+ }
+
+ /* transition on "retour" event */
+ public Object onActionFromRetour() {
+ return leaveUseCase();
+ }
+
+ /* return a unique state id for model */
+ protected final String getUseCaseName() {
+ return "ul";
+ }
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,273 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.Link;
+import org.apache.tapestry.StreamResponse;
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.util.TextStreamResponse;
+import org.codelutin.tapestry.beans.TreeNode;
+
+import com.healthmarketscience.rmiio.RemoteOutputStreamServer;
+import com.healthmarketscience.rmiio.SimpleRemoteOutputStream;
+
+import fr.cemagref.simexplorer.is.entities.data.Code;
+import fr.cemagref.simexplorer.is.entities.data.Component;
+import fr.cemagref.simexplorer.is.entities.data.Constant;
+import fr.cemagref.simexplorer.is.entities.data.ConstantValue;
+import fr.cemagref.simexplorer.is.entities.data.ExplorationApplication;
+import fr.cemagref.simexplorer.is.entities.data.ExplorationData;
+import fr.cemagref.simexplorer.is.entities.data.Library;
+import fr.cemagref.simexplorer.is.entities.data.Result;
+import fr.cemagref.simexplorer.is.entities.data.Structure;
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
+
+public class ApplicationDetail extends AbstractApplicationDetail {
+
+ @Inject
+ private ComponentResources resources;
+
+ @Persist
+ private ExplorationApplication explorationApplication;
+
+ public void setup(String uuid, String version) throws Exception {
+ explorationApplication = StorageServiceFactory.getService()
+ .getExplorationApplication(uuid, version);
+ }
+
+ public List<String> getHeaders() {
+ List<String> result = new ArrayList<String>();
+ result.add("");
+ result.add("");
+ result.add("");
+ result.add("");
+ return result;
+ }
+
+ public List<TreeNode> getNodes() {
+ List<TreeNode> nodes = new ArrayList<TreeNode>();
+ nodes.add(generateAppllication());
+ return nodes;
+ }
+
+ public Object exportElement(String uuid, String version) throws Exception {
+ StreamResponse response = null;
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ RemoteOutputStreamServer xmlRemoteOutputStream = new SimpleRemoteOutputStream(
+ bos);
+ StorageServiceFactory.getService().exportElement(
+ xmlRemoteOutputStream.export(), uuid, version);
+ response = new TextStreamResponse("text/xml", bos.toString());
+
+ return response;
+ }
+
+ public Object onExportea(String context) throws Exception {
+ return exportElement(explorationApplication.getMetaData().getUuid(),
+ explorationApplication.getMetaData().getVersion().toString());
+ }
+
+ public Object onExportElement(String context) throws Exception {
+ StringTokenizer st = new StringTokenizer(context, ",");
+ String uuid = st.nextToken();
+ String version = st.nextToken();
+ return exportElement(uuid, version);
+ }
+
+ private String[] generateStringArray(String s1, String s2, String s3) {
+ List<String> result = new ArrayList<String>();
+ result.add(s1);
+ result.add(s2);
+ result.add(s3);
+ result.add("");
+ return result.toArray(new String[0]);
+ }
+
+ private String[] generateStringArray(String s1, String s2, String s3,
+ String actionCaption, String action, Object context) {
+ List<String> result = new ArrayList<String>();
+ result.add(s1);
+ result.add(s2);
+ result.add(s3);
+ Link link = resources.createActionLink(action, false, context);
+ StringBuffer sb = new StringBuffer("");
+ sb.append("<a href=\"");
+ sb.append(link.toString());
+ sb.append("\">");
+ sb.append(actionCaption);
+ sb.append("</a>");
+ result.add(sb.toString());
+ return result.toArray(new String[0]);
+ }
+
+ private TreeNode generateAppllication() {
+ TreeNode node = new TreeNode();
+ node.setType(TreeNode.TYPE_FOLDER);
+
+ node.setColumns(generateStringArray("Exploration Application",
+ explorationApplication.getMetaData().getDescription(),
+ explorationApplication.getMetaData().getVersion().toString(),
+ "Export", "exportea", null));
+ TreeNode[] children = new TreeNode[2];
+ children[0] = new TreeNode();
+ children[0].setType(TreeNode.TYPE_FOLDER);
+ children[0].setColumns(generateStringArray("Components", "", ""));
+ children[0].setChildren(generateComponents());
+
+ children[1] = new TreeNode();
+ children[1].setType(TreeNode.TYPE_FOLDER);
+ children[1].setColumns(generateStringArray("Explorations", "", ""));
+ children[1].setChildren(generateExplorations());
+
+ node.setChildren(children);
+
+ return node;
+ }
+
+ private TreeNode[] generateExplorations() {
+ TreeNode[] res = new TreeNode[explorationApplication.getExplorations()
+ .size()];
+ int i = 0;
+ for (ExplorationData explorationData : explorationApplication
+ .getExplorations()) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_FOLDER);
+ res[i]
+ .setColumns(generateStringArray("Exploration data",
+ explorationData.getMetaData().getDescription(),
+ explorationData.getMetaData().getVersion()
+ .toString(), "Export", "exportElement",
+ explorationData.getMetaData().getUuid()
+ + ","
+ + explorationData.getMetaData()
+ .getVersion()));
+ TreeNode[] children = new TreeNode[2];
+ children[0] = generateResult(explorationData.getResult());
+ children[1] = new TreeNode();
+ children[1].setType(TreeNode.TYPE_FOLDER);
+ children[1].setColumns(generateStringArray("Values", "", ""));
+ children[1].setChildren(generateValues(explorationData));
+ res[i].setChildren(children);
+ i++;
+ }
+ return res;
+ }
+
+ private TreeNode[] generateValues(ExplorationData explorationData) {
+ Set<ConstantValue> values = explorationData.getValuesMap();
+ TreeNode[] res = new TreeNode[values.size()];
+ int i = 0;
+ for (ConstantValue value : values) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray(
+ value.getConstant().getName(), value.getValue(), value
+ .getConstant().getType().getSimpleName()));
+ i++;
+ }
+
+ return res;
+ }
+
+ private TreeNode generateResult(Result result) {
+ TreeNode res = new TreeNode();
+ res.setType(TreeNode.TYPE_DOCUMENT);
+ res.setColumns(generateStringArray("Result", "", ""));
+ return res;
+ }
+
+ private TreeNode[] generateComponents() {
+ Set<Component> components = explorationApplication.getComponents();
+ TreeNode[] res = new TreeNode[components.size()];
+
+ int i = 0;
+ for (Component component : components) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_FOLDER);
+ res[i].setColumns(generateStringArray("Component", component
+ .getMetaData().getDescription(), component.getMetaData()
+ .getVersion().toString(), "Export", "exportElement",
+ component.getMetaData().getUuid() + ","
+ + component.getMetaData().getVersion()));
+ TreeNode[] children = new TreeNode[4];
+ for (int j = 0; j < children.length; j++) {
+ children[j] = new TreeNode();
+ children[j].setType(TreeNode.TYPE_FOLDER);
+ }
+ children[0].setColumns(generateStringArray("Constants", "", ""));
+ children[0]
+ .setChildren(generateConstants(component.getConstants()));
+ children[1].setColumns(generateStringArray("Structures", "", ""));
+ children[1].setChildren(generateStructures(component
+ .getStructures()));
+ children[2].setColumns(generateStringArray("Codes", "", ""));
+ children[2].setChildren(generateCodes(component.getCodes()));
+ children[3].setColumns(generateStringArray("Libraries", "", ""));
+ children[3]
+ .setChildren(generateLibraries(component.getLibraries()));
+ res[i].setChildren(children);
+ i++;
+ }
+
+ return res;
+ }
+
+ private TreeNode[] generateLibraries(Set<Library> libraries) {
+ TreeNode[] res = new TreeNode[libraries.size()];
+ int i = 0;
+ for (Library library : libraries) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Library", "", ""));
+ i++;
+ }
+ return res;
+ }
+
+ private TreeNode[] generateCodes(Set<Code> codes) {
+ TreeNode[] res = new TreeNode[codes.size()];
+ int i = 0;
+ for (Code code : codes) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Code", code.getLanguage(),
+ code.getCode()));
+ i++;
+ }
+ return res;
+ }
+
+ private TreeNode[] generateStructures(Set<Structure> structures) {
+ TreeNode[] res = new TreeNode[structures.size()];
+ int i = 0;
+ for (Structure structure : structures) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Structure", "", ""));
+ i++;
+ }
+ return res;
+ }
+
+ private TreeNode[] generateConstants(Set<Constant> constants) {
+ TreeNode[] res = new TreeNode[constants.size()];
+ int i = 0;
+ for (Constant constant : constants) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Constant", constant
+ .getName(), constant.getType().getSimpleName()));
+ i++;
+ }
+ return res;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,9 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
+public class ApplicationExport extends AbstractApplicationExport {
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,42 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.upload.services.UploadedFile;
+
+import com.healthmarketscience.rmiio.RemoteInputStreamServer;
+import com.healthmarketscience.rmiio.SimpleRemoteInputStream;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
+
+public class ApplicationImport extends AbstractApplicationImport {
+
+ private UploadedFile fileEA;
+ private UploadedFile fileLib;
+
+ public UploadedFile getFileEA() {
+ return fileEA;
+ }
+
+ public void setFileEA(UploadedFile fileEA) {
+ this.fileEA = fileEA;
+ }
+
+ public UploadedFile getFileLib() {
+ return fileLib;
+ }
+
+ public void setFileLib(UploadedFile fileLib) {
+ this.fileLib = fileLib;
+ }
+
+ public void onSuccess() throws Exception {
+ if (fileEA != null) {
+ RemoteInputStreamServer zipRemoteStream = new SimpleRemoteInputStream(
+ fileEA.getStream());
+ StorageServiceFactory.getService().saveElement(
+ zipRemoteStream.export());
+ }
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,82 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Retain;
+import org.apache.tapestry.beaneditor.BeanModel;
+import org.apache.tapestry.internal.beaneditor.BeanModelImpl;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.services.BeanModelSource;
+
+import fr.cemagref.simexplorer.is.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.grid.ApplicationDataSource;
+
+public class ApplicationList extends AbstractApplicationList {
+
+ @Retain
+ private BeanModel model;
+
+ @Inject
+ private BeanModelSource beanModelSource;
+
+ @Inject
+ private ComponentResources resources;
+
+ private MetaDataEntity application;
+
+ @InjectPage
+ private ApplicationDetail applicationDetail;
+
+ void pageLoaded() {
+ model = beanModelSource.create(MetaDataEntity.class, true, resources);
+ List<String> wantedProperties = new ArrayList<String>();
+ wantedProperties.add("uuid");
+ wantedProperties.add("name");
+ wantedProperties.add("description");
+ wantedProperties.add("version");
+ wantedProperties.add("creationDate");
+ List<String> properties = model.getPropertyNames();
+ for (String property : properties) {
+ if (!"creationDate".equals(property)) {
+ model.get(property).sortable(false);
+ }
+ if (!wantedProperties.contains(property)) {
+ model = model.remove(property);
+ }
+ }
+ }
+
+ public BeanModel getModel() {
+ return model;
+ }
+
+ public ApplicationDataSource getApplications() {
+ return new ApplicationDataSource();
+ }
+
+ public MetaDataEntity getApplication() {
+ return application;
+ }
+
+ public void setApplication(MetaDataEntity application) {
+ this.application = application;
+ }
+
+ public String getDetailApplicationContext() {
+ String result = application.getUuid() + "," + application.getVersion();
+ return result;
+ }
+
+ public Object onActionFromDetailApplication(String context) throws Exception {
+ StringTokenizer st = new StringTokenizer(context, ",");
+ String uuid = st.nextToken();
+ String version = st.nextToken();
+ applicationDetail.setup(uuid, version);
+ return applicationDetail;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,18 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.Persist;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
+public class GroupEdit extends AbstractGroupEdit {
+
+ @Persist
+ private int groupId;
+
+ void onActivate(int groupId) {
+ this.groupId = groupId;
+ this.onActivate();
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,9 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
+public class GroupList extends AbstractGroupList {
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,18 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.Persist;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
+public class UserEdit extends AbstractUserEdit {
+
+ @Persist
+ private int userId;
+
+ void onActivate(int userId) {
+ this.userId = userId;
+ this.onActivate();
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,9 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
+public class UserList extends AbstractUserList {
+
+}
Added: trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
===================================================================
--- trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java (rev 0)
+++ trunk/simexplorer-is-web/src/main/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,32 @@
+package fr.cemagref.simexplorer.is.ui.web.services;
+
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import fr.cemagref.simexplorer.is.service.StorageService;
+
+public class StorageServiceFactory {
+
+ private static StorageService serviceProjets = null;
+
+ public static StorageService getService() throws NamingException {
+ if (serviceProjets == null) {
+ Properties properties = (Properties) System.getProperties().clone();
+ properties.put("java.naming.provider.url", "jnp://localhost:1099");
+ properties.put("java.naming.factory.initial",
+ "org.jnp.interfaces.NamingContextFactory");
+ properties
+ .put("java.naming.factory.url.pkgs", "org.jnp.interfaces");
+
+ Context context = new InitialContext(properties);
+ serviceProjets = (StorageService) context
+ .lookup("ejb3/StorageService");
+ }
+ return serviceProjets;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,22 @@
+abstractpage-windowtitle=Simexplorer SI
+abstractpage-pagetitle=Simexplorer SI
+
+abstractpage-menutitle=Menu
+abstractpage-menusubtitle1=Application Menu
+abstractpage-menuitem1-1=List
+abstractpage-menuitem1-2=Import
+
+abstractpage-menusubtitle2=Administration Menu
+abstractpage-menuitem2-1=User list
+abstractpage-menuitem2-2=Add user
+abstractpage-menuitem2-3=Group list
+abstractpage-menuitem2-4=Add group
+
+abstractpage-tip=Change your navigator language to see this website in another language.
+
+abstractpage-localeen=English
+abstractpage-localefr=Français
+
+abstractpage-administration=Administration
+
+abstractpage-copyright=Copyright © 2007. Code Lutin - GPL
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,58 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <head>
+ <title>${title}</title>
+ </head>
+
+ <body>
+
+ <!-- titre -->
+ <h1 id="Title">${message:abstractpage-pagetitle}</h1>
+
+ <!-- barre -->
+ <div id="Header">
+ <div class="Left">
+ [<a t:type="actionlink" t:id="switchLocaleEn">${message:abstractpage-localeen}</a>]
+ -
+ [<a t:type="actionlink" t:id="switchLocaleFr">${message:abstractpage-localefr}</a>]
+ </div>
+ <div class="Right">
+ <!--
+ <t:if test="administrator">
+ <a t:type="actionlink" t:id="administration">${message:abstractpage-administration}</a>
+ </t:if>
+ -->
+ </div>
+
+ </div>
+
+ <div id="Menu" class="">
+ <!-- menu -->
+ <h1 class="tab">${message:abstractpage-menutitle}</h1>
+ <div id="tabMenu">
+
+ <h2 class="Title">${message:abstractpage-menusubtitle1}</h2>
+ <menu class="menu">
+ <li><t:pagelink page="ApplicationList">${message:abstractpage-menuitem1-1}</t:pagelink></li>
+ <li><t:pagelink page="ApplicationImport">${message:abstractpage-menuitem1-2}</t:pagelink></li>
+ </menu>
+
+ <!-- h2 class="Title">${message:abstractpage-menusubtitle2}</h2>
+ <menu class="menu">
+ <li><t:pagelink page="UserList">${message:abstractpage-menuitem2-1}</t:pagelink></li>
+ <li><t:pagelink page="UserEdit" context="-1">${message:abstractpage-menuitem2-2}</t:pagelink></li>
+ <li><t:pagelink page="GroupList">${message:abstractpage-menuitem2-3}</t:pagelink></li>
+ <li><t:pagelink page="GroupEdit" context="-1">${message:abstractpage-menuitem2-4}</t:pagelink></li>
+ </menu -->
+
+ </div>
+ </div>
+
+ <div id="Content">
+ <!-- main template here -->
+ <t:body/>
+ </div>
+
+ <div id="FooterAdd">${message:abstractpage-copyright}
+ </div>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,22 @@
+abstractpage-windowtitle=Simexplorer SI
+abstractpage-pagetitle=Simexplorer SI
+
+abstractpage-menutitle=Menu
+abstractpage-menusubtitle1=Application Menu
+abstractpage-menuitem1-1=List
+abstractpage-menuitem1-2=Import
+
+abstractpage-menusubtitle2=Administration Menu
+abstractpage-menuitem2-1=User list
+abstractpage-menuitem2-2=Add user
+abstractpage-menuitem2-3=Group list
+abstractpage-menuitem2-4=Add group
+
+abstractpage-tip=Change your navigator language to see this website in another language.
+
+abstractpage-localeen=English
+abstractpage-localefr=Français
+
+abstractpage-administration=Administration
+
+abstractpage-copyright=Copyright © 2007. Code Lutin - GPL
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,542 @@
+/***************************** Mise en forme gᅵnᅵrale ************************/
+h1.Title {
+ margin: 0px 0px 0px 0px;
+ padding: 0px;
+ font-size: 28px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+}
+
+h1.tab {
+ margin: 0px 0px 10px 0px;
+ padding: 5px;
+ font-size: 20px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ text-align: center;
+ border: 1px solid black;
+ -moz-border-radius: 10px;
+}
+
+h2.Title {
+ margin: 0px 0px 10px 0px;
+ padding: 0px;
+ font-weight: bold;
+ color: #09c;
+ font-size: 18px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+hr.Ligne {
+ margin-bottom: 10px;
+}
+
+.Container {
+ width: 100%;
+}
+
+.Clear {
+ clear: both;
+}
+
+.NoWrap {
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ white-space: nowrap;
+}
+
+.MonoSpace {
+ font-size: 14px;
+ font-family: monospace;
+}
+
+acronym.Acronym {
+ border: none;
+}
+
+acronym.Acronym:hover {
+ cursor: help;
+}
+
+/******************************** Les liens *****************************/
+a.Link {
+ color: black;
+ text-decoration: none;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ vertical-align: middle;
+}
+
+a.Link:link {
+ color: black;
+}
+
+a.Link:visited {
+ color: black;
+}
+
+a.Link:hover {
+ background-color: transparent;
+ text-decoration: underline;
+}
+
+/******************************* Infos bulles ********************************/
+a.InfoBulle {
+ position: relative;
+ z-index: 24;
+ text-decoration: none;
+ cursor: help;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+a.InfoBulle:hover {
+ z-index: 25;
+}
+
+a.InfoBulle:hover span.Info {
+ text-decoration: underline;
+}
+
+a.InfoBulle span.Bulle {
+ display: none;
+ border: 1px solid black;
+}
+
+a.InfoBulle:hover span.Bulle {
+ text-decoration: none;
+ display: block;
+ position: absolute;
+ top: 2em;
+ left: 2em;
+ width: 15em;
+ background-color: #deecf1;
+ text-align: center;
+}
+
+/******************************* Block ****************************************/
+.Block {
+ position: relative;
+ z-index: 24;
+ text-decoration: none;
+ font-size: small;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.BlockHide {
+ display: none;
+}
+
+.BlockShow {
+ border: 1px solid black;
+ display: block;
+ position: absolute;
+ z-index: 25;
+ top: 2em;
+ left: 2em;
+ padding: 5px;
+ background-color: #deecf1;
+}
+
+/******************************* Menu ****************************************/
+h1.tab:hover {
+ background-color: #deecf1;
+ cursor: pointer;
+}
+
+menu.Menu {
+
+}
+
+menu.Menu>li {
+ margin: 0px;
+ padding: 0px;
+ list-style-type: disc;
+ color: black;
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+menu.Menu>li>a.Link {
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Hide {
+ display: none;
+}
+
+.Show {
+
+}
+
+/******************************* Prᅵsentation des donnᅵes ******************/
+fieldset.Fieldset {
+ margin: -10px 0px 20px 0px;
+ padding: 10px;
+ font-weight: bold;
+ border-color: #09c;
+ -moz-border-radius: 10px;
+}
+
+fieldset.Fieldset>legend,fieldset.Fieldset>legend>a {
+ font-size: 18px;
+ font-weight: normal;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ text-decoration: none;
+}
+
+fieldset.Fieldset>legend>a:link {
+
+}
+
+fieldset.Fieldset>legend>a:hover {
+ text-decoration: underline;
+}
+
+fieldset.Fieldset>legend>a.Actif {
+ text-decoration: underline;
+}
+
+.FloatLeft,.FloatRight {
+ float: left;
+ width: 50%;
+ margin: 0;
+ padding: 0;
+}
+
+.FloatRightRight {
+ float: left;
+ width: 50%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+.Group {
+ margin-bottom: 10px;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.SmallText {
+ color: black;
+ font-size: 10px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.MediumText {
+ color: black;
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Normal {
+ color: black;
+ font-weight: normal;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Text {
+ color: black;
+ font-weight: bold;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Center {
+ text-align: center;
+}
+
+.Large {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 100%;
+}
+
+.Medium {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 90%;
+}
+
+.Small {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 60%;
+}
+
+.Green {
+ color: green;
+}
+
+.Red {
+ color: red;
+}
+
+/**************************** Tableau *************************************/
+table.Small td,table.Large td,table.Medium td {
+ border: 1px solid;
+ border-color: #09c;
+ padding: 5px;
+}
+
+tr.Click:hover,td.Click:hover {
+ background-color: #deecf1;
+ cursor: pointer;
+}
+
+table.Small td.Angle,table.Medium td.Angle,table.Large td.Angle {
+ border-left: none;
+ border-top: none;
+}
+
+td.Colomun {
+ background-color: #eee;
+ font-weight: bold;
+ text-align: left;
+}
+
+tr.First { /* Entᅵte du tableau */
+ font-weight: bold;
+ background-color: #eee;
+ text-align: center;
+}
+
+td.Actions {
+ text-align: center;
+}
+
+td.Number {
+ text-align: right;
+}
+
+td.LargeCase {
+ height: 75px;
+ vertical-align: top;
+}
+
+td.LargeCaseSelect {
+ height: 75px;
+ vertical-align: top;
+ background-color: #deecf1;
+}
+
+/******************************** Formulaires ********************************/
+.FormActions {
+ display: block;
+ text-align: right;
+ margin-bottom: 10px;
+}
+
+.Form {
+ display: inline;
+ text-align: left;
+}
+
+.FormActions input[type="password"],.FormActions input[type="radio"],.FormActions input[type="button"],.FormActions input[type="text"],.FormActions input[type="submit"],.FormActions textarea,.FormActions select,.Form input[type="password"],.Form input[type="radio"],.Form input[type="button"],.Form input[type="text"],.Form input[type="submit"],.Form textarea,.Form select,.Form button,.FormActions button,button
+ {
+ border: 1px solid black;
+ padding: 2px;
+ margin: 0px;
+ font: 12px verdana, arial, helvetica, sans-serif;
+ display: inline;
+}
+
+.FormActions textarea.MonoSpace,.Form textarea.MonoSpace {
+ font-family: monospace;
+}
+
+.FormLeft {
+ float: left;
+ width: 40%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+.FormRight {
+ float: left;
+ width: 60%;
+ margin: 0;
+ padding: 0;
+}
+
+.FormLeft div.Normal,.FormRight div.Normal {
+ margin-bottom: 10px;
+}
+
+.FormLeft div.Text,.FormRight div.Text {
+ margin: 0px;
+ margin-bottom: 8px;
+ margin-right: 5px;
+ padding: 3px;
+}
+
+.Float {
+ float: left;
+ margin: 0;
+ margin-right: 5px;
+ padding: 0;
+}
+
+/* Layout */
+body { /* background-image: url("../images/lutin.gif"); */
+ background-repeat: no-repeat;
+ background-position: right top;
+ margin: 0px;
+ padding: 0px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #333;
+ background-color: white;
+}
+
+#beforeheader {
+ display: table-row;
+ background-color: red;
+ margin: 0px 0px 15px 0px;
+ width: 100%;
+}
+
+#Title {
+ display: table-cell;
+ font-size: 28px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ margin: 0px 0px 15px 0px;
+ padding: 5px 0px 0px 5px;
+}
+
+#Google-AdSense {
+ display: table-cell;
+ width: 100%;
+ height: 60px;
+ text-align: right;
+ vertical-align: middle;
+}
+
+#Header {
+ font-size: 12px;
+ margin: 10px 0px 10px 0px;
+ padding: 3px 5px 3px 5px;
+ border-style: solid;
+ border-color: black;
+ border-width: 1px 0px;
+ line-height: 11px;
+ background-color: #eee;
+ height: 14px;
+}
+
+.Left {
+ float: left;
+ width: 40%;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+}
+
+.Right {
+ float: left;
+ width: 60%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+#Content {
+ margin: 0px 50px 50px 300px;
+ padding: 0px;
+ min-height: 455px;
+}
+
+#Menu {
+ position: absolute;
+ top: 80px;
+ left: 10px;
+ padding: 10px 10px 0px 10px;
+ background-color: #eee;
+ border: 1px solid black;
+ -moz-border-radius: 10px;
+ line-height: 17px;
+ width: 250px;
+ z-index: 1;
+}
+
+#Footer {
+ font-size: 12px;
+ position: relative;
+ text-align: right;
+ width: 100%;
+ margin: 10px 0px 0px 0px;
+ padding: 3px 0px 3px 0px;
+ border-style: solid;
+ border-color: black;
+ border-width: 1px 0px;
+ line-height: 11px;
+ background-color: #eee;
+ height: 14px;
+}
+
+#FooterAdd {
+ font-size: 12px;
+ text-align: center;
+}
+
+#AddressBar {
+ font-size: x-small;
+ margin-bottom: 7px;
+}
+
+#AddressBar a.Link {
+ font-size: small;
+}
+
+.Message {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #deecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+.Error {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #ffecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+.FieldError {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #ffecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+#FieldErrorExplication {
+ font-weight: normal;
+}
+
+img.Img {
+ border-width: 0px;
+ border-style: none;
+ vertical-align: middle;
+ padding: 0px;
+ margin: 0px;
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1 @@
+windowtitle=Application detail
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.properties
===================================================================
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,4 @@
+windowtitle=Import
+upload=Upload
+explorationapplication=Exploration application
+library=Library
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1 @@
+windowtitle=Application list
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,3 @@
+name=Name
+cancel=Cancel
+submit=Submit
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,5 @@
+windowtitle=Manage groups
+name=Name
+modify=Modify
+delete=Delete
+addgroup=Add group
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,8 @@
+name=Name
+firstname=First name
+mail=Mail
+groups=Groups
+add=Add
+remove=Remove
+submit=Submit
+cancel=Cancel
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties
===================================================================
--- trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties (rev 0)
+++ trunk/simexplorer-is-web/src/main/resources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,6 @@
+windowtitle=Manage users
+name=Name
+firstname=First name
+modify=Modify
+delete=Delete
+adduser=Add user
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/webapp/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/ApplicationDetail.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/ApplicationDetail.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,7 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <table t:type="cl/TreeGrid" source="nodes" columnHeaders="headers">
+ </table>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/ApplicationExport.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/ApplicationExport.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/ApplicationExport.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,4 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/ApplicationImport.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/ApplicationImport.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/ApplicationImport.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,20 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors/>
+
+ <h1 class="Title">${message:explorationapplication}</h1>
+
+ <input t:type="upload" t:id="fileEA"/>
+ <br/>
+
+ <h1 class="Title">${message:library}</h1>
+
+ <input t:type="upload" t:id="fileLib"/>
+ <br/>
+
+ <input type="submit" value="${message:upload}"/>
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/ApplicationList.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/ApplicationList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/ApplicationList.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,10 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <table t:type="Grid" source="applications" row="application" model="model">
+ <t:parameter name="uuidCell">
+ <t:actionlink t:id="detailApplication" context="${detailApplicationContext}">Details</t:actionlink>
+ </t:parameter>
+ </table>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/GroupEdit.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/GroupEdit.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/GroupEdit.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,21 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors/>
+
+ <!--
+
+ <p>${message:name} :
+ <input t:type="TextField" t:id="name" t:validate="required,minlength=3"
+ t:value="group.name" size="30"/></p>
+
+ -->
+
+ <input t:type="Submit" t:value="message:submit"/>
+
+ <a t:type="actionlink" t:id="cancel">${message:cancel}</a>
+
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/GroupList.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/GroupList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/GroupList.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,24 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors />
+
+ <table class="Large">
+ <tr class="First">
+ <td>${message:name}</td>
+ <td>${message:modify}</td>
+ <td>${message:delete}</td>
+ </tr>
+ <!-- t:loop source="groups" value="group">
+ <tr>
+ <td>${group.name}</td>
+ <td><a t:type="ActionLink" t:id="edit" t:context="group.id">${message:modify}</a></td>
+ <td><a t:type="ActionLink" t:id="delete" t:context="group.id">${message:delete}</a></td>
+ </tr>
+ </t:loop -->
+ </table>
+
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/META-INF/MANIFEST.MF 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added: trunk/simexplorer-is-web/src/main/webapp/UserEdit.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/UserEdit.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/UserEdit.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,82 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors />
+
+ <!--
+
+ <p>${message:name} : <input t:type="TextField" t:id="name"
+ t:validate="required,minlength=3" t:value="user.name" size="30" /></p>
+
+ <p>${message:firstname} : <input t:type="TextField"
+ t:id="firstName" t:validate="required,minlength=3"
+ t:value="user.firstName" size="30" /></p>
+
+ <p>${message:mail} : <input t:type="TextField" t:id="mail"
+ t:validate="required,minlength=3" t:value="user.mail" size="30" /></p>
+
+ <h1 class="Title">${message:groups}</h1>
+
+ <table class="Large">
+ <tr class="First">
+ <td>${message:name}</td>
+ <td>${message:add}</td>
+ <td>${message:remove}</td>
+ </tr>
+ <tr>
+ <td class="Text">Member of :</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>XXXXX</td>
+ <td></td>
+ <td><a t:type="ActionLink" t:id="removeGroup0"
+ t:context="0">${message:remove}</a></td>
+ </tr>
+ <tr>
+ <td>YYYYYY</td>
+ <td></td>
+ <td><a t:type="ActionLink" t:id="removeGroup1"
+ t:context="0">${message:remove}</a></td>
+ </tr>
+ <tr>
+ <td>ZZZZZZZ</td>
+ <td></td>
+ <td><a t:type="ActionLink" t:id="removeGroup2"
+ t:context="0">${message:remove}</a></td>
+ </tr>
+ <tr>
+ <td class="Text">Available groups :</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>AAAAA</td>
+ <td><a t:type="ActionLink" t:id="removeGroup3"
+ t:context="0">${message:add}</a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>BBBBB</td>
+ <td><a t:type="ActionLink" t:id="removeGroup4"
+ t:context="0">${message:add}</a></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>CCCCCCCC</td>
+ <td><a t:type="ActionLink" t:id="removeGroup5"
+ t:context="0">${message:add}</a></td>
+ <td></td>
+ </tr>
+
+ </table>
+ -->
+
+ <input t:type="Submit" t:value="message:submit" />
+
+ <a t:type="actionlink" t:id="cancel">${message:cancel}</a>
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/UserList.tml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/UserList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/UserList.tml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,27 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors/>
+
+ <table class="Large">
+ <tr class="First">
+ <td>${message:name}</td>
+ <td>${message:firstname}</td>
+ <td>${message:modify}</td>
+ <td>${message:delete}</td>
+ </tr>
+
+ <!-- t:loop source="users" value="user">
+ <tr>
+ <td>${user.name}</td>
+ <td>${user.firstName}</td>
+ <td><t:pagelink page="UserEdit" context="user.id">${message:modify}</t:pagelink></td>
+ <td><a t:type="ActionLink" t:id="delete" t:context="user.id">${message:delete}</a></td>
+ </tr>
+ </t:loop -->
+ </table>
+
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/WEB-INF/web.xml 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
+ id="WebApp_ID" version="2.4">
+
+ <display-name>simexplorer-is-web</display-name>
+
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>fr.cemagref.simexplorer.is.ui.web</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>tapestryfilter</filter-name>
+ <filter-class>org.apache.tapestry.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>tapestryfilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>dwr-invoker</servlet-name>
+ <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>dwr-invoker</servlet-name>
+ <url-pattern>/js/dwr/*</url-pattern>
+ </servlet-mapping>
+
+ <listener>
+ <listener-class>
+ fr.cemagref.simexplorer.is.ui.web.ContextListener
+ </listener-class>
+ </listener>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+</web-app>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/webapp/index.html
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/index.html (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/index.html 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
+ <meta http-equiv="refresh"
+ content="0; url=applicationlist"/>
+ <title></title>
+ <meta name="robots" content="noindex,follow"/>
+ </head>
+
+ <body>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/main/webapp/js/dftree.js
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/js/dftree.js (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/js/dftree.js 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,530 @@
+/* Dynamic Folder Tree
+ * Generates DHTML tree dynamically (on the fly).
+ * License: BSD.
+ * See details at http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Copyright (c) 2004, 2005, 2006
+ * Vinicius Cubas Brand, Raphael Derosso Pereira, Frank Alcantara
+ * {viniciuscb,raphaelpereira,frankalcantara} at users.sourceforge.net
+ * All rights reserved.
+ */
+
+
+// NODE
+//Usage: a = new dNode({id:2, caption:'tree root', url:'http://www.w3.org'});
+function dNode(arrayProps) {
+ //mandatory fields
+ this.id; //node id
+ this.caption; //node caption
+
+ //optional fields
+ this.url; //url to open
+ this.target; //target to open url
+ this.onClick; //javascript to execute onclick
+ this.onOpen; //javascript to execute when a node of the tree opens
+ this.onClose; //javascript to execute when a node of the tree closes
+ this.onFirstOpen; //javascript to execute only on the first open
+ this.iconClosed; //img.src of closed icon
+ this.iconOpen; //img.src of open icon
+ this.runJS = true; //(bool) if true, runs the on* props defined above
+ this.plusSign = true; //(bool) if the plus sign will appear or not
+ this.captionClass = 'l'; //(string) the class for this node's caption
+
+
+ //The parameters below are private
+ this._opened = false; //already opened
+ this._io = false; //is opened
+
+ this._children = []; //references to children
+ this._parent; //pointer to parent
+ this._myTree; //pointer to myTree
+
+ for (i in arrayProps)
+ {
+ if (i.charAt(0) != '_')
+ {
+ eval('this.'+i+' = arrayProps[\''+i+'\'];');
+ }
+ }
+}
+
+//changes node state from open to closed, and vice-versa
+dNode.prototype.changeState = function()
+{
+ if (this._io)
+ {
+ this.close();
+ }
+ else
+ {
+ this.open();
+ }
+
+ //cons = COokie of Node Status
+ //setCookie("cons"+this.id,this._io);
+}
+
+dNode.prototype.open = function () {
+ if (!this._io)
+ {
+ if (!this._opened && this.runJS && this.onFirstOpen != null)
+ {
+ eval(this.onFirstOpen);
+ }
+ else if (this.runJS && this.onOpen != null)
+ {
+ eval(this.onOpen);
+ }
+
+ this._opened = true;
+ this._io = true;
+ this._refresh();
+ }
+}
+
+
+dNode.prototype.close = function() {
+ if (this._io)
+ {
+ if (this.runJS && this.onClose != null)
+ {
+ eval(this.onClose);
+ }
+ this._io = false;
+ this._refresh();
+ }
+}
+
+//alter node label and other properties
+dNode.prototype.alter = function(arrayProps)
+{
+ for (i in arrayProps)
+ {
+ if (i != 'id' && i.charAt(0) != '_')
+ {
+ eval('this.'+i+' = arrayProps[\''+i+'\'];');
+ }
+ }
+}
+
+//css and dhtml refresh part
+dNode.prototype._refresh = function() {
+ var nodeDiv = getObjectById("n"+this.id);
+ var plusSpan = getObjectById("p"+this.id);
+ var captionSpan = getObjectById("l"+this.id);
+ var childrenDiv = getObjectById("ch"+this.id);
+
+ if (nodeDiv != null)
+ {
+ //Handling open and close: checks this._io and changes class as needed
+ if (!this._io) //just closed
+ {
+ childrenDiv.className = "closed";
+ }
+ else //just opened
+ {
+ //prevents IE undesired behaviour when displaying empty DIVs
+/* if (this._children.length > 0)
+ {*/
+ childrenDiv.className = "opened";
+ // }
+ }
+
+ plusSpan.innerHTML = this._properPlus();
+
+ captionSpan.innerHTML = this.caption;
+ }
+
+//alter onLoad, etc
+
+}
+
+//gets the proper plus for this moment
+dNode.prototype._properPlus = function()
+{
+ if (!this._io)
+ {
+ if (this._myTree.useIcons)
+ {
+ return (this.plusSign)?imageHTML(this._myTree.icons.plus):"";
+ }
+ else
+ {
+ return (this.plusSign)?"+":"";
+ }
+ }
+ else
+ {
+ if (this._myTree.useIcons)
+ {
+ return (this.plusSign)?imageHTML(this._myTree.icons.minus):"";
+ }
+ else
+ {
+ return (this.plusSign)?"-":"";
+ }
+ }
+}
+
+//changes node to selected style class. Perform further actions.
+dNode.prototype._select = function()
+{
+
+ var captionSpan;
+
+ if (this._myTree._selected)
+ {
+ this._myTree._selected._unselect();
+ }
+ this._myTree._selected = this;
+
+ captionSpan = getObjectById("l"+this.id);
+
+ //changes class to selected link
+ if (captionSpan)
+ {
+ captionSpan.className = 'sl';
+ }
+
+}
+
+//changes node to unselected style class. Perform further actions.
+dNode.prototype._unselect = function()
+{
+ var captionSpan = getObjectById("l"+this.id);
+
+ this._myTree._lastSelected = this._myTree._selected;
+ this._myTree._selected = null;
+
+ //changes class to selected link
+ if (captionSpan)
+ {
+ captionSpan.className = this.captionClass;
+ }
+}
+
+
+//state can be open or closed
+//warning: if drawed node is not child or root, bugs will happen
+dNode.prototype._draw = function()
+{
+ var str;
+ var div;
+ var myClass = (this._io)? "opened" : "closed";
+ var myPlus = this._properPlus();
+ var append = true;
+ var myPlusOnClick = this._myTree.name+'.getNodeById(\''+this.id+'\').changeState();';
+ var captionOnClickEvent = "";
+// var cook;
+
+ var plusEventHandler = function(){
+ eval(myPlusOnClick);
+ }
+
+ var captionEventHandler = function(){
+ eval(captionOnClickEvent);
+ }
+
+
+/* if (this.myTree.followCookies)
+ {
+ this._io = getCookie("cons"+this.id);
+ }*/
+
+ //FIXME put this in a separate function, as this will be necessary in
+ //various parts
+
+ captionOnClickEvent = this._myTree.name+'.getNodeById(\''+this.id+'\')._select(); ';
+ if (this.onClick) //FIXME when onclick && url
+ {
+ captionOnClickEvent += this.onClick;
+ }
+ else if (this.url && this.target)
+ {
+ captionOnClickEvent += 'window.open(\''+this.url+'\',\''+this.target+'\')';
+ }
+ else if (this.url)
+ {
+ captionOnClickEvent += 'window.location=\''+this.url+'\'';
+ }
+
+
+ //The div of this node
+ divN = document.createElement('div');
+ divN.id = 'n'+this.id;
+ divN.className = 'son';
+
+ //The span that holds the plus/minus sign
+ spanP = document.createElement('span');
+ spanP.id = 'p'+this.id;
+ spanP.className = 'plus';
+// spanP.addEventListener('click',plusEventHandler,false);
+ spanP.onclick = plusEventHandler;
+ spanP.innerHTML = myPlus;
+
+ //The span that holds the label/caption
+ spanL = document.createElement('span');
+ spanL.id = 'l'+this.id;
+ spanL.className = this.captionClass;
+// spanL.addEventListener('click',captionEventHandler,false);
+ spanL.onclick = captionEventHandler;
+ spanL.innerHTML = this.caption;
+
+ //The div that holds the children
+ divCH = document.createElement('div');
+ divCH.id = 'ch'+this.id;
+ divCH.className = myClass;
+
+
+// str = '<div id="n'+this.id+'" class="son">';
+// str = '<span id="p'+this.id+'" class="plus" onclick="'+myPlusOnClick+'">'+myPlus+'</span>';
+// str += '<span id="l'+this.id+'" class="l"'+captionOnClickEvent+'>'+this.caption+'</span>';
+// str += '<div id="ch'+this.id+'" class="'+myClass+'"></div>';
+
+// div.innerHTML = str;
+ divN.appendChild(spanP);
+ divN.appendChild(spanL);
+ divN.appendChild(divCH);
+
+
+ if (this._parent != null)
+ {
+ parentChildrenDiv = getObjectById("ch"+this._parent.id);
+ }
+ else //is root
+ {
+ parentChildrenDiv = getObjectById("dftree_"+this._myTree.name);
+// append = false;
+ }
+
+ if (parentChildrenDiv)
+ {
+
+ parentChildrenDiv.appendChild(divN);
+/* if (append)
+ {
+ parentChildrenDiv.innerHTML += str;
+ }
+ else
+ {
+ parentChildrenDiv.innerHTML = str;
+ }*/
+ }
+}
+
+// TREE
+//Usage: t = new dFTree({name:t, caption:'tree root', url:'http://www.w3.org'});
+function dFTree(arrayProps) {
+ //mandatory fields
+ this.name; //the value of this must be the name of the object
+
+ //optional fields
+ this.is_dynamic = true; //tree is dynamic, i.e. updated on the fly
+ this.followCookies = true;//use previous state (o/c) of nodes
+ this.useIcons = false; //use icons or not
+
+
+ //arrayProps[icondir]: Icons Directory
+ iconPath = (arrayProps['icondir'] != null)? arrayProps['icondir'] : '';
+
+ this.icons = {
+ root : iconPath+'/foldertree_base.gif',
+ folder : iconPath+'/foldertree_folder.gif',
+ folderOpen : iconPath+'/foldertree_folderopen.gif',
+ node : iconPath+'/foldertree_folder.gif',
+ empty : iconPath+'/foldertree_empty.gif',
+ line : iconPath+'/foldertree_line.gif',
+ join : iconPath+'/foldertree_join.gif',
+ joinBottom : iconPath+'/foldertree_joinbottom.gif',
+ plus : iconPath+'/foldertree_plus.gif',
+ plusBottom : iconPath+'/foldertree_plusbottom.gif',
+ minus : iconPath+'/foldertree_minus.gif',
+ minusBottom : iconPath+'/foldertree_minusbottom.gif',
+ nlPlus : iconPath+'/foldertree_nolines_plus.gif',
+ nlMinus : iconPath+'/foldertree_nolines_minus.gif'
+ };
+
+ //private
+ this._root; //reference to root node
+ this._aNodes = [];
+ this._lastSelected; //The last selected node
+ this._selected; //The actual selected node
+
+ for (i in arrayProps)
+ {
+ if (i.charAt(0) != '_')
+ {
+ eval('this.'+i+' = arrayProps[\''+i+'\'];');
+ }
+ }
+
+}
+
+dFTree.prototype.draw = function() {
+ if (!getObjectById("dftree_"+this.name))
+ {
+ document.write('<div id="dftree_'+this.name+'"></div>');
+ }
+
+ if (this._root != null)
+ {
+ this._root._draw();
+ this._drawBranch(this._root._children);
+ }
+
+}
+
+//Transforms tree in HTML code. Do not use it. Use draw() instead.
+/*dFTree.prototype.toString = function() {
+ var str = '';
+
+ if (!getObjectById("dftree_"+this.name))
+ {
+ str = '<div id="dftree_'+this.name+'"></div>';
+ }
+ return str;
+
+/ * if (this.root != false)
+ {
+ this.root._draw();
+ this._drawBranch(this.root.children);
+ }* /
+}*/
+
+//Recursive function, draws children
+dFTree.prototype._drawBranch = function(childrenArray) {
+ var a=0;
+ for (a;a<childrenArray.length;a++)
+ {
+ childrenArray[a]._draw();
+ this._drawBranch(childrenArray[a]._children);
+ }
+}
+
+//add into a position
+dFTree.prototype.add = function(node,pid) {
+ var auxPos;
+ var addNode = false;
+ if (typeof (auxPos = this._searchNode(node.id)) != "number")
+ {
+ // if parent exists, add node as its child
+ if (typeof (auxPos = this._searchNode(pid)) == "number")
+ {
+ node._parent = this._aNodes[auxPos];
+ this._aNodes[auxPos]._children[this._aNodes[auxPos]._children.length] = node;
+ addNode = true;
+ }
+ else //if parent cannot be found and there is a tree root, ignores node
+ {
+ if (this._root == null)
+ {
+ this._root = node;
+ addNode = true;
+ }
+ }
+ if (addNode)
+ {
+ this._aNodes[this._aNodes.length] = node;
+ node._myTree = this;
+ if (this.is_dynamic)
+ {
+ node._draw();
+ }
+ }
+ }
+
+}
+
+//arrayProps: same properties of Node
+dFTree.prototype.alter = function(arrayProps) {
+ if (arrayProps['id'])
+ {
+ this.getNodeById(arrayProps['id']).alter(arrayProps);
+ }
+}
+
+dFTree.prototype.getNodeById = function(nodeid) {
+ return this._aNodes[this._searchNode(nodeid)];
+}
+
+
+//Searches for a node in the node array, returning the position of the array 4it
+dFTree.prototype._searchNode = function(id) {
+ var a=0;
+ for (a;a<this._aNodes.length;a++)
+ {
+ if (this._aNodes[a].id == id)
+ {
+ return a;
+ }
+ }
+ return false;
+}
+
+
+//Auxiliar functions
+
+//For multi-browser compatibility
+function getObjectById(name)
+{
+ if (document.getElementById)
+ {
+ return document.getElementById(name);
+ }
+ else if (document.all)
+ {
+ return document.all[name];
+ }
+ else if (document.layers)
+ {
+ return document.layers[name];
+ }
+ return false;
+}
+
+// [Cookie] Clears a cookie
+function clearCookie(cookieName) {
+ var now = new Date();
+ var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
+ this.setCookie(cookieName, 'cookieValue', yesterday);
+ this.setCookie(cookieName, 'cookieValue', yesterday);
+};
+
+// [Cookie] Sets value in a cookie
+function setCookie(cookieName, cookieValue, expires, path, domain, secure) {
+ document.cookie =
+ escape(cookieName) + '=' + escape(cookieValue)
+ + (expires ? '; expires=' + expires.toGMTString() : '')
+ + (path ? '; path=' + path : '')
+ + (domain ? '; domain=' + domain : '')
+ + (secure ? '; secure' : '');
+};
+
+// [Cookie] Gets a value from a cookie
+function getCookie(cookieName) {
+ var cookieValue = '';
+ var posName = document.cookie.indexOf(escape(cookieName) + '=');
+ if (posName != -1) {
+ var posValue = posName + (escape(cookieName) + '=').length;
+ var endPos = document.cookie.indexOf(';', posValue);
+ if (endPos != -1)
+ {
+ cookieValue = unescape(document.cookie.substring(posValue, endPos));
+ }
+ else
+ {
+ cookieValue = unescape(document.cookie.substring(posValue));
+ }
+ }
+ return (cookieValue);
+};
+
+
+function imageHTML(src,attributes) {
+ if (attributes != null)
+ {
+ attributes = '';
+ }
+ return "<img "+attributes+" src=\""+src+"\">";
+}
+
Added: trunk/simexplorer-is-web/src/main/webapp/js/treeLoader.js
===================================================================
--- trunk/simexplorer-is-web/src/main/webapp/js/treeLoader.js (rev 0)
+++ trunk/simexplorer-is-web/src/main/webapp/js/treeLoader.js 2008-01-08 15:28:20 UTC (rev 99)
@@ -0,0 +1,72 @@
+var tree;
+var nodes = [];
+var inode = 0;
+
+function getNodeCallback(treeNode) {
+ for (var i = 0; i < treeNode.enfants.length; i++) {
+ createNode(treeNode.enfants[i].id, treeNode.enfants[i].libelle, treeNode.id);
+ }
+}
+
+function createNode(idNode, nodeCaption, parentId) {
+ var node = new dNode({id: idNode,caption: nodeCaption});
+
+ if (parentId == -1) {
+ TreeData.getNode(idNode, getNodeCallback);
+ } else {
+ node.alter({onFirstOpen: 'TreeData.getNode('+idNode+', getNodeCallback)'});
+ }
+
+ tree.add(node, parentId);
+ nodes[inode++] = node;
+}
+
+function initTree() {
+ tree = new dFTree({name: 'tree', icondir: './images/tree'});
+ tree.useIcons = true;
+ var i = 0;
+ var pid = [];
+ createNode(i++, 'Applications', -1); //root node
+
+ /*
+ pid[0] = i;
+ createNode(i++, 'My first application', 0);
+
+ pid[1] = i;
+ createNode(i++, 'Components [1]', pid[0]);
+ createNode(i++, 'Initialization [1]', pid[1]);
+ pid[2] = i;
+ createNode(i++, 'Experimental design [1]', pid[1]);
+ createNode(i++, 'Experimental design [1.1]', pid[2]);
+ createNode(i++, 'Input generating [1]', pid[1]);
+ createNode(i++, 'Model launching [1]', pid[1]);
+ createNode(i++, 'Output processing [1]', pid[1]);
+
+ pid[1] = i;
+ createNode(i++, 'Explorations', pid[0]);
+ pid[2] = i;
+ createNode(i++, 'First Exploration [1]', pid[1]);
+ pid[3] = i;
+ createNode(i++, 'Factors [1]', pid[2]);
+ createNode(i++, 'F1 = range(2,10,2)', pid[3]);
+ createNode(i++, 'F2 = (0.2,0.8)', pid[3]);
+ pid[3] = i;
+ createNode(i++, 'Constants [1]', pid[2]);
+ pid[4] = i;
+ createNode(i++, 'Input generating', pid[3]);
+ createNode(i++, 'ageMax = 12', pid[4]);
+ pid[4] = i;
+ createNode(i++, 'Output processing', pid[3]);
+ createNode(i++, 'diagramTitle = \'first application\'', pid[4]);
+
+ pid[0] = i;
+ createNode(i++, 'My second application', 0);
+ createNode(i++, 'Components', pid[0]);
+ createNode(i++, 'Explorations', pid[0]);
+
+ */
+
+ for (var j = 0; j < inode; j++) {
+ nodes[j].open();
+ }
+}
Added: trunk/simexplorer-is-web/xmi/simexplorer-is-web.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/xmi/simexplorer-is-web.zargo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: glandais
Date: 2008-01-08 15:27:48 +0000 (Tue, 08 Jan 2008)
New Revision: 98
Added:
trunk/simexplorer-is-web/
Log:
Re import (changed web path)
1
0
Author: glandais
Date: 2008-01-08 15:26:23 +0000 (Tue, 08 Jan 2008)
New Revision: 97
Added:
trunk/simexplorer-si-web/
Removed:
trunk/simexplorer-is-web/
Log:
Copied: trunk/simexplorer-si-web (from rev 96, trunk/simexplorer-is-web)
1
0
r96 - in trunk/simexplorer-is-web/src: java/fr/cemagref/simexplorer/is/ui/web/pages webcontent
by glandais@users.labs.libre-entreprise.org 04 Jan '08
by glandais@users.labs.libre-entreprise.org 04 Jan '08
04 Jan '08
Author: glandais
Date: 2008-01-04 16:55:38 +0000 (Fri, 04 Jan 2008)
New Revision: 96
Modified:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
Log:
EA export
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-04 16:00:46 UTC (rev 95)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-04 16:55:38 UTC (rev 96)
@@ -1,12 +1,19 @@
package fr.cemagref.simexplorer.is.ui.web.pages;
+import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import org.apache.tapestry.StreamResponse;
import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.util.TextStreamResponse;
import org.codelutin.tapestry.beans.TreeNode;
+import com.healthmarketscience.rmiio.RemoteOutputStream;
+import com.healthmarketscience.rmiio.RemoteOutputStreamServer;
+import com.healthmarketscience.rmiio.SimpleRemoteOutputStream;
+
import fr.cemagref.simexplorer.is.storage.entities.data.Code;
import fr.cemagref.simexplorer.is.storage.entities.data.Component;
import fr.cemagref.simexplorer.is.storage.entities.data.Constant;
@@ -42,6 +49,24 @@
return nodes;
}
+ public Object onActionFromExport(String context) throws Exception {
+ StreamResponse response = null;
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ RemoteOutputStreamServer xmlRemoteOutputStream = new SimpleRemoteOutputStream(
+ bos);
+ StorageServiceFactory.getService().exportElement(xmlRemoteOutputStream.export(),
+ explorationApplication.getMetaData().getUuid(),
+ explorationApplication.getMetaData().getVersion().toString());
+ response = new TextStreamResponse("text/xml", bos.toString());
+
+ return response;
+ }
+
+ public String getContext() {
+ return "node";
+ }
+
private String[] generateStringArray(String s1, String s2, String s3) {
String[] res = new String[4];
res[0] = s1;
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-04 16:00:46 UTC (rev 95)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-04 16:55:38 UTC (rev 96)
@@ -4,4 +4,6 @@
<table t:type="cl/TreeGrid" source="nodes" columnHeaders="headers">
</table>
+ <t:actionlink t:id="export" context="${context}">Export</t:actionlink>
+
</t:layout>
1
0
r95 - in trunk/simexplorer-is-web: . src/java/fr/cemagref/simexplorer/is/ui/web/components src/java/fr/cemagref/simexplorer/is/ui/web/pages src/ressources/fr/cemagref/simexplorer/is/ui/web/components src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css src/ressources/fr/cemagref/simexplorer/is/ui/web/pages src/webcontent src/webcontent/WEB-INF/lib
by glandais@users.labs.libre-entreprise.org 04 Jan '08
by glandais@users.labs.libre-entreprise.org 04 Jan '08
04 Jan '08
Author: glandais
Date: 2008-01-04 16:00:46 +0000 (Fri, 04 Jan 2008)
New Revision: 95
Added:
trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/tapestry5-treegrid-0.0.1-SNAPSHOT.jar
Removed:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/
Modified:
trunk/simexplorer-is-web/.classpath
trunk/simexplorer-is-web/pom.xml
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties
trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
Log:
Externalisation du composant TreeGrid
Affichage d'une exploration
Modified: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/.classpath 2008-01-04 16:00:46 UTC (rev 95)
@@ -4,11 +4,12 @@
<classpathentry kind="src" path="target/gen/java"/>
<classpathentry kind="src" path="src/ressources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
- <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: trunk/simexplorer-is-web/pom.xml
===================================================================
--- trunk/simexplorer-is-web/pom.xml 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/pom.xml 2008-01-04 16:00:46 UTC (rev 95)
@@ -158,5 +158,6 @@
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
+
</dependencies>
</project>
\ No newline at end of file
Deleted: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java 2008-01-04 16:00:46 UTC (rev 95)
@@ -1,147 +0,0 @@
-package fr.cemagref.simexplorer.is.ui.web.components;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tapestry.MarkupWriter;
-import org.apache.tapestry.annotations.Environmental;
-import org.apache.tapestry.annotations.IncludeJavaScriptLibrary;
-import org.apache.tapestry.annotations.IncludeStylesheet;
-import org.apache.tapestry.annotations.Parameter;
-import org.apache.tapestry.annotations.SupportsInformalParameters;
-import org.apache.tapestry.services.Heartbeat;
-
-import fr.cemagref.simexplorer.is.ui.web.components.beans.RenderableNode;
-import fr.cemagref.simexplorer.is.ui.web.components.beans.TreeNode;
-
- at SupportsInformalParameters
- at IncludeStylesheet("css/TreeGrid.css")
- at IncludeJavaScriptLibrary("js/TreeGrid.js")
-public class TreeGrid {
-
- private List<RenderableNode> list;
-
- /**
- * Iterator to iterate over all tree elements
- */
- private Iterator<RenderableNode> iterator;
-
- /**
- * Defines the source Tree to walk over.
- */
- @Parameter(required = true)
- private List<TreeNode> source;
-
- @Parameter(required = true)
- private List<String> columnHeaders;
-
- /**
- * Current node of the tree
- */
- private RenderableNode currentNode;
-
- @Environmental
- private Heartbeat heartbeat;
-
- private void buildSourceList(TreeNode treeNode, int depth, String dotId) {
- list.add(new RenderableNode(treeNode, depth, dotId));
- TreeNode[] children = (TreeNode[]) treeNode.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (!list.contains(children[i])) {
- buildSourceList(children[i], depth + 1, dotId + "-" + i);
- }
- }
- }
-
- boolean setupRender(MarkupWriter writer) {
- if (source == null)
- return false;
-
- list = new ArrayList<RenderableNode>();
- int i = 0;
- for (TreeNode node : source) {
- buildSourceList(node, 0, Integer.toString(i));
- i++;
- }
- iterator = list.iterator();
-
- // begin table
- writer.element("table", "width", "100%");
-
- // header row
- writer.element("tr");
- if (columnHeaders != null) {
- int col = 0;
- for (String column : columnHeaders) {
- /*
- if (col == 0) {
- writer.element("th", "width", "20%");
- } else {
- writer.element("th");
- }
- */
- writer.element("th");
- writer.writeRaw(column);
- writer.end();
- col++;
- }
- }
- writer.end();
-
- return (iterator.hasNext());
- }
-
- /** Begins a new heartbeat. */
- void beginRender() {
- currentNode = iterator.next();
- heartbeat.begin();
- }
-
- void beforeRenderBody(MarkupWriter writer) {
- String[] columns = currentNode.getInnerNode().getColumns();
-
- writer.element("tr", "id", currentNode.getDotId(), "class", "a");
-
- writer.element("td");
- writer.element("div", "class", "tier" + currentNode.getDepth());
- if (currentNode.getInnerNode().getType() == TreeNode.TYPE_FOLDER) {
- writer.element("a", "href", "#", "class", "folderopen", "onclick",
- "toggleRows(this)");
- } else {
- writer.element("a", "href", "#", "class", "doc");
- }
- // a
- writer.end();
-
- if (columns.length > 0) {
- writer.writeRaw(columns[0]);
- }
- // div
- writer.end();
- // td
- writer.end();
-
- for (int i = 1; i < columns.length; i++) {
- writer.element("td");
- writer.writeRaw(columns[i]);
- // td
- writer.end();
- }
-
- // tr
- writer.end();
- }
-
- /** Ends the current heartbeat. */
- boolean afterRender() {
- heartbeat.end();
- return (!iterator.hasNext());
- }
-
- void cleanupRender(MarkupWriter writer) {
- // end table
- writer.end();
- }
-
-}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-04 16:00:46 UTC (rev 95)
@@ -2,81 +2,205 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Random;
+import java.util.Set;
import org.apache.tapestry.annotations.Persist;
+import org.codelutin.tapestry.beans.TreeNode;
-import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
-import fr.cemagref.simexplorer.is.ui.web.components.beans.TreeNode;
+import fr.cemagref.simexplorer.is.storage.entities.data.Code;
+import fr.cemagref.simexplorer.is.storage.entities.data.Component;
+import fr.cemagref.simexplorer.is.storage.entities.data.Constant;
+import fr.cemagref.simexplorer.is.storage.entities.data.ConstantValue;
+import fr.cemagref.simexplorer.is.storage.entities.data.ExplorationApplication;
+import fr.cemagref.simexplorer.is.storage.entities.data.ExplorationData;
+import fr.cemagref.simexplorer.is.storage.entities.data.Library;
+import fr.cemagref.simexplorer.is.storage.entities.data.Result;
+import fr.cemagref.simexplorer.is.storage.entities.data.Structure;
import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
public class ApplicationDetail extends AbstractApplicationDetail {
@Persist
- private MetaDataEntity explorationApplication;
+ private ExplorationApplication explorationApplication;
public void setup(String uuid, String version) throws Exception {
explorationApplication = StorageServiceFactory.getService()
- .getMetadata(uuid, version);
+ .getExplorationApplication(uuid, version);
}
- public MetaDataEntity getExplorationApplication() {
- return explorationApplication;
+ public List<String> getHeaders() {
+ List<String> result = new ArrayList<String>();
+ result.add("");
+ result.add("");
+ result.add("");
+ return result;
}
- public void setExplorationApplication(MetaDataEntity explorationApplication) {
- this.explorationApplication = explorationApplication;
+ public List<TreeNode> getNodes() {
+ List<TreeNode> nodes = new ArrayList<TreeNode>();
+ nodes.add(generateAppllication());
+ return nodes;
}
- public String getMessage() {
- return explorationApplication.getDescription();
+ private String[] generateStringArray(String s1, String s2, String s3) {
+ String[] res = new String[4];
+ res[0] = s1;
+ res[1] = s2;
+ res[2] = s3;
+ return res;
}
- private Random r = new Random();
-
- private TreeNode generateNode(TreeNode parent, int level) {
+ private TreeNode generateAppllication() {
TreeNode node = new TreeNode();
- node.setIdentifier(r.nextLong());
+ node.setType(TreeNode.TYPE_FOLDER);
- if (level > 1 && (r.nextBoolean() || level == 4)) {
- node.setType(TreeNode.TYPE_DOCUMENT);
- node.setChildren(new TreeNode[0]);
- } else {
- int c = 3 + r.nextInt(5);
- TreeNode[] children = new TreeNode[c];
- for (int i = 0; i < children.length; i++) {
- children[i] = generateNode(node, level + 1);
- }
- node.setType(TreeNode.TYPE_FOLDER);
- node.setChildren(children);
+ node.setColumns(generateStringArray("Exploration Application",
+ explorationApplication.getMetaData().getDescription(),
+ explorationApplication.getMetaData().getVersion().toString()));
+ TreeNode[] children = new TreeNode[2];
+ children[0] = new TreeNode();
+ children[0].setType(TreeNode.TYPE_FOLDER);
+ children[0].setColumns(generateStringArray("Components", "", ""));
+ children[0].setChildren(generateComponents());
+
+ children[1] = new TreeNode();
+ children[1].setType(TreeNode.TYPE_FOLDER);
+ children[1].setColumns(generateStringArray("Explorations", "", ""));
+ children[1].setChildren(generateExplorations());
+
+ node.setChildren(children);
+
+ return node;
+ }
+
+ private TreeNode[] generateExplorations() {
+ TreeNode[] res = new TreeNode[explorationApplication.getExplorations()
+ .size()];
+ int i = 0;
+ for (ExplorationData explorationData : explorationApplication
+ .getExplorations()) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_FOLDER);
+ res[i].setColumns(generateStringArray("Exploration data",
+ explorationData.getMetaData().getDescription(),
+ explorationData.getMetaData().getVersion().toString()));
+ TreeNode[] children = new TreeNode[2];
+ children[0] = generateResult(explorationData.getResult());
+ children[1] = new TreeNode();
+ children[1].setType(TreeNode.TYPE_FOLDER);
+ children[1].setColumns(generateStringArray("Values", "", ""));
+ children[1].setChildren(generateValues(explorationData));
+ res[i].setChildren(children);
+ i++;
}
+ return res;
+ }
- String[] columns = new String[3];
- for (int i = 0; i < columns.length; i++) {
- columns[i] = Long.toHexString(r.nextLong());
- if (r.nextBoolean()) {
- columns[i] = "<b>" + columns[i] + "</b>";
+ private TreeNode[] generateValues(ExplorationData explorationData) {
+ Set<ConstantValue> values = explorationData.getValuesMap();
+ TreeNode[] res = new TreeNode[values.size()];
+ int i = 0;
+ for (ConstantValue value : values) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray(
+ value.getConstant().getName(), value.getValue(), value
+ .getConstant().getType().getSimpleName()));
+ i++;
+ }
+
+ return res;
+ }
+
+ private TreeNode generateResult(Result result) {
+ TreeNode res = new TreeNode();
+ res.setType(TreeNode.TYPE_DOCUMENT);
+ res.setColumns(generateStringArray("Result", "", ""));
+ return res;
+ }
+
+ private TreeNode[] generateComponents() {
+ Set<Component> components = explorationApplication.getComponents();
+ TreeNode[] res = new TreeNode[components.size()];
+
+ int i = 0;
+ for (Component component : components) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_FOLDER);
+ res[i].setColumns(generateStringArray("Component", component
+ .getMetaData().getDescription(), component.getMetaData()
+ .getVersion().toString()));
+ TreeNode[] children = new TreeNode[4];
+ for (int j = 0; j < children.length; j++) {
+ children[j] = new TreeNode();
+ children[j].setType(TreeNode.TYPE_FOLDER);
}
+ children[0].setColumns(generateStringArray("Constants", "", ""));
+ children[0]
+ .setChildren(generateConstants(component.getConstants()));
+ children[1].setColumns(generateStringArray("Structures", "", ""));
+ children[1].setChildren(generateStructures(component
+ .getStructures()));
+ children[2].setColumns(generateStringArray("Codes", "", ""));
+ children[2].setChildren(generateCodes(component.getCodes()));
+ children[3].setColumns(generateStringArray("Libraries", "", ""));
+ children[3]
+ .setChildren(generateLibraries(component.getLibraries()));
+ res[i].setChildren(children);
+ i++;
}
- node.setColumns(columns);
- return node;
+ return res;
}
- public List<TreeNode> getNodes() {
- List<TreeNode> nodes = new ArrayList<TreeNode>();
- nodes.add(generateNode(null, 0));
- nodes.add(generateNode(null, 0));
- nodes.add(generateNode(null, 0));
- return nodes;
+ private TreeNode[] generateLibraries(Set<Library> libraries) {
+ TreeNode[] res = new TreeNode[libraries.size()];
+ int i = 0;
+ for (Library library : libraries) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Library", "", ""));
+ i++;
+ }
+ return res;
}
- public List<String> getHeaders() {
- List<String> result = new ArrayList<String>();
- result.add("");
- result.add("");
- result.add("");
- return result;
+ private TreeNode[] generateCodes(Set<Code> codes) {
+ TreeNode[] res = new TreeNode[codes.size()];
+ int i = 0;
+ for (Code code : codes) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Code", code.getLanguage(),
+ code.getCode()));
+ i++;
+ }
+ return res;
}
+ private TreeNode[] generateStructures(Set<Structure> structures) {
+ TreeNode[] res = new TreeNode[structures.size()];
+ int i = 0;
+ for (Structure structure : structures) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Structure", "", ""));
+ i++;
+ }
+ return res;
+ }
+
+ private TreeNode[] generateConstants(Set<Constant> constants) {
+ TreeNode[] res = new TreeNode[constants.size()];
+ int i = 0;
+ for (Constant constant : constants) {
+ res[i] = new TreeNode();
+ res[i].setType(TreeNode.TYPE_DOCUMENT);
+ res[i].setColumns(generateStringArray("Constant", constant
+ .getName(), constant.getType().getSimpleName()));
+ i++;
+ }
+ return res;
+ }
+
}
Deleted: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css 2008-01-04 16:00:46 UTC (rev 95)
@@ -1,67 +0,0 @@
-.folderclose {
- background: transparent url(../images/folder-closed.gif)
- no-repeat scroll 0%;
- float: left;
- height: 14px;
- padding-right: 3px;
- width: 26px;
-}
-
-.folderopen {
- background: transparent url(../images/folder-open.gif)
- no-repeat scroll 0%;
- float: left;
- height: 14px;
- padding-right: 3px;
- width: 26px;
-}
-
-.doc {
- background: transparent url(../images/file.gif) no-repeat
- scroll 0%;
- float: left;
- height: 14px;
- margin-left: 20px;
- padding-right: 3px;
- width: 12px;
-}
-
-.tier0 {
- margin-left: 0pt;
-}
-
-.tier1 {
- margin-left: 1.5em;
-}
-
-.tier2 {
- margin-left: 3em;
-}
-
-.tier3 {
- margin-left: 4.5em;
-}
-
-.tier4 {
- margin-left: 6em;
-}
-
-.tier5 {
- margin-left: 7.5em;
-}
-
-.tier6 {
- margin-left: 9em;
-}
-
-.tier7 {
- margin-left: 10.5em;
-}
-
-.tier8 {
- margin-left: 12em;
-}
-
-.tier9 {
- margin-left: 13.5em;
-}
\ No newline at end of file
Modified: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties 2008-01-04 16:00:46 UTC (rev 95)
@@ -0,0 +1 @@
+windowtitle=Application detail
\ No newline at end of file
Modified: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties 2008-01-04 16:00:46 UTC (rev 95)
@@ -1,2 +1,4 @@
windowtitle=Import
-upload=Upload
\ No newline at end of file
+upload=Upload
+explorationapplication=Exploration application
+library=Library
\ No newline at end of file
Modified: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties 2008-01-04 16:00:46 UTC (rev 95)
@@ -0,0 +1 @@
+windowtitle=Application list
\ No newline at end of file
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-04 15:59:36 UTC (rev 94)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-04 16:00:46 UTC (rev 95)
@@ -1,7 +1,7 @@
<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="message:windowtitle">
- <t:TreeGrid source="nodes" columnHeaders="headers">
- </t:TreeGrid>
+ <table t:type="cl/TreeGrid" source="nodes" columnHeaders="headers">
+ </table>
</t:layout>
Added: trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/tapestry5-treegrid-0.0.1-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/tapestry5-treegrid-0.0.1-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
r94 - in trunk/simexplorer-si-storage/src: java/fr/cemagref/simexplorer/is/storage java/fr/cemagref/simexplorer/is/storage/attachment java/fr/cemagref/simexplorer/is/storage/attachment/handler java/fr/cemagref/simexplorer/is/storage/database/lucene java/fr/cemagref/simexplorer/is/storage/engine java/fr/cemagref/simexplorer/is/storage/entities java/fr/cemagref/simexplorer/is/storage/entities/data java/fr/cemagref/simexplorer/is/storage/entities/metadata java/fr/cemagref/simexplorer/i
by glandais@users.labs.libre-entreprise.org 04 Jan '08
by glandais@users.labs.libre-entreprise.org 04 Jan '08
04 Jan '08
Author: glandais
Date: 2008-01-04 15:59:36 +0000 (Fri, 04 Jan 2008)
New Revision: 94
Added:
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceMassInsert.java
Removed:
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/Content.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/xml/
Modified:
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/handler/FileSystemAttachmentHandler.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/BaseEntity.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Code.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Component.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Constant.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ConstantValue.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/DataEntity.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationApplication.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationData.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Library.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Repository.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Result.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/MetaDataEntity.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/BaseEntityFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/CodeFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ComponentFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantValueFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationApplicationFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationDataFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/LoggableElementFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/MetaDataEntityFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/RepositoryFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ResultFactory.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/XmlConstants.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/ElementGenerator.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/MetaDataGenerator.java
Log:
Suppression de Content
MAJ des factories
Suppression du package Parser
Export d'un EA
Deleted: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/Content.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/Content.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/Content.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,28 +0,0 @@
-package fr.cemagref.simexplorer.is.storage.attachment;
-
-import java.io.InputStream;
-
-import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
-
-public class Content {
-
- private ContentType type;
- private InputStream content;
-
- public ContentType getType() {
- return type;
- }
-
- public void setType(ContentType type) {
- this.type = type;
- }
-
- public InputStream getContent() {
- return content;
- }
-
- public void setContent(InputStream content) {
- this.content = content;
- }
-
-}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/handler/FileSystemAttachmentHandler.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/handler/FileSystemAttachmentHandler.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/handler/FileSystemAttachmentHandler.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -21,7 +21,7 @@
/**
* Base folder FIXME config
*/
- private static String baseFolder = "./data/";
+ private static String baseFolder = "/var/local/simexplorer/data1/";
/**
* Retrieve file associated to content Create directories associated to file
@@ -37,8 +37,18 @@
String resultPath = baseFolder;
// Create file path
- resultPath = resultPath + entity.getUuid() + "/"
- + entity.getVersion().toString() + "/" + field;
+ if (entity.getUuid().length() > 2) {
+ resultPath = resultPath
+ + entity.getUuid().substring(0, 1)
+ + "/"
+ + entity.getUuid().substring(1, 2)
+ + "/"
+ + entity.getUuid();
+ } else {
+ resultPath = resultPath + entity.getUuid();
+ }
+ resultPath = resultPath + "/" + entity.getVersion().toString() + "/"
+ + field;
File result = new File(resultPath);
// Create directories
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -36,7 +36,7 @@
import org.apache.lucene.store.LockFactory;
import org.apache.lucene.store.NoLockFactory;
-import fr.cemagref.simexplorer.is.storage.attachment.Content;
+import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
import fr.cemagref.simexplorer.is.storage.attachment.type.ContentTypeFactory;
import fr.cemagref.simexplorer.is.storage.database.Database;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
@@ -50,558 +50,558 @@
*/
public class LuceneDatabase extends Database {
- /**
- * Lock factory for Lucene writer
- */
- private static LockFactory lockFactory = new NoLockFactory();
- /**
- * Location of index
- */
- private Directory directory;
- /**
- * Index writer
- */
- private IndexWriter writer = null;
- /**
- * Pool of searcher
- */
- private SearcherPool searcherPool = new SearcherPool();
- /**
- * Searcher that should be used for new queries
- */
- private Searcher cachedSearcher = null;
- /**
- * Date of latest optimization
- */
- private Date lastOptimize = new Date();
+ /**
+ * Lock factory for Lucene writer
+ */
+ private static LockFactory lockFactory = new NoLockFactory();
+ /**
+ * Location of index
+ */
+ private Directory directory;
+ /**
+ * Index writer
+ */
+ private IndexWriter writer = null;
+ /**
+ * Pool of searcher
+ */
+ private SearcherPool searcherPool = new SearcherPool();
+ /**
+ * Searcher that should be used for new queries
+ */
+ private Searcher cachedSearcher = null;
+ /**
+ * Date of latest optimization
+ */
+ private Date lastOptimize = new Date();
- /**
- * Retrieve searcher for a new query
- *
- * @return Searcher
- * @throws CorruptIndexException
- * @throws IOException
- */
- private Searcher getSearcher() throws CorruptIndexException, IOException {
- synchronized (this) {
- // If cached searcher is null (as after an index write)
- if (cachedSearcher == null) {
- // Instanciate a new searcher
- cachedSearcher = new IndexSearcher(directory);
- }
- // Mark searcher as being used in a new query
- searcherPool.capture(cachedSearcher);
- return cachedSearcher;
- }
- }
+ /**
+ * Retrieve searcher for a new query
+ *
+ * @return Searcher
+ * @throws CorruptIndexException
+ * @throws IOException
+ */
+ private Searcher getSearcher() throws CorruptIndexException, IOException {
+ synchronized (this) {
+ // If cached searcher is null (as after an index write)
+ if (cachedSearcher == null) {
+ // Instanciate a new searcher
+ cachedSearcher = new IndexSearcher(directory);
+ }
+ // Mark searcher as being used in a new query
+ searcherPool.capture(cachedSearcher);
+ return cachedSearcher;
+ }
+ }
- /**
- * Release searcher, after the end of a query execution
- *
- * @param searcher
- * Searcher to be released
- * @throws IOException
- */
- private void releaseSearcher(Searcher searcher) throws IOException {
- synchronized (this) {
- searcherPool.release(searcher);
- }
- }
+ /**
+ * Release searcher, after the end of a query execution
+ *
+ * @param searcher
+ * Searcher to be released
+ * @throws IOException
+ */
+ private void releaseSearcher(Searcher searcher) throws IOException {
+ synchronized (this) {
+ searcherPool.release(searcher);
+ }
+ }
- /**
- * Called to invalidate reader
- *
- * @throws IOException
- */
- private void resetReader() throws IOException {
- synchronized (this) {
- // Reset searcher
- if (cachedSearcher != null) {
- // Mark as should be closed asap
- searcherPool.mark(cachedSearcher);
- cachedSearcher = null;
- }
- }
- }
+ /**
+ * Called to invalidate reader
+ *
+ * @throws IOException
+ */
+ private void resetReader() throws IOException {
+ synchronized (this) {
+ // Reset searcher
+ if (cachedSearcher != null) {
+ // Mark as should be closed asap
+ searcherPool.mark(cachedSearcher);
+ cachedSearcher = null;
+ }
+ }
+ }
- @Override
- public void open(boolean create) throws Exception {
- // Create an analyzer
- Analyzer analyzer = new SimpleAnalyzer();
+ @Override
+ public void open(boolean create) throws Exception {
+ // Create an analyzer
+ Analyzer analyzer = new SimpleAnalyzer();
- // FIXME index location
- //File indexDir = new File("./index/");
- File indexDir = new File("/home/glandais/lucene/index.big");
+ // FIXME index location
+ // File indexDir = new File("./index/");
+ // File indexDir = new File("/home/glandais/lucene/index.big");
+ File indexDir = new File("/var/local/simexplorer/db1");
- // Base directory index
- directory = FSDirectory.getDirectory(indexDir, lockFactory);
+ // Base directory index
+ directory = FSDirectory.getDirectory(indexDir, lockFactory);
- boolean realCreate = create;
- if (!IndexReader.indexExists(directory)) {
- realCreate = true;
- }
+ boolean realCreate = create;
+ if (!IndexReader.indexExists(directory)) {
+ realCreate = true;
+ }
- // Instanciate unique writer
- writer = new IndexWriter(directory, true, analyzer, realCreate);
-
- if (realCreate) {
- commit();
- }
- }
+ // Instanciate unique writer
+ writer = new IndexWriter(directory, true, analyzer, realCreate);
- @Override
- public void close() throws Exception {
- writer.close();
- resetReader();
- }
+ if (realCreate) {
+ commit();
+ }
+ }
- private synchronized void synchedCommit() throws CorruptIndexException,
- IOException {
- // Flush in ram data
- writer.flush();
- // Check if an optimization is required
- Date now = new Date();
- long elapsed = now.getTime() - lastOptimize.getTime();
- // FIXME One optimize per hour, if readers are closed
- if (elapsed > 3600 * 1000 && searcherPool.allClosed()) {
- writer.optimize();
- lastOptimize = new Date();
- }
- // System.out.println(writer.docCount());
- // Invalidate reader
- resetReader();
- }
+ @Override
+ public void close() throws Exception {
+ writer.close();
+ resetReader();
+ }
- @Override
- public void commit() throws Exception {
- synchedCommit();
- }
+ private synchronized void synchedCommit() throws CorruptIndexException,
+ IOException {
+ // Flush in ram data
+ writer.flush();
+ // Check if an optimization is required
+ Date now = new Date();
+ long elapsed = now.getTime() - lastOptimize.getTime();
+ // FIXME One optimize per hour, if readers are closed
+ if (elapsed > 3600 * 1000 && searcherPool.allClosed()) {
+ writer.optimize();
+ lastOptimize = new Date();
+ }
+ // System.out.println(writer.docCount());
+ // Invalidate reader
+ resetReader();
+ }
- @Override
- public void insertElement(MetaDataEntity element, List<Reader> readers)
- throws Exception {
- // Save element to a Lucene document
- Document document = saveLuceneElement(element, readers);
+ @Override
+ public void commit() throws Exception {
+ synchedCommit();
+ }
- // Retrieve existing element with same id/version
- MetaDataEntity oldElement = getElement(element.getUuid(), element
- .getVersion());
- // Delete element if exists, for update
- if (oldElement != null) {
- // update
- deleteElement(element);
- }
+ @Override
+ public void insertElement(MetaDataEntity element, List<Reader> readers)
+ throws Exception {
+ // Save element to a Lucene document
+ Document document = saveLuceneElement(element, readers);
- // add document to index
- writer.addDocument(document);
- }
+ // Retrieve existing element with same id/version
+ MetaDataEntity oldElement = getElement(element.getUuid(), element
+ .getVersion());
+ // Delete element if exists, for update
+ if (oldElement != null) {
+ // update
+ deleteElement(element);
+ }
- @Override
- public MetaDataEntity getElement(String uuid, Version version)
- throws Exception {
- MetaDataEntity result = null;
+ // add document to index
+ writer.addDocument(document);
+ }
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- Hits hits = getHitsByIdVersion(uuid, version, searcher);
- if (hits != null && hits.length() != 0) {
- // convert first document to element
- result = loadLuceneElement(hits.doc(0));
- }
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ @Override
+ public MetaDataEntity getElement(String uuid, Version version)
+ throws Exception {
+ MetaDataEntity result = null;
- return result;
- }
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ Hits hits = getHitsByIdVersion(uuid, version, searcher);
+ if (hits != null && hits.length() != 0) {
+ // convert first document to element
+ result = loadLuceneElement(hits.doc(0));
+ }
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- /**
- * @param uuid
- * @param version
- * @return
- * @throws IOException
- * @throws Exception
- */
- private Hits getHitsByIdVersion(String uuid, Version version,
- Searcher searcher) throws IOException {
- // Retrieve element with id/version
- Map<String, String> properties = new HashMap<String, String>();
- properties.put(KEY_UUID, uuid);
- properties.put(KEY_VERSION, version.toString());
+ return result;
+ }
- // Search elements
- Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
- return hits;
- }
+ /**
+ * @param uuid
+ * @param version
+ * @return
+ * @throws IOException
+ * @throws Exception
+ */
+ private Hits getHitsByIdVersion(String uuid, Version version,
+ Searcher searcher) throws IOException {
+ // Retrieve element with id/version
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put(KEY_UUID, uuid);
+ properties.put(KEY_VERSION, version.toString());
- @Override
- public List<Version> getVersions(String uuid) throws Exception {
- // Retrieve all document corresponding to id
- Map<String, String> properties = new HashMap<String, String>();
- properties.put(KEY_UUID, uuid);
+ // Search elements
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
+ return hits;
+ }
- List<Version> versions = null;
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
+ @Override
+ public List<Version> getVersions(String uuid) throws Exception {
+ // Retrieve all document corresponding to id
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put(KEY_UUID, uuid);
- // Add all versions to a list
- versions = new ArrayList<Version>();
- if (hits != null) {
- for (int i = 0; i < hits.length(); i++) {
- Document doc = hits.doc(i);
- versions.add(new Version(doc.get(KEY_VERSION)));
- }
- }
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ List<Version> versions = null;
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
- return versions;
- }
+ // Add all versions to a list
+ versions = new ArrayList<Version>();
+ if (hits != null) {
+ for (int i = 0; i < hits.length(); i++) {
+ Document doc = hits.doc(i);
+ versions.add(new Version(doc.get(KEY_VERSION)));
+ }
+ }
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- @Override
- public Set<MetaDataEntity> findElementsById(String uuid, boolean onlyLatest)
- throws Exception {
- // Create hash map with id
- Map<String, String> properties = new HashMap<String, String>();
- properties.put(KEY_UUID, uuid);
- if (onlyLatest) {
- properties.put(KEY_LATEST, "1");
- }
+ return versions;
+ }
- Set<MetaDataEntity> result = null;
+ @Override
+ public Set<MetaDataEntity> findElementsById(String uuid, boolean onlyLatest)
+ throws Exception {
+ // Create hash map with id
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put(KEY_UUID, uuid);
+ if (onlyLatest) {
+ properties.put(KEY_LATEST, "1");
+ }
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
- result = convertHitsToElements(hits, 0, -1);
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ Set<MetaDataEntity> result = null;
- // Return all elements parsed from documents fund
- return result;
- }
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
+ result = convertHitsToElements(hits, 0, -1);
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- @Override
- public int findElementsByPropertiesCount(Map<String, String> properties)
- throws Exception {
- int result = 0;
+ // Return all elements parsed from documents fund
+ return result;
+ }
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
- result = hits.length();
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ @Override
+ public int findElementsByPropertiesCount(Map<String, String> properties)
+ throws Exception {
+ int result = 0;
- // Return all elements parsed from documents fund
- return result;
- }
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
+ result = hits.length();
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- @Override
- public Set<MetaDataEntity> findElementsByProperties(
- Map<String, String> properties, int start, int count, int dateOrder)
- throws Exception {
- Set<MetaDataEntity> result = null;
+ // Return all elements parsed from documents fund
+ return result;
+ }
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- Hits hits = findHits(properties, searcher, dateOrder);
- result = convertHitsToElements(hits, start, count);
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ @Override
+ public Set<MetaDataEntity> findElementsByProperties(
+ Map<String, String> properties, int start, int count, int dateOrder)
+ throws Exception {
+ Set<MetaDataEntity> result = null;
- // Return all elements parsed from documents fund
- return result;
- }
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ Hits hits = findHits(properties, searcher, dateOrder);
+ result = convertHitsToElements(hits, start, count);
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- @Override
- public int findElementsByContentSearchCount(String queryText,
- boolean onlyLatest) throws Exception {
- Query query = getQueryByContentSearch(queryText, onlyLatest);
+ // Return all elements parsed from documents fund
+ return result;
+ }
- int result = 0;
+ @Override
+ public int findElementsByContentSearchCount(String queryText,
+ boolean onlyLatest) throws Exception {
+ Query query = getQueryByContentSearch(queryText, onlyLatest);
- Hits hits = null;
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- hits = searcher.search(query);
- // Return hits length
- result = hits.length();
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ int result = 0;
- return result;
- }
+ Hits hits = null;
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ hits = searcher.search(query);
+ // Return hits length
+ result = hits.length();
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- private Sort getSortDate(int dateOrder) {
- Sort sort = null;
+ return result;
+ }
+
+ private Sort getSortDate(int dateOrder) {
+ Sort sort = null;
if (dateOrder == SORT_DATE_DESCENDING) {
sort = new Sort(SORT_DATE_FIELD, true);
}
if (dateOrder == SORT_DATE_ASCENDING) {
sort = new Sort(SORT_DATE_FIELD);
}
- return sort;
- }
-
- @Override
- public Set<MetaDataEntity> findElementsByContentSearch(String queryText,
- boolean onlyLatest, int start, int count, int dateOrder) throws Exception {
- Query query = getQueryByContentSearch(queryText, onlyLatest);
+ return sort;
+ }
- Set<MetaDataEntity> result = null;
+ @Override
+ public Set<MetaDataEntity> findElementsByContentSearch(String queryText,
+ boolean onlyLatest, int start, int count, int dateOrder)
+ throws Exception {
+ Query query = getQueryByContentSearch(queryText, onlyLatest);
- Hits hits = null;
- // Get current searcher instance
- Searcher searcher = getSearcher();
- try {
- hits = searcher.search(query, getSortDate(dateOrder));
- // Convert hits to elements
- result = convertHitsToElements(hits, start, count);
- } finally {
- // Release searcher instance
- releaseSearcher(searcher);
- }
+ Set<MetaDataEntity> result = null;
- return result;
- }
+ Hits hits = null;
+ // Get current searcher instance
+ Searcher searcher = getSearcher();
+ try {
+ hits = searcher.search(query, getSortDate(dateOrder));
+ // Convert hits to elements
+ result = convertHitsToElements(hits, start, count);
+ } finally {
+ // Release searcher instance
+ releaseSearcher(searcher);
+ }
- private Query getQueryByContentSearch(String queryText, boolean onlyLatest)
- throws ParseException {
- Query query;
- Analyzer analyzer = new SimpleAnalyzer();
- QueryParser parser = new QueryParser(KEY_SEARCHABLE_CONTENT, analyzer);
- Query searchQuery = parser.parse(queryText);
- if (onlyLatest) {
- query = new BooleanQuery();
- ((BooleanQuery) query).add(searchQuery, BooleanClause.Occur.MUST);
- ((BooleanQuery) query).add(
- new TermQuery(new Term(KEY_LATEST, "1")),
- BooleanClause.Occur.MUST);
- } else {
- query = searchQuery;
- }
- return query;
- }
+ return result;
+ }
- @Override
- public void deleteElement(String uuid, Version version) throws Exception {
- // Delete element in db with term search
- Term[] terms = new Term[2];
- terms[0] = new Term(KEY_UUID, uuid);
- terms[1] = new Term(KEY_VERSION, version.toString());
+ private Query getQueryByContentSearch(String queryText, boolean onlyLatest)
+ throws ParseException {
+ Query query;
+ Analyzer analyzer = new SimpleAnalyzer();
+ QueryParser parser = new QueryParser(KEY_SEARCHABLE_CONTENT, analyzer);
+ Query searchQuery = parser.parse(queryText);
+ if (onlyLatest) {
+ query = new BooleanQuery();
+ ((BooleanQuery) query).add(searchQuery, BooleanClause.Occur.MUST);
+ ((BooleanQuery) query).add(
+ new TermQuery(new Term(KEY_LATEST, "1")),
+ BooleanClause.Occur.MUST);
+ } else {
+ query = searchQuery;
+ }
+ return query;
+ }
- writer.deleteDocuments(terms);
- }
+ @Override
+ public void deleteElement(String uuid, Version version) throws Exception {
+ // Delete element in db with term search
+ Term[] terms = new Term[2];
+ terms[0] = new Term(KEY_UUID, uuid);
+ terms[1] = new Term(KEY_VERSION, version.toString());
- /**
- * Find all documents matching properties
- *
- * @param properties
- * criteria
- * @return Documents and search handle
- * @throws IOException
- * @throws Exception
- */
- private Hits findHits(Map<String, String> properties, Searcher searcher, int dateOrder)
- throws IOException {
- // Create a query with all parameters
- BooleanQuery query = new BooleanQuery();
- for (Entry<String, String> kv : properties.entrySet()) {
- query.add(new TermQuery(new Term(kv.getKey(), kv.getValue())),
- BooleanClause.Occur.MUST);
- }
+ writer.deleteDocuments(terms);
+ }
- Hits hits = searcher.search(query, getSortDate(dateOrder));
- return hits;
- }
+ /**
+ * Find all documents matching properties
+ *
+ * @param properties
+ * criteria
+ * @return Documents and search handle
+ * @throws IOException
+ * @throws Exception
+ */
+ private Hits findHits(Map<String, String> properties, Searcher searcher,
+ int dateOrder) throws IOException {
+ // Create a query with all parameters
+ BooleanQuery query = new BooleanQuery();
+ for (Entry<String, String> kv : properties.entrySet()) {
+ query.add(new TermQuery(new Term(kv.getKey(), kv.getValue())),
+ BooleanClause.Occur.MUST);
+ }
- /**
- * Convert all Lucene documents to real entities
- *
- * @param hits
- * Document collection
- * @param start
- * Index of first document to return
- * @param count
- * Number of documents to return
- * @return Entities list
- * @throws Exception
- */
- private Set<MetaDataEntity> convertHitsToElements(Hits hits, int start,
- int count) throws Exception {
- Set<MetaDataEntity> elements = new HashSet<MetaDataEntity>();
- if (hits != null) {
- // For documents in range
- for (int i = start; i < hits.length()
- && (i < start + count || count == -1); i++) {
- Document document = hits.doc(i);
- // Convert to element
- elements.add(loadLuceneElement(document));
- }
- }
- return elements;
- }
+ Hits hits = searcher.search(query, getSortDate(dateOrder));
+ return hits;
+ }
- /**
- * Transform a Lucene document into a LoggableElement thanks to a factory
- *
- * @param factory
- * The element factory
- * @param document
- * The document to transform
- * @return Instance of element
- * @throws Exception
- */
- private MetaDataEntity loadLuceneElement(Document document)
- throws Exception {
- MetaDataEntity element = new MetaDataEntity();
- element.setUuid(document.get(KEY_UUID));
- element.setName(document.get(KEY_NAME));
- element.setType(document.get(KEY_TYPE));
- element.setDescription(document.get(KEY_DESCRIPTION));
- element.setVersion(document.get(KEY_VERSION));
- if ("1".equals(document.get(KEY_LATEST))) {
- element.setLatest(true);
- } else {
- element.setLatest(false);
- }
- String creationDate = document.get(KEY_CREATIONDATE);
- if (creationDate != null) {
- long creationDateLong = new Long(creationDate);
- Date date = new Date(creationDateLong);
- element.setCreationDate(date);
- }
- element.setHash(document.get(KEY_HASH));
+ /**
+ * Convert all Lucene documents to real entities
+ *
+ * @param hits
+ * Document collection
+ * @param start
+ * Index of first document to return
+ * @param count
+ * Number of documents to return
+ * @return Entities list
+ * @throws Exception
+ */
+ private Set<MetaDataEntity> convertHitsToElements(Hits hits, int start,
+ int count) throws Exception {
+ Set<MetaDataEntity> elements = new HashSet<MetaDataEntity>();
+ if (hits != null) {
+ // For documents in range
+ for (int i = start; i < hits.length()
+ && (i < start + count || count == -1); i++) {
+ Document document = hits.doc(i);
+ // Convert to element
+ elements.add(loadLuceneElement(document));
+ }
+ }
+ return elements;
+ }
- Map<String, String> descriptors = new HashMap<String, String>();
- Map<String, Content> attachments = new HashMap<String, Content>();
+ /**
+ * Transform a Lucene document into a LoggableElement thanks to a factory
+ *
+ * @param factory
+ * The element factory
+ * @param document
+ * The document to transform
+ * @return Instance of element
+ * @throws Exception
+ */
+ private MetaDataEntity loadLuceneElement(Document document)
+ throws Exception {
+ MetaDataEntity element = new MetaDataEntity();
+ element.setUuid(document.get(KEY_UUID));
+ element.setName(document.get(KEY_NAME));
+ element.setType(document.get(KEY_TYPE));
+ element.setDescription(document.get(KEY_DESCRIPTION));
+ element.setVersion(document.get(KEY_VERSION));
+ if ("1".equals(document.get(KEY_LATEST))) {
+ element.setLatest(true);
+ } else {
+ element.setLatest(false);
+ }
+ String creationDate = document.get(KEY_CREATIONDATE);
+ if (creationDate != null) {
+ long creationDateLong = new Long(creationDate);
+ Date date = new Date(creationDateLong);
+ element.setCreationDate(date);
+ }
+ element.setHash(document.get(KEY_HASH));
- List<Fieldable> fields = document.getFields();
- for (Fieldable fieldable : fields) {
+ Map<String, String> descriptors = new HashMap<String, String>();
+ Map<String, ContentType> attachments = new HashMap<String, ContentType>();
- if (fieldable.name().startsWith(KEY_DESCRIPTOR)) {
- String field = fieldable.name().replace(KEY_DESCRIPTOR + ".",
- "");
- String value = fieldable.stringValue();
- descriptors.put(field, value);
- }
+ List<Fieldable> fields = document.getFields();
+ for (Fieldable fieldable : fields) {
- if (fieldable.name().startsWith(KEY_ATTACHMENT)) {
- String field = fieldable.name().replace(KEY_ATTACHMENT + ".",
- "");
- String value = fieldable.stringValue();
- Content content = new Content();
- content.setType(ContentTypeFactory
- .getContentTypeInstance(value));
- attachments.put(field, content);
- }
- }
+ if (fieldable.name().startsWith(KEY_DESCRIPTOR)) {
+ String field = fieldable.name().replace(KEY_DESCRIPTOR + ".",
+ "");
+ String value = fieldable.stringValue();
+ descriptors.put(field, value);
+ }
- element.setDescriptors(descriptors);
+ if (fieldable.name().startsWith(KEY_ATTACHMENT)) {
+ String field = fieldable.name().replace(KEY_ATTACHMENT + ".",
+ "");
+ String value = fieldable.stringValue();
+ ContentType contentType = ContentTypeFactory
+ .getContentTypeInstance(value);
+ attachments.put(field, contentType);
+ }
+ }
- element.setAttachments(attachments);
+ element.setDescriptors(descriptors);
- element.setParentDataUuid(document.get(KEY_PARENTDATA_UUID));
- element.setParentDataVersion(document.get(KEY_PARENTDATA_VERSION));
+ element.setAttachments(attachments);
- element.setParentVersionUuid(document.get(KEY_PARENTVERSION_UUID));
- element
- .setParentVersionVersion(document
- .get(KEY_PARENTVERSION_VERSION));
+ element.setParentDataUuid(document.get(KEY_PARENTDATA_UUID));
+ element.setParentDataVersion(document.get(KEY_PARENTDATA_VERSION));
- return element;
- }
+ element.setParentVersionUuid(document.get(KEY_PARENTVERSION_UUID));
+ element
+ .setParentVersionVersion(document
+ .get(KEY_PARENTVERSION_VERSION));
- private void addSimpleField(Document document, String name, String value) {
- if (value != null) {
- Field f = new Field(name, value, Field.Store.YES,
- Field.Index.UN_TOKENIZED);
- document.add(f);
- }
- }
+ return element;
+ }
- /**
- * Transform an element to a Lucene document thanks to a factory
- *
- * @param factory
- * @param element
- * @return
- * @throws Exception
- */
- private Document saveLuceneElement(MetaDataEntity element,
- List<Reader> readers) {
- Document document = new Document();
+ private void addSimpleField(Document document, String name, String value) {
+ if (value != null) {
+ Field f = new Field(name, value, Field.Store.YES,
+ Field.Index.UN_TOKENIZED);
+ document.add(f);
+ }
+ }
- addSimpleField(document, KEY_UUID, element.getUuid());
- addSimpleField(document, KEY_NAME, element.getName());
- addSimpleField(document, KEY_TYPE, element.getType());
- addSimpleField(document, KEY_DESCRIPTION, element.getDescription());
- if (element.getVersion() != null) {
- addSimpleField(document, KEY_VERSION, element.getVersion()
- .toString());
- }
- if (element.isLatest()) {
- addSimpleField(document, KEY_LATEST, "1");
- } else {
- addSimpleField(document, KEY_LATEST, "0");
- }
+ /**
+ * Transform an element to a Lucene document thanks to a factory
+ *
+ * @param factory
+ * @param element
+ * @return
+ * @throws Exception
+ */
+ private Document saveLuceneElement(MetaDataEntity element,
+ List<Reader> readers) {
+ Document document = new Document();
- if (element.getCreationDate() != null) {
- addSimpleField(document, KEY_CREATIONDATE, Long.toString(element
- .getCreationDate().getTime()));
- }
- addSimpleField(document, KEY_HASH, element.getHash());
+ addSimpleField(document, KEY_UUID, element.getUuid());
+ addSimpleField(document, KEY_NAME, element.getName());
+ addSimpleField(document, KEY_TYPE, element.getType());
+ addSimpleField(document, KEY_DESCRIPTION, element.getDescription());
+ if (element.getVersion() != null) {
+ addSimpleField(document, KEY_VERSION, element.getVersion()
+ .toString());
+ }
+ if (element.isLatest()) {
+ addSimpleField(document, KEY_LATEST, "1");
+ } else {
+ addSimpleField(document, KEY_LATEST, "0");
+ }
- Map<String, String> descriptors = element.getDescriptors();
- for (Map.Entry<String, String> entry : descriptors.entrySet()) {
- String key = KEY_DESCRIPTOR + "." + entry.getKey();
- String value = entry.getValue();
- addSimpleField(document, key, value);
- }
+ if (element.getCreationDate() != null) {
+ addSimpleField(document, KEY_CREATIONDATE, Long.toString(element
+ .getCreationDate().getTime()));
+ }
+ addSimpleField(document, KEY_HASH, element.getHash());
- Map<String, Content> attachments = element.getAttachments();
- for (Map.Entry<String, Content> entry : attachments.entrySet()) {
- String key = KEY_ATTACHMENT + "." + entry.getKey();
- Content value = entry.getValue();
- if (value != null && value.getType() != null) {
- addSimpleField(document, key, value.getType().getClass()
- .getSimpleName());
- }
- }
+ Map<String, String> descriptors = element.getDescriptors();
+ for (Map.Entry<String, String> entry : descriptors.entrySet()) {
+ String key = KEY_DESCRIPTOR + "." + entry.getKey();
+ String value = entry.getValue();
+ addSimpleField(document, key, value);
+ }
- addSimpleField(document, KEY_PARENTDATA_UUID, element
- .getParentDataUuid());
- addSimpleField(document, KEY_PARENTDATA_VERSION, element
- .getParentDataVersion());
- addSimpleField(document, KEY_PARENTVERSION_UUID, element
- .getParentVersionUuid());
- addSimpleField(document, KEY_PARENTVERSION_VERSION, element
- .getParentVersionVersion());
+ Map<String, ContentType> attachments = element.getAttachments();
+ for (Map.Entry<String, ContentType> entry : attachments.entrySet()) {
+ String key = KEY_ATTACHMENT + "." + entry.getKey();
+ ContentType value = entry.getValue();
+ if (value != null) {
+ addSimpleField(document, key, value.getClass().getSimpleName());
+ }
+ }
- for (Reader reader : readers) {
- document.add(new Field(KEY_SEARCHABLE_CONTENT, reader));
- }
+ addSimpleField(document, KEY_PARENTDATA_UUID, element
+ .getParentDataUuid());
+ addSimpleField(document, KEY_PARENTDATA_VERSION, element
+ .getParentDataVersion());
+ addSimpleField(document, KEY_PARENTVERSION_UUID, element
+ .getParentVersionUuid());
+ addSimpleField(document, KEY_PARENTVERSION_VERSION, element
+ .getParentVersionVersion());
- return document;
- }
+ for (Reader reader : readers) {
+ document.add(new Field(KEY_SEARCHABLE_CONTENT, reader));
+ }
+ return document;
+ }
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -8,7 +8,6 @@
import java.util.Set;
import java.util.UUID;
-import fr.cemagref.simexplorer.is.storage.attachment.Content;
import fr.cemagref.simexplorer.is.storage.attachment.handler.AttachmentHandler;
import fr.cemagref.simexplorer.is.storage.attachment.handler.FileSystemAttachmentHandler;
import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
@@ -107,10 +106,8 @@
InputStream content = attachmentHandler
.retrieveData(element, field);
if (element.getAttachments() != null) {
- Content contentInstance = element.getAttachments().get(field);
- if (contentInstance != null
- && contentInstance.getType() != null) {
- ContentType contentType = contentInstance.getType();
+ ContentType contentType = element.getAttachments().get(field);
+ if (contentType != null) {
Reader reader = contentType.renderToText(content);
readers.add(reader);
}
@@ -181,7 +178,8 @@
public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
int indexStart, int count, int dateOrder) throws Exception {
MetaDataEntity[] result = database.findElementsByContentSearch(query,
- onlyLatest, indexStart, count, dateOrder).toArray(new MetaDataEntity[0]);
+ onlyLatest, indexStart, count, dateOrder).toArray(
+ new MetaDataEntity[0]);
return result;
}
@@ -208,8 +206,8 @@
public void deleteElement(String uuid, Version version) throws Exception {
MetaDataEntity element = getMetadata(uuid, version);
- Map<String, Content> attachments = element.getAttachments();
- for (Map.Entry<String, Content> entry : attachments.entrySet()) {
+ Map<String, ContentType> attachments = element.getAttachments();
+ for (Map.Entry<String, ContentType> entry : attachments.entrySet()) {
attachmentHandler.deleteData(element, entry.getKey());
}
database.deleteElement(element);
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/BaseEntity.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/BaseEntity.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/BaseEntity.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,7 @@
package fr.cemagref.simexplorer.is.storage.entities;
-public abstract class BaseEntity {
+import java.io.Serializable;
+public abstract class BaseEntity implements Serializable {
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Code.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Code.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Code.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,7 +1,11 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class Code extends DataEntity {
+import java.io.Serializable;
+public class Code extends DataEntity implements Serializable {
+
+ private static final long serialVersionUID = 1232989963544650014L;
+
private String language;
private String code;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Component.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Component.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Component.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,9 +1,12 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
+import java.io.Serializable;
import java.util.Set;
-public class Component extends LoggableElement {
+public class Component extends LoggableElement implements Serializable {
+ private static final long serialVersionUID = -1759921918565071510L;
+
Set<Constant> constants;
Set<Structure> structures;
Set<Code> codes;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Constant.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Constant.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Constant.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,7 +1,11 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class Constant extends DataEntity {
+import java.io.Serializable;
+public class Constant extends DataEntity implements Serializable {
+
+ private static final long serialVersionUID = 5473300963328292128L;
+
private String name;
private Class<?> type;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ConstantValue.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ConstantValue.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ConstantValue.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,7 +1,11 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class ConstantValue extends DataEntity {
+import java.io.Serializable;
+public class ConstantValue extends DataEntity implements Serializable {
+
+ private static final long serialVersionUID = -5434140706898012637L;
+
private String value;
private Constant constant;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/DataEntity.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/DataEntity.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/DataEntity.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,7 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
+import java.io.Serializable;
+
import fr.cemagref.simexplorer.is.storage.entities.BaseEntity;
public abstract class DataEntity extends BaseEntity {
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationApplication.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationApplication.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationApplication.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,9 +1,12 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
+import java.io.Serializable;
import java.util.Set;
-public class ExplorationApplication extends LoggableElement {
+public class ExplorationApplication extends LoggableElement implements Serializable {
+ private static final long serialVersionUID = 122049347724394193L;
+
private Set<ExplorationData> explorations;
private Set<Component> components;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationData.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationData.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/ExplorationData.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,9 +1,12 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
+import java.io.Serializable;
import java.util.Set;
-public class ExplorationData extends LoggableElement {
+public class ExplorationData extends LoggableElement implements Serializable {
+ private static final long serialVersionUID = -6439801837608358754L;
+
private Set<ConstantValue> valuesMap;
private Result result;
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Library.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Library.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Library.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,9 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class Library extends LoggableElement {
+import java.io.Serializable;
+public class Library extends LoggableElement implements Serializable {
+
+ private static final long serialVersionUID = -5635619075345573945L;
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Repository.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Repository.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Repository.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,9 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class Repository extends DataEntity {
+import java.io.Serializable;
+public class Repository extends DataEntity implements Serializable {
+
+ private static final long serialVersionUID = 1232065724338066924L;
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Result.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Result.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/data/Result.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,9 @@
package fr.cemagref.simexplorer.is.storage.entities.data;
-public class Result extends DataEntity {
+import java.io.Serializable;
+public class Result extends DataEntity implements Serializable {
+
+ private static final long serialVersionUID = 2111484866027162494L;
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/MetaDataEntity.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/MetaDataEntity.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/MetaDataEntity.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -4,229 +4,229 @@
import java.util.Date;
import java.util.Map;
-import fr.cemagref.simexplorer.is.storage.attachment.Content;
+import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
import fr.cemagref.simexplorer.is.storage.entities.BaseEntity;
public class MetaDataEntity extends BaseEntity implements Serializable {
- private static final long serialVersionUID = -7916932464982315229L;
-
- private String uuid;
- private String name;
- private String type;
- private String description;
- private Version version;
- private Date creationDate;
- private String hash;
- private Map<String, String> descriptors;
- private Map<String, Content> attachments;
- private String parentDataUuid;
- private String parentDataVersion;
- private String parentVersionUuid;
- private String parentVersionVersion;
- private boolean latest;
+ private static final long serialVersionUID = -7916932464982315229L;
- /**
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
+ private String uuid;
+ private String name;
+ private String type;
+ private String description;
+ private Version version;
+ private Date creationDate;
+ private String hash;
+ private Map<String, String> descriptors;
+ private Map<String, ContentType> attachments;
+ private String parentDataUuid;
+ private String parentDataVersion;
+ private String parentVersionUuid;
+ private String parentVersionVersion;
+ private boolean latest;
- /**
- * @param uuid
- * the uuid to set
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
+ /**
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
+ /**
+ * @param uuid
+ * the uuid to set
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
- /**
- * @param name
- * the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * @return the type
- */
- public String getType() {
- return type;
- }
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
- /**
- * @param type
- * the type to set
- */
- public void setType(String type) {
- this.type = type;
- }
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
- /**
- * @param description
- * the description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * @return the version
- */
- public Version getVersion() {
- return version;
- }
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * @param version
- * the version to set
- */
- public void setVersion(String version) {
- this.version = new Version(version);
- }
+ /**
+ * @return the version
+ */
+ public Version getVersion() {
+ return version;
+ }
- /**
- * @return the creationDate
- */
- public Date getCreationDate() {
- return creationDate;
- }
+ /**
+ * @param version
+ * the version to set
+ */
+ public void setVersion(String version) {
+ this.version = new Version(version);
+ }
- /**
- * @param creationDate
- * the creationDate to set
- */
- public void setCreationDate(Date creationDate) {
- this.creationDate = creationDate;
- }
+ /**
+ * @return the creationDate
+ */
+ public Date getCreationDate() {
+ return creationDate;
+ }
- /**
- * @return the hash
- */
- public String getHash() {
- return hash;
- }
+ /**
+ * @param creationDate
+ * the creationDate to set
+ */
+ public void setCreationDate(Date creationDate) {
+ this.creationDate = creationDate;
+ }
- /**
- * @param hash
- * the hash to set
- */
- public void setHash(String hash) {
- this.hash = hash;
- }
+ /**
+ * @return the hash
+ */
+ public String getHash() {
+ return hash;
+ }
- /**
- * @return the descriptors
- */
- public Map<String, String> getDescriptors() {
- return descriptors;
- }
+ /**
+ * @param hash
+ * the hash to set
+ */
+ public void setHash(String hash) {
+ this.hash = hash;
+ }
- /**
- * @param descriptors
- * the descriptors to set
- */
- public void setDescriptors(Map<String, String> descriptors) {
- this.descriptors = descriptors;
- }
+ /**
+ * @return the descriptors
+ */
+ public Map<String, String> getDescriptors() {
+ return descriptors;
+ }
- /**
- * @return the attachments
- */
- public Map<String, Content> getAttachments() {
- return attachments;
- }
+ /**
+ * @param descriptors
+ * the descriptors to set
+ */
+ public void setDescriptors(Map<String, String> descriptors) {
+ this.descriptors = descriptors;
+ }
- /**
- * @param attachments
- * the attachments to set
- */
- public void setAttachments(Map<String, Content> attachments) {
- this.attachments = attachments;
- }
+ /**
+ * @return the attachments
+ */
+ public Map<String, ContentType> getAttachments() {
+ return attachments;
+ }
- /**
- * @return the parentDataUuid
- */
- public String getParentDataUuid() {
- return parentDataUuid;
- }
+ /**
+ * @param attachments
+ * the attachments to set
+ */
+ public void setAttachments(Map<String, ContentType> attachments) {
+ this.attachments = attachments;
+ }
- /**
- * @param parentDataUuid
- * the parentDataUuid to set
- */
- public void setParentDataUuid(String parentDataUuid) {
- this.parentDataUuid = parentDataUuid;
- }
+ /**
+ * @return the parentDataUuid
+ */
+ public String getParentDataUuid() {
+ return parentDataUuid;
+ }
- /**
- * @return the parentDataVersion
- */
- public String getParentDataVersion() {
- return parentDataVersion;
- }
+ /**
+ * @param parentDataUuid
+ * the parentDataUuid to set
+ */
+ public void setParentDataUuid(String parentDataUuid) {
+ this.parentDataUuid = parentDataUuid;
+ }
- /**
- * @param parentDataVersion
- * the parentDataVersion to set
- */
- public void setParentDataVersion(String parentDataVersion) {
- this.parentDataVersion = parentDataVersion;
- }
+ /**
+ * @return the parentDataVersion
+ */
+ public String getParentDataVersion() {
+ return parentDataVersion;
+ }
- /**
- * @return the parentVersionUuid
- */
- public String getParentVersionUuid() {
- return parentVersionUuid;
- }
+ /**
+ * @param parentDataVersion
+ * the parentDataVersion to set
+ */
+ public void setParentDataVersion(String parentDataVersion) {
+ this.parentDataVersion = parentDataVersion;
+ }
- /**
- * @param parentVersionUuid
- * the parentVersionUuid to set
- */
- public void setParentVersionUuid(String parentVersionUuid) {
- this.parentVersionUuid = parentVersionUuid;
- }
+ /**
+ * @return the parentVersionUuid
+ */
+ public String getParentVersionUuid() {
+ return parentVersionUuid;
+ }
- /**
- * @return the parentVersionVersion
- */
- public String getParentVersionVersion() {
- return parentVersionVersion;
- }
+ /**
+ * @param parentVersionUuid
+ * the parentVersionUuid to set
+ */
+ public void setParentVersionUuid(String parentVersionUuid) {
+ this.parentVersionUuid = parentVersionUuid;
+ }
- /**
- * @param parentVersionVersion
- * the parentVersionVersion to set
- */
- public void setParentVersionVersion(String parentVersionVersion) {
- this.parentVersionVersion = parentVersionVersion;
- }
+ /**
+ * @return the parentVersionVersion
+ */
+ public String getParentVersionVersion() {
+ return parentVersionVersion;
+ }
- public boolean isLatest() {
- return latest;
- }
+ /**
+ * @param parentVersionVersion
+ * the parentVersionVersion to set
+ */
+ public void setParentVersionVersion(String parentVersionVersion) {
+ this.parentVersionVersion = parentVersionVersion;
+ }
- public void setLatest(boolean latest) {
- this.latest = latest;
- }
+ public boolean isLatest() {
+ return latest;
+ }
+ public void setLatest(boolean latest) {
+ this.latest = latest;
+ }
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/BaseEntityFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/BaseEntityFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/BaseEntityFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,7 +1,8 @@
package fr.cemagref.simexplorer.is.storage.factories;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.OutputStream;
+import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -23,33 +24,37 @@
import fr.cemagref.simexplorer.is.storage.entities.BaseEntity;
import fr.cemagref.simexplorer.is.storage.entities.data.DataEntity;
-public abstract class BaseEntityFactory<E extends BaseEntity> {
+public abstract class BaseEntityFactory<E extends BaseEntity> implements
+ XmlConstants {
private static DocumentBuilder documentBuilder = null;
private static Map<String, BaseEntityFactory<? extends DataEntity>> factories = new HashMap<String, BaseEntityFactory<? extends DataEntity>>();
- private final static String PACKAGE_DAO = "fr.cemagref.simexplorer.is.storage.factories";
+ /*
+ * Static methods - Retrieve factories, get XML document builder
+ */
- public static synchronized DocumentBuilder getBuilder() throws Exception {
- if (documentBuilder == null) {
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- documentBuilder = factory.newDocumentBuilder();
- return documentBuilder;
- }
- return documentBuilder;
- }
-
- // @SuppressWarnings("unchecked")
+ /**
+ * Retrieve instance of the factory
+ *
+ * @param <T>
+ * Factory spec. class
+ * @param entityClass
+ * Class wanted
+ * @return Factory
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
public static <T extends DataEntity> BaseEntityFactory<T> getFactory(
Class entityClass) throws Exception {
// FIXME Raw types and unchecked casts
BaseEntityFactory<T> result = (BaseEntityFactory<T>) factories
.get(entityClass.getSimpleName());
if (result == null) {
- String elementFactoryClassName = PACKAGE_DAO + "."
- + entityClass.getSimpleName() + "Factory";
+ String elementFactoryClassName = BaseEntityFactory.class
+ .getPackage().getName()
+ + "." + entityClass.getSimpleName() + "Factory";
Class<? extends BaseEntityFactory<T>> factoryClass = (Class<? extends BaseEntityFactory<T>>) Class
.forName(elementFactoryClassName).asSubclass(
@@ -61,6 +66,13 @@
return result;
}
+ /**
+ * Retrieve a factory with class name
+ *
+ * @param entityClassName
+ * @return
+ * @throws Exception
+ */
public static BaseEntityFactory<? extends DataEntity> getFactory(
String entityClassName) throws Exception {
Class<? extends DataEntity> entityClass = Class
@@ -68,39 +80,52 @@
return getFactory(entityClass);
}
- public abstract E createInstance();
-
- public Element getElementByTagName(Element xmlElement, String tagName) {
- Set<Element> elements = getElementsByTagName(xmlElement, tagName);
- if (elements.size() > 0) {
- return elements.iterator().next();
- } else {
- return null;
+ /**
+ * Retrieve an instance of document builder
+ *
+ * @return XML document builder
+ * @throws Exception
+ */
+ public static synchronized DocumentBuilder getXMLBuilder() throws Exception {
+ if (documentBuilder == null) {
+ DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ documentBuilder = factory.newDocumentBuilder();
+ return documentBuilder;
}
+ return documentBuilder;
}
- public Set<Element> getElementsByTagName(Element xmlElement, String tagName) {
- Set<Element> elements = new HashSet<Element>();
+ /*
+ * Entity methods - Instanciate, load and save to XML/streams
+ */
- NodeList nodes = xmlElement.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- if (node instanceof Element
- && tagName.equals(((Element) node).getTagName())) {
- elements.add((Element) node);
- }
- }
- return elements;
+ /**
+ * Instanciate an element
+ *
+ * @return Element
+ */
+ public abstract E createInstance();
+
+ public E loadElement(Element xmlElement) throws Exception {
+ E element = createInstance();
+ return element;
}
- public String getElementXML(E element) throws Exception {
- ByteArrayOutputStream writer = new ByteArrayOutputStream();
- getElementXML(element, writer);
- return writer.toString();
+ public E loadElement(InputStream stream) throws Exception {
+ Document document = getXMLBuilder().parse(stream);
+ Element rootElement = (Element) document.getFirstChild();
+ E element = loadElement(rootElement);
+ return element;
}
- public void getElementXML(E element, OutputStream os) throws Exception {
- org.w3c.dom.Document xmlDocument = getBuilder().newDocument();
+ public abstract void saveElement(Document document, Element xmlElement,
+ E element) throws Exception;
+
+ public InputStream saveElement(E element) throws Exception {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ org.w3c.dom.Document xmlDocument = getXMLBuilder().newDocument();
// Propriétés du DOM
xmlDocument.setXmlVersion("1.0");
xmlDocument.setXmlStandalone(true);
@@ -108,7 +133,7 @@
Element racine = xmlDocument.createElement(element.getClass()
.getSimpleName());
- saveXMLElement(xmlDocument, racine, element);
+ saveElement(xmlDocument, racine, element);
xmlDocument.appendChild(racine);
DOMSource domSource = new DOMSource(xmlDocument);
@@ -116,29 +141,28 @@
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(domSource, result);
- }
- public String getProperty(Element xmlElement, String tagName) {
- Element element = getElementByTagName(xmlElement, tagName);
- if (element != null) {
- return element.getFirstChild().getNodeValue();
- } else {
- return null;
- }
+ InputStream is = new ByteArrayInputStream(os.toByteArray());
+
+ return is;
}
+ /*
+ * Collection methods : Help load/save of inner collections
+ */
+
public <T extends DataEntity> Set<T> loadCollection(String tagSetName,
String tagName, Class<T> clazz, Element xmlElement,
DataEntity parentData) throws Exception {
Set<T> entities = new HashSet<T>();
- Element xmlCollection = getElementByTagName(xmlElement, tagSetName);
+ Element xmlCollection = getXMLElementByTagName(xmlElement, tagSetName);
if (xmlCollection != null) {
BaseEntityFactory<T> elementFactory = getFactory(clazz);
- Set<Element> list = getElementsByTagName(xmlCollection, tagName);
+ Set<Element> list = getXMLElementsByTagName(xmlCollection, tagName);
for (Element element : list) {
- T entity = elementFactory.loadXMLElement(element);
+ T entity = elementFactory.loadElement(element);
entity.setParentData(parentData);
entities.add(entity);
}
@@ -147,11 +171,6 @@
return entities;
}
- public E loadXMLElement(Element xmlElement) throws Exception {
- E element = createInstance();
- return element;
- }
-
public <T extends DataEntity> void saveCollection(Set<T> entities,
String tagSetName, String tagName, Class<T> clazz,
Document document, Element xmlElement) throws Exception {
@@ -163,17 +182,40 @@
// TODO
// if (entity instanceof LoggableElement) {
// elementFactory.saveXMLElementByReference
- elementFactory.saveXMLElement(document, childElement, entity);
+ elementFactory.saveElement(document, childElement, entity);
xmlCollection.appendChild(childElement);
}
xmlElement.appendChild(xmlCollection);
}
}
- public abstract void saveXMLElement(Document document, Element xmlElement,
- E element) throws Exception;
+ public static InputStream serializeElement(String rootNode, Element node)
+ throws Exception {
+ org.w3c.dom.Document xmlDocument = getXMLBuilder().newDocument();
+ // Propriétés du DOM
+ xmlDocument.setXmlVersion("1.0");
+ xmlDocument.setXmlStandalone(true);
+ // Création de l'arborescence du DOM
+ xmlDocument.appendChild(xmlDocument.importNode(node, true));
+ DOMSource domSource = new DOMSource(xmlDocument);
- protected void setProperty(Document document, Element xmlElement,
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(os);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer transformer = tf.newTransformer();
+ transformer.transform(domSource, result);
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(os
+ .toByteArray());
+
+ return inputStream;
+ }
+
+ /*
+ * XML methods : set, get properties
+ */
+
+ protected void setXMLProperty(Document document, Element xmlElement,
String tagName, Object value) {
if (value != null) {
Element xmlProperty = document.createElement(tagName);
@@ -183,4 +225,67 @@
}
}
+ public String getXMLProperty(Element xmlElement, String tagName) {
+ Element element = getXMLElementByTagName(xmlElement, tagName);
+ if (element != null) {
+ return element.getFirstChild().getNodeValue();
+ } else {
+ return null;
+ }
+ }
+
+ /*
+ * XML methods : retrieve nodes
+ */
+
+ /**
+ * @param xmlElement
+ * @param tagName
+ * @return
+ */
+ public Element getXMLElementByTagName(Element xmlElement, String tagName) {
+ Set<Element> elements = getXMLElementsByTagName(xmlElement, tagName);
+ if (elements.size() > 0) {
+ return elements.iterator().next();
+ } else {
+ return null;
+ }
+ }
+
+ public Set<Element> getXMLElementsByTagName(Element xmlElement,
+ String tagName) {
+ Set<Element> elements = new HashSet<Element>();
+
+ NodeList nodes = xmlElement.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ if (node instanceof Element
+ && tagName.equals(((Element) node).getTagName())) {
+ elements.add((Element) node);
+ }
+ }
+ return elements;
+ }
+
+ /*
+ * public void getXMLStream(E element, OutputStream os) throws Exception {
+ * org.w3c.dom.Document xmlDocument = getXMLBuilder().newDocument(); //
+ * Propriétés du DOM xmlDocument.setXmlVersion("1.0");
+ * xmlDocument.setXmlStandalone(true); // Création de l'arborescence du DOM
+ * Element racine = xmlDocument.createElement(element.getClass()
+ * .getSimpleName());
+ *
+ * saveElement(xmlDocument, racine, element);
+ *
+ * xmlDocument.appendChild(racine); DOMSource domSource = new
+ * DOMSource(xmlDocument); StreamResult result = new StreamResult(os);
+ * TransformerFactory tf = TransformerFactory.newInstance(); Transformer
+ * transformer = tf.newTransformer(); transformer.transform(domSource,
+ * result); }
+ *
+ * public String getXMLString(E element) throws Exception {
+ * ByteArrayOutputStream writer = new ByteArrayOutputStream();
+ * getXMLStream(element, writer); return writer.toString(); }
+ */
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/CodeFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/CodeFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/CodeFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -7,27 +7,25 @@
public class CodeFactory<E extends Code> extends BaseEntityFactory<Code> {
- public static final String KEY_LANGUAGE = "language";
- public static final String KEY_CODE = "code";
-
@Override
public Code createInstance() {
return new Code();
}
@Override
- public Code loadXMLElement(Element xmlElement) throws Exception {
- Code code = super.loadXMLElement(xmlElement);
- code.setLanguage(getProperty(xmlElement, KEY_LANGUAGE));
- code.setCode(getProperty(xmlElement, KEY_CODE));
+ public Code loadElement(Element xmlElement) throws Exception {
+ Code code = super.loadElement(xmlElement);
+ code.setLanguage(getXMLProperty(xmlElement, KEY_CODE_LANGUAGE));
+ code.setCode(getXMLProperty(xmlElement, KEY_CODE_CODE));
return code;
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
- Code element) throws Exception {
- setProperty(document, xmlElement, KEY_LANGUAGE, element.getLanguage());
- setProperty(document, xmlElement, KEY_CODE, element.getCode());
+ public void saveElement(Document document, Element xmlElement, Code element)
+ throws Exception {
+ setXMLProperty(document, xmlElement, KEY_CODE_LANGUAGE, element
+ .getLanguage());
+ setXMLProperty(document, xmlElement, KEY_CODE_CODE, element.getCode());
}
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ComponentFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ComponentFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ComponentFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -10,49 +10,48 @@
import fr.cemagref.simexplorer.is.storage.entities.data.Structure;
public class ComponentFactory<E extends Component> extends
- BaseEntityFactory<Component> {
+ LoggableElementFactory<Component> {
- public static final String KEY_CONSTANTS = "constants";
- public static final String KEY_CONSTANT_NODE = "constant";
- public static final String KEY_STRUCTURE = "structures";
- public static final String KEY_STRUCTURE_NODE = "structure";
- public static final String KEY_CODES = "codes";
- public static final String KEY_CODE_NODE = "code";
- public static final String KEY_LIBRARIES = "libraries";
- public static final String KEY_LIBRARY_NODE = "library";
-
@Override
public Component createInstance() {
return new Component();
}
@Override
- public Component loadXMLElement(Element xmlElement) throws Exception {
- Component component = super.loadXMLElement(xmlElement);
+ public Component loadElement(Element xmlElement) throws Exception {
+ Component component = super.loadElement(xmlElement);
- component.setConstants(loadCollection(KEY_CONSTANTS, KEY_CONSTANT_NODE,
- Constant.class, xmlElement, component));
- component.setStructures(loadCollection(KEY_STRUCTURE,
- KEY_STRUCTURE_NODE, Structure.class, xmlElement, component));
- component.setCodes(loadCollection(KEY_CODES, KEY_CODE_NODE, Code.class,
- xmlElement, component));
- component.setLibraries(loadCollection(KEY_LIBRARIES, KEY_LIBRARY_NODE,
- Library.class, xmlElement, component));
+ component.setConstants(loadCollection(KEY_COMPONENT_CONSTANTS,
+ KEY_COMPONENT_CONSTANT_NODE, Constant.class, xmlElement,
+ component));
+ component.setStructures(loadCollection(KEY_COMPONENT_STRUCTURE,
+ KEY_COMPONENT_STRUCTURE_NODE, Structure.class, xmlElement,
+ component));
+ component.setCodes(loadCollection(KEY_COMPONENT_CODES,
+ KEY_COMPONENT_CODE_NODE, Code.class, xmlElement, component));
+ component.setLibraries(loadCollection(KEY_COMPONENT_LIBRARIES,
+ KEY_COMPONENT_LIBRARY_NODE, Library.class, xmlElement,
+ component));
return component;
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public void saveElement(Document document, Element xmlElement,
Component element) throws Exception {
- saveCollection(element.getConstants(), KEY_CONSTANTS,
- KEY_CONSTANT_NODE, Constant.class, document, xmlElement);
- saveCollection(element.getStructures(), KEY_STRUCTURE,
- KEY_STRUCTURE_NODE, Structure.class, document, xmlElement);
- saveCollection(element.getCodes(), KEY_CODES, KEY_CODE_NODE,
- Code.class, document, xmlElement);
- saveCollection(element.getLibraries(), KEY_LIBRARIES, KEY_LIBRARY_NODE,
- Library.class, document, xmlElement);
+
+ super.saveElement(document, xmlElement, element);
+
+ saveCollection(element.getConstants(), KEY_COMPONENT_CONSTANTS,
+ KEY_COMPONENT_CONSTANT_NODE, Constant.class, document,
+ xmlElement);
+ saveCollection(element.getStructures(), KEY_COMPONENT_STRUCTURE,
+ KEY_COMPONENT_STRUCTURE_NODE, Structure.class, document,
+ xmlElement);
+ saveCollection(element.getCodes(), KEY_COMPONENT_CODES,
+ KEY_COMPONENT_CODE_NODE, Code.class, document, xmlElement);
+ saveCollection(element.getLibraries(), KEY_COMPONENT_LIBRARIES,
+ KEY_COMPONENT_LIBRARY_NODE, Library.class, document, xmlElement);
}
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -8,29 +8,27 @@
public class ConstantFactory<E extends Constant> extends
BaseEntityFactory<Constant> {
- public static final String KEY_NAME = "name";
- public static final String KEY_TYPE = "type";
-
@Override
public Constant createInstance() {
return new Constant();
}
@Override
- public Constant loadXMLElement(Element xmlElement) throws Exception {
- Constant constant = super.loadXMLElement(xmlElement);
- constant.setName(getProperty(xmlElement, KEY_NAME));
- String className = getProperty(xmlElement, KEY_TYPE);
+ public Constant loadElement(Element xmlElement) throws Exception {
+ Constant constant = super.loadElement(xmlElement);
+ constant.setName(getXMLProperty(xmlElement, KEY_CONSTANT_NAME));
+ String className = getXMLProperty(xmlElement, KEY_CONSTANT_TYPE);
constant.setType(Class.forName(className));
return constant;
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public void saveElement(Document document, Element xmlElement,
Constant element) throws Exception {
- setProperty(document, xmlElement, KEY_NAME, element.getName());
+ setXMLProperty(document, xmlElement, KEY_CONSTANT_NAME, element
+ .getName());
String className = element.getType().getName();
- setProperty(document, xmlElement, KEY_TYPE, className);
+ setXMLProperty(document, xmlElement, KEY_CONSTANT_TYPE, className);
}
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantValueFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantValueFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ConstantValueFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -9,33 +9,35 @@
public class ConstantValueFactory<E extends ConstantValue> extends
BaseEntityFactory<ConstantValue> {
- public static final String KEY_CONSTANT = "constant";
- public static final String KEY_VALUE = "value";
-
@Override
public ConstantValue createInstance() {
return new ConstantValue();
}
@Override
- public ConstantValue loadXMLElement(Element xmlElement) throws Exception {
- ConstantValue constantValue = super.loadXMLElement(xmlElement);
+ public ConstantValue loadElement(Element xmlElement) throws Exception {
+ ConstantValue constantValue = super.loadElement(xmlElement);
constantValue.setConstant((Constant) getFactory(Constant.class)
- .loadXMLElement(getElementByTagName(xmlElement, KEY_CONSTANT)));
- constantValue.setValue(getProperty(xmlElement, KEY_VALUE));
+ .loadElement(
+ getXMLElementByTagName(xmlElement,
+ KEY_CONSTANTVALUE_CONSTANT)));
+ constantValue.setValue(getXMLProperty(xmlElement,
+ KEY_CONSTANTVALUE_VALUE));
return constantValue;
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public void saveElement(Document document, Element xmlElement,
ConstantValue element) throws Exception {
- Element xmlConstant = document.createElement(KEY_CONSTANT);
- getFactory(Constant.class).saveXMLElement(document, xmlConstant,
+ Element xmlConstant = document
+ .createElement(KEY_CONSTANTVALUE_CONSTANT);
+ getFactory(Constant.class).saveElement(document, xmlConstant,
element.getConstant());
xmlElement.appendChild(xmlConstant);
- setProperty(document, xmlElement, KEY_VALUE, element.getValue());
+ setXMLProperty(document, xmlElement, KEY_CONSTANTVALUE_VALUE, element
+ .getValue());
}
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationApplicationFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationApplicationFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationApplicationFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -10,37 +10,33 @@
public class ExplorationApplicationFactory extends
LoggableElementFactory<ExplorationApplication> {
- public static final String KEY_DATA = "data";
- public static final String KEY_DATA_NODE = "explorationdata";
- public static final String KEY_COMPONENTS = "components";
- public static final String KEY_COMPONENT_NODE = "component";
-
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public ExplorationApplication createInstance() {
+ return new ExplorationApplication();
+ }
+
+ @Override
+ public void saveElement(Document document, Element xmlElement,
ExplorationApplication element) throws Exception {
- super.saveXMLElement(document, xmlElement, element);
- saveCollection(element.getExplorations(), KEY_DATA, KEY_DATA_NODE,
+ super.saveElement(document, xmlElement, element);
+ saveCollection(element.getExplorations(), KEY_EXPLORATIONAPPLICATION_DATA, KEY_EXPLORATIONAPPLICATION_DATA_NODE,
ExplorationData.class, document, xmlElement);
- saveCollection(element.getComponents(), KEY_COMPONENTS,
- KEY_COMPONENT_NODE, Component.class, document, xmlElement);
+ saveCollection(element.getComponents(), KEY_EXPLORATIONAPPLICATION_COMPONENTS,
+ KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE, Component.class, document, xmlElement);
}
@Override
- public ExplorationApplication loadXMLElement(Element xmlElement)
+ public ExplorationApplication loadElement(Element xmlElement)
throws Exception {
ExplorationApplication explorationApplication = super
- .loadXMLElement(xmlElement);
- explorationApplication.setExplorations(loadCollection(KEY_DATA,
- KEY_DATA_NODE, ExplorationData.class, xmlElement,
+ .loadElement(xmlElement);
+ explorationApplication.setExplorations(loadCollection(KEY_EXPLORATIONAPPLICATION_DATA,
+ KEY_EXPLORATIONAPPLICATION_DATA_NODE, ExplorationData.class, xmlElement,
explorationApplication));
- explorationApplication.setComponents(loadCollection(KEY_COMPONENTS,
- KEY_COMPONENT_NODE, Component.class, xmlElement,
+ explorationApplication.setComponents(loadCollection(KEY_EXPLORATIONAPPLICATION_COMPONENTS,
+ KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE, Component.class, xmlElement,
explorationApplication));
return explorationApplication;
}
- public ExplorationApplication createInstance() {
- return new ExplorationApplication();
- }
-
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationDataFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationDataFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ExplorationDataFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -10,38 +10,38 @@
public class ExplorationDataFactory extends
LoggableElementFactory<ExplorationData> {
- public static final String KEY_RESULT = "result";
- public static final String KEY_VALUES = "values";
- public static final String KEY_VALUE = "value";
+ @Override
+ public ExplorationData createInstance() {
+ return new ExplorationData();
+ }
@Override
- public ExplorationData loadXMLElement(Element xmlElement) throws Exception {
- ExplorationData explorationData = super.loadXMLElement(xmlElement);
+ public ExplorationData loadElement(Element xmlElement) throws Exception {
+ ExplorationData explorationData = super.loadElement(xmlElement);
explorationData.setResult((Result) getFactory(Result.class)
- .loadXMLElement(getElementByTagName(xmlElement, KEY_RESULT)));
- explorationData.setValuesMap(loadCollection(KEY_VALUES, KEY_VALUE,
- ConstantValue.class, xmlElement, explorationData));
+ .loadElement(
+ getXMLElementByTagName(xmlElement,
+ KEY_EXPLORATIONDATA_RESULT)));
+ explorationData.setValuesMap(loadCollection(KEY_EXPLORATIONDATA_VALUES,
+ KEY_EXPLORATIONDATA_VALUE, ConstantValue.class, xmlElement,
+ explorationData));
return explorationData;
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public void saveElement(Document document, Element xmlElement,
ExplorationData element) throws Exception {
- super.saveXMLElement(document, xmlElement, element);
+ super.saveElement(document, xmlElement, element);
- Element xmlResult = document.createElement(KEY_RESULT);
- getFactory(Result.class).saveXMLElement(document, xmlResult,
+ Element xmlResult = document.createElement(KEY_EXPLORATIONDATA_RESULT);
+ getFactory(Result.class).saveElement(document, xmlResult,
element.getResult());
xmlElement.appendChild(xmlResult);
- saveCollection(element.getValuesMap(), KEY_VALUES, KEY_VALUE,
- ConstantValue.class, document, xmlElement);
+ saveCollection(element.getValuesMap(), KEY_EXPLORATIONDATA_VALUES,
+ KEY_EXPLORATIONDATA_VALUE, ConstantValue.class, document,
+ xmlElement);
}
- @Override
- public ExplorationData createInstance() {
- return new ExplorationData();
- }
-
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/LoggableElementFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/LoggableElementFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/LoggableElementFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -2,25 +2,35 @@
import org.w3c.dom.Element;
-import fr.cemagref.simexplorer.is.storage.database.DatabaseConstants;
import fr.cemagref.simexplorer.is.storage.entities.data.LoggableElement;
+import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
public abstract class LoggableElementFactory<E extends LoggableElement> extends
- BaseEntityFactory<E> implements DatabaseConstants {
+ BaseEntityFactory<E> {
- private static final String KEY_DESCRIPTION = "description";
+ @Override
+ public E loadElement(Element xmlElement) throws Exception {
+ E element = super.loadElement(xmlElement);
- @Override
- public E loadXMLElement(Element xmlElement) throws Exception {
- E element = super.loadXMLElement(xmlElement);
- // FIXME Load metadata
+ MetaDataEntityFactory elementFactory = (MetaDataEntityFactory) BaseEntityFactory
+ .getFactory(MetaDataEntity.class);
+
+ Element mdeElement = getXMLElementByTagName(xmlElement, KEY_METADATA);
+ MetaDataEntity metaData = elementFactory.loadElement(mdeElement);
+ element.setMetaData(metaData);
+
return element;
}
@Override
- public void saveXMLElement(org.w3c.dom.Document document,
- Element xmlElement, E element) throws Exception {
- // FIXME save metadata
+ public void saveElement(org.w3c.dom.Document document, Element xmlElement,
+ E element) throws Exception {
+ MetaDataEntityFactory elementFactory = (MetaDataEntityFactory) BaseEntityFactory
+ .getFactory(MetaDataEntity.class);
+
+ Element mdeElement = document.createElement(KEY_METADATA);
+ elementFactory.saveElement(document, mdeElement, element.getMetaData());
+ xmlElement.appendChild(mdeElement);
}
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/MetaDataEntityFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/MetaDataEntityFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/MetaDataEntityFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,5 +1,6 @@
package fr.cemagref.simexplorer.is.storage.factories;
+import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -8,12 +9,12 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import fr.cemagref.simexplorer.is.storage.attachment.Content;
+import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
import fr.cemagref.simexplorer.is.storage.attachment.type.ContentTypeFactory;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
public class MetaDataEntityFactory<E extends MetaDataEntity> extends
- BaseEntityFactory<MetaDataEntity> implements XmlConstants {
+ BaseEntityFactory<MetaDataEntity> {
@Override
public MetaDataEntity createInstance() {
@@ -26,17 +27,16 @@
* @see fr.cemagref.simexplorer.is.storage.factories.BaseEntityFactory#loadXMLElement(org.w3c.dom.Element)
*/
@Override
- public MetaDataEntity loadXMLElement(Element xmlElement) throws Exception {
- MetaDataEntity entity = super.loadXMLElement(xmlElement);
- entity.setUuid(getProperty(xmlElement, KEY_METADATA_UUID));
- entity.setName(getProperty(xmlElement, KEY_METADATA_NAME));
- entity.setType(getProperty(xmlElement, KEY_METADATA_TYPE));
- entity
- .setDescription(getProperty(xmlElement,
- KEY_METADATA_DESCRIPTION));
- entity.setVersion(getProperty(xmlElement, KEY_METADATA_VERSION));
+ public MetaDataEntity loadElement(Element xmlElement) throws Exception {
+ MetaDataEntity entity = super.loadElement(xmlElement);
+ entity.setUuid(getXMLProperty(xmlElement, KEY_METADATA_UUID));
+ entity.setName(getXMLProperty(xmlElement, KEY_METADATA_NAME));
+ entity.setType(getXMLProperty(xmlElement, KEY_METADATA_TYPE));
+ entity.setDescription(getXMLProperty(xmlElement,
+ KEY_METADATA_DESCRIPTION));
+ entity.setVersion(getXMLProperty(xmlElement, KEY_METADATA_VERSION));
- String latestVersion = getProperty(xmlElement,
+ String latestVersion = getXMLProperty(xmlElement,
KEY_METADATA_LATESTVERSION);
if (latestVersion != null && "1".equals(latestVersion)) {
entity.setLatest(true);
@@ -44,57 +44,56 @@
entity.setLatest(false);
}
- String creationDate = getProperty(xmlElement, KEY_METADATA_CREATIONDATE);
+ String creationDate = getXMLProperty(xmlElement,
+ KEY_METADATA_CREATIONDATE);
if (creationDate != null) {
long creationDateLong = new Long(creationDate);
Date date = new Date(creationDateLong);
entity.setCreationDate(date);
}
- entity.setHash(getProperty(xmlElement, KEY_METADATA_HASH));
- entity.setParentDataUuid(getProperty(xmlElement,
+ entity.setHash(getXMLProperty(xmlElement, KEY_METADATA_HASH));
+ entity.setParentDataUuid(getXMLProperty(xmlElement,
KEY_METADATA_PARENTDATA_UUID));
- entity.setParentDataVersion(getProperty(xmlElement,
+ entity.setParentDataVersion(getXMLProperty(xmlElement,
KEY_METADATA_PARENTDATA_VERSION));
- entity.setParentVersionUuid(getProperty(xmlElement,
+ entity.setParentVersionUuid(getXMLProperty(xmlElement,
KEY_METADATA_PARENTVERSION_UUID));
- entity.setParentVersionVersion(getProperty(xmlElement,
+ entity.setParentVersionVersion(getXMLProperty(xmlElement,
KEY_METADATA_PARENTVERSION_VERSION));
Map<String, String> descriptors = new HashMap<String, String>();
- Element descriptorsElement = getElementByTagName(xmlElement,
+ Element descriptorsElement = getXMLElementByTagName(xmlElement,
KEY_METADATA_DESCRIPTORS);
if (descriptorsElement != null) {
- Set<Element> descriptorElements = getElementsByTagName(
+ Set<Element> descriptorElements = getXMLElementsByTagName(
descriptorsElement, KEY_METADATA_DESCRIPTOR);
for (Element descriptorElement : descriptorElements) {
- String name = getProperty(descriptorElement,
- KEY_DESCRIPTOR_NAME);
- String value = getProperty(descriptorElement,
- KEY_DESCRIPTOR_VALUE);
+ String name = getXMLProperty(descriptorElement,
+ KEY_METADATA_DESCRIPTOR_NAME);
+ String value = getXMLProperty(descriptorElement,
+ KEY_METADATA_DESCRIPTOR_VALUE);
descriptors.put(name, value);
}
}
entity.setDescriptors(descriptors);
- Map<String, Content> attachments = new HashMap<String, Content>();
+ Map<String, ContentType> attachments = new HashMap<String, ContentType>();
- Element attachmentsElement = getElementByTagName(xmlElement,
+ Element attachmentsElement = getXMLElementByTagName(xmlElement,
KEY_METADATA_ATTACHMENTS);
if (attachmentsElement != null) {
- Set<Element> attachmentElements = getElementsByTagName(
+ Set<Element> attachmentElements = getXMLElementsByTagName(
attachmentsElement, KEY_METADATA_ATTACHMENT);
for (Element attachmentElement : attachmentElements) {
- String name = getProperty(attachmentElement,
- KEY_ATTACHMENT_NAME);
- String type = getProperty(attachmentElement,
- KEY_ATTACHMENT_TYPE);
- Content content = new Content();
- content
- .setType(ContentTypeFactory
- .getContentTypeInstance(type));
- attachments.put(name, content);
+ String name = getXMLProperty(attachmentElement,
+ KEY_METADATA_ATTACHMENT_NAME);
+ String type = getXMLProperty(attachmentElement,
+ KEY_METADATA_ATTACHMENT_TYPE);
+ ContentType contentType = ContentTypeFactory
+ .getContentTypeInstance(type);
+ attachments.put(name, contentType);
}
}
@@ -104,10 +103,92 @@
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public void saveElement(Document document, Element xmlElement,
MetaDataEntity element) throws Exception {
- // TODO Auto-generated method stub
+ setXMLProperty(document, xmlElement, KEY_METADATA_UUID, element
+ .getUuid());
+ setXMLProperty(document, xmlElement, KEY_METADATA_NAME, element
+ .getName());
+ setXMLProperty(document, xmlElement, KEY_METADATA_TYPE, element
+ .getType());
+ setXMLProperty(document, xmlElement, KEY_METADATA_DESCRIPTION, element
+ .getDescription());
+ setXMLProperty(document, xmlElement, KEY_METADATA_VERSION, element
+ .getVersion().toString());
+
+ if (element.isLatest()) {
+ setXMLProperty(document, xmlElement, KEY_METADATA_LATESTVERSION,
+ "1");
+ } else {
+ setXMLProperty(document, xmlElement, KEY_METADATA_LATESTVERSION,
+ "0");
+ }
+
+ if (element.getCreationDate() != null) {
+ setXMLProperty(document, xmlElement, KEY_METADATA_CREATIONDATE,
+ element.getCreationDate().getTime());
+ }
+
+ setXMLProperty(document, xmlElement, KEY_METADATA_HASH, element
+ .getHash());
+ setXMLProperty(document, xmlElement, KEY_METADATA_PARENTDATA_UUID,
+ element.getParentDataUuid());
+ setXMLProperty(document, xmlElement, KEY_METADATA_PARENTDATA_VERSION,
+ element.getParentDataVersion());
+ setXMLProperty(document, xmlElement, KEY_METADATA_PARENTVERSION_UUID,
+ element.getParentVersionUuid());
+ setXMLProperty(document, xmlElement,
+ KEY_METADATA_PARENTVERSION_VERSION, element
+ .getParentVersionVersion());
+
+ Map<String, String> descriptors = element.getDescriptors();
+
+ Element descriptorsElement = document
+ .createElement(KEY_METADATA_DESCRIPTORS);
+
+ for (Map.Entry<String, String> kv : descriptors.entrySet()) {
+ Element descriptorElement = document
+ .createElement(KEY_METADATA_DESCRIPTOR);
+ setXMLProperty(document, descriptorElement,
+ KEY_METADATA_DESCRIPTOR_NAME, kv.getKey());
+ setXMLProperty(document, descriptorElement,
+ KEY_METADATA_DESCRIPTOR_VALUE, kv.getValue());
+ descriptorsElement.appendChild(descriptorElement);
+ }
+
+ xmlElement.appendChild(descriptorsElement);
+
+ Map<String, ContentType> attachments = element.getAttachments();
+
+ if (attachments != null) {
+
+ Element attachmentsElement = document
+ .createElement(KEY_METADATA_ATTACHMENTS);
+
+ for (Map.Entry<String, ContentType> kv : attachments.entrySet()) {
+ Element attachmentElement = document
+ .createElement(KEY_METADATA_ATTACHMENT);
+ setXMLProperty(document, attachmentElement,
+ KEY_METADATA_ATTACHMENT_NAME, kv.getKey());
+ setXMLProperty(document, attachmentElement,
+ KEY_METADATA_ATTACHMENT_TYPE, kv.getValue().getClass()
+ .getSimpleName());
+ attachmentsElement.appendChild(attachmentElement);
+ }
+ xmlElement.appendChild(attachmentsElement);
+
+ }
+
}
+ public MetaDataEntity loadElementFromParentXML(InputStream xmlStream)
+ throws Exception {
+ Document document = getXMLBuilder().parse(xmlStream);
+ Element rootElement = (Element) document.getFirstChild();
+ Element mdeElement = getXMLElementByTagName(rootElement, KEY_METADATA);
+ MetaDataEntity mde = loadElement(mdeElement);
+ return mde;
+ }
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/RepositoryFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/RepositoryFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/RepositoryFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -14,7 +14,12 @@
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public Repository loadElement(Element xmlElement) throws Exception {
+ return super.loadElement(xmlElement);
+ }
+
+ @Override
+ public void saveElement(Document document, Element xmlElement,
Repository element) throws Exception {
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ResultFactory.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ResultFactory.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/ResultFactory.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -13,7 +13,12 @@
}
@Override
- public void saveXMLElement(Document document, Element xmlElement,
+ public Result loadElement(Element xmlElement) throws Exception {
+ return super.loadElement(xmlElement);
+ }
+
+ @Override
+ public void saveElement(Document document, Element xmlElement,
Result element) throws Exception {
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/XmlConstants.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/XmlConstants.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/XmlConstants.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -2,14 +2,44 @@
public interface XmlConstants {
+ public static final String KEY_CODE_LANGUAGE = "language";
+ public static final String KEY_CODE_CODE = "code";
+
+ public static final String KEY_COMPONENT_CONSTANTS = "constants";
+ public static final String KEY_COMPONENT_CONSTANT_NODE = "constant";
+ public static final String KEY_COMPONENT_STRUCTURE = "structures";
+ public static final String KEY_COMPONENT_STRUCTURE_NODE = "structure";
+ public static final String KEY_COMPONENT_CODES = "codes";
+ public static final String KEY_COMPONENT_CODE_NODE = "code";
+ public static final String KEY_COMPONENT_LIBRARIES = "libraries";
+ public static final String KEY_COMPONENT_LIBRARY_NODE = "library";
+
+ public static final String KEY_CONSTANT_NAME = "name";
+ public static final String KEY_CONSTANT_TYPE = "type";
+
+ public static final String KEY_CONSTANTVALUE_CONSTANT = "constant";
+ public static final String KEY_CONSTANTVALUE_VALUE = "value";
+
+ public static final String KEY_EXPLORATIONAPPLICATION_DATA = "data";
+ public static final String KEY_EXPLORATIONAPPLICATION_DATA_NODE = "explorationdata";
+ public static final String KEY_EXPLORATIONAPPLICATION_COMPONENTS = "components";
+ public static final String KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE = "component";
+
+ public static final String KEY_EXPLORATIONDATA_RESULT = "result";
+ public static final String KEY_EXPLORATIONDATA_VALUES = "values";
+ public static final String KEY_EXPLORATIONDATA_VALUE = "value";
+
+ public static final String KEY_RESULT_FILE = "file";
+
+ public static final String KEY_METADATA = "metadata";
+
public static final String KEY_METADATA_UUID = "uuid";
public static final String KEY_METADATA_VERSION = "version";
public static final String KEY_METADATA_LATESTVERSION = "latestversion";
public static final String KEY_METADATA_NAME = "name";
public static final String KEY_METADATA_TYPE = "type";
- public static final String KEY_METADATA_TYPE_VALUE_EA = "LuceneDatabaseTestCase"; // FIXME
- // EA
+ public static final String KEY_METADATA_TYPE_VALUE_EA = "ExplorationApplication";
public static final String KEY_METADATA_DESCRIPTION = "description";
public static final String KEY_METADATA_CREATIONDATE = "creationdate";
@@ -23,16 +53,18 @@
public static final String KEY_METADATA_ATTACHMENTS = "attachments";
public static final String KEY_METADATA_ATTACHMENT = "attachment";
- public static final String KEY_DESCRIPTOR_NAME = "name";
- public static final String KEY_DESCRIPTOR_VALUE = "value";
+ public static final String KEY_METADATA_DESCRIPTOR_NAME = "name";
+ public static final String KEY_METADATA_DESCRIPTOR_VALUE = "value";
- public static final String KEY_ATTACHMENT_NAME = "name";
- public static final String KEY_ATTACHMENT_TYPE = "type";
+ public static final String KEY_METADATA_ATTACHMENT_NAME = "name";
+ public static final String KEY_METADATA_ATTACHMENT_TYPE = "type";
+ /*
public static final String KEY_COMPONENT = "C";
public static final String KEY_ED = "ED";
public static final String KEY_RESULT = "R";
public static final String KEY_FILE = "FILE";
+ */
public static final String FILE_XML = "data.xml";
public static final String FILE_DATA_PREFIX = "attachment";
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -5,7 +5,9 @@
import javax.ejb.Remote;
import com.healthmarketscience.rmiio.RemoteInputStream;
+import com.healthmarketscience.rmiio.RemoteOutputStream;
+import fr.cemagref.simexplorer.is.storage.entities.data.ExplorationApplication;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
@Remote
@@ -16,7 +18,7 @@
void close() throws Exception;
void commit() throws Exception;
-
+
MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
throws Exception;
@@ -28,6 +30,8 @@
MetaDataEntity getMetadata(String uuid, String version) throws Exception;
+ void exportElement(RemoteOutputStream xmlOutputStream, String uuid, String version) throws Exception;
+
int findFullTextCount(String query, boolean onlyLatest) throws Exception;
MetaDataEntity[] findFullText(String query, boolean onlyLatest,
@@ -37,5 +41,7 @@
MetaDataEntity[] findApplications(boolean onlyLatest, int start, int count, int dateOrder)
throws Exception;
+
+ ExplorationApplication getExplorationApplication(String uuid, String version) throws Exception;
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -1,6 +1,9 @@
package fr.cemagref.simexplorer.is.storage.service;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.InputStream;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -18,15 +21,16 @@
import com.healthmarketscience.rmiio.RemoteInputStream;
import com.healthmarketscience.rmiio.RemoteInputStreamClient;
+import com.healthmarketscience.rmiio.RemoteOutputStream;
+import com.healthmarketscience.rmiio.RemoteOutputStreamClient;
import fr.cemagref.simexplorer.is.storage.engine.StorageEngine;
+import fr.cemagref.simexplorer.is.storage.entities.data.ExplorationApplication;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
import fr.cemagref.simexplorer.is.storage.entities.metadata.Version;
import fr.cemagref.simexplorer.is.storage.factories.BaseEntityFactory;
import fr.cemagref.simexplorer.is.storage.factories.MetaDataEntityFactory;
import fr.cemagref.simexplorer.is.storage.factories.XmlConstants;
-import fr.cemagref.simexplorer.is.storage.xml.MetaDataParser;
-import fr.cemagref.simexplorer.is.storage.xml.Parser;
@Stateless(name = "StorageService")
@Remote(StorageService.class)
@@ -86,7 +90,8 @@
public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
int indexStart, int count, int dateOrder) throws Exception {
- return storageEngine.findFullText(query, onlyLatest, indexStart, count, dateOrder);
+ return storageEngine.findFullText(query, onlyLatest, indexStart, count,
+ dateOrder);
}
public int findFullTextCount(String query, boolean onlyLatest)
@@ -105,6 +110,15 @@
onlyLatest, start, count, dateOrder);
}
+ public ExplorationApplication getExplorationApplication(String uuid,
+ String version) throws Exception {
+ MetaDataEntity mde = getMetadata(uuid, version);
+ ExplorationApplication ea = (ExplorationApplication) BaseEntityFactory
+ .getFactory(ExplorationApplication.class).loadElement(
+ storageEngine.retrieveData(mde, KEY_XML));
+ return ea;
+ }
+
private MetaDataEntity saveElement(InputStream zipStream) throws Exception {
String xmlFile = null;
Map<String, String> attachments = new HashMap<String, String>();
@@ -131,7 +145,7 @@
return saveElement(xmlFile, attachments);
}
- private MetaDataEntity saveElement(InputStream xmlFile,
+ public MetaDataEntity saveElement(InputStream xmlFile,
Map<String, InputStream> attachments) throws Exception {
// Store temporary data
String idxml = storageEngine.storeTempData(xmlFile);
@@ -143,6 +157,25 @@
return saveElement(idxml, idsattachment);
}
+ public void exportElement(RemoteOutputStream xmlOutputStream, String uuid, String version)
+ throws Exception {
+ MetaDataEntity mde = getMetadata(uuid, version);
+ InputStream xmlStream = storageEngine.retrieveData(mde, KEY_XML);
+ OutputStream os = RemoteOutputStreamClient.wrap(xmlOutputStream);
+
+ // Buffer copy stream to stream
+ BufferedInputStream bin = new BufferedInputStream(xmlStream);
+ BufferedOutputStream bout = new BufferedOutputStream(os);
+ while (true) {
+ int datum = bin.read();
+ if (datum == -1)
+ break;
+ bout.write(datum);
+ }
+ bout.flush();
+
+ }
+
/**
* Real implementation of saveElement
*
@@ -153,17 +186,22 @@
*/
private MetaDataEntity saveElement(String idxml,
Map<String, String> idsattachment) throws Exception {
- // Load xml metadata
- MetaDataEntity metaData = MetaDataParser.parse(storageEngine
- .retrieveTempData(idxml));
+ // Load metadata xml
+ MetaDataEntityFactory mdeFactory = (MetaDataEntityFactory) BaseEntityFactory
+ .getFactory(MetaDataEntity.class);
+ MetaDataEntity metaData = mdeFactory
+ .loadElementFromParentXML(storageEngine.retrieveTempData(idxml));
- String uuid = metaData.getUuid();
+ if (metaData.getType() != null
+ && KEY_METADATA_TYPE_VALUE_EA.equals(metaData.getType())) {
- // If element is an EA, save inner Components and Data
+ /*
+ ExplorationApplication ea = (ExplorationApplication) BaseEntityFactory
+ .getFactory(ExplorationApplication.class).loadElement(
+ storageEngine.retrieveTempData(idxml));
+ */
- if (metaData.getType() != null
- && metaData.getType().equals(KEY_METADATA_TYPE_VALUE_EA)) {
-
+ // If element is an EA, save inner Components and Data
List<String> components = new ArrayList<String>();
List<String[]> explorationDatas = new ArrayList<String[]>();
@@ -191,14 +229,33 @@
saveElement(idComponent, new HashMap<String, String>());
}
- // Don't save any file for an EA
- idsattachment = new HashMap<String, String>();
+ }
+ // Process version rules
+ processVersionRules(metaData);
+
+ // Prepare saving
+ Map<String, InputStream> attachments = new HashMap<String, InputStream>();
+
+ attachments.put(KEY_XML, storageEngine.retrieveTempData(idxml));
+ if (metaData.getType() != null
+ && !KEY_METADATA_TYPE_VALUE_EA.equals(metaData.getType())) {
+ for (Map.Entry<String, String> entry : idsattachment.entrySet()) {
+ attachments.put(entry.getKey(), storageEngine
+ .retrieveTempData(entry.getValue()));
+ }
}
+ storageEngine.saveElement(metaData, attachments);
+ storageEngine.commit();
+ return metaData;
+ }
+
+ private void processVersionRules(MetaDataEntity metaData) throws Exception {
+
// Check existing version in storage
- MetaDataEntity previousVersion = storageEngine.getMetadata(uuid,
- metaData.getVersion());
+ MetaDataEntity previousVersion = storageEngine.getMetadata(metaData
+ .getUuid(), metaData.getVersion());
/*
* MetaDataEntity parentData = storageEngine.getElementVersion(metaData
* .getParentData().getUuid(), metaData.getParentData() .getVersion());
@@ -210,55 +267,51 @@
// Version rules
if (previousVersion != null) {
- /*
- * metaData.setParentVersion(storageEngine.getElementVersion(uuid,
- * previousVersion.getVersion()));
- */
metaData.setVersion(previousVersion.getVersion().incVersion(0)
.toString());
}
- // Prepare saving
- Map<String, InputStream> attachments = new HashMap<String, InputStream>();
-
- attachments.put(KEY_XML, storageEngine.retrieveTempData(idxml));
- for (Map.Entry<String, String> entry : idsattachment.entrySet()) {
- attachments.put(entry.getKey(), storageEngine
- .retrieveTempData(entry.getValue()));
- }
- storageEngine.saveElement(metaData, attachments);
- storageEngine.commit();
-
- return metaData;
}
private void extractChildren(String idxml,
Map<String, String> idsattachment, List<String> components,
List<String[]> explorationDatas) throws Exception {
- MetaDataEntityFactory<MetaDataEntity> elementFactory = (MetaDataEntityFactory<MetaDataEntity>) BaseEntityFactory
- .getFactory("MetaDataEntity");
- Document document = BaseEntityFactory.getBuilder().parse(
+ MetaDataEntityFactory<MetaDataEntity> elementFactory = (MetaDataEntityFactory) BaseEntityFactory
+ .getFactory(MetaDataEntity.class);
+
+ Document document = BaseEntityFactory.getXMLBuilder().parse(
storageEngine.retrieveTempData(idxml));
Element rootElement = (Element) document.getFirstChild();
// Components
- Set<Element> componentElements = elementFactory.getElementsByTagName(
- rootElement, KEY_COMPONENT);
+ Element componentsElement = elementFactory.getXMLElementByTagName(
+ rootElement, KEY_EXPLORATIONAPPLICATION_COMPONENTS);
+ Set<Element> componentElements = elementFactory
+ .getXMLElementsByTagName(componentsElement,
+ KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE);
for (Element element : componentElements) {
- components.add(storageEngine.storeTempData(Parser
- .serializeElement(element)));
+ components
+ .add(storageEngine.storeTempData(elementFactory
+ .serializeElement(
+ KEY_EXPLORATIONAPPLICATION_COMPONENT_NODE,
+ element)));
}
+ Element applicationDatasElement = elementFactory
+ .getXMLElementByTagName(rootElement,
+ KEY_EXPLORATIONAPPLICATION_DATA);
Set<Element> applicationDataElements = elementFactory
- .getElementsByTagName(rootElement, KEY_ED);
+ .getXMLElementsByTagName(applicationDatasElement,
+ KEY_EXPLORATIONAPPLICATION_DATA_NODE);
+
for (Element elementAD : applicationDataElements) {
+ Element element = elementFactory.getXMLElementByTagName(elementAD,
+ KEY_EXPLORATIONDATA_RESULT);
+ String result = elementFactory.getXMLProperty(element,
+ KEY_RESULT_FILE);
- Element element = elementFactory.getElementByTagName(elementAD,
- KEY_RESULT);
- String result = elementFactory.getProperty(element, KEY_FILE);
-
String[] explorationDataArray = null;
if (result != null) {
explorationDataArray = new String[2];
@@ -266,16 +319,13 @@
} else {
explorationDataArray = new String[1];
}
- explorationDataArray[0] = storageEngine.storeTempData(Parser
- .serializeElement(elementAD));
+ explorationDataArray[0] = storageEngine
+ .storeTempData(elementFactory.serializeElement(
+ KEY_EXPLORATIONAPPLICATION_DATA_NODE, elementAD));
+ explorationDatas.add(explorationDataArray);
}
}
- /*
- * public MetaDataEntity loadElement(String idxml, Map<String, String>
- * idsattachment) throws Exception { }
- */
-
}
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/ElementGenerator.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/ElementGenerator.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/ElementGenerator.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -33,15 +33,14 @@
metaData.setType(element.getClass().getSimpleName());
metaData.setDescription("test");
metaData.setVersion(Integer.toString(r.nextInt(100)));
- metaData.setCreationDate(new Date(r.nextLong()));
+ metaData.setCreationDate(new Date());
metaData.setHash(UUID.randomUUID().toString());
metaData.setLatest(true);
Map<String, String> descriptors = new HashMap<String, String>();
int i = 5 + r.nextInt(10);
for (int j = 0; j < i; j++) {
- descriptors.put(UUID.randomUUID().toString(), UUID.randomUUID()
- .toString());
+ descriptors.put(Integer.toString(j), UUID.randomUUID().toString());
}
metaData.setDescriptors(descriptors);
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/MetaDataGenerator.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/MetaDataGenerator.java 2008-01-03 11:12:58 UTC (rev 93)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/MetaDataGenerator.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -6,7 +6,7 @@
import java.util.Random;
import java.util.UUID;
-import fr.cemagref.simexplorer.is.storage.attachment.Content;
+import fr.cemagref.simexplorer.is.storage.attachment.type.ContentType;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
import fr.cemagref.simexplorer.is.storage.entities.metadata.Version;
@@ -66,7 +66,7 @@
descriptors.put("descriptor" + j, UUID.randomUUID().toString());
}
me.setDescriptors(descriptors);
- me.setAttachments(new HashMap<String, Content>());
+ me.setAttachments(new HashMap<String, ContentType>());
me.setParentDataUuid(null);
me.setParentDataVersion(null);
me.setParentVersionUuid(null);
Added: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceMassInsert.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceMassInsert.java (rev 0)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceMassInsert.java 2008-01-04 15:59:36 UTC (rev 94)
@@ -0,0 +1,59 @@
+package fr.cemagref.simexplorer.is.storage.test.service;
+
+import java.io.InputStream;
+import java.util.Date;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+import fr.cemagref.simexplorer.is.storage.entities.data.ExplorationApplication;
+import fr.cemagref.simexplorer.is.storage.factories.BaseEntityFactory;
+import fr.cemagref.simexplorer.is.storage.service.StorageServiceImpl;
+import fr.cemagref.simexplorer.is.storage.test.ElementGenerator;
+
+public class StorageServiceMassInsert extends TestCase {
+
+ private StorageServiceImpl storageService;
+ private ElementGenerator elementGenerator;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ elementGenerator = new ElementGenerator();
+
+ storageService = new StorageServiceImpl();
+ storageService.open();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ storageService.close();
+ }
+
+ public void testMassInsert() throws Exception {
+ int c = 289747;
+
+ Date begin = new Date();
+
+ ExplorationApplication ea = null;
+ for (int i = 0; i < c; i++) {
+ ea = elementGenerator.generateRandomEA();
+ InputStream xmlStream = BaseEntityFactory.getFactory(
+ ExplorationApplication.class).saveElement(ea);
+
+ storageService.saveElement(xmlStream,
+ new HashMap<String, InputStream>());
+
+ if (i > 0 && i % 100 == 0) {
+ Date end = new Date();
+ long time = end.getTime() - begin.getTime();
+ System.out.println("Insert " + i + " : Time taken : " + time
+ + "ms");
+ double timePerElement = time / i;
+ System.out.println("Insert " + i
+ + " : Time taken per element : " + timePerElement
+ + "ms");
+ }
+
+ }
+ }
+
+}
1
0
r93 - in trunk/simexplorer-is-web: . .settings src/java/fr/cemagref/simexplorer/is/ui/web src/java/fr/cemagref/simexplorer/is/ui/web/beans src/java/fr/cemagref/simexplorer/is/ui/web/components src/java/fr/cemagref/simexplorer/is/ui/web/components/beans src/java/fr/cemagref/simexplorer/is/ui/web/grid src/java/fr/cemagref/simexplorer/is/ui/web/pages src/ressources/fr/cemagref/simexplorer/is/ui/web/components src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css src/ressource
by glandais@users.labs.libre-entreprise.org 03 Jan '08
by glandais@users.labs.libre-entreprise.org 03 Jan '08
03 Jan '08
Author: glandais
Date: 2008-01-03 11:12:58 +0000 (Thu, 03 Jan 2008)
New Revision: 93
Added:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/RenderableNode.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/TreeNode.java
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/file.gif
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-closed.gif
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-open.gif
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/TreeGrid.js
trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/jbossall-client.jar
Removed:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/
trunk/simexplorer-is-web/src/webcontent/css/
trunk/simexplorer-is-web/src/webcontent/images/lutin.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/
Modified:
trunk/simexplorer-is-web/.classpath
trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
trunk/simexplorer-is-web/pom.xml
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
Log:
TreeGrid component
Date sort
Layout as component
Modified: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/.classpath 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="target/gen/java"/>
<classpathentry kind="src" path="src/ressources"/>
- <classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
+ <classpathentry combineaccessrules="false" kind="src" path="/simexplorer-is-storage"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2008-01-03 11:12:58 UTC (rev 93)
@@ -2,9 +2,9 @@
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="simexplorer-is-web">
<wb-resource deploy-path="/" source-path="/src/webcontent"/>
- <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/gen/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/ressources"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/gen/java"/>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/simexplorer-is-storage/simexplorer-is-storage">
<dependency-type>uses</dependency-type>
</dependent-module>
Modified: trunk/simexplorer-is-web/pom.xml
===================================================================
--- trunk/simexplorer-is-web/pom.xml 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/pom.xml 2008-01-03 11:12:58 UTC (rev 93)
@@ -139,7 +139,7 @@
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-upload</artifactId>
- <version>5.0.6</version>
+ <version>5.0.7</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Deleted: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,33 +0,0 @@
-package fr.cemagref.simexplorer.is.ui.web.beans;
-
-public class TreeNode {
-
- private long id;
- private String libelle;
- private TreeNode[] enfants;
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public String getLibelle() {
- return libelle;
- }
-
- public void setLibelle(String libelle) {
- this.libelle = libelle;
- }
-
- public TreeNode[] getEnfants() {
- return enfants;
- }
-
- public void setEnfants(TreeNode[] enfants) {
- this.enfants = enfants;
- }
-
-}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -21,6 +21,7 @@
import java.util.Locale;
import org.apache.tapestry.Asset;
+import org.apache.tapestry.annotations.IncludeStylesheet;
import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.annotations.Path;
@@ -38,6 +39,7 @@
*
* Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $
*/
+ at IncludeStylesheet("css/Layout.css")
public class Layout {
/* linked state "UserList" */
@@ -50,22 +52,10 @@
@Parameter("defaulttitle")
private String title;
- @Inject
- @Path("context:css/general.css")
- private Asset _stylesheetGeneral;
-
- @Inject
- @Path("context:css/layout.css")
- private Asset _stylesheetLayout;
-
- @Inject
- @Path("context:css/dftree.css")
- private Asset stylesheetTree;
-
public Layout() {
super();
}
-
+
/**
* @return the title
*/
@@ -80,20 +70,6 @@
title = "";
}
- /**
- * @return the _stylesheetGeneral
- */
- public Asset getStylesheetGeneral() {
- return _stylesheetGeneral;
- }
-
- /**
- * @return the _stylesheetLayout
- */
- public Asset getStylesheetLayout() {
- return _stylesheetLayout;
- }
-
@Inject
@Service("PersistentLocale")
private PersistentLocale persistentLocale;
@@ -115,9 +91,5 @@
public boolean getAdministrator() {
return true;
}
-
- public Asset getStylesheetTree() {
- return stylesheetTree;
- }
-
+
}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/TreeGrid.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,147 @@
+package fr.cemagref.simexplorer.is.ui.web.components;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.annotations.IncludeJavaScriptLibrary;
+import org.apache.tapestry.annotations.IncludeStylesheet;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.SupportsInformalParameters;
+import org.apache.tapestry.services.Heartbeat;
+
+import fr.cemagref.simexplorer.is.ui.web.components.beans.RenderableNode;
+import fr.cemagref.simexplorer.is.ui.web.components.beans.TreeNode;
+
+ at SupportsInformalParameters
+ at IncludeStylesheet("css/TreeGrid.css")
+ at IncludeJavaScriptLibrary("js/TreeGrid.js")
+public class TreeGrid {
+
+ private List<RenderableNode> list;
+
+ /**
+ * Iterator to iterate over all tree elements
+ */
+ private Iterator<RenderableNode> iterator;
+
+ /**
+ * Defines the source Tree to walk over.
+ */
+ @Parameter(required = true)
+ private List<TreeNode> source;
+
+ @Parameter(required = true)
+ private List<String> columnHeaders;
+
+ /**
+ * Current node of the tree
+ */
+ private RenderableNode currentNode;
+
+ @Environmental
+ private Heartbeat heartbeat;
+
+ private void buildSourceList(TreeNode treeNode, int depth, String dotId) {
+ list.add(new RenderableNode(treeNode, depth, dotId));
+ TreeNode[] children = (TreeNode[]) treeNode.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (!list.contains(children[i])) {
+ buildSourceList(children[i], depth + 1, dotId + "-" + i);
+ }
+ }
+ }
+
+ boolean setupRender(MarkupWriter writer) {
+ if (source == null)
+ return false;
+
+ list = new ArrayList<RenderableNode>();
+ int i = 0;
+ for (TreeNode node : source) {
+ buildSourceList(node, 0, Integer.toString(i));
+ i++;
+ }
+ iterator = list.iterator();
+
+ // begin table
+ writer.element("table", "width", "100%");
+
+ // header row
+ writer.element("tr");
+ if (columnHeaders != null) {
+ int col = 0;
+ for (String column : columnHeaders) {
+ /*
+ if (col == 0) {
+ writer.element("th", "width", "20%");
+ } else {
+ writer.element("th");
+ }
+ */
+ writer.element("th");
+ writer.writeRaw(column);
+ writer.end();
+ col++;
+ }
+ }
+ writer.end();
+
+ return (iterator.hasNext());
+ }
+
+ /** Begins a new heartbeat. */
+ void beginRender() {
+ currentNode = iterator.next();
+ heartbeat.begin();
+ }
+
+ void beforeRenderBody(MarkupWriter writer) {
+ String[] columns = currentNode.getInnerNode().getColumns();
+
+ writer.element("tr", "id", currentNode.getDotId(), "class", "a");
+
+ writer.element("td");
+ writer.element("div", "class", "tier" + currentNode.getDepth());
+ if (currentNode.getInnerNode().getType() == TreeNode.TYPE_FOLDER) {
+ writer.element("a", "href", "#", "class", "folderopen", "onclick",
+ "toggleRows(this)");
+ } else {
+ writer.element("a", "href", "#", "class", "doc");
+ }
+ // a
+ writer.end();
+
+ if (columns.length > 0) {
+ writer.writeRaw(columns[0]);
+ }
+ // div
+ writer.end();
+ // td
+ writer.end();
+
+ for (int i = 1; i < columns.length; i++) {
+ writer.element("td");
+ writer.writeRaw(columns[i]);
+ // td
+ writer.end();
+ }
+
+ // tr
+ writer.end();
+ }
+
+ /** Ends the current heartbeat. */
+ boolean afterRender() {
+ heartbeat.end();
+ return (!iterator.hasNext());
+ }
+
+ void cleanupRender(MarkupWriter writer) {
+ // end table
+ writer.end();
+ }
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/RenderableNode.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/RenderableNode.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/RenderableNode.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,28 @@
+package fr.cemagref.simexplorer.is.ui.web.components.beans;
+
+public class RenderableNode {
+
+ private TreeNode innerNode;
+ private String dotId;
+ private int depth;
+
+ public RenderableNode(TreeNode innerNode, int depth, String dotId) {
+ super();
+ this.innerNode = innerNode;
+ this.dotId = dotId;
+ this.depth = depth;
+ }
+
+ public TreeNode getInnerNode() {
+ return innerNode;
+ }
+
+ public String getDotId() {
+ return dotId;
+ }
+
+ public int getDepth() {
+ return depth;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/TreeNode.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/TreeNode.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/beans/TreeNode.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,45 @@
+package fr.cemagref.simexplorer.is.ui.web.components.beans;
+
+public class TreeNode {
+
+ public static final int TYPE_DOCUMENT = 0;
+ public static final int TYPE_FOLDER = 1;
+
+ private TreeNode[] children;
+ private String[] columns;
+ private long identifier;
+ private int type;
+
+ public TreeNode[] getChildren() {
+ return children;
+ }
+
+ public void setChildren(TreeNode[] children) {
+ this.children = children;
+ }
+
+ public String[] getColumns() {
+ return columns;
+ }
+
+ public void setColumns(String[] columns) {
+ this.columns = columns;
+ }
+
+ public long getIdentifier() {
+ return identifier;
+ }
+
+ public void setIdentifier(long identifier) {
+ this.identifier = identifier;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,10 +1,7 @@
package fr.cemagref.simexplorer.is.ui.web.grid;
-import java.util.List;
-
import javax.naming.NamingException;
-import org.apache.tapestry.beaneditor.BeanModel;
import org.apache.tapestry.beaneditor.PropertyModel;
import org.apache.tapestry.grid.GridDataSource;
@@ -62,12 +59,25 @@
boolean ascending) {
try {
this.indexStart = startIndex;
+
+ int dateOrder = 0;
+ if (sortModel != null
+ && "creationDate".equals(sortModel.getPropertyName())) {
+ if (ascending) {
+ dateOrder = 1;
+ } else {
+ dateOrder = -1;
+ }
+ }
+
if (query.isEmpty()) {
- entities = StorageServiceFactory.getService().findApplications(
- false, startIndex, 1 + endIndex - startIndex);
+ entities = StorageServiceFactory.getService()
+ .findApplications(false, startIndex,
+ 1 + endIndex - startIndex, dateOrder);
} else {
entities = StorageServiceFactory.getService().findFullText(
- query, false, startIndex, 1 + endIndex - startIndex);
+ query, false, startIndex, 1 + endIndex - startIndex,
+ dateOrder);
}
} catch (Exception e) {
// TODO Auto-generated catch block
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,10 +1,13 @@
package fr.cemagref.simexplorer.is.ui.web.pages;
-import org.apache.tapestry.annotations.Component;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
import org.apache.tapestry.annotations.Persist;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
-import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+import fr.cemagref.simexplorer.is.ui.web.components.beans.TreeNode;
import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
public class ApplicationDetail extends AbstractApplicationDetail {
@@ -29,4 +32,51 @@
return explorationApplication.getDescription();
}
+ private Random r = new Random();
+
+ private TreeNode generateNode(TreeNode parent, int level) {
+ TreeNode node = new TreeNode();
+ node.setIdentifier(r.nextLong());
+
+ if (level > 1 && (r.nextBoolean() || level == 4)) {
+ node.setType(TreeNode.TYPE_DOCUMENT);
+ node.setChildren(new TreeNode[0]);
+ } else {
+ int c = 3 + r.nextInt(5);
+ TreeNode[] children = new TreeNode[c];
+ for (int i = 0; i < children.length; i++) {
+ children[i] = generateNode(node, level + 1);
+ }
+ node.setType(TreeNode.TYPE_FOLDER);
+ node.setChildren(children);
+ }
+
+ String[] columns = new String[3];
+ for (int i = 0; i < columns.length; i++) {
+ columns[i] = Long.toHexString(r.nextLong());
+ if (r.nextBoolean()) {
+ columns[i] = "<b>" + columns[i] + "</b>";
+ }
+ }
+ node.setColumns(columns);
+
+ return node;
+ }
+
+ public List<TreeNode> getNodes() {
+ List<TreeNode> nodes = new ArrayList<TreeNode>();
+ nodes.add(generateNode(null, 0));
+ nodes.add(generateNode(null, 0));
+ nodes.add(generateNode(null, 0));
+ return nodes;
+ }
+
+ public List<String> getHeaders() {
+ List<String> result = new ArrayList<String>();
+ result.add("");
+ result.add("");
+ result.add("");
+ return result;
+ }
+
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2008-01-03 11:12:58 UTC (rev 93)
@@ -33,7 +33,9 @@
model = beanModelSource.create(MetaData.class, true, resources);
List<String> properties = model.getPropertyNames();
for (String property : properties) {
- model.get(property).sortable(false);
+ if (!"creationDate".equals(property)) {
+ model.get(property).sortable(false);
+ }
}
}
Modified: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,10 +1,6 @@
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>${title}</title>
- <link rel="stylesheet" type="text/css" href="${prop:stylesheetGeneral}" />
- <link rel="stylesheet" type="text/css" href="${prop:stylesheetLayout}" />
- <link rel="stylesheet" type="text/css" href="${prop:stylesheetTree}" />
-
</head>
<body>
@@ -52,11 +48,11 @@
</div>
<div id="Content">
- <!-- main template here -->
+ <!-- main template here -->
<t:body/>
</div>
<div id="FooterAdd">${message:abstractpage-copyright}
- </div>
+ </div>
</body>
</html>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/Layout.css 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,542 @@
+/***************************** Mise en forme g?n?rale ************************/
+h1.Title {
+ margin: 0px 0px 0px 0px;
+ padding: 0px;
+ font-size: 28px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+}
+
+h1.tab {
+ margin: 0px 0px 10px 0px;
+ padding: 5px;
+ font-size: 20px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ text-align: center;
+ border: 1px solid black;
+ -moz-border-radius: 10px;
+}
+
+h2.Title {
+ margin: 0px 0px 10px 0px;
+ padding: 0px;
+ font-weight: bold;
+ color: #09c;
+ font-size: 18px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+hr.Ligne {
+ margin-bottom: 10px;
+}
+
+.Container {
+ width: 100%;
+}
+
+.Clear {
+ clear: both;
+}
+
+.NoWrap {
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ white-space: nowrap;
+}
+
+.MonoSpace {
+ font-size: 14px;
+ font-family: monospace;
+}
+
+acronym.Acronym {
+ border: none;
+}
+
+acronym.Acronym:hover {
+ cursor: help;
+}
+
+/******************************** Les liens *****************************/
+a.Link {
+ color: black;
+ text-decoration: none;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ vertical-align: middle;
+}
+
+a.Link:link {
+ color: black;
+}
+
+a.Link:visited {
+ color: black;
+}
+
+a.Link:hover {
+ background-color: transparent;
+ text-decoration: underline;
+}
+
+/******************************* Infos bulles ********************************/
+a.InfoBulle {
+ position: relative;
+ z-index: 24;
+ text-decoration: none;
+ cursor: help;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+a.InfoBulle:hover {
+ z-index: 25;
+}
+
+a.InfoBulle:hover span.Info {
+ text-decoration: underline;
+}
+
+a.InfoBulle span.Bulle {
+ display: none;
+ border: 1px solid black;
+}
+
+a.InfoBulle:hover span.Bulle {
+ text-decoration: none;
+ display: block;
+ position: absolute;
+ top: 2em;
+ left: 2em;
+ width: 15em;
+ background-color: #deecf1;
+ text-align: center;
+}
+
+/******************************* Block ****************************************/
+.Block {
+ position: relative;
+ z-index: 24;
+ text-decoration: none;
+ font-size: small;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.BlockHide {
+ display: none;
+}
+
+.BlockShow {
+ border: 1px solid black;
+ display: block;
+ position: absolute;
+ z-index: 25;
+ top: 2em;
+ left: 2em;
+ padding: 5px;
+ background-color: #deecf1;
+}
+
+/******************************* Menu ****************************************/
+h1.tab:hover {
+ background-color: #deecf1;
+ cursor: pointer;
+}
+
+menu.Menu {
+
+}
+
+menu.Menu>li {
+ margin: 0px;
+ padding: 0px;
+ list-style-type: disc;
+ color: black;
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+menu.Menu>li>a.Link {
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Hide {
+ display: none;
+}
+
+.Show {
+
+}
+
+/******************************* Pr?sentation des donn?es ******************/
+fieldset.Fieldset {
+ margin: -10px 0px 20px 0px;
+ padding: 10px;
+ font-weight: bold;
+ border-color: #09c;
+ -moz-border-radius: 10px;
+}
+
+fieldset.Fieldset>legend,fieldset.Fieldset>legend>a {
+ font-size: 18px;
+ font-weight: normal;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ text-decoration: none;
+}
+
+fieldset.Fieldset>legend>a:link {
+
+}
+
+fieldset.Fieldset>legend>a:hover {
+ text-decoration: underline;
+}
+
+fieldset.Fieldset>legend>a.Actif {
+ text-decoration: underline;
+}
+
+.FloatLeft,.FloatRight {
+ float: left;
+ width: 50%;
+ margin: 0;
+ padding: 0;
+}
+
+.FloatRightRight {
+ float: left;
+ width: 50%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+.Group {
+ margin-bottom: 10px;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.SmallText {
+ color: black;
+ font-size: 10px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.MediumText {
+ color: black;
+ font-size: 12px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Normal {
+ color: black;
+ font-weight: normal;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Text {
+ color: black;
+ font-weight: bold;
+ font-size: 14px;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+.Center {
+ text-align: center;
+}
+
+.Large {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 100%;
+}
+
+.Medium {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 90%;
+}
+
+.Small {
+ border-collapse: collapse;
+ font-size: 14px;
+ width: 60%;
+}
+
+.Green {
+ color: green;
+}
+
+.Red {
+ color: red;
+}
+
+/**************************** Tableau *************************************/
+table.Small td,table.Large td,table.Medium td {
+ border: 1px solid;
+ border-color: #09c;
+ padding: 5px;
+}
+
+tr.Click:hover,td.Click:hover {
+ background-color: #deecf1;
+ cursor: pointer;
+}
+
+table.Small td.Angle,table.Medium td.Angle,table.Large td.Angle {
+ border-left: none;
+ border-top: none;
+}
+
+td.Colomun {
+ background-color: #eee;
+ font-weight: bold;
+ text-align: left;
+}
+
+tr.First { /* Ent?te du tableau */
+ font-weight: bold;
+ background-color: #eee;
+ text-align: center;
+}
+
+td.Actions {
+ text-align: center;
+}
+
+td.Number {
+ text-align: right;
+}
+
+td.LargeCase {
+ height: 75px;
+ vertical-align: top;
+}
+
+td.LargeCaseSelect {
+ height: 75px;
+ vertical-align: top;
+ background-color: #deecf1;
+}
+
+/******************************** Formulaires ********************************/
+.FormActions {
+ display: block;
+ text-align: right;
+ margin-bottom: 10px;
+}
+
+.Form {
+ display: inline;
+ text-align: left;
+}
+
+.FormActions input[type="password"],.FormActions input[type="radio"],.FormActions input[type="button"],.FormActions input[type="text"],.FormActions input[type="submit"],.FormActions textarea,.FormActions select,.Form input[type="password"],.Form input[type="radio"],.Form input[type="button"],.Form input[type="text"],.Form input[type="submit"],.Form textarea,.Form select,.Form button,.FormActions button,button
+ {
+ border: 1px solid black;
+ padding: 2px;
+ margin: 0px;
+ font: 12px verdana, arial, helvetica, sans-serif;
+ display: inline;
+}
+
+.FormActions textarea.MonoSpace,.Form textarea.MonoSpace {
+ font-family: monospace;
+}
+
+.FormLeft {
+ float: left;
+ width: 40%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+.FormRight {
+ float: left;
+ width: 60%;
+ margin: 0;
+ padding: 0;
+}
+
+.FormLeft div.Normal,.FormRight div.Normal {
+ margin-bottom: 10px;
+}
+
+.FormLeft div.Text,.FormRight div.Text {
+ margin: 0px;
+ margin-bottom: 8px;
+ margin-right: 5px;
+ padding: 3px;
+}
+
+.Float {
+ float: left;
+ margin: 0;
+ margin-right: 5px;
+ padding: 0;
+}
+
+/* Layout */
+body { /* background-image: url("../images/lutin.gif"); */
+ background-repeat: no-repeat;
+ background-position: right top;
+ margin: 0px;
+ padding: 0px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #333;
+ background-color: white;
+}
+
+#beforeheader {
+ display: table-row;
+ background-color: red;
+ margin: 0px 0px 15px 0px;
+ width: 100%;
+}
+
+#Title {
+ display: table-cell;
+ font-size: 28px;
+ line-height: 28px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #09c;
+ margin: 0px 0px 15px 0px;
+ padding: 5px 0px 0px 5px;
+}
+
+#Google-AdSense {
+ display: table-cell;
+ width: 100%;
+ height: 60px;
+ text-align: right;
+ vertical-align: middle;
+}
+
+#Header {
+ font-size: 12px;
+ margin: 10px 0px 10px 0px;
+ padding: 3px 5px 3px 5px;
+ border-style: solid;
+ border-color: black;
+ border-width: 1px 0px;
+ line-height: 11px;
+ background-color: #eee;
+ height: 14px;
+}
+
+.Left {
+ float: left;
+ width: 40%;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+}
+
+.Right {
+ float: left;
+ width: 60%;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+#Content {
+ margin: 0px 50px 50px 300px;
+ padding: 0px;
+ min-height: 455px;
+}
+
+#Menu {
+ position: absolute;
+ top: 80px;
+ left: 10px;
+ padding: 10px 10px 0px 10px;
+ background-color: #eee;
+ border: 1px solid black;
+ -moz-border-radius: 10px;
+ line-height: 17px;
+ width: 250px;
+ z-index: 1;
+}
+
+#Footer {
+ font-size: 12px;
+ position: relative;
+ text-align: right;
+ width: 100%;
+ margin: 10px 0px 0px 0px;
+ padding: 3px 0px 3px 0px;
+ border-style: solid;
+ border-color: black;
+ border-width: 1px 0px;
+ line-height: 11px;
+ background-color: #eee;
+ height: 14px;
+}
+
+#FooterAdd {
+ font-size: 12px;
+ text-align: center;
+}
+
+#AddressBar {
+ font-size: x-small;
+ margin-bottom: 7px;
+}
+
+#AddressBar a.Link {
+ font-size: small;
+}
+
+.Message {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #deecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+.Error {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #ffecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+.FieldError {
+ font-size: 14px;
+ font-weight: bold;
+ font-family: verdana, arial, helvetica, sans-serif;
+ border: 1px solid black;
+ background-color: #ffecf1;
+ padding: 5px;
+ margin-bottom: 5px;
+}
+
+#FieldErrorExplication {
+ font-weight: normal;
+}
+
+img.Img {
+ border-width: 0px;
+ border-style: none;
+ vertical-align: middle;
+ padding: 0px;
+ margin: 0px;
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/css/TreeGrid.css 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,67 @@
+.folderclose {
+ background: transparent url(../images/folder-closed.gif)
+ no-repeat scroll 0%;
+ float: left;
+ height: 14px;
+ padding-right: 3px;
+ width: 26px;
+}
+
+.folderopen {
+ background: transparent url(../images/folder-open.gif)
+ no-repeat scroll 0%;
+ float: left;
+ height: 14px;
+ padding-right: 3px;
+ width: 26px;
+}
+
+.doc {
+ background: transparent url(../images/file.gif) no-repeat
+ scroll 0%;
+ float: left;
+ height: 14px;
+ margin-left: 20px;
+ padding-right: 3px;
+ width: 12px;
+}
+
+.tier0 {
+ margin-left: 0pt;
+}
+
+.tier1 {
+ margin-left: 1.5em;
+}
+
+.tier2 {
+ margin-left: 3em;
+}
+
+.tier3 {
+ margin-left: 4.5em;
+}
+
+.tier4 {
+ margin-left: 6em;
+}
+
+.tier5 {
+ margin-left: 7.5em;
+}
+
+.tier6 {
+ margin-left: 9em;
+}
+
+.tier7 {
+ margin-left: 10.5em;
+}
+
+.tier8 {
+ margin-left: 12em;
+}
+
+.tier9 {
+ margin-left: 13.5em;
+}
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/file.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/file.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-closed.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-closed.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-open.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/images/folder-open.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/TreeGrid.js
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/TreeGrid.js (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/js/TreeGrid.js 2008-01-03 11:12:58 UTC (rev 93)
@@ -0,0 +1,52 @@
+function toggleRows(elm) {
+ var rows = document.getElementsByTagName("TR");
+ elm.className = "folderclose";
+ var newDisplay = "none";
+ var thisID = elm.parentNode.parentNode.parentNode.id + "-";
+ // Are we expanding or contracting? If the first child is hidden, we expand
+ for (var i = 0; i < rows.length; i++) {
+ var r = rows[i];
+ if (matchStart(r.id, thisID, true)) {
+ if (r.style.display == "none") {
+ if (document.all) newDisplay = "block"; //IE4+ specific code
+ else newDisplay = "table-row"; //Netscape and Mozilla
+ elm.className = "folderopen";
+ }
+ break;
+ }
+ }
+
+ // When expanding, only expand one level. Collapse all desendants.
+ var matchDirectChildrenOnly = (newDisplay != "none");
+
+ for (var j = 0; j < rows.length; j++) {
+ var s = rows[j];
+ if (matchStart(s.id, thisID, matchDirectChildrenOnly)) {
+ s.style.display = newDisplay;
+ var cell = s.getElementsByTagName("TD")[0];
+ var tier = cell.getElementsByTagName("DIV")[0];
+ var folder = tier.getElementsByTagName("A")[0];
+ if (folder.getAttribute("onclick") != null) {
+ folder.className = "folderclose";
+ }
+ }
+ }
+}
+
+function matchStart(target, pattern, matchDirectChildrenOnly) {
+ var pos = target.indexOf(pattern);
+ if (pos != 0) return false;
+ if (!matchDirectChildrenOnly) return true;
+ if (target.slice(pos + pattern.length, target.length).indexOf("-") >= 0) return false;
+ return true;
+}
+
+function collapseAllRows() {
+ var rows = document.getElementsByTagName("TR");
+ for (var j = 0; j < rows.length; j++) {
+ var r = rows[j];
+ if (r.id.indexOf("-") >= 0) {
+ r.style.display = "none";
+ }
+ }
+}
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-03 11:10:57 UTC (rev 92)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2008-01-03 11:12:58 UTC (rev 93)
@@ -1,6 +1,7 @@
<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="message:windowtitle">
- <strong>${message}</strong>
+ <t:TreeGrid source="nodes" columnHeaders="headers">
+ </t:TreeGrid>
</t:layout>
Added: trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/jbossall-client.jar
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/WEB-INF/lib/jbossall-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/simexplorer-is-web/src/webcontent/images/lutin.gif
===================================================================
(Binary files differ)
1
0