Cantharella-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
February 2013
- 3 participants
- 101 discussions
r116 - in trunk: cantharella.data/src/main/java/nc/ird/cantharella/data/model cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors cantharella.web/src/main/webapp/js
by echatellier@users.forge.codelutin.com 15 Feb '13
by echatellier@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: echatellier
Date: 2013-02-15 15:39:31 +0100 (Fri, 15 Feb 2013)
New Revision: 116
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/116
Log:
Display both mol?\195?\169cule and personne organisms
Modified:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
trunk/cantharella.web/src/main/webapp/js/moleditor.js
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java 2013-02-15 11:49:11 UTC (rev 115)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java 2013-02-15 14:39:31 UTC (rev 116)
@@ -23,6 +23,7 @@
package nc.ird.cantharella.data.model;
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
@@ -148,6 +149,14 @@
private List<Document> documents;
/**
+ * Constructor.
+ */
+ public Molecule() {
+ provenances = new ArrayList<MoleculeProvenance>();
+ documents = new ArrayList<Document>();
+ }
+
+ /**
* Id molecule getter.
*
* @return the idMolecule
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-02-15 11:49:11 UTC (rev 115)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-02-15 14:39:31 UTC (rev 116)
@@ -23,10 +23,14 @@
package nc.ird.cantharella.service.services.impl;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import nc.ird.cantharella.data.dao.GenericDao;
import nc.ird.cantharella.data.dao.impl.MoleculeDao;
+import nc.ird.cantharella.data.dao.impl.PersonneDao;
import nc.ird.cantharella.data.exceptions.DataConstraintException;
import nc.ird.cantharella.data.exceptions.DataNotFoundException;
import nc.ird.cantharella.data.exceptions.UnexpectedException;
@@ -129,7 +133,7 @@
result.add(new MoleculeProvenanceBean(molecule));
}
}
-
+
return result;
}
@@ -163,7 +167,13 @@
@SuppressWarnings("unchecked")
@Override
public List<String> listMoleculeOrganisme() {
- return (List<String>) dao.list(MoleculeDao.CRITERIA_DISTINCT_MOLECULE_ORGANISMES);
+ Set<String> organismes = new HashSet<String>();
+ organismes.addAll((List<String>)dao.list(MoleculeDao.CRITERIA_DISTINCT_MOLECULE_ORGANISMES));
+ organismes.addAll((List<String>)dao.list(PersonneDao.CRITERIA_DISTINCT_PERSONNE_ORGANISMES));
+ List<String> result = new ArrayList<String>(organismes);
+ result.remove(null); // fix NPE on sort
+ Collections.sort(result);
+ return result;
}
/** {@inheritDoc} */
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-15 11:49:11 UTC (rev 115)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-15 14:39:31 UTC (rev 116)
@@ -57,7 +57,11 @@
protected String newValue(String currentValue, String replacementValue) {
// on ajoute toujours un premier caractere pour oblige l'existance de
// l'attribut car sinon si formula est vide l'attribut n'est pas ajoute
- return "." + replacementValue;
+ String result = ".";
+ if (replacementValue != null) {
+ result += replacementValue;
+ }
+ return result;
}
/** {@inheritDoc} */
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-15 11:49:11 UTC (rev 115)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-15 14:39:31 UTC (rev 116)
@@ -76,7 +76,11 @@
protected String newValue(String currentValue, String replacementValue) {
// on ajoute toujours un premier caractere pour oblige l'existance de
// l'attribut car sinon si formula est vide le l'attribut n'est pas ajoute
- return "." + replacementValue;
+ String result = ".";
+ if (replacementValue != null) {
+ result += replacementValue;
+ }
+ return result;
}
/** {@inheritDoc} */
Modified: trunk/cantharella.web/src/main/webapp/js/moleditor.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/js/moleditor.js 2013-02-15 11:49:11 UTC (rev 115)
+++ trunk/cantharella.web/src/main/webapp/js/moleditor.js 2013-02-15 14:39:31 UTC (rev 116)
@@ -21,7 +21,7 @@
* #L%
*/
function addEditorMolecule(tagId) {
- if (tagId) {
+ if (tagId) {
tagId = '#' + tagId.replace( /(:|\.)/g, "\\$1" );
} else {
tagId = '[formula]';
1
0
15 Feb '13
Author: echatellier
Date: 2013-02-15 12:49:11 +0100 (Fri, 15 Feb 2013)
New Revision: 115
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/115
Log:
Merge search page data table will listXXXPage data table (unique definition)
use wicket 6.2+ data table export toolbar for csv export
Added:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ExtraitsColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/TableExportToolbar.java
Removed:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/CsvWriter.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/links/
Modified:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ProduitDao.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/DocumentService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java
trunk/cantharella.web/src/main/resources/web_en.properties
trunk/cantharella.web/src/main/resources/web_fr.properties
trunk/cantharella.web/src/main/webapp/css/general.css
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -40,20 +40,23 @@
import nc.ird.cantharella.data.exceptions.UnexpectedException;
import nc.ird.cantharella.data.validation.utils.ModelValidator;
import nc.ird.cantharella.data.validation.utils.ModelValidatorImpl;
+import nc.ird.module.utils.CantharellaConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.hibernate.SessionFactory;
import org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.PostgreSQL82Dialect;
+import org.nuiton.util.ArgumentsParserException;
import org.postgresql.Driver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.orm.hibernate4.HibernateTransactionManager;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
@@ -61,12 +64,6 @@
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.mchange.v2.c3p0.impl.DefaultConnectionTester;
-import java.util.logging.Level;
-import javax.annotation.Resource;
-import nc.ird.module.utils.CantharellaConfig;
-import org.nuiton.util.ArgumentsParserException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
/**
* Spring context for the data layer
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ProduitDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ProduitDao.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ProduitDao.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,12 +22,8 @@
*/
package nc.ird.cantharella.data.dao.impl;
-import java.util.Collections;
-
import nc.ird.cantharella.data.dao.AbstractModelDao;
-import nc.ird.cantharella.data.model.Molecule;
import nc.ird.cantharella.data.model.MoleculeProvenance;
-import nc.ird.cantharella.data.model.Produit;
import nc.ird.cantharella.data.model.Purification;
import nc.ird.cantharella.data.model.ResultatTestBio;
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -32,16 +32,15 @@
import nc.ird.cantharella.service.utils.normalizers.utils.Normalizer;
import nc.ird.module.utils.CantharellaConfig;
import nc.ird.module.utils.PasswordTools;
+
import org.nuiton.util.ArgumentsParserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/DocumentService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/DocumentService.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/DocumentService.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -29,7 +29,6 @@
import nc.ird.cantharella.data.model.Document;
import nc.ird.cantharella.data.model.TypeDocument;
import nc.ird.cantharella.data.model.Utilisateur;
-import nc.ird.cantharella.service.utils.normalizers.DocumentNormalizer;
import nc.ird.cantharella.service.utils.normalizers.TypeDocumentNormalizer;
import nc.ird.cantharella.service.utils.normalizers.UniqueFieldNormalizer;
import nc.ird.cantharella.service.utils.normalizers.utils.Normalize;
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -29,7 +29,6 @@
import nc.ird.cantharella.data.model.Molecule;
import nc.ird.cantharella.data.model.MoleculeProvenance;
import nc.ird.cantharella.data.model.Utilisateur;
-import nc.ird.cantharella.data.model.utils.AbstractModel;
import nc.ird.cantharella.service.model.MoleculeProvenanceBean;
import nc.ird.cantharella.service.utils.normalizers.MoleculeNormalizer;
import nc.ird.cantharella.service.utils.normalizers.utils.Normalize;
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,8 +22,7 @@
*/
package nc.ird.module.utils;
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.junit.Test;
/**
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,8 +22,7 @@
*/
package nc.ird.module.utils;
-import junit.framework.Assert;
-
+import org.junit.Assert;
import org.junit.Test;
/**
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -31,8 +31,8 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javax.annotation.PostConstruct;
+import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.validation.ValidatorFactory;
@@ -57,7 +57,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -65,7 +65,6 @@
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.util.value.ValueMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,15 +22,11 @@
*/
package nc.ird.cantharella.web.pages.columns;
-import nc.ird.cantharella.web.utils.columns.CsvWriter;
-import nc.ird.cantharella.web.utils.columns.ExportableColumn;
-
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
@@ -39,7 +35,7 @@
* @author Adrien Cheype
* @param <T> Type of the row model
*/
-public class TaxonomyPropertyColumn<T, S> extends PropertyColumn<T, S> implements ExportableColumn<T, S> {
+public class TaxonomyPropertyColumn<T, S> extends PropertyColumn<T, S> {
/**
* Constructor
@@ -63,26 +59,8 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
- Label label = new Label(componentId, createLabelModel(rowModel));
+ Label label = new Label(componentId, getDataModel(rowModel));
label.add(new AttributeModifier("class", new Model<String>("taxonomy")));
item.add(label);
}
-
- @Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
- }
-
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = createLabelModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- });
- writer.write(textModel.getObject());
- textModel.detach();
- }
-
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -34,6 +34,7 @@
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn;
import nc.ird.cantharella.web.utils.columns.ShortDatePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
@@ -139,7 +140,7 @@
final DataTable<Campagne, String> campagnesDataTable = new AjaxFallbackDefaultDataTable<Campagne, String>(
"ListCampagnesPage.Campagnes", columns, campagnesDataProvider, WebContext.ROWS_PER_PAGE);
-
+ campagnesDataTable.addBottomToolbar(new TableExportToolbar(campagnesDataTable, "campagnes", getSession().getLocale()));
campagnesRefresh.add(campagnesDataTable);
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -99,9 +99,6 @@
@SpringBean(name = "webModelValidator")
private ModelValidator validator;
- /** Entity where document is attached. */
- private DocumentAttachable documentAttachable;
-
/** Caller page. */
private final CallerPage callerPage;
@@ -153,7 +150,6 @@
assert idDocument == null || document == null;
this.callerPage = callerPage;
this.multipleEntry = multipleEntry;
- this.documentAttachable = documentAttachable;
final CallerPage currentPage = new CallerPage(this);
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ExtraitsColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ExtraitsColumn.java (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ExtraitsColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -0,0 +1,119 @@
+/*
+ * #%L
+ * Cantharella :: Web
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package nc.ird.cantharella.web.pages.domain.extraction;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Locale;
+
+import nc.ird.cantharella.data.model.Extraction;
+import nc.ird.cantharella.data.model.Extrait;
+import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
+import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel;
+import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * Extraits exportable column displaying 4 first extracts of current extractions.
+ *
+ * @author Eric Chatellier
+ */
+public class ExtraitsColumn extends AbstractColumn<Extraction, String> implements IExportableColumn<Extraction, String, Serializable> {
+
+ /** Nombre d'extraits affichés dans la colonne de résumés des extraits. */
+ private static final int MAX_EXTRAITS_DISPLAY = 4;
+
+ /** Locale. */
+ protected Locale locale;
+
+ /**
+ * Constructor.
+ *
+ * @param displayModel model used to generate header text
+ * @param locale locale
+ */
+ public ExtraitsColumn(IModel<String> displayModel, Locale locale) {
+ super(displayModel);
+ this.locale = locale;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId, IModel<Extraction> rowModel) {
+ // affiche un résumé des types extraits et des masses, allant jusqu'à MAX_EXTRAITS_DISPLAY extraits
+ Label extraitsLabel = new Label(componentId, getDataModel(rowModel, true));
+ extraitsLabel.setEscapeModelStrings(false);
+ extraitsLabel.add(new ReplaceEmptyLabelBehavior());
+ cellItem.add(extraitsLabel);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IModel<Serializable> getDataModel(IModel<Extraction> rowModel) {
+ return getDataModel(rowModel, false);
+ }
+
+ /**
+ * Improve data model to support optionnal html formatting.
+ */
+ protected IModel<Serializable> getDataModel(IModel<Extraction> rowModel, final boolean html) {
+ return new Model<Serializable>(rowModel) {
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ StringBuilder extraitsResume = new StringBuilder();
+ List<Extrait> extraits = new PropertyModel<List<Extrait>>(super.getObject(), "sortedExtraits")
+ .getObject();
+ for (int i = 0; i < MAX_EXTRAITS_DISPLAY && i < extraits.size(); i++) {
+ Extrait curExtrait = extraits.get(i);
+ if (html) {
+ extraitsResume.append("<b>");
+ }
+ extraitsResume.append(curExtrait.getTypeExtrait().getInitiales());
+ if (html) {
+ extraitsResume.append("</b>");
+ }
+ extraitsResume.append(" : ");
+ extraitsResume.append(curExtrait.getMasseObtenue() == null ? ReplaceEmptyLabelBehavior.NULL_PROPERTY
+ : new DisplayDecimalPropertyModel(curExtrait, "masseObtenue",
+ DecimalDisplFormat.SMALL, locale).getObject());
+ if (i < MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
+ extraitsResume.append(", ");
+ }
+ if (i == MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
+ extraitsResume.append(", ...");
+ }
+ }
+ return extraitsResume.toString();
+ }
+ };
+ }
+}
Property changes on: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ExtraitsColumn.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,24 +22,21 @@
*/
package nc.ird.cantharella.web.pages.domain.extraction;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import nc.ird.cantharella.data.model.Extraction;
-import nc.ird.cantharella.data.model.Extrait;
import nc.ird.cantharella.service.services.ExtractionService;
import nc.ird.cantharella.web.config.WebContext;
import nc.ird.cantharella.web.pages.TemplatePage;
import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage;
import nc.ird.cantharella.web.pages.domain.lot.ReadLotPage;
import nc.ird.cantharella.web.utils.CallerPage;
-import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.ShortDatePropertyColumn;
-import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
@@ -48,7 +45,6 @@
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
@@ -58,7 +54,6 @@
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
/**
@@ -73,11 +68,6 @@
private ExtractionService extractionService;
/**
- * Nombre d'extraits affichés dans la colonne de résumés des extraits
- */
- private static int MAX_EXTRAITS_DISPLAY = 4;
-
- /**
* Constructeur
*/
public ListExtractionsPage() {
@@ -97,101 +87,86 @@
final MarkupContainer extractionsRefresh = new WebMarkupContainer(getResource() + ".Extractions.Refresh");
extractionsRefresh.setOutputMarkupId(true);
add(extractionsRefresh);
-
+
// Liste des Extractions
final List<Extraction> extractions = extractionService.listExtractions(getSession().getUtilisateur());
+
+ DataTable<Extraction, String> extractionsDataTable = initExtractionsDataTable(this,
+ "ListExtractionsPage.Extractions", currentPage, extractions, extractionService);
+ extractionsRefresh.add(extractionsDataTable);
+ }
+
+ /**
+ * Init data table with extractions list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param extractions extractions list
+ * @param extractionService extraction service
+ * @return data table component
+ */
+ public static DataTable<Extraction, String> initExtractionsDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<Extraction> extractions, final ExtractionService extractionService) {
+
LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
- extractions, getSession().getLocale());
+ extractions, templatePage.getSession().getLocale());
List<IColumn<Extraction, String>> columns = new ArrayList<IColumn<Extraction, String>>();
- columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
+ templatePage.setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Extraction.lot")), "lot", "lot",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadLotPage(model.getObject().getLot().getIdLot(), currentPage));
+ templatePage.setResponsePage(new ReadLotPage(model.getObject().getLot().getIdLot(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Extraction.ref")), "ref", "ref",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
+ templatePage.setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), callerPage));
}
});
- columns.add(new ShortDatePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.date")), "date",
- "date", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Extraction.date")), "date",
+ "date", templatePage.getLocale()));
- columns.add(new PropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.methode2")), "methode",
+ columns.add(new PropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Extraction.methode2")), "methode",
"methode"));
- columns.add(new DecimalPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.masseDepart2")),
- "masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Extraction.masseDepart2")),
+ "masseDepart", "masseDepart", DecimalDisplFormat.SMALL, templatePage.getLocale()));
- columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Campagne")), "lot.campagne",
- "lot.campagne", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(templatePage.getString("Campagne")), "lot.campagne",
+ "lot.campagne", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getLot().getCampagne().getIdCampagne(),
- currentPage));
+ templatePage.setResponsePage(new ReadCampagnePage(model.getObject().getLot().getCampagne().getIdCampagne(),
+ callerPage));
}
});
- columns.add(new AbstractColumn<Extraction, String>(new Model<String>(getString("Extraction.extraits"))) {
- @Override
- public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId,
- IModel<Extraction> rowModel) {
+ columns.add(new ExtraitsColumn(new Model<String>(templatePage.getString("Extraction.extraits")), templatePage.getLocale()));
- // affiche un résumé des types extraits et des masses, allant jusqu'à MAX_EXTRAITS_DISPLAY extraits
- Label extraitsLabel = new Label(componentId, new Model<Serializable>(rowModel) {
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- StringBuilder extraitsResume = new StringBuilder();
- List<Extrait> extraits = new PropertyModel<List<Extrait>>(super.getObject(), "sortedExtraits")
- .getObject();
- for (int i = 0; i < MAX_EXTRAITS_DISPLAY && i < extraits.size(); i++) {
- Extrait curExtrait = extraits.get(i);
- extraitsResume.append("<b>");
- extraitsResume.append(curExtrait.getTypeExtrait().getInitiales());
- extraitsResume.append("</b>");
- extraitsResume.append(" : ");
- extraitsResume.append(curExtrait.getMasseObtenue() == null ? ReplaceEmptyLabelBehavior.NULL_PROPERTY
- : new DisplayDecimalPropertyModel(curExtrait, "masseObtenue",
- DecimalDisplFormat.SMALL, getLocale()).getObject());
- if (i < MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
- extraitsResume.append(", ");
- }
- if (i == MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
- extraitsResume.append(", ...");
- }
- }
- return extraitsResume.toString();
- }
- });
- extraitsLabel.setEscapeModelStrings(false);
- extraitsLabel.add(new ReplaceEmptyLabelBehavior());
- cellItem.add(extraitsLabel);
- }
-
- });
-
- columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/edit.png", templatePage.getString("Update"),
+ templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- if (extractionService.updateOrdeleteExtractionEnabled(model.getObject(), getSession().getUtilisateur())) {
+ if (extractionService.updateOrdeleteExtractionEnabled(model.getObject(), templatePage.getSession().getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
// label vide
@@ -201,13 +176,13 @@
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ManageExtractionPage(model.getObject().getIdExtraction(), currentPage));
+ templatePage.setResponsePage(new ManageExtractionPage(model.getObject().getIdExtraction(), callerPage));
}
});
final DataTable<Extraction, String> extractionsDataTable = new AjaxFallbackDefaultDataTable<Extraction, String>(
- "ListExtractionsPage.Extractions", columns, extractionsDataProvider, WebContext.ROWS_PER_PAGE);
- extractionsRefresh.add(extractionsDataTable);
-
+ componentId, columns, extractionsDataProvider, WebContext.ROWS_PER_PAGE);
+ extractionsDataTable.addBottomToolbar(new TableExportToolbar(extractionsDataTable, "extractions", templatePage.getSession().getLocale()));
+ return extractionsDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -39,8 +39,9 @@
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
+import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
-import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
@@ -92,85 +93,103 @@
// Liste des lots
final List<Lot> lots = lotService.listLots(getSession().getUtilisateur());
+ DataTable<Lot, String> lotsDataTable = initLotsDataTable(this, "ListLotsPage.Lots", currentPage, lots, lotService);
+ lotsRefresh.add(lotsDataTable);
+ }
+ /**
+ * Init data table with lots list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param lots lots list
+ * @param lotService lot service
+ * @return data table component
+ */
+ public static DataTable<Lot, String> initLotsDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<Lot> lots, final LotService lotService) {
LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
- lots, getSession().getLocale());
+ lots, templatePage.getSession().getLocale());
List<IColumn<Lot, String>> columns = new ArrayList<IColumn<Lot, String>>();
- columns.add(new LinkableImagePropertyColumn<Lot, String>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Lot, String>("images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
+ templatePage.setResponsePage(new ReadLotPage(model.getObject().getIdLot(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.ref")), "ref", "ref",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.ref")), "ref", "ref",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
+ templatePage.setResponsePage(new ReadLotPage(model.getObject().getIdLot(), callerPage));
}
});
- columns.add(new PropertyColumn<Lot, String>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
+ columns.add(new PropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.dateRecolte2")), "dateRecolte",
"dateRecolte"));
- columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.station")), "station", "station",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.station")), "station", "station",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), currentPage));
+ templatePage.setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
- "specimenRef", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.specimenRef2")), "specimenRef",
+ "specimenRef", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getSpecimenRef().getIdSpecimen(), currentPage));
+ templatePage.setResponsePage(new ReadSpecimenPage(model.getObject().getSpecimenRef().getIdSpecimen(), callerPage));
}
});
- columns.add(new EnumPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.typeOrganisme")),
- "specimenRef.typeOrganisme", "specimenRef.typeOrganisme", ListLotsPage.this));
+ columns.add(new EnumPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Specimen.typeOrganisme")),
+ "specimenRef.typeOrganisme", "specimenRef.typeOrganisme", templatePage));
- columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.embranchement")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Specimen.embranchement")),
"specimenRef.embranchement", "specimenRef.embranchement"));
- columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.famille")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Specimen.famille")),
"specimenRef.famille", "specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.genre")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Specimen.genre")),
"specimenRef.genre", "specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.espece")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Specimen.espece")),
"specimenRef.espece", "specimenRef.espece"));
- columns.add(new PropertyColumn<Lot, String>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
+ columns.add(new PropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.partie")), "partie", "partie"));
- columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
- "masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.masseFraiche2")), "masseFraiche",
+ "masseFraiche", DecimalDisplFormat.SMALL, templatePage.getLocale()));
- columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
- "masseSeche", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.masseSeche2")), "masseSeche",
+ "masseSeche", DecimalDisplFormat.SMALL, templatePage.getLocale()));
- columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(templatePage.getString("Lot.campagne")), "campagne", "campagne",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), currentPage));
+ templatePage.setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), callerPage));
}
});
- columns.add(new MapValuePropertyColumn<Lot, String, String>(new Model<String>(getString("Campagne.codePays")),
- "campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<Lot, String, String>(new Model<String>(templatePage.getString("Campagne.codePays")),
+ "campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(templatePage.getSession().getLocale())));
- columns.add(new LinkableImagePropertyColumn<Lot, String>("images/edit.png", getString("Update"), getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Lot, String>("images/edit.png", templatePage.getString("Update"), templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- if (lotService.updateOrdeleteLotEnabled(model.getObject(), getSession().getUtilisateur())) {
+ if (lotService.updateOrdeleteLotEnabled(model.getObject(), templatePage.getSession().getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
// label vide
@@ -180,13 +199,13 @@
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ManageLotPage(model.getObject().getIdLot(), currentPage));
+ templatePage.setResponsePage(new ManageLotPage(model.getObject().getIdLot(), callerPage));
}
});
- final DataTable<Lot, String> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot, String>("ListLotsPage.Lots", columns,
+ final DataTable<Lot, String> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot, String>(componentId, columns,
lotsDataProvider, WebContext.ROWS_PER_PAGE);
- lotsRefresh.add(lotsDataTable);
-
+ lotsDataTable.addBottomToolbar(new TableExportToolbar(lotsDataTable, "lots", templatePage.getSession().getLocale()));
+ return lotsDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -38,6 +38,7 @@
import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.models.SimpleSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
@@ -97,7 +98,7 @@
Utilisateur utilisateur = getSession().getUtilisateur();
final List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(utilisateur);
- DataTable<MoleculeProvenanceBean, String> moleculesDataTable = initMoleculesListTable(this,
+ DataTable<MoleculeProvenanceBean, String> moleculesDataTable = initMoleculesDataTable(this,
"ListMoleculesPage.Molecules", currentPage, moleculeProvenances);
moleculesRefresh.add(moleculesDataTable);
}
@@ -105,7 +106,7 @@
/**
* Init data table with molecule provenances list.
*
- * This method is static to be resued in several places.
+ * This method is static to be reused in several places.
*
* @param templatePage parent page
* @param componentId data table id
@@ -113,7 +114,7 @@
* @param moleculeProvenances molecules provenance list
* @return data table component
*/
- public static DataTable<MoleculeProvenanceBean, String> initMoleculesListTable(final TemplatePage templatePage,
+ public static DataTable<MoleculeProvenanceBean, String> initMoleculesDataTable(final TemplatePage templatePage,
final String componentId, final CallerPage callerPage,
List<MoleculeProvenanceBean> moleculeProvenances) {
@@ -224,6 +225,7 @@
final DataTable<MoleculeProvenanceBean, String> moleculesDataTable =
new AjaxFallbackDefaultDataTable<MoleculeProvenanceBean, String>(
componentId, columns, moleculesDataProvider, WebContext.ROWS_PER_PAGE);
+ moleculesDataTable.addBottomToolbar(new TableExportToolbar(moleculesDataTable, "molecules", templatePage.getSession().getLocale()));
return moleculesDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -83,7 +83,6 @@
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -39,6 +39,7 @@
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.ShortDatePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
@@ -64,8 +65,6 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListPurificationsPage extends TemplatePage {
- /** Logger */
- //private static final Logger LOG = LoggerFactory.getLogger(ListPurificationsPage.class);
/** Service : manipPurification */
@SpringBean
private PurificationService purificationService;
@@ -90,73 +89,97 @@
final MarkupContainer purificationsRefresh = new WebMarkupContainer(getResource() + ".Purifications.Refresh");
purificationsRefresh.setOutputMarkupId(true);
add(purificationsRefresh);
-
+
// Liste des Purifications
final List<Purification> purifications = purificationService.listPurifications(getSession().getUtilisateur());
+
+ DataTable<Purification, String> purificationsDataTable = initPurificationsDataTable(this,
+ "ListPurificationsPage.Purifications", currentPage, purifications, purificationService);
+ purificationsRefresh.add(purificationsDataTable);
+
+ }
+
+ /**
+ * Init data table with purification list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param purifications purifications list
+ * @param purificationService purification service
+ * @return data table component
+ */
+ public static DataTable<Purification, String> initPurificationsDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<Purification> purifications, final PurificationService purificationService) {
+
+
LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
- purifications, getSession().getLocale());
+ purifications, templatePage.getSession().getLocale());
List<IColumn<Purification, String>> columns = new ArrayList<IColumn<Purification, String>>();
- columns.add(new LinkableImagePropertyColumn<Purification, String>("images/read.png", getString("Read"),
- getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Purification, String>("images/read.png", templatePage.getString("Read"),
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), currentPage));
+ templatePage.setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Extraction.lot")), "lotSource",
- "lotSource", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(templatePage.getString("Extraction.lot")), "lotSource",
+ "lotSource", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadLotPage(model.getObject().getLotSource().getIdLot(), currentPage));
+ templatePage.setResponsePage(new ReadLotPage(model.getObject().getLotSource().getIdLot(), callerPage));
}
});
columns.add(new LinkProduitPropertyColumn<Purification, String>(
- new Model<String>(getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
+ new Model<String>(templatePage.getString("ResultatTestBio.produit")), "produit", "produit", templatePage) {
@Override
public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
+ templatePage.setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), callerPage));
}
@Override
public void onClickIfFraction(Fraction fraction) {
- setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
+ templatePage.setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Purification.ref")), "ref",
- "ref", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(templatePage.getString("Purification.ref")), "ref",
+ "ref", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), currentPage));
+ templatePage.setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), callerPage));
}
});
- columns.add(new ShortDatePropertyColumn<Purification, String>(new Model<String>(getString("Purification.date")),
- "date", "date", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Purification, String>(new Model<String>(templatePage.getString("Purification.date")),
+ "date", "date", templatePage.getLocale()));
- columns.add(new PropertyColumn<Purification, String>(new Model<String>(getString("Purification.methode2")), "methode",
+ columns.add(new PropertyColumn<Purification, String>(new Model<String>(templatePage.getString("Purification.methode2")), "methode",
"methode"));
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Campagne")),
- "lotSource.campagne", "lotSource.campagne", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(templatePage.getString("Campagne")),
+ "lotSource.campagne", "lotSource.campagne", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getLotSource().getCampagne().getIdCampagne(),
- currentPage));
+ templatePage.setResponsePage(new ReadCampagnePage(model.getObject().getLotSource().getCampagne().getIdCampagne(),
+ callerPage));
}
});
- columns.add(new LinkableImagePropertyColumn<Purification, String>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Purification, String>("images/edit.png", templatePage.getString("Update"),
+ templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Purification>> item, String componentId,
IModel<Purification> model) {
- if (purificationService.updateOrdeletePurificationEnabled(model.getObject(), getSession()
+ if (purificationService.updateOrdeletePurificationEnabled(model.getObject(), templatePage.getSession()
.getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
@@ -167,13 +190,14 @@
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ManagePurificationPage(model.getObject().getIdPurification(), currentPage));
+ templatePage.setResponsePage(new ManagePurificationPage(model.getObject().getIdPurification(), callerPage));
}
});
final DataTable<Purification, String> purificationsDataTable = new AjaxFallbackDefaultDataTable<Purification, String>(
- "ListPurificationsPage.Purifications", columns, purificationsDataProvider, WebContext.ROWS_PER_PAGE);
- purificationsRefresh.add(purificationsDataTable);
+ componentId, columns, purificationsDataProvider, WebContext.ROWS_PER_PAGE);
+ purificationsDataTable.addBottomToolbar(new TableExportToolbar(purificationsDataTable, "purifications", templatePage.getSession().getLocale()));
+ return purificationsDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.html
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.html 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.html 2013-02-15 11:49:11 UTC (rev 115)
@@ -39,31 +39,25 @@
<h3><wicket:message key="SearchPage.Stations" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Stations.Results"/>
-<a wicket:id="SearchPage.Stations.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.Specimens" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Specimens.Results"/>
-<a wicket:id="SearchPage.Specimens.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.Lots" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Lots.Results"/>
-<a wicket:id="SearchPage.Lots.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.Extractions" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Extractions.Results"/>
-<a wicket:id="SearchPage.Extractions.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.Purifications" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Purifications.Results"/>
-<a wicket:id="SearchPage.Purifications.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.ResultatTestBios" /></h3>
<table cellspacing="0" wicket:id="SearchPage.ResultatTestBios.Results"/>
-<a wicket:id="SearchPage.ResultatTestBios.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
<h3><wicket:message key="SearchPage.Molecules" /></h3>
<table cellspacing="0" wicket:id="SearchPage.Molecules.Results"/>
-<a wicket:id="SearchPage.Molecules.ExportCSV"><wicket:message key="SearchPage.ExportCSV" /></a>
+
</wicket:extend>
</body>
</html>
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,13 +22,9 @@
*/
package nc.ird.cantharella.web.pages.domain.search;
-import java.io.Serializable;
-import java.util.ArrayList;
import java.util.List;
import nc.ird.cantharella.data.model.Extraction;
-import nc.ird.cantharella.data.model.Extrait;
-import nc.ird.cantharella.data.model.Fraction;
import nc.ird.cantharella.data.model.Lot;
import nc.ird.cantharella.data.model.Molecule;
import nc.ird.cantharella.data.model.Purification;
@@ -38,51 +34,30 @@
import nc.ird.cantharella.data.model.Utilisateur;
import nc.ird.cantharella.service.model.MoleculeProvenanceBean;
import nc.ird.cantharella.service.model.SearchResult;
+import nc.ird.cantharella.service.services.ExtractionService;
+import nc.ird.cantharella.service.services.LotService;
import nc.ird.cantharella.service.services.MoleculeService;
+import nc.ird.cantharella.service.services.PurificationService;
import nc.ird.cantharella.service.services.SearchService;
-import nc.ird.cantharella.web.config.WebContext;
+import nc.ird.cantharella.service.services.SpecimenService;
+import nc.ird.cantharella.service.services.StationService;
+import nc.ird.cantharella.service.services.TestBioService;
import nc.ird.cantharella.web.pages.TemplatePage;
-import nc.ird.cantharella.web.pages.columns.LinkProduitPropertyColumn;
-import nc.ird.cantharella.web.pages.columns.TaxonomyPropertyColumn;
-import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage;
-import nc.ird.cantharella.web.pages.domain.extraction.ReadExtractionPage;
-import nc.ird.cantharella.web.pages.domain.lot.ReadLotPage;
+import nc.ird.cantharella.web.pages.domain.extraction.ListExtractionsPage;
+import nc.ird.cantharella.web.pages.domain.lot.ListLotsPage;
import nc.ird.cantharella.web.pages.domain.molecule.ListMoleculesPage;
-import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage;
-import nc.ird.cantharella.web.pages.domain.specimen.ReadSpecimenPage;
-import nc.ird.cantharella.web.pages.domain.station.ReadStationPage;
-import nc.ird.cantharella.web.pages.domain.testBio.ReadTestBioPage;
+import nc.ird.cantharella.web.pages.domain.purification.ListPurificationsPage;
+import nc.ird.cantharella.web.pages.domain.specimen.ListSpecimensPage;
+import nc.ird.cantharella.web.pages.domain.station.ListStationsPage;
+import nc.ird.cantharella.web.pages.domain.testBio.ListTestsBioPage;
import nc.ird.cantharella.web.utils.CallerPage;
-import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
-import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn;
-import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn;
-import nc.ird.cantharella.web.utils.columns.EnumPropertyColumn;
-import nc.ird.cantharella.web.utils.columns.ExportablePropertyColumn;
-import nc.ird.cantharella.web.utils.columns.ExportableTextFilteredPropertyColumn;
-import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
-import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
-import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn;
-import nc.ird.cantharella.web.utils.columns.ShortDatePropertyColumn;
-import nc.ird.cantharella.web.utils.links.CsvExportLink;
-import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel;
-import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
-import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.ExternalLink;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.util.value.ValueMap;
@@ -102,13 +77,34 @@
@SpringBean
protected SearchService searchService;
+ /** Specimen service. */
+ @SpringBean
+ protected SpecimenService specimenService;
+
+ /** Lot service. */
+ @SpringBean
+ protected LotService lotService;
+
+ /** Extraction service. */
+ @SpringBean
+ protected ExtractionService extractionService;
+
+ /** Purification service. */
+ @SpringBean
+ protected PurificationService purificationService;
+
+ /** Testbio service. */
+ @SpringBean
+ protected TestBioService testBioService;
+
+ /** Station service. */
+ @SpringBean
+ protected StationService stationService;
+
/** Molecule service. */
@SpringBean
protected MoleculeService moleculeService;
- /** Nombre d'extraits affichés dans la colonne de résumés des extraits. */
- private static final int MAX_EXTRAITS_DISPLAY = 4;
-
/**
* Constructor.
*
@@ -135,485 +131,52 @@
// search results
Utilisateur utilisateur = getSession().getUtilisateur();
SearchResult searchResult = searchService.search(query, utilisateur);
- addSpecimensTable(currentPage, searchResult);
- addLotsTable(currentPage, searchResult);
- addExtractionsTable(currentPage, searchResult);
- addPurificationsTable(currentPage, searchResult);
- addTestBiosTable(currentPage, searchResult);
- addStationsTable(currentPage, searchResult);
-
- // additionnal transformation for molecule provenances
+ // Additional transformation for molecule provenances
List<Molecule> molecules = searchResult.getMolecules();
List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(molecules, utilisateur);
- // call static methods in ListXXXPage
- DataTable<MoleculeProvenanceBean, String> moleculesDataTable = ListMoleculesPage.initMoleculesListTable(this,
- "SearchPage.Molecules.Results", currentPage, moleculeProvenances);
- add(moleculesDataTable);
- add(new CsvExportLink("SearchPage.Molecules.ExportCSV", moleculesDataTable, "molecules.csv"));
- }
-
- /**
- * Get current form query value.
- *
- * @return form query value
- */
- public String getQuery() {
- return query;
- }
-
- /**
- * Format specimens result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addSpecimensTable(final CallerPage currentPage, SearchResult searchResult) {
- // search result : specimens
- List<Specimen> specimens = searchResult.getSpecimens();
- List<IColumn<Specimen, String>> specimensColumns = new ArrayList<IColumn<Specimen, String>>();
-
- specimensColumns.add(new LinkableImagePropertyColumn<Specimen, String>("images/read.png", getString("Read"), getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
- }
- });
-
- specimensColumns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
- }
- });
-
- specimensColumns.add(new EnumPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.typeOrganisme")),
- "typeOrganisme", "typeOrganisme", SearchPage.this));
-
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.embranchement")),
- "embranchement", "embranchement"));
-
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.famille")), "famille",
- "famille"));
-
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.genre")), "genre",
- "genre"));
-
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.espece")), "espece",
- "espece"));
-
- specimensColumns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.station2")), "station",
- "station", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), currentPage));
- }
- });
- LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
- specimens, getSession().getLocale());
- final DataTable<Specimen, String> specimensDataTable = new DefaultDataTable<Specimen, String>(getResource() + ".Specimens.Results",
- specimensColumns, specimensDataProvider, Integer.MAX_VALUE);
+ // specimens table
+ DataTable<Specimen, String> specimensDataTable = ListSpecimensPage.initSpecimensDataTable(this,
+ "SearchPage.Specimens.Results", currentPage, searchResult.getSpecimens(), specimenService);
add(specimensDataTable);
- add(new CsvExportLink("SearchPage.Specimens.ExportCSV", specimensDataTable, "specimens.csv"));
- }
- /**
- * Format lots result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addLotsTable(final CallerPage currentPage, SearchResult searchResult) {
- // search result : lots
- List<Lot> lots = searchResult.getLots();
- List<IColumn<Lot, String>> lotsColumns = new ArrayList<IColumn<Lot, String>>();
-
- lotsColumns.add(new LinkableImagePropertyColumn<Lot, String>("images/read.png", getString("Read"), getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
- }
- });
-
- lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.ref")), "ref", "ref",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
- }
- });
-
- lotsColumns.add(new ExportablePropertyColumn<Lot, String>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
- "dateRecolte"));
-
- lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.station")), "station", "station",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), currentPage));
- }
- });
-
- lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
- "specimenRef", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getSpecimenRef().getIdSpecimen(), currentPage));
- }
- });
-
- lotsColumns.add(new EnumPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.typeOrganisme")),
- "specimenRef.typeOrganisme", "specimenRef.typeOrganisme", SearchPage.this));
-
- lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.embranchement")),
- "specimenRef.embranchement", "specimenRef.embranchement"));
-
- lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.famille")),
- "specimenRef.famille", "specimenRef.famille"));
-
- lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.genre")),
- "specimenRef.genre", "specimenRef.genre"));
-
- lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.espece")),
- "specimenRef.espece", "specimenRef.espece"));
-
- lotsColumns.add(new ExportablePropertyColumn<Lot, String>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
-
- lotsColumns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
- "masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
-
- lotsColumns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
- "masseSeche", DecimalDisplFormat.SMALL, getLocale()));
-
- lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), currentPage));
- }
- });
-
- lotsColumns.add(new MapValuePropertyColumn<Lot, String, String>(new Model<String>(getString("Campagne.codePays")),
- "campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
-
- LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
- lots, getSession().getLocale());
- final DataTable<Lot, String> lotsDataTable = new DefaultDataTable<Lot, String>(getResource() + ".Lots.Results", lotsColumns,
- lotsDataProvider, Integer.MAX_VALUE);
+ // lot table
+ DataTable<Lot, String> lotsDataTable = ListLotsPage.initLotsDataTable(this,
+ "SearchPage.Lots.Results", currentPage, searchResult.getLots(), lotService);
add(lotsDataTable);
- add(new CsvExportLink("SearchPage.Lots.ExportCSV", lotsDataTable, "lots.csv"));
- }
- /**
- * Format extractions result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addExtractionsTable(final CallerPage currentPage, SearchResult searchResult) {
- // search result : extractions
- List<Extraction> extractions = searchResult.getExtractions();
-
- List<IColumn<Extraction, String>> extractionsColumns = new ArrayList<IColumn<Extraction, String>>();
-
- extractionsColumns.add(new LinkableImagePropertyColumn<Extraction, String>("images/read.png", getString("Read"), getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
- }
- });
-
- extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadLotPage(model.getObject().getLot().getIdLot(), currentPage));
- }
- });
-
- extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
- }
- });
-
- extractionsColumns.add(new ShortDatePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.date")), "date",
- "date", getLocale()));
-
- extractionsColumns.add(new ExportablePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.methode2")), "methode",
- "methode"));
-
- extractionsColumns.add(new DecimalPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.masseDepart2")),
- "masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
-
- extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Campagne")), "lot.campagne",
- "lot.campagne", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getLot().getCampagne().getIdCampagne(),
- currentPage));
- }
- });
-
- extractionsColumns.add(new AbstractColumn<Extraction, String>(new Model<String>(getString("Extraction.extraits"))) {
- @Override
- public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId,
- IModel<Extraction> rowModel) {
-
- // affiche un résumé des types extraits et des masses, allant jusqu'à MAX_EXTRAITS_DISPLAY extraits
- Label extraitsLabel = new Label(componentId, new Model<Serializable>(rowModel) {
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- StringBuilder extraitsResume = new StringBuilder();
- List<Extrait> extraits = new PropertyModel<List<Extrait>>(super.getObject(), "sortedExtraits")
- .getObject();
- for (int i = 0; i < MAX_EXTRAITS_DISPLAY && i < extraits.size(); i++) {
- Extrait curExtrait = extraits.get(i);
- extraitsResume.append("<b>");
- extraitsResume.append(curExtrait.getTypeExtrait().getInitiales());
- extraitsResume.append("</b>");
- extraitsResume.append(" : ");
- extraitsResume.append(curExtrait.getMasseObtenue() == null ? ReplaceEmptyLabelBehavior.NULL_PROPERTY
- : new DisplayDecimalPropertyModel(curExtrait, "masseObtenue",
- DecimalDisplFormat.SMALL, getLocale()).getObject());
- if (i < MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
- extraitsResume.append(", ");
- }
- if (i == MAX_EXTRAITS_DISPLAY - 1 && i < extraits.size() - 1) {
- extraitsResume.append(", ...");
- }
- }
- return extraitsResume.toString();
- }
- });
- extraitsLabel.setEscapeModelStrings(false);
- extraitsLabel.add(new ReplaceEmptyLabelBehavior());
- cellItem.add(extraitsLabel);
- }
-
- });
-
- LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
- extractions, getSession().getLocale());
- final DataTable<Extraction, String> extractionsDataTable = new DefaultDataTable<Extraction, String>(
- getResource() + ".Extractions.Results", extractionsColumns, extractionsDataProvider, Integer.MAX_VALUE);
+ // extractions table
+ DataTable<Extraction, String> extractionsDataTable = ListExtractionsPage.initExtractionsDataTable(this,
+ "SearchPage.Extractions.Results", currentPage, searchResult.getExtractions(), extractionService);
add(extractionsDataTable);
- add(new CsvExportLink("SearchPage.Extractions.ExportCSV", extractionsDataTable, "extractions.csv"));
- }
- /**
- * Format purification result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addPurificationsTable(final CallerPage currentPage, SearchResult searchResult) {
- List<Purification> purifications = searchResult.getPurifications();
- LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
- purifications, getSession().getLocale());
-
- List<IColumn<Purification, String>> columns = new ArrayList<IColumn<Purification, String>>();
-
- columns.add(new LinkableImagePropertyColumn<Purification, String>("images/read.png", getString("Read"),
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), currentPage));
- }
- });
-
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Extraction.lot")), "lotSource",
- "lotSource", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadLotPage(model.getObject().getLotSource().getIdLot(), currentPage));
- }
- });
-
- columns.add(new LinkProduitPropertyColumn<Purification, String>(
- new Model<String>(getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
-
- @Override
- public void onClickIfFraction(Fraction fraction) {
- setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
- }
- });
-
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Purification.ref")), "ref",
- "ref", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadPurificationPage(model.getObject().getIdPurification(), currentPage));
- }
- });
-
- columns.add(new ShortDatePropertyColumn<Purification, String>(new Model<String>(getString("Purification.date")),
- "date", "date", getLocale()));
-
- columns.add(new ExportablePropertyColumn<Purification, String>(new Model<String>(getString("Purification.methode2")), "methode",
- "methode"));
-
- columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Campagne")),
- "lotSource.campagne", "lotSource.campagne", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getLotSource().getCampagne().getIdCampagne(),
- currentPage));
- }
- });
-
- final DataTable<Purification, String> purificationsDataTable = new DefaultDataTable<Purification, String>(
- getResource() + ".Purifications.Results", columns, purificationsDataProvider, Integer.MAX_VALUE);
+ // purification table
+ DataTable<Purification, String> purificationsDataTable = ListPurificationsPage.initPurificationsDataTable(this,
+ "SearchPage.Purifications.Results", currentPage, searchResult.getPurifications(), purificationService);
add(purificationsDataTable);
- add(new CsvExportLink("SearchPage.Purifications.ExportCSV", purificationsDataTable, "purifications.csv"));
- }
- /**
- * Format testBios result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addTestBiosTable(final CallerPage currentPage, SearchResult searchResult) {
- List<ResultatTestBio> resultatTestBios = searchResult.getResultatTestBios();
- LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
- resultatTestBios, getSession().getLocale());
+ // test bio table
+ DataTable<ResultatTestBio, String> testBiosDataTable = ListTestsBioPage.initTestsBioDataTable(this,
+ "SearchPage.ResultatTestBios.Results", currentPage, searchResult.getResultatTestBios(), testBioService);
+ add(testBiosDataTable);
- List<IColumn<ResultatTestBio, String>> columns = new ArrayList<IColumn<ResultatTestBio, String>>();
+ // stations table
+ DataTable<Station, String> stationsDataTable = ListStationsPage.initStationsDataTable(this,
+ "SearchPage.Stations.Results", currentPage, searchResult.getStations(), stationService);
+ add(stationsDataTable);
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/read.png", getString("Read"),
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
- IModel<ResultatTestBio> model) {
- setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
- }
- });
-
- columns.add(new ExportableTextFilteredPropertyColumn<ResultatTestBio, String, String>(new Model<String>(
- getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
-
- columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
- getLocale()));
-
- columns.add(new EnumPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.uniteConcMasse2")),
- "uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
-
- columns.add(new LinkProduitPropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
-
- @Override
- public void onClickIfFraction(Fraction fraction) {
- setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
- }
- });
-
- columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.valeur")),
- "valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
-
- columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
- "testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
-
- columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Extrait.typeExtrait2")),
- "typeExtraitSource", "typeExtraitSource"));
-
- columns.add(new BooleanPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.actif")),
- "actif", "actif", (TemplatePage) getPage()));
-
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.famille")),
- "lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
-
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.genre")),
- "lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
-
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.espece")),
- "lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
-
- columns.add(new MapValuePropertyColumn<ResultatTestBio, String, String>(new Model<String>(
- getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
- WebContext.COUNTRIES.get(getSession().getLocale())));
-
- columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.repere")),
- "repere", "repere"));
-
- columns.add(new LinkPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
- "testBio.ref", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
- IModel<ResultatTestBio> model) {
- setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
- }
- });
-
- final DataTable<ResultatTestBio, String> resTestBiosDataTable = new DefaultDataTable<ResultatTestBio, String>(
- getResource() + ".ResultatTestBios.Results", columns, resTestBiosDataProvider, Integer.MAX_VALUE);
-
- add(resTestBiosDataTable);
- add(new CsvExportLink("SearchPage.ResultatTestBios.ExportCSV", resTestBiosDataTable, "testbios.csv"));
-
+ // molecule table
+ DataTable<MoleculeProvenanceBean, String> moleculesDataTable = ListMoleculesPage.initMoleculesDataTable(this,
+ "SearchPage.Molecules.Results", currentPage, moleculeProvenances);
+ add(moleculesDataTable);
}
/**
- * Format stations result into table.
+ * Get current form query value.
*
- * @param currentPage current page
- * @param searchResult search results
+ * @return form query value
*/
- protected void addStationsTable(final CallerPage currentPage, SearchResult searchResult) {
-
- // Liste des stations
- List<Station> stations = searchResult.getStations();
-
- LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
- stations, getSession().getLocale());
-
- List<IColumn<Station, String>> columns = new ArrayList<IColumn<Station, String>>();
-
- columns.add(new LinkableImagePropertyColumn<Station, String>("images/read.png", getString("Read"), getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
- }
- });
-
- columns.add(new LinkPropertyColumn<Station, String>(new Model<String>(getString("Station.nom")), "nom", "nom",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
- }
- });
-
- columns.add(new MapValuePropertyColumn<Station, String, String>(new Model<String>(getString("Station.codePays")),
- "codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
-
- columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.localite")), "localite",
- "localite"));
-
- columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.latitude")), "latitude",
- "latitude"));
-
- columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.longitude")), "longitude",
- "longitude"));
-
-
- final DataTable<Station, String> stationsDataTable = new AjaxFallbackDefaultDataTable<Station, String>(
- getResource() + ".Stations.Results", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
-
- add(stationsDataTable);
- add(new CsvExportLink("SearchPage.Stations.ExportCSV", stationsDataTable, "stations.csv"));
+ public String getQuery() {
+ return query;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -35,6 +35,7 @@
import nc.ird.cantharella.web.utils.columns.EnumPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
@@ -88,51 +89,73 @@
// Liste des Specimens
final List<Specimen> specimens = specimenService.listSpecimens(getSession().getUtilisateur());
+ DataTable<Specimen, String> specimensDataTable = initSpecimensDataTable(this,
+ "ListSpecimensPage.Specimens", currentPage, specimens, specimenService);
+ specimensRefresh.add(specimensDataTable);
+ }
+
+ /**
+ * Init data table with specimens list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param specimens specimens list
+ * @param specimenService specimen service
+ * @return data table component
+ */
+ public static DataTable<Specimen, String> initSpecimensDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<Specimen> specimens, final SpecimenService specimenService) {
+
+
LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
- specimens, getSession().getLocale());
+ specimens, templatePage.getSession().getLocale());
List<IColumn<Specimen, String>> columns = new ArrayList<IColumn<Specimen, String>>();
- columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
+ templatePage.setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.ref")), "ref", "ref",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
+ templatePage.setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), callerPage));
}
});
- columns.add(new EnumPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.typeOrganisme")),
- "typeOrganisme", "typeOrganisme", ListSpecimensPage.this));
+ columns.add(new EnumPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.typeOrganisme")),
+ "typeOrganisme", "typeOrganisme", templatePage));
- columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.embranchement")),
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.embranchement")),
"embranchement", "embranchement"));
- columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.famille")), "famille",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.famille")), "famille",
"famille"));
- columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.genre")), "genre",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.genre")), "genre",
"genre"));
- columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.espece")), "espece",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.espece")), "espece",
"espece"));
- columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.station2")), "station",
- "station", getString("Read")) {
+ columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(templatePage.getString("Specimen.station2")), "station",
+ "station", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), currentPage));
+ templatePage.setResponsePage(new ReadStationPage(model.getObject().getStation().getIdStation(), callerPage));
}
});
- columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/edit.png", templatePage.getString("Update"),
+ templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
@@ -140,7 +163,7 @@
item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
}
- if (specimenService.updateOrdeleteSpecimenEnabled(model.getObject(), getSession().getUtilisateur())) {
+ if (specimenService.updateOrdeleteSpecimenEnabled(model.getObject(), templatePage.getSession().getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
// label vide
@@ -150,13 +173,13 @@
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ManageSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
+ templatePage.setResponsePage(new ManageSpecimenPage(model.getObject().getIdSpecimen(), callerPage));
}
});
final DataTable<Specimen, String> specimensDataTable = new AjaxFallbackDefaultDataTable<Specimen, String>(
- "ListSpecimensPage.Specimens", columns, specimensDataProvider, WebContext.ROWS_PER_PAGE);
-
- specimensRefresh.add(specimensDataTable);
+ componentId, columns, specimensDataProvider, WebContext.ROWS_PER_PAGE);
+ specimensDataTable.addBottomToolbar(new TableExportToolbar(specimensDataTable, "specimens", templatePage.getSession().getLocale()));
+ return specimensDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -33,6 +33,7 @@
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
@@ -85,43 +86,65 @@
final MarkupContainer stationsRefresh = new WebMarkupContainer(getResource() + ".Stations.Refresh");
stationsRefresh.setOutputMarkupId(true);
add(stationsRefresh);
-
+
// Liste des stations
final List<Station> stations = stationService.listStations(getSession().getUtilisateur());
+ DataTable<Station, String> stationsDataTable = initStationsDataTable(this,
+ "ListStationsPage.Stations", currentPage, stations, stationService);
+ stationsRefresh.add(stationsDataTable);
+
+ }
+
+ /**
+ * Init data table with stations list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param stations stations list
+ * @param stationService station service
+ * @return data table component
+ */
+ public static DataTable<Station, String> initStationsDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<Station> stations, final StationService stationService) {
+
LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
- stations, getSession().getLocale());
+ stations, templatePage.getSession().getLocale());
List<IColumn<Station, String>> columns = new ArrayList<IColumn<Station, String>>();
- columns.add(new LinkableImagePropertyColumn<Station, String>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Station, String>("images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
+ templatePage.setResponsePage(new ReadStationPage(model.getObject().getIdStation(), callerPage));
}
});
- columns.add(new LinkPropertyColumn<Station, String>(new Model<String>(getString("Station.nom")), "nom", "nom",
- getString("Read")) {
+ columns.add(new LinkPropertyColumn<Station, String>(new Model<String>(templatePage.getString("Station.nom")), "nom", "nom",
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
+ templatePage.setResponsePage(new ReadStationPage(model.getObject().getIdStation(), callerPage));
}
});
- columns.add(new MapValuePropertyColumn<Station, String, String>(new Model<String>(getString("Station.codePays")),
- "codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<Station, String, String>(new Model<String>(templatePage.getString("Station.codePays")),
+ "codePays", "codePays", WebContext.COUNTRIES.get(templatePage.getSession().getLocale())));
- columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.localite")), "localite",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(templatePage.getString("Station.localite")), "localite",
"localite"));
- columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.latitude")), "latitude",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(templatePage.getString("Station.latitude")), "latitude",
"latitude"));
- columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.longitude")), "longitude",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(templatePage.getString("Station.longitude")), "longitude",
"longitude"));
- columns.add(new LinkableImagePropertyColumn<Station, String>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Station, String>("images/edit.png", templatePage.getString("Update"),
+ templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
@@ -129,7 +152,7 @@
item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
}
- if (stationService.updateOrdeleteStationEnabled(model.getObject(), getSession().getUtilisateur())) {
+ if (stationService.updateOrdeleteStationEnabled(model.getObject(), templatePage.getSession().getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
// label vide
@@ -139,13 +162,13 @@
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ManageStationPage(model.getObject().getIdStation(), currentPage));
+ templatePage.setResponsePage(new ManageStationPage(model.getObject().getIdStation(), callerPage));
}
});
final DataTable<Station, String> stationsDataTable = new AjaxFallbackDefaultDataTable<Station, String>(
- "ListStationsPage.Stations", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
-
- stationsRefresh.add(stationsDataTable);
+ componentId, columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
+ stationsDataTable.addBottomToolbar(new TableExportToolbar(stationsDataTable, "stations", templatePage.getSession().getLocale()));
+ return stationsDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -42,6 +42,7 @@
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.columns.MapValuePropertyColumn;
+import nc.ird.cantharella.web.utils.data.TableExportToolbar;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.models.LoadableDetachableSortableListDataProvider;
import nc.ird.cantharella.web.utils.security.AuthRole;
@@ -96,88 +97,108 @@
// Liste des résultats de tests biologiques
final List<ResultatTestBio> resTestsBios = testBioService.listResultatsTestBio(getSession().getUtilisateur());
+ DataTable<ResultatTestBio, String> resTestsBiosDataTable = initTestsBioDataTable(this,
+ "ListTestsBioPage.ResultatsTestsBio", currentPage, resTestsBios, testBioService);
+ resTestsBiosRefresh.add(resTestsBiosDataTable);
+ }
+ /**
+ * Init data table with testsbio list.
+ *
+ * This method is static to be reused in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param resTestsBios tests bio list
+ * @param testBioService test bio service
+ * @return data table component
+ */
+ public static DataTable<ResultatTestBio, String> initTestsBioDataTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<ResultatTestBio> resTestsBios, final TestBioService testBioService) {
+
LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
- resTestsBios, getSession().getLocale());
+ resTestsBios, templatePage.getSession().getLocale());
List<IColumn<ResultatTestBio, String>> columns = new ArrayList<IColumn<ResultatTestBio, String>>();
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/read.png", getString("Read"),
- getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/read.png", templatePage.getString("Read"),
+ templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
IModel<ResultatTestBio> model) {
- setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
+ templatePage.setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), callerPage));
}
});
columns.add(new TextFilteredPropertyColumn<ResultatTestBio, String, String>(new Model<String>(
- getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
+ templatePage.getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
- getLocale()));
+ templatePage.getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
+ templatePage.getLocale()));
- columns.add(new EnumPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.uniteConcMasse2")),
- "uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
+ columns.add(new EnumPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("TestBio.uniteConcMasse2")),
+ "uniteConcMasse", "uniteConcMasse", templatePage));
columns.add(new LinkProduitPropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
+ templatePage.getString("ResultatTestBio.produit")), "produit", "produit", templatePage) {
@Override
public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
+ templatePage.setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), callerPage));
}
@Override
public void onClickIfFraction(Fraction fraction) {
- setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
+ templatePage.setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), callerPage));
}
});
- columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.valeur")),
- "valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("ResultatTestBio.valeur")),
+ "valeur", "valeur", DecimalDisplFormat.SMALL, templatePage.getLocale()));
- columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("MethodeTestBio.uniteResultat2")),
"testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
- columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Extrait.typeExtrait2")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("Extrait.typeExtrait2")),
"typeExtraitSource", "typeExtraitSource"));
- columns.add(new BooleanPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.actif")),
- "actif", "actif", (TemplatePage) getPage()));
+ columns.add(new BooleanPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("ResultatTestBio.actif")),
+ "actif", "actif", templatePage));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.famille")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("Specimen.famille")),
"lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.genre")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("Specimen.genre")),
"lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.espece")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("Specimen.espece")),
"lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
columns.add(new MapValuePropertyColumn<ResultatTestBio, String, String>(new Model<String>(
- getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
- WebContext.COUNTRIES.get(getSession().getLocale())));
+ templatePage.getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
+ WebContext.COUNTRIES.get(templatePage.getSession().getLocale())));
- columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.repere")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("ResultatTestBio.repere")),
"repere", "repere"));
- columns.add(new LinkPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
- "testBio.ref", getString("Read")) {
+ columns.add(new LinkPropertyColumn<ResultatTestBio, String>(new Model<String>(templatePage.getString("TestBio.ref")), "testBio.ref",
+ "testBio.ref", templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
IModel<ResultatTestBio> model) {
- setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
+ templatePage.setResponsePage(new ReadTestBioPage(model.getObject().getTestBio().getIdTestBio(), callerPage));
}
});
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/edit.png", templatePage.getString("Update"),
+ templatePage.getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
IModel<ResultatTestBio> model) {
- if (testBioService.updateOrdeleteTestBioEnabled(model.getObject().getTestBio(), getSession()
+ if (testBioService.updateOrdeleteTestBioEnabled(model.getObject().getTestBio(), templatePage.getSession()
.getUtilisateur())) {
item.add(new LinkableImagePanel(item, componentId, model));
} else {
@@ -189,13 +210,13 @@
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
IModel<ResultatTestBio> model) {
- setResponsePage(new ManageTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
+ templatePage.setResponsePage(new ManageTestBioPage(model.getObject().getTestBio().getIdTestBio(), callerPage));
}
});
final DataTable<ResultatTestBio, String> resTestBiosDataTable = new AjaxFallbackDefaultDataTable<ResultatTestBio, String>(
- "ListTestsBioPage.ResultatsTestsBio", columns, resTestBiosDataProvider, WebContext.ROWS_PER_PAGE);
-
+ componentId, columns, resTestBiosDataProvider, WebContext.ROWS_PER_PAGE);
+ resTestBiosDataTable.addBottomToolbar(new TableExportToolbar(resTestBiosDataTable, "testsbio", templatePage.getSession().getLocale()));
// DRAFT FOR FILTER TABLE
// resTestBiosDataTable.addTopToolbar(new NavigationToolbar(resTestBiosDataTable));
// resTestBiosDataTable.addTopToolbar(new HeadersToolbar(resTestBiosDataTable, resTestBiosDataProvider));
@@ -207,7 +228,6 @@
* @Override protected void onSubmit() { resTestBiosDataTable.setCurrentPage(0); } }; resTestBiosDataTable
* .addTopToolbar(new FilterToolbar(resTestBiosDataTable, filterForm, resTestBiosDataProvider));
*/
- resTestsBiosRefresh.add(resTestBiosDataTable);
-
+ return resTestBiosDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,8 +22,6 @@
*/
package nc.ird.cantharella.web.utils.behaviors;
-import nc.ird.cantharella.web.pages.HomePage;
-
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.core.util.string.JavaScriptUtils;
@@ -32,8 +30,6 @@
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.Response;
-import org.apache.wicket.request.resource.CssResourceReference;
-import org.apache.wicket.request.resource.JavaScriptResourceReference;
/**
* Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -22,8 +22,6 @@
*/
package nc.ird.cantharella.web.utils.behaviors;
-import nc.ird.cantharella.web.pages.HomePage;
-
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.core.util.string.JavaScriptUtils;
@@ -32,8 +30,6 @@
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.Response;
-import org.apache.wicket.request.resource.CssResourceReference;
-import org.apache.wicket.request.resource.JavaScriptResourceReference;
/**
* Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -27,9 +27,9 @@
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
/**
@@ -38,7 +38,7 @@
* @param <T> Type of the row model
* @param <S> the type of the sort property
*/
-public class BooleanPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
+public class BooleanPropertyColumn<T, S> extends AbstractColumn<T, S> implements IExportableColumn<T, S, Object> {
/** wicket property expression */
private final String propertyExpression;
@@ -63,26 +63,13 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId, new DisplayBooleanPropertyModel(rowModel.getObject(), propertyExpression,
- page)));
+ cellItem.add(new Label(componentId, getDataModel(rowModel)));
}
/** {@inheritDoc} */
@Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
+ public IModel<Object> getDataModel(final IModel<T> rowModel) {
+ IModel<Object> textModel = new DisplayBooleanPropertyModel(rowModel.getObject(), propertyExpression, page);
+ return textModel;
}
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = new DisplayBooleanPropertyModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- }, propertyExpression, page);
- writer.write(textModel.getObject());
- textModel.detach();
- }
}
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/CsvWriter.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/CsvWriter.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/CsvWriter.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -1,102 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2013 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package nc.ird.cantharella.web.utils.columns;
-
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-/**
- * CsvWriter helper used to export data from data table.
- *
- * @author echatellier
- */
-public class CsvWriter {
-
- /** Output writer. */
- private final PrintWriter out;
-
- /** First column flag. */
- private boolean first = true;
-
- /** Csv separator. */
- private char separator;
-
- /**
- * Constructor.
- *
- * @param os output stream
- * @param separator csv separator
- */
- public CsvWriter(OutputStream os, char separator) {
- out = new PrintWriter(os);
- this.separator = separator;
- }
-
- /**
- * Write simple column data.
- *
- * @param value value to write
- * @return {@code this}
- */
- public CsvWriter write(Object value) {
- if (!first) {
- out.append(separator);
- }
- out.append("\"");
- if (value != null) {
- out.append(value.toString().replace("\"", "\"\"")
- .replace("\n", " "));
- }
- out.append("\"");
- first = false;
- return this;
- }
-
- /**
- * End current line.
- *
- * @return {@code this}
- */
- public CsvWriter endLine() {
- out.append("\r\n");
- first = true;
- return this;
- }
-
- /**
- * Flush output stream.
- *
- * @return {@code this}
- */
- public CsvWriter flush() {
- out.flush();
- return this;
- }
-
- /**
- * Close output stream.
- */
- public void close() {
- out.close();
- }
-}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -29,9 +29,9 @@
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
/**
@@ -40,7 +40,7 @@
* @param <T> Type of the row model
* @param <S> the type of the sort property
*/
-public class DecimalPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
+public class DecimalPropertyColumn<T, S> extends AbstractColumn<T, S> implements IExportableColumn<T, S, Object> {
/** wicket property expression */
private final String propertyExpression;
@@ -70,27 +70,14 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId, new DisplayDecimalPropertyModel(rowModel.getObject(), propertyExpression,
- format, locale)));
+ cellItem.add(new Label(componentId, getDataModel(rowModel)));
}
/** {@inheritDoc} */
@Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
+ public IModel<Object> getDataModel(IModel<T> rowModel) {
+ return new DisplayDecimalPropertyModel(rowModel.getObject(), propertyExpression,
+ format, locale);
}
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = new DisplayDecimalPropertyModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- }, propertyExpression, format, locale);
- writer.write(textModel.getObject());
- textModel.detach();
- }
-
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -27,9 +27,9 @@
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
/**
@@ -38,7 +38,7 @@
* @param <T> Type of the row model
* @param <S> the type of the sort property
*/
-public class EnumPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
+public class EnumPropertyColumn<T, S> extends AbstractColumn<T, S> implements IExportableColumn<T, S, Object> {
/** wicket property expression */
private final String propertyExpression;
@@ -63,26 +63,12 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId,
- new DisplayEnumPropertyModel(rowModel.getObject(), propertyExpression, page)));
+ cellItem.add(new Label(componentId, getDataModel(rowModel)));
}
/** {@inheritDoc} */
@Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
+ public IModel<Object> getDataModel(IModel<T> rowModel) {
+ return new DisplayEnumPropertyModel(rowModel.getObject(), propertyExpression, page);
}
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = new DisplayEnumPropertyModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- }, propertyExpression, page);
- writer.write(textModel.getObject());
- textModel.detach();
- }
}
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package nc.ird.cantharella.web.utils.columns;
-
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-
-/**
- * Interface to mark column as exportable.
- *
- * @author echatellier
- *
- * @param <T>
- * @param <S> the type of the sort property
- */
-public interface ExportableColumn<T, S> extends IColumn<T, S> {
-
- /** Export column name. */
- String getHeaderName();
-
- /** Export current object into writer. */
- void exportCsv(T object, CsvWriter writer);
- }
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -1,69 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package nc.ird.cantharella.web.utils.columns;
-
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.model.AbstractReadOnlyModel;
-import org.apache.wicket.model.IModel;
-
-/**
- * Override {@link PropertyColumn} to addd export support.
- *
- * @author echatellier
- *
- * @param <T>
- * @param <S> the type of the sort property
- */
-public class ExportablePropertyColumn<T, S> extends PropertyColumn<T, S> implements
- ExportableColumn<T, S> {
-
- /**
- * Constructor.
- *
- * @param displayModel display model
- * @param sortProperty wicket sort property
- * @param propertyExpression wicket sort expression
- */
- public ExportablePropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression) {
- super(displayModel, sortProperty, propertyExpression);
- }
-
- /** {@inheritDoc} */
- @Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
- }
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = createLabelModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- });
- writer.write(textModel.getObject());
- textModel.detach();
- }
-}
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -1,70 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package nc.ird.cantharella.web.utils.columns;
-
-import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.TextFilteredPropertyColumn;
-import org.apache.wicket.model.AbstractReadOnlyModel;
-import org.apache.wicket.model.IModel;
-
-/**
- * Override {@link TextFilteredPropertyColumn} to add export support.
- *
- * @author echatellier
- *
- * @param <T>
- * @param <F>
- * @param <S> the type of the sort property
- */
-public class ExportableTextFilteredPropertyColumn<T, F, S> extends TextFilteredPropertyColumn<T, F, S> implements ExportableColumn<T, S> {
-
- /**
- * Constructor.
- *
- * @param displayModel display model
- * @param sortProperty wicket sort property
- * @param propertyExpression wicket sort expression
- */
- public ExportableTextFilteredPropertyColumn(IModel<String> displayModel,
- S sortProperty, String propertyExpression) {
- super(displayModel, sortProperty, propertyExpression);
- }
-
- /** {@inheritDoc} */
- @Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
- }
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = createLabelModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- });
- writer.write(textModel.getObject());
- textModel.detach();
- }
-}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -30,7 +30,6 @@
import org.apache.wicket.markup.html.link.PopupSettings;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
@@ -40,7 +39,7 @@
* @param <T> Generic type
* @param <S> the type of the sort property
*/
-abstract public class LinkPropertyColumn<T, S> extends PropertyColumn<T, S> implements ExportableColumn<T, S>{
+abstract public class LinkPropertyColumn<T, S> extends PropertyColumn<T, S> {
/** Popup settings */
private PopupSettings popupSettings;
@@ -166,29 +165,10 @@
IModel<?> tmpLabelModel = labelModel;
if (labelModel == null) {
- tmpLabelModel = createLabelModel(model);
+ tmpLabelModel = getDataModel(model);
}
link.add(new Label("label", tmpLabelModel));
}
}
-
- /** {@inheritDoc} */
- @Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
- }
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = createLabelModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- });
- writer.write(textModel.getObject());
- textModel.detach();
- }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -28,9 +28,9 @@
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
/**
@@ -40,7 +40,7 @@
* @param <S> the type of the sort property
* @param <U> Type of the map key. The map is thus parametred by <U, String>
*/
-public class MapValuePropertyColumn<T, S, U> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
+public class MapValuePropertyColumn<T, S, U> extends AbstractColumn<T, S> implements IExportableColumn<T, S, Object> {
/** wicket property expression */
private final String propertyExpression;
@@ -65,26 +65,13 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId, new DisplayMapValuePropertyModel<U>(rowModel.getObject(),
- propertyExpression, map)));
+ cellItem.add(new Label(componentId, getDataModel(rowModel)));
}
/** {@inheritDoc} */
@Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
+ public IModel<Object> getDataModel(IModel<T> rowModel) {
+ return new DisplayMapValuePropertyModel<U>(rowModel.getObject(),
+ propertyExpression, map);
}
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = new DisplayMapValuePropertyModel<U>(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- }, propertyExpression, map);
- writer.write(textModel.getObject());
- textModel.detach();
- }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -28,9 +28,9 @@
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.IExportableColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
/**
@@ -39,7 +39,7 @@
* @param <T> Type of the row model
* @param <S> the type of the sort property
*/
-public class ShortDatePropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
+public class ShortDatePropertyColumn<T, S> extends AbstractColumn<T, S> implements IExportableColumn<T, S, Object> {
/** wicket property expression */
private final String propertyExpression;
@@ -64,26 +64,13 @@
/** {@inheritDoc} */
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId, new DisplayShortDatePropertyModel(rowModel.getObject(), propertyExpression,
- locale)));
+ cellItem.add(new Label(componentId, getDataModel(rowModel)));
}
/** {@inheritDoc} */
@Override
- public String getHeaderName() {
- return getDisplayModel().getObject().toString();
+ public IModel<Object> getDataModel(IModel<T> rowModel) {
+ return new DisplayShortDatePropertyModel(rowModel.getObject(), propertyExpression,
+ locale);
}
-
- /** {@inheritDoc} */
- @Override
- public void exportCsv(final T object, CsvWriter writer) {
- IModel<?> textModel = new DisplayShortDatePropertyModel(new AbstractReadOnlyModel<T>() {
- @Override
- public T getObject() {
- return object;
- }
- }, propertyExpression, locale);
- writer.write(textModel.getObject());
- textModel.detach();
- }
}
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/TableExportToolbar.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/TableExportToolbar.java (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/TableExportToolbar.java 2013-02-15 11:49:11 UTC (rev 115)
@@ -0,0 +1,64 @@
+/*
+ * #%L
+ * Cantharella :: Web
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package nc.ird.cantharella.web.utils.data;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.CSVDataExporter;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.export.ExportToolbar;
+import org.apache.wicket.model.Model;
+
+/**
+ * Cantharella customisation of wicket {@link ExportToolbar}.
+ *
+ * @author Eric Chatellier
+ */
+public class TableExportToolbar extends ExportToolbar {
+
+ public TableExportToolbar(DataTable<?, ?> table, String fileName, Locale locale) {
+ super(table);
+
+ // set message model
+ setMessageModel(new Model<String>(getString("ExportTo")));
+
+ // file name model
+ DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd-HH_mm-");
+ String headerFilename = dateFormat.format(new Date());
+ setFileNameModel(new Model<String>(headerFilename + fileName));
+
+ CSVDataExporter csvDataExporter = new CSVDataExporter();
+ // configuration du separateur suivant la locale
+ // fr : ;
+ // en : ,
+ if (Locale.FRENCH.equals(locale)) {
+ csvDataExporter.setDelimiter(';');
+ } else {
+ csvDataExporter.setDelimiter(',');
+ }
+ addDataExporter(csvDataExporter);
+ }
+}
Property changes on: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/data/TableExportToolbar.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/cantharella.web/src/main/resources/web_en.properties
===================================================================
--- trunk/cantharella.web/src/main/resources/web_en.properties 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/resources/web_en.properties 2013-02-15 11:49:11 UTC (rev 115)
@@ -303,7 +303,6 @@
SearchPage.Molecules=Molecules
SearchPage.QuerySyntax=Search terms (or parts of words using *). For a more advanced search, consult the ${advancedLink}.
SearchPage.QuerySyntaxAdvanced=complete syntax
-SearchPage.ExportCSV=Export to CSV
#MODELS#
@@ -418,7 +417,7 @@
Valid=Valid
Reject=Reject
Rebuild=Rebuild
-Create=Create
+Create=Create
Add=Add
Update=Modify
Delete=Delete
@@ -428,6 +427,7 @@
ReadPurification=View the purification
TODO=ToDo
Confirm=Are you sure?
+ExportTo=Export to
List.none=The list is empty.
Boolean.true=yes
Boolean.false=no
Modified: trunk/cantharella.web/src/main/resources/web_fr.properties
===================================================================
--- trunk/cantharella.web/src/main/resources/web_fr.properties 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/resources/web_fr.properties 2013-02-15 11:49:11 UTC (rev 115)
@@ -302,7 +302,6 @@
SearchPage.Molecules=Molécules
SearchPage.QuerySyntax=Rechercher des termes (ou des parties de termes avec *). Pour une utilisation plus avancée de la recherche, consulter la ${advancedLink}.
SearchPage.QuerySyntaxAdvanced=synthaxe complète
-SearchPage.ExportCSV=Exporter en CSV
#MODELS#
@@ -426,6 +425,7 @@
ReadPurification=Consulter la purification
TODO=ToDo
Confirm=Êtes-vous sûr ?
+ExportTo=Exporter en
List.none=La liste est vide.
Boolean.true=oui
Boolean.false=non
Modified: trunk/cantharella.web/src/main/webapp/css/general.css
===================================================================
--- trunk/cantharella.web/src/main/webapp/css/general.css 2013-02-15 07:33:46 UTC (rev 114)
+++ trunk/cantharella.web/src/main/webapp/css/general.css 2013-02-15 11:49:11 UTC (rev 115)
@@ -389,6 +389,14 @@
#content table thead {
background-color: #CAD7E2;
color:#003f58;
+}
+
+#content table thead .navigatorLabel {
+ float: left;
+}
+
+#content table thead .navigator {
+ text-align: right;
}
#content table th {
1
0
r114 - in trunk: cantharella.data/src/main/java/nc/ird/cantharella/data/config cantharella.data/src/main/resources cantharella.service/src/main/java/nc/ird/cantharella/service/config cantharella.service/src/main/resources cantharella.web/src/main/java/nc/ird/cantharella/web/config cantharella.web/src/main/resources
by acheype@users.forge.codelutin.com 15 Feb '13
by acheype@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: acheype
Date: 2013-02-15 08:33:46 +0100 (Fri, 15 Feb 2013)
New Revision: 114
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/114
Log:
replace the placeholder xml configuration with a java based one. No more dataContext.xml and serviceContext.xml !
Removed:
trunk/cantharella.service/src/main/resources/serviceContext.xml
trunk/cantharella.web/src/main/resources/webContext.xml
Modified:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java
trunk/cantharella.data/src/main/resources/dataContext.xml
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2013-02-15 07:33:46 UTC (rev 114)
@@ -61,97 +61,120 @@
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.mchange.v2.c3p0.impl.DefaultConnectionTester;
+import java.util.logging.Level;
+import javax.annotation.Resource;
+import nc.ird.module.utils.CantharellaConfig;
+import org.nuiton.util.ArgumentsParserException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
/**
* Spring context for the data layer
* <p>
* DB_* properties can be placed in the properties file, if they vary depending on the environment.
* </p>
+ *
* @author Mickael Tricot
* @author Adrien Cheype
*/
// Import the spring context file
@ImportResource(value = "classpath:/dataContext.xml")
// Scans for @Repository, @Service and @Component
-@ComponentScan(basePackages = { "nc.ird.cantharella.data.dao", "nc.ird.cantharella.data.validation.utils" })
+@ComponentScan(basePackages = {"nc.ird.cantharella.data.dao", "nc.ird.cantharella.data.validation.utils"})
// Enable @Transactional support -> not work with <aop:aspectj-autoproxy /> in xml context file
@EnableTransactionManagement
// This is a configuration class
@Configuration
public abstract class DataContext {
- /** Logger */
+ /**
+ * Logger
+ */
private static final Logger LOG = LoggerFactory.getLogger(DataContext.class);
-
- /** Country codes */
+ /**
+ * Country codes
+ */
public static final List<String> COUNTRY_CODES = Collections.unmodifiableList(Arrays.asList(Locale
.getISOCountries()));
-
- /** DB connection: acquire retry attemps */
+ /**
+ * DB connection: acquire retry attemps
+ */
private static final int DB_CONNECTION_ACQUIRE_RETRY_ATTEMPS = 30;
-
- /** DB connexion: acquire retry delay */
+ /**
+ * DB connexion: acquire retry delay
+ */
private static final int DB_CONNECTION_ACQUIRE_RETRY_DELAY = 1000;
-
- /** DB pool: acquire increment */
+ /**
+ * DB pool: acquire increment
+ */
private static final int DB_POOL_ACQUIRE_INCREMENT = 3;
-
- /** DB pool: max size */
+ /**
+ * DB pool: max size
+ */
private static final int DB_POOL_MAX_SIZE = 15;
-
- /** DB pool: min size */
+ /**
+ * DB pool: min size
+ */
private static final int DB_POOL_MIN_SIZE = 3;
-
- /** Encoding */
+ /**
+ * Encoding
+ */
public static final String ENCODING = Charset.forName("UTF-8").name();
-
- /** Availables locales for the application */
+ /**
+ * Availables locales for the application
+ */
public static final List<Locale> LOCALES;
-
- /** Precision is the total number of digits */
+ /**
+ * Precision is the total number of digits
+ */
public static final int DECIMAL_PRECISION = 9;
-
/**
* Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a
* precision of 5 and a scale of 2
- **/
+ *
+ */
public static final int DECIMAL_SCALE = 4;
-
/**
* According to DECIMAL_PRECISION and DECIMAL_SCALE, number max allowed for decimals. Attention to ensure that is
* equal to 10^(DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE) -1
*/
public static final int DECIMAL_MAX = 99999;
-
- /** Référentiels */
+ /**
+ * Référentiels
+ */
public static final Map<Integer, String> REFERENTIELS;
-
- /** DB debug */
+ /**
+ * DB debug
+ */
@Value("${db.debug}")
protected boolean dbDebugProperty;
-
- /** DB password */
+ /**
+ * DB password
+ */
@Value("${db.password}")
protected String dbPasswordProperty;
-
- /** DB URL */
+ /**
+ * DB URL
+ */
@Value("${db.url}")
protected String dbUrlProperty;
-
- /** DB user */
+ /**
+ * DB user
+ */
@Value("${db.user}")
protected String dbUserProperty;
-
- /** DB user */
+ /**
+ * DB user
+ */
@Value("${db.hbm2ddl:validate}")
protected String hbm2ddl;
-
+
static {
// The first Locale in the list is the default one
List<Locale> locales = new ArrayList<Locale>();
locales.add(Locale.FRENCH);
locales.add(Locale.ENGLISH);
-
+
LOCALES = Collections.unmodifiableList(locales);
Locale.setDefault(LOCALES.get(0));
@@ -234,7 +257,7 @@
public SessionFactory sessionFactory() {
LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean();
sessionFactoryBean.setDataSource(dataSource());
- sessionFactoryBean.setPackagesToScan(new String[] { "nc.ird.cantharella.data.model" });
+ sessionFactoryBean.setPackagesToScan(new String[]{"nc.ird.cantharella.data.model"});
Properties hibernateProperties = new Properties();
// Hibernate: basic
hibernateProperties.setProperty(Environment.DIALECT, PostgreSQL82Dialect.class.getName());
@@ -318,4 +341,21 @@
return new ModelValidatorImpl(validatorFactory(), dataMessageSource());
}
+ /**
+ * Set the data layer properties for the cantharella configuration
+ * @return The placeholder configurer which get the data layer properties
+ */
+ @Bean
+ public static PropertySourcesPlaceholderConfigurer properties() {
+ PropertySourcesPlaceholderConfigurer pspc =
+ new PropertySourcesPlaceholderConfigurer();
+ try {
+ pspc.setProperties(CantharellaConfig.getProperties());
+ } catch (ArgumentsParserException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ pspc.setIgnoreUnresolvablePlaceholders(true);
+ return pspc;
+ }
}
Modified: trunk/cantharella.data/src/main/resources/dataContext.xml
===================================================================
--- trunk/cantharella.data/src/main/resources/dataContext.xml 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.data/src/main/resources/dataContext.xml 2013-02-15 07:33:46 UTC (rev 114)
@@ -37,15 +37,6 @@
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
- <bean id="propertiesConfig"
- class="nc.ird.module.utils.CantharellaConfig" factory-method="getProperties"/>
-
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="properties" ref="propertiesConfig" />
- <!-- set on except on the last file to allow multiple files to load -->
- <property name="ignoreUnresolvablePlaceholders" value="true"/>
- </bean>
-
<!-- Enable @Transactional support -->
<tx:annotation-driven/>
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java 2013-02-15 07:33:46 UTC (rev 114)
@@ -25,11 +25,16 @@
import java.util.Properties;
import nc.ird.cantharella.data.config.DataContext;
+import nc.ird.cantharella.data.exceptions.UnexpectedException;
import nc.ird.cantharella.data.model.Utilisateur;
import nc.ird.cantharella.data.model.Utilisateur.TypeDroit;
import nc.ird.cantharella.service.utils.normalizers.PersonneNormalizer;
import nc.ird.cantharella.service.utils.normalizers.utils.Normalizer;
+import nc.ird.module.utils.CantharellaConfig;
import nc.ird.module.utils.PasswordTools;
+import org.nuiton.util.ArgumentsParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@@ -38,6 +43,7 @@
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
@@ -50,8 +56,6 @@
*/
// Load the data-layer configuration
@Import(DataContext.class)
-// Import the spring context file
-@ImportResource(value = "classpath:/serviceContext.xml")
// Scans for @Repository, @Service and @Component
@ComponentScan(basePackages = { "nc.ird.cantharella.service.services", "nc.ird.cantharella.service.utils" })
// Enable @Transactional support -> not work with <aop:aspectj-autoproxy /> in xml context file
@@ -60,6 +64,11 @@
@Configuration
public abstract class ServiceContext {
+ /**
+ * Logger
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(ServiceContext.class);
+
/** Mail SMTP: port */
private static final int MAIL_SMTP_PORT = 25;
@@ -166,4 +175,22 @@
serviceMessageSource.setCacheSeconds(-1);
return new MessageSourceAccessor(serviceMessageSource);
}
+
+ /**
+ * Set the service layer properties for the cantharella configuration
+ * @return The placeholder configurer which get the service layer properties
+ */
+ @Bean
+ public static PropertySourcesPlaceholderConfigurer properties() {
+ PropertySourcesPlaceholderConfigurer pspc =
+ new PropertySourcesPlaceholderConfigurer();
+ try {
+ pspc.setProperties(CantharellaConfig.getProperties());
+ } catch (ArgumentsParserException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ pspc.setIgnoreUnresolvablePlaceholders(true);
+ return pspc;
+ }
}
Deleted: trunk/cantharella.service/src/main/resources/serviceContext.xml
===================================================================
--- trunk/cantharella.service/src/main/resources/serviceContext.xml 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.service/src/main/resources/serviceContext.xml 2013-02-15 07:33:46 UTC (rev 114)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- Cantharella :: Service
- $Id:$
- $HeadURL:$
- %%
- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd">
-
- <bean id="propertiesConfig"
- class="nc.ird.module.utils.CantharellaConfig" factory-method="getProperties"/>
-
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="properties" ref="propertiesConfig" />
- <!-- set on except on the last file to allow multiple files to load -->
- <property name="ignoreUnresolvablePlaceholders" value="true"/>
- </bean>
-
-</beans>
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 07:33:46 UTC (rev 114)
@@ -37,10 +37,12 @@
import javax.validation.ValidatorFactory;
import nc.ird.cantharella.data.config.DataContext;
+import nc.ird.cantharella.data.exceptions.UnexpectedException;
import nc.ird.cantharella.data.validation.utils.ModelValidator;
import nc.ird.cantharella.data.validation.utils.ModelValidatorImpl;
import nc.ird.cantharella.service.config.ServiceContext;
import nc.ird.cantharella.web.utils.resources.WebMessages;
+import nc.ird.module.utils.CantharellaConfig;
import nc.ird.module.utils.Pair;
import nc.ird.module.utils.StringTools;
@@ -48,12 +50,16 @@
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.util.lang.Bytes;
import org.apache.wicket.util.time.Duration;
+import org.nuiton.util.ArgumentsParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.util.Log4jConfigurer;
@@ -65,13 +71,16 @@
*/
// Load the service-layer configuration
@Import(ServiceContext.class)
-// Import the spring context file
-@ImportResource(value = "classpath:/webContext.xml")
// This is a configuration class
@Configuration
public abstract class WebContext {
/**
+ * Logger
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(WebContext.class);
+
+ /**
* Cookie key for authentification
*/
public static final String AUTH_COOKIE_KEY = "LoggedIn";
@@ -224,9 +233,27 @@
}
/**
+ * Set the web layer properties for the cantharella configuration
+ * @return The placeholder configurer which get the web layer properties
+ */
+ @Bean
+ public static PropertySourcesPlaceholderConfigurer properties() {
+ PropertySourcesPlaceholderConfigurer pspc =
+ new PropertySourcesPlaceholderConfigurer();
+ try {
+ pspc.setProperties(CantharellaConfig.getProperties());
+ } catch (ArgumentsParserException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ pspc.setIgnoreUnresolvablePlaceholders(true);
+ return pspc;
+ }
+
+ /**
* Init the log4j configuration filepath
*
- * @throws FileNotFoundException
+ * @throws FileNotFoundException If the config file is not found
*/
@PostConstruct
public void initLog4j() throws FileNotFoundException {
Deleted: trunk/cantharella.web/src/main/resources/webContext.xml
===================================================================
--- trunk/cantharella.web/src/main/resources/webContext.xml 2013-02-15 06:40:39 UTC (rev 113)
+++ trunk/cantharella.web/src/main/resources/webContext.xml 2013-02-15 07:33:46 UTC (rev 114)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- Cantharella :: Web
- $Id:$
- $HeadURL:$
- %%
- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd">
-
- <bean id="propertiesConfig"
- class="nc.ird.module.utils.CantharellaConfig" factory-method="getProperties"/>
-
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="properties" ref="propertiesConfig" />
- <!-- set on except on the last file to allow multiple files to load -->
- <property name="ignoreUnresolvablePlaceholders" value="true"/>
- </bean>
-
-</beans>
\ No newline at end of file
1
0
r113 - in trunk/cantharella.web/src/main: java/nc/ird/cantharella/web/config resources
by acheype@users.forge.codelutin.com 15 Feb '13
by acheype@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: acheype
Date: 2013-02-15 07:40:39 +0100 (Fri, 15 Feb 2013)
New Revision: 113
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/113
Log:
add the variable in the cantharella.conf to define the log4j configuration filepath
Modified:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
trunk/cantharella.web/src/main/resources/cantharella.conf
trunk/cantharella.web/src/main/resources/log4j_prod.xml
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 05:08:09 UTC (rev 112)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-02-15 06:40:39 UTC (rev 113)
@@ -22,6 +22,7 @@
*/
package nc.ird.cantharella.web.config;
+import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -30,6 +31,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.validation.ValidatorFactory;
@@ -53,9 +55,11 @@
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
+import org.springframework.util.Log4jConfigurer;
/**
* Spring context for the web layer
+ *
* @author Mickael Tricot
* @author Adrien Cheype
*/
@@ -67,66 +71,88 @@
@Configuration
public abstract class WebContext {
- /** Cookie key for authentification */
+ /**
+ * Cookie key for authentification
+ */
public static final String AUTH_COOKIE_KEY = "LoggedIn";
-
- /** Cookie max age for authentification */
+ /**
+ * Cookie max age for authentification
+ */
public static final int AUTH_COOKIE_MAX_AGE = (int) Duration.days(1).seconds();
-
/**
* Countries: Locale -> country code + country name (sorted by country name)
*/
public static final Map<Locale, Map<String, String>> COUNTRIES;
-
- /** Country codes: Locale -> country code (sorted by country name) */
+ /**
+ * Country codes: Locale -> country code (sorted by country name)
+ */
public static final Map<Locale, List<String>> COUNTRY_CODES;
-
- /** HTTP cache duraction */
+ /**
+ * HTTP cache duraction
+ */
public static final Duration HTTP_CACHE_DURATION = Duration.days(1);
-
- /** HTTP maximum upload */
+ /**
+ * HTTP maximum upload
+ */
public static final Bytes HTTP_MAXIMUM_UPLOAD = Bytes.megabytes(1);
-
- /** HTTP request logger window size */
+ /**
+ * HTTP request logger window size
+ */
public static final int HTTP_REQUEST_LOGGER_WINDOW_SIZE = 2000;
-
- /** HTTP session max page maps */
+ /**
+ * HTTP session max page maps
+ */
public static final int HTTP_SESSION_MAX_PAGE_MAPS = 5;
-
- /** HTTP time out */
+ /**
+ * HTTP time out
+ */
public static final Duration HTTP_TIME_OUT = Duration.seconds(30);
-
- /** Référentiels codes */
+ /**
+ * Référentiels codes
+ */
public static final List<Integer> REFERENTIEL_CODES = new ArrayList<Integer>(DataContext.REFERENTIELS.keySet());
-
- /** Percent format precision */
+ /**
+ * Percent format precision
+ */
public static final int PERCENT_PRECISION = 2;
-
- /** The maximum number of digits allowed in the fraction portion of doubles **/
+ /**
+ * The maximum number of digits allowed in the fraction portion of doubles *
+ */
public static final int DOUBLE_MAX_FRACTION_DIGIT = 3;
-
- /** The maximum rows number displayed for a list page */
+ /**
+ * The maximum rows number displayed for a list page
+ */
public static final int ROWS_PER_PAGE = 20;
-
- /** Message source for data layer */
+ /**
+ * Message source for data layer
+ */
@Resource(name = "dataMessageSource")
private MessageSourceAccessor dataMessageSource;
-
- /** Validator factory of the data layer */
+ /**
+ * Validator factory of the data layer
+ */
@Resource(name = "validatorFactory")
private ValidatorFactory validatorFactory;
-
- /** Debug mode */
+ /**
+ * Debug mode
+ */
@Value("${app.debug}")
protected boolean appDebugProperty;
-
- /** Optimize mode */
+ /**
+ * Optimize mode
+ */
@Value("${app.optimize}")
protected boolean appOptimizeProperty;
-
- /** Wicket configuration string ("development" or "deployment") */
+ /**
+ * Wicket configuration string ("development" or "deployment")
+ */
@Value("${wicket.configuration}")
protected String wicketConfiguration;
+ /**
+ * Log4j configuration filepath
+ */
+ @Value("${log4j.config}")
+ protected String log4jConfig;
static {
Map<Locale, Map<String, String>> countries = new HashMap<Locale, Map<String, String>>(
@@ -196,4 +222,14 @@
return new WebApplicationImpl(appDebugProperty, appOptimizeProperty, runtimeWicketConf, new WebMessages(
dataMessageSource), new WebMessages(webMessageSource()));
}
+
+ /**
+ * Init the log4j configuration filepath
+ *
+ * @throws FileNotFoundException
+ */
+ @PostConstruct
+ public void initLog4j() throws FileNotFoundException {
+ Log4jConfigurer.initLogging(log4jConfig);
+ }
}
Modified: trunk/cantharella.web/src/main/resources/cantharella.conf
===================================================================
--- trunk/cantharella.web/src/main/resources/cantharella.conf 2013-02-15 05:08:09 UTC (rev 112)
+++ trunk/cantharella.web/src/main/resources/cantharella.conf 2013-02-15 06:40:39 UTC (rev 113)
@@ -32,5 +32,7 @@
wicket.configuration=development
# value for production
#wicket.configuration=deployment
+log4j.config=classpath:log4j.xml
+# value for production
+#log4j.config=/home/tomcat/.config/log4j_prod.xml
-
Modified: trunk/cantharella.web/src/main/resources/log4j_prod.xml
===================================================================
--- trunk/cantharella.web/src/main/resources/log4j_prod.xml 2013-02-15 05:08:09 UTC (rev 112)
+++ trunk/cantharella.web/src/main/resources/log4j_prod.xml 2013-02-15 06:40:39 UTC (rev 113)
@@ -27,7 +27,7 @@
<!-- Asynchronous daily rolling file logs -->
<appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="file" value="${catalina.home}/logs/cantharella.log" />
+ <param name="file" value="/opt/tomcat/logs/cantharella.log" />
<param name="threshold" value="info" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
1
0
r112 - in trunk: . cantharella.data cantharella.data/src/main/resources cantharella.service cantharella.service/src/main/resources cantharella.utils cantharella.web cantharella.web/src/main/java/nc/ird/cantharella/web/pages cantharella.web/src/main/resources
by acheype@users.forge.codelutin.com 15 Feb '13
by acheype@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: acheype
Date: 2013-02-15 06:08:09 +0100 (Fri, 15 Feb 2013)
New Revision: 112
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/112
Log:
Cleaning the pom.xml for all the modules
Added:
trunk/cantharella.web/src/main/resources/log4j.xml
trunk/cantharella.web/src/main/resources/log4j_prod.xml
Removed:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.java
trunk/cantharella.web/src/main/resources/log4j.xml
Modified:
trunk/cantharella.data/pom.xml
trunk/cantharella.data/src/main/resources/cantharella.conf
trunk/cantharella.service/pom.xml
trunk/cantharella.service/src/main/resources/cantharella.conf
trunk/cantharella.utils/pom.xml
trunk/cantharella.web/
trunk/cantharella.web/pom.xml
trunk/cantharella.web/src/main/resources/cantharella.conf
trunk/pom.xml
Modified: trunk/cantharella.data/pom.xml
===================================================================
--- trunk/cantharella.data/pom.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.data/pom.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,181 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>nc.ird</groupId>
- <artifactId>cantharella</artifactId>
- <version>1.1-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>nc.ird</groupId>
+ <artifactId>cantharella</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
- <artifactId>cantharella.data</artifactId>
- <name>Cantharella :: Data</name>
+ <artifactId>cantharella.data</artifactId>
+ <name>Cantharella :: Data</name>
- <build>
- <plugins>
- <!-- Plugins for the data layer -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>hibernate3-maven-plugin</artifactId>
- <configuration>
- <components>
- <component>
- <name>hbm2ddl</name>
- <implementation>annotationconfiguration</implementation>
- </component>
- </components>
- <componentProperties>
- <scan-classes>true</scan-classes>
- <format>true</format>
- <export>false</export>
- <update>false</update>
- <outputfilename>cantharella.sql</outputfilename>
- </componentProperties>
- </configuration>
- <dependencies>
- <dependency>
+ <build>
+ <plugins>
+ <!-- Plugins for the data layer -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>hibernate3-maven-plugin</artifactId>
+ <configuration>
+ <components>
+ <component>
+ <name>hbm2ddl</name>
+ <implementation>annotationconfiguration</implementation>
+ </component>
+ </components>
+ <componentProperties>
+ <scan-classes>true</scan-classes>
+ <format>true</format>
+ <export>false</export>
+ <update>false</update>
+ <outputfilename>cantharella.sql</outputfilename>
+ </componentProperties>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${version.postgresql}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+ <dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
- <version>${version.postgresql}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.utils</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>c3p0</groupId>
- <artifactId>c3p0</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-ehcache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>c3p0</groupId>
+ <artifactId>c3p0</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/resources/cantharella.conf
===================================================================
--- trunk/cantharella.data/src/main/resources/cantharella.conf 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.data/src/main/resources/cantharella.conf 2013-02-15 05:08:09 UTC (rev 112)
@@ -28,4 +28,6 @@
db.user=cantharella
db.password=cantharella
db.debug=true
+# value for production
+#db.debug=false
db.hbm2ddl=validate
Modified: trunk/cantharella.service/pom.xml
===================================================================
--- trunk/cantharella.service/pom.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.service/pom.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,140 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>cantharella</artifactId>
- <groupId>nc.ird</groupId>
- <version>1.1-SNAPSHOT</version>
- </parent>
+ <parent>
+ <artifactId>cantharella</artifactId>
+ <groupId>nc.ird</groupId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
- <artifactId>cantharella.service</artifactId>
- <name>Cantharella :: Service</name>
+ <artifactId>cantharella.service</artifactId>
+ <name>Cantharella :: Service</name>
- <dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.data</artifactId>
+ <version>${project.version}</version>
+ </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.utils</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.data</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- ??? -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.poi</groupId>
+ <artifactId>poi</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/resources/cantharella.conf
===================================================================
--- trunk/cantharella.service/src/main/resources/cantharella.conf 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.service/src/main/resources/cantharella.conf 2013-02-15 05:08:09 UTC (rev 112)
@@ -25,6 +25,8 @@
# SERVICE CONFIGURATION
#
mail.debug=true
+# value for production
+#mail.debug=false
mail.from=no-reply(a)ird.fr
mail.host=smtp
Modified: trunk/cantharella.utils/pom.xml
===================================================================
--- trunk/cantharella.utils/pom.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.utils/pom.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,50 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>nc.ird</groupId>
- <artifactId>cantharella</artifactId>
- <version>1.1-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>nc.ird</groupId>
+ <artifactId>cantharella</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
- <artifactId>cantharella.utils</artifactId>
- <name>Cantharella :: Utils</name>
+ <artifactId>cantharella.utils</artifactId>
+ <name>Cantharella :: Utils</name>
- <dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ </dependency>
+ </dependencies>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>nuiton-utils</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
</project>
\ No newline at end of file
Property changes on: trunk/cantharella.web
___________________________________________________________________
Modified: svn:ignore
- .apt_generated
target
*.ipr
*.iws
*.iml
.idea
.classpath
.project
.settings
+ *.ipr
nb-configuration.xml
*.iws
.classpath
*.iml
.idea
.project
target
.apt_generated
nbactions.xml
.settings
Modified: trunk/cantharella.web/pom.xml
===================================================================
--- trunk/cantharella.web/pom.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.web/pom.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,300 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>cantharella</artifactId>
- <groupId>nc.ird</groupId>
- <version>1.1-SNAPSHOT</version>
- </parent>
+ <parent>
+ <artifactId>cantharella</artifactId>
+ <groupId>nc.ird</groupId>
+ <version>1.1-SNAPSHOT</version>
+ </parent>
- <artifactId>cantharella.web</artifactId>
- <name>Cantharella :: Web</name>
- <packaging>war</packaging>
+ <artifactId>cantharella.web</artifactId>
+ <name>Cantharella :: Web</name>
+ <packaging>war</packaging>
- <properties>
- <!-- Deployment details for the integration server, host & password to update -->
- <deploy.integration-host>INTEGRATION_SVR</deploy.integration-host>
- <deploy.integration-port>8080</deploy.integration-port>
- <deploy.integration-user>admin</deploy.integration-user>
- <deploy.integration-password>INTEGRATION_PASSWD
- </deploy.integration-password>
- <!-- Deployment details for the production server, host & password to update -->
- <deploy.production-host>PROD_SVR</deploy.production-host>
- <deploy.production-port>80</deploy.production-port>
- <deploy.production-user>admin</deploy.production-user>
- <deploy.production-password>PROD_PASSWD</deploy.production-password>
- <deploy.production-war-name>ROOT</deploy.production-war-name>
-
- </properties>
- <build>
- <resources>
- <!-- for html in java packages (wicket) -->
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
-
- <!-- Default resources for the web layer -->
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- </build>
-
- <profiles>
- <profile>
- <id>integration</id>
- <build>
- <!-- Integration plugins for the web layer -->
+ <build>
+ <resources>
+ <!-- for html in java packages (wicket) -->
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/java</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ <!-- Default resources for the web layer -->
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
<plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
-
- <executions>
- <execution>
- <id>redeploy</id>
- <phase>install</phase>
- <goals>
- <goal>redeploy</goal>
- </goals>
+ <!-- Default plugins for the web layer -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
<configuration>
- <container>
- <containerId>tomcat7x</containerId>
- <type>remote</type>
- </container>
- <configuration>
- <type>runtime</type>
- <properties>
- <cargo.remote.uri>
- http://${deploy.integration-host}:${deploy.integration-port}/manager/text
- </cargo.remote.uri>
- <cargo.remote.username>${deploy.integration-user}
- </cargo.remote.username>
- <cargo.remote.password>${deploy.integration-password}
- </cargo.remote.password>
- </properties>
- </configuration>
- <deployer>
- <type>remote</type>
- <deployables>
- <deployable>
- <groupId>${project.groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <type>war</type>
- <pingURL>
- http://${deploy.integration-host}:${deploy.integration-port}/${parent.project.build.finalName}/
- </pingURL>
- </deployable>
- </deployables>
- </deployer>
+ <scanIntervalSeconds>2</scanIntervalSeconds>
+ <stopPort>9966</stopPort>
+ <stopKey>jetty-stop</stopKey>
</configuration>
- </execution>
- </executions>
- </plugin>
+ </plugin>
</plugins>
- </build>
- </profile>
- <profile>
- <id>production</id>
- <build>
- <!-- Production plugins for the web layer -->
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <executions>
- <execution>
- <id>redeploy</id>
- <phase>install</phase>
- <goals>
- <goal>redeploy</goal>
- </goals>
- <configuration>
- <container>
- <containerId>tomcat7x</containerId>
- <type>remote</type>
- </container>
- <configuration>
- <type>runtime</type>
- <properties>
- <cargo.remote.uri>
- http://${deploy.production-host}:${deploy.production-port}/manager/text
- </cargo.remote.uri>
- <cargo.remote.username>${deploy.production-user}
- </cargo.remote.username>
- <cargo.remote.password>${deploy.production-password}
- </cargo.remote.password>
- </properties>
- </configuration>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.data</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.service</artifactId>
+ <version>${project.version}</version>
+ </dependency>
- <deployer>
- <type>remote</type>
- <deployables>
- <deployable>
- <groupId>${project.groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <type>war</type>
- <pingURL>
- http://${deploy.production-host}:${deploy.production-port}/
- </pingURL>
- <properties>
- <context>/</context>
- </properties>
- </deployable>
- </deployables>
- </deployer>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <dependencies>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.data</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.service</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-ioc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- </dependency>
- <!--dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-auth-roles</artifactId>
- </dependency -->
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-datetime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-spring</artifactId>
- </dependency>
-
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-ioc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-request</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-datetime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-spring</artifactId>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.html
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.html 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.html 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,31 +0,0 @@
-<!--
- #%L
- Cantharella :: Web
- $Id:$
- $HeadURL:$
- %%
- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<!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" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
-<head>
-<title>Sandbox</title>
-</head>
-<body>
- <!-- Page dedicated to test some Wicket behaviors -->
-</body>
-</html>
\ No newline at end of file
Deleted: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.java 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.java 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,96 +0,0 @@
-/*
- * #%L
- * Cantharella :: Web
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package nc.ird.cantharella.web.pages;
-
-import java.util.List;
-
-import nc.ird.cantharella.data.dao.GenericDao;
-import nc.ird.cantharella.data.dao.impl.PersonneDao;
-import nc.ird.cantharella.data.model.Utilisateur;
-import nc.ird.cantharella.data.model.Utilisateur.TypeDroit;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.hibernate.criterion.DetachedCriteria;
-import org.hibernate.criterion.Restrictions;
-
-/**
- * Page dedicated to test some Wicket behaviors
- * @author Adrien Cheype
- */
-public class SandboxPage extends WebPage {
-
- /** Logger */
- private static final Logger LOG = LoggerFactory.getLogger(SandboxPage.class);
-
- /** DAO */
- @SpringBean
- private GenericDao dao;
-
- /** session factory hibernate **/
- // @SpringBean
- // private SessionFactory sf;
- /**
- * Constructor
- */
- @SuppressWarnings("unchecked")
- public SandboxPage() {
- long count = dao.count(PersonneDao.CRITERIA_LIST_ADMINS);
- LOG.debug(String.valueOf(count));
-
- List<Utilisateur> users = (List<Utilisateur>) dao.list(DetachedCriteria.forClass(Utilisateur.class)
- .add(Restrictions.eq("typeDroit", TypeDroit.ADMINISTRATEUR))
- .add(Restrictions.eq("estValide", Boolean.TRUE)));
- LOG.debug(users.toString());
- for (Utilisateur u : users) {
- LOG.debug(u.toString());
- }
-
- List<Utilisateur> users2 = (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_ADMINS);
- LOG.debug(users2.toString());
- for (Utilisateur u : users2) {
- LOG.debug(u.toString());
- }
-
- // LOG.debug("createur proxy : " + (p1.createur instanceof HibernateProxy));
- // LOG.debug(p1.createur);
- // Personne pers2 = (Personne) session.get(Personne.class, p1.createur.idPersonne);
- // LOG.debug(pers2.nom);
-
- /*
- * Station st1 = (Station) session.load(Station.class, 47); LOG.debug(st1.getClass().getSimpleName());
- * LOG.debug(st1.idStation + " " + st1.nom); LOG.debug("createur proxy : " + (st1.createur instanceof
- * HibernateProxy)); LOG.debug(st1.createur); Personne pers1 = (Personne) session.load(Personne.class, 27);
- * LOG.debug(pers1.getClass().getSimpleName()); LOG.debug(pers1.idPersonne + " " + pers1.nom);
- * LOG.debug("proxy : " + (pers1 instanceof HibernateProxy)); LOG.debug(pers1.purificationsCrees);
- */
-
- /*
- * Map cacheEntries = sf.getStatistics() .getSecondLevelCacheStatistics(regionName) .getEntries();
- */
-
- // session.close();
- }
-}
Modified: trunk/cantharella.web/src/main/resources/cantharella.conf
===================================================================
--- trunk/cantharella.web/src/main/resources/cantharella.conf 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.web/src/main/resources/cantharella.conf 2013-02-15 05:08:09 UTC (rev 112)
@@ -24,5 +24,13 @@
# WEB CONFIGURATION
#
app.debug=true
+# value for production
+#app.debug=false
app.optimize=false
+# value for production
+#app.optimize=true
wicket.configuration=development
+# value for production
+#wicket.configuration=deployment
+
+
Deleted: trunk/cantharella.web/src/main/resources/log4j.xml
===================================================================
--- trunk/cantharella.web/src/main/resources/log4j.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/cantharella.web/src/main/resources/log4j.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%L
- Cantharella :: Data
- $Id:$
- $HeadURL:$
- %%
- Copyright (C) 2009 - 2013 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 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 Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <!-- Console IRD: detailed logs -->
- <appender name="consoleIRD" class="org.apache.log4j.ConsoleAppender">
- <param name="threshold" value="debug" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%F:%M:%L) %m%n" />
- </layout>
- </appender>
-
- <!-- Console root: simple logs -->
- <appender name="consoleRoot" class="org.apache.log4j.ConsoleAppender">
- <param name="threshold" value="error" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%c) %m%n" />
- </layout>
- </appender>
-
- <!-- Logs IRD -->
- <logger name="nc.ird" additivity="false">
- <level value="debug" />
- <appender-ref ref="consoleIRD" />
- </logger>
-
- <!-- Logs default -->
- <root>
- <level value="error" />
- <appender-ref ref="consoleRoot" />
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Copied: trunk/cantharella.web/src/main/resources/log4j.xml (from rev 85, trunk/cantharella.data/src/main/resources/development/log4j.xml)
===================================================================
--- trunk/cantharella.web/src/main/resources/log4j.xml (rev 0)
+++ trunk/cantharella.web/src/main/resources/log4j.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Cantharella :: Data
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 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 Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+#L%
+-->
+<!DOCTYPE log4j:configuration SYSTEM
+ "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/…">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <!-- Console IRD: detailed logs -->
+ <appender name="consoleIRD" class="org.apache.log4j.ConsoleAppender">
+ <param name="threshold" value="debug" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%F:%M:%L) %m%n" />
+ </layout>
+ </appender>
+
+ <!-- Console root: simple logs -->
+ <appender name="consoleRoot" class="org.apache.log4j.ConsoleAppender">
+ <param name="threshold" value="debug" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%c) %m%n" />
+ </layout>
+ </appender>
+
+ <!-- Logs IRD -->
+ <logger name="nc.ird" additivity="false">
+ <level value="debug" />
+ <appender-ref ref="consoleIRD" />
+ </logger>
+
+ <!-- Logs Hibernate -->
+ <logger name="org.hibernate.SQL" additivity="false">
+ <level value="info" />
+ <appender-ref ref="consoleRoot" />
+ </logger>
+ <logger name="org.hibernate.pretty" additivity="false">
+ <level value="info" />
+ <appender-ref ref="consoleRoot" />
+ </logger>
+
+ <!-- Logs default -->
+ <root>
+ <level value="warn" />
+ <appender-ref ref="consoleRoot" />
+ </root>
+</log4j:configuration>
\ No newline at end of file
Copied: trunk/cantharella.web/src/main/resources/log4j_prod.xml (from rev 85, trunk/cantharella.data/src/main/resources/production/log4j.xml)
===================================================================
--- trunk/cantharella.web/src/main/resources/log4j_prod.xml (rev 0)
+++ trunk/cantharella.web/src/main/resources/log4j_prod.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Cantharella :: Data
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+ <!DOCTYPE log4j:configuration SYSTEM
+ "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/…">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <!-- Asynchronous daily rolling file logs -->
+ <appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="file" value="${catalina.home}/logs/cantharella.log" />
+ <param name="threshold" value="info" />
+ <param name="datePattern" value="'.'yyyy-MM-dd" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%c) %m%n" />
+ </layout>
+ </appender>
+ <appender name="async" class="org.apache.log4j.AsyncAppender">
+ <param name="bufferSize" value="128" />
+ <appender-ref ref="file" />
+ </appender>
+
+ <!-- E-mail logs -->
+ <appender name="mail" class="org.apache.log4j.net.SMTPAppender">
+ <param name="SMTPHost" value="smtp.ird.nc" />
+ <param name="threshold" value="error" />
+ <param name="bufferSize" value="512" />
+ <param name="subject" value="[ISlog][Cantharella] Error" />
+ <param name="from" value="no-reply(a)ird.fr" />
+ <param name="to" value="ISlog(a)factor.ird.nc" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} %5p (%c) %m%n" />
+ </layout>
+ </appender>
+
+ <!-- Logs IRD -->
+ <logger name="nc.ird" additivity="false">
+ <level value="info" />
+ <appender-ref ref="async" />
+ </logger>
+
+ <!-- Logs Hibernate -->
+ <logger name="org.hibernate" additivity="false">
+ <!-- Disabled -->
+ <level value="off"/>
+ </logger>
+
+ <logger name="org.hibernate.validator" additivity="false">
+ <level value="error" />
+ <appender-ref ref="async" />
+ </logger>
+
+ <!-- Logs default -->
+ <root>
+ <level value="warn" />
+ <appender-ref ref="async" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-02-15 00:08:42 UTC (rev 111)
+++ trunk/pom.xml 2013-02-15 05:08:09 UTC (rev 112)
@@ -1,468 +1,479 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.nuiton</groupId>
- <artifactId>mavenpom4redmine</artifactId>
- <version>3.4.7</version>
- </parent>
+ <parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>mavenpom4redmine</artifactId>
+ <version>3.4.7</version>
+ </parent>
- <groupId>nc.ird</groupId>
- <artifactId>cantharella</artifactId>
- <version>1.1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>Cantharella</name>
- <description>Pharmacochemical database of natural substances</description>
- <inceptionYear>2009</inceptionYear>
- <url>http://maven-site.forge.codelutin.com/cantharella</url>
+ <groupId>nc.ird</groupId>
+ <artifactId>cantharella</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Cantharella</name>
+ <description>Pharmacochemical database of natural substances</description>
+ <inceptionYear>2009</inceptionYear>
+ <url>http://maven-site.forge.codelutin.com/cantharella</url>
- <organization>
- <name>IRD</name>
- <url>http://www.ird.fr/</url>
- </organization>
+ <organization>
+ <name>IRD</name>
+ <url>http://www.ird.fr/</url>
+ </organization>
- <licenses>
- <license>
- <name>Affero General Public License (AGPL)</name>
- <url>http://www.gnu.org/licenses/agpl.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
+ <licenses>
+ <license>
+ <name>Affero General Public License (AGPL)</name>
+ <url>http://www.gnu.org/licenses/agpl.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
- <developers>
- <developer>
- <id>chemit</id>
- <name>Tony Chemit</name>
- <email>chemit at codelutin dot com</email>
- <organization>CodeLutin</organization>
- <organizationUrl>http://codelutin.com</organizationUrl>
- <roles>
- <role>developer</role>
- </roles>
- <timezone>Europe/Paris</timezone>
- </developer>
- <developer>
- <id>poussin</id>
- <name>Benjamin Poussin</name>
- <email>poussin at codelutin dot com</email>
- <organization>CodeLutin</organization>
- <organizationUrl>http://codelutin.com</organizationUrl>
- <roles>
- <role>developer</role>
- </roles>
- <timezone>Europe/Paris</timezone>
- </developer>
- <developer>
- <id>acheype</id>
- <name>Adrien Cheype</name>
- <email>adrien.cheype at ird dot fr</email>
- <organization>IRD</organization>
- <organizationUrl>https://www.ird.fr/</organizationUrl>
- <roles>
- <role>developer</role>
- </roles>
- <timezone>Pacific/Noumea</timezone>
- </developer>
- </developers>
+ <developers>
+ <developer>
+ <id>chemit</id>
+ <name>Tony Chemit</name>
+ <email>chemit at codelutin dot com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://codelutin.com</organizationUrl>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>Europe/Paris</timezone>
+ </developer>
+ <developer>
+ <id>poussin</id>
+ <name>Benjamin Poussin</name>
+ <email>poussin at codelutin dot com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://codelutin.com</organizationUrl>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>Europe/Paris</timezone>
+ </developer>
+ <developer>
+ <id>acheype</id>
+ <name>Adrien Cheype</name>
+ <email>adrien.cheype at ird dot fr</email>
+ <organization>IRD</organization>
+ <organizationUrl>http://www.ird.fr/</organizationUrl>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>Pacific/Noumea</timezone>
+ </developer>
+ </developers>
- <scm>
- <url>http://svn.forge.codelutin.com/svn/cantharella/trunk</url>
- <connection>
- scm:svn:http://svn.forge.codelutin.com/svn/cantharella/trunk
- </connection>
- <developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/cantharella/trunk
- </developerConnection>
- </scm>
+ <scm>
+ <url>http://svn.forge.codelutin.com/svn/cantharella/trunk</url>
+ <connection>
+ scm:svn:http://svn.forge.codelutin.com/svn/cantharella/trunk
+ </connection>
+ <developerConnection>
+ scm:svn:http://svn.forge.codelutin.com/svn/cantharella/trunk
+ </developerConnection>
+ </scm>
- <distributionManagement>
- <site>
- <id>${platform}</id>
- <url>${our.site.repository}/${projectId}</url>
- </site>
- </distributionManagement>
+ <distributionManagement>
+ <site>
+ <id>${platform}</id>
+ <url>${our.site.repository}/${projectId}</url>
+ </site>
+ </distributionManagement>
- <modules>
- <module>cantharella.utils</module>
- <module>cantharella.data</module>
- <module>cantharella.service</module>
- <module>cantharella.web</module>
- </modules>
+ <modules>
+ <module>cantharella.utils</module>
+ <module>cantharella.data</module>
+ <module>cantharella.service</module>
+ <module>cantharella.web</module>
+ </modules>
- <properties>
+ <properties>
+ <platform>forge.codelutin.com</platform>
+ <projectId>cantharella</projectId>
- <platform>forge.codelutin.com</platform>
- <projectId>cantharella</projectId>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+ <!-- license header configuration -->
+ <license.organizationName>
+ IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ </license.organizationName>
+ <license.licenseName>agpl_v3</license.licenseName>
- <!-- license header configuration -->
- <license.organizationName>
- IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
- </license.organizationName>
- <license.licenseName>agpl_v3</license.licenseName>
+ <!-- plugin versions -->
+ <version.hibernate3-maven-plugin>3.0</version.hibernate3-maven-plugin>
+ <version.maven-surefire-plugin>2.13</version.maven-surefire-plugin>
+ <version.animal-sniffer-maven-plugin>1.10</version.animal-sniffer-maven-plugin>
+
+ <!-- dependency versions -->
+ <version.junit>4.11</version.junit>
+ <version.slf4j>1.7.2</version.slf4j>
+ <version.commons-lang3>3.1</version.commons-lang3>
+ <version.commons-beanutils>1.8.3</version.commons-beanutils>
+ <version.commons-io>2.4</version.commons-io>
+ <version.commons-collections>3.2.1</version.commons-collections>
+ <version.commons-codec>1.7</version.commons-codec>
+ <version.postgresql>9.1-901-1.jdbc4</version.postgresql>
+ <version.h2>1.3.170</version.h2>
+ <version.validation-api>1.0.0.GA</version.validation-api>
+ <version.hibernate-jpa-2.0-api>1.0.1.Final</version.hibernate-jpa-2.0-api>
+ <version.hibernate>4.1.9.Final</version.hibernate>
+ <version.hibernate-validator>4.3.1.Final</version.hibernate-validator>
+ <version.hibernate-search>4.2.0.Final</version.hibernate-search>
+ <version.lucene>3.6.2</version.lucene>
+ <version.c3p0>0.9.1</version.c3p0>
+ <version.aspectj>1.7.1</version.aspectj>
+ <!--<version.javassist>3.8.0.GA</version.javassist>-->
+ <version.spring>3.2.1.RELEASE</version.spring>
+ <version.mail>1.4.6</version.mail>
+ <version.backport-util-concurrent>3.1</version.backport-util-concurrent>
+ <version.cglib>2.2.2</version.cglib>
+ <version.opencsv>2.3</version.opencsv>
+ <version.poi>3.9</version.poi>
+ <version.nuiton-utils>2.6.6</version.nuiton-utils>
+ <version.servlet-api>2.5</version.servlet-api>
+ <version.wicket>6.5.0</version.wicket>
- <version.commons-codec>1.7</version.commons-codec>
- <commonsIoVersion>2.4</commonsIoVersion>
- <commonsLang3Version>3.1</commonsLang3Version>
- <commonsCollectionsVersion>3.2.1</commonsCollectionsVersion>
- <junitVersion>4.11</junitVersion>
- <version.slf4j>1.7.2</version.slf4j>
+ <!-- FIXME echatellier Probleme de parallelisation des tests unitaire,
+ cause org.hibernate.HibernateException: Don't change the reference to a collection
+ with cascade="all-delete-orphan": nc.ird.cantharella.data.model.Personne.campagnesDroits -->
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
- <version.postgresql>9.1-901-1.jdbc4</version.postgresql>
- <version.h2>1.3.170</version.h2>
+ <build>
- <version.validation-api>1.0.0.GA</version.validation-api>
- <version.jpa>1.0.1.Final</version.jpa>
- <version.hibernate>4.1.9.Final</version.hibernate>
- <version.hibernate-validator>4.3.1.Final</version.hibernate-validator>
- <version.hibernate3-maven-plugin>3.0</version.hibernate3-maven-plugin>
- <version.hibernate-search>4.2.0.Final</version.hibernate-search>
- <version.lucene>3.6.2</version.lucene>
+ <pluginManagement>
+ <plugins>
+ <!-- plugin site -->
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jrst</groupId>
+ <artifactId>doxia-module-jrst</artifactId>
+ <version>${jrstPluginVersion}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>hibernate3-maven-plugin</artifactId>
+ <version>${version.hibernate3-maven-plugin}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${version.maven-surefire-plugin}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java16-sun</artifactId>
+ <version>${version.animal-sniffer-maven-plugin}</version>
+ </signature>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
- <version.c3p0>0.9.1</version.c3p0>
- <version.aspectj>1.7.1</version.aspectj>
- <version.opencsv>2.3</version.opencsv>
- <version.javassist>3.8.0.GA</version.javassist>
- <version.spring>3.2.1.RELEASE</version.spring>
- <version.mail>1.4.6</version.mail>
- <version.cglib>2.2.2</version.cglib>
-
- <version.servlet-api>2.5</version.servlet-api>
-
- <version.wicket>6.5.0</version.wicket>
-
- <!-- FIXME echatellier Probleme de parallelisation des tests unitaire,
- cause org.hibernate.HibernateException: Don't change the reference to a collection
- with cascade="all-delete-orphan": nc.ird.cantharella.data.model.Personne.campagnesDroits -->
- <maven.test.skip>true</maven.test.skip>
- </properties>
-
- <build>
-
- <pluginManagement>
- <plugins>
-
- <!-- plugin site -->
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
+ <dependencyManagement>
+ <dependencies>
<dependency>
- <groupId>org.nuiton.jrst</groupId>
- <artifactId>doxia-module-jrst</artifactId>
- <version>${jrstPluginVersion}</version>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ <scope>test</scope>
</dependency>
- </dependencies>
- </plugin>
-
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>hibernate3-maven-plugin</artifactId>
- <version>${version.hibernate3-maven-plugin}</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.2.1</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java16-sun</artifactId>
- <version>1.10</version>
- </signature>
- </configuration>
- </plugin>
- </plugins>
-
- </pluginManagement>
-
- </build>
-
- <dependencyManagement>
-
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${version.slf4j}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${version.slf4j}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${version.slf4j}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${version.commons-lang3}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>${version.commons-beanutils}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${version.commons-io}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>${version.commons-collections}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${version.commons-codec}</version>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${version.postgresql}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${version.h2}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>${version.validation-api}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>${version.hibernate-jpa-2.0-api}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${version.hibernate}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-ehcache</artifactId>
+ <version>${version.hibernate}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${version.hibernate-validator}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ <version>${version.hibernate-search}</version>
+ <exclusions>
+ <!-- 13Mo of unused dependencies -->
+ <exclusion>
+ <artifactId>solr-analysis-extras</artifactId>
+ <groupId>org.apache.solr</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-orm</artifactId>
+ <version>${version.hibernate-search}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ <version>${version.lucene}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-analyzers</artifactId>
+ <version>${version.lucene}</version>
+ </dependency>
+ <dependency>
+ <groupId>c3p0</groupId>
+ <artifactId>c3p0</artifactId>
+ <version>${version.c3p0}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${version.aspectj}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>${version.aspectj}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${version.spring}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${version.spring}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${version.spring}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${version.spring}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>${version.mail}</version>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ <version>${version.backport-util-concurrent}</version>
+ </dependency>
+ <dependency>
+ <!-- for JUnit Spring Test with @Configuration -->
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>${version.cglib}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>${version.opencsv}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.poi</groupId>
+ <artifactId>poi</artifactId>
+ <version>${version.poi}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ <version>${version.nuiton-utils}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-vfs2</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet-api}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-core</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-util</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-ioc</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-request</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-auth-roles</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-datetime</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-spring</artifactId>
+ <version>${version.wicket}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
-
- <!-- Dependencies for all layers -->
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${version.commons-codec}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.8.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>${version.opencsv}</version>
- </dependency>
-
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${version.aspectj}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${version.aspectj}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${version.slf4j}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${version.slf4j}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${version.slf4j}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${version.spring}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${version.spring}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <version>${version.jpa}</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${version.hibernate}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- <version>${version.hibernate}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>${version.hibernate-validator}</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-orm</artifactId>
- <version>${version.hibernate-search}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
- <version>${version.hibernate-search}</version>
- <exclusions>
- <!-- 13Mo of unused dependencies -->
- <exclusion>
- <artifactId>solr-analysis-extras</artifactId>
- <groupId>org.apache.solr</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- <version>${version.lucene}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-analyzers</artifactId>
- <version>${version.lucene}</version>
- </dependency>
-
- <dependency>
- <groupId>c3p0</groupId>
- <artifactId>c3p0</artifactId>
- <version>${version.c3p0}</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>${version.postgresql}</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${version.servlet-api}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>${version.validation-api}</version>
- </dependency>
-
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${version.spring}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-util</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-ioc</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-auth-roles</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-datetime</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- <version>${version.wicket}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-spring</artifactId>
- <version>${version.wicket}</version>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${version.h2}</version>
- </dependency>
-
- <!-- for JUnit Spring Test with @Configuration -->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>${version.cglib}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>${version.mail}</version>
- </dependency>
-
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>nuiton-utils</artifactId>
- <version>2.6.6</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-vfs2</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <version>3.9</version>
- <scope>test</scope>
- </dependency>
+ <!-- shared dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
</dependencies>
-
- </dependencyManagement>
+
</project>
1
0
15 Feb '13
Author: acheype
Date: 2013-02-15 01:08:42 +0100 (Fri, 15 Feb 2013)
New Revision: 111
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/111
Log:
move sql scripts to not be deployed with the jar
Added:
trunk/cantharella.data/src/main/sql/
trunk/cantharella.data/src/main/sql/cantharella_schema_1.0.sql
trunk/cantharella.data/src/main/sql/create_db.sql
trunk/cantharella.data/src/main/sql/dev_update.sql
trunk/cantharella.data/src/main/sql/init.sql
Copied: trunk/cantharella.data/src/main/sql/cantharella_schema_1.0.sql (from rev 109, trunk/cantharella.data/src/main/resources/sql/cantharella_schema_1.0.sql)
===================================================================
--- trunk/cantharella.data/src/main/sql/cantharella_schema_1.0.sql (rev 0)
+++ trunk/cantharella.data/src/main/sql/cantharella_schema_1.0.sql 2013-02-15 00:08:42 UTC (rev 111)
@@ -0,0 +1,591 @@
+---
+-- #%L
+-- Cantharella :: Data
+-- $Id:$
+-- $HeadURL:$
+-- %%
+-- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero General Public License as published by
+-- the Free Software Foundation, either version 3 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+-- insert once connected to cantharella database with the user cantharella
+
+BEGIN;
+
+ create table Campagne (
+ idCampagne int4 not null,
+ codePays varchar(255) not null,
+ complement text,
+ dateDeb date not null,
+ dateFin date not null,
+ mentionLegale text,
+ nom varchar(255) unique not null,
+ programme varchar(255),
+ createur_idPersonne int4 not null,
+ primary key (idCampagne)
+ );
+
+ create table CampagneGroupeDroits (
+ droitExtrait bool,
+ droitPuri bool,
+ droitRecolte bool,
+ droitTestBio bool,
+ pk1_idCampagne int4 not null,
+ pk2_idGroupe int4 not null,
+ primary key (pk1_idCampagne, pk2_idGroupe)
+ );
+
+ create table CampagnePersonneDroits (
+ droitExtrait bool,
+ droitPuri bool,
+ droitRecolte bool,
+ droitTestBio bool,
+ pk1_idCampagne int4 not null,
+ pk2_idPersonne int4 not null,
+ primary key (pk1_idCampagne, pk2_idPersonne)
+ );
+
+ create table CampagnePersonneParticipant (
+ complement text,
+ pk1_idCampagne int4 not null,
+ pk2_idPersonne int4 not null,
+ primary key (pk1_idCampagne, pk2_idPersonne)
+ );
+
+ create table Campagne_Station (
+ campagnes_idCampagne int4 not null,
+ stations_idStation int4 not null
+ );
+
+ create table ErreurTestBio (
+ idErreurTest int4 not null,
+ description text not null,
+ nom varchar(255) not null,
+ primary key (idErreurTest),
+ unique (nom)
+ );
+
+ create table Extraction (
+ idExtraction int4 not null,
+ complement text,
+ date date not null,
+ masseDepart numeric(9, 4),
+ ref varchar(255) unique not null,
+ createur_idPersonne int4 not null,
+ lot_idLot int4 not null,
+ manipulateur_idPersonne int4 not null,
+ methode_idMethodeExtraction int4 not null,
+ primary key (idExtraction)
+ );
+
+ create table Extrait (
+ id int4 not null,
+ extraction_idExtraction int4 not null,
+ typeExtrait_idTypeExtrait int4 not null,
+ primary key (id)
+ );
+
+ create table Fraction (
+ indice varchar(255) not null,
+ id int4 not null,
+ purification_idPurification int4 not null,
+ primary key (id)
+ );
+
+ create table Groupe (
+ idGroupe int4 not null,
+ description text not null,
+ nom varchar(255) unique not null,
+ primary key (idGroupe)
+ );
+
+ create table Lot (
+ idLot int4 not null,
+ complement text,
+ dateRecolte date not null,
+ echantillonColl bool not null,
+ echantillonIdent bool not null,
+ echantillonPhylo bool not null,
+ masseFraiche numeric(9, 4),
+ masseSeche numeric(9, 4),
+ ref varchar(255) unique not null,
+ campagne_idCampagne int4 not null,
+ createur_idPersonne int4 not null,
+ partie_idPartie int4,
+ specimenRef_idSpecimen int4 not null,
+ station_idStation int4 not null,
+ primary key (idLot)
+ );
+
+ create table LotGroupeDroits (
+ droitExtrait bool,
+ droitPuri bool,
+ droitRecolte bool,
+ droitTestBio bool,
+ pk1_idLot int4 not null,
+ pk2_idGroupe int4 not null,
+ primary key (pk1_idLot, pk2_idGroupe)
+ );
+
+ create table LotPersonneDroits (
+ droitExtrait bool,
+ droitPuri bool,
+ droitRecolte bool,
+ droitTestBio bool,
+ pk2_idPersonne int4 not null,
+ pk1_idLot int4 not null,
+ primary key (pk1_idLot, pk2_idPersonne)
+ );
+
+ create table MethodeExtraction (
+ idMethodeExtraction int4 not null,
+ description text not null,
+ nom varchar(255) unique not null,
+ primary key (idMethodeExtraction)
+ );
+
+ create table MethodePurification (
+ idMethodePurification int4 not null,
+ description text not null,
+ nom varchar(255) unique not null,
+ primary key (idMethodePurification)
+ );
+
+ create table MethodeTestBio (
+ idMethodeTest int4 not null,
+ cible varchar(255) unique not null,
+ critereActivite varchar(255) not null,
+ description text not null,
+ domaine varchar(255) not null,
+ nom varchar(255) unique not null,
+ uniteResultat varchar(255) not null,
+ valeurMesuree varchar(255) not null,
+ primary key (idMethodeTest)
+ );
+
+ create table ParamMethoPuri (
+ idParamMethoPuri int4 not null,
+ description text not null,
+ index int4 not null,
+ nom varchar(255) not null,
+ methodePurification_idMethodePurification int4 not null,
+ primary key (idParamMethoPuri)
+ );
+
+ create table ParamMethoPuriEffectif (
+ idParamMethoPuriEffectif int4 not null,
+ valeur varchar(255),
+ param_idParamMethoPuri int4 not null,
+ purification_idPurification int4 not null,
+ primary key (idParamMethoPuriEffectif)
+ );
+
+ create table Partie (
+ idPartie int4 not null,
+ nom varchar(255) unique not null,
+ primary key (idPartie)
+ );
+
+ create table Personne (
+ idPersonne int4 not null,
+ adressePostale text not null,
+ codePays varchar(255) not null,
+ codePostal varchar(255) not null,
+ courriel varchar(255) unique not null,
+ fax varchar(255),
+ fonction varchar(255),
+ nom varchar(255) not null,
+ organisme varchar(255) not null,
+ prenom varchar(255) not null,
+ tel varchar(255),
+ ville varchar(255) not null,
+ primary key (idPersonne),
+ unique (nom, prenom)
+ );
+
+ create table Produit (
+ id int4 not null,
+ masseObtenue numeric(9, 4),
+ ref varchar(255) unique not null,
+ primary key (id)
+ );
+
+ create table Purification (
+ idPurification int4 not null,
+ complement text,
+ confidentiel bool not null,
+ date date not null,
+ dateConfidentialite date,
+ masseDepart numeric(9, 4),
+ ref varchar(255) unique not null,
+ createur_idPersonne int4 not null,
+ lotSource_idLot int4 not null,
+ manipulateur_idPersonne int4 not null,
+ methode_idMethodePurification int4 not null,
+ produit_id int4 not null,
+ primary key (idPurification)
+ );
+
+ create table ResultatTestBio (
+ id int4 not null,
+ concMasse numeric(9, 4),
+ estActif bool,
+ produitTemoin varchar(255),
+ repere varchar(255) not null,
+ stade int4,
+ typeResultat int4 not null,
+ uniteConcMasse int4,
+ valeur numeric(9, 4),
+ erreur_idErreurTest int4,
+ produit_id int4,
+ testBio_idTestBio int4 not null,
+ typeExtraitSource_idTypeExtrait int4,
+ primary key (id)
+ );
+
+ create table Specimen (
+ idSpecimen int4 not null,
+ complement text,
+ dateDepot date,
+ embranchement varchar(255) not null,
+ espece varchar(255),
+ famille varchar(255),
+ genre varchar(255),
+ lieuDepot varchar(255),
+ numDepot varchar(255),
+ ref varchar(255) unique not null,
+ sousEspece varchar(255),
+ typeOrganisme int4,
+ variete varchar(255),
+ createur_idPersonne int4 not null,
+ identificateur_idPersonne int4,
+ station_idStation int4,
+ primary key (idSpecimen)
+ );
+
+ create table Station (
+ idStation int4 not null,
+ codePays varchar(255) not null,
+ complement text,
+ latitude varchar(255),
+ localite varchar(255),
+ longitude varchar(255),
+ nom varchar(255) unique not null,
+ referentiel int4,
+ createur_idPersonne int4 not null,
+ primary key (idStation)
+ );
+
+ create table TestBio (
+ idTestBio int4 not null,
+ complement text,
+ concMasseDefaut numeric(9, 4),
+ confidentiel bool not null,
+ date date not null,
+ dateConfidentialite date,
+ organismeTesteur varchar(255) not null,
+ ref varchar(255) unique not null,
+ stadeDefaut int4,
+ uniteConcMasseDefaut int4,
+ createur_idPersonne int4 not null,
+ manipulateur_idPersonne int4 not null,
+ methode_idMethodeTest int4 not null,
+ primary key (idTestBio)
+ );
+
+ create table TypeDocument (
+ idTypeDocument int4 not null,
+ description text not null,
+ domaine varchar(255),
+ estImage bool,
+ nom varchar(255) unique,
+ primary key (idTypeDocument),
+ unique (nom)
+ );
+
+ create table TypeExtrait (
+ idTypeExtrait int4 not null,
+ description text not null,
+ initiales varchar(255) unique not null,
+ methodeExtraction_idMethodeExtraction int4 not null,
+ primary key (idTypeExtrait)
+ );
+
+ create table Utilisateur (
+ dateValiditeCompte date,
+ estValide bool not null,
+ passwordHash varchar(255) not null,
+ typeDroit int4 not null,
+ idPersonne int4 not null,
+ groupe_idGroupe int4,
+ primary key (idPersonne)
+ );
+
+ alter table Campagne
+ add constraint FKFB835E7E822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table CampagneGroupeDroits
+ add constraint FK3AFBE26B905CBAAF
+ foreign key (pk2_idGroupe)
+ references Groupe;
+
+ alter table CampagneGroupeDroits
+ add constraint FK3AFBE26B975C19C0
+ foreign key (pk1_idCampagne)
+ references Campagne;
+
+ alter table CampagnePersonneDroits
+ add constraint FK81782471975C19C0
+ foreign key (pk1_idCampagne)
+ references Campagne;
+
+ alter table CampagnePersonneDroits
+ add constraint FK81782471E49019FB
+ foreign key (pk2_idPersonne)
+ references Personne;
+
+ alter table CampagnePersonneParticipant
+ add constraint FK72EE0469975C19C0
+ foreign key (pk1_idCampagne)
+ references Campagne;
+
+ alter table CampagnePersonneParticipant
+ add constraint FK72EE0469E49019FB
+ foreign key (pk2_idPersonne)
+ references Personne;
+
+ alter table Campagne_Station
+ add constraint FK61A84053557B2C21
+ foreign key (campagnes_idCampagne)
+ references Campagne;
+
+ alter table Campagne_Station
+ add constraint FK61A840531AE541CD
+ foreign key (stations_idStation)
+ references Station;
+
+ alter table Extraction
+ add constraint FKA39DBC077106663B
+ foreign key (manipulateur_idPersonne)
+ references Personne;
+
+ alter table Extraction
+ add constraint FKA39DBC07822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table Extraction
+ add constraint FKA39DBC07F7C7FFC0
+ foreign key (methode_idMethodeExtraction)
+ references MethodeExtraction;
+
+ alter table Extraction
+ add constraint FKA39DBC07AE638899
+ foreign key (lot_idLot)
+ references Lot;
+
+ alter table Extrait
+ add constraint FK156B751B9547CE24
+ foreign key (id)
+ references Produit;
+
+ alter table Extrait
+ add constraint FK156B751B252FD5C9
+ foreign key (typeExtrait_idTypeExtrait)
+ references TypeExtrait;
+
+ alter table Extrait
+ add constraint FK156B751BE48A1121
+ foreign key (extraction_idExtraction)
+ references Extraction;
+
+ alter table Fraction
+ add constraint FKA14826229547CE24
+ foreign key (id)
+ references Produit;
+
+ alter table Fraction
+ add constraint FKA1482622859CB52B
+ foreign key (purification_idPurification)
+ references Purification;
+
+ alter table Lot
+ add constraint FK12B311AA103F8
+ foreign key (campagne_idCampagne)
+ references Campagne;
+
+ alter table Lot
+ add constraint FK12B3168370809
+ foreign key (partie_idPartie)
+ references Partie;
+
+ alter table Lot
+ add constraint FK12B31822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table Lot
+ add constraint FK12B31DDF1E8FF
+ foreign key (specimenRef_idSpecimen)
+ references Specimen;
+
+ alter table Lot
+ add constraint FK12B31CBED0F02
+ foreign key (station_idStation)
+ references Station;
+
+ alter table LotGroupeDroits
+ add constraint FK9AC53A9E905CBAAF
+ foreign key (pk2_idGroupe)
+ references Groupe;
+
+ alter table LotGroupeDroits
+ add constraint FK9AC53A9E87AF0F1E
+ foreign key (pk1_idLot)
+ references Lot;
+
+ alter table LotPersonneDroits
+ add constraint FK144C3BE4E49019FB
+ foreign key (pk2_idPersonne)
+ references Personne;
+
+ alter table LotPersonneDroits
+ add constraint FK144C3BE487AF0F1E
+ foreign key (pk1_idLot)
+ references Lot;
+
+ alter table ParamMethoPuri
+ add constraint FK1476479225A42085
+ foreign key (methodePurification_idMethodePurification)
+ references MethodePurification;
+
+ alter table ParamMethoPuriEffectif
+ add constraint FK8F7FA020B4F23AD1
+ foreign key (param_idParamMethoPuri)
+ references ParamMethoPuri;
+
+ alter table ParamMethoPuriEffectif
+ add constraint FK8F7FA020859CB52B
+ foreign key (purification_idPurification)
+ references Purification;
+
+ create index courriel on Personne (courriel);
+
+ alter table Purification
+ add constraint FKD1727611FE19187A
+ foreign key (produit_id)
+ references Produit;
+
+ alter table Purification
+ add constraint FKD17276117106663B
+ foreign key (manipulateur_idPersonne)
+ references Personne;
+
+ alter table Purification
+ add constraint FKD1727611822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table Purification
+ add constraint FKD1727611626E4F54
+ foreign key (methode_idMethodePurification)
+ references MethodePurification;
+
+ alter table Purification
+ add constraint FKD1727611C4943FB4
+ foreign key (lotSource_idLot)
+ references Lot;
+
+ create index typeResultat on ResultatTestBio (typeResultat);
+
+ alter table ResultatTestBio
+ add constraint FK5DFD5BC6FE19187A
+ foreign key (produit_id)
+ references Produit;
+
+ alter table ResultatTestBio
+ add constraint FK5DFD5BC65033BE68
+ foreign key (testBio_idTestBio)
+ references TestBio;
+
+ alter table ResultatTestBio
+ add constraint FK5DFD5BC64B1883E5
+ foreign key (erreur_idErreurTest)
+ references ErreurTestBio;
+
+ alter table ResultatTestBio
+ add constraint FK5DFD5BC6ABE26DE4
+ foreign key (typeExtraitSource_idTypeExtrait)
+ references TypeExtrait;
+
+ alter table Specimen
+ add constraint FK84B96728822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table Specimen
+ add constraint FK84B96728D2CE02CA
+ foreign key (identificateur_idPersonne)
+ references Personne;
+
+ alter table Specimen
+ add constraint FK84B96728CBED0F02
+ foreign key (station_idStation)
+ references Station;
+
+ alter table Station
+ add constraint FKF2249914822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table TestBio
+ add constraint FKE6F36F67106663B
+ foreign key (manipulateur_idPersonne)
+ references Personne;
+
+ alter table TestBio
+ add constraint FKE6F36F6822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table TestBio
+ add constraint FKE6F36F67DBA1C52
+ foreign key (methode_idMethodeTest)
+ references MethodeTestBio;
+
+ alter table TypeExtrait
+ add constraint FK40F3D8811D52927
+ foreign key (methodeExtraction_idMethodeExtraction)
+ references MethodeExtraction;
+
+ create index estValide on Utilisateur (estValide);
+
+ create index typeDroit on Utilisateur (typeDroit);
+
+ alter table Utilisateur
+ add constraint FK407FDB6370C95760
+ foreign key (groupe_idGroupe)
+ references Groupe;
+
+ alter table Utilisateur
+ add constraint FK407FDB63A1338A53
+ foreign key (idPersonne)
+ references Personne;
+
+ create sequence hibernate_sequence;
+
+COMMIT;
Copied: trunk/cantharella.data/src/main/sql/create_db.sql (from rev 109, trunk/cantharella.data/src/main/resources/sql/create_db.sql)
===================================================================
--- trunk/cantharella.data/src/main/sql/create_db.sql (rev 0)
+++ trunk/cantharella.data/src/main/sql/create_db.sql 2013-02-15 00:08:42 UTC (rev 111)
@@ -0,0 +1,29 @@
+---
+-- #%L
+-- Cantharella :: Data
+-- $Id:$
+-- $HeadURL:$
+-- %%
+-- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero General Public License as published by
+-- the Free Software Foundation, either version 3 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+CREATE ROLE cantharella LOGIN PASSWORD 'ctrl4';
+CREATE DATABASE cantharella WITH ENCODING='UTF8' OWNER=cantharella;
+GRANT ALL ON DATABASE cantharella TO cantharella;
+\connect cantharella
+ALTER SCHEMA public OWNER TO cantharella;
+GRANT ALL ON SCHEMA public TO cantharella;
+\q
Copied: trunk/cantharella.data/src/main/sql/dev_update.sql (from rev 109, trunk/cantharella.data/src/main/resources/sql/dev_update.sql)
===================================================================
--- trunk/cantharella.data/src/main/sql/dev_update.sql (rev 0)
+++ trunk/cantharella.data/src/main/sql/dev_update.sql 2013-02-15 00:08:42 UTC (rev 111)
@@ -0,0 +1,125 @@
+---
+-- #%L
+-- Cantharella :: Data
+-- $Id:$
+-- $HeadURL:$
+-- %%
+-- Copyright (C) 2013 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero General Public License as published by
+-- the Free Software Foundation, either version 3 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+-- Mise à jour à appliquer à la base de données
+-- pour les modifications effectuées pendant le développement
+
+
+BEGIN;
+-- Documents (16/11/2012)
+ create table TypeDocument (
+ idTypeDocument int4 not null,
+ description text not null,
+ domaine varchar(60),
+ estImage boolean not null,
+ nom varchar(60) not null unique,
+ primary key (idTypeDocument),
+ unique (nom)
+ );
+
+-- Molecules (07/01/2013)
+ create table Molecule (
+ idMolecule int4 not null,
+ complement text,
+ familleChimique varchar(60),
+ formuleBrute varchar(60) not null,
+ formuleDevMol text,
+ masseMolaire numeric(9, 4) check (masseMolaire<=99999 AND masseMolaire>=0),
+ nomCommun varchar(100),
+ nomIupca varchar(255),
+ nouvMolecul boolean not null,
+ publiOrigine text,
+ campagne_idCampagne int4,
+ createur_idPersonne int4 not null,
+ identifieePar varchar(60),
+ primary key (idMolecule)
+ );
+
+ create table MoleculeProvenance (
+ id int4 not null,
+ pourcentage numeric(9, 4) check (pourcentage>=0 AND pourcentage<=100),
+ molecule_idMolecule int4 not null,
+ produit_id int4 not null,
+ primary key (id)
+ );
+
+ alter table Molecule
+ add constraint FKEC979EA61AA103F8
+ foreign key (campagne_idCampagne)
+ references Campagne;
+
+ alter table Molecule
+ add constraint FKEC979EA6822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table MoleculeProvenance
+ add constraint FK8B39E567F44F1B20
+ foreign key (molecule_idMolecule)
+ references Molecule;
+
+ alter table MoleculeProvenance
+ add constraint FK8B39E567FE19187A
+ foreign key (produit_id)
+ references Produit;
+
+ create sequence molecule_sequence;
+
+-- Document (12/02/2013)
+ create table Document (
+ idDocument int4 not null,
+ contrainteLegale varchar(100),
+ dateCreation timestamp not null,
+ description text,
+ editeur varchar(100) not null,
+ fileContent bytea;,
+ fileMimetype varchar(60) not null,
+ fileName varchar(60) not null,
+ langue varchar(2),
+ titre varchar(100) not null,
+ ajoutePar_idPersonne int4 not null,
+ createur_idPersonne int4 not null,
+ typeDocument_idTypeDocument int4 not null,
+ molecule int4,
+ primary key (idDocument)
+ );
+
+ alter table Document
+ add constraint FK3737353B2F46DB31
+ foreign key (ajoutePar_idPersonne)
+ references Personne;
+
+ alter table Document
+ add constraint FK3737353B822055B9
+ foreign key (createur_idPersonne)
+ references Personne;
+
+ alter table Document
+ add constraint FK3737353BBECBA92F
+ foreign key (typeDocument_idTypeDocument)
+ references TypeDocument;
+
+ alter table Document
+ add constraint FK3737353B20FEEDAC
+ foreign key (molecule)
+ references Molecule;
+COMMIT;
\ No newline at end of file
Copied: trunk/cantharella.data/src/main/sql/init.sql (from rev 85, trunk/cantharella.data/src/main/resources/development/init.sql)
===================================================================
--- trunk/cantharella.data/src/main/sql/init.sql (rev 0)
+++ trunk/cantharella.data/src/main/sql/init.sql 2013-02-15 00:08:42 UTC (rev 111)
@@ -0,0 +1,35 @@
+---
+-- #%L
+-- Cantharella :: Data
+-- $Id:$
+-- $HeadURL:$
+-- %%
+-- Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero General Public License as published by
+-- the Free Software Foundation, either version 3 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+CREATE ROLE cantharella LOGIN PASSWORD 'ctrl4';
+CREATE DATABASE cantharella WITH ENCODING='UTF8' OWNER=cantharella;
+GRANT ALL ON DATABASE cantharella TO cantharella;
+\connect cantharella
+ALTER SCHEMA public OWNER TO cantharella;
+GRANT ALL ON SCHEMA public TO cantharella;
+\q
+
+-- To generate the DB schema, run the Maven command:
+-- mvn hibernate3:hbm2ddl
+
+-- Caution : the NOT NULL constraints are not generated
+-- Go to src/main/resources/commons/sql for production schema scripts
1
0
15 Feb '13
Author: acheype
Date: 2013-02-15 01:08:22 +0100 (Fri, 15 Feb 2013)
New Revision: 110
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/110
Log:
move sql scripts to not be deployed with the jar
Removed:
trunk/cantharella.data/src/main/resources/sql/
1
0
14 Feb '13
Author: echatellier
Date: 2013-02-14 17:39:05 +0100 (Thu, 14 Feb 2013)
New Revision: 109
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/109
Log:
Update to wicket 6.5
Added:
trunk/cantharella.utils/src/license/
trunk/cantharella.utils/src/license/THIRD-PARTY.properties
Modified:
trunk/cantharella.data/src/license/THIRD-PARTY.properties
trunk/cantharella.service/src/license/THIRD-PARTY.properties
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/model/MoleculeProvenanceBean.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CantharellaConfig.java
trunk/cantharella.web/src/license/THIRD-PARTY.properties
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/LinkProduitPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ListPersonnesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/PercentPropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/links/CsvExportLink.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/LoadableDetachableSortableListDataProvider.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/SimpleSortableListDataProvider.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthSession.java
trunk/pom.xml
Modified: trunk/cantharella.data/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/cantharella.data/src/license/THIRD-PARTY.properties 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.data/src/license/THIRD-PARTY.properties 2013-02-14 16:39:05 UTC (rev 109)
@@ -9,6 +9,7 @@
# - Eclipse Public License - v 1.0
# - GNU Lesser General Public License, version 2.1
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
@@ -22,5 +23,6 @@
# Please fill the missing licenses for dependencies :
#
#
-#Fri Jan 18 10:34:09 CET 2013
+#Thu Feb 14 17:34:33 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
Modified: trunk/cantharella.service/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/cantharella.service/src/license/THIRD-PARTY.properties 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.service/src/license/THIRD-PARTY.properties 2013-02-14 16:39:05 UTC (rev 109)
@@ -11,6 +11,7 @@
# - GNU Lesser General Public License, version 2.1
# - GPLv2+CE
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
@@ -24,5 +25,6 @@
# Please fill the missing licenses for dependencies :
#
#
-#Fri Jan 18 10:45:39 CET 2013
+#Thu Feb 14 17:34:54 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/model/MoleculeProvenanceBean.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/model/MoleculeProvenanceBean.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/model/MoleculeProvenanceBean.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -1,5 +1,28 @@
package nc.ird.cantharella.service.model;
+/*
+ * #%L
+ * Cantharella :: Service
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2013 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import java.io.Serializable;
import nc.ird.cantharella.data.model.Extrait;
import nc.ird.cantharella.data.model.Fraction;
Added: trunk/cantharella.utils/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/cantharella.utils/src/license/THIRD-PARTY.properties (rev 0)
+++ trunk/cantharella.utils/src/license/THIRD-PARTY.properties 2013-02-14 16:39:05 UTC (rev 109)
@@ -0,0 +1,19 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - BSD License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Public License Version 1.0
+# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
+# - New BSD License
+# - The Apache Software License, Version 2.0
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Thu Feb 14 17:34:15 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CantharellaConfig.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CantharellaConfig.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CantharellaConfig.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -1,5 +1,28 @@
package nc.ird.module.utils;
+/*
+ * #%L
+ * Cantharella :: Utils
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2013 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import java.util.Properties;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
Modified: trunk/cantharella.web/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/cantharella.web/src/license/THIRD-PARTY.properties 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/license/THIRD-PARTY.properties 2013-02-14 16:39:05 UTC (rev 109)
@@ -7,11 +7,11 @@
# - CDDL
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
# - Common Public License Version 1.0
-# - Copyright (c) 2000-2011 INRIA, France Telecom
# - Eclipse Public License - v 1.0
# - GNU Lesser General Public License, version 2.1
# - GPLv2+CE
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - License Agreement for Java(TM) Servlet API Specification Interface Classes
@@ -25,7 +25,7 @@
# Please fill the missing licenses for dependencies :
#
#
-#Fri Jan 18 11:06:20 CET 2013
-asm--asm--3.1=Copyright (c) 2000-2011 INRIA, France Telecom
+#Thu Feb 14 17:35:11 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
javax.servlet--servlet-api--2.5=License Agreement for Java(TM) Servlet API Specification Interface Classes
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -80,13 +80,13 @@
import org.apache.wicket.Session;
import org.apache.wicket.authentication.IAuthenticationStrategy;
import org.apache.wicket.authentication.strategy.DefaultAuthenticationStrategy;
+import org.apache.wicket.core.request.mapper.MountedMapper;
+import org.apache.wicket.core.request.mapper.PackageMapper;
import org.apache.wicket.injection.Injector;
import org.apache.wicket.javascript.DefaultJavaScriptCompressor;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
-import org.apache.wicket.request.mapper.MountedMapper;
-import org.apache.wicket.request.mapper.PackageMapper;
import org.apache.wicket.request.mapper.mount.MountMapper;
import org.apache.wicket.resource.NoOpTextCompressor;
import org.apache.wicket.resource.loader.IStringResourceLoader;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -46,14 +46,14 @@
import nc.ird.module.utils.AssertTools;
import nc.ird.module.utils.Pair;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.IAjaxIndicatorAware;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
@@ -65,7 +65,10 @@
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.CssResourceReference;
import org.apache.wicket.util.value.ValueMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Template page
@@ -137,11 +140,11 @@
/** {@inheritDoc} */
public void renderHead(IHeaderResponse response) {
// dynamic declaration of the menu Css due to the internationalization
- response.renderCSSReference(getString("TemplatePage.Css.Menu"));
+ response.render(CssHeaderItem.forUrl(getString("TemplatePage.Css.Menu")));
// scroll up to the anchor if any feedback message
if (!getSession().getFeedbackMessages().isEmpty()) {
- response.renderOnLoadJavaScript("location.hash='header'");
+ response.render(OnDomReadyHeaderItem.forScript("location.hash='header'"));
// LOG.debug("session FeedbackMessages is not empty");
// for (FeedbackMessage msg : getSession().getFeedbackMessages()) {
// LOG.debug(msg.getLevelAsString() + " : " + msg.getMessage() + ", from : " + msg.getReporter());
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/LinkProduitPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/LinkProduitPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/LinkProduitPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -39,8 +39,9 @@
* fraction). T MUST HAVE a property named "produit" which give a Produit.
* @author Adrien Cheype
* @param <T> Row type
+ * @param <S> the type of the sort property
*/
-public abstract class LinkProduitPropertyColumn<T> extends LinkPropertyColumn<T> {
+public abstract class LinkProduitPropertyColumn<T, S> extends LinkPropertyColumn<T, S> {
/** page used to get messages */
private final TemplatePage page;
@@ -52,7 +53,7 @@
* @param propertyExpression propertyExpression
* @param page page used to get messages
*/
- public LinkProduitPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public LinkProduitPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
TemplatePage page) {
super(displayModel, sortProperty, propertyExpression);
this.page = page;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -39,7 +39,7 @@
* @author Adrien Cheype
* @param <T> Type of the row model
*/
-public class TaxonomyPropertyColumn<T> extends PropertyColumn<T> implements ExportableColumn<T> {
+public class TaxonomyPropertyColumn<T, S> extends PropertyColumn<T, S> implements ExportableColumn<T, S> {
/**
* Constructor
@@ -47,7 +47,7 @@
* @param sortProperty Sort property
* @param propertyExpression Property expression
*/
- public TaxonomyPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
+ public TaxonomyPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -92,16 +92,16 @@
LoadableDetachableSortableListDataProvider<Campagne> campagnesDataProvider = new LoadableDetachableSortableListDataProvider<Campagne>(
campagnes, getSession().getLocale());
- List<IColumn<Campagne>> columns = new ArrayList<IColumn<Campagne>>();
+ List<IColumn<Campagne, String>> columns = new ArrayList<IColumn<Campagne, String>>();
- columns.add(new LinkableImagePropertyColumn<Campagne>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Campagne, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Campagne>> item, String componentId, IModel<Campagne> model) {
setResponsePage(new ReadCampagnePage(model.getObject().getIdCampagne(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Campagne>(new Model<String>(getString("Campagne.nom")), "nom", "nom",
+ columns.add(new LinkPropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.nom")), "nom", "nom",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Campagne>> item, String componentId, IModel<Campagne> model) {
@@ -109,16 +109,16 @@
}
});
- columns.add(new ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateDeb")), "dateDeb",
+ columns.add(new ShortDatePropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.dateDeb")), "dateDeb",
"dateDeb", getLocale()));
- columns.add(new ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateFin")), "dateFin",
+ columns.add(new ShortDatePropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.dateFin")), "dateFin",
"dateFin", getLocale()));
- columns.add(new MapValuePropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.codePays")),
+ columns.add(new MapValuePropertyColumn<Campagne, String, String>(new Model<String>(getString("Campagne.codePays")),
"codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new LinkableImagePropertyColumn<Campagne>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Campagne, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -137,7 +137,7 @@
}
});
- final DataTable<Campagne> campagnesDataTable = new AjaxFallbackDefaultDataTable<Campagne>(
+ final DataTable<Campagne, String> campagnesDataTable = new AjaxFallbackDefaultDataTable<Campagne, String>(
"ListCampagnesPage.Campagnes", columns, campagnesDataProvider, WebContext.ROWS_PER_PAGE);
campagnesRefresh.add(campagnesDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -104,16 +104,16 @@
LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
extractions, getSession().getLocale());
- List<IColumn<Extraction>> columns = new ArrayList<IColumn<Extraction>>();
+ List<IColumn<Extraction, String>> columns = new ArrayList<IColumn<Extraction, String>>();
- columns.add(new LinkableImagePropertyColumn<Extraction>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -121,7 +121,7 @@
}
});
- columns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -129,16 +129,16 @@
}
});
- columns.add(new ShortDatePropertyColumn<Extraction>(new Model<String>(getString("Extraction.date")), "date",
+ columns.add(new ShortDatePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.date")), "date",
"date", getLocale()));
- columns.add(new PropertyColumn<Extraction>(new Model<String>(getString("Extraction.methode2")), "methode",
+ columns.add(new PropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.methode2")), "methode",
"methode"));
- columns.add(new DecimalPropertyColumn<Extraction>(new Model<String>(getString("Extraction.masseDepart2")),
+ columns.add(new DecimalPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.masseDepart2")),
"masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Campagne")), "lot.campagne",
+ columns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Campagne")), "lot.campagne",
"lot.campagne", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -147,7 +147,7 @@
}
});
- columns.add(new AbstractColumn<Extraction>(new Model<String>(getString("Extraction.extraits"))) {
+ columns.add(new AbstractColumn<Extraction, String>(new Model<String>(getString("Extraction.extraits"))) {
@Override
public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId,
IModel<Extraction> rowModel) {
@@ -186,7 +186,7 @@
});
- columns.add(new LinkableImagePropertyColumn<Extraction>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Extraction, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -205,7 +205,7 @@
}
});
- final DataTable<Extraction> extractionsDataTable = new AjaxFallbackDefaultDataTable<Extraction>(
+ final DataTable<Extraction, String> extractionsDataTable = new AjaxFallbackDefaultDataTable<Extraction, String>(
"ListExtractionsPage.Extractions", columns, extractionsDataProvider, WebContext.ROWS_PER_PAGE);
extractionsRefresh.add(extractionsDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -96,16 +96,16 @@
LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
lots, getSession().getLocale());
- List<IColumn<Lot>> columns = new ArrayList<IColumn<Lot>>();
+ List<IColumn<Lot, String>> columns = new ArrayList<IColumn<Lot, String>>();
- columns.add(new LinkableImagePropertyColumn<Lot>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Lot, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.ref")), "ref", "ref",
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -113,10 +113,10 @@
}
});
- columns.add(new PropertyColumn<Lot>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
+ columns.add(new PropertyColumn<Lot, String>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
"dateRecolte"));
- columns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.station")), "station", "station",
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.station")), "station", "station",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -124,7 +124,7 @@
}
});
- columns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
"specimenRef", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -132,30 +132,30 @@
}
});
- columns.add(new EnumPropertyColumn<Lot>(new Model<String>(getString("Specimen.typeOrganisme")),
+ columns.add(new EnumPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.typeOrganisme")),
"specimenRef.typeOrganisme", "specimenRef.typeOrganisme", ListLotsPage.this));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.embranchement")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.embranchement")),
"specimenRef.embranchement", "specimenRef.embranchement"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.famille")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.famille")),
"specimenRef.famille", "specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.genre")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.genre")),
"specimenRef.genre", "specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.espece")),
+ columns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.espece")),
"specimenRef.espece", "specimenRef.espece"));
- columns.add(new PropertyColumn<Lot>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
+ columns.add(new PropertyColumn<Lot, String>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
- columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
+ columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
"masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
+ columns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
"masseSeche", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
+ columns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -163,10 +163,10 @@
}
});
- columns.add(new MapValuePropertyColumn<Lot, String>(new Model<String>(getString("Campagne.codePays")),
+ columns.add(new MapValuePropertyColumn<Lot, String, String>(new Model<String>(getString("Campagne.codePays")),
"campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new LinkableImagePropertyColumn<Lot>("images/edit.png", getString("Update"), getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Lot, String>("images/edit.png", getString("Update"), getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
public void populateItem(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -184,7 +184,7 @@
}
});
- final DataTable<Lot> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot>("ListLotsPage.Lots", columns,
+ final DataTable<Lot, String> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot, String>("ListLotsPage.Lots", columns,
lotsDataProvider, WebContext.ROWS_PER_PAGE);
lotsRefresh.add(lotsDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -97,7 +97,7 @@
Utilisateur utilisateur = getSession().getUtilisateur();
final List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(utilisateur);
- DataTable<MoleculeProvenanceBean> moleculesDataTable = initMoleculesListTable(this,
+ DataTable<MoleculeProvenanceBean, String> moleculesDataTable = initMoleculesListTable(this,
"ListMoleculesPage.Molecules", currentPage, moleculeProvenances);
moleculesRefresh.add(moleculesDataTable);
}
@@ -113,7 +113,7 @@
* @param moleculeProvenances molecules provenance list
* @return data table component
*/
- public static DataTable<MoleculeProvenanceBean> initMoleculesListTable(final TemplatePage templatePage,
+ public static DataTable<MoleculeProvenanceBean, String> initMoleculesListTable(final TemplatePage templatePage,
final String componentId, final CallerPage callerPage,
List<MoleculeProvenanceBean> moleculeProvenances) {
@@ -121,9 +121,9 @@
new SimpleSortableListDataProvider<MoleculeProvenanceBean>(
moleculeProvenances, templatePage.getSession().getLocale());
- List<IColumn<MoleculeProvenanceBean>> columns = new ArrayList<IColumn<MoleculeProvenanceBean>>();
+ List<IColumn<MoleculeProvenanceBean, String>> columns = new ArrayList<IColumn<MoleculeProvenanceBean, String>>();
- columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean, String>(
"images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item, String componentId, IModel<MoleculeProvenanceBean> model) {
@@ -131,7 +131,7 @@
}
});
- columns.add(new LinkPropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new LinkPropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.idMolecule")),
"idMolecule", "idMolecule") {
@Override
@@ -140,7 +140,7 @@
}
});
- columns.add(new AbstractColumn<MoleculeProvenanceBean>(
+ columns.add(new AbstractColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.formuleDevMol"))) {
public void populateItem(Item<ICellPopulator<MoleculeProvenanceBean>> cellItem, String componentId, IModel<MoleculeProvenanceBean> rowModel) {
cellItem.add(new Label(componentId, "-")
@@ -148,23 +148,23 @@
}
});
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.nomCommun")),
"molecule.nomCommun", "molecule.nomCommun"));
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.familleChimique")),
"molecule.familleChimique", "molecule.familleChimique"));
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.formuleBrute")),
"molecule.formuleBrute", "molecule.formuleBrute"));
- columns.add(new DecimalPropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new DecimalPropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.masseMolaire")),
"molecule.masseMolaire", "molecule.masseMolaire", DecimalDisplFormat.SMALL, templatePage.getLocale()));
- columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean, String>(
"images/attachment.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item, String componentId, IModel<MoleculeProvenanceBean> model) {
@@ -177,23 +177,23 @@
}
});
- columns.add(new BooleanPropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new BooleanPropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.nouvMolecul")),
"molecule.nouvMolecul", "molecule.nouvMolecul", templatePage));
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.provenance.embranchement")),
"lot.specimenRef.embranchement", "lot.specimenRef.embranchement"));
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.provenance.genre")),
"lot.specimenRef.genre", "lot.specimenRef.genre"));
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.provenance.espece")),
"lot.specimenRef.espece", "lot.specimenRef.espece"));
- columns.add(new LinkPropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new LinkPropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.provenance.lot.ref")),
"lot.ref", "lot.ref") {
@Override
@@ -207,11 +207,11 @@
}
});
- columns.add(new PropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new PropertyColumn<MoleculeProvenanceBean, String>(
new Model<String>(templatePage.getString("Molecule.provenance.programme")),
"lot.campagne.programme", "lot.campagne.programme"));
- columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
+ columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean, String>(
"images/edit.png", templatePage.getString("Update"), templatePage.getString("Update")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item,
@@ -221,8 +221,8 @@
}
});
- final DataTable<MoleculeProvenanceBean> moleculesDataTable =
- new AjaxFallbackDefaultDataTable<MoleculeProvenanceBean>(
+ final DataTable<MoleculeProvenanceBean, String> moleculesDataTable =
+ new AjaxFallbackDefaultDataTable<MoleculeProvenanceBean, String>(
componentId, columns, moleculesDataProvider, WebContext.ROWS_PER_PAGE);
return moleculesDataTable;
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -614,9 +614,9 @@
SimpleSortableListDataProvider<Document> attachedDocumentsDataProvider =
new SimpleSortableListDataProvider<Document>(documents, getSession().getLocale());
- List<IColumn<Document>> columns = new ArrayList<IColumn<Document>>();
+ List<IColumn<Document, String>> columns = new ArrayList<IColumn<Document, String>>();
- columns.add(new LinkPropertyColumn<Document>(
+ columns.add(new LinkPropertyColumn<Document, String>(
new Model<String>(getString("Document.titre")), "titre", "titre") {
@Override
public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
@@ -624,13 +624,13 @@
}
});
- columns.add(new PropertyColumn<Document>(
+ columns.add(new PropertyColumn<Document, String>(
new Model<String>(getString("Document.typeDocument")), "typeDocument.nom", "typeDocument.nom"));
- columns.add(new PropertyColumn<Document>(
+ columns.add(new PropertyColumn<Document, String>(
new Model<String>(getString("Document.createur")), "createur", "createur"));
- columns.add(new LinkableImagePropertyColumn<Document>(new Model<String>(getString("Document.link")),
+ columns.add(new LinkableImagePropertyColumn<Document, String>(new Model<String>(getString("Document.link")),
"images/download.png", getString("Document.link"), getString("Document.link")) {
@Override
public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
@@ -650,10 +650,10 @@
}
});
- final DataTable<Document> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document>("ListDocumentsPage.AttachedDocuments", columns,
+ final DataTable<Document, String> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document, String>("ListDocumentsPage.AttachedDocuments", columns,
attachedDocumentsDataProvider, WebContext.ROWS_PER_PAGE);
- columns.add(new AjaxButtonPropertyColumn<Document>(new Model<String>(getString("Actions")),
+ columns.add(new AjaxButtonPropertyColumn<Document, String>(new Model<String>(getString("Actions")),
new Model<String>(getString("Delete")), formView) {
@Override
public void onSubmit(AjaxRequestTarget target, Form<?> form, IModel<Document> model) {
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -307,9 +307,9 @@
new SimpleSortableListDataProvider<Document>(
documents, getSession().getLocale());
- List<IColumn<Document>> columns = new ArrayList<IColumn<Document>>();
+ List<IColumn<Document, String>> columns = new ArrayList<IColumn<Document, String>>();
- columns.add(new LinkPropertyColumn<Document>(
+ columns.add(new LinkPropertyColumn<Document, String>(
new Model<String>(getString("Document.titre")), "titre", "titre") {
@Override
public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
@@ -317,13 +317,13 @@
}
});
- columns.add(new PropertyColumn<Document>(
+ columns.add(new PropertyColumn<Document, String>(
new Model<String>(getString("Document.typeDocument")), "typeDocument.nom", "typeDocument.nom"));
- columns.add(new PropertyColumn<Document>(
+ columns.add(new PropertyColumn<Document, String>(
new Model<String>(getString("Document.createur")), "createur", "createur"));
- columns.add(new LinkableImagePropertyColumn<Document>(new Model<String>(getString("Document.link")),
+ columns.add(new LinkableImagePropertyColumn<Document, String>(new Model<String>(getString("Document.link")),
"images/download.png", getString("Document.link"), getString("Document.link")) {
@Override
public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
@@ -343,7 +343,7 @@
}
});
- final DataTable<Document> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document>("ListDocumentsPage.AttachedDocuments", columns,
+ final DataTable<Document, String> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document, String>("ListDocumentsPage.AttachedDocuments", columns,
attachedDocumentsDataProvider, WebContext.ROWS_PER_PAGE);
add(attachedDocumentTable);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ListPersonnesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ListPersonnesPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ListPersonnesPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -103,9 +103,9 @@
final LoadableDetachableSortableListDataProvider<Personne> personnesDataProvider = new LoadableDetachableSortableListDataProvider<Personne>(
personnes, getSession().getLocale());
- List<IColumn<Personne>> columns = new ArrayList<IColumn<Personne>>();
+ List<IColumn<Personne, String>> columns = new ArrayList<IColumn<Personne, String>>();
- columns.add(new LinkableImagePropertyColumn<Personne>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Personne, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> model) {
if (model.getObject() instanceof Utilisateur) {
@@ -117,11 +117,11 @@
}
});
- columns.add(new PropertyColumn<Personne>(new Model<String>(getString("Personne.nom")), "nom", "nom"));
+ columns.add(new PropertyColumn<Personne, String>(new Model<String>(getString("Personne.nom")), "nom", "nom"));
- columns.add(new PropertyColumn<Personne>(new Model<String>(getString("Personne.prenom")), "prenom", "prenom"));
+ columns.add(new PropertyColumn<Personne, String>(new Model<String>(getString("Personne.prenom")), "prenom", "prenom"));
- columns.add(new LinkPropertyColumn<Personne>(new Model<String>(getString("Personne.courriel")), "courriel",
+ columns.add(new LinkPropertyColumn<Personne, String>(new Model<String>(getString("Personne.courriel")), "courriel",
"courriel", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
@@ -134,7 +134,7 @@
}
});
- columns.add(new AbstractColumn<Personne>(new Model<String>(getString("Utilisateur.typeDroit"))) {
+ columns.add(new AbstractColumn<Personne, String>(new Model<String>(getString("Utilisateur.typeDroit"))) {
@Override
public void populateItem(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
String typeDroit;
@@ -149,7 +149,7 @@
}
});
- columns.add(new LinkableImagePropertyColumn<Personne>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Personne, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@@ -178,7 +178,7 @@
}
});
- final DataTable<Personne> personnesDataTable = new AjaxFallbackDefaultDataTable<Personne>(
+ final DataTable<Personne, String> personnesDataTable = new AjaxFallbackDefaultDataTable<Personne, String>(
"ListPersonnesPage.Personnes", columns, personnesDataProvider, WebContext.ROWS_PER_PAGE);
personnesRefresh.add(personnesDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -96,9 +96,9 @@
LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
purifications, getSession().getLocale());
- List<IColumn<Purification>> columns = new ArrayList<IColumn<Purification>>();
+ List<IColumn<Purification, String>> columns = new ArrayList<IColumn<Purification, String>>();
- columns.add(new LinkableImagePropertyColumn<Purification>("images/read.png", getString("Read"),
+ columns.add(new LinkableImagePropertyColumn<Purification, String>("images/read.png", getString("Read"),
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -106,7 +106,7 @@
}
});
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Extraction.lot")), "lotSource",
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Extraction.lot")), "lotSource",
"lotSource", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -114,7 +114,7 @@
}
});
- columns.add(new LinkProduitPropertyColumn<Purification>(
+ columns.add(new LinkProduitPropertyColumn<Purification, String>(
new Model<String>(getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
@Override
public void onClickIfExtrait(Extrait extrait) {
@@ -127,7 +127,7 @@
}
});
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Purification.ref")), "ref",
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Purification.ref")), "ref",
"ref", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -135,13 +135,13 @@
}
});
- columns.add(new ShortDatePropertyColumn<Purification>(new Model<String>(getString("Purification.date")),
+ columns.add(new ShortDatePropertyColumn<Purification, String>(new Model<String>(getString("Purification.date")),
"date", "date", getLocale()));
- columns.add(new PropertyColumn<Purification>(new Model<String>(getString("Purification.methode2")), "methode",
+ columns.add(new PropertyColumn<Purification, String>(new Model<String>(getString("Purification.methode2")), "methode",
"methode"));
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Campagne")),
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Campagne")),
"lotSource.campagne", "lotSource.campagne", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -150,7 +150,7 @@
}
});
- columns.add(new LinkableImagePropertyColumn<Purification>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Purification, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -171,7 +171,7 @@
}
});
- final DataTable<Purification> purificationsDataTable = new AjaxFallbackDefaultDataTable<Purification>(
+ final DataTable<Purification, String> purificationsDataTable = new AjaxFallbackDefaultDataTable<Purification, String>(
"ListPurificationsPage.Purifications", columns, purificationsDataProvider, WebContext.ROWS_PER_PAGE);
purificationsRefresh.add(purificationsDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -147,7 +147,7 @@
List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(molecules, utilisateur);
// call static methods in ListXXXPage
- DataTable<MoleculeProvenanceBean> moleculesDataTable = ListMoleculesPage.initMoleculesListTable(this,
+ DataTable<MoleculeProvenanceBean, String> moleculesDataTable = ListMoleculesPage.initMoleculesListTable(this,
"SearchPage.Molecules.Results", currentPage, moleculeProvenances);
add(moleculesDataTable);
add(new CsvExportLink("SearchPage.Molecules.ExportCSV", moleculesDataTable, "molecules.csv"));
@@ -171,16 +171,16 @@
protected void addSpecimensTable(final CallerPage currentPage, SearchResult searchResult) {
// search result : specimens
List<Specimen> specimens = searchResult.getSpecimens();
- List<IColumn<Specimen>> specimensColumns = new ArrayList<IColumn<Specimen>>();
+ List<IColumn<Specimen, String>> specimensColumns = new ArrayList<IColumn<Specimen, String>>();
- specimensColumns.add(new LinkableImagePropertyColumn<Specimen>("images/read.png", getString("Read"), getString("Read")) {
+ specimensColumns.add(new LinkableImagePropertyColumn<Specimen, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
}
});
- specimensColumns.add(new LinkPropertyColumn<Specimen>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
+ specimensColumns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
@@ -188,22 +188,22 @@
}
});
- specimensColumns.add(new EnumPropertyColumn<Specimen>(new Model<String>(getString("Specimen.typeOrganisme")),
+ specimensColumns.add(new EnumPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.typeOrganisme")),
"typeOrganisme", "typeOrganisme", SearchPage.this));
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.embranchement")),
+ specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.embranchement")),
"embranchement", "embranchement"));
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.famille")), "famille",
+ specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.famille")), "famille",
"famille"));
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.genre")), "genre",
+ specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.genre")), "genre",
"genre"));
- specimensColumns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.espece")), "espece",
+ specimensColumns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.espece")), "espece",
"espece"));
- specimensColumns.add(new LinkPropertyColumn<Specimen>(new Model<String>(getString("Specimen.station2")), "station",
+ specimensColumns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.station2")), "station",
"station", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
@@ -212,7 +212,7 @@
});
LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
specimens, getSession().getLocale());
- final DataTable<Specimen> specimensDataTable = new DefaultDataTable<Specimen>(getResource() + ".Specimens.Results",
+ final DataTable<Specimen, String> specimensDataTable = new DefaultDataTable<Specimen, String>(getResource() + ".Specimens.Results",
specimensColumns, specimensDataProvider, Integer.MAX_VALUE);
add(specimensDataTable);
add(new CsvExportLink("SearchPage.Specimens.ExportCSV", specimensDataTable, "specimens.csv"));
@@ -227,16 +227,16 @@
protected void addLotsTable(final CallerPage currentPage, SearchResult searchResult) {
// search result : lots
List<Lot> lots = searchResult.getLots();
- List<IColumn<Lot>> lotsColumns = new ArrayList<IColumn<Lot>>();
+ List<IColumn<Lot, String>> lotsColumns = new ArrayList<IColumn<Lot, String>>();
- lotsColumns.add(new LinkableImagePropertyColumn<Lot>("images/read.png", getString("Read"), getString("Read")) {
+ lotsColumns.add(new LinkableImagePropertyColumn<Lot, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
setResponsePage(new ReadLotPage(model.getObject().getIdLot(), currentPage));
}
});
- lotsColumns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.ref")), "ref", "ref",
+ lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -244,10 +244,10 @@
}
});
- lotsColumns.add(new ExportablePropertyColumn<Lot>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
+ lotsColumns.add(new ExportablePropertyColumn<Lot, String>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
"dateRecolte"));
- lotsColumns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.station")), "station", "station",
+ lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.station")), "station", "station",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -255,7 +255,7 @@
}
});
- lotsColumns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
+ lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.specimenRef2")), "specimenRef",
"specimenRef", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -263,30 +263,30 @@
}
});
- lotsColumns.add(new EnumPropertyColumn<Lot>(new Model<String>(getString("Specimen.typeOrganisme")),
+ lotsColumns.add(new EnumPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.typeOrganisme")),
"specimenRef.typeOrganisme", "specimenRef.typeOrganisme", SearchPage.this));
- lotsColumns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.embranchement")),
+ lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.embranchement")),
"specimenRef.embranchement", "specimenRef.embranchement"));
- lotsColumns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.famille")),
+ lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.famille")),
"specimenRef.famille", "specimenRef.famille"));
- lotsColumns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.genre")),
+ lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.genre")),
"specimenRef.genre", "specimenRef.genre"));
- lotsColumns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.espece")),
+ lotsColumns.add(new TaxonomyPropertyColumn<Lot, String>(new Model<String>(getString("Specimen.espece")),
"specimenRef.espece", "specimenRef.espece"));
- lotsColumns.add(new ExportablePropertyColumn<Lot>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
+ lotsColumns.add(new ExportablePropertyColumn<Lot, String>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
- lotsColumns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
+ lotsColumns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
"masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
- lotsColumns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
+ lotsColumns.add(new DecimalPropertyColumn<Lot, String>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
"masseSeche", DecimalDisplFormat.SMALL, getLocale()));
- lotsColumns.add(new LinkPropertyColumn<Lot>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
+ lotsColumns.add(new LinkPropertyColumn<Lot, String>(new Model<String>(getString("Lot.campagne")), "campagne", "campagne",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
@@ -294,12 +294,12 @@
}
});
- lotsColumns.add(new MapValuePropertyColumn<Lot, String>(new Model<String>(getString("Campagne.codePays")),
+ lotsColumns.add(new MapValuePropertyColumn<Lot, String, String>(new Model<String>(getString("Campagne.codePays")),
"campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
lots, getSession().getLocale());
- final DataTable<Lot> lotsDataTable = new DefaultDataTable<Lot>(getResource() + ".Lots.Results", lotsColumns,
+ final DataTable<Lot, String> lotsDataTable = new DefaultDataTable<Lot, String>(getResource() + ".Lots.Results", lotsColumns,
lotsDataProvider, Integer.MAX_VALUE);
add(lotsDataTable);
add(new CsvExportLink("SearchPage.Lots.ExportCSV", lotsDataTable, "lots.csv"));
@@ -315,16 +315,16 @@
// search result : extractions
List<Extraction> extractions = searchResult.getExtractions();
- List<IColumn<Extraction>> extractionsColumns = new ArrayList<IColumn<Extraction>>();
+ List<IColumn<Extraction, String>> extractionsColumns = new ArrayList<IColumn<Extraction, String>>();
- extractionsColumns.add(new LinkableImagePropertyColumn<Extraction>("images/read.png", getString("Read"), getString("Read")) {
+ extractionsColumns.add(new LinkableImagePropertyColumn<Extraction, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
setResponsePage(new ReadExtractionPage(model.getObject().getIdExtraction(), currentPage));
}
});
- extractionsColumns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
+ extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.lot")), "lot", "lot",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -332,7 +332,7 @@
}
});
- extractionsColumns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
+ extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -340,16 +340,16 @@
}
});
- extractionsColumns.add(new ShortDatePropertyColumn<Extraction>(new Model<String>(getString("Extraction.date")), "date",
+ extractionsColumns.add(new ShortDatePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.date")), "date",
"date", getLocale()));
- extractionsColumns.add(new ExportablePropertyColumn<Extraction>(new Model<String>(getString("Extraction.methode2")), "methode",
+ extractionsColumns.add(new ExportablePropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.methode2")), "methode",
"methode"));
- extractionsColumns.add(new DecimalPropertyColumn<Extraction>(new Model<String>(getString("Extraction.masseDepart2")),
+ extractionsColumns.add(new DecimalPropertyColumn<Extraction, String>(new Model<String>(getString("Extraction.masseDepart2")),
"masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
- extractionsColumns.add(new LinkPropertyColumn<Extraction>(new Model<String>(getString("Campagne")), "lot.campagne",
+ extractionsColumns.add(new LinkPropertyColumn<Extraction, String>(new Model<String>(getString("Campagne")), "lot.campagne",
"lot.campagne", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
@@ -358,7 +358,7 @@
}
});
- extractionsColumns.add(new AbstractColumn<Extraction>(new Model<String>(getString("Extraction.extraits"))) {
+ extractionsColumns.add(new AbstractColumn<Extraction, String>(new Model<String>(getString("Extraction.extraits"))) {
@Override
public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId,
IModel<Extraction> rowModel) {
@@ -399,7 +399,7 @@
LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
extractions, getSession().getLocale());
- final DataTable<Extraction> extractionsDataTable = new DefaultDataTable<Extraction>(
+ final DataTable<Extraction, String> extractionsDataTable = new DefaultDataTable<Extraction, String>(
getResource() + ".Extractions.Results", extractionsColumns, extractionsDataProvider, Integer.MAX_VALUE);
add(extractionsDataTable);
add(new CsvExportLink("SearchPage.Extractions.ExportCSV", extractionsDataTable, "extractions.csv"));
@@ -416,9 +416,9 @@
LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
purifications, getSession().getLocale());
- List<IColumn<Purification>> columns = new ArrayList<IColumn<Purification>>();
+ List<IColumn<Purification, String>> columns = new ArrayList<IColumn<Purification, String>>();
- columns.add(new LinkableImagePropertyColumn<Purification>("images/read.png", getString("Read"),
+ columns.add(new LinkableImagePropertyColumn<Purification, String>("images/read.png", getString("Read"),
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -426,7 +426,7 @@
}
});
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Extraction.lot")), "lotSource",
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Extraction.lot")), "lotSource",
"lotSource", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -434,7 +434,7 @@
}
});
- columns.add(new LinkProduitPropertyColumn<Purification>(
+ columns.add(new LinkProduitPropertyColumn<Purification, String>(
new Model<String>(getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
@Override
public void onClickIfExtrait(Extrait extrait) {
@@ -447,7 +447,7 @@
}
});
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Purification.ref")), "ref",
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Purification.ref")), "ref",
"ref", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -455,13 +455,13 @@
}
});
- columns.add(new ShortDatePropertyColumn<Purification>(new Model<String>(getString("Purification.date")),
+ columns.add(new ShortDatePropertyColumn<Purification, String>(new Model<String>(getString("Purification.date")),
"date", "date", getLocale()));
- columns.add(new ExportablePropertyColumn<Purification>(new Model<String>(getString("Purification.methode2")), "methode",
+ columns.add(new ExportablePropertyColumn<Purification, String>(new Model<String>(getString("Purification.methode2")), "methode",
"methode"));
- columns.add(new LinkPropertyColumn<Purification>(new Model<String>(getString("Campagne")),
+ columns.add(new LinkPropertyColumn<Purification, String>(new Model<String>(getString("Campagne")),
"lotSource.campagne", "lotSource.campagne", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
@@ -470,7 +470,7 @@
}
});
- final DataTable<Purification> purificationsDataTable = new DefaultDataTable<Purification>(
+ final DataTable<Purification, String> purificationsDataTable = new DefaultDataTable<Purification, String>(
getResource() + ".Purifications.Results", columns, purificationsDataProvider, Integer.MAX_VALUE);
add(purificationsDataTable);
add(new CsvExportLink("SearchPage.Purifications.ExportCSV", purificationsDataTable, "purifications.csv"));
@@ -487,9 +487,9 @@
LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
resultatTestBios, getSession().getLocale());
- List<IColumn<ResultatTestBio>> columns = new ArrayList<IColumn<ResultatTestBio>>();
+ List<IColumn<ResultatTestBio, String>> columns = new ArrayList<IColumn<ResultatTestBio, String>>();
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("images/read.png", getString("Read"),
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/read.png", getString("Read"),
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
@@ -498,17 +498,17 @@
}
});
- columns.add(new ExportableTextFilteredPropertyColumn<ResultatTestBio, String>(new Model<String>(
+ columns.add(new ExportableTextFilteredPropertyColumn<ResultatTestBio, String, String>(new Model<String>(
getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(
+ columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(
getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
getLocale()));
- columns.add(new EnumPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.uniteConcMasse2")),
+ columns.add(new EnumPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.uniteConcMasse2")),
"uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
- columns.add(new LinkProduitPropertyColumn<ResultatTestBio>(new Model<String>(
+ columns.add(new LinkProduitPropertyColumn<ResultatTestBio, String>(new Model<String>(
getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
@Override
public void onClickIfExtrait(Extrait extrait) {
@@ -521,35 +521,35 @@
}
});
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.valeur")),
+ columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.valeur")),
"valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new ExportablePropertyColumn<ResultatTestBio>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
+ columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
"testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
- columns.add(new ExportablePropertyColumn<ResultatTestBio>(new Model<String>(getString("Extrait.typeExtrait2")),
+ columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Extrait.typeExtrait2")),
"typeExtraitSource", "typeExtraitSource"));
- columns.add(new BooleanPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.actif")),
+ columns.add(new BooleanPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.actif")),
"actif", "actif", (TemplatePage) getPage()));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.famille")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.famille")),
"lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.genre")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.genre")),
"lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.espece")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.espece")),
"lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
- columns.add(new MapValuePropertyColumn<ResultatTestBio, String>(new Model<String>(
+ columns.add(new MapValuePropertyColumn<ResultatTestBio, String, String>(new Model<String>(
getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new ExportablePropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.repere")),
+ columns.add(new ExportablePropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.repere")),
"repere", "repere"));
- columns.add(new LinkPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
+ columns.add(new LinkPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
"testBio.ref", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
@@ -558,7 +558,7 @@
}
});
- final DataTable<ResultatTestBio> resTestBiosDataTable = new DefaultDataTable<ResultatTestBio>(
+ final DataTable<ResultatTestBio, String> resTestBiosDataTable = new DefaultDataTable<ResultatTestBio, String>(
getResource() + ".ResultatTestBios.Results", columns, resTestBiosDataProvider, Integer.MAX_VALUE);
add(resTestBiosDataTable);
@@ -580,16 +580,16 @@
LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
stations, getSession().getLocale());
- List<IColumn<Station>> columns = new ArrayList<IColumn<Station>>();
+ List<IColumn<Station, String>> columns = new ArrayList<IColumn<Station, String>>();
- columns.add(new LinkableImagePropertyColumn<Station>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Station, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Station>(new Model<String>(getString("Station.nom")), "nom", "nom",
+ columns.add(new LinkPropertyColumn<Station, String>(new Model<String>(getString("Station.nom")), "nom", "nom",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
@@ -597,20 +597,20 @@
}
});
- columns.add(new MapValuePropertyColumn<Station, String>(new Model<String>(getString("Station.codePays")),
+ columns.add(new MapValuePropertyColumn<Station, String, String>(new Model<String>(getString("Station.codePays")),
"codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new ExportablePropertyColumn<Station>(new Model<String>(getString("Station.localite")), "localite",
+ columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.localite")), "localite",
"localite"));
- columns.add(new ExportablePropertyColumn<Station>(new Model<String>(getString("Station.latitude")), "latitude",
+ columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.latitude")), "latitude",
"latitude"));
- columns.add(new ExportablePropertyColumn<Station>(new Model<String>(getString("Station.longitude")), "longitude",
+ columns.add(new ExportablePropertyColumn<Station, String>(new Model<String>(getString("Station.longitude")), "longitude",
"longitude"));
- final DataTable<Station> stationsDataTable = new AjaxFallbackDefaultDataTable<Station>(
+ final DataTable<Station, String> stationsDataTable = new AjaxFallbackDefaultDataTable<Station, String>(
getResource() + ".Stations.Results", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
add(stationsDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -91,16 +91,16 @@
LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
specimens, getSession().getLocale());
- List<IColumn<Specimen>> columns = new ArrayList<IColumn<Specimen>>();
+ List<IColumn<Specimen, String>> columns = new ArrayList<IColumn<Specimen, String>>();
- columns.add(new LinkableImagePropertyColumn<Specimen>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
setResponsePage(new ReadSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Specimen>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
+ columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.ref")), "ref", "ref",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
@@ -108,22 +108,22 @@
}
});
- columns.add(new EnumPropertyColumn<Specimen>(new Model<String>(getString("Specimen.typeOrganisme")),
+ columns.add(new EnumPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.typeOrganisme")),
"typeOrganisme", "typeOrganisme", ListSpecimensPage.this));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.embranchement")),
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.embranchement")),
"embranchement", "embranchement"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.famille")), "famille",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.famille")), "famille",
"famille"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.genre")), "genre",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.genre")), "genre",
"genre"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.espece")), "espece",
+ columns.add(new TaxonomyPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.espece")), "espece",
"espece"));
- columns.add(new LinkPropertyColumn<Specimen>(new Model<String>(getString("Specimen.station2")), "station",
+ columns.add(new LinkPropertyColumn<Specimen, String>(new Model<String>(getString("Specimen.station2")), "station",
"station", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
@@ -131,7 +131,7 @@
}
});
- columns.add(new LinkableImagePropertyColumn<Specimen>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Specimen, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -154,7 +154,7 @@
}
});
- final DataTable<Specimen> specimensDataTable = new AjaxFallbackDefaultDataTable<Specimen>(
+ final DataTable<Specimen, String> specimensDataTable = new AjaxFallbackDefaultDataTable<Specimen, String>(
"ListSpecimensPage.Specimens", columns, specimensDataProvider, WebContext.ROWS_PER_PAGE);
specimensRefresh.add(specimensDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -91,16 +91,16 @@
LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
stations, getSession().getLocale());
- List<IColumn<Station>> columns = new ArrayList<IColumn<Station>>();
+ List<IColumn<Station, String>> columns = new ArrayList<IColumn<Station, String>>();
- columns.add(new LinkableImagePropertyColumn<Station>("images/read.png", getString("Read"), getString("Read")) {
+ columns.add(new LinkableImagePropertyColumn<Station, String>("images/read.png", getString("Read"), getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
setResponsePage(new ReadStationPage(model.getObject().getIdStation(), currentPage));
}
});
- columns.add(new LinkPropertyColumn<Station>(new Model<String>(getString("Station.nom")), "nom", "nom",
+ columns.add(new LinkPropertyColumn<Station, String>(new Model<String>(getString("Station.nom")), "nom", "nom",
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
@@ -108,19 +108,19 @@
}
});
- columns.add(new MapValuePropertyColumn<Station, String>(new Model<String>(getString("Station.codePays")),
+ columns.add(new MapValuePropertyColumn<Station, String, String>(new Model<String>(getString("Station.codePays")),
"codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.localite")), "localite",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.localite")), "localite",
"localite"));
- columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.latitude")), "latitude",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.latitude")), "latitude",
"latitude"));
- columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.longitude")), "longitude",
+ columns.add(new PropertyColumn<Station, String>(new Model<String>(getString("Station.longitude")), "longitude",
"longitude"));
- columns.add(new LinkableImagePropertyColumn<Station>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<Station, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -143,7 +143,7 @@
}
});
- final DataTable<Station> stationsDataTable = new AjaxFallbackDefaultDataTable<Station>(
+ final DataTable<Station, String> stationsDataTable = new AjaxFallbackDefaultDataTable<Station, String>(
"ListStationsPage.Stations", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
stationsRefresh.add(stationsDataTable);
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -100,9 +100,9 @@
LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
resTestsBios, getSession().getLocale());
- List<IColumn<ResultatTestBio>> columns = new ArrayList<IColumn<ResultatTestBio>>();
+ List<IColumn<ResultatTestBio, String>> columns = new ArrayList<IColumn<ResultatTestBio, String>>();
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("images/read.png", getString("Read"),
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/read.png", getString("Read"),
getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
@@ -111,17 +111,17 @@
}
});
- columns.add(new TextFilteredPropertyColumn<ResultatTestBio, String>(new Model<String>(
+ columns.add(new TextFilteredPropertyColumn<ResultatTestBio, String, String>(new Model<String>(
getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(
+ columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(
getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
getLocale()));
- columns.add(new EnumPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.uniteConcMasse2")),
+ columns.add(new EnumPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.uniteConcMasse2")),
"uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
- columns.add(new LinkProduitPropertyColumn<ResultatTestBio>(new Model<String>(
+ columns.add(new LinkProduitPropertyColumn<ResultatTestBio, String>(new Model<String>(
getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
@Override
public void onClickIfExtrait(Extrait extrait) {
@@ -134,35 +134,35 @@
}
});
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.valeur")),
+ columns.add(new DecimalPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.valeur")),
"valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
"testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
- columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("Extrait.typeExtrait2")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Extrait.typeExtrait2")),
"typeExtraitSource", "typeExtraitSource"));
- columns.add(new BooleanPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.actif")),
+ columns.add(new BooleanPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.actif")),
"actif", "actif", (TemplatePage) getPage()));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.famille")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.famille")),
"lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.genre")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.genre")),
"lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.espece")),
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("Specimen.espece")),
"lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
- columns.add(new MapValuePropertyColumn<ResultatTestBio, String>(new Model<String>(
+ columns.add(new MapValuePropertyColumn<ResultatTestBio, String, String>(new Model<String>(
getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.repere")),
+ columns.add(new PropertyColumn<ResultatTestBio, String>(new Model<String>(getString("ResultatTestBio.repere")),
"repere", "repere"));
- columns.add(new LinkPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
+ columns.add(new LinkPropertyColumn<ResultatTestBio, String>(new Model<String>(getString("TestBio.ref")), "testBio.ref",
"testBio.ref", getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
@@ -171,7 +171,7 @@
}
});
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("images/edit.png", getString("Update"),
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio, String>("images/edit.png", getString("Update"),
getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
@Override
@@ -193,7 +193,7 @@
}
});
- final DataTable<ResultatTestBio> resTestBiosDataTable = new AjaxFallbackDefaultDataTable<ResultatTestBio>(
+ final DataTable<ResultatTestBio, String> resTestBiosDataTable = new AjaxFallbackDefaultDataTable<ResultatTestBio, String>(
"ListTestsBioPage.ResultatsTestsBio", columns, resTestBiosDataProvider, WebContext.ROWS_PER_PAGE);
// DRAFT FOR FILTER TABLE
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -22,12 +22,18 @@
*/
package nc.ird.cantharella.web.utils.behaviors;
+import nc.ird.cantharella.web.pages.HomePage;
+
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
-import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.core.util.string.JavaScriptUtils;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.Response;
-import org.apache.wicket.util.string.JavaScriptUtils;
+import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
/**
* Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
@@ -61,14 +67,14 @@
/** {@inheritDoc} */
@Override
public void renderHead(Component component, IHeaderResponse response) {
- response.renderCSSReference("ChemDoodleWeb/css/ChemDoodleWeb.css");
- response.renderCSSReference("ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css");
- response.renderJavaScriptReference("js/jquery-1.9.1.min.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb-libs.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js");
- response.renderJavaScriptReference("js/moleditor.js");
+ response.render(CssHeaderItem.forUrl("ChemDoodleWeb/css/ChemDoodleWeb.css"));
+ response.render(CssHeaderItem.forUrl("ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css"));
+ response.render(JavaScriptHeaderItem.forUrl("js/jquery-1.9.1.min.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/ChemDoodleWeb-libs.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/ChemDoodleWeb.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js"));
+ response.render(JavaScriptHeaderItem.forUrl("js/moleditor.js"));
}
/** {@inheritDoc} */
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -22,12 +22,18 @@
*/
package nc.ird.cantharella.web.utils.behaviors;
+import nc.ird.cantharella.web.pages.HomePage;
+
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
-import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.core.util.string.JavaScriptUtils;
+import org.apache.wicket.markup.head.CssHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.Response;
-import org.apache.wicket.util.string.JavaScriptUtils;
+import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.request.resource.JavaScriptResourceReference;
/**
* Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
@@ -80,11 +86,11 @@
/** {@inheritDoc} */
@Override
public void renderHead(Component component, IHeaderResponse response) {
- response.renderCSSReference("ChemDoodleWeb/css/ChemDoodleWeb.css");
- response.renderJavaScriptReference("js/jquery-1.9.1.min.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb-libs.js");
- response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb.js");
- response.renderJavaScriptReference("js/molviewer.js");
+ response.render(CssHeaderItem.forUrl("ChemDoodleWeb/css/ChemDoodleWeb.css"));
+ response.render(JavaScriptHeaderItem.forUrl("js/jquery-1.9.1.min.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/ChemDoodleWeb-libs.js"));
+ response.render(JavaScriptHeaderItem.forUrl("ChemDoodleWeb/js/ChemDoodleWeb.js"));
+ response.render(JavaScriptHeaderItem.forUrl("js/molviewer.js"));
}
/** {@inheritDoc} */
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -36,8 +36,9 @@
* Column embeded in a datatable which represent an linkable image
* @author Adrien Cheype
* @param <T> Generic type
+ * @param <S> the type of the sort property
*/
-abstract public class AjaxButtonPropertyColumn<T> extends AbstractColumn<T> {
+abstract public class AjaxButtonPropertyColumn<T, S> extends AbstractColumn<T, S> {
/** Title displayed for the button */
private Model<String> buttonLabel;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -36,8 +36,9 @@
* PropertyColumn which display booleans
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
*/
-public class BooleanPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
+public class BooleanPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -52,7 +53,7 @@
* @param propertyExpression Wicket property expression
* @param page Page used to get True, False message
*/
- public BooleanPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public BooleanPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
TemplatePage page) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -38,8 +38,9 @@
* PropertyColumn which display numbers with decimal format
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
*/
-public class DecimalPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
+public class DecimalPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -58,7 +59,7 @@
* @param format format to display
* @param locale Locale used to format decimal
*/
- public DecimalPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public DecimalPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
DecimalDisplFormat format, Locale locale) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -36,8 +36,9 @@
* PropertyColumns which display corresponding messages for enum values
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
*/
-public class EnumPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
+public class EnumPropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -52,7 +53,7 @@
* @param propertyExpression Wicket property expression
* @param page Page used to get enum messages
*/
- public EnumPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public EnumPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
TemplatePage page) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -30,8 +30,9 @@
* @author echatellier
*
* @param <T>
+ * @param <S> the type of the sort property
*/
-public interface ExportableColumn<T> extends IColumn<T> {
+public interface ExportableColumn<T, S> extends IColumn<T, S> {
/** Export column name. */
String getHeaderName();
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportablePropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -32,9 +32,10 @@
* @author echatellier
*
* @param <T>
+ * @param <S> the type of the sort property
*/
-public class ExportablePropertyColumn<T> extends PropertyColumn<T> implements
- ExportableColumn<T> {
+public class ExportablePropertyColumn<T, S> extends PropertyColumn<T, S> implements
+ ExportableColumn<T, S> {
/**
* Constructor.
@@ -43,7 +44,7 @@
* @param sortProperty wicket sort property
* @param propertyExpression wicket sort expression
*/
- public ExportablePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
+ public ExportablePropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ExportableTextFilteredPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -33,8 +33,9 @@
*
* @param <T>
* @param <F>
+ * @param <S> the type of the sort property
*/
-public class ExportableTextFilteredPropertyColumn<T, F> extends TextFilteredPropertyColumn<T, F> implements ExportableColumn<T> {
+public class ExportableTextFilteredPropertyColumn<T, F, S> extends TextFilteredPropertyColumn<T, F, S> implements ExportableColumn<T, S> {
/**
* Constructor.
@@ -44,7 +45,7 @@
* @param propertyExpression wicket sort expression
*/
public ExportableTextFilteredPropertyColumn(IModel<String> displayModel,
- String sortProperty, String propertyExpression) {
+ S sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -38,8 +38,9 @@
* Column embeded in a datatable which represent a link code from
* https://cwiki.apache.org/WICKET/adding-links-in-a-defaultdatatable.html
* @param <T> Generic type
+ * @param <S> the type of the sort property
*/
-abstract public class LinkPropertyColumn<T> extends PropertyColumn<T> implements ExportableColumn<T>{
+abstract public class LinkPropertyColumn<T, S> extends PropertyColumn<T, S> implements ExportableColumn<T, S>{
/** Popup settings */
private PopupSettings popupSettings;
@@ -57,7 +58,7 @@
* @param propertyExpression Property expression
* @param popupSettings Popup setting
*/
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public LinkPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
PopupSettings popupSettings) {
this(displayModel, sortProperty, propertyExpression);
this.popupSettings = popupSettings;
@@ -70,7 +71,7 @@
* @param propertyExpression Property expression
* @param linkTitle Title displayed for the link
*/
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public LinkPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
String linkTitle) {
this(displayModel, sortProperty, propertyExpression);
this.linkTitle = linkTitle;
@@ -84,7 +85,7 @@
* @param linkTitle Title displayed for the link
* @param popupSettings Popup setting
*/
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public LinkPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
String linkTitle, PopupSettings popupSettings) {
this(displayModel, sortProperty, propertyExpression);
this.linkTitle = linkTitle;
@@ -107,7 +108,7 @@
* @param sortProperty Sort property
* @param propertyExpression Property expression
*/
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
+ public LinkPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -36,8 +36,9 @@
* Column embeded in a datatable which represent an linkable image
* @author Adrien Cheype
* @param <T> Generic type
+ * @param <S> the type of the sort property
*/
-abstract public class LinkableImagePropertyColumn<T> extends AbstractColumn<T> {
+abstract public class LinkableImagePropertyColumn<T, S> extends AbstractColumn<T, S> {
/** Relative url for the image */
private String imageSrc;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -37,9 +37,10 @@
* PropertyColumn which display string resulting values of applying model value on a map.
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
* @param <U> Type of the map key. The map is thus parametred by <U, String>
*/
-public class MapValuePropertyColumn<T, U> extends AbstractColumn<T> implements ExportableColumn<T> {
+public class MapValuePropertyColumn<T, S, U> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -54,7 +55,7 @@
* @param propertyExpression Wicket property expression
* @param map Applying map
*/
- public MapValuePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public MapValuePropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
Map<U, String> map) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/PercentPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/PercentPropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/PercentPropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -36,8 +36,9 @@
* PropertyColumns which display numbers with percent format
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
*/
-public class PercentPropertyColumn<T> extends AbstractColumn<T> {
+public class PercentPropertyColumn<T, S> extends AbstractColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -52,7 +53,7 @@
* @param propertyExpression Wicket property expression
* @param locale Locale used to format decimal
*/
- public PercentPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public PercentPropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
Locale locale) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -37,8 +37,9 @@
* PropertyColumns which display dates with a short format
* @author Adrien Cheype
* @param <T> Type of the row model
+ * @param <S> the type of the sort property
*/
-public class ShortDatePropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
+public class ShortDatePropertyColumn<T, S> extends AbstractColumn<T, S> implements ExportableColumn<T, S> {
/** wicket property expression */
private final String propertyExpression;
@@ -53,7 +54,7 @@
* @param propertyExpression Wicket property expression
* @param locale Locale used to format decimal
*/
- public ShortDatePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ public ShortDatePropertyColumn(IModel<String> displayModel, S sortProperty, String propertyExpression,
Locale locale) {
super(displayModel, sortProperty);
this.propertyExpression = propertyExpression;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/links/CsvExportLink.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/links/CsvExportLink.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/links/CsvExportLink.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -45,13 +45,13 @@
* @author Eric Chatellier
* @param <T> datatable type
*/
-public class CsvExportLink<T> extends Link<Void> {
+public class CsvExportLink<T, S> extends Link<Void> {
/** For serializable methods */
private static final long serialVersionUID = 20130204L;
/** Data table containing data to export. */
- private final DataTable<T> table;
+ private final DataTable<T, S> table;
/** Download filename. */
private final String filename;
@@ -63,7 +63,7 @@
* @param table data table
* @param filename csv filename
*/
- public CsvExportLink(String id, DataTable<T> table, String filename) {
+ public CsvExportLink(String id, DataTable<T, S> table, String filename) {
super(id);
this.table = table;
this.filename = filename;
@@ -94,10 +94,10 @@
} else {
writer = new CsvWriter(out, ',');
}
- List<ExportableColumn<T>> exportable = getExportableColumns();
+ List<ExportableColumn<T, S>> exportable = getExportableColumns();
// write header
- for (ExportableColumn<T> column : exportable) {
+ for (ExportableColumn<T, S> column : exportable) {
writer.write(column.getHeaderName());
}
writer.endLine();
@@ -105,7 +105,7 @@
Iterator<? extends T> it = table.getDataProvider().iterator(0, table.getDataProvider().size());
while (it.hasNext()) {
T object = it.next();
- for (ExportableColumn<T> col : exportable) {
+ for (ExportableColumn<T, S> col : exportable) {
col.exportCsv(object, writer);
}
writer.endLine();
@@ -119,11 +119,11 @@
* @return exportable column list
*/
@SuppressWarnings("unchecked")
- private List<ExportableColumn<T>> getExportableColumns() {
- List<ExportableColumn<T>> exportable = new ArrayList<ExportableColumn<T>>(table.getColumns().size());
- for (IColumn<?> column : table.getColumns()) {
- if (column instanceof ExportableColumn<?>) {
- exportable.add((ExportableColumn<T>) column);
+ private List<ExportableColumn<T, S>> getExportableColumns() {
+ List<ExportableColumn<T, S>> exportable = new ArrayList<ExportableColumn<T, S>>(table.getColumns().size());
+ for (IColumn<?, ?> column : table.getColumns()) {
+ if (column instanceof ExportableColumn<?, ?>) {
+ exportable.add((ExportableColumn<T, S>) column);
}
}
return exportable;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/LoadableDetachableSortableListDataProvider.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/LoadableDetachableSortableListDataProvider.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/LoadableDetachableSortableListDataProvider.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -48,9 +48,10 @@
* avec "implements IFilterStateLocator<FilterMapHomeMade>"
* @author Mickael Tricot
* @author Adrien Cheype
- * @param <M> Model object type
+ * @param <T> Model object type
+ * @param <S> the type of the sort property
*/
-public final class LoadableDetachableSortableListDataProvider<M extends AbstractModel> extends SortableDataProvider<M> {
+public final class LoadableDetachableSortableListDataProvider<M extends AbstractModel> extends SortableDataProvider<M, String> {
/** Logger */
private static final Logger LOG = LoggerFactory.getLogger(LoadableDetachableSortableListDataProvider.class);
@@ -86,7 +87,7 @@
/** {@inheritDoc} */
@Override
- public Iterator<? extends M> iterator(int first, int count) {
+ public Iterator<? extends M> iterator(long first, long count) {
if (getSort() != null && !StringUtils.isEmpty(getSort().getProperty())) {
Collections.sort(list, new Comparator<M>() {
@@ -121,7 +122,7 @@
});
}
- return list.subList(first, Math.min(first + count, size())).iterator();
+ return list.subList((int)first, (int)Math.min(first + count, size())).iterator();
}
/** {@inheritDoc} */
@@ -133,7 +134,7 @@
/** {@inheritDoc} */
@Override
- public int size() {
+ public long size() {
return list.size();
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/SimpleSortableListDataProvider.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/SimpleSortableListDataProvider.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/SimpleSortableListDataProvider.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -50,7 +50,7 @@
* @author Adrien Cheype
* @param <M> Model object type
*/
-public class SimpleSortableListDataProvider<M> extends SortableDataProvider<M> {
+public class SimpleSortableListDataProvider<M> extends SortableDataProvider<M, String> {
private static final long serialVersionUID = 1L;
@@ -87,7 +87,7 @@
/** {@inheritDoc} */
@Override
- public Iterator<M> iterator(int first, int count) {
+ public Iterator<M> iterator(long first, long count) {
if (getSort() != null && !StringUtils.isEmpty(getSort().getProperty())) {
Collections.sort(list, new Comparator<M>() {
@@ -122,7 +122,7 @@
});
}
- return list.subList(first, Math.min(first + count, size())).iterator();
+ return list.subList((int)first, (int)Math.min(first + count, size())).iterator();
}
/** {@inheritDoc} */
@@ -140,7 +140,7 @@
/** {@inheritDoc} */
@Override
- public int size() {
+ public long size() {
return list.size();
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthSession.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthSession.java 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthSession.java 2013-02-14 16:39:05 UTC (rev 109)
@@ -105,8 +105,6 @@
return false;
}
- /** {@inheritDoc} */
- @Override
public boolean authenticate(String username, String password) {
boolean authenticate = personneService.authenticateUtilisateur(username, password);
LOG.debug(String.valueOf(authenticate));
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-02-14 15:39:46 UTC (rev 108)
+++ trunk/pom.xml 2013-02-14 16:39:05 UTC (rev 109)
@@ -130,7 +130,7 @@
<version.servlet-api>2.5</version.servlet-api>
- <version.wicket>1.5.9</version.wicket>
+ <version.wicket>6.5.0</version.wicket>
<!-- FIXME echatellier Probleme de parallelisation des tests unitaire,
cause org.hibernate.HibernateException: Don't change the reference to a collection
1
0
r108 - in trunk: cantharella.service/src/main/java/nc/ird/cantharella/service/services cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search
by echatellier@users.forge.codelutin.com 14 Feb '13
by echatellier@users.forge.codelutin.com 14 Feb '13
14 Feb '13
Author: echatellier
Date: 2013-02-14 16:39:46 +0100 (Thu, 14 Feb 2013)
New Revision: 108
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/108
Log:
Merge SearchPage datatable with ListMoleculesPage datatable (common code)
Modified:
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-02-14 15:01:31 UTC (rev 107)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-02-14 15:39:46 UTC (rev 108)
@@ -84,6 +84,16 @@
List<MoleculeProvenanceBean> listMoleculeProvenances(Utilisateur utilisateur);
/**
+ * List molecule provenance and molecule without provenance or provenance
+ * not visible by current user.
+ *
+ * @param molecules molecules list to transform
+ * @param utilisateur utilisateur to filter results
+ * @return Molecules
+ */
+ List<MoleculeProvenanceBean> listMoleculeProvenances(List<Molecule> molecules, Utilisateur utilisateur);
+
+ /**
* Charge une molecule
* @param numero numero
* @return Le lot correspondant
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-02-14 15:01:31 UTC (rev 107)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-02-14 15:39:46 UTC (rev 108)
@@ -104,9 +104,16 @@
/** {@inheritDoc} */
@Override
public List<MoleculeProvenanceBean> listMoleculeProvenances(Utilisateur utilisateur) {
+ List<Molecule> molecules = listMolecules();
+ List<MoleculeProvenanceBean> result = listMoleculeProvenances(molecules, utilisateur);
+ return result;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public List<MoleculeProvenanceBean> listMoleculeProvenances(List<Molecule> molecules, Utilisateur utilisateur) {
List<MoleculeProvenanceBean> result = new ArrayList<MoleculeProvenanceBean>();
- List<Molecule> molecules = listMolecules();
-
+
for (Molecule molecule : molecules) {
boolean isOneProductVisible = false;
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-14 15:01:31 UTC (rev 107)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-02-14 15:39:46 UTC (rev 108)
@@ -96,32 +96,52 @@
// Liste des molecules
Utilisateur utilisateur = getSession().getUtilisateur();
final List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(utilisateur);
+
+ DataTable<MoleculeProvenanceBean> moleculesDataTable = initMoleculesListTable(this,
+ "ListMoleculesPage.Molecules", currentPage, moleculeProvenances);
+ moleculesRefresh.add(moleculesDataTable);
+ }
+ /**
+ * Init data table with molecule provenances list.
+ *
+ * This method is static to be resued in several places.
+ *
+ * @param templatePage parent page
+ * @param componentId data table id
+ * @param callerPage caller page
+ * @param moleculeProvenances molecules provenance list
+ * @return data table component
+ */
+ public static DataTable<MoleculeProvenanceBean> initMoleculesListTable(final TemplatePage templatePage,
+ final String componentId, final CallerPage callerPage,
+ List<MoleculeProvenanceBean> moleculeProvenances) {
+
SimpleSortableListDataProvider<MoleculeProvenanceBean> moleculesDataProvider =
new SimpleSortableListDataProvider<MoleculeProvenanceBean>(
- moleculeProvenances, getSession().getLocale());
+ moleculeProvenances, templatePage.getSession().getLocale());
List<IColumn<MoleculeProvenanceBean>> columns = new ArrayList<IColumn<MoleculeProvenanceBean>>();
columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
- "images/read.png", getString("Read"), getString("Read")) {
+ "images/read.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item, String componentId, IModel<MoleculeProvenanceBean> model) {
- setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
+ templatePage.setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), callerPage));
}
});
columns.add(new LinkPropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.idMolecule")),
+ new Model<String>(templatePage.getString("Molecule.idMolecule")),
"idMolecule", "idMolecule") {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item, String componentId, IModel<MoleculeProvenanceBean> model) {
- setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
+ templatePage.setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), callerPage));
}
});
columns.add(new AbstractColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.formuleDevMol"))) {
+ new Model<String>(templatePage.getString("Molecule.formuleDevMol"))) {
public void populateItem(Item<ICellPopulator<MoleculeProvenanceBean>> cellItem, String componentId, IModel<MoleculeProvenanceBean> rowModel) {
cellItem.add(new Label(componentId, "-")
.add(new MoleculeViewBehavior(new PropertyModel<String>(rowModel, "molecule.formuleDevMol"))));
@@ -129,26 +149,26 @@
});
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.nomCommun")),
+ new Model<String>(templatePage.getString("Molecule.nomCommun")),
"molecule.nomCommun", "molecule.nomCommun"));
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.familleChimique")),
+ new Model<String>(templatePage.getString("Molecule.familleChimique")),
"molecule.familleChimique", "molecule.familleChimique"));
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.formuleBrute")),
+ new Model<String>(templatePage.getString("Molecule.formuleBrute")),
"molecule.formuleBrute", "molecule.formuleBrute"));
columns.add(new DecimalPropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.masseMolaire")),
- "molecule.masseMolaire", "molecule.masseMolaire", DecimalDisplFormat.SMALL, getLocale()));
+ new Model<String>(templatePage.getString("Molecule.masseMolaire")),
+ "molecule.masseMolaire", "molecule.masseMolaire", DecimalDisplFormat.SMALL, templatePage.getLocale()));
columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
- "images/attachment.png", getString("Read"), getString("Read")) {
+ "images/attachment.png", templatePage.getString("Read"), templatePage.getString("Read")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item, String componentId, IModel<MoleculeProvenanceBean> model) {
- setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
+ templatePage.setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), callerPage));
}
@Override
@@ -158,23 +178,23 @@
});
columns.add(new BooleanPropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.nouvMolecul")),
- "molecule.nouvMolecul", "molecule.nouvMolecul", this));
+ new Model<String>(templatePage.getString("Molecule.nouvMolecul")),
+ "molecule.nouvMolecul", "molecule.nouvMolecul", templatePage));
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.provenance.embranchement")),
+ new Model<String>(templatePage.getString("Molecule.provenance.embranchement")),
"lot.specimenRef.embranchement", "lot.specimenRef.embranchement"));
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.provenance.genre")),
+ new Model<String>(templatePage.getString("Molecule.provenance.genre")),
"lot.specimenRef.genre", "lot.specimenRef.genre"));
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.provenance.espece")),
+ new Model<String>(templatePage.getString("Molecule.provenance.espece")),
"lot.specimenRef.espece", "lot.specimenRef.espece"));
columns.add(new LinkPropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.provenance.lot.ref")),
+ new Model<String>(templatePage.getString("Molecule.provenance.lot.ref")),
"lot.ref", "lot.ref") {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item,
@@ -182,29 +202,28 @@
Lot lot = model.getObject().getLot();
if (lot != null) {
int idLot = lot.getIdLot();
- setResponsePage(new ReadLotPage(idLot, currentPage));
+ templatePage.setResponsePage(new ReadLotPage(idLot, callerPage));
}
}
});
columns.add(new PropertyColumn<MoleculeProvenanceBean>(
- new Model<String>(getString("Molecule.provenance.programme")),
+ new Model<String>(templatePage.getString("Molecule.provenance.programme")),
"lot.campagne.programme", "lot.campagne.programme"));
columns.add(new LinkableImagePropertyColumn<MoleculeProvenanceBean>(
- "images/edit.png", getString("Update"), getString("Update")) {
+ "images/edit.png", templatePage.getString("Update"), templatePage.getString("Update")) {
@Override
public void onClick(Item<ICellPopulator<MoleculeProvenanceBean>> item,
String componentId, IModel<MoleculeProvenanceBean> model) {
int idMolecule = model.getObject().getIdMolecule();
- setResponsePage(new ManageMoleculePage(idMolecule, currentPage));
+ templatePage.setResponsePage(new ManageMoleculePage(idMolecule, callerPage));
}
});
final DataTable<MoleculeProvenanceBean> moleculesDataTable =
new AjaxFallbackDefaultDataTable<MoleculeProvenanceBean>(
- "ListMoleculesPage.Molecules", columns,
- moleculesDataProvider, WebContext.ROWS_PER_PAGE);
- moleculesRefresh.add(moleculesDataTable);
+ componentId, columns, moleculesDataProvider, WebContext.ROWS_PER_PAGE);
+ return moleculesDataTable;
}
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-14 15:01:31 UTC (rev 107)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-02-14 15:39:46 UTC (rev 108)
@@ -36,7 +36,9 @@
import nc.ird.cantharella.data.model.Specimen;
import nc.ird.cantharella.data.model.Station;
import nc.ird.cantharella.data.model.Utilisateur;
+import nc.ird.cantharella.service.model.MoleculeProvenanceBean;
import nc.ird.cantharella.service.model.SearchResult;
+import nc.ird.cantharella.service.services.MoleculeService;
import nc.ird.cantharella.service.services.SearchService;
import nc.ird.cantharella.web.config.WebContext;
import nc.ird.cantharella.web.pages.TemplatePage;
@@ -45,14 +47,12 @@
import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage;
import nc.ird.cantharella.web.pages.domain.extraction.ReadExtractionPage;
import nc.ird.cantharella.web.pages.domain.lot.ReadLotPage;
-import nc.ird.cantharella.web.pages.domain.molecule.ReadMoleculePage;
+import nc.ird.cantharella.web.pages.domain.molecule.ListMoleculesPage;
import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage;
-import nc.ird.cantharella.web.pages.domain.specimen.ListSpecimensPage;
import nc.ird.cantharella.web.pages.domain.specimen.ReadSpecimenPage;
import nc.ird.cantharella.web.pages.domain.station.ReadStationPage;
import nc.ird.cantharella.web.pages.domain.testBio.ReadTestBioPage;
import nc.ird.cantharella.web.utils.CallerPage;
-import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn;
import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn;
@@ -76,7 +76,6 @@
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
@@ -103,6 +102,10 @@
@SpringBean
protected SearchService searchService;
+ /** Molecule service. */
+ @SpringBean
+ protected MoleculeService moleculeService;
+
/** Nombre d'extraits affichés dans la colonne de résumés des extraits. */
private static final int MAX_EXTRAITS_DISPLAY = 4;
@@ -114,7 +117,7 @@
public SearchPage(String query) {
super(SearchPage.class);
this.query = query;
- final CallerPage currentPage = new CallerPage(ListSpecimensPage.class);
+ final CallerPage currentPage = new CallerPage(SearchPage.class);
// ca sert a rien, mais wicket est pas content
ExternalLink link = new ExternalLink("advancedLink", "http://lucene.apache.org/core/3_6_2/queryparsersyntax.html");
@@ -138,7 +141,16 @@
addPurificationsTable(currentPage, searchResult);
addTestBiosTable(currentPage, searchResult);
addStationsTable(currentPage, searchResult);
- addMoleculesTable(currentPage, searchResult);
+
+ // additionnal transformation for molecule provenances
+ List<Molecule> molecules = searchResult.getMolecules();
+ List<MoleculeProvenanceBean> moleculeProvenances = moleculeService.listMoleculeProvenances(molecules, utilisateur);
+
+ // call static methods in ListXXXPage
+ DataTable<MoleculeProvenanceBean> moleculesDataTable = ListMoleculesPage.initMoleculesListTable(this,
+ "SearchPage.Molecules.Results", currentPage, moleculeProvenances);
+ add(moleculesDataTable);
+ add(new CsvExportLink("SearchPage.Molecules.ExportCSV", moleculesDataTable, "molecules.csv"));
}
/**
@@ -604,66 +616,4 @@
add(stationsDataTable);
add(new CsvExportLink("SearchPage.Stations.ExportCSV", stationsDataTable, "stations.csv"));
}
-
- /**
- * Format molécules result into table.
- *
- * @param currentPage current page
- * @param searchResult search results
- */
- protected void addMoleculesTable(final CallerPage currentPage, SearchResult searchResult) {
-
- // Liste des molecules
- final List<Molecule> molecules = searchResult.getMolecules();
-
- LoadableDetachableSortableListDataProvider<Molecule> moleculesDataProvider = new LoadableDetachableSortableListDataProvider<Molecule>(
- molecules, getSession().getLocale());
-
- List<IColumn<Molecule>> columns = new ArrayList<IColumn<Molecule>>();
-
- columns.add(new LinkableImagePropertyColumn<Molecule>("images/read.png", getString("Read"), getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Molecule>> item, String componentId, IModel<Molecule> model) {
- setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
- }
- });
- columns.add(new LinkPropertyColumn<Molecule>(new Model<String>(getString("Molecule.idMolecule")), "idMolecule", "idMolecule",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Molecule>> item, String componentId, IModel<Molecule> model) {
- setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
- }
- });
- columns.add(new AbstractColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol"))) {
- public void populateItem(Item<ICellPopulator<Molecule>> cellItem, String componentId, IModel<Molecule> rowModel) {
- cellItem.add(new Label(componentId, "-")
- .add(new MoleculeViewBehavior(new PropertyModel<String>(rowModel, "formuleDevMol"))));
- }
- });
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.nomCommun")), "nomCommun",
- "nomCommun"));
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.familleChimique")), "familleChimique",
- "familleChimique"));
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleBrute")), "formuleBrute",
- "formuleBrute"));
- columns.add(new DecimalPropertyColumn<Molecule>(new Model<String>(getString("Molecule.masseMolaire")), "masseMolaire",
- "masseMolaire", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new BooleanPropertyColumn<Molecule>(new Model<String>(getString("Molecule.nouvMolecul")), "nouvMolecul",
- "nouvMolecul", this));
- columns.add(new LinkPropertyColumn<Molecule>(new Model<String>(getString("Molecule.campagne")), "campagne",
- "campagne", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Molecule>> item, String componentId, IModel<Molecule> model) {
- setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), currentPage));
- }
- });
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.identifieePar")), "identifieePar",
- "identifieePar"));
-
- final DataTable<Molecule> moleculesDataTable = new AjaxFallbackDefaultDataTable<Molecule>(
- getResource() + ".Molecules.Results", columns,
- moleculesDataProvider, WebContext.ROWS_PER_PAGE);
- add(moleculesDataTable);
- add(new CsvExportLink("SearchPage.Molecules.ExportCSV", moleculesDataTable, "molecules.csv"));
- }
}
1
0
r107 - in trunk: cantharella.data/src/main/java/nc/ird/cantharella/data/model cantharella.data/src/main/resources/sql cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns cantharella.web/src/main/resources cantharella.web/src/main/webapp/images
by echatellier@users.forge.codelutin.com 14 Feb '13
by echatellier@users.forge.codelutin.com 14 Feb '13
14 Feb '13
Author: echatellier
Date: 2013-02-14 16:01:31 +0100 (Thu, 14 Feb 2013)
New Revision: 107
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/107
Log:
refs #1653: Gestion des donn?\195?\169es binaire des fichiers en bytea;
Added:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn$ButtonPanel.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java
trunk/cantharella.web/src/main/webapp/images/download.png
Modified:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Document.java
trunk/cantharella.data/src/main/resources/sql/dev_update.sql
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ReadDocumentPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java
trunk/cantharella.web/src/main/resources/web_en.properties
trunk/cantharella.web/src/main/resources/web_fr.properties
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Document.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Document.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Document.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -23,7 +23,6 @@
package nc.ird.cantharella.data.model;
-import java.io.InputStream;
import java.util.Date;
import javax.persistence.Basic;
@@ -103,10 +102,9 @@
@Length(max = LENGTH_MEDIUM_TEXT)
private String fileName;
- /* File data.
- @Lob
- @Basic(fetch=FetchType.LAZY, optional=true)
- private byte[] fileContent;*/
+ /** File data. */
+ @Basic(fetch = FetchType.LAZY)
+ private byte[] fileContent;
/** File mime type. */
@NotEmpty
@@ -201,13 +199,13 @@
this.fileName = fileName;
}
- /*public byte[] getFileContent() {
+ public byte[] getFileContent() {
return fileContent;
}
public void setFileContent(byte[] fileContent) {
this.fileContent = fileContent;
- }*/
+ }
public String getFileMimetype() {
return fileMimetype;
Modified: trunk/cantharella.data/src/main/resources/sql/dev_update.sql
===================================================================
--- trunk/cantharella.data/src/main/resources/sql/dev_update.sql 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.data/src/main/resources/sql/dev_update.sql 2013-02-14 15:01:31 UTC (rev 107)
@@ -91,7 +91,7 @@
dateCreation timestamp not null,
description text,
editeur varchar(100) not null,
- fileContent oid,
+ fileContent bytea;,
fileMimetype varchar(60) not null,
fileName varchar(60) not null,
langue varchar(2),
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ManageDocumentPage.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -265,7 +265,7 @@
public void onValidate() {
final FileUpload uploadedFile = fileUploadField.getFileUpload();
if (uploadedFile != null) {
- //documentModel.getObject().setFileContent(uploadedFile.getBytes());
+ documentModel.getObject().setFileContent(uploadedFile.getBytes());
documentModel.getObject().setFileName(uploadedFile.getClientFileName());
documentModel.getObject().setFileMimetype(uploadedFile.getContentType());
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ReadDocumentPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ReadDocumentPage.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/document/ReadDocumentPage.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -120,7 +120,7 @@
@Override
public void onSuccess() {
- successNextPage(ManageLotPage.class, ACTION_DELETE);
+ successNextPage(ManageDocumentPage.class, ACTION_DELETE);
redirect();
}
});
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html 2013-02-14 15:01:31 UTC (rev 107)
@@ -181,7 +181,7 @@
<fieldset>
<legend><wicket:message key="ListDocumentsPage.AttachedDocuments" /></legend>
<div wicket:id="ListDocumentsPage.AttachedDocuments.Refresh">
- <table cellspacing="0" wicket:id="ListDocumentsPage.AttachedDocuments"/>
+ <table class="large" cellspacing="0" wicket:id="ListDocumentsPage.AttachedDocuments"/>
</div>
<a wicket:id="NewDocument" class="add"><wicket:message key="ListDocumentsPage.NewDocument" /></a>
</fieldset>
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -22,6 +22,10 @@
*/
package nc.ird.cantharella.web.pages.domain.molecule;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@@ -47,6 +51,7 @@
import nc.ird.cantharella.web.pages.TemplatePage;
import nc.ird.cantharella.web.pages.domain.campagne.ManageCampagnePage;
import nc.ird.cantharella.web.pages.domain.document.ManageDocumentPage;
+import nc.ird.cantharella.web.pages.domain.document.ReadDocumentPage;
import nc.ird.cantharella.web.pages.domain.extraction.ReadExtractionPage;
import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage;
import nc.ird.cantharella.web.pages.renderers.ProduitRenderer;
@@ -54,6 +59,9 @@
import nc.ird.cantharella.web.utils.behaviors.JSConfirmationBehavior;
import nc.ird.cantharella.web.utils.behaviors.MoleculeEditorBehavior;
import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
+import nc.ird.cantharella.web.utils.columns.AjaxButtonPropertyColumn;
+import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
+import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.forms.AutoCompleteTextFieldString;
import nc.ird.cantharella.web.utils.forms.AutoCompleteTextFieldString.ComparisonMode;
import nc.ird.cantharella.web.utils.forms.SubmittableButton;
@@ -66,6 +74,7 @@
import nc.ird.cantharella.web.utils.security.AuthRoles;
import nc.ird.cantharella.web.utils.security.AuthSession;
+import org.apache.commons.io.IOUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -96,6 +105,7 @@
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -278,21 +288,6 @@
formView.add(new TextField<String>("Molecule.createur", new PropertyModel<String>(moleculeModel, "createur"))
.setEnabled(false));
- // Action : création d'un nouveau document
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewDocument") {
- @Override
- protected void onSubmit(AjaxRequestTarget request, Form<?> form) {
- setResponsePage(new ManageDocumentPage(currentPage, moleculeModel.getObject(), false));
- }
-
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageDocumentPage(currentPage, moleculeModel.getObject(), false));
- }
- }.setVisibilityAllowed(editEnabled));
-
// Action : création du lot
Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
@Override
@@ -606,7 +601,7 @@
* @param documentAttachable entity to get documents
* @param currentPage current page
*/
- private void initAttachedDocumentsTable(final Form<Void> formView, final DocumentAttachable documentAttachable, CallerPage currentPage) {
+ private void initAttachedDocumentsTable(final Form<Void> formView, final DocumentAttachable documentAttachable, final CallerPage currentPage) {
List<Document> documents = documentAttachable.getDocuments();
@@ -617,48 +612,77 @@
formView.add(attachedDocumentRefresh);
SimpleSortableListDataProvider<Document> attachedDocumentsDataProvider =
- new SimpleSortableListDataProvider<Document>(
- documents, getSession().getLocale());
+ new SimpleSortableListDataProvider<Document>(documents, getSession().getLocale());
List<IColumn<Document>> columns = new ArrayList<IColumn<Document>>();
+ columns.add(new LinkPropertyColumn<Document>(
+ new Model<String>(getString("Document.titre")), "titre", "titre") {
+ @Override
+ public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
+ setResponsePage(new ReadDocumentPage(model.getObject(), documentAttachable, currentPage));
+ }
+ });
+
columns.add(new PropertyColumn<Document>(
- new Model<String>(getString("Document.titre")), "titre", "titre"));
-
- columns.add(new PropertyColumn<Document>(
new Model<String>(getString("Document.typeDocument")), "typeDocument.nom", "typeDocument.nom"));
-
+
columns.add(new PropertyColumn<Document>(
new Model<String>(getString("Document.createur")), "createur", "createur"));
-
- columns.add(new PropertyColumn<Document>(
- new Model<String>(getString("Document.fileName")), "fileName", "fileName"));
- columns.add(new AbstractColumn<Document>(new Model<String>(), "idMolecule") {
+ columns.add(new LinkableImagePropertyColumn<Document>(new Model<String>(getString("Document.link")),
+ "images/download.png", getString("Document.link"), getString("Document.link")) {
@Override
- public void populateItem(Item<ICellPopulator<Document>> cellItem, String componentId, final IModel<Document> rowModel) {
- cellItem.add(new AjaxFallbackButton(componentId, new Model<String>(getString("Delete")), formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- documentAttachable.removeDocument(rowModel.getObject());
+ public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
- if (target != null) {
- target.add(attachedDocumentRefresh);
- refreshFeedbackPage(target);
- }
- }
+ Document document = model.getObject();
+ WebResponse response = (WebResponse) getResponse();
+ response.setContentType(document.getFileMimetype());
+ response.setAttachmentHeader(document.getFileName());
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
- });
+ OutputStream out = getResponse().getOutputStream();
+ InputStream in = new ByteArrayInputStream(document.getFileContent());
+ try {
+ IOUtils.copy(in, out);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
});
final DataTable<Document> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document>("ListDocumentsPage.AttachedDocuments", columns,
attachedDocumentsDataProvider, WebContext.ROWS_PER_PAGE);
+
+ columns.add(new AjaxButtonPropertyColumn<Document>(new Model<String>(getString("Actions")),
+ new Model<String>(getString("Delete")), formView) {
+ @Override
+ public void onSubmit(AjaxRequestTarget target, Form<?> form, IModel<Document> model) {
+ Document document = model.getObject();
+ documentAttachable.removeDocument(document);
+
+ if (target != null) {
+ target.add(attachedDocumentTable);
+ refreshFeedbackPage(target);
+ }
+ }
+ });
+
attachedDocumentRefresh.add(attachedDocumentTable);
+
+ // Action : création d'un nouveau document
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewDocument") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget request, Form<?> form) {
+ setResponsePage(new ManageDocumentPage(currentPage, moleculeModel.getObject(), false));
+ }
+
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageDocumentPage(currentPage, moleculeModel.getObject(), false));
+ }
+ }.setVisibilityAllowed(true));
}
/**
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -22,6 +22,10 @@
*/
package nc.ird.cantharella.web.pages.domain.molecule;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
@@ -48,6 +52,7 @@
import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
import nc.ird.cantharella.web.utils.columns.LinkPropertyColumn;
+import nc.ird.cantharella.web.utils.columns.LinkableImagePropertyColumn;
import nc.ird.cantharella.web.utils.forms.SubmittableButton;
import nc.ird.cantharella.web.utils.forms.SubmittableButtonEvents;
import nc.ird.cantharella.web.utils.models.DisplayBooleanPropertyModel;
@@ -61,6 +66,7 @@
import nc.ird.cantharella.web.utils.security.AuthRoles;
import nc.ird.cantharella.web.utils.security.AuthSession;
+import org.apache.commons.io.IOUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
@@ -80,6 +86,7 @@
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.spring.injection.annot.SpringBean;
/**
@@ -312,13 +319,30 @@
columns.add(new PropertyColumn<Document>(
new Model<String>(getString("Document.typeDocument")), "typeDocument.nom", "typeDocument.nom"));
-
+
columns.add(new PropertyColumn<Document>(
new Model<String>(getString("Document.createur")), "createur", "createur"));
-
- columns.add(new PropertyColumn<Document>(
- new Model<String>(getString("Document.fileName")), "fileName", "fileName"));
+ columns.add(new LinkableImagePropertyColumn<Document>(new Model<String>(getString("Document.link")),
+ "images/download.png", getString("Document.link"), getString("Document.link")) {
+ @Override
+ public void onClick(Item<ICellPopulator<Document>> item, String componentId, IModel<Document> model) {
+
+ Document document = model.getObject();
+ WebResponse response = (WebResponse) getResponse();
+ response.setContentType(document.getFileMimetype());
+ response.setAttachmentHeader(document.getFileName());
+
+ OutputStream out = getResponse().getOutputStream();
+ InputStream in = new ByteArrayInputStream(document.getFileContent());
+ try {
+ IOUtils.copy(in, out);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
final DataTable<Document> attachedDocumentTable = new AjaxFallbackDefaultDataTable<Document>("ListDocumentsPage.AttachedDocuments", columns,
attachedDocumentsDataProvider, WebContext.ROWS_PER_PAGE);
add(attachedDocumentTable);
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn$ButtonPanel.html
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn$ButtonPanel.html (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn$ButtonPanel.html 2013-02-14 15:01:31 UTC (rev 107)
@@ -0,0 +1,31 @@
+<!--
+ #%L
+ Cantharella :: Web
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 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 Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<!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"
+ xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
+<body>
+<wicket:panel>
+ <input type="submit" wicket:id="button" />
+</wicket:panel>
+</body>
+</html>
\ No newline at end of file
Added: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -0,0 +1,110 @@
+/*
+ * #%L
+ * Cantharella :: Web
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package nc.ird.cantharella.web.utils.columns;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+/**
+ * Column embeded in a datatable which represent an linkable image
+ * @author Adrien Cheype
+ * @param <T> Generic type
+ */
+abstract public class AjaxButtonPropertyColumn<T> extends AbstractColumn<T> {
+
+ /** Title displayed for the button */
+ private Model<String> buttonLabel;
+
+ /** Form. */
+ private Form<?> form;
+
+ /**
+ * Constructor
+ * @param imageSrc Relative url for the image
+ * @param linkTitle Title displayed for the link
+ * @param altMessage Alternative message displayed when image can't be rendered
+ */
+ public AjaxButtonPropertyColumn(Model<String> buttonLabel, Form<?> form) {
+ this(new Model<String>(), buttonLabel, form);
+ }
+
+ /**
+ * Constructor
+ * @param displayModel header display model
+ * @param imageSrc Relative url for the image
+ * @param linkTitle Title displayed for the link
+ * @param altMessage Alternative message displayed when image can't be rendered
+ */
+ public AjaxButtonPropertyColumn(IModel<String> displayModel, Model<String> buttonLabel, Form<?> form) {
+ super(displayModel);
+ this.buttonLabel = buttonLabel;
+ this.form = form;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
+ ButtonPanel panel = new ButtonPanel(item, componentId, model);
+ item.add(panel);
+ }
+
+ /**
+ * Override this method to react to link clicks. Your own/internal row id will most likely be inside the model.
+ * @param item Item
+ * @param componentId Component id
+ * @param model Model
+ */
+ public abstract void onSubmit(AjaxRequestTarget target, Form<?> form, IModel<T> model);
+
+ /**
+ * Panel which include a linkable image. Used with the LinkableImagePropertyColumn$LinkablePanel.html file
+ */
+ public class ButtonPanel extends Panel {
+
+ /**
+ * Constructor
+ * @param item Item
+ * @param componentId Component id
+ * @param model Model
+ */
+ public ButtonPanel(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> model) {
+ super(componentId);
+
+ AjaxButton button = new AjaxButton("button", buttonLabel, form) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ AjaxButtonPropertyColumn.this.onSubmit(target, form, model);
+ }
+ };
+
+ add(button);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/AjaxButtonPropertyColumn.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java 2013-02-14 15:01:31 UTC (rev 107)
@@ -55,7 +55,18 @@
* @param altMessage Alternative message displayed when image can't be rendered
*/
public LinkableImagePropertyColumn(String imageSrc, String linkTitle, String altMessage) {
- super(new Model<String>());
+ this(new Model<String>(), imageSrc, linkTitle, altMessage);
+ }
+
+ /**
+ * Constructor
+ * @param displayModel header display model
+ * @param imageSrc Relative url for the image
+ * @param linkTitle Title displayed for the link
+ * @param altMessage Alternative message displayed when image can't be rendered
+ */
+ public LinkableImagePropertyColumn(IModel<String> displayModel, String imageSrc, String linkTitle, String altMessage) {
+ super(displayModel);
this.imageSrc = imageSrc;
this.linkTitle = linkTitle;
this.altMessage = altMessage;
Modified: trunk/cantharella.web/src/main/resources/web_en.properties
===================================================================
--- trunk/cantharella.web/src/main/resources/web_en.properties 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/resources/web_en.properties 2013-02-14 15:01:31 UTC (rev 107)
@@ -385,7 +385,7 @@
Molecule.masseMolaire.Required=Molar mass - can’t be null
Molecule.masseMolaire.IConverter.BigDecimal=Molar mass - must be a decimal number
-TestBio.date.IConverter.Date= The date is incorrectly formatted (DD/MM/YY)
+TestBio.date.IConverter.Date=The date is incorrectly formatted (DD/MM/YY)
TestBio.concMasseDefaut.IConverter.BigDecimal=Default Conc./Mass - must be a decimal number
TestBio.resultats.valeur.IConverter.BigDecimal=Value - must be a decimal number
TestBio.resultats.repere.Required=Mark – can’t be null
@@ -408,6 +408,9 @@
TestBio.resultats.noProduit=The bioassay must contain at least a result of type "product"
TestBio.resultsNotAccessibles=Some results are not displayed because you don't have the required rights over their products.
+Document.dateCreation.IConverter.Date=The date is incorrectly formatted (DD/MM/YY)
+Document.link=Link
+
#BASIC#
Actions=Actions
Submit=Submit
Modified: trunk/cantharella.web/src/main/resources/web_fr.properties
===================================================================
--- trunk/cantharella.web/src/main/resources/web_fr.properties 2013-02-14 01:47:03 UTC (rev 106)
+++ trunk/cantharella.web/src/main/resources/web_fr.properties 2013-02-14 15:01:31 UTC (rev 107)
@@ -406,6 +406,9 @@
TestBio.resultats.noProduit=Le test biologique doit comporter au moins un résultat de type "produit"
TestBio.resultsNotAccessibles=Certains résultats ne sont pas affichés car vous n'avez pas les droits nécessaires sur leur produit.
+Document.dateCreation.IConverter.Date=La date est mal formatée (JJ/MM/AA)
+Document.link=Lien
+
#BASIC#
Actions=Actions
Submit=Valider
Added: trunk/cantharella.web/src/main/webapp/images/download.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/images/download.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
1
0