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
r92 - in trunk/simexplorer-si-storage: . src/java/fr/cemagref/simexplorer/is/storage/database src/java/fr/cemagref/simexplorer/is/storage/database/lucene src/java/fr/cemagref/simexplorer/is/storage/engine src/java/fr/cemagref/simexplorer/is/storage/service src/test/fr/cemagref/simexplorer/is/storage/test
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:10:57 +0000 (Thu, 03 Jan 2008)
New Revision: 92
Modified:
trunk/simexplorer-si-storage/.classpath
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.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/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/LuceneDatabaseLoadTestCase.java
Log:
Date sort
Modified: trunk/simexplorer-si-storage/.classpath
===================================================================
--- trunk/simexplorer-si-storage/.classpath 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/.classpath 2008-01-03 11:10:57 UTC (rev 92)
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/test"/>
- <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss v4.2"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v4.2"/>
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -109,7 +109,7 @@
*/
public Set<MetaDataEntity> findElementsByProperties(
Map<String, String> properties) throws Exception {
- return findElementsByProperties(properties, 0, -1);
+ return findElementsByProperties(properties, 0, -1, 0);
}
/**
@@ -126,7 +126,7 @@
* @throws Exception
*/
public abstract Set<MetaDataEntity> findElementsByProperties(
- Map<String, String> properties, int start, int count)
+ Map<String, String> properties, int start, int count, int dateOrder)
throws Exception;
/**
@@ -151,9 +151,9 @@
}
public Set<MetaDataEntity> findElementsByType(String type,
- boolean onlyLatest, int start, int count) throws Exception {
+ boolean onlyLatest, int start, int count, int dateOrder) throws Exception {
return findElementsByProperties(getPropertiesByType(type, onlyLatest),
- start, count);
+ start, count, dateOrder);
}
public int findElementsByTypeCount(String type, boolean onlyLatest)
@@ -176,7 +176,7 @@
* @throws Exception
*/
public abstract Set<MetaDataEntity> findElementsByContentSearch(
- String queryText, boolean onlyLatest, int start, int count)
+ String queryText, boolean onlyLatest, int start, int count, int dateOrder)
throws Exception;
/**
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -69,5 +69,20 @@
* Field name for searchable content
*/
public static final String KEY_SEARCHABLE_CONTENT = "simexplorer.searchablecontent";
-
+ /**
+ *
+ */
+ public static final String SORT_DATE_FIELD = KEY_CREATIONDATE;
+ /**
+ *
+ */
+ public static final int SORT_DATE_NONE = 0;
+ /**
+ *
+ */
+ public static final int SORT_DATE_ASCENDING = 1;
+ /**
+ *
+ */
+ public static final int SORT_DATE_DESCENDING = -1;
}
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 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -29,6 +29,7 @@
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
@@ -129,8 +130,8 @@
Analyzer analyzer = new SimpleAnalyzer();
// FIXME index location
- File indexDir = new File("./index/");
- //File indexDir = new File("/home/landais/lucene/index.big");
+ //File indexDir = new File("./index/");
+ File indexDir = new File("/home/glandais/lucene/index.big");
// Base directory index
directory = FSDirectory.getDirectory(indexDir, lockFactory);
@@ -231,7 +232,7 @@
properties.put(KEY_VERSION, version.toString());
// Search elements
- Hits hits = findHits(properties, searcher);
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
return hits;
}
@@ -245,7 +246,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- Hits hits = findHits(properties, searcher);
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
// Add all versions to a list
versions = new ArrayList<Version>();
@@ -278,7 +279,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- Hits hits = findHits(properties, searcher);
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
result = convertHitsToElements(hits, 0, -1);
} finally {
// Release searcher instance
@@ -297,7 +298,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- Hits hits = findHits(properties, searcher);
+ Hits hits = findHits(properties, searcher, SORT_DATE_NONE);
result = hits.length();
} finally {
// Release searcher instance
@@ -310,14 +311,14 @@
@Override
public Set<MetaDataEntity> findElementsByProperties(
- Map<String, String> properties, int start, int count)
+ Map<String, String> properties, int start, int count, int dateOrder)
throws Exception {
Set<MetaDataEntity> result = null;
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- Hits hits = findHits(properties, searcher);
+ Hits hits = findHits(properties, searcher, dateOrder);
result = convertHitsToElements(hits, start, count);
} finally {
// Release searcher instance
@@ -350,9 +351,20 @@
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) throws Exception {
+ boolean onlyLatest, int start, int count, int dateOrder) throws Exception {
Query query = getQueryByContentSearch(queryText, onlyLatest);
Set<MetaDataEntity> result = null;
@@ -361,7 +373,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- hits = searcher.search(query);
+ hits = searcher.search(query, getSortDate(dateOrder));
// Convert hits to elements
result = convertHitsToElements(hits, start, count);
} finally {
@@ -409,7 +421,7 @@
* @throws IOException
* @throws Exception
*/
- private Hits findHits(Map<String, String> properties, Searcher searcher)
+ private Hits findHits(Map<String, String> properties, Searcher searcher, int dateOrder)
throws IOException {
// Create a query with all parameters
BooleanQuery query = new BooleanQuery();
@@ -418,7 +430,7 @@
BooleanClause.Occur.MUST);
}
- Hits hits = searcher.search(query);
+ Hits hits = searcher.search(query, getSortDate(dateOrder));
return hits;
}
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 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -179,16 +179,16 @@
}
public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
- int indexStart, int count) throws Exception {
+ int indexStart, int count, int dateOrder) throws Exception {
MetaDataEntity[] result = database.findElementsByContentSearch(query,
- onlyLatest, indexStart, count).toArray(new MetaDataEntity[0]);
+ onlyLatest, indexStart, count, dateOrder).toArray(new MetaDataEntity[0]);
return result;
}
public MetaDataEntity[] findElementsByType(String type, boolean onlyLatest,
- int start, int count) throws Exception {
+ int start, int count, int dateOrder) throws Exception {
MetaDataEntity[] result = database.findElementsByType(type, onlyLatest,
- start, count).toArray(new MetaDataEntity[0]);
+ start, count, dateOrder).toArray(new MetaDataEntity[0]);
return result;
}
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 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -31,11 +31,11 @@
int findFullTextCount(String query, boolean onlyLatest) throws Exception;
MetaDataEntity[] findFullText(String query, boolean onlyLatest,
- int indexStart, int count) throws Exception;
+ int indexStart, int count, int dateOrder) throws Exception;
int findApplicationsCount(boolean onlyLatest) throws Exception;
- MetaDataEntity[] findApplications(boolean onlyLatest, int start, int count)
+ MetaDataEntity[] findApplications(boolean onlyLatest, int start, int count, int dateOrder)
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 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -85,8 +85,8 @@
}
public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
- int indexStart, int count) throws Exception {
- return storageEngine.findFullText(query, onlyLatest, indexStart, count);
+ int indexStart, int count, int dateOrder) throws Exception {
+ return storageEngine.findFullText(query, onlyLatest, indexStart, count, dateOrder);
}
public int findFullTextCount(String query, boolean onlyLatest)
@@ -100,9 +100,9 @@
}
public MetaDataEntity[] findApplications(boolean onlyLatest, int start,
- int count) throws Exception {
+ int count, int dateOrder) throws Exception {
return storageEngine.findElementsByType(KEY_METADATA_TYPE_VALUE_EA,
- onlyLatest, start, count);
+ onlyLatest, start, count, dateOrder);
}
private MetaDataEntity saveElement(InputStream zipStream) throws Exception {
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java 2007-12-28 16:00:25 UTC (rev 91)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java 2008-01-03 11:10:57 UTC (rev 92)
@@ -146,7 +146,7 @@
int length = Math.min(200, Math.min(count, Math.max(1, count / 4)));
Set<MetaDataEntity> metaDatas = database
- .findElementsByContentSearch(key, false, start, length);
+ .findElementsByContentSearch(key, false, start, length, 1);
System.out.println(key + " (" + start + " " + length + ") : "
+ metaDatas.size());
1
0
r91 - 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/grid src/java/fr/cemagref/simexplorer/is/ui/web/pages src/java/fr/cemagref/simexplorer/is/ui/web/services src/ressources/fr/cemagref/simexplorer/is/ui/web src/ressources/fr/cemagref/simexplorer/is/ui/web/components src/ressources/fr/cemagref/simexplor
by glandais@users.labs.libre-entreprise.org 28 Dec '07
by glandais@users.labs.libre-entreprise.org 28 Dec '07
28 Dec '07
Author: glandais
Date: 2007-12-28 16:00:25 +0000 (Fri, 28 Dec 2007)
New Revision: 91
Added:
trunk/simexplorer-is-web/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs
trunk/simexplorer-is-web/.settings/org.eclipse.ltk.core.refactoring.prefs
trunk/simexplorer-is-web/.settings/org.eclipse.wst.validation.prefs
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/MetaData.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties
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_fr.properties
Removed:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties
trunk/simexplorer-is-web/src/webcontent/Layout.tml
Modified:
trunk/simexplorer-is-web/.classpath
trunk/simexplorer-is-web/.project
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/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/ApplicationExport.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
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/GroupEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
Log:
Affichage des applications
Modified: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/.classpath 2007-12-28 16:00:25 UTC (rev 91)
@@ -5,6 +5,10 @@
<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"/>
+ <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="output" path="target/classes"/>
</classpath>
Modified: trunk/simexplorer-is-web/.project
===================================================================
--- trunk/simexplorer-is-web/.project 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/.project 2007-12-28 16:00:25 UTC (rev 91)
@@ -3,6 +3,7 @@
<name>simexplorer-is-web</name>
<comment>simexploreris web</comment>
<projects>
+ <project>simexplorer-is-storage</project>
</projects>
<buildSpec>
<buildCommand>
Modified: 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 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.jst.common.project.facet.core.prefs 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,4 +1,4 @@
#Wed Dec 19 15:57:55 CET 2007
classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
-classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.generic.runtimeTarget\:\:JBoss\ v4.2/owners=jst.web\:2.5
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.generic.runtimeTarget\:\:JBoss\ v4.2/owners=jst.web\:2.4
eclipse.preferences.version=1
Added: trunk/simexplorer-is-web/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,6 @@
+#Fri Dec 28 15:20:02 CET 2007
+XDOCLETBUILDERACTIVE=true
+XDOCLETHOME=
+XDOCLETUSEGLOBAL=true
+XDOCLETVERSION=1.2.1
+eclipse.preferences.version=1
Added: trunk/simexplorer-is-web/.settings/org.eclipse.ltk.core.refactoring.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.ltk.core.refactoring.prefs (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.ltk.core.refactoring.prefs 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,3 @@
+#Thu Dec 27 16:56:41 CET 2007
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
Modified: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-28 16:00:25 UTC (rev 91)
@@ -5,7 +5,10 @@
<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"/>
+ <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/simexplorer-is-storage/simexplorer-is-storage">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <property name="java-output-path" value="build/classes"/>
<property name="context-root" value="simexplorer-is"/>
- <property name="java-output-path" value="build/classes"/>
</wb-module>
</project-modules>
Modified: 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 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.project.facet.core.xml 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="JBoss v4.2"/>
+ <secondary-runtime name="Apache Tomcat v5.5"/>
<fixed facet="jst.java"/>
<fixed facet="jst.web"/>
<installed facet="jst.java" version="5.0"/>
- <installed facet="jst.web" version="2.5"/>
+ <installed facet="jst.web" version="2.4"/>
</faceted-project>
Added: trunk/simexplorer-is-web/.settings/org.eclipse.wst.validation.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.validation.prefs (rev 0)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.validation.prefs 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,6 @@
+#Fri Dec 28 15:20:01 CET 2007
+DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;
+USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;
+USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;
+USER_PREFERENCE=overrideGlobalPreferencesfalse
+eclipse.preferences.version=1
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/MetaData.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/MetaData.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/MetaData.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,53 @@
+package fr.cemagref.simexplorer.is.ui.web.beans;
+
+import java.util.Date;
+
+import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
+
+public class MetaData {
+
+ private String uuid;
+ private String name;
+ private String version;
+ private Date creationDate;
+
+ public void loadFromMetaDataEntity(MetaDataEntity mde) {
+ setUuid(mde.getUuid());
+ setName(mde.getName());
+ setVersion(mde.getVersion().toString());
+ setCreationDate(mde.getCreationDate());
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(Date creationDate) {
+ this.creationDate = creationDate;
+ }
+
+}
Copied: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java (from rev 89, trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java)
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/components/Layout.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,123 @@
+/* *##%
+ * 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.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 $
+ */
+public class Layout {
+
+ /* linked state "UserList" */
+ @InjectPage
+ private UserList userList;
+
+ /**
+ * page title
+ */
+ @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
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set default title
+ */
+ void getDefaultTitle() {
+ title = "";
+ }
+
+ /**
+ * @return the _stylesheetGeneral
+ */
+ public Asset getStylesheetGeneral() {
+ return _stylesheetGeneral;
+ }
+
+ /**
+ * @return the _stylesheetLayout
+ */
+ public Asset getStylesheetLayout() {
+ return _stylesheetLayout;
+ }
+
+ @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;
+ }
+
+ public Asset getStylesheetTree() {
+ return stylesheetTree;
+ }
+
+}
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 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,11 +1,15 @@
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;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.beans.MetaData;
import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
public class ApplicationDataSource implements GridDataSource {
@@ -45,11 +49,13 @@
}
public Class getRowType() {
- return MetaDataEntity.class;
+ return MetaData.class;
}
public Object getRowValue(int index) {
- return entities[index - indexStart];
+ MetaData md = new MetaData();
+ md.loadFromMetaDataEntity(entities[index - indexStart]);
+ return md;
}
public void prepare(int startIndex, int endIndex, PropertyModel sortModel,
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 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,12 +1,32 @@
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.storage.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
+
public class ApplicationDetail extends AbstractApplicationDetail {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ @Persist
+ private MetaDataEntity explorationApplication;
+ public void setup(String uuid, String version) throws Exception {
+ explorationApplication = StorageServiceFactory.getService()
+ .getMetadata(uuid, version);
+ }
+
+ public MetaDataEntity getExplorationApplication() {
+ return explorationApplication;
+ }
+
+ public void setExplorationApplication(MetaDataEntity explorationApplication) {
+ this.explorationApplication = explorationApplication;
+ }
+
+ public String getMessage() {
+ return explorationApplication.getDescription();
+ }
+
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -2,11 +2,8 @@
import org.apache.tapestry.annotations.Component;
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
public class ApplicationExport extends AbstractApplicationExport {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
-
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -6,15 +6,11 @@
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 {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
-
private UploadedFile fileEA;
private UploadedFile fileLib;
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 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,30 +1,69 @@
package fr.cemagref.simexplorer.is.ui.web.pages;
-import org.apache.tapestry.annotations.Component;
+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.ioc.annotations.Inject;
+import org.apache.tapestry.services.BeanModelSource;
-import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.beans.MetaData;
import fr.cemagref.simexplorer.is.ui.web.grid.ApplicationDataSource;
public class ApplicationList extends AbstractApplicationList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ @Retain
+ private BeanModel model;
- private MetaDataEntity application;
+ @Inject
+ private BeanModelSource beanModelSource;
+ @Inject
+ private ComponentResources resources;
+
+ private MetaData application;
+
+ @InjectPage
+ private ApplicationDetail applicationDetail;
+
+ void pageLoaded() {
+ model = beanModelSource.create(MetaData.class, true, resources);
+ List<String> properties = model.getPropertyNames();
+ for (String property : properties) {
+ model.get(property).sortable(false);
+ }
+ }
+
+ public BeanModel getModel() {
+ return model;
+ }
+
public ApplicationDataSource getApplications() {
return new ApplicationDataSource();
}
- public MetaDataEntity getApplication() {
+ public MetaData getApplication() {
return application;
}
- public void setApplication(MetaDataEntity application) {
+ public void setApplication(MetaData 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;
+ }
+
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -3,11 +3,9 @@
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 {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
@Persist
private int groupId;
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -2,10 +2,8 @@
import org.apache.tapestry.annotations.Component;
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
public class GroupList extends AbstractGroupList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
}
Deleted: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,129 +0,0 @@
-/* *##%
- * 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.pages;
-
-import java.util.Locale;
-
-import org.apache.tapestry.Asset;
-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;
-
-/**
- * AbstractPage.java
- *
- * @author chatellier
- * @version $Revision: 1.1 $
- *
- * Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $
- */
-public class Layout {
-
- /* linked state "UserList" */
- @InjectPage
- private UserList userList;
-
- /**
- * page title
- */
- @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;
-
- @Inject
- @Path("context:js/dftree.js")
- private Asset javascriptTree;
-
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Set default title
- */
- void getDefaultTitle() {
- title = "";
- }
-
- /**
- * @return the _stylesheetGeneral
- */
- public Asset getStylesheetGeneral() {
- return _stylesheetGeneral;
- }
-
- /**
- * @return the _stylesheetLayout
- */
- public Asset getStylesheetLayout() {
- return _stylesheetLayout;
- }
-
- @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;
- }
-
- public Asset getStylesheetTree() {
- return stylesheetTree;
- }
-
- public Asset getJavascriptTree() {
- return javascriptTree;
- }
-
- public String getJavascriptFolder() {
- return javascriptTree.toClientURL().replace("dftree.js", "");
- }
-
-}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -3,11 +3,9 @@
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 {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
@Persist
private int userId;
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -2,10 +2,8 @@
import org.apache.tapestry.annotations.Component;
+import fr.cemagref.simexplorer.is.ui.web.components.Layout;
+
public class UserList extends AbstractUserList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,5 +1,8 @@
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;
@@ -12,7 +15,14 @@
public static StorageService getService() throws NamingException {
if (serviceProjets == null) {
- Context context = new InitialContext(System.getProperties());
+ 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");
}
Copied: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties (from rev 89, trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties)
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.properties 2007-12-28 16:00:25 UTC (rev 91)
@@ -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
Copied: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml (from rev 89, trunk/simexplorer-is-web/src/webcontent/Layout.tml)
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout.tml 2007-12-28 16:00:25 UTC (rev 91)
@@ -0,0 +1,62 @@
+<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>
+
+ <!-- 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
Copied: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties (from rev 89, trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties)
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/components/Layout_fr.properties 2007-12-28 16:00:25 UTC (rev 91)
@@ -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
Deleted: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,22 +0,0 @@
-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
Deleted: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,22 +0,0 @@
-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
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,4 +1,6 @@
<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="message:windowtitle">
-
+
+ <strong>${message}</strong>
+
</t:layout>
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,14 +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">
- <t:parameter name="uuidCell">
- ${application.uuid}
- </t:parameter>
+ <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>
- <a t:type="ActionLink" t:id="edit">Details</a>
- <a t:type="ActionLink" t:id="create">Create</a>
- <a t:type="ActionLink" t:id="delete">Delete</a>
-
</t:layout>
Deleted: trunk/simexplorer-is-web/src/webcontent/Layout.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/Layout.tml 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/webcontent/Layout.tml 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,66 +0,0 @@
-<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}" />
- <script type="text/javascript" src="${prop:javascriptTree}"></script>
- <script type="text/javascript" src="${prop:javascriptFolder}treeLoader.js"></script>
- <script type="text/javascript" src="${prop:javascriptFolder}dwr/engine.js"></script>
- <script type="text/javascript" src="${prop:javascriptFolder}dwr/interface/TreeData.js"></script>
-
- </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
Modified: trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-28 15:57:46 UTC (rev 90)
+++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-28 16:00:25 UTC (rev 91)
@@ -1,9 +1,9 @@
<?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_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- id="WebApp_ID" version="2.5">
+ 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>
1
0
r90 - trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service
by glandais@users.labs.libre-entreprise.org 28 Dec '07
by glandais@users.labs.libre-entreprise.org 28 Dec '07
28 Dec '07
Author: glandais
Date: 2007-12-28 15:57:46 +0000 (Fri, 28 Dec 2007)
New Revision: 90
Modified:
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java
Log:
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 2007-12-26 16:30:43 UTC (rev 89)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java 2007-12-28 15:57:46 UTC (rev 90)
@@ -11,33 +11,31 @@
@Remote
public interface StorageService {
- public void open() throws Exception;
+ void open() throws Exception;
- public void close() throws Exception;
+ void close() throws Exception;
- public void commit() throws Exception;
+ void commit() throws Exception;
- public MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
+ MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
throws Exception;
- public MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
+ MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
Map<String, RemoteInputStream> attachmentsRemoteStream)
throws Exception;
- public MetaDataEntity getMetadata(String uuid) throws Exception;
+ MetaDataEntity getMetadata(String uuid) throws Exception;
- public MetaDataEntity getMetadata(String uuid, String version)
- throws Exception;
+ MetaDataEntity getMetadata(String uuid, String version) throws Exception;
- public int findFullTextCount(String query, boolean onlyLatest)
- throws Exception;
+ int findFullTextCount(String query, boolean onlyLatest) throws Exception;
- public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
+ MetaDataEntity[] findFullText(String query, boolean onlyLatest,
int indexStart, int count) throws Exception;
- public int findApplicationsCount(boolean onlyLatest) throws Exception;
+ int findApplicationsCount(boolean onlyLatest) throws Exception;
- public MetaDataEntity[] findApplications(boolean onlyLatest, int start,
- int count) throws Exception;
+ MetaDataEntity[] findApplications(boolean onlyLatest, int start, int count)
+ throws Exception;
}
1
0
r89 - 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/dwr src/java/fr/cemagref/simexplorer/is/ui/web/grid src/java/fr/cemagref/simexplorer/is/ui/web/pages src/java/fr/cemagref/simexplorer/is/ui/web/services src/webcontent src/webcontent/WEB-INF src/webcontent/js
by glandais@users.labs.libre-entreprise.org 26 Dec '07
by glandais@users.labs.libre-entreprise.org 26 Dec '07
26 Dec '07
Author: glandais
Date: 2007-12-26 16:30:43 +0000 (Wed, 26 Dec 2007)
New Revision: 89
Added:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/
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/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/errors/
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/
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/services/
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml
trunk/simexplorer-is-web/src/webcontent/index.html
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/ContextListener.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/ApplicationExport.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
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/GroupEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js
Log:
Upload et affichage des applications
Modified: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/.classpath 2007-12-26 16:30:43 UTC (rev 89)
@@ -1,13 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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 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.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<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 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-26 16:30:43 UTC (rev 89)
@@ -4,6 +4,7 @@
<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"/>
<property name="context-root" value="simexplorer-is"/>
<property name="java-output-path" value="build/classes"/>
</wb-module>
Modified: trunk/simexplorer-is-web/pom.xml
===================================================================
--- trunk/simexplorer-is-web/pom.xml 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/pom.xml 2007-12-26 16:30:43 UTC (rev 89)
@@ -152,5 +152,11 @@
<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
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/ContextListener.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -1,33 +1,26 @@
package fr.cemagref.simexplorer.is.ui.web;
-import javax.naming.Context;
-import javax.naming.InitialContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
-import fr.cemagref.simexplorer.is.storage.service.StorageService;
+import fr.cemagref.simexplorer.is.ui.web.services.StorageServiceFactory;
public class ContextListener implements ServletContextListener {
- StorageService serviceProjets = null;
+ public void contextDestroyed(ServletContextEvent arg0) {
+ try {
+ StorageServiceFactory.getService().close();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
- public void contextDestroyed(ServletContextEvent arg0) {
- try {
- serviceProjets.close();
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
+ public void contextInitialized(ServletContextEvent arg0) {
+ try {
+ StorageServiceFactory.getService().open();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
- public void contextInitialized(ServletContextEvent arg0) {
- try {
- Context context = new InitialContext(System.getProperties());
- serviceProjets = (StorageService) context
- .lookup("ejb3/StorageService");
- serviceProjets.open();
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
}
Added: 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 (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/beans/TreeNode.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -0,0 +1,33 @@
+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;
+ }
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/dwr/TreeData.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -0,0 +1,28 @@
+package fr.cemagref.simexplorer.is.ui.web.dwr;
+
+import java.util.Random;
+
+import fr.cemagref.simexplorer.is.ui.web.beans.TreeNode;
+
+public class TreeData {
+
+ public TreeNode getNode(long id) {
+ Random r = new Random();
+
+ TreeNode tn = new TreeNode();
+ tn.setId(id);
+ tn.setLibelle(Long.toHexString(r.nextLong()));
+ int n = 5 + r.nextInt(10);
+ TreeNode[] children = new TreeNode[n];
+ for (int i = 0; i < children.length; i++) {
+ children[i] = new TreeNode();
+ children[i].setId(1 + r.nextLong());
+ children[i].setLibelle(Long.toHexString(r.nextLong()));
+ children[i].setEnfants(new TreeNode[0]);
+ }
+ tn.setEnfants(children);
+
+ return tn;
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/grid/ApplicationDataSource.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -0,0 +1,74 @@
+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.storage.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;
+ if (query.isEmpty()) {
+ entities = StorageServiceFactory.getService().findApplications(
+ false, startIndex, 1 + endIndex - startIndex);
+ } else {
+ entities = StorageServiceFactory.getService().findFullText(
+ query, false, startIndex, 1 + endIndex - startIndex);
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ this.indexStart = 0;
+ entities = new MetaDataEntity[0];
+ }
+ }
+
+}
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 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -2,12 +2,11 @@
import org.apache.tapestry.annotations.Component;
-
public class ApplicationDetail extends AbstractApplicationDetail {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -2,12 +2,11 @@
import org.apache.tapestry.annotations.Component;
-
public class ApplicationExport extends AbstractApplicationExport {
-
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -3,30 +3,44 @@
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.services.StorageServiceFactory;
+
public class ApplicationImport extends AbstractApplicationImport {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
- private UploadedFile _file;
+ private UploadedFile fileEA;
+ private UploadedFile fileLib;
- public UploadedFile getFile()
- {
- return _file;
- }
+ public UploadedFile getFileEA() {
+ return fileEA;
+ }
- public void setFile(UploadedFile file)
- {
- _file = file;
- }
+ public void setFileEA(UploadedFile fileEA) {
+ this.fileEA = fileEA;
+ }
- public void onSuccess()
- {
- //File copied = new File("/my/file/location/" + _file.getFileName());
- //_file.write(copied);
- }
-
+ 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());
+ }
+ }
+
}
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 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -1,12 +1,30 @@
package fr.cemagref.simexplorer.is.ui.web.pages;
import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.ioc.annotations.Inject;
+import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
+import fr.cemagref.simexplorer.is.ui.web.grid.ApplicationDataSource;
+
public class ApplicationList extends AbstractApplicationList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+ private MetaDataEntity application;
+
+ public ApplicationDataSource getApplications() {
+ return new ApplicationDataSource();
+ }
+
+ public MetaDataEntity getApplication() {
+ return application;
+ }
+
+ public void setApplication(MetaDataEntity application) {
+ this.application = application;
+ }
+
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -3,19 +3,18 @@
import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.annotations.Persist;
-
public class GroupEdit extends AbstractGroupEdit {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
- @Persist
- private int groupId;
+ @Persist
+ private int groupId;
- void onActivate(int groupId) {
- this.groupId = groupId;
- this.onActivate();
- }
+ void onActivate(int groupId) {
+ this.groupId = groupId;
+ this.onActivate();
+ }
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -2,11 +2,10 @@
import org.apache.tapestry.annotations.Component;
-
public class GroupList extends AbstractGroupList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -28,8 +28,6 @@
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.services.PersistentLocale;
-
-
/**
* AbstractPage.java
*
@@ -39,94 +37,93 @@
* Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $
*/
public class Layout {
-
+
/* linked state "UserList" */
@InjectPage
private UserList userList;
-
- /**
- * page title
- */
- @Parameter("defaulttitle")
- private String title;
-
- @Inject
- @Path("context:css/general.css")
- private Asset _stylesheetGeneral;
-
+
+ /**
+ * page title
+ */
+ @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;
-
+
@Inject
@Path("context:js/dftree.js")
private Asset javascriptTree;
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Set default title
- */
- void getDefaultTitle() {
- title = "";
- }
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
- /**
- * @return the _stylesheetGeneral
- */
- public Asset getStylesheetGeneral() {
- return _stylesheetGeneral;
- }
+ /**
+ * Set default title
+ */
+ void getDefaultTitle() {
+ title = "";
+ }
- /**
- * @return the _stylesheetLayout
- */
- public Asset getStylesheetLayout() {
- return _stylesheetLayout;
- }
-
- @Inject
- @Service("PersistentLocale")
- private PersistentLocale persistentLocale;
-
+ /**
+ * @return the _stylesheetGeneral
+ */
+ public Asset getStylesheetGeneral() {
+ return _stylesheetGeneral;
+ }
+
+ /**
+ * @return the _stylesheetLayout
+ */
+ public Asset getStylesheetLayout() {
+ return _stylesheetLayout;
+ }
+
+ @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;
- }
+ Object onActionFromSwitchLocaleEn() {
+ persistentLocale.set(new Locale("en"));
+ return null;
+ }
+ Object onActionFromAdministration() {
+ return userList;
+ }
+
+ public boolean getAdministrator() {
+ return true;
+ }
+
public Asset getStylesheetTree() {
return stylesheetTree;
}
public Asset getJavascriptTree() {
- return javascriptTree;
+ return javascriptTree;
}
-
+
public String getJavascriptFolder() {
return javascriptTree.toClientURL().replace("dftree.js", "");
}
-
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -3,19 +3,18 @@
import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.annotations.Persist;
-
public class UserEdit extends AbstractUserEdit {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
- @Persist
- private int userId;
+ @Persist
+ private int userId;
- void onActivate(int userId) {
- this.userId = userId;
- this.onActivate();
- }
+ void onActivate(int userId) {
+ this.userId = userId;
+ this.onActivate();
+ }
}
Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -2,11 +2,10 @@
import org.apache.tapestry.annotations.Component;
-
public class UserList extends AbstractUserList {
- /** layout */
- @SuppressWarnings("unused")
- @Component
- private Layout layout;
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/services/StorageServiceFactory.java 2007-12-26 16:30:43 UTC (rev 89)
@@ -0,0 +1,22 @@
+package fr.cemagref.simexplorer.is.ui.web.services;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import fr.cemagref.simexplorer.is.storage.service.StorageService;
+
+public class StorageServiceFactory {
+
+ private static StorageService serviceProjets = null;
+
+ public static StorageService getService() throws NamingException {
+ if (serviceProjets == null) {
+ Context context = new InitialContext(System.getProperties());
+ serviceProjets = (StorageService) context
+ .lookup("ejb3/StorageService");
+ }
+ return serviceProjets;
+ }
+
+}
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml 2007-12-26 16:30:43 UTC (rev 89)
@@ -3,8 +3,17 @@
<t:form>
<t:errors/>
- <input t:type="upload" t:id="file" validate="required"/>
+
+ <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>
Modified: trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-26 16:30:43 UTC (rev 89)
@@ -1,15 +1,14 @@
<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="message:windowtitle">
-
- <div id="dftree_tree">
- </div>
+
+ <table t:type="Grid" source="applications" row="application">
+ <t:parameter name="uuidCell">
+ ${application.uuid}
+ </t:parameter>
+ </table>
+
<a t:type="ActionLink" t:id="edit">Details</a>
<a t:type="ActionLink" t:id="create">Create</a>
<a t:type="ActionLink" t:id="delete">Delete</a>
-
-
-<script>
-initTree();
-</script>
-
+
</t:layout>
Added: trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/dwr.xml 2007-12-26 16:30:43 UTC (rev 89)
@@ -0,0 +1,12 @@
+<!DOCTYPE dwr PUBLIC
+ "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
+ "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
+
+<dwr>
+ <allow>
+ <convert converter="bean" match="fr.cemagref.simexplorer.is.ui.web.beans.*"/>
+ <create creator="new" javascript="TreeData">
+ <param name="class" value="fr.cemagref.simexplorer.is.ui.web.dwr.TreeData"/>
+ </create>
+ </allow>
+</dwr>
\ No newline at end of file
Modified: trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-26 16:30:43 UTC (rev 89)
@@ -21,6 +21,20 @@
<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
@@ -28,6 +42,6 @@
</listener>
<welcome-file-list>
- <welcome-file>ApplicationList</welcome-file>
+ <welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/webcontent/index.html
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/index.html (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/index.html 2007-12-26 16:30:43 UTC (rev 89)
@@ -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
Modified: trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js 2007-12-26 16:30:11 UTC (rev 88)
+++ trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js 2007-12-26 16:30:43 UTC (rev 89)
@@ -10,24 +10,25 @@
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 = 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);
@@ -63,6 +64,8 @@
createNode(i++, 'Components', pid[0]);
createNode(i++, 'Explorations', pid[0]);
+ */
+
for (var j = 0; j < inode; j++) {
nodes[j].open();
}
1
0
r88 - in trunk/simexplorer-si-storage: . .settings src/java/META-INF src/java/fr/cemagref/simexplorer/is/storage/attachment src/java/fr/cemagref/simexplorer/is/storage/database src/java/fr/cemagref/simexplorer/is/storage/database/lucene src/java/fr/cemagref/simexplorer/is/storage/engine src/java/fr/cemagref/simexplorer/is/storage/entities/metadata src/java/fr/cemagref/simexplorer/is/storage/factories src/java/fr/cemagref/simexplorer/is/storage/service src/java/fr/cemagref/simexplore
by glandais@users.labs.libre-entreprise.org 26 Dec '07
by glandais@users.labs.libre-entreprise.org 26 Dec '07
26 Dec '07
Author: glandais
Date: 2007-12-26 16:30:11 +0000 (Wed, 26 Dec 2007)
New Revision: 88
Added:
trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs
Modified:
trunk/simexplorer-si-storage/.classpath
trunk/simexplorer-si-storage/src/java/META-INF/MANIFEST.MF
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/database/Database.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.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/metadata/MetaDataEntity.java
trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/Version.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/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/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/java/fr/cemagref/simexplorer/is/storage/xml/MetaDataParser.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/LuceneDatabaseLoadTestCase.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseTestCase.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThread.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThreadsTestCase.java
trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneSimpleTest.java
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/service/StorageServiceTest.java
Log:
Gestion des versions par d?\195?\169faut (latest)
Modified: trunk/simexplorer-si-storage/.classpath
===================================================================
--- trunk/simexplorer-si-storage/.classpath 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/.classpath 2007-12-26 16:30:11 UTC (rev 88)
@@ -4,8 +4,8 @@
<classpathentry kind="src" path="src/test"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss v4.2"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v4.2"/>
+ <classpathentry exported="true" kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Added: trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs 2007-12-26 16:30:11 UTC (rev 88)
@@ -0,0 +1,4 @@
+#Mon Dec 24 09:40:26 CET 2007
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.generic.runtimeTarget\:\:JBoss\ v4.2/owners=jst.ejb\:3.0
+eclipse.preferences.version=1
Modified: trunk/simexplorer-si-storage/src/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/simexplorer-si-storage/src/java/META-INF/MANIFEST.MF 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/META-INF/MANIFEST.MF 2007-12-26 16:30:11 UTC (rev 88)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path:
Modified: 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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/attachment/Content.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -6,23 +6,23 @@
public class Content {
- private ContentType type;
- private InputStream content;
+ private ContentType type;
+ private InputStream content;
- public ContentType getType() {
- return type;
- }
+ public ContentType getType() {
+ return type;
+ }
- public void setType(ContentType type) {
- this.type = type;
- }
+ public void setType(ContentType type) {
+ this.type = type;
+ }
- public InputStream getContent() {
- return content;
- }
+ public InputStream getContent() {
+ return content;
+ }
- public void setContent(InputStream content) {
- this.content = content;
- }
+ public void setContent(InputStream content) {
+ this.content = content;
+ }
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/Database.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -1,7 +1,7 @@
package fr.cemagref.simexplorer.is.storage.database;
import java.io.Reader;
-import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -88,38 +88,6 @@
public abstract List<Version> getVersions(String uuid) throws Exception;
/**
- * Retrieve an element in its latest version null if not fund
- *
- * @param uuid
- * Id
- * @return Element in its latest version, null if no element with this id
- * exists
- * @throws Exception
- */
- public MetaDataEntity getElementLatestVersion(String uuid) throws Exception {
- MetaDataEntity result = null;
-
- // Get all versions
- List<Version> versions = getVersions(uuid);
-
- // Sort versions ascending
- Collections.sort(versions);
- // Revert, first is latest
- Collections.reverse(versions);
-
- // If at least a version exists
- if (versions.size() > 0) {
- Version version = versions.get(0);
- // get element corresponding to latest version
- result = getElement(uuid, version);
- } else {
- result = null;
- }
-
- return result;
- }
-
- /**
* Retrieve all elements by id Empty list if no element with this id
*
* @param uuid
@@ -127,8 +95,8 @@
* @return Element list
* @throws Exception
*/
- public abstract Set<MetaDataEntity> findElementsById(String uuid)
- throws Exception;
+ public abstract Set<MetaDataEntity> findElementsById(String uuid,
+ boolean onlyLatest) throws Exception;
/**
* Retrieve elements with specific properties<br>
@@ -172,18 +140,26 @@
public abstract int findElementsByPropertiesCount(
Map<String, String> properties) throws Exception;
- /**
- * Retrieve elements by content search<br>
- * Empty list if no element
- *
- * @param searchedText
- * Searched text
- * @return Element list
- * @throws Exception
- */
- public Set<MetaDataEntity> findElementsByContentSearch(String queryText)
+ private Map<String, String> getPropertiesByType(String type,
+ boolean onlyLatest) {
+ Map<String, String> properties = new HashMap<String, String>();
+ properties.put(KEY_TYPE, type);
+ if (onlyLatest) {
+ properties.put(KEY_LATEST, "1");
+ }
+ return properties;
+ }
+
+ public Set<MetaDataEntity> findElementsByType(String type,
+ boolean onlyLatest, int start, int count) throws Exception {
+ return findElementsByProperties(getPropertiesByType(type, onlyLatest),
+ start, count);
+ }
+
+ public int findElementsByTypeCount(String type, boolean onlyLatest)
throws Exception {
- return findElementsByContentSearch(queryText, 0, -1);
+ return findElementsByPropertiesCount(getPropertiesByType(type,
+ onlyLatest));
}
/**
@@ -200,7 +176,8 @@
* @throws Exception
*/
public abstract Set<MetaDataEntity> findElementsByContentSearch(
- String queryText, int start, int count) throws Exception;
+ String queryText, boolean onlyLatest, int start, int count)
+ throws Exception;
/**
* Retrieve element count with specific content
@@ -210,8 +187,8 @@
* @return Number of elements fund
* @throws Exception
*/
- public abstract int findElementsByContentSearchCount(String queryText)
- throws Exception;
+ public abstract int findElementsByContentSearchCount(String queryText,
+ boolean onlyLatest) throws Exception;
// Delete
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/DatabaseConstants.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -29,6 +29,11 @@
*/
public static final String KEY_VERSION = "simexplorer.version";
/**
+ * Field name for latest
+ */
+ public static final String KEY_LATEST = "simexplorer.latest";
+ /**
+ *
* Field name for creation date
*/
public static final String KEY_CREATIONDATE = "simexplorer.creationdate";
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/LuceneDatabase.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -21,6 +21,7 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
@@ -129,6 +130,7 @@
// FIXME index location
File indexDir = new File("./index/");
+ //File indexDir = new File("/home/landais/lucene/index.big");
// Base directory index
directory = FSDirectory.getDirectory(indexDir, lockFactory);
@@ -140,6 +142,10 @@
// Instanciate unique writer
writer = new IndexWriter(directory, true, analyzer, realCreate);
+
+ if (realCreate) {
+ commit();
+ }
}
@Override
@@ -155,7 +161,7 @@
// Check if an optimization is required
Date now = new Date();
long elapsed = now.getTime() - lastOptimize.getTime();
- // One optimize per hour, if readers are closed
+ // FIXME One optimize per hour, if readers are closed
if (elapsed > 3600 * 1000 && searcherPool.allClosed()) {
writer.optimize();
lastOptimize = new Date();
@@ -258,10 +264,14 @@
}
@Override
- public Set<MetaDataEntity> findElementsById(String uuid) throws Exception {
+ 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");
+ }
Set<MetaDataEntity> result = null;
@@ -319,11 +329,9 @@
}
@Override
- public int findElementsByContentSearchCount(String queryText)
- throws Exception {
- Analyzer analyzer = new SimpleAnalyzer();
- QueryParser parser = new QueryParser(KEY_SEARCHABLE_CONTENT, analyzer);
- Query luceneQuery = parser.parse(queryText);
+ public int findElementsByContentSearchCount(String queryText,
+ boolean onlyLatest) throws Exception {
+ Query query = getQueryByContentSearch(queryText, onlyLatest);
int result = 0;
@@ -331,7 +339,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- hits = searcher.search(luceneQuery);
+ hits = searcher.search(query);
// Return hits length
result = hits.length();
} finally {
@@ -344,10 +352,8 @@
@Override
public Set<MetaDataEntity> findElementsByContentSearch(String queryText,
- int start, int count) throws Exception {
- Analyzer analyzer = new SimpleAnalyzer();
- QueryParser parser = new QueryParser(KEY_SEARCHABLE_CONTENT, analyzer);
- Query luceneQuery = parser.parse(queryText);
+ boolean onlyLatest, int start, int count) throws Exception {
+ Query query = getQueryByContentSearch(queryText, onlyLatest);
Set<MetaDataEntity> result = null;
@@ -355,7 +361,7 @@
// Get current searcher instance
Searcher searcher = getSearcher();
try {
- hits = searcher.search(luceneQuery);
+ hits = searcher.search(query);
// Convert hits to elements
result = convertHitsToElements(hits, start, count);
} finally {
@@ -366,6 +372,24 @@
return result;
}
+ 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;
+ }
+
@Override
public void deleteElement(String uuid, Version version) throws Exception {
// Delete element in db with term search
@@ -443,6 +467,11 @@
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);
@@ -518,6 +547,12 @@
addSimpleField(document, KEY_VERSION, element.getVersion()
.toString());
}
+ if (element.isLatest()) {
+ addSimpleField(document, KEY_LATEST, "1");
+ } else {
+ addSimpleField(document, KEY_LATEST, "0");
+ }
+
if (element.getCreationDate() != null) {
addSimpleField(document, KEY_CREATIONDATE, Long.toString(element
.getCreationDate().getTime()));
@@ -536,7 +571,8 @@
String key = KEY_ATTACHMENT + "." + entry.getKey();
Content value = entry.getValue();
if (value != null && value.getType() != null) {
- addSimpleField(document, key, value.getType().getClass().getSimpleName());
+ addSimpleField(document, key, value.getType().getClass()
+ .getSimpleName());
}
}
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/engine/StorageEngine.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -25,200 +25,211 @@
*/
public class StorageEngine {
- /**
- * Indexing
- */
- protected Database database;
+ /**
+ * Indexing
+ */
+ protected Database database;
- /**
- * Storage
- */
- protected AttachmentHandler attachmentHandler;
+ /**
+ * Storage
+ */
+ protected AttachmentHandler attachmentHandler;
- /**
- * Metadata handling temporary data
- */
- private MetaDataEntity mdTmp;
+ /**
+ * Metadata handling temporary data
+ */
+ private MetaDataEntity mdTmp;
- /**
- * Default constructor with default implementations of storage and indexing
- */
- public StorageEngine() {
- super();
- // Indexing
- database = new LuceneDatabase();
- // Storage
- attachmentHandler = new FileSystemAttachmentHandler();
- // Storing tmp data
- mdTmp = new MetaDataEntity();
- mdTmp.setUuid(UUID.randomUUID().toString());
- mdTmp.setVersion("0");
- }
+ /**
+ * Default constructor with default implementations of storage and indexing
+ */
+ public StorageEngine() {
+ super();
+ // Indexing
+ database = new LuceneDatabase();
+ // Storage
+ attachmentHandler = new FileSystemAttachmentHandler();
+ // Storing tmp data
+ mdTmp = new MetaDataEntity();
+ mdTmp.setUuid(UUID.randomUUID().toString());
+ mdTmp.setVersion("0");
+ }
- /**
- * Open storage
- *
- * @throws Exception
- */
- public void open() throws Exception {
- database.open();
- }
+ /**
+ * Open storage
+ *
+ * @throws Exception
+ */
+ public void open() throws Exception {
+ database.open();
+ }
- /**
- * Close storage
- *
- * @throws Exception
- */
- public void close() throws Exception {
- database.close();
- }
+ /**
+ * Close storage
+ *
+ * @throws Exception
+ */
+ public void close() throws Exception {
+ database.close();
+ }
- /**
- * Commit changes to storage
- *
- * @throws Exception
- */
- public void commit() throws Exception {
- database.commit();
- }
+ /**
+ * Commit changes to storage
+ *
+ * @throws Exception
+ */
+ public void commit() throws Exception {
+ database.commit();
+ }
- // Create / update
+ // Create / update
- /**
- * Save an element to storage
- *
- * @param element
- * Element to save
- * @param attachments
- * Attachments related
- * @throws Exception
- */
- public void saveElement(MetaDataEntity element,
- Map<String, InputStream> attachments) throws Exception {
+ /**
+ * Save an element to storage
+ *
+ * @param element
+ * Element to save
+ * @param attachments
+ * Attachments related
+ * @throws Exception
+ */
+ public void saveElement(MetaDataEntity element,
+ Map<String, InputStream> attachments) throws Exception {
- for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
- attachmentHandler.storeData(element, entry.getKey(), entry
- .getValue());
- }
+ for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
+ attachmentHandler.storeData(element, entry.getKey(), entry
+ .getValue());
+ }
- List<Reader> readers = new ArrayList<Reader>();
- for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
- String field = entry.getKey();
- 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();
- Reader reader = contentType.renderToText(content);
- readers.add(reader);
- }
- }
- }
+ List<Reader> readers = new ArrayList<Reader>();
+ for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
+ String field = entry.getKey();
+ 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();
+ Reader reader = contentType.renderToText(content);
+ readers.add(reader);
+ }
+ }
+ }
- database.insertElement(element, readers);
- }
+ database.insertElement(element, readers);
+ }
- // Read
+ // Read
- /**
- * Retrieve an element
- *
- * @param uuid
- * Id of the element
- * @return The element
- * @throws Exception
- */
- public MetaDataEntity getMetadata(String uuid) throws Exception {
- MetaDataEntity mde = database.getElementLatestVersion(uuid);
- return mde;
- }
+ /**
+ * Retrieve an element
+ *
+ * @param uuid
+ * Id of the element
+ * @return The element
+ * @throws Exception
+ */
+ public MetaDataEntity getMetadata(String uuid) throws Exception {
+ MetaDataEntity mde = null;
+ Set<MetaDataEntity> set = database.findElementsById(uuid, true);
+ if (!set.isEmpty()) {
+ mde = set.iterator().next();
+ }
+ return mde;
+ }
- /**
- * Retrieve versions of an element<br>
- * Empty list if no element with this id
- *
- * @param uuid
- * Id of the element
- * @return List of versions of the element<br>
- *
- * @throws Exception
- */
- public List<Version> getVersions(String uuid) throws Exception {
- return database.getVersions(uuid);
- }
+ /**
+ * Retrieve versions of an element<br>
+ * Empty list if no element with this id
+ *
+ * @param uuid
+ * Id of the element
+ * @return List of versions of the element<br>
+ *
+ * @throws Exception
+ */
+ public List<Version> getVersions(String uuid) throws Exception {
+ return database.getVersions(uuid);
+ }
- /**
- * Retrieve an element in a specific version
- *
- * @param uuid
- * @param version
- * @return
- * @throws Exception
- */
- public MetaDataEntity getMetadata(String uuid, Version version)
- throws Exception {
- MetaDataEntity mde = database.getElement(uuid, version);
- return mde;
- }
+ /**
+ * Retrieve an element in a specific version
+ *
+ * @param uuid
+ * @param version
+ * @return
+ * @throws Exception
+ */
+ public MetaDataEntity getMetadata(String uuid, Version version)
+ throws Exception {
+ MetaDataEntity mde = database.getElement(uuid, version);
+ return mde;
+ }
- public InputStream retrieveData(MetaDataEntity entity, String field)
- throws Exception {
- InputStream result = attachmentHandler.retrieveData(entity, field);
- return result;
- }
+ public InputStream retrieveData(MetaDataEntity entity, String field)
+ throws Exception {
+ InputStream result = attachmentHandler.retrieveData(entity, field);
+ return result;
+ }
- public int findFullTextCount(String query) throws Exception {
- return database.findElementsByContentSearchCount(query);
- }
+ public int findFullTextCount(String query, boolean onlyLatest)
+ throws Exception {
+ return database.findElementsByContentSearchCount(query, onlyLatest);
+ }
- public MetaDataEntity[] findFullText(String query) throws Exception {
- MetaDataEntity[] result = database.findElementsByContentSearch(query)
- .toArray(new MetaDataEntity[0]);
- return result;
- }
+ public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
+ int indexStart, int count) throws Exception {
+ MetaDataEntity[] result = database.findElementsByContentSearch(query,
+ onlyLatest, indexStart, count).toArray(new MetaDataEntity[0]);
+ return result;
+ }
- public MetaDataEntity[] findFullText(String query, int indexStart, int count)
- throws Exception {
- MetaDataEntity[] result = database.findElementsByContentSearch(query,
- indexStart, count).toArray(new MetaDataEntity[0]);
- return result;
- }
+ public MetaDataEntity[] findElementsByType(String type, boolean onlyLatest,
+ int start, int count) throws Exception {
+ MetaDataEntity[] result = database.findElementsByType(type, onlyLatest,
+ start, count).toArray(new MetaDataEntity[0]);
+ return result;
+ }
- // Delete
+ public int findElementsByTypeCount(String type, boolean onlyLatest)
+ throws Exception {
+ return database.findElementsByTypeCount(type, onlyLatest);
+ }
- public void deleteElements(String uuid) throws Exception {
- List<Version> versions = getVersions(uuid);
- for (Version version : versions) {
- deleteElement(uuid, version);
- }
- }
+ // Delete
- 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()) {
- attachmentHandler.deleteData(element, entry.getKey());
- }
- database.deleteElement(element);
- }
+ public void deleteElements(String uuid) throws Exception {
+ List<Version> versions = getVersions(uuid);
+ for (Version version : versions) {
+ deleteElement(uuid, version);
+ }
+ }
- // Tools
+ 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()) {
+ attachmentHandler.deleteData(element, entry.getKey());
+ }
+ database.deleteElement(element);
+ }
- public String storeTempData(InputStream stream) throws Exception {
- String id = UUID.randomUUID().toString();
- attachmentHandler.storeData(mdTmp, id, stream);
- return id;
- }
+ // Tools
- public InputStream retrieveTempData(String id) throws Exception {
- InputStream is = attachmentHandler.retrieveData(mdTmp, id);
- return is;
- }
+ public String storeTempData(InputStream stream) throws Exception {
+ String id = UUID.randomUUID().toString();
+ attachmentHandler.storeData(mdTmp, id, stream);
+ return id;
+ }
- public void deleteTempData(String id) throws Exception {
- attachmentHandler.deleteData(mdTmp, id);
- }
+ public InputStream retrieveTempData(String id) throws Exception {
+ InputStream is = attachmentHandler.retrieveData(mdTmp, id);
+ return is;
+ }
+ public void deleteTempData(String id) throws Exception {
+ attachmentHandler.deleteData(mdTmp, id);
+ }
+
}
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/MetaDataEntity.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -1,13 +1,16 @@
package fr.cemagref.simexplorer.is.storage.entities.metadata;
+import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import fr.cemagref.simexplorer.is.storage.attachment.Content;
import fr.cemagref.simexplorer.is.storage.entities.BaseEntity;
-public class MetaDataEntity extends BaseEntity {
+public class MetaDataEntity extends BaseEntity implements Serializable {
+ private static final long serialVersionUID = -7916932464982315229L;
+
private String uuid;
private String name;
private String type;
@@ -21,6 +24,7 @@
private String parentDataVersion;
private String parentVersionUuid;
private String parentVersionVersion;
+ private boolean latest;
/**
* @return the uuid
@@ -217,4 +221,12 @@
this.parentVersionVersion = parentVersionVersion;
}
+ 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/entities/metadata/Version.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/Version.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/entities/metadata/Version.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -1,12 +1,14 @@
package fr.cemagref.simexplorer.is.storage.entities.metadata;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-public class Version implements Comparable<Version> {
+public class Version implements Comparable<Version>, Serializable {
- private List<Integer> pointedVersion;
+ private static final long serialVersionUID = 8982527036997002451L;
+ private List<Integer> pointedVersion;
public Version(String version) {
super();
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/BaseEntityFactory.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -79,8 +79,7 @@
}
}
- public Set<Element> getElementsByTagName(Element xmlElement,
- String tagName) {
+ public Set<Element> getElementsByTagName(Element xmlElement, String tagName) {
Set<Element> elements = new HashSet<Element>();
NodeList nodes = xmlElement.getChildNodes();
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/LoggableElementFactory.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -13,42 +13,14 @@
@Override
public E loadXMLElement(Element xmlElement) throws Exception {
E element = super.loadXMLElement(xmlElement);
- /*
- * element.setUuid(getProperty(xmlElement, KEY_UUID));
- * element.setName(getProperty(xmlElement, KEY_NAME));
- * element.setType(getProperty(xmlElement, KEY_TYPE));
- * element.setDescription(getProperty(xmlElement, KEY_DESCRIPTION));
- * element.setVersion(getProperty(xmlElement, KEY_VERSION));
- */
// FIXME Load metadata
- /*
- * element.setCreationDate(new Date(getProperty(xmlElement,
- * KEY_CREATIONDATE)));
- */
-
- // element.setHash(getProperty(xmlElement, KEY_HASH));
return element;
}
@Override
public void saveXMLElement(org.w3c.dom.Document document,
Element xmlElement, E element) throws Exception {
-
// FIXME save metadata
-
- /*
- * setProperty(document, xmlElement, KEY_UUID, element.getUuid());
- * setProperty(document, xmlElement, KEY_NAME, element.getName());
- * setProperty(document, xmlElement, KEY_TYPE, element.getType());
- * setProperty(document, xmlElement, KEY_DESCRIPTION, element
- * .getDescription()); setProperty(document, xmlElement, KEY_VERSION,
- * element.getVersion()); /* setProperty(document, xmlElement,
- * KEY_CREATIONDATE, element.getCreationDate());
- */
- /*
- * setProperty(document, xmlElement, KEY_HASH, element.getHash());
- */
-
}
}
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/MetaDataEntityFactory.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -13,93 +13,101 @@
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
public class MetaDataEntityFactory<E extends MetaDataEntity> extends
- BaseEntityFactory<MetaDataEntity> implements XmlConstants {
+ BaseEntityFactory<MetaDataEntity> implements XmlConstants {
- @Override
- public MetaDataEntity createInstance() {
- return new MetaDataEntity();
- }
+ @Override
+ public MetaDataEntity createInstance() {
+ return new MetaDataEntity();
+ }
- /*
- * (non-Javadoc)
- *
- * @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));
+ /*
+ * (non-Javadoc)
+ *
+ * @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));
- String creationDate = getProperty(xmlElement, KEY_METADATA_CREATIONDATE);
- if (creationDate != null) {
- long creationDateLong = new Long(creationDate);
- Date date = new Date(creationDateLong);
- entity.setCreationDate(date);
- }
+ String latestVersion = getProperty(xmlElement,
+ KEY_METADATA_LATESTVERSION);
+ if (latestVersion != null && "1".equals(latestVersion)) {
+ entity.setLatest(true);
+ } else {
+ entity.setLatest(false);
+ }
- entity.setHash(getProperty(xmlElement, KEY_METADATA_HASH));
- entity.setParentDataUuid(getProperty(xmlElement,
- KEY_METADATA_PARENTDATA_UUID));
- entity.setParentDataVersion(getProperty(xmlElement,
- KEY_METADATA_PARENTDATA_VERSION));
- entity.setParentVersionUuid(getProperty(xmlElement,
- KEY_METADATA_PARENTVERSION_UUID));
- entity.setParentVersionVersion(getProperty(xmlElement,
- KEY_METADATA_PARENTVERSION_VERSION));
+ String creationDate = getProperty(xmlElement, KEY_METADATA_CREATIONDATE);
+ if (creationDate != null) {
+ long creationDateLong = new Long(creationDate);
+ Date date = new Date(creationDateLong);
+ entity.setCreationDate(date);
+ }
- Map<String, String> descriptors = new HashMap<String, String>();
+ entity.setHash(getProperty(xmlElement, KEY_METADATA_HASH));
+ entity.setParentDataUuid(getProperty(xmlElement,
+ KEY_METADATA_PARENTDATA_UUID));
+ entity.setParentDataVersion(getProperty(xmlElement,
+ KEY_METADATA_PARENTDATA_VERSION));
+ entity.setParentVersionUuid(getProperty(xmlElement,
+ KEY_METADATA_PARENTVERSION_UUID));
+ entity.setParentVersionVersion(getProperty(xmlElement,
+ KEY_METADATA_PARENTVERSION_VERSION));
- Element descriptorsElement = getElementByTagName(xmlElement,
- KEY_METADATA_DESCRIPTORS);
- if (descriptorsElement != null) {
- Set<Element> descriptorElements = getElementsByTagName(
- descriptorsElement, KEY_METADATA_DESCRIPTOR);
- for (Element descriptorElement : descriptorElements) {
- String name = getProperty(descriptorElement,
- KEY_DESCRIPTOR_NAME);
- String value = getProperty(descriptorElement,
- KEY_DESCRIPTOR_VALUE);
- descriptors.put(name, value);
- }
- }
- entity.setDescriptors(descriptors);
+ Map<String, String> descriptors = new HashMap<String, String>();
- Map<String, Content> attachments = new HashMap<String, Content>();
+ Element descriptorsElement = getElementByTagName(xmlElement,
+ KEY_METADATA_DESCRIPTORS);
+ if (descriptorsElement != null) {
+ Set<Element> descriptorElements = getElementsByTagName(
+ descriptorsElement, KEY_METADATA_DESCRIPTOR);
+ for (Element descriptorElement : descriptorElements) {
+ String name = getProperty(descriptorElement,
+ KEY_DESCRIPTOR_NAME);
+ String value = getProperty(descriptorElement,
+ KEY_DESCRIPTOR_VALUE);
+ descriptors.put(name, value);
+ }
+ }
+ entity.setDescriptors(descriptors);
- Element attachmentsElement = getElementByTagName(xmlElement,
- KEY_METADATA_ATTACHMENTS);
- if (attachmentsElement != null) {
- Set<Element> attachmentElements = getElementsByTagName(
- 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);
- }
- }
+ Map<String, Content> attachments = new HashMap<String, Content>();
- entity.setAttachments(attachments);
+ Element attachmentsElement = getElementByTagName(xmlElement,
+ KEY_METADATA_ATTACHMENTS);
+ if (attachmentsElement != null) {
+ Set<Element> attachmentElements = getElementsByTagName(
+ 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);
+ }
+ }
- return entity;
- }
+ entity.setAttachments(attachments);
- @Override
- public void saveXMLElement(Document document, Element xmlElement,
- MetaDataEntity element) throws Exception {
- // TODO Auto-generated method stub
+ return entity;
+ }
- }
+ @Override
+ public void saveXMLElement(Document document, Element xmlElement,
+ MetaDataEntity element) throws Exception {
+ // TODO Auto-generated method stub
+ }
+
}
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/factories/XmlConstants.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -2,37 +2,39 @@
public interface XmlConstants {
- public static final String KEY_METADATA_UUID = "uuid";
- public static final String KEY_METADATA_VERSION = "version";
- public static final String KEY_METADATA_NAME = "name";
+ 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 = "EA";
+ 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_DESCRIPTION = "description";
- public static final String KEY_METADATA_CREATIONDATE = "creationdate";
- public static final String KEY_METADATA_HASH = "hash";
- public static final String KEY_METADATA_PARENTDATA_UUID = "parentdatauuid";
- public static final String KEY_METADATA_PARENTDATA_VERSION = "parentdataversion";
- public static final String KEY_METADATA_PARENTVERSION_UUID = "parentversionuuid";
- public static final String KEY_METADATA_PARENTVERSION_VERSION = "parentversionversion";
- public static final String KEY_METADATA_DESCRIPTORS = "descriptors";
- public static final String KEY_METADATA_DESCRIPTOR = "descriptor";
- public static final String KEY_METADATA_ATTACHMENTS = "attachments";
- public static final String KEY_METADATA_ATTACHMENT = "attachment";
+ public static final String KEY_METADATA_DESCRIPTION = "description";
+ public static final String KEY_METADATA_CREATIONDATE = "creationdate";
+ public static final String KEY_METADATA_HASH = "hash";
+ public static final String KEY_METADATA_PARENTDATA_UUID = "parentdatauuid";
+ public static final String KEY_METADATA_PARENTDATA_VERSION = "parentdataversion";
+ public static final String KEY_METADATA_PARENTVERSION_UUID = "parentversionuuid";
+ public static final String KEY_METADATA_PARENTVERSION_VERSION = "parentversionversion";
+ public static final String KEY_METADATA_DESCRIPTORS = "descriptors";
+ public static final String KEY_METADATA_DESCRIPTOR = "descriptor";
+ 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_DESCRIPTOR_NAME = "name";
+ public static final String KEY_DESCRIPTOR_VALUE = "value";
- public static final String KEY_ATTACHMENT_NAME = "name";
- public static final String KEY_ATTACHMENT_TYPE = "type";
+ public static final String KEY_ATTACHMENT_NAME = "name";
+ public static final String KEY_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 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";
+ 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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageService.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -11,29 +11,33 @@
@Remote
public interface StorageService {
- public void open() throws Exception;
+ public void open() throws Exception;
- public void close() throws Exception;
+ public void close() throws Exception;
- public void commit() throws Exception;
+ public void commit() throws Exception;
- public MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
- throws Exception;
+ public MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
+ throws Exception;
- public MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
- Map<String, RemoteInputStream> attachmentsRemoteStream)
- throws Exception;
+ public MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
+ Map<String, RemoteInputStream> attachmentsRemoteStream)
+ throws Exception;
- public MetaDataEntity getMetadata(String uuid) throws Exception;
+ public MetaDataEntity getMetadata(String uuid) throws Exception;
- public MetaDataEntity getMetadata(String uuid, String version)
- throws Exception;
+ public MetaDataEntity getMetadata(String uuid, String version)
+ throws Exception;
- public int findFullTextCount(String query) throws Exception;
+ public int findFullTextCount(String query, boolean onlyLatest)
+ throws Exception;
- public MetaDataEntity[] findFullText(String query) throws Exception;
+ public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
+ int indexStart, int count) throws Exception;
- public MetaDataEntity[] findFullText(String query, int indexStart, int count)
- throws Exception;
+ public int findApplicationsCount(boolean onlyLatest) throws Exception;
+ public MetaDataEntity[] findApplications(boolean onlyLatest, int start,
+ int count) 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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/service/StorageServiceImpl.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -33,238 +33,249 @@
@RemoteBinding(jndiBinding = "/ejb3/StorageService")
public class StorageServiceImpl implements StorageService, XmlConstants {
- private StorageEngine storageEngine;
+ private static StorageEngine storageEngine = null;
- private static final String KEY_XML = "_xml";
+ private static final String KEY_XML = "_xml";
- public StorageServiceImpl() {
- super();
- storageEngine = new StorageEngine();
- }
+ public StorageServiceImpl() {
+ super();
+ if (storageEngine == null) {
+ storageEngine = new StorageEngine();
+ }
+ }
- public void open() throws Exception {
- storageEngine.open();
- }
+ public void open() throws Exception {
+ storageEngine.open();
+ }
- public void close() throws Exception {
- storageEngine.close();
- }
+ public void close() throws Exception {
+ storageEngine.close();
+ }
- public void commit() throws Exception {
- storageEngine.commit();
- }
+ public void commit() throws Exception {
+ storageEngine.commit();
+ }
- public MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
- throws Exception {
- InputStream zipStream = RemoteInputStreamClient.wrap(zipRemoteStream);
- return saveElement(zipStream);
- }
+ public MetaDataEntity saveElement(RemoteInputStream zipRemoteStream)
+ throws Exception {
+ InputStream zipStream = RemoteInputStreamClient.wrap(zipRemoteStream);
+ return saveElement(zipStream);
+ }
- public MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
- Map<String, RemoteInputStream> attachmentsRemoteStream)
- throws Exception {
- InputStream xmlStream = RemoteInputStreamClient.wrap(xmlRemoteStream);
- Map<String, InputStream> attachmentStreams = new HashMap<String, InputStream>();
- for (Map.Entry<String, RemoteInputStream> entry : attachmentsRemoteStream
- .entrySet()) {
- InputStream stream = RemoteInputStreamClient.wrap(entry.getValue());
- attachmentStreams.put(entry.getKey(), stream);
- }
- return saveElement(xmlStream, attachmentStreams);
- }
+ public MetaDataEntity saveElement(RemoteInputStream xmlRemoteStream,
+ Map<String, RemoteInputStream> attachmentsRemoteStream)
+ throws Exception {
+ InputStream xmlStream = RemoteInputStreamClient.wrap(xmlRemoteStream);
+ Map<String, InputStream> attachmentStreams = new HashMap<String, InputStream>();
+ for (Map.Entry<String, RemoteInputStream> entry : attachmentsRemoteStream
+ .entrySet()) {
+ InputStream stream = RemoteInputStreamClient.wrap(entry.getValue());
+ attachmentStreams.put(entry.getKey(), stream);
+ }
+ return saveElement(xmlStream, attachmentStreams);
+ }
- public MetaDataEntity getMetadata(String uuid) throws Exception {
- return storageEngine.getMetadata(uuid);
- }
+ public MetaDataEntity getMetadata(String uuid) throws Exception {
+ return storageEngine.getMetadata(uuid);
+ }
- public MetaDataEntity getMetadata(String uuid, String version)
- throws Exception {
- return storageEngine.getMetadata(uuid, new Version(version));
- }
+ public MetaDataEntity getMetadata(String uuid, String version)
+ throws Exception {
+ return storageEngine.getMetadata(uuid, new Version(version));
+ }
- public MetaDataEntity[] findFullText(String query) throws Exception {
- return storageEngine.findFullText(query);
- }
+ public MetaDataEntity[] findFullText(String query, boolean onlyLatest,
+ int indexStart, int count) throws Exception {
+ return storageEngine.findFullText(query, onlyLatest, indexStart, count);
+ }
- public MetaDataEntity[] findFullText(String query, int indexStart, int count)
- throws Exception {
- return storageEngine.findFullText(query, indexStart, count);
- }
+ public int findFullTextCount(String query, boolean onlyLatest)
+ throws Exception {
+ return storageEngine.findFullTextCount(query, onlyLatest);
+ }
- public int findFullTextCount(String query) throws Exception {
- return storageEngine.findFullTextCount(query);
- }
+ public int findApplicationsCount(boolean onlyLatest) throws Exception {
+ return storageEngine.findElementsByTypeCount(
+ KEY_METADATA_TYPE_VALUE_EA, onlyLatest);
+ }
- private MetaDataEntity saveElement(InputStream zipStream) throws Exception {
- String xmlFile = null;
- Map<String, String> attachments = new HashMap<String, String>();
+ public MetaDataEntity[] findApplications(boolean onlyLatest, int start,
+ int count) throws Exception {
+ return storageEngine.findElementsByType(KEY_METADATA_TYPE_VALUE_EA,
+ onlyLatest, start, count);
+ }
- ZipInputStream zis = new ZipInputStream(zipStream);
+ private MetaDataEntity saveElement(InputStream zipStream) throws Exception {
+ String xmlFile = null;
+ Map<String, String> attachments = new HashMap<String, String>();
- ZipEntry entry;
- while ((entry = zis.getNextEntry()) != null) {
- if (!entry.isDirectory()) {
- String entryName = entry.getName();
- if (entryName.equals(FILE_XML)) {
- xmlFile = storageEngine.storeTempData(zis);
- } else {
- if (entryName.startsWith(FILE_DATA_PREFIX)) {
- String fileName = entryName.replace(FILE_DATA_PREFIX
- + "/", "");
- String idFile = storageEngine.storeTempData(zis);
- attachments.put(fileName, idFile);
- }
- }
- }
- }
+ ZipInputStream zis = new ZipInputStream(zipStream);
- return saveElement(xmlFile, attachments);
- }
+ ZipEntry entry;
+ while ((entry = zis.getNextEntry()) != null) {
+ if (!entry.isDirectory()) {
+ String entryName = entry.getName();
+ if (entryName.equals(FILE_XML)) {
+ xmlFile = storageEngine.storeTempData(zis);
+ } else {
+ if (entryName.startsWith(FILE_DATA_PREFIX)) {
+ String fileName = entryName.replace(FILE_DATA_PREFIX
+ + "/", "");
+ String idFile = storageEngine.storeTempData(zis);
+ attachments.put(fileName, idFile);
+ }
+ }
+ }
+ }
- private MetaDataEntity saveElement(InputStream xmlFile,
- Map<String, InputStream> attachments) throws Exception {
- // Store temporary data
- String idxml = storageEngine.storeTempData(xmlFile);
- Map<String, String> idsattachment = new HashMap<String, String>();
- for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
- String idattachment = storageEngine.storeTempData(entry.getValue());
- idsattachment.put(entry.getKey(), idattachment);
- }
- return saveElement(idxml, idsattachment);
- }
+ return saveElement(xmlFile, attachments);
+ }
- /**
- * Real implementation of saveElement
- *
- * @param idxml
- * @param idsattachment
- * @return
- * @throws Exception
- */
- private MetaDataEntity saveElement(String idxml,
- Map<String, String> idsattachment) throws Exception {
- // Load xml metadata
- MetaDataEntity metaData = MetaDataParser.parse(storageEngine
- .retrieveTempData(idxml));
+ private MetaDataEntity saveElement(InputStream xmlFile,
+ Map<String, InputStream> attachments) throws Exception {
+ // Store temporary data
+ String idxml = storageEngine.storeTempData(xmlFile);
+ Map<String, String> idsattachment = new HashMap<String, String>();
+ for (Map.Entry<String, InputStream> entry : attachments.entrySet()) {
+ String idattachment = storageEngine.storeTempData(entry.getValue());
+ idsattachment.put(entry.getKey(), idattachment);
+ }
+ return saveElement(idxml, idsattachment);
+ }
- String uuid = metaData.getUuid();
+ /**
+ * Real implementation of saveElement
+ *
+ * @param idxml
+ * @param idsattachment
+ * @return
+ * @throws Exception
+ */
+ private MetaDataEntity saveElement(String idxml,
+ Map<String, String> idsattachment) throws Exception {
+ // Load xml metadata
+ MetaDataEntity metaData = MetaDataParser.parse(storageEngine
+ .retrieveTempData(idxml));
- // If element is an EA, save inner Components and Data
+ String uuid = metaData.getUuid();
- 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[]>();
+ if (metaData.getType() != null
+ && metaData.getType().equals(KEY_METADATA_TYPE_VALUE_EA)) {
- // Retrieve elements
- extractChildren(idxml, idsattachment, components, explorationDatas);
+ List<String> components = new ArrayList<String>();
+ List<String[]> explorationDatas = new ArrayList<String[]>();
- // For each exploration data
- for (String[] explorationData : explorationDatas) {
- // where is stored xml
- String idxmlED = explorationData[0];
+ // Retrieve elements
+ extractChildren(idxml, idsattachment, components, explorationDatas);
- // where is stored result
- Map<String, String> attachmentsED = new HashMap<String, String>();
- if (explorationData.length > 1) {
- attachmentsED.put(explorationData[1], idsattachment
- .get(explorationData[1]));
- }
- // recursive save
- saveElement(idxmlED, attachmentsED);
+ // For each exploration data
+ for (String[] explorationData : explorationDatas) {
+ // where is stored xml
+ String idxmlED = explorationData[0];
- }
+ // where is stored result
+ Map<String, String> attachmentsED = new HashMap<String, String>();
+ if (explorationData.length > 1) {
+ attachmentsED.put(explorationData[1], idsattachment
+ .get(explorationData[1]));
+ }
+ // recursive save
+ saveElement(idxmlED, attachmentsED);
- // For each component
- for (String idComponent : components) {
- saveElement(idComponent, new HashMap<String, String>());
- }
+ }
- // Don't save any file for an EA
- idsattachment = new HashMap<String, String>();
+ // For each component
+ for (String idComponent : components) {
+ saveElement(idComponent, new HashMap<String, String>());
+ }
- }
+ // Don't save any file for an EA
+ idsattachment = new HashMap<String, String>();
- // Check existing version in storage
- MetaDataEntity previousVersion = storageEngine.getMetadata(uuid,
- metaData.getVersion());
- /*
- * MetaDataEntity parentData = storageEngine.getElementVersion(metaData
- * .getParentData().getUuid(), metaData.getParentData() .getVersion());
- * MetaDataEntity parentVersion =
- * storageEngine.getElementVersion(metaData
- * .getParentVersion().getUuid(), metaData.getParentVersion()
- * .getVersion());
- */
+ }
- // Version rules
- if (previousVersion != null) {
- /*
- * metaData.setParentVersion(storageEngine.getElementVersion(uuid,
- * previousVersion.getVersion()));
- */
- metaData.setVersion(previousVersion.getVersion().incVersion(0)
- .toString());
- }
+ // Check existing version in storage
+ MetaDataEntity previousVersion = storageEngine.getMetadata(uuid,
+ metaData.getVersion());
+ /*
+ * MetaDataEntity parentData = storageEngine.getElementVersion(metaData
+ * .getParentData().getUuid(), metaData.getParentData() .getVersion());
+ * MetaDataEntity parentVersion =
+ * storageEngine.getElementVersion(metaData
+ * .getParentVersion().getUuid(), metaData.getParentVersion()
+ * .getVersion());
+ */
- // Prepare saving
- Map<String, InputStream> attachments = new HashMap<String, InputStream>();
+ // Version rules
+ if (previousVersion != null) {
+ /*
+ * metaData.setParentVersion(storageEngine.getElementVersion(uuid,
+ * previousVersion.getVersion()));
+ */
+ metaData.setVersion(previousVersion.getVersion().incVersion(0)
+ .toString());
+ }
- 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);
+ // Prepare saving
+ Map<String, InputStream> attachments = new HashMap<String, InputStream>();
- return metaData;
- }
+ 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();
- 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");
+ return metaData;
+ }
- Document document = BaseEntityFactory.getBuilder().parse(
- storageEngine.retrieveTempData(idxml));
+ 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");
- Element rootElement = (Element) document.getFirstChild();
+ Document document = BaseEntityFactory.getBuilder().parse(
+ storageEngine.retrieveTempData(idxml));
- // Components
- Set<Element> componentElements = elementFactory.getElementsByTagName(
- rootElement, KEY_COMPONENT);
- for (Element element : componentElements) {
- components.add(storageEngine.storeTempData(Parser
- .serializeElement(element)));
- }
+ Element rootElement = (Element) document.getFirstChild();
- Set<Element> applicationDataElements = elementFactory
- .getElementsByTagName(rootElement, KEY_ED);
- for (Element elementAD : applicationDataElements) {
+ // Components
+ Set<Element> componentElements = elementFactory.getElementsByTagName(
+ rootElement, KEY_COMPONENT);
+ for (Element element : componentElements) {
+ components.add(storageEngine.storeTempData(Parser
+ .serializeElement(element)));
+ }
- Element element = elementFactory.getElementByTagName(elementAD,
- KEY_RESULT);
- String result = elementFactory.getProperty(element, KEY_FILE);
+ Set<Element> applicationDataElements = elementFactory
+ .getElementsByTagName(rootElement, KEY_ED);
+ for (Element elementAD : applicationDataElements) {
- String[] explorationDataArray = null;
- if (result != null) {
- explorationDataArray = new String[2];
- explorationDataArray[1] = result;
- } else {
- explorationDataArray = new String[1];
- }
- explorationDataArray[0] = storageEngine.storeTempData(Parser
- .serializeElement(elementAD));
+ Element element = elementFactory.getElementByTagName(elementAD,
+ KEY_RESULT);
+ String result = elementFactory.getProperty(element, KEY_FILE);
- }
+ String[] explorationDataArray = null;
+ if (result != null) {
+ explorationDataArray = new String[2];
+ explorationDataArray[1] = result;
+ } else {
+ explorationDataArray = new String[1];
+ }
+ explorationDataArray[0] = storageEngine.storeTempData(Parser
+ .serializeElement(elementAD));
- }
+ }
- /*
- * public MetaDataEntity loadElement(String idxml, Map<String, String>
- * idsattachment) throws Exception { }
- */
+ }
+ /*
+ * public MetaDataEntity loadElement(String idxml, Map<String, String>
+ * idsattachment) throws Exception { }
+ */
+
}
Modified: trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/xml/MetaDataParser.java
===================================================================
--- trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/xml/MetaDataParser.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/java/fr/cemagref/simexplorer/is/storage/xml/MetaDataParser.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -13,28 +13,28 @@
public class MetaDataParser extends Parser {
- private static String KEY_METADATA = "metadata";
+ private static String KEY_METADATA = "metadata";
- private static String KEY_UUID = "uuid";
- private static String KEY_VERSION = "version";
+ private static String KEY_UUID = "uuid";
+ private static String KEY_VERSION = "version";
- public static MetaDataEntity parse(InputStream xmlStream) throws Exception {
- MetaDataEntityFactory<MetaDataEntity> elementFactory = (MetaDataEntityFactory) BaseEntityFactory
- .getFactory(MetaDataEntity.class);
+ public static MetaDataEntity parse(InputStream xmlStream) throws Exception {
+ MetaDataEntityFactory<MetaDataEntity> elementFactory = (MetaDataEntityFactory) BaseEntityFactory
+ .getFactory(MetaDataEntity.class);
- Document document = elementFactory.getBuilder().parse(xmlStream);
- Element rootElement = (Element) document.getFirstChild();
- Element metadataElement = elementFactory.getElementByTagName(
- rootElement, KEY_METADATA);
+ Document document = elementFactory.getBuilder().parse(xmlStream);
+ Element rootElement = (Element) document.getFirstChild();
+ Element metadataElement = elementFactory.getElementByTagName(
+ rootElement, KEY_METADATA);
- MetaDataEntity metaData = elementFactory
- .loadXMLElement(metadataElement);
- return metaData;
- }
+ MetaDataEntity metaData = elementFactory
+ .loadXMLElement(metadataElement);
+ return metaData;
+ }
- public static void save(Document document, Element xmlElement,
- MetaDataEntity element) throws Exception {
+ public static void save(Document document, Element xmlElement,
+ MetaDataEntity element) 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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/ElementGenerator.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -35,6 +35,7 @@
metaData.setVersion(Integer.toString(r.nextInt(100)));
metaData.setCreationDate(new Date(r.nextLong()));
metaData.setHash(UUID.randomUUID().toString());
+ metaData.setLatest(true);
Map<String, String> descriptors = new HashMap<String, String>();
int i = 5 + r.nextInt(10);
@@ -52,7 +53,8 @@
Set<T> elements = new HashSet<T>();
int i = 1 + r.nextInt(2);
for (int j = 0; j < i; j++) {
- T element = (T) BaseEntityFactory.getFactory(clazz).createInstance();
+ T element = (T) BaseEntityFactory.getFactory(clazz)
+ .createInstance();
if (element instanceof LoggableElement) {
update((LoggableElement) element);
}
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseLoadTestCase.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -139,14 +139,14 @@
for (int i = 0; i < csearch; i++) {
String key = randomstrings[r.nextInt(randomstrings.length)] + "*";
- int count = database.findElementsByContentSearchCount(key);
+ int count = database.findElementsByContentSearchCount(key, false);
System.out.println(key + " : " + count);
int start = count / 2;
int length = Math.min(200, Math.min(count, Math.max(1, count / 4)));
Set<MetaDataEntity> metaDatas = database
- .findElementsByContentSearch(key, start, length);
+ .findElementsByContentSearch(key, false, start, length);
System.out.println(key + " (" + start + " " + length + ") : "
+ metaDatas.size());
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseTestCase.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseTestCase.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseTestCase.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -58,14 +58,14 @@
List<Reader> readers = new ArrayList<Reader>();
readers.add(reader);
-
+
database.insertElement(me, readers);
database.commit();
- Set<MetaDataEntity> mes = database
- .findElementsByContentSearch(keyphrase);
+ int mesCount = database.findElementsByContentSearchCount(keyphrase,
+ true);
- assertEquals(1, mes.size());
+ assertEquals(1, mesCount);
}
public void testGetVersions() throws Exception {
@@ -74,7 +74,7 @@
database.insertElement(mes[i], new ArrayList<Reader>());
}
database.commit();
-
+
List<Version> versions = database.getVersions(mes[0].getUuid());
assertEquals(mes.length, versions.size());
Collections.sort(versions);
@@ -92,7 +92,7 @@
database.commit();
Set<MetaDataEntity> elements = database.findElementsById(mes[0]
- .getUuid());
+ .getUuid(), false);
assertEquals(elements.size(), mes.length);
}
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThread.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThread.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThread.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -3,6 +3,7 @@
import java.io.Reader;
import java.util.ArrayList;
import java.util.Random;
+import java.util.Set;
import fr.cemagref.simexplorer.is.storage.database.Database;
import fr.cemagref.simexplorer.is.storage.entities.metadata.MetaDataEntity;
@@ -52,8 +53,8 @@
}
private void searchElements(String id) throws Exception {
- MetaDataEntity mde = database.getElementLatestVersion(id);
- if (mde == null) {
+ Set<MetaDataEntity> mde = database.findElementsById(id, true);
+ if (mde.isEmpty()) {
System.err.println(idThreadLucene + " - " + id);
}
}
@@ -69,16 +70,11 @@
for (int i = 0; i < mes.length; i++) {
mes[i].setParentDataUuid(Integer.toString(idThreadLucene));
database.insertElement(mes[i], new ArrayList<Reader>());
- /*
- System.out.println(idThreadLucene + " - " + ipass + " - " + j
- + " - " + i);
- */
id = mes[i].getUuid();
}
}
System.out.print(idThreadLucene + " ");
database.commit();
- //sleep(1000);
return id;
}
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThreadsTestCase.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThreadsTestCase.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneDatabaseThreadsTestCase.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -22,7 +22,7 @@
public void testLuceneDatabaseThreads() throws Exception {
int nthreads = 10;
-
+
LuceneDatabaseThread[] threads = new LuceneDatabaseThread[nthreads];
for (int i = 0; i < threads.length; i++) {
threads[i] = new LuceneDatabaseThread();
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneSimpleTest.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneSimpleTest.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/LuceneSimpleTest.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -17,6 +17,17 @@
public class LuceneSimpleTest extends TestCase {
+ /*
+ * public void testSearch() throws Exception { Searcher searcher; searcher =
+ * new IndexSearcher("/home/landais/lucene/index.big"); Query query = new
+ * TermQuery(new Term("simexplorer.type", "LuceneDatabaseTestCase"));
+ *
+ * Sort sort = new Sort("simexplorer.creationdate", true); Hits hits =
+ * searcher.search(query, sort); for (int i = 0; i < 50; i++) { Document doc =
+ * hits.doc(i); System.out.println(doc.get("simexplorer.creationdate")); }
+ * System.out.println(hits.length()); }
+ */
+
public void testLuceneSimple() throws Exception {
IndexWriter writer;
@@ -56,6 +67,6 @@
System.out.println(searcher.search(query).length());
searcher = new IndexSearcher(indexDir);
System.out.println(searcher.search(query).length());
+ }
- }
}
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 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/MetaDataGenerator.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -40,7 +40,9 @@
if (parentVersion != null) {
me.setParentVersionUuid(parentVersion.getUuid());
me.setParentVersionVersion(parentVersion.getVersion().toString());
+ parentVersion.setLatest(false);
}
+ me.setLatest(true);
return me;
}
@@ -53,6 +55,7 @@
me.setType("LuceneDatabaseTestCase");
me.setDescription(uuid + " " + version.toString());
me.setVersion(version.toString());
+ me.setLatest(true);
me.setCreationDate(new Date());
me.setHash(UUID.randomUUID().toString());
Modified: trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceTest.java
===================================================================
--- trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceTest.java 2007-12-24 12:11:45 UTC (rev 87)
+++ trunk/simexplorer-si-storage/src/test/fr/cemagref/simexplorer/is/storage/test/service/StorageServiceTest.java 2007-12-26 16:30:11 UTC (rev 88)
@@ -119,7 +119,7 @@
storageService.commit();
assertNotNull(storageService.getMetadata(id));
for (int i = 0; i < randomcontent.length; i++) {
- assertTrue(storageService.findFullTextCount(randomcontent[i]) > 0);
+ assertTrue(storageService.findFullTextCount(randomcontent[i], false) > 0);
}
}
1
0
r87 - in trunk/simexplorer-is-web/src/ressources: . fr fr/cemagref fr/cemagref/simexplorer fr/cemagref/simexplorer/is fr/cemagref/simexplorer/is/ui fr/cemagref/simexplorer/is/ui/web fr/cemagref/simexplorer/is/ui/web/pages
by glandais@users.labs.libre-entreprise.org 24 Dec '07
by glandais@users.labs.libre-entreprise.org 24 Dec '07
24 Dec '07
Author: glandais
Date: 2007-12-24 12:11:45 +0000 (Mon, 24 Dec 2007)
New Revision: 87
Added:
trunk/simexplorer-is-web/src/ressources/fr/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/
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/ApplicationExport.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/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties
trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties
Log:
Mise en place pages
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.properties
===================================================================
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.properties
===================================================================
Added: 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 (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -0,0 +1,2 @@
+windowtitle=Import
+upload=Upload
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.properties
===================================================================
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -0,0 +1,3 @@
+name=Name
+cancel=Cancel
+submit=Submit
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -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/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -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/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/Layout_fr.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -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/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -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/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties
===================================================================
--- trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties (rev 0)
+++ trunk/simexplorer-is-web/src/ressources/fr/cemagref/simexplorer/is/ui/web/pages/UserList.properties 2007-12-24 12:11:45 UTC (rev 87)
@@ -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
1
0
24 Dec '07
Author: glandais
Date: 2007-12-24 12:05:03 +0000 (Mon, 24 Dec 2007)
New Revision: 86
Removed:
trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs
Log:
Deleted: trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs 2007-12-24 12:01:17 UTC (rev 85)
+++ trunk/simexplorer-si-storage/.settings/org.eclipse.jst.common.project.facet.core.prefs 2007-12-24 12:05:03 UTC (rev 86)
@@ -1,4 +0,0 @@
-#Wed Dec 19 15:38:25 CET 2007
-classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
-classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.generic.runtimeTarget\:\:JBoss\ v4.2/owners=jst.ejb\:3.0
-eclipse.preferences.version=1
1
0
24 Dec '07
Author: glandais
Date: 2007-12-24 12:01:17 +0000 (Mon, 24 Dec 2007)
New Revision: 85
Added:
trunk/simexplorer-is-web/src/ressources/
Log:
1
0
r84 - in trunk/simexplorer-is-web: . src src/webcontent src/webcontent/META-INF src/webcontent/WEB-INF src/webcontent/css src/webcontent/images src/webcontent/images/tree src/webcontent/js src/xmi
by glandais@users.labs.libre-entreprise.org 24 Dec '07
by glandais@users.labs.libre-entreprise.org 24 Dec '07
24 Dec '07
Author: glandais
Date: 2007-12-24 11:57:20 +0000 (Mon, 24 Dec 2007)
New Revision: 84
Added:
trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationExport.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml
trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
trunk/simexplorer-is-web/src/webcontent/GroupEdit.tml
trunk/simexplorer-is-web/src/webcontent/GroupList.tml
trunk/simexplorer-is-web/src/webcontent/Layout.tml
trunk/simexplorer-is-web/src/webcontent/UserEdit.tml
trunk/simexplorer-is-web/src/webcontent/UserList.tml
trunk/simexplorer-is-web/src/webcontent/css/
trunk/simexplorer-is-web/src/webcontent/css/dftree.css
trunk/simexplorer-is-web/src/webcontent/css/general.css
trunk/simexplorer-is-web/src/webcontent/css/layout.css
trunk/simexplorer-is-web/src/webcontent/images/
trunk/simexplorer-is-web/src/webcontent/images/lutin.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_base.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_cd.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_empty.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_felamimail_sm.png
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folder.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folderopen.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_globe.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_imgfolder.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_join.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_joinbottom.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_line.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minus.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minusbottom.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_musicfolder.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_minus.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_plus.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_page.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plus.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plusbottom.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_question.gif
trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_trash.gif
trunk/simexplorer-is-web/src/webcontent/js/
trunk/simexplorer-is-web/src/webcontent/js/dftree.js
trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js
trunk/simexplorer-is-web/src/xmi/
trunk/simexplorer-is-web/src/xmi/simexplorer-is-web.zargo
Modified:
trunk/simexplorer-is-web/.classpath
trunk/simexplorer-is-web/.project
trunk/simexplorer-is-web/pom.xml
trunk/simexplorer-is-web/src/webcontent/META-INF/MANIFEST.MF
trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
Log:
Mise en place pages
Modified: trunk/simexplorer-is-web/.classpath
===================================================================
--- trunk/simexplorer-is-web/.classpath 2007-12-24 11:57:01 UTC (rev 83)
+++ trunk/simexplorer-is-web/.classpath 2007-12-24 11:57:20 UTC (rev 84)
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="target/gen/java"/>
<classpathentry kind="src" path="src/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.generic.runtimeTarget/JBoss v4.2"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_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-storage"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: trunk/simexplorer-is-web/.project
===================================================================
--- trunk/simexplorer-is-web/.project 2007-12-24 11:57:01 UTC (rev 83)
+++ trunk/simexplorer-is-web/.project 2007-12-24 11:57:20 UTC (rev 84)
@@ -25,12 +25,18 @@
<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.eclipse.wst.common.project.facet.core.nature</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>
Modified: trunk/simexplorer-is-web/pom.xml
===================================================================
--- trunk/simexplorer-is-web/pom.xml 2007-12-24 11:57:01 UTC (rev 83)
+++ trunk/simexplorer-is-web/pom.xml 2007-12-24 11:57:20 UTC (rev 84)
@@ -1,16 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<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.6</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>
</dependencies>
</project>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationDetail.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/ApplicationExport.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationExport.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationExport.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/ApplicationImport.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationImport.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,11 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <t:form>
+ <t:errors/>
+ <input t:type="upload" t:id="file" validate="required"/>
+ <br/>
+ <input type="submit" value="${message:upload}"/>
+ </t:form>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/ApplicationList.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,15 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
+ title="message:windowtitle">
+
+ <div id="dftree_tree">
+ </div>
+ <a t:type="ActionLink" t:id="edit">Details</a>
+ <a t:type="ActionLink" t:id="create">Create</a>
+ <a t:type="ActionLink" t:id="delete">Delete</a>
+
+
+<script>
+initTree();
+</script>
+
+</t:layout>
Added: trunk/simexplorer-is-web/src/webcontent/GroupEdit.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/GroupEdit.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/GroupEdit.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/GroupList.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/GroupList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/GroupList.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/Layout.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/Layout.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/Layout.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,66 @@
+<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}" />
+ <script type="text/javascript" src="${prop:javascriptTree}"></script>
+ <script type="text/javascript" src="${prop:javascriptFolder}treeLoader.js"></script>
+ <script type="text/javascript" src="${prop:javascriptFolder}dwr/engine.js"></script>
+ <script type="text/javascript" src="${prop:javascriptFolder}dwr/interface/TreeData.js"></script>
+
+ </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
Modified: trunk/simexplorer-is-web/src/webcontent/META-INF/MANIFEST.MF
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/META-INF/MANIFEST.MF 2007-12-24 11:57:01 UTC (rev 83)
+++ trunk/simexplorer-is-web/src/webcontent/META-INF/MANIFEST.MF 2007-12-24 11:57:20 UTC (rev 84)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path:
Added: trunk/simexplorer-is-web/src/webcontent/UserEdit.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/UserEdit.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/UserEdit.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/UserList.tml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/UserList.tml (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/UserList.tml 2007-12-24 11:57:20 UTC (rev 84)
@@ -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>
Modified: trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-24 11:57:01 UTC (rev 83)
+++ trunk/simexplorer-is-web/src/webcontent/WEB-INF/web.xml 2007-12-24 11:57:20 UTC (rev 84)
@@ -1,12 +1,33 @@
<?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_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
- <display-name>simexplorer-is-web</display-name>
- <listener>
- <listener-class>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID" version="2.5">
+
+ <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>
+
+ <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>
+ </listener>
+
+ <welcome-file-list>
+ <welcome-file>ApplicationList</welcome-file>
+ </welcome-file-list>
</web-app>
\ No newline at end of file
Added: trunk/simexplorer-is-web/src/webcontent/css/dftree.css
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/css/dftree.css (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/css/dftree.css 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,64 @@
+
+.son {
+ position: relative;
+ left: 10px;
+}
+
+
+.plus {
+ font-size: 15px;
+ font-weight: bold;
+ cursor: pointer;
+ cursor: hand;
+ color: #000000;
+ font-family: monospace;
+}
+
+.plus:hover {
+ color: #FF0000;
+}
+
+.opened {
+ display: block;
+}
+
+.closed {
+ display: none;
+}
+
+/* link */
+.l {
+ padding: 2px;
+ font-weight: bold;
+ font-size: 12px;
+ color: #666666;
+ text-decoration: none;
+ cursor: pointer;
+ cursor: hand;
+ white-space: nowrap;
+ font-family: sans-serif;
+}
+
+.l:hover {
+ text-decoration: underline;
+}
+
+
+/* selected link */
+.sl {
+ padding: 2px;
+ font-weight: bold;
+ font-size: 12px;
+ color: #0000FF;
+ text-decoration: none;
+ cursor: pointer;
+ cursor: hand;
+ white-space: nowrap;
+ font-family: sans-serif;
+}
+
+.sl:hover {
+ text-decoration: underline;
+}
+
+
Added: trunk/simexplorer-is-web/src/webcontent/css/general.css
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/css/general.css (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/css/general.css 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,383 @@
+/***************************** 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;
+}
+
Added: trunk/simexplorer-is-web/src/webcontent/css/layout.css
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/css/layout.css (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/css/layout.css 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,155 @@
+/* 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;
+}
Added: trunk/simexplorer-is-web/src/webcontent/images/lutin.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/lutin.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_base.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_base.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_cd.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_cd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_empty.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_empty.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_felamimail_sm.png
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_felamimail_sm.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folder.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folder.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folderopen.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_folderopen.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_globe.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_globe.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_imgfolder.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_imgfolder.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_join.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_join.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_joinbottom.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_joinbottom.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_line.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minus.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minusbottom.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_minusbottom.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_musicfolder.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_musicfolder.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_minus.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_minus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_plus.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_nolines_plus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_page.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_page.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plus.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plus.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plusbottom.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_plusbottom.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_question.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_question.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_trash.gif
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/webcontent/images/tree/foldertree_trash.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/simexplorer-is-web/src/webcontent/js/dftree.js
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/js/dftree.js (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/js/dftree.js 2007-12-24 11:57:20 UTC (rev 84)
@@ -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/webcontent/js/treeLoader.js
===================================================================
--- trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js (rev 0)
+++ trunk/simexplorer-is-web/src/webcontent/js/treeLoader.js 2007-12-24 11:57:20 UTC (rev 84)
@@ -0,0 +1,69 @@
+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/src/xmi/simexplorer-is-web.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/simexplorer-is-web/src/xmi/simexplorer-is-web.zargo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
r83 - in trunk/simexplorer-is-web: .settings src/java/fr/cemagref/simexplorer/is/ui/web src/java/fr/cemagref/simexplorer/is/ui/web/pages
by glandais@users.labs.libre-entreprise.org 24 Dec '07
by glandais@users.labs.libre-entreprise.org 24 Dec '07
24 Dec '07
Author: glandais
Date: 2007-12-24 11:57:01 +0000 (Mon, 24 Dec 2007)
New Revision: 83
Added:
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/
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/ApplicationExport.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
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/GroupEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
Modified:
trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs
trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
Log:
Mise en place pages
Modified: trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs 2007-12-24 11:54:23 UTC (rev 82)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.jdt.core.prefs 2007-12-24 11:57:01 UTC (rev 83)
@@ -1,4 +1,4 @@
-#Thu Dec 20 16:13:09 CET 2007
+#Fri Dec 21 11:22:46 CET 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
Modified: trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-24 11:54:23 UTC (rev 82)
+++ trunk/simexplorer-is-web/.settings/org.eclipse.wst.common.component 2007-12-24 11:57:01 UTC (rev 83)
@@ -2,6 +2,7 @@
<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"/>
<property name="context-root" value="simexplorer-is"/>
<property name="java-output-path" value="build/classes"/>
Added: 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 (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationDetail.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,13 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+
+public class ApplicationDetail extends AbstractApplicationDetail {
+
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationExport.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,13 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+
+public class ApplicationExport extends AbstractApplicationExport {
+
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationImport.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,32 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.upload.services.UploadedFile;
+
+
+public class ApplicationImport extends AbstractApplicationImport {
+
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+ private UploadedFile _file;
+
+ public UploadedFile getFile()
+ {
+ return _file;
+ }
+
+ public void setFile(UploadedFile file)
+ {
+ _file = file;
+ }
+
+ public void onSuccess()
+ {
+ //File copied = new File("/my/file/location/" + _file.getFileName());
+ //_file.write(copied);
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ApplicationList.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,12 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+public class ApplicationList extends AbstractApplicationList {
+
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupEdit.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,21 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.Persist;
+
+
+public class GroupEdit extends AbstractGroupEdit {
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+ @Persist
+ private int groupId;
+
+ void onActivate(int groupId) {
+ this.groupId = groupId;
+ this.onActivate();
+ }
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/GroupList.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,12 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+
+public class GroupList extends AbstractGroupList {
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Layout.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,132 @@
+/* *##%
+ * 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.pages;
+
+import java.util.Locale;
+
+import org.apache.tapestry.Asset;
+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;
+
+
+
+/**
+ * AbstractPage.java
+ *
+ * @author chatellier
+ * @version $Revision: 1.1 $
+ *
+ * Last update : $Date: 2007/05/14 07:56:43 $ By : $Author: E023931M $
+ */
+public class Layout {
+
+ /* linked state "UserList" */
+ @InjectPage
+ private UserList userList;
+
+ /**
+ * page title
+ */
+ @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;
+
+ @Inject
+ @Path("context:js/dftree.js")
+ private Asset javascriptTree;
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set default title
+ */
+ void getDefaultTitle() {
+ title = "";
+ }
+
+ /**
+ * @return the _stylesheetGeneral
+ */
+ public Asset getStylesheetGeneral() {
+ return _stylesheetGeneral;
+ }
+
+ /**
+ * @return the _stylesheetLayout
+ */
+ public Asset getStylesheetLayout() {
+ return _stylesheetLayout;
+ }
+
+ @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;
+ }
+
+ public Asset getStylesheetTree() {
+ return stylesheetTree;
+ }
+
+ public Asset getJavascriptTree() {
+ return javascriptTree;
+ }
+
+ public String getJavascriptFolder() {
+ return javascriptTree.toClientURL().replace("dftree.js", "");
+ }
+
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserEdit.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,21 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+import org.apache.tapestry.annotations.Persist;
+
+
+public class UserEdit extends AbstractUserEdit {
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+ @Persist
+ private int userId;
+
+ void onActivate(int userId) {
+ this.userId = userId;
+ this.onActivate();
+ }
+
+}
Added: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java
===================================================================
--- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java (rev 0)
+++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/UserList.java 2007-12-24 11:57:01 UTC (rev 83)
@@ -0,0 +1,12 @@
+package fr.cemagref.simexplorer.is.ui.web.pages;
+
+import org.apache.tapestry.annotations.Component;
+
+
+public class UserList extends AbstractUserList {
+ /** layout */
+ @SuppressWarnings("unused")
+ @Component
+ private Layout layout;
+
+}
1
0