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
January 2013
- 2 participants
- 25 discussions
29 Jan '13
Author: echatellier
Date: 2013-01-29 10:48:04 +0100 (Tue, 29 Jan 2013)
New Revision: 65
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/65
Log:
Use 4 spaces indentation instead of tab convention
Modified:
trunk/cantharella.data/pom.xml
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/AbstractModelDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/GenericDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/CampagneDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ExtractionDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/HibernateTemplateDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PersonneDao.java
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/PurificationDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/SpecimenDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/StationDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/TestBioDao.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/utils/GenericDaoAspect.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/AbstractException.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataConstraintException.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataNotFoundException.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Campagne.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagneGroupeDroits.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneDroits.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneParticipant.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Droits.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ErreurTestBio.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extraction.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extrait.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Fraction.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Groupe.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Lot.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotGroupeDroits.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotPersonneDroits.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeExtraction.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodePurification.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeTestBio.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuri.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuriEffectif.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Partie.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Personne.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Produit.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Purification.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Specimen.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Station.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TestBio.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeDocument.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeExtrait.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Utilisateur.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/CampagnePersonneDroitsComp.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ExtraitsOfExtractionComp.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/FractionsOfPurificationComp.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/LotPersonneDroitsComp.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ResultatsOfTestBioComp.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/AbstractModel.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/CompositeId.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueField.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueFieldValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCode.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCodeValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueField.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueFieldValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Latitude.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientation.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientationValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Longitude.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientation.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientationValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraint.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraintValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Referentiel.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/ReferentielValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidator.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorEventListener.java
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorImpl.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/AbstractDataTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/DataContextTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/GenericDaoTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/SpringTransactionTestAppender.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/TestAppender.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTransactionTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/ModelValidatorTest.java
trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/PersonneTest.java
trunk/cantharella.service/pom.xml
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/exceptions/EmailException.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/CampagneService.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/ExtractionService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/LotService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MailService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PersonneService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ProduitService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PurificationService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/SpecimenService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/StationService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/TestBioService.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/CampagneServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/DocumentServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ExtractionServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/LotServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MailServiceImpl.java
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/PersonneServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ProduitServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PurificationServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SpecimenServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/StationServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/TestBioServiceImpl.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/CampagneNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ConfigNameNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/EmailNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ErreurTestNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ExtractionNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/LotNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeExtractionNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodePurificationNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeTestBioNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MoleculeNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PartieNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PersonneNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PurificationNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/SpecimenNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/StationNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TestBioNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TypeDocumentNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/UniqueFieldNormalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalize.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalizer.java
trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/NormalizerAspect.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/AbstractServiceTest.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/ServiceContextTest.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/exceptions/ExcelImportException.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/services/PersonneServiceTest.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnStructure.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnsReader.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelSheetStructure.java
trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/PopulateDB.java
trunk/cantharella.utils/pom.xml
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/AssertTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanLookup.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CaptchaTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CollectionTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CoordTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenerateCsv.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenericsTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/IntuitiveStringComparator.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/LogTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/NumberTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/Pair.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/PasswordTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTools.java
trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTransformer.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/AssertToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanLookupTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CollectionToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CoordToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/GenericsToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/LogToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/NumberToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PairTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringToolsTest.java
trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringTransformerTest.java
trunk/cantharella.web/pom.xml
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.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/ContactPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/HomePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.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/campagne/ManageCampagnePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ReadCampagnePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ListConfigurationPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageErreurTestBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeExtractionPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodePurificationPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeTestBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManagePartiePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListErreurTestBioPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeExtractionPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodePurificationPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeTestBioPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListPartiePanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/RebuildLuceneIndexPanel.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/extraction/ManageExtractionPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ReadExtractionPage.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/lot/ManageLotPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ReadLotPage.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/personne/ListPersonnesPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ManagePersonnePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ReadPersonnePage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ManagePersonnePanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ReadPersonnePanel.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/purification/ManagePurificationPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ReadPurificationPage.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/specimen/ManageSpecimenPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ReadSpecimenPage.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/station/ManageStationPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ReadStationPage.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/pages/domain/testBio/ManageTestBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ReadTestBioPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ManageUtilisateurPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ReadUtilisateurPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/RegisterPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ResetPasswordPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/UpdateUtilisateurPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/panels/ReadDroitsUtilisateurPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/AccessDeniedPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/ErrorPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/InternalErrorPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/PageExpiredErrorPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/CaptchaModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ContactModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/LoginModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageCampagneModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageStationModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageUtilisateurModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/RegisterModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/UpdateUtilisateurModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/PersonneRenderer.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/ProduitRenderer.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/CallerPage.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/JSConfirmationBehavior.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/ReplaceEmptyLabelBehavior.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/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/converters/BigDecimalConverterImpl.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/DoubleConverterImpl.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/AutoCompleteTextFieldString.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButton.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButtonEvents.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayBooleanPropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayDecimalPropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayEnumPropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayMapValuePropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayPercentPropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayShortDatePropertyModel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/GenericLoadableDetachableModel.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/panels/CollapsiblePanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkProduitPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/SimpleTooltipPanel.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/EnumChoiceRenderer.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/MapChoiceRenderer.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/resources/WebMessages.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthContainer.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRole.java
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRoles.java
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/AuthStrategy.java
trunk/cantharella.web/src/test/java/nc/ird/cantharella/web/AbstractWebTest.java
trunk/pom.xml
Modified: trunk/cantharella.data/pom.xml
===================================================================
--- trunk/cantharella.data/pom.xml 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/pom.xml 2013-01-29 09:48:04 UTC (rev 65)
@@ -1,219 +1,214 @@
<?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>
- <resources>
- <!-- Default resources for the data layer -->
- <resource>
- <directory>src/main/resources/commons</directory>
- </resource>
- </resources>
- <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>
+ <build>
+ <resources>
+ <!-- Default resources for the data layer -->
+ <resource>
+ <directory>src/main/resources/commons</directory>
+ </resource>
+ </resources>
+ <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>
- <profiles>
- <profile>
- <id>development</id>
- <build>
- <resources>
- <!-- Development resources for the data layer -->
- <resource>
- <directory>src/main/resources/development</directory>
- </resource>
- </resources>
- </build>
- </profile>
- <profile>
- <id>integration</id>
- <build>
- <resources>
- <!-- Integration resources for the data layer -->
- <resource>
- <directory>src/main/resources/integration</directory>
- </resource>
- </resources>
- </build>
- </profile>
- <profile>
- <id>production</id>
- <build>
- <resources>
- <!-- Production resources for the data layer -->
- <resource>
- <directory>src/main/resources/production</directory>
- </resource>
- </resources>
- </build>
- </profile>
- </profiles>
+ <profiles>
+ <profile>
+ <id>development</id>
+ <build>
+ <resources>
+ <!-- Development resources for the data layer -->
+ <resource>
+ <directory>src/main/resources/development</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ <profile>
+ <id>integration</id>
+ <build>
+ <resources>
+ <!-- Integration resources for the data layer -->
+ <resource>
+ <directory>src/main/resources/integration</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ <profile>
+ <id>production</id>
+ <build>
+ <resources>
+ <!-- Production resources for the data layer -->
+ <resource>
+ <directory>src/main/resources/production</directory>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ </profiles>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>cantharella.utils</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cantharella.utils</artifactId>
+ <version>${project.version}</version>
+ </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>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </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>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</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</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>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ </dependency>
- <dependency>
- <groupId>c3p0</groupId>
- <artifactId>c3p0</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ </dependency>
- <!-- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency> -->
+ <dependency>
+ <groupId>c3p0</groupId>
+ <artifactId>c3p0</artifactId>
+ </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -80,242 +80,242 @@
@Configuration
public abstract class DataContext {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Country codes */
- public static final List<String> COUNTRY_CODES = Collections.unmodifiableList(Arrays.asList(Locale
- .getISOCountries()));
+ /** Country codes */
+ public static final List<String> COUNTRY_CODES = Collections.unmodifiableList(Arrays.asList(Locale
+ .getISOCountries()));
- /** DB connection: acquire retry attemps */
- private static final int DB_CONNECTION_ACQUIRE_RETRY_ATTEMPS = 30;
+ /** DB connection: acquire retry attemps */
+ private static final int DB_CONNECTION_ACQUIRE_RETRY_ATTEMPS = 30;
- /** DB connexion: acquire retry delay */
- private static final int DB_CONNECTION_ACQUIRE_RETRY_DELAY = 1000;
+ /** DB connexion: acquire retry delay */
+ private static final int DB_CONNECTION_ACQUIRE_RETRY_DELAY = 1000;
- /** DB pool: acquire increment */
- private static final int DB_POOL_ACQUIRE_INCREMENT = 3;
+ /** DB pool: acquire increment */
+ private static final int DB_POOL_ACQUIRE_INCREMENT = 3;
- /** DB pool: max size */
- private static final int DB_POOL_MAX_SIZE = 15;
+ /** DB pool: max size */
+ private static final int DB_POOL_MAX_SIZE = 15;
- /** DB pool: min size */
- private static final int DB_POOL_MIN_SIZE = 3;
+ /** DB pool: min size */
+ private static final int DB_POOL_MIN_SIZE = 3;
- /** Encoding */
- public static final String ENCODING = Charset.forName("UTF-8").name();
+ /** Encoding */
+ public static final String ENCODING = Charset.forName("UTF-8").name();
- /** Availables locales for the application */
- public static final List<Locale> LOCALES;
+ /** Availables locales for the application */
+ public static final List<Locale> LOCALES;
- /** Precision is the total number of digits */
- public static final int DECIMAL_PRECISION = 9;
+ /** 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;
+ /**
+ * 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;
+ /**
+ * 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 */
- public static final Map<Integer, String> REFERENTIELS;
+ /** Référentiels */
+ public static final Map<Integer, String> REFERENTIELS;
- /** DB debug */
- @Value("${db.debug}")
- protected boolean dbDebugProperty;
+ /** DB debug */
+ @Value("${db.debug}")
+ protected boolean dbDebugProperty;
- /** DB password */
- @Value("${db.password}")
- protected String dbPasswordProperty;
+ /** DB password */
+ @Value("${db.password}")
+ protected String dbPasswordProperty;
- /** DB URL */
- @Value("${db.url}")
- protected String dbUrlProperty;
+ /** DB URL */
+ @Value("${db.url}")
+ protected String dbUrlProperty;
- /** DB user */
- @Value("${db.user}")
- protected String dbUserProperty;
+ /** DB user */
+ @Value("${db.user}")
+ protected String dbUserProperty;
- /** DB user */
+ /** DB user */
@Value("${db.hbm2ddl:validate}")
- protected String hbm2ddl;
+ 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));
+ 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));
- Map<Integer, String> referentiels = new HashMap<Integer, String>();
- referentiels.put(4326, "WGS84");
- REFERENTIELS = Collections.unmodifiableMap(referentiels);
- }
+ Map<Integer, String> referentiels = new HashMap<Integer, String>();
+ referentiels.put(4326, "WGS84");
+ REFERENTIELS = Collections.unmodifiableMap(referentiels);
+ }
- /**
- * @return Internationalization messages for data layer
- */
- @Bean
- public MessageSourceAccessor dataMessageSource() {
- // The ResourceBundleMessageSource does not handle UTF-8, so we use the Reloadable one
- ReloadableResourceBundleMessageSource dataMessageSource = new ReloadableResourceBundleMessageSource();
- dataMessageSource.setBasename("data");
- dataMessageSource.setDefaultEncoding(ENCODING);
- dataMessageSource.setCacheSeconds(-1);
- return new MessageSourceAccessor(dataMessageSource);
- }
+ /**
+ * @return Internationalization messages for data layer
+ */
+ @Bean
+ public MessageSourceAccessor dataMessageSource() {
+ // The ResourceBundleMessageSource does not handle UTF-8, so we use the Reloadable one
+ ReloadableResourceBundleMessageSource dataMessageSource = new ReloadableResourceBundleMessageSource();
+ dataMessageSource.setBasename("data");
+ dataMessageSource.setDefaultEncoding(ENCODING);
+ dataMessageSource.setCacheSeconds(-1);
+ return new MessageSourceAccessor(dataMessageSource);
+ }
- /**
- * @return Data source (for DB connection)
- */
- @Bean
- public DataSource dataSource() {
- ComboPooledDataSource dataSource = new ComboPooledDataSource();
- // Connexion
- try {
- dataSource.setDriverClass(Driver.class.getName());
- } catch (PropertyVetoException e) {
- LOG.fatal(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- dataSource.setJdbcUrl(dbUrlProperty);
- dataSource.setPassword(dbPasswordProperty);
- dataSource.setUser(dbUserProperty);
- // Pool: basic configuration
- dataSource.setInitialPoolSize(DB_POOL_MIN_SIZE);
- // Pool: size and connection age
- dataSource.setMaxConnectionAge(0);
- dataSource.setMaxIdleTimeExcessConnections(0);
- // Pool: connection testing
- dataSource.setAutomaticTestTable(null);
- try {
- dataSource.setConnectionTesterClassName(DefaultConnectionTester.class.getName());
- } catch (PropertyVetoException e) {
- LOG.fatal(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- dataSource.setPreferredTestQuery(null);
- dataSource.setTestConnectionOnCheckin(false);
- dataSource.setTestConnectionOnCheckout(false);
- // Pool: statement pooling
- dataSource.setMaxStatementsPerConnection(0);
- // Pool: recovery from database outages
- dataSource.setAcquireRetryAttempts(DB_CONNECTION_ACQUIRE_RETRY_ATTEMPS);
- dataSource.setAcquireRetryDelay(DB_CONNECTION_ACQUIRE_RETRY_DELAY);
- dataSource.setBreakAfterAcquireFailure(false);
- // Pool: connection lifecycles with connection customizer
- dataSource.setConnectionCustomizerClassName(null);
- // Pool: unresolved transaction handling
- dataSource.setAutoCommitOnClose(false);
- dataSource.setForceIgnoreUnresolvedTransactions(false);
- // Pool: debug and workaround broken client applications
- dataSource.setDebugUnreturnedConnectionStackTraces(false);
- dataSource.setUnreturnedConnectionTimeout(0);
- // Pool: dataSource
- dataSource.setCheckoutTimeout(0);
- dataSource.setFactoryClassLocation(null);
- dataSource.setMaxAdministrativeTaskTime(0);
- dataSource.setUsesTraditionalReflectiveProxies(false);
- return dataSource;
- }
+ /**
+ * @return Data source (for DB connection)
+ */
+ @Bean
+ public DataSource dataSource() {
+ ComboPooledDataSource dataSource = new ComboPooledDataSource();
+ // Connexion
+ try {
+ dataSource.setDriverClass(Driver.class.getName());
+ } catch (PropertyVetoException e) {
+ LOG.fatal(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ dataSource.setJdbcUrl(dbUrlProperty);
+ dataSource.setPassword(dbPasswordProperty);
+ dataSource.setUser(dbUserProperty);
+ // Pool: basic configuration
+ dataSource.setInitialPoolSize(DB_POOL_MIN_SIZE);
+ // Pool: size and connection age
+ dataSource.setMaxConnectionAge(0);
+ dataSource.setMaxIdleTimeExcessConnections(0);
+ // Pool: connection testing
+ dataSource.setAutomaticTestTable(null);
+ try {
+ dataSource.setConnectionTesterClassName(DefaultConnectionTester.class.getName());
+ } catch (PropertyVetoException e) {
+ LOG.fatal(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ dataSource.setPreferredTestQuery(null);
+ dataSource.setTestConnectionOnCheckin(false);
+ dataSource.setTestConnectionOnCheckout(false);
+ // Pool: statement pooling
+ dataSource.setMaxStatementsPerConnection(0);
+ // Pool: recovery from database outages
+ dataSource.setAcquireRetryAttempts(DB_CONNECTION_ACQUIRE_RETRY_ATTEMPS);
+ dataSource.setAcquireRetryDelay(DB_CONNECTION_ACQUIRE_RETRY_DELAY);
+ dataSource.setBreakAfterAcquireFailure(false);
+ // Pool: connection lifecycles with connection customizer
+ dataSource.setConnectionCustomizerClassName(null);
+ // Pool: unresolved transaction handling
+ dataSource.setAutoCommitOnClose(false);
+ dataSource.setForceIgnoreUnresolvedTransactions(false);
+ // Pool: debug and workaround broken client applications
+ dataSource.setDebugUnreturnedConnectionStackTraces(false);
+ dataSource.setUnreturnedConnectionTimeout(0);
+ // Pool: dataSource
+ dataSource.setCheckoutTimeout(0);
+ dataSource.setFactoryClassLocation(null);
+ dataSource.setMaxAdministrativeTaskTime(0);
+ dataSource.setUsesTraditionalReflectiveProxies(false);
+ return dataSource;
+ }
- /**
- * @return Session factory (for DB connections)
- */
- @Bean
- public SessionFactory sessionFactory() {
- LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean();
- sessionFactoryBean.setDataSource(dataSource());
- sessionFactoryBean.setPackagesToScan(new String[] { "nc.ird.cantharella.data.model" });
- Properties hibernateProperties = new Properties();
- // Hibernate: basic
- hibernateProperties.setProperty(Environment.DIALECT, PostgreSQL82Dialect.class.getName());
- //System.setProperty(Environment.BYTECODE_PROVIDER, "cglib");
- hibernateProperties.setProperty(Environment.HBM2DDL_AUTO, hbm2ddl);
- // hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "create-drop");
- hibernateProperties.setProperty("hibernate.generate_statistics", String.valueOf(dbDebugProperty));
- hibernateProperties.setProperty("hibernate.cache.use_structured_entries", String.valueOf(dbDebugProperty));
- hibernateProperties.setProperty("hibernate.show_sql", String.valueOf(false));
- hibernateProperties.setProperty("hibernate.format_sql", String.valueOf(false));
- hibernateProperties.setProperty("hibernate.use_sql_comments", String.valueOf(dbDebugProperty));
- // Hibernate: cache
- hibernateProperties.setProperty("hibernate.cache.region.factory_class", SingletonEhCacheRegionFactory.class.getName());
- hibernateProperties.setProperty("hibernate.cache.use_query_cache", String.valueOf(true));
- hibernateProperties.setProperty("hibernate.cache.use_second_level_cache", String.valueOf(true));
- hibernateProperties.setProperty("hibernate.cache.use_structured_entries", String.valueOf(dbDebugProperty));
- // Hibernate: connection
- hibernateProperties.setProperty("hibernate.connection.autocommit", String.valueOf(false));
- hibernateProperties.setProperty("hibernate.connection.release_mode", "on_close");
- // Pool: c3p0 properties overrided by Hibernate
- // echatellier 20121129 : désactivé car la datasource est construite
- // à partir de c3p0, il ne faut donc pas que hibernate la gère
- // sur c3p0 en plus
- //hibernateProperties.setProperty(Environment.CONNECTION_PROVIDER, "org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider");
- //hibernateProperties.setProperty("hibernate.c3p0.acquire_increment", String.valueOf(DB_POOL_ACQUIRE_INCREMENT)); // acquireIncrement
- //hibernateProperties.setProperty("hibernate.c3p0.idle_test_period", String.valueOf(0)); // idleConnectionTestPeriod
- //hibernateProperties.setProperty("hibernate.c3p0.timeout", String.valueOf(0)); // maxIdleTime
- //hibernateProperties.setProperty("hibernate.c3p0.max_size", String.valueOf(DB_POOL_MAX_SIZE)); // maxPoolSize
- //hibernateProperties.setProperty("hibernate.c3p0.max_statements", String.valueOf(0)); // maxStatements
- //hibernateProperties.setProperty("hibernate.c3p0.min_size", String.valueOf(DB_POOL_MIN_SIZE)); // minPoolSize
- // Hibernate search
- hibernateProperties.setProperty("hibernate.search.default.directory_provider", "filesystem");
- hibernateProperties.setProperty("hibernate.search.default.indexBase", "/tmp/cantharella/hs");
- hibernateProperties.setProperty("hibernate.search.analyzer", "org.apache.lucene.analysis.fr.FrenchAnalyzer");
+ /**
+ * @return Session factory (for DB connections)
+ */
+ @Bean
+ public SessionFactory sessionFactory() {
+ LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource());
+ sessionFactoryBean.setPackagesToScan(new String[] { "nc.ird.cantharella.data.model" });
+ Properties hibernateProperties = new Properties();
+ // Hibernate: basic
+ hibernateProperties.setProperty(Environment.DIALECT, PostgreSQL82Dialect.class.getName());
+ //System.setProperty(Environment.BYTECODE_PROVIDER, "cglib");
+ hibernateProperties.setProperty(Environment.HBM2DDL_AUTO, hbm2ddl);
+ // hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "create-drop");
+ hibernateProperties.setProperty("hibernate.generate_statistics", String.valueOf(dbDebugProperty));
+ hibernateProperties.setProperty("hibernate.cache.use_structured_entries", String.valueOf(dbDebugProperty));
+ hibernateProperties.setProperty("hibernate.show_sql", String.valueOf(false));
+ hibernateProperties.setProperty("hibernate.format_sql", String.valueOf(false));
+ hibernateProperties.setProperty("hibernate.use_sql_comments", String.valueOf(dbDebugProperty));
+ // Hibernate: cache
+ hibernateProperties.setProperty("hibernate.cache.region.factory_class", SingletonEhCacheRegionFactory.class.getName());
+ hibernateProperties.setProperty("hibernate.cache.use_query_cache", String.valueOf(true));
+ hibernateProperties.setProperty("hibernate.cache.use_second_level_cache", String.valueOf(true));
+ hibernateProperties.setProperty("hibernate.cache.use_structured_entries", String.valueOf(dbDebugProperty));
+ // Hibernate: connection
+ hibernateProperties.setProperty("hibernate.connection.autocommit", String.valueOf(false));
+ hibernateProperties.setProperty("hibernate.connection.release_mode", "on_close");
+ // Pool: c3p0 properties overrided by Hibernate
+ // echatellier 20121129 : désactivé car la datasource est construite
+ // à partir de c3p0, il ne faut donc pas que hibernate la gère
+ // sur c3p0 en plus
+ //hibernateProperties.setProperty(Environment.CONNECTION_PROVIDER, "org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider");
+ //hibernateProperties.setProperty("hibernate.c3p0.acquire_increment", String.valueOf(DB_POOL_ACQUIRE_INCREMENT)); // acquireIncrement
+ //hibernateProperties.setProperty("hibernate.c3p0.idle_test_period", String.valueOf(0)); // idleConnectionTestPeriod
+ //hibernateProperties.setProperty("hibernate.c3p0.timeout", String.valueOf(0)); // maxIdleTime
+ //hibernateProperties.setProperty("hibernate.c3p0.max_size", String.valueOf(DB_POOL_MAX_SIZE)); // maxPoolSize
+ //hibernateProperties.setProperty("hibernate.c3p0.max_statements", String.valueOf(0)); // maxStatements
+ //hibernateProperties.setProperty("hibernate.c3p0.min_size", String.valueOf(DB_POOL_MIN_SIZE)); // minPoolSize
+ // Hibernate search
+ hibernateProperties.setProperty("hibernate.search.default.directory_provider", "filesystem");
+ hibernateProperties.setProperty("hibernate.search.default.indexBase", "/tmp/cantharella/hs");
+ hibernateProperties.setProperty("hibernate.search.analyzer", "org.apache.lucene.analysis.fr.FrenchAnalyzer");
- // Hibernate: Session
- //hibernateProperties.setProperty("hibernate.current_session_context_class", "thread");
- //hibernateProperties.setProperty(Environment.JTA_PLATFORM, "hibernate.transaction.factory_class", SpringTransactionFactory.class.getName());
- // TODO batch_size à ajuster
- hibernateProperties.setProperty("hibernate.default_batch_fetch_size", String.valueOf(20));
+ // Hibernate: Session
+ //hibernateProperties.setProperty("hibernate.current_session_context_class", "thread");
+ //hibernateProperties.setProperty(Environment.JTA_PLATFORM, "hibernate.transaction.factory_class", SpringTransactionFactory.class.getName());
+ // TODO batch_size à ajuster
+ hibernateProperties.setProperty("hibernate.default_batch_fetch_size", String.valueOf(20));
- sessionFactoryBean.setHibernateProperties(hibernateProperties);
+ sessionFactoryBean.setHibernateProperties(hibernateProperties);
- //Map<String, Object> eventListeners = new HashMap<String, Object>();
- //ModelValidatorEventListener validationListener = new ModelValidatorEventListener(validatorFactory());
- //eventListeners.put("pre-insert", validationListener);
- //eventListeners.put("pre-update", validationListener);
- //sessionFactoryBean.setEventListeners(eventListeners);
+ //Map<String, Object> eventListeners = new HashMap<String, Object>();
+ //ModelValidatorEventListener validationListener = new ModelValidatorEventListener(validatorFactory());
+ //eventListeners.put("pre-insert", validationListener);
+ //eventListeners.put("pre-update", validationListener);
+ //sessionFactoryBean.setEventListeners(eventListeners);
- try {
- sessionFactoryBean.afterPropertiesSet();
- } catch (Exception e) {
- throw new RuntimeException("SessionFactory misconfiguration", e);
- }
- return sessionFactoryBean.getObject();
- }
+ try {
+ sessionFactoryBean.afterPropertiesSet();
+ } catch (Exception e) {
+ throw new RuntimeException("SessionFactory misconfiguration", e);
+ }
+ return sessionFactoryBean.getObject();
+ }
- /**
- * @return Transaction manager (for DB)
- */
- @Bean
- public HibernateTransactionManager transactionManager() {
- return new HibernateTransactionManager(sessionFactory());
- }
+ /**
+ * @return Transaction manager (for DB)
+ */
+ @Bean
+ public HibernateTransactionManager transactionManager() {
+ return new HibernateTransactionManager(sessionFactory());
+ }
- /**
- * @return Validator factory
- */
- @Bean
- public ValidatorFactory validatorFactory() {
- // LocalValidatorFactoryBean validatorFactory = new LocalValidatorFactoryBean();
- // return validatorFactory;
- return Validation.buildDefaultValidatorFactory();
- }
+ /**
+ * @return Validator factory
+ */
+ @Bean
+ public ValidatorFactory validatorFactory() {
+ // LocalValidatorFactoryBean validatorFactory = new LocalValidatorFactoryBean();
+ // return validatorFactory;
+ return Validation.buildDefaultValidatorFactory();
+ }
- /**
- * @return A Validator for models of the data layer
- */
- @Bean
- public ModelValidator dataModelValidator() {
- return new ModelValidatorImpl(validatorFactory(), dataMessageSource());
- }
+ /**
+ * @return A Validator for models of the data layer
+ */
+ @Bean
+ public ModelValidator dataModelValidator() {
+ return new ModelValidatorImpl(validatorFactory(), dataMessageSource());
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/AbstractModelDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/AbstractModelDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/AbstractModelDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -27,5 +27,5 @@
* @author Adrien Cheype
*/
public abstract class AbstractModelDao {
- //
+ //
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/GenericDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/GenericDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/GenericDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,255 +39,255 @@
*/
public interface GenericDao {
- /**
- * Count the number of rows
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @return Number of rows
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> long count(Class<M> modelClass);
+ /**
+ * Count the number of rows
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @return Number of rows
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> long count(Class<M> modelClass);
- /**
- * Count the number of result given by the search criteria. The criteria must contain the count projection.
- * @param criteria The criteria
- * @return The number
- */
- @Transactional(readOnly = true)
- long count(DetachedCriteria criteria);
+ /**
+ * Count the number of result given by the search criteria. The criteria must contain the count projection.
+ * @param criteria The criteria
+ * @return The number
+ */
+ @Transactional(readOnly = true)
+ long count(DetachedCriteria criteria);
- /**
- * Count the number of result given by the hql search. The hql query must contain the count operator.
- * @param hqlQuery The HQL query string
- * @param parameters Parameters (in replacement of ?)
- * @return The number
- */
- @Transactional(readOnly = true)
- long count(String hqlQuery, Object... parameters);
+ /**
+ * Count the number of result given by the hql search. The hql query must contain the count operator.
+ * @param hqlQuery The HQL query string
+ * @param parameters Parameters (in replacement of ?)
+ * @return The number
+ */
+ @Transactional(readOnly = true)
+ long count(String hqlQuery, Object... parameters);
- /**
- * Create a model
- * @param <M> Model type
- * @param model Model (not null)
- * @throws DataConstraintException When there is a problem of data integrity
- */
- @Transactional
- <M extends AbstractModel> void create(M model) throws DataConstraintException;
+ /**
+ * Create a model
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @throws DataConstraintException When there is a problem of data integrity
+ */
+ @Transactional
+ <M extends AbstractModel> void create(M model) throws DataConstraintException;
- /**
- * Create or update a model
- * @param <M> Model type
- * @param model Model (not null)
- * @throws DataConstraintException When there is a problem of data integrity
- */
- @Transactional
- <M extends AbstractModel> void createOrUpdate(M model) throws DataConstraintException;
+ /**
+ * Create or update a model
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @throws DataConstraintException When there is a problem of data integrity
+ */
+ @Transactional
+ <M extends AbstractModel> void createOrUpdate(M model) throws DataConstraintException;
- /**
- * Merge a model. Usefull when several detached objects are loaded (createOrUpdate throws NonUniqueObjectException
- * in this case).
- * @param <M> Model type
- * @param model Model (not null)
- * @throws DataConstraintException When there is a problem of data integrity
- */
- // @Transactional
- // public <M extends AbstractModel> void merge(M model) throws DataConstraintException;
- /**
- * Delete a model
- * @param <M> model type
- * @param modelClass Model class (not null)
- * @param id Model ID (not null)
- * @throws DataNotFoundException Model not found
- * @throws DataConstraintException Model linked to other objects
- */
- @Transactional
- <M extends AbstractModel> void delete(Class<M> modelClass, Serializable id) throws DataConstraintException,
- DataNotFoundException;
+ /**
+ * Merge a model. Usefull when several detached objects are loaded (createOrUpdate throws NonUniqueObjectException
+ * in this case).
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @throws DataConstraintException When there is a problem of data integrity
+ */
+ // @Transactional
+ // public <M extends AbstractModel> void merge(M model) throws DataConstraintException;
+ /**
+ * Delete a model
+ * @param <M> model type
+ * @param modelClass Model class (not null)
+ * @param id Model ID (not null)
+ * @throws DataNotFoundException Model not found
+ * @throws DataConstraintException Model linked to other objects
+ */
+ @Transactional
+ <M extends AbstractModel> void delete(Class<M> modelClass, Serializable id) throws DataConstraintException,
+ DataNotFoundException;
- /**
- * Delete a model
- * @param <M> Model type
- * @param model Model (not null)
- * @throws DataNotFoundException Model not found
- * @throws DataConstraintException Model linked to other objects
- */
- @Transactional
- <M extends AbstractModel> void delete(M model) throws DataNotFoundException, DataConstraintException;
+ /**
+ * Delete a model
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @throws DataNotFoundException Model not found
+ * @throws DataConstraintException Model linked to other objects
+ */
+ @Transactional
+ <M extends AbstractModel> void delete(M model) throws DataNotFoundException, DataConstraintException;
- /**
- * List entities given by the search criteria
- * @param criteria The criteria
- * @return List of results
- */
- @Transactional(readOnly = true)
- List<?> list(DetachedCriteria criteria);
+ /**
+ * List entities given by the search criteria
+ * @param criteria The criteria
+ * @return List of results
+ */
+ @Transactional(readOnly = true)
+ List<?> list(DetachedCriteria criteria);
- /**
- * List entities given by the hql query
- * @param hqlQuery The HQL query string
- * @param parameters Parameters (in replacement of ?)
- * @return List of results
- */
- @Transactional(readOnly = true)
- List<?> list(String hqlQuery, Object... parameters);
+ /**
+ * List entities given by the hql query
+ * @param hqlQuery The HQL query string
+ * @param parameters Parameters (in replacement of ?)
+ * @return List of results
+ */
+ @Transactional(readOnly = true)
+ List<?> list(String hqlQuery, Object... parameters);
- /**
- * Execute SQL query. This method is not recommanded because it shortcuts the Hibernate process. Do not use it if it
- * is not really necessary.
- * @param sqlQuery SQL query
- * @param parameters Parameters (in replacement of ?)
- * @return Number of rows affected
- * @throws DataConstraintException In case of data integrity exceptions
- */
- @Transactional
- int execute(String sqlQuery, Object... parameters) throws DataConstraintException;
+ /**
+ * Execute SQL query. This method is not recommanded because it shortcuts the Hibernate process. Do not use it if it
+ * is not really necessary.
+ * @param sqlQuery SQL query
+ * @param parameters Parameters (in replacement of ?)
+ * @return Number of rows affected
+ * @throws DataConstraintException In case of data integrity exceptions
+ */
+ @Transactional
+ int execute(String sqlQuery, Object... parameters) throws DataConstraintException;
- /**
- * Test model existence
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @param id ID (not null)
- * @return Existence
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> boolean exists(Class<M> modelClass, Serializable id);
+ /**
+ * Test model existence
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @param id ID (not null)
+ * @return Existence
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> boolean exists(Class<M> modelClass, Serializable id);
- /**
- * Test model existence
- * @param <M> Model type
- * @param modelClass Model class
- * @param property Property name
- * @param value Property value
- * @return Existence
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> boolean exists(Class<M> modelClass, String property, Serializable value);
+ /**
+ * Test model existence
+ * @param <M> Model type
+ * @param modelClass Model class
+ * @param property Property name
+ * @param value Property value
+ * @return Existence
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> boolean exists(Class<M> modelClass, String property, Serializable value);
- /**
- * Test existence of a criteria
- * @param criteria The criteria
- * @return True if exists, otherwise false
- */
- @Transactional(readOnly = true)
- boolean exists(DetachedCriteria criteria);
+ /**
+ * Test existence of a criteria
+ * @param criteria The criteria
+ * @return True if exists, otherwise false
+ */
+ @Transactional(readOnly = true)
+ boolean exists(DetachedCriteria criteria);
- /**
- * Read models
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @return Models
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> List<M> readList(Class<M> modelClass);
+ /**
+ * Read models
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @return Models
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> List<M> readList(Class<M> modelClass);
- /**
- * Read models
- * @param <M> Model type
- * @param sortColumn column name for the models sort
- * @param modelClass Model class (not null)
- * @return Models
- */
- // @Transactional(readOnly = true)
- // <M extends AbstractModel> List<M> readList(Class<M> modelClass, String sortColumn);
- /**
- * Read models
- * @param <M> Model type
- * @param sortColumns column names for the models sort (with the order)
- * @param modelClass Model class (not null)
- * @return Models
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> List<M> readList(Class<M> modelClass, String... sortColumns);
+ /**
+ * Read models
+ * @param <M> Model type
+ * @param sortColumn column name for the models sort
+ * @param modelClass Model class (not null)
+ * @return Models
+ */
+ // @Transactional(readOnly = true)
+ // <M extends AbstractModel> List<M> readList(Class<M> modelClass, String sortColumn);
+ /**
+ * Read models
+ * @param <M> Model type
+ * @param sortColumns column names for the models sort (with the order)
+ * @param modelClass Model class (not null)
+ * @return Models
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> List<M> readList(Class<M> modelClass, String... sortColumns);
- /**
- * Read models according to the order of @Id or @EmbeddedId column
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @param firstResult First result (not negative)
- * @param maxResults Max results (not negative)
- * @param sortColumns column names for the models sort (with the order)
- * @return Models
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults,
- String... sortColumns);
+ /**
+ * Read models according to the order of @Id or @EmbeddedId column
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @param firstResult First result (not negative)
+ * @param maxResults Max results (not negative)
+ * @param sortColumns column names for the models sort (with the order)
+ * @return Models
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults,
+ String... sortColumns);
- /**
- * Read models according to the order of @Id or @EmbeddedId column
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @param firstResult First result (not negative)
- * @param maxResults Max results (not negative)
- * @return Models
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults);
+ /**
+ * Read models according to the order of @Id or @EmbeddedId column
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @param firstResult First result (not negative)
+ * @param maxResults Max results (not negative)
+ * @return Models
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults);
- /**
- * Read a model
- * @param <M> Model type
- * @param modelClass Model class (not null)
- * @param id Model ID (not null)
- * @return Model (null if not found)
- * @throws DataNotFoundException Model not found
- */
- // if Transactional(readOnly = true) -> Bug ...
- // so nothing until this bug is fixed
- <M extends AbstractModel> M read(Class<M> modelClass, Serializable id) throws DataNotFoundException;
+ /**
+ * Read a model
+ * @param <M> Model type
+ * @param modelClass Model class (not null)
+ * @param id Model ID (not null)
+ * @return Model (null if not found)
+ * @throws DataNotFoundException Model not found
+ */
+ // if Transactional(readOnly = true) -> Bug ...
+ // so nothing until this bug is fixed
+ <M extends AbstractModel> M read(Class<M> modelClass, Serializable id) throws DataNotFoundException;
- /**
- * Read and fetch a model
- * @param <M> Model class
- * @param modelClass Model class
- * @param uniqueProperty Unique property name
- * @param value Unique property value
- * @return Model
- * @throws DataNotFoundException Model not found
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> M read(Class<M> modelClass, String uniqueProperty, Serializable value)
- throws DataNotFoundException;
+ /**
+ * Read and fetch a model
+ * @param <M> Model class
+ * @param modelClass Model class
+ * @param uniqueProperty Unique property name
+ * @param value Unique property value
+ * @return Model
+ * @throws DataNotFoundException Model not found
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> M read(Class<M> modelClass, String uniqueProperty, Serializable value)
+ throws DataNotFoundException;
- /**
- * Refresh a model object
- * @param <M> Model type
- * @param model Model object
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> void refresh(M model);
+ /**
+ * Refresh a model object
+ * @param <M> Model type
+ * @param model Model object
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> void refresh(M model);
- /**
- * Update a model
- * @param <M> Model type
- * @param model Model (not null)
- * @throws DataNotFoundException Model not found
- * @throws DataConstraintException Model already exists
- */
- @Transactional
- <M extends AbstractModel> void update(M model) throws DataNotFoundException, DataConstraintException;
+ /**
+ * Update a model
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @throws DataNotFoundException Model not found
+ * @throws DataConstraintException Model already exists
+ */
+ @Transactional
+ <M extends AbstractModel> void update(M model) throws DataNotFoundException, DataConstraintException;
- /**
- * Evict a model. Remove from the hibernate session.
- * @param <M> Model type
- * @param model Model (not null)
- */
- @Transactional
- <M extends AbstractModel> void evict(M model);
+ /**
+ * Evict a model. Remove from the hibernate session.
+ * @param <M> Model type
+ * @param model Model (not null)
+ */
+ @Transactional
+ <M extends AbstractModel> void evict(M model);
- /**
- * Check if the given model is in the hibernate session.
- * @param <M> Model type
- * @param model Model (not null)
- * @return If the given model is in the hibernate session
- */
- @Transactional(readOnly = true)
- <M extends AbstractModel> boolean contains(M model);
+ /**
+ * Check if the given model is in the hibernate session.
+ * @param <M> Model type
+ * @param model Model (not null)
+ * @return If the given model is in the hibernate session
+ */
+ @Transactional(readOnly = true)
+ <M extends AbstractModel> boolean contains(M model);
- /**
- * Merge a model from the hibernate session.
- * @param <M> Model type
- * @param model Model (not null)
- */
- @Transactional
- <M extends AbstractModel> void merge(M model);
+ /**
+ * Merge a model from the hibernate session.
+ * @param <M> Model type
+ * @param model Model (not null)
+ */
+ @Transactional
+ <M extends AbstractModel> void merge(M model);
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/CampagneDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/CampagneDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/CampagneDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,15 +36,15 @@
*/
public final class CampagneDao extends AbstractModelDao {
- /** Criteria : différents programmes des campagnes déjà saisis */
- public static final DetachedCriteria CRITERIA_DISTINCT_CAMPAGNE_PROGRAMMES = DetachedCriteria
- .forClass(Campagne.class).setProjection(Projections.distinct(Projections.property("programme")))
- .addOrder(Order.asc("programme"));
+ /** Criteria : différents programmes des campagnes déjà saisis */
+ public static final DetachedCriteria CRITERIA_DISTINCT_CAMPAGNE_PROGRAMMES = DetachedCriteria
+ .forClass(Campagne.class).setProjection(Projections.distinct(Projections.property("programme")))
+ .addOrder(Order.asc("programme"));
- /**
- * Constructor (prevents from instantiation)
- */
- private CampagneDao() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private CampagneDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ExtractionDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ExtractionDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ExtractionDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,21 +35,21 @@
*/
public class ExtractionDao {
- /**
- * Constructor (empêche l'instantiation)
- */
- private ExtractionDao() {
- //
- }
+ /**
+ * Constructor (empêche l'instantiation)
+ */
+ private ExtractionDao() {
+ //
+ }
- /**
- * Rend le criteria qui rend le nombre d'extrait qui référencent un type d'extrait
- * @param idTypeExtrait L'id du type extrait
- * @return Le criteria
- **/
- public static DetachedCriteria getCriteriaCountExtraitOfTypeExtrait(Integer idTypeExtrait) {
- return DetachedCriteria.forClass(Extrait.class).createAlias("typeExtrait", "type")
- .add(Restrictions.eq("type.idTypeExtrait", idTypeExtrait)).setProjection(Projections.rowCount());
- }
+ /**
+ * Rend le criteria qui rend le nombre d'extrait qui référencent un type d'extrait
+ * @param idTypeExtrait L'id du type extrait
+ * @return Le criteria
+ **/
+ public static DetachedCriteria getCriteriaCountExtraitOfTypeExtrait(Integer idTypeExtrait) {
+ return DetachedCriteria.forClass(Extrait.class).createAlias("typeExtrait", "type")
+ .add(Restrictions.eq("type.idTypeExtrait", idTypeExtrait)).setProjection(Projections.rowCount());
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/HibernateTemplateDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/HibernateTemplateDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/HibernateTemplateDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -53,251 +53,251 @@
@Resource
private SessionFactory sessionFactory;
- public HibernateTemplateDao() {
+ public HibernateTemplateDao() {
- }
+ }
- /**
- * Criteria : model from a property value
- * @param modelClass Model class
- * @param propertyName Property name
- * @param value Value
- * @return Criteria
- */
- private static DetachedCriteria criteriaByProperty(Class<? extends AbstractModel> modelClass, String propertyName,
- Serializable value) {
- return DetachedCriteria.forClass(modelClass).add(Restrictions.eq(propertyName, value));
- }
+ /**
+ * Criteria : model from a property value
+ * @param modelClass Model class
+ * @param propertyName Property name
+ * @param value Value
+ * @return Criteria
+ */
+ private static DetachedCriteria criteriaByProperty(Class<? extends AbstractModel> modelClass, String propertyName,
+ Serializable value) {
+ return DetachedCriteria.forClass(modelClass).add(Restrictions.eq(propertyName, value));
+ }
- /*
- * Constructor
- * @param sessionFactory Session factory
- *
- @Autowired
- public HibernateTemplateDao(SessionFactory sessionFactory) {
- setSessionFactory(sessionFactory);
- sessionFactory.getCurrentSession().setAllowCreate(false);
- sessionFactory.getCurrentSession().setCacheQueries(true);
- sessionFactory.getCurrentSession().afterPropertiesSet();
- }*/
+ /*
+ * Constructor
+ * @param sessionFactory Session factory
+ *
+ @Autowired
+ public HibernateTemplateDao(SessionFactory sessionFactory) {
+ setSessionFactory(sessionFactory);
+ sessionFactory.getCurrentSession().setAllowCreate(false);
+ sessionFactory.getCurrentSession().setCacheQueries(true);
+ sessionFactory.getCurrentSession().afterPropertiesSet();
+ }*/
- /**
- * {@inheritDoc}
- */
- @Override
- public long count(DetachedCriteria criteria) {
- AssertTools.assertNotNull(criteria);
- return (Long) list(criteria.setProjection(Projections.rowCount())).get(0);
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public long count(DetachedCriteria criteria) {
+ AssertTools.assertNotNull(criteria);
+ return (Long) list(criteria.setProjection(Projections.rowCount())).get(0);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> long count(Class<M> modelClass) {
- AssertTools.assertNotNull(modelClass);
- return (Long) list(DetachedCriteria.forClass(modelClass).setProjection(Projections.rowCount())).get(0);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> long count(Class<M> modelClass) {
+ AssertTools.assertNotNull(modelClass);
+ return (Long) list(DetachedCriteria.forClass(modelClass).setProjection(Projections.rowCount())).get(0);
+ }
- /**
- * {@inheritDoc}
- */
- @Override
- public long count(String hqlQuery, Object... parameters) {
- AssertTools.assertNotEmpty(hqlQuery);
- Query query = sessionFactory.getCurrentSession().createQuery(hqlQuery);
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public long count(String hqlQuery, Object... parameters) {
+ AssertTools.assertNotEmpty(hqlQuery);
+ Query query = sessionFactory.getCurrentSession().createQuery(hqlQuery);
for (int i = 0; i < parameters.length; i++) {
query.setParameter(i, parameters[i]);
}
- return (Long)query.iterate().next();
- }
+ return (Long)query.iterate().next();
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void create(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().save(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void create(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().save(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void createOrUpdate(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().saveOrUpdate(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void createOrUpdate(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().saveOrUpdate(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void delete(Class<M> modelClass, Serializable id) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertNotNull(id);
- sessionFactory.getCurrentSession().delete(read(modelClass, id));
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void delete(Class<M> modelClass, Serializable id) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertNotNull(id);
+ sessionFactory.getCurrentSession().delete(read(modelClass, id));
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void delete(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().delete(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void delete(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().delete(model);
+ }
- /** {@inheritDoc} */
- @Override
- public List<?> list(DetachedCriteria criteria) {
- AssertTools.assertNotNull(criteria);
- Criteria execCriteria = criteria.getExecutableCriteria(sessionFactory.getCurrentSession());
- return execCriteria.list();
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<?> list(DetachedCriteria criteria) {
+ AssertTools.assertNotNull(criteria);
+ Criteria execCriteria = criteria.getExecutableCriteria(sessionFactory.getCurrentSession());
+ return execCriteria.list();
+ }
- /** {@inheritDoc} */
- @Override
- public List<?> list(String hqlQuery, Object... parameters) {
- Query query = sessionFactory.getCurrentSession().createQuery(hqlQuery);
- for (int i = 0; i < parameters.length; i++) {
+ /** {@inheritDoc} */
+ @Override
+ public List<?> list(String hqlQuery, Object... parameters) {
+ Query query = sessionFactory.getCurrentSession().createQuery(hqlQuery);
+ for (int i = 0; i < parameters.length; i++) {
query.setParameter(i, parameters[i]);
}
- return query.list();
- }
+ return query.list();
+ }
- /** {@inheritDoc} */
- @Override
- public int execute(final String sqlQuery, final Object... parameters) {
- AssertTools.assertNotEmpty(sqlQuery);
- Query query = sessionFactory.getCurrentSession().createSQLQuery(sqlQuery);
+ /** {@inheritDoc} */
+ @Override
+ public int execute(final String sqlQuery, final Object... parameters) {
+ AssertTools.assertNotEmpty(sqlQuery);
+ Query query = sessionFactory.getCurrentSession().createSQLQuery(sqlQuery);
for (int i = 0; i < parameters.length; i++) {
query.setParameter(i, parameters[i]);
}
int nbLines = Integer.valueOf(query.executeUpdate());
- // This way to execute requests shortcuts the Hibernate process, so we need to refresh the data cache
- sessionFactory.getCurrentSession().flush();
- sessionFactory.getCurrentSession().clear();
- return nbLines;
- }
+ // This way to execute requests shortcuts the Hibernate process, so we need to refresh the data cache
+ sessionFactory.getCurrentSession().flush();
+ sessionFactory.getCurrentSession().clear();
+ return nbLines;
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> boolean exists(Class<M> modelClass, Serializable id) {
- return count(criteriaByProperty(modelClass, AbstractModel.getIdField(modelClass).getName(), id).setProjection(
- Projections.rowCount())) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> boolean exists(Class<M> modelClass, Serializable id) {
+ return count(criteriaByProperty(modelClass, AbstractModel.getIdField(modelClass).getName(), id).setProjection(
+ Projections.rowCount())) > 0;
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> boolean exists(Class<M> modelClass, String property, Serializable value) {
- return count(criteriaByProperty(modelClass, property, value).setProjection(Projections.rowCount())) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> boolean exists(Class<M> modelClass, String property, Serializable value) {
+ return count(criteriaByProperty(modelClass, property, value).setProjection(Projections.rowCount())) > 0;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean exists(DetachedCriteria criteria) {
- return count(criteria) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean exists(DetachedCriteria criteria) {
+ return count(criteria) > 0;
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> List<M> readList(Class<M> modelClass) {
- AssertTools.assertNotNull(modelClass);
- Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
- criteria.addOrder(Order.asc(AbstractModel.getIdField(modelClass).getName()));
- return GenericsTools.cast(criteria.list());
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> List<M> readList(Class<M> modelClass) {
+ AssertTools.assertNotNull(modelClass);
+ Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
+ criteria.addOrder(Order.asc(AbstractModel.getIdField(modelClass).getName()));
+ return GenericsTools.cast(criteria.list());
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> List<M> readList(Class<M> modelClass, String... sortColumns) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertNotEmpty(sortColumns);
- Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
- for (String sortCol : sortColumns) {
- criteria.addOrder(Order.asc(sortCol));
- }
- return GenericsTools.cast(criteria.list());
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> List<M> readList(Class<M> modelClass, String... sortColumns) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertNotEmpty(sortColumns);
+ Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
+ for (String sortCol : sortColumns) {
+ criteria.addOrder(Order.asc(sortCol));
+ }
+ return GenericsTools.cast(criteria.list());
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertPositive(firstResult);
- AssertTools.assertPositive(maxResults);
- Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
- criteria.addOrder(Order.asc(AbstractModel.getIdField(modelClass).getName()));
- criteria.setFirstResult(firstResult);
- criteria.setMaxResults(maxResults);
- return GenericsTools.cast(criteria.list());
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertPositive(firstResult);
+ AssertTools.assertPositive(maxResults);
+ Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
+ criteria.addOrder(Order.asc(AbstractModel.getIdField(modelClass).getName()));
+ criteria.setFirstResult(firstResult);
+ criteria.setMaxResults(maxResults);
+ return GenericsTools.cast(criteria.list());
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults,
- String... sortColumns) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertNotEmpty(sortColumns);
- AssertTools.assertPositive(firstResult);
- AssertTools.assertPositive(maxResults);
- Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
- for (String sortCol : sortColumns) {
- criteria.addOrder(Order.asc(sortCol));
- }
- criteria.setFirstResult(firstResult);
- criteria.setMaxResults(maxResults);
- return GenericsTools.cast(criteria.list());
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> List<M> readList(Class<M> modelClass, int firstResult, int maxResults,
+ String... sortColumns) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertNotEmpty(sortColumns);
+ AssertTools.assertPositive(firstResult);
+ AssertTools.assertPositive(maxResults);
+ Criteria criteria = sessionFactory.getCurrentSession().createCriteria(modelClass);
+ for (String sortCol : sortColumns) {
+ criteria.addOrder(Order.asc(sortCol));
+ }
+ criteria.setFirstResult(firstResult);
+ criteria.setMaxResults(maxResults);
+ return GenericsTools.cast(criteria.list());
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> M read(Class<M> modelClass, Serializable id) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertNotNull(id);
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> M read(Class<M> modelClass, Serializable id) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertNotNull(id);
- M m = modelClass.cast(sessionFactory.getCurrentSession().get(modelClass, id));
- if (m == null) {
- throw new ObjectRetrievalFailureException(modelClass, id);
- }
- return m;
- }
+ M m = modelClass.cast(sessionFactory.getCurrentSession().get(modelClass, id));
+ if (m == null) {
+ throw new ObjectRetrievalFailureException(modelClass, id);
+ }
+ return m;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public <M extends AbstractModel> M read(Class<M> modelClass, String uniqueProperty, Serializable value) {
- List<M> list = (List<M>) list(criteriaByProperty(modelClass, uniqueProperty, value));
- if (list.size() != 1) {
- throw new ObjectRetrievalFailureException(modelClass, value);
- }
- return list.get(0);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <M extends AbstractModel> M read(Class<M> modelClass, String uniqueProperty, Serializable value) {
+ List<M> list = (List<M>) list(criteriaByProperty(modelClass, uniqueProperty, value));
+ if (list.size() != 1) {
+ throw new ObjectRetrievalFailureException(modelClass, value);
+ }
+ return list.get(0);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void refresh(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().refresh(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void refresh(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().refresh(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void update(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().update(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void update(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().update(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void evict(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().evict(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void evict(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().evict(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> boolean contains(M model) {
- AssertTools.assertNotNull(model);
- return sessionFactory.getCurrentSession().contains(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> boolean contains(M model) {
+ AssertTools.assertNotNull(model);
+ return sessionFactory.getCurrentSession().contains(model);
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void merge(M model) {
- AssertTools.assertNotNull(model);
- sessionFactory.getCurrentSession().merge(model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void merge(M model) {
+ AssertTools.assertNotNull(model);
+ sessionFactory.getCurrentSession().merge(model);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,15 +37,15 @@
*/
public final class MoleculeDao extends AbstractModelDao {
- /** Criteria : différents programmes des campagnes déjà saisis */
- public static final DetachedCriteria CRITERIA_DISTINCT_MOLECULE_ORGANISMES = DetachedCriteria
- .forClass(Molecule.class).setProjection(Projections.distinct(Projections.property("identifieePar")))
- .addOrder(Order.asc("identifieePar"));
+ /** Criteria : différents programmes des campagnes déjà saisis */
+ public static final DetachedCriteria CRITERIA_DISTINCT_MOLECULE_ORGANISMES = DetachedCriteria
+ .forClass(Molecule.class).setProjection(Projections.distinct(Projections.property("identifieePar")))
+ .addOrder(Order.asc("identifieePar"));
- /**
- * Constructor (prevents from instantiation)
- */
- private MoleculeDao() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private MoleculeDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PersonneDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PersonneDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PersonneDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,55 +35,55 @@
/** DAO : personne */
public final class PersonneDao extends AbstractModelDao {
- /** Criteria : compte les administrateurs */
- public static final DetachedCriteria CRITERIA_COUNT_ADMINS = DetachedCriteria.forClass(Utilisateur.class)
- .add(Restrictions.eq("typeDroit", TypeDroit.ADMINISTRATEUR))
- .add(Restrictions.eq("estValide", Boolean.TRUE)).setProjection(Projections.rowCount());
+ /** Criteria : compte les administrateurs */
+ public static final DetachedCriteria CRITERIA_COUNT_ADMINS = DetachedCriteria.forClass(Utilisateur.class)
+ .add(Restrictions.eq("typeDroit", TypeDroit.ADMINISTRATEUR))
+ .add(Restrictions.eq("estValide", Boolean.TRUE)).setProjection(Projections.rowCount());
- /** Criteria : liste les administrateurs */
- public static final DetachedCriteria CRITERIA_LIST_ADMINS = DetachedCriteria.forClass(Utilisateur.class)
- .add(Restrictions.eq("typeDroit", TypeDroit.ADMINISTRATEUR))
- .add(Restrictions.eq("estValide", Boolean.TRUE));
+ /** Criteria : liste les administrateurs */
+ public static final DetachedCriteria CRITERIA_LIST_ADMINS = DetachedCriteria.forClass(Utilisateur.class)
+ .add(Restrictions.eq("typeDroit", TypeDroit.ADMINISTRATEUR))
+ .add(Restrictions.eq("estValide", Boolean.TRUE));
- /** Criteria : liste les utilisateurs à valider */
- public static final DetachedCriteria CRITERIA_LIST_UTILISATEURS_INVALID = DetachedCriteria
- .forClass(Utilisateur.class).add(Restrictions.eq("estValide", Boolean.FALSE)).addOrder(Order.asc("nom"))
- .addOrder(Order.asc("prenom"));
+ /** Criteria : liste les utilisateurs à valider */
+ public static final DetachedCriteria CRITERIA_LIST_UTILISATEURS_INVALID = DetachedCriteria
+ .forClass(Utilisateur.class).add(Restrictions.eq("estValide", Boolean.FALSE)).addOrder(Order.asc("nom"))
+ .addOrder(Order.asc("prenom"));
- /** Criteria : liste les utilisateurs qui sont déjà valides */
- public static final DetachedCriteria CRITERIA_LIST_UTILISATEURS_VALID = DetachedCriteria
- .forClass(Utilisateur.class).add(Restrictions.eq("estValide", Boolean.TRUE)).addOrder(Order.asc("nom"))
- .addOrder(Order.asc("prenom"));
+ /** Criteria : liste les utilisateurs qui sont déjà valides */
+ public static final DetachedCriteria CRITERIA_LIST_UTILISATEURS_VALID = DetachedCriteria
+ .forClass(Utilisateur.class).add(Restrictions.eq("estValide", Boolean.TRUE)).addOrder(Order.asc("nom"))
+ .addOrder(Order.asc("prenom"));
- /** SQL : créé un utilisateur à partir d'une personne */
- public static final String SQL_CREATE_UTILISATEUR_FROM_PERSONNE = String.format(
- "INSERT INTO %s(estValide, passwordHash, typeDroit, idPersonne) VALUES (?, ?, ?, ?);",
- Utilisateur.class.getSimpleName());
+ /** SQL : créé un utilisateur à partir d'une personne */
+ public static final String SQL_CREATE_UTILISATEUR_FROM_PERSONNE = String.format(
+ "INSERT INTO %s(estValide, passwordHash, typeDroit, idPersonne) VALUES (?, ?, ?, ?);",
+ Utilisateur.class.getSimpleName());
- /** SQL : supprime un utilisateur (mais pas la personne associée) */
- public static final String SQL_DELETE_UTILISATEUR = String.format("DELETE FROM %s WHERE idPersonne = ?;",
- Utilisateur.class.getSimpleName());
+ /** SQL : supprime un utilisateur (mais pas la personne associée) */
+ public static final String SQL_DELETE_UTILISATEUR = String.format("DELETE FROM %s WHERE idPersonne = ?;",
+ Utilisateur.class.getSimpleName());
- /** Criteria : valeurs existantes du champ 'organisme' pour les personnes existantes */
- public static final DetachedCriteria CRITERIA_DISTINCT_PERSONNE_ORGANISMES = DetachedCriteria
- .forClass(Personne.class).setProjection(Projections.distinct(Projections.property("organisme")))
- .addOrder(Order.asc("organisme"));
+ /** Criteria : valeurs existantes du champ 'organisme' pour les personnes existantes */
+ public static final DetachedCriteria CRITERIA_DISTINCT_PERSONNE_ORGANISMES = DetachedCriteria
+ .forClass(Personne.class).setProjection(Projections.distinct(Projections.property("organisme")))
+ .addOrder(Order.asc("organisme"));
- /**
- * Liste l'utilisateur qui a le courriel et le password donné et qui est un utilisateur validé
- * @param courriel Le courriel recherché
- * @param passwordHash Le password recherché
- * @return Le criteria
- **/
- public static DetachedCriteria getCriteriaAuthenticateUser(String courriel, String passwordHash) {
- return DetachedCriteria.forClass(Utilisateur.class).add(Restrictions.eq("courriel", courriel))
- .add(Restrictions.eq("passwordHash", passwordHash)).add(Restrictions.eq("estValide", Boolean.TRUE));
- }
+ /**
+ * Liste l'utilisateur qui a le courriel et le password donné et qui est un utilisateur validé
+ * @param courriel Le courriel recherché
+ * @param passwordHash Le password recherché
+ * @return Le criteria
+ **/
+ public static DetachedCriteria getCriteriaAuthenticateUser(String courriel, String passwordHash) {
+ return DetachedCriteria.forClass(Utilisateur.class).add(Restrictions.eq("courriel", courriel))
+ .add(Restrictions.eq("passwordHash", passwordHash)).add(Restrictions.eq("estValide", Boolean.TRUE));
+ }
- /**
- * Constructor (empêche l'instantiation)
- */
- private PersonneDao() {
- //
- }
+ /**
+ * Constructor (empêche l'instantiation)
+ */
+ private PersonneDao() {
+ //
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/ProduitDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,31 +33,31 @@
/** DAO : produit */
public final class ProduitDao extends AbstractModelDao {
- /**
- * Constructor (empêche l'instantiation)
- */
- private ProduitDao() {
- //
- }
+ /**
+ * Constructor (empêche l'instantiation)
+ */
+ private ProduitDao() {
+ //
+ }
- /**
- * Rend le criteria qui rend le nombre de purifications qui référencent un produit
- * @param refProduit La référence du produit
- * @return Le criteria
- **/
- public static DetachedCriteria getCriteriaCountPurifFromProduit(String refProduit) {
- return DetachedCriteria.forClass(Purification.class).createAlias("produit", "prod").add(
- Restrictions.eq("prod.ref", refProduit)).setProjection(Projections.rowCount());
- }
+ /**
+ * Rend le criteria qui rend le nombre de purifications qui référencent un produit
+ * @param refProduit La référence du produit
+ * @return Le criteria
+ **/
+ public static DetachedCriteria getCriteriaCountPurifFromProduit(String refProduit) {
+ return DetachedCriteria.forClass(Purification.class).createAlias("produit", "prod").add(
+ Restrictions.eq("prod.ref", refProduit)).setProjection(Projections.rowCount());
+ }
- /**
- * Rend le criteria qui rend le nombre de tests biologiques qui référencent un produit
- * @param refProduit La référence du produit
- * @return Le criteria
- **/
- public static DetachedCriteria getCriteriaCountTestBioFromProduit(String refProduit) {
- return DetachedCriteria.forClass(ResultatTestBio.class).createAlias("produit", "prod").add(
- Restrictions.eq("prod.ref", refProduit)).setProjection(Projections.rowCount());
- }
+ /**
+ * Rend le criteria qui rend le nombre de tests biologiques qui référencent un produit
+ * @param refProduit La référence du produit
+ * @return Le criteria
+ **/
+ public static DetachedCriteria getCriteriaCountTestBioFromProduit(String refProduit) {
+ return DetachedCriteria.forClass(ResultatTestBio.class).createAlias("produit", "prod").add(
+ Restrictions.eq("prod.ref", refProduit)).setProjection(Projections.rowCount());
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PurificationDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PurificationDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/PurificationDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -28,18 +28,18 @@
*/
public class PurificationDao {
- /**
- * Rend la requête HQL qui compte les purifications qui référencent un paramètre de méthode. Prend en paramètre l'id
- * du paramètre de la méthode.
- **/
- public final static String COUNT_PURIF_WITH_PARAM_METHO = "select count(purif) from Purification purif inner join purif.paramsMetho paramsEff "
- + "where paramsEff.id.pk2.idParamMethoPuri = ?";
+ /**
+ * Rend la requête HQL qui compte les purifications qui référencent un paramètre de méthode. Prend en paramètre l'id
+ * du paramètre de la méthode.
+ **/
+ public final static String COUNT_PURIF_WITH_PARAM_METHO = "select count(purif) from Purification purif inner join purif.paramsMetho paramsEff "
+ + "where paramsEff.id.pk2.idParamMethoPuri = ?";
- /**
- * Constructor (empêche l'instantiation)
- */
- private PurificationDao() {
- //
- }
+ /**
+ * Constructor (empêche l'instantiation)
+ */
+ private PurificationDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/SpecimenDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/SpecimenDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/SpecimenDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,43 +35,43 @@
*/
public class SpecimenDao extends AbstractModelDao {
- /** Criteria : valeurs existantes du champ 'embranchement' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_EMBRANCHEMENTS = DetachedCriteria
- .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("embranchement")))
- .addOrder(Order.asc("embranchement"));
+ /** Criteria : valeurs existantes du champ 'embranchement' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_EMBRANCHEMENTS = DetachedCriteria
+ .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("embranchement")))
+ .addOrder(Order.asc("embranchement"));
- /** Criteria : valeurs existantes du champ 'famille' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_FAMILLES = DetachedCriteria
- .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("famille")))
- .addOrder(Order.asc("famille"));
+ /** Criteria : valeurs existantes du champ 'famille' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_FAMILLES = DetachedCriteria
+ .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("famille")))
+ .addOrder(Order.asc("famille"));
- /** Criteria : valeurs existantes du champ 'genre' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_GENRES = DetachedCriteria.forClass(Specimen.class)
- .setProjection(Projections.distinct(Projections.property("genre"))).addOrder(Order.asc("genre"));
+ /** Criteria : valeurs existantes du champ 'genre' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_GENRES = DetachedCriteria.forClass(Specimen.class)
+ .setProjection(Projections.distinct(Projections.property("genre"))).addOrder(Order.asc("genre"));
- /** Criteria : valeurs existantes du champ 'espece' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_ESPECES = DetachedCriteria.forClass(Specimen.class)
- .setProjection(Projections.distinct(Projections.property("espece"))).addOrder(Order.asc("espece"));
+ /** Criteria : valeurs existantes du champ 'espece' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_ESPECES = DetachedCriteria.forClass(Specimen.class)
+ .setProjection(Projections.distinct(Projections.property("espece"))).addOrder(Order.asc("espece"));
- /** Criteria : valeurs existantes du champ 'sousEspece' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_SOUSESPECES = DetachedCriteria
- .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("sousEspece")))
- .addOrder(Order.asc("sousEspece"));
+ /** Criteria : valeurs existantes du champ 'sousEspece' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_SOUSESPECES = DetachedCriteria
+ .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("sousEspece")))
+ .addOrder(Order.asc("sousEspece"));
- /** Criteria : valeurs existantes du champ 'variete' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_VARIETES = DetachedCriteria
- .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("variete")))
- .addOrder(Order.asc("variete"));
+ /** Criteria : valeurs existantes du champ 'variete' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_SPECIMEN_VARIETES = DetachedCriteria
+ .forClass(Specimen.class).setProjection(Projections.distinct(Projections.property("variete")))
+ .addOrder(Order.asc("variete"));
- /** Criteria : valeurs existantes du champ 'variete' existants pour les spécimens existants */
- public static final DetachedCriteria CRITERIA_DISTINCT_LIEUX_DEPOT = DetachedCriteria.forClass(Specimen.class)
- .setProjection(Projections.distinct(Projections.property("lieuDepot"))).addOrder(Order.asc("lieuDepot"));
+ /** Criteria : valeurs existantes du champ 'variete' existants pour les spécimens existants */
+ public static final DetachedCriteria CRITERIA_DISTINCT_LIEUX_DEPOT = DetachedCriteria.forClass(Specimen.class)
+ .setProjection(Projections.distinct(Projections.property("lieuDepot"))).addOrder(Order.asc("lieuDepot"));
- /**
- * Constructeur (empêche l'instantiation)
- */
- private SpecimenDao() {
- //
- }
+ /**
+ * Constructeur (empêche l'instantiation)
+ */
+ private SpecimenDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/StationDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/StationDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/StationDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,14 +36,14 @@
*/
public final class StationDao extends AbstractModelDao {
- /** Criteria : différentes localités des stations déjà saisies */
- public static final DetachedCriteria CRITERIA_DISTINCT_STATION_LOCALITES = DetachedCriteria.forClass(Station.class)
- .setProjection(Projections.distinct(Projections.property("localite"))).addOrder(Order.asc("localite"));
+ /** Criteria : différentes localités des stations déjà saisies */
+ public static final DetachedCriteria CRITERIA_DISTINCT_STATION_LOCALITES = DetachedCriteria.forClass(Station.class)
+ .setProjection(Projections.distinct(Projections.property("localite"))).addOrder(Order.asc("localite"));
- /**
- * Constructeur (empêche l'instantiation)
- */
- private StationDao() {
- //
- }
+ /**
+ * Constructeur (empêche l'instantiation)
+ */
+ private StationDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/TestBioDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/TestBioDao.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/TestBioDao.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,40 +38,40 @@
*/
public class TestBioDao {
- /**
- * Criteria : liste les résultats de tests bio qui sont de type "produit". L'ensemble est trié par (cible, produit,
- * id)
- */
- public static final DetachedCriteria CRITERIA_LIST_RESULTATS_TYPE_PRODUIT = DetachedCriteria
- .forClass(ResultatTestBio.class, "r").add(Restrictions.eq("r.typeResultat", TypeResultat.PRODUIT))
- .createCriteria("testBio", "t").createCriteria("t.methode", "m").addOrder(Order.asc("m.cible"))
- .createCriteria("r.produit", "p").addOrder(Order.asc("p.ref")).addOrder(Order.asc("r.id"));
+ /**
+ * Criteria : liste les résultats de tests bio qui sont de type "produit". L'ensemble est trié par (cible, produit,
+ * id)
+ */
+ public static final DetachedCriteria CRITERIA_LIST_RESULTATS_TYPE_PRODUIT = DetachedCriteria
+ .forClass(ResultatTestBio.class, "r").add(Restrictions.eq("r.typeResultat", TypeResultat.PRODUIT))
+ .createCriteria("testBio", "t").createCriteria("t.methode", "m").addOrder(Order.asc("m.cible"))
+ .createCriteria("r.produit", "p").addOrder(Order.asc("p.ref")).addOrder(Order.asc("r.id"));
- /** Criteria : compte les résultats de tests bio qui sont de type "produit" */
- public static final DetachedCriteria CRITERIA_COUNT_RESULTATS_TYPE_PRODUIT = DetachedCriteria
- .forClass(ResultatTestBio.class).add(Restrictions.eq("typeResultat", TypeResultat.PRODUIT))
- .setProjection(Projections.rowCount());
+ /** Criteria : compte les résultats de tests bio qui sont de type "produit" */
+ public static final DetachedCriteria CRITERIA_COUNT_RESULTATS_TYPE_PRODUIT = DetachedCriteria
+ .forClass(ResultatTestBio.class).add(Restrictions.eq("typeResultat", TypeResultat.PRODUIT))
+ .setProjection(Projections.rowCount());
- /** Criteria : valeurs existantes du champ 'domaines' existants pour les méthodes de tests biologiques */
- public static final DetachedCriteria CRITERIA_DISTINCT_DOMAINES_METHODES = DetachedCriteria
- .forClass(MethodeTestBio.class).setProjection(Projections.distinct(Projections.property("domaine")))
- .addOrder(Order.asc("domaine"));
+ /** Criteria : valeurs existantes du champ 'domaines' existants pour les méthodes de tests biologiques */
+ public static final DetachedCriteria CRITERIA_DISTINCT_DOMAINES_METHODES = DetachedCriteria
+ .forClass(MethodeTestBio.class).setProjection(Projections.distinct(Projections.property("domaine")))
+ .addOrder(Order.asc("domaine"));
- /** Criteria : valeurs existantes du champ 'uniteResultat' existants pour les méthodes de tests biologiques */
- public static final DetachedCriteria CRITERIA_DISTINCT_UNITES_RESULTAT_METHODES = DetachedCriteria
- .forClass(MethodeTestBio.class).setProjection(Projections.distinct(Projections.property("uniteResultat")))
- .addOrder(Order.asc("uniteResultat"));
+ /** Criteria : valeurs existantes du champ 'uniteResultat' existants pour les méthodes de tests biologiques */
+ public static final DetachedCriteria CRITERIA_DISTINCT_UNITES_RESULTAT_METHODES = DetachedCriteria
+ .forClass(MethodeTestBio.class).setProjection(Projections.distinct(Projections.property("uniteResultat")))
+ .addOrder(Order.asc("uniteResultat"));
- /** Criteria : valeurs existantes du champ 'uniteResultat' existants pour les méthodes de tests biologiques */
- public static final DetachedCriteria CRITERIA_DISTINCT_PRODUITS_TEMOINS = DetachedCriteria
- .forClass(ResultatTestBio.class).setProjection(Projections.distinct(Projections.property("produitTemoin")))
- .addOrder(Order.asc("produitTemoin"));
+ /** Criteria : valeurs existantes du champ 'uniteResultat' existants pour les méthodes de tests biologiques */
+ public static final DetachedCriteria CRITERIA_DISTINCT_PRODUITS_TEMOINS = DetachedCriteria
+ .forClass(ResultatTestBio.class).setProjection(Projections.distinct(Projections.property("produitTemoin")))
+ .addOrder(Order.asc("produitTemoin"));
- /**
- * Constructor (empêche l'instantiation)
- */
- private TestBioDao() {
- //
- }
+ /**
+ * Constructor (empêche l'instantiation)
+ */
+ private TestBioDao() {
+ //
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/utils/GenericDaoAspect.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/utils/GenericDaoAspect.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/utils/GenericDaoAspect.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -46,23 +46,23 @@
@Component
public final class GenericDaoAspect {
- /**
- * Convert a DataIntegrityViolationException into a DataConstraintException
- * @param e DataIntegrityViolationException
- * @throws DataConstraintException In any case
- */
- @AfterThrowing(pointcut = "execution(* nc.ird.cantharella.data.dao.GenericDao.*(..))", throwing = "e")
- public void afterThrowing(DataIntegrityViolationException e) throws DataConstraintException {
- throw new DataConstraintException(e);
- }
+ /**
+ * Convert a DataIntegrityViolationException into a DataConstraintException
+ * @param e DataIntegrityViolationException
+ * @throws DataConstraintException In any case
+ */
+ @AfterThrowing(pointcut = "execution(* nc.ird.cantharella.data.dao.GenericDao.*(..))", throwing = "e")
+ public void afterThrowing(DataIntegrityViolationException e) throws DataConstraintException {
+ throw new DataConstraintException(e);
+ }
- /**
- * Convert a DataRetrievalFailureException into a DataNotFoundException
- * @param e DataRetrievalFailureException
- * @throws DataNotFoundException In any case
- */
- @AfterThrowing(pointcut = "execution(* nc.ird.cantharella.data.dao.GenericDao.*(..))", throwing = "e")
- public void afterThrowing(DataRetrievalFailureException e) throws DataNotFoundException {
- throw new DataNotFoundException(e);
- }
+ /**
+ * Convert a DataRetrievalFailureException into a DataNotFoundException
+ * @param e DataRetrievalFailureException
+ * @throws DataNotFoundException In any case
+ */
+ @AfterThrowing(pointcut = "execution(* nc.ird.cantharella.data.dao.GenericDao.*(..))", throwing = "e")
+ public void afterThrowing(DataRetrievalFailureException e) throws DataNotFoundException {
+ throw new DataNotFoundException(e);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/AbstractException.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/AbstractException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/AbstractException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -29,35 +29,35 @@
*/
public abstract class AbstractException extends Exception {
- /**
- * Constructor
- */
- protected AbstractException() {
- //
- }
+ /**
+ * Constructor
+ */
+ protected AbstractException() {
+ //
+ }
- /**
- * Constructor
- * @param cause Cause
- */
- protected AbstractException(Exception cause) {
- super(cause.getMessage(), cause);
- }
+ /**
+ * Constructor
+ * @param cause Cause
+ */
+ protected AbstractException(Exception cause) {
+ super(cause.getMessage(), cause);
+ }
- /**
- * Constructor
- * @param message Message
- */
- protected AbstractException(String message) {
- super(message);
- }
+ /**
+ * Constructor
+ * @param message Message
+ */
+ protected AbstractException(String message) {
+ super(message);
+ }
- /**
- * Constructor
- * @param message Message
- * @param cause Cause
- */
- protected AbstractException(String message, Exception cause) {
- super(message, cause);
- }
+ /**
+ * Constructor
+ * @param message Message
+ * @param cause Cause
+ */
+ protected AbstractException(String message, Exception cause) {
+ super(message, cause);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataConstraintException.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataConstraintException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataConstraintException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,18 +31,18 @@
*/
public class DataConstraintException extends AbstractException {
- /**
- * Constructor
- */
- public DataConstraintException() {
- //
- }
+ /**
+ * Constructor
+ */
+ public DataConstraintException() {
+ //
+ }
- /**
- * Constructor
- * @param cause Cause
- */
- public DataConstraintException(DataIntegrityViolationException cause) {
- super(cause);
- }
+ /**
+ * Constructor
+ * @param cause Cause
+ */
+ public DataConstraintException(DataIntegrityViolationException cause) {
+ super(cause);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataNotFoundException.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataNotFoundException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/DataNotFoundException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,11 +31,11 @@
*/
public final class DataNotFoundException extends AbstractException {
- /**
- * Constructor
- * @param cause Cause
- */
- public DataNotFoundException(DataRetrievalFailureException cause) {
- super(cause);
- }
+ /**
+ * Constructor
+ * @param cause Cause
+ */
+ public DataNotFoundException(DataRetrievalFailureException cause) {
+ super(cause);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -29,12 +29,12 @@
*/
public final class UnexpectedException extends RuntimeException {
- /**
- * Constructor
- * @param cause Cause
- */
- public UnexpectedException(Exception cause) {
- super(cause.getMessage(), cause);
- }
+ /**
+ * Constructor
+ * @param cause Cause
+ */
+ public UnexpectedException(Exception cause) {
+ super(cause.getMessage(), cause);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Campagne.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Campagne.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Campagne.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -66,335 +66,335 @@
@Embeddable
public class Campagne extends AbstractModel implements Comparable<Campagne> {
- /** ID */
- @Id
- @GeneratedValue
- private Integer idCampagne;
+ /** ID */
+ @Id
+ @GeneratedValue
+ private Integer idCampagne;
- /** Nom */
- @Column(unique = true)
- @NotNull
- @NotEmpty
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String nom;
+ /** Nom */
+ @Column(unique = true)
+ @NotNull
+ @NotEmpty
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String nom;
- /** Code pays */
- @NotNull
- @CountryCode
- @Length(min = 2, max = 2)
- private String codePays;
+ /** Code pays */
+ @NotNull
+ @CountryCode
+ @Length(min = 2, max = 2)
+ private String codePays;
- /** Programme */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String programme;
+ /** Programme */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String programme;
- /** Mention légale décrivant les droits sur les données */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String mentionLegale;
+ /** Mention légale décrivant les droits sur les données */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String mentionLegale;
- /** Complément */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Complément */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Date début */
- @NotNull
- @Temporal(TemporalType.DATE)
- private Date dateDeb;
+ /** Date début */
+ @NotNull
+ @Temporal(TemporalType.DATE)
+ private Date dateDeb;
- /** Date fin */
- @NotNull
- @Temporal(TemporalType.DATE)
- private Date dateFin;
+ /** Date fin */
+ @NotNull
+ @Temporal(TemporalType.DATE)
+ private Date dateFin;
- /** Droits groupes */
- @NotNull
- @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
- private List<CampagneGroupeDroits> groupesDroits;
+ /** Droits groupes */
+ @NotNull
+ @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
+ private List<CampagneGroupeDroits> groupesDroits;
- /** Lots */
- @NotNull
- @OneToMany(mappedBy = "campagne", fetch = FetchType.LAZY)
- private List<Lot> lots;
+ /** Lots */
+ @NotNull
+ @OneToMany(mappedBy = "campagne", fetch = FetchType.LAZY)
+ private List<Lot> lots;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Personne createur;
- /** Participants */
- @NotNull
- @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- private List<CampagnePersonneParticipant> participants;
+ /** Participants */
+ @NotNull
+ @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private List<CampagnePersonneParticipant> participants;
- /** Droits personnes */
- @NotNull
- @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
- private List<CampagnePersonneDroits> personnesDroits;
+ /** Droits personnes */
+ @NotNull
+ @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
+ private List<CampagnePersonneDroits> personnesDroits;
- /** Stations prospectées **/
- @NotNull
- @ManyToMany(fetch = FetchType.LAZY)
- @Cascade({ CascadeType.SAVE_UPDATE })
- private List<Station> stations;
+ /** Stations prospectées **/
+ @NotNull
+ @ManyToMany(fetch = FetchType.LAZY)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private List<Station> stations;
- /**
- * Constructor
- */
- public Campagne() {
- lots = new ArrayList<Lot>();
- participants = new ArrayList<CampagnePersonneParticipant>();
- stations = new ArrayList<Station>();
- personnesDroits = new ArrayList<CampagnePersonneDroits>();
- groupesDroits = new ArrayList<CampagneGroupeDroits>();
- }
+ /**
+ * Constructor
+ */
+ public Campagne() {
+ lots = new ArrayList<Lot>();
+ participants = new ArrayList<CampagnePersonneParticipant>();
+ stations = new ArrayList<Station>();
+ personnesDroits = new ArrayList<CampagnePersonneDroits>();
+ groupesDroits = new ArrayList<CampagneGroupeDroits>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Campagne campagne) {
- return new BeanComparator("nom").compare(this, campagne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Campagne campagne) {
+ return new BeanComparator("nom").compare(this, campagne);
+ }
- /**
- * Rend les stations triées par noms
- * @return Les stations triées
- */
- public List<Station> getSortedStations() {
- Collections.sort(stations);
- return stations;
- }
+ /**
+ * Rend les stations triées par noms
+ * @return Les stations triées
+ */
+ public List<Station> getSortedStations() {
+ Collections.sort(stations);
+ return stations;
+ }
- /**
- * idCampagne getter
- * @return idCampagne
- */
- public Integer getIdCampagne() {
- return idCampagne;
- }
+ /**
+ * idCampagne getter
+ * @return idCampagne
+ */
+ public Integer getIdCampagne() {
+ return idCampagne;
+ }
- /**
- * idCampagne setter
- * @param idCampagne idCampagne
- */
- public void setIdCampagne(Integer idCampagne) {
- this.idCampagne = idCampagne;
- }
+ /**
+ * idCampagne setter
+ * @param idCampagne idCampagne
+ */
+ public void setIdCampagne(Integer idCampagne) {
+ this.idCampagne = idCampagne;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * codePays getter
- * @return codePays
- */
- public String getCodePays() {
- return codePays;
- }
+ /**
+ * codePays getter
+ * @return codePays
+ */
+ public String getCodePays() {
+ return codePays;
+ }
- /**
- * codePays setter
- * @param codePays codePays
- */
- public void setCodePays(String codePays) {
- this.codePays = codePays;
- }
+ /**
+ * codePays setter
+ * @param codePays codePays
+ */
+ public void setCodePays(String codePays) {
+ this.codePays = codePays;
+ }
- /**
- * programme getter
- * @return programme
- */
- public String getProgramme() {
- return programme;
- }
+ /**
+ * programme getter
+ * @return programme
+ */
+ public String getProgramme() {
+ return programme;
+ }
- /**
- * programme setter
- * @param programme programme
- */
- public void setProgramme(String programme) {
- this.programme = programme;
- }
+ /**
+ * programme setter
+ * @param programme programme
+ */
+ public void setProgramme(String programme) {
+ this.programme = programme;
+ }
- /**
- * mentionLegale getter
- * @return mentionLegale
- */
- public String getMentionLegale() {
- return mentionLegale;
- }
+ /**
+ * mentionLegale getter
+ * @return mentionLegale
+ */
+ public String getMentionLegale() {
+ return mentionLegale;
+ }
- /**
- * mentionLegale setter
- * @param mentionLegale mentionLegale
- */
- public void setMentionLegale(String mentionLegale) {
- this.mentionLegale = mentionLegale;
- }
+ /**
+ * mentionLegale setter
+ * @param mentionLegale mentionLegale
+ */
+ public void setMentionLegale(String mentionLegale) {
+ this.mentionLegale = mentionLegale;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * dateDeb getter
- * @return dateDeb
- */
- public Date getDateDeb() {
- return dateDeb;
- }
+ /**
+ * dateDeb getter
+ * @return dateDeb
+ */
+ public Date getDateDeb() {
+ return dateDeb;
+ }
- /**
- * dateDeb setter
- * @param dateDeb dateDeb
- */
- public void setDateDeb(Date dateDeb) {
- this.dateDeb = dateDeb;
- }
+ /**
+ * dateDeb setter
+ * @param dateDeb dateDeb
+ */
+ public void setDateDeb(Date dateDeb) {
+ this.dateDeb = dateDeb;
+ }
- /**
- * dateFin getter
- * @return dateFin
- */
- public Date getDateFin() {
- return dateFin;
- }
+ /**
+ * dateFin getter
+ * @return dateFin
+ */
+ public Date getDateFin() {
+ return dateFin;
+ }
- /**
- * dateFin setter
- * @param dateFin dateFin
- */
- public void setDateFin(Date dateFin) {
- this.dateFin = dateFin;
- }
+ /**
+ * dateFin setter
+ * @param dateFin dateFin
+ */
+ public void setDateFin(Date dateFin) {
+ this.dateFin = dateFin;
+ }
- /**
- * groupesDroits getter
- * @return groupesDroits
- */
- public List<CampagneGroupeDroits> getGroupesDroits() {
- return groupesDroits;
- }
+ /**
+ * groupesDroits getter
+ * @return groupesDroits
+ */
+ public List<CampagneGroupeDroits> getGroupesDroits() {
+ return groupesDroits;
+ }
- /**
- * groupesDroits setter
- * @param groupesDroits groupesDroits
- */
- public void setGroupesDroits(List<CampagneGroupeDroits> groupesDroits) {
- this.groupesDroits = groupesDroits;
- }
+ /**
+ * groupesDroits setter
+ * @param groupesDroits groupesDroits
+ */
+ public void setGroupesDroits(List<CampagneGroupeDroits> groupesDroits) {
+ this.groupesDroits = groupesDroits;
+ }
- /**
- * lots getter
- * @return lots
- */
- public List<Lot> getLots() {
- return lots;
- }
+ /**
+ * lots getter
+ * @return lots
+ */
+ public List<Lot> getLots() {
+ return lots;
+ }
- /**
- * lots setter
- * @param lots lots
- */
- public void setLots(List<Lot> lots) {
- this.lots = lots;
- }
+ /**
+ * lots setter
+ * @param lots lots
+ */
+ public void setLots(List<Lot> lots) {
+ this.lots = lots;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * participants getter
- * @return participants
- */
- public List<CampagnePersonneParticipant> getParticipants() {
- return participants;
- }
+ /**
+ * participants getter
+ * @return participants
+ */
+ public List<CampagnePersonneParticipant> getParticipants() {
+ return participants;
+ }
- /**
- * participants setter
- * @param participants participants
- */
- public void setParticipants(List<CampagnePersonneParticipant> participants) {
- this.participants = participants;
- }
+ /**
+ * participants setter
+ * @param participants participants
+ */
+ public void setParticipants(List<CampagnePersonneParticipant> participants) {
+ this.participants = participants;
+ }
- /**
- * personnesDroits getter
- * @return personnesDroits
- */
- public List<CampagnePersonneDroits> getPersonnesDroits() {
- return personnesDroits;
- }
+ /**
+ * personnesDroits getter
+ * @return personnesDroits
+ */
+ public List<CampagnePersonneDroits> getPersonnesDroits() {
+ return personnesDroits;
+ }
- /**
- * personnesDroits setter
- * @param personnesDroits personnesDroits
- */
- public void setPersonnesDroits(List<CampagnePersonneDroits> personnesDroits) {
- this.personnesDroits = personnesDroits;
- }
+ /**
+ * personnesDroits setter
+ * @param personnesDroits personnesDroits
+ */
+ public void setPersonnesDroits(List<CampagnePersonneDroits> personnesDroits) {
+ this.personnesDroits = personnesDroits;
+ }
- /**
- * stations getter
- * @return stations
- */
- public List<Station> getStations() {
- return stations;
- }
+ /**
+ * stations getter
+ * @return stations
+ */
+ public List<Station> getStations() {
+ return stations;
+ }
- /**
- * stations setter
- * @param stations stations
- */
- public void setStations(List<Station> stations) {
- this.stations = stations;
- }
+ /**
+ * stations setter
+ * @param stations stations
+ */
+ public void setStations(List<Station> stations) {
+ this.stations = stations;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagneGroupeDroits.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagneGroupeDroits.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagneGroupeDroits.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,53 +39,53 @@
@Table
public class CampagneGroupeDroits extends AbstractModel {
- /** Droits */
- @NotNull
- private Droits droits;
+ /** Droits */
+ @NotNull
+ private Droits droits;
- /** ID */
- @EmbeddedId
- @NotNull
- private CompositeId<Campagne, Groupe> id;
+ /** ID */
+ @EmbeddedId
+ @NotNull
+ private CompositeId<Campagne, Groupe> id;
- /**
- * Constructeur
- */
- public CampagneGroupeDroits() {
- droits = new Droits();
- id = new CompositeId<Campagne, Groupe>();
- }
+ /**
+ * Constructeur
+ */
+ public CampagneGroupeDroits() {
+ droits = new Droits();
+ id = new CompositeId<Campagne, Groupe>();
+ }
- /**
- * droits getter
- * @return droits
- */
- public Droits getDroits() {
- return droits;
- }
+ /**
+ * droits getter
+ * @return droits
+ */
+ public Droits getDroits() {
+ return droits;
+ }
- /**
- * droits setter
- * @param droits droits
- */
- public void setDroits(Droits droits) {
- this.droits = droits;
- }
+ /**
+ * droits setter
+ * @param droits droits
+ */
+ public void setDroits(Droits droits) {
+ this.droits = droits;
+ }
- /**
- * id getter
- * @return id
- */
- public CompositeId<Campagne, Groupe> getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public CompositeId<Campagne, Groupe> getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(CompositeId<Campagne, Groupe> id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(CompositeId<Campagne, Groupe> id) {
+ this.id = id;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneDroits.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneDroits.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneDroits.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,62 +38,62 @@
@Table
public class CampagnePersonneDroits extends AbstractModel {
- /** Droits */
- @NotNull
- private Droits droits;
+ /** Droits */
+ @NotNull
+ private Droits droits;
- /** ID */
- @EmbeddedId
- @NotNull
- private CompositeId<Campagne, Personne> id;
+ /** ID */
+ @EmbeddedId
+ @NotNull
+ private CompositeId<Campagne, Personne> id;
- /**
- * Constructeur
- */
- public CampagnePersonneDroits() {
- droits = new Droits();
- id = new CompositeId<Campagne, Personne>();
- }
+ /**
+ * Constructeur
+ */
+ public CampagnePersonneDroits() {
+ droits = new Droits();
+ id = new CompositeId<Campagne, Personne>();
+ }
- /** {@inheritDoc} */
- @Override
- public CampagnePersonneDroits clone() throws CloneNotSupportedException {
- CampagnePersonneDroits clone = new CampagnePersonneDroits();
- clone.id = id.clone();
- clone.droits = droits.clone();
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public CampagnePersonneDroits clone() throws CloneNotSupportedException {
+ CampagnePersonneDroits clone = new CampagnePersonneDroits();
+ clone.id = id.clone();
+ clone.droits = droits.clone();
+ return clone;
+ }
- /**
- * droits getter
- * @return droits
- */
- public Droits getDroits() {
- return droits;
- }
+ /**
+ * droits getter
+ * @return droits
+ */
+ public Droits getDroits() {
+ return droits;
+ }
- /**
- * droits setter
- * @param droits droits
- */
- public void setDroits(Droits droits) {
- this.droits = droits;
- }
+ /**
+ * droits setter
+ * @param droits droits
+ */
+ public void setDroits(Droits droits) {
+ this.droits = droits;
+ }
- /**
- * id getter
- * @return id
- */
- public CompositeId<Campagne, Personne> getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public CompositeId<Campagne, Personne> getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(CompositeId<Campagne, Personne> id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(CompositeId<Campagne, Personne> id) {
+ this.id = id;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneParticipant.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneParticipant.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/CampagnePersonneParticipant.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,61 +41,61 @@
@Table
public class CampagnePersonneParticipant extends AbstractModel implements Cloneable {
- /** Complément */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Complément */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** ID */
- @EmbeddedId
- @NotNull
- private CompositeId<Campagne, Personne> id;
+ /** ID */
+ @EmbeddedId
+ @NotNull
+ private CompositeId<Campagne, Personne> id;
- /**
- * Constructor
- */
- public CampagnePersonneParticipant() {
- id = new CompositeId<Campagne, Personne>();
- }
+ /**
+ * Constructor
+ */
+ public CampagnePersonneParticipant() {
+ id = new CompositeId<Campagne, Personne>();
+ }
- /** {@inheritDoc} */
- @Override
- public final CampagnePersonneParticipant clone() throws CloneNotSupportedException {
- CampagnePersonneParticipant clone = (CampagnePersonneParticipant) super.clone();
- clone.id = id.clone();
- clone.complement = complement;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public final CampagnePersonneParticipant clone() throws CloneNotSupportedException {
+ CampagnePersonneParticipant clone = (CampagnePersonneParticipant) super.clone();
+ clone.id = id.clone();
+ clone.complement = complement;
+ return clone;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * id getter
- * @return id
- */
- public CompositeId<Campagne, Personne> getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public CompositeId<Campagne, Personne> getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(CompositeId<Campagne, Personne> id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(CompositeId<Campagne, Personne> id) {
+ this.id = id;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Droits.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Droits.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Droits.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,108 +38,108 @@
@Embeddable
public class Droits implements Serializable, Cloneable {
- /** Droits extrait */
- @NotNull
- private Boolean droitExtrait;
+ /** Droits extrait */
+ @NotNull
+ private Boolean droitExtrait;
- /** Droits purification */
- @NotNull
- private Boolean droitPuri;
+ /** Droits purification */
+ @NotNull
+ private Boolean droitPuri;
- /** Droits récolte */
- @NotNull
- private Boolean droitRecolte;
+ /** Droits récolte */
+ @NotNull
+ private Boolean droitRecolte;
- /** Droits test */
- @NotNull
- private Boolean droitTestBio;
+ /** Droits test */
+ @NotNull
+ private Boolean droitTestBio;
- /** {@inheritDoc} */
- @Override
- public Droits clone() throws CloneNotSupportedException {
- Droits clone = (Droits) super.clone();
- clone.droitExtrait = droitExtrait;
- clone.droitPuri = droitPuri;
- clone.droitRecolte = droitRecolte;
- clone.droitTestBio = droitTestBio;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Droits clone() throws CloneNotSupportedException {
+ Droits clone = (Droits) super.clone();
+ clone.droitExtrait = droitExtrait;
+ clone.droitPuri = droitPuri;
+ clone.droitRecolte = droitRecolte;
+ clone.droitTestBio = droitTestBio;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean equals(Object obj) {
- return BeanTools.equals(this, obj, AccessType.GETTER, "droitExtrait", "droitPuri", "droitRecolte",
- "droitTestBio");
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean equals(Object obj) {
+ return BeanTools.equals(this, obj, AccessType.GETTER, "droitExtrait", "droitPuri", "droitRecolte",
+ "droitTestBio");
+ }
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return BeanTools.hashCode(this, droitExtrait, droitPuri, droitRecolte, droitTestBio);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int hashCode() {
+ return BeanTools.hashCode(this, droitExtrait, droitPuri, droitRecolte, droitTestBio);
+ }
- /**
- * droitExtrait getter
- * @return droitExtrait
- */
- public Boolean getDroitExtrait() {
- return droitExtrait;
- }
+ /**
+ * droitExtrait getter
+ * @return droitExtrait
+ */
+ public Boolean getDroitExtrait() {
+ return droitExtrait;
+ }
- /**
- * droitExtrait setter
- * @param droitExtrait droitExtrait
- */
- public void setDroitExtrait(Boolean droitExtrait) {
- this.droitExtrait = droitExtrait;
- }
+ /**
+ * droitExtrait setter
+ * @param droitExtrait droitExtrait
+ */
+ public void setDroitExtrait(Boolean droitExtrait) {
+ this.droitExtrait = droitExtrait;
+ }
- /**
- * droitPuri getter
- * @return droitPuri
- */
- public Boolean getDroitPuri() {
- return droitPuri;
- }
+ /**
+ * droitPuri getter
+ * @return droitPuri
+ */
+ public Boolean getDroitPuri() {
+ return droitPuri;
+ }
- /**
- * droitPuri setter
- * @param droitPuri droitPuri
- */
- public void setDroitPuri(Boolean droitPuri) {
- this.droitPuri = droitPuri;
- }
+ /**
+ * droitPuri setter
+ * @param droitPuri droitPuri
+ */
+ public void setDroitPuri(Boolean droitPuri) {
+ this.droitPuri = droitPuri;
+ }
- /**
- * droitRecolte getter
- * @return droitRecolte
- */
- public Boolean getDroitRecolte() {
- return droitRecolte;
- }
+ /**
+ * droitRecolte getter
+ * @return droitRecolte
+ */
+ public Boolean getDroitRecolte() {
+ return droitRecolte;
+ }
- /**
- * droitRecolte setter
- * @param droitRecolte droitRecolte
- */
- public void setDroitRecolte(Boolean droitRecolte) {
- this.droitRecolte = droitRecolte;
- }
+ /**
+ * droitRecolte setter
+ * @param droitRecolte droitRecolte
+ */
+ public void setDroitRecolte(Boolean droitRecolte) {
+ this.droitRecolte = droitRecolte;
+ }
- /**
- * droitTestBio getter
- * @return droitTestBio
- */
- public Boolean getDroitTestBio() {
- return droitTestBio;
- }
+ /**
+ * droitTestBio getter
+ * @return droitTestBio
+ */
+ public Boolean getDroitTestBio() {
+ return droitTestBio;
+ }
- /**
- * droitTestBio setter
- * @param droitTestBio droitTestBio
- */
- public void setDroitTestBio(Boolean droitTestBio) {
- this.droitTestBio = droitTestBio;
- }
+ /**
+ * droitTestBio setter
+ * @param droitTestBio droitTestBio
+ */
+ public void setDroitTestBio(Boolean droitTestBio) {
+ this.droitTestBio = droitTestBio;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ErreurTestBio.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ErreurTestBio.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ErreurTestBio.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,79 +45,79 @@
@Table(uniqueConstraints = @UniqueConstraint(columnNames = "nom"))
public class ErreurTestBio extends AbstractModel implements Comparable<ErreurTestBio> {
- /** Id de l'erreur */
- @Id
- @GeneratedValue
- private Integer idErreurTest;
+ /** Id de l'erreur */
+ @Id
+ @GeneratedValue
+ private Integer idErreurTest;
- /** Nom */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String nom;
+ /** Nom */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String nom;
- /** Description */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- @NotEmpty
- private String description;
+ /** Description */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ @NotEmpty
+ private String description;
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(ErreurTestBio erreurTest) {
- return new BeanComparator("nom").compare(this, erreurTest);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(ErreurTestBio erreurTest) {
+ return new BeanComparator("nom").compare(this, erreurTest);
+ }
- /**
- * idErreurTest getter
- * @return idErreurTest
- */
- public Integer getIdErreurTest() {
- return idErreurTest;
- }
+ /**
+ * idErreurTest getter
+ * @return idErreurTest
+ */
+ public Integer getIdErreurTest() {
+ return idErreurTest;
+ }
- /**
- * idErreurTest setter
- * @param idErreurTest idErreurTest
- */
- public void setIdErreurTest(Integer idErreurTest) {
- this.idErreurTest = idErreurTest;
- }
+ /**
+ * idErreurTest setter
+ * @param idErreurTest idErreurTest
+ */
+ public void setIdErreurTest(Integer idErreurTest) {
+ this.idErreurTest = idErreurTest;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extraction.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extraction.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extraction.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -75,254 +75,254 @@
})
public class Extraction extends AbstractModel implements Comparable<Extraction> {
- /** Id de l'extraction */
- @Id
- @GeneratedValue
- private Integer idExtraction;
+ /** Id de l'extraction */
+ @Id
+ @GeneratedValue
+ private Integer idExtraction;
- /** Référence de la manip */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Référence de la manip */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Manipulateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Personne manipulateur;
+ /** Manipulateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Personne manipulateur;
- /** Méthode pour l'extraction **/
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- private MethodeExtraction methode;
+ /** Méthode pour l'extraction **/
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ private MethodeExtraction methode;
- /** Date de la manip */
- @NotNull
- @Temporal(TemporalType.DATE)
- private Date date;
+ /** Date de la manip */
+ @NotNull
+ @Temporal(TemporalType.DATE)
+ private Date date;
- /** Lot utilisé pour l'extraction **/
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded(depth=1)
- private Lot lot;
+ /** Lot utilisé pour l'extraction **/
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded(depth=1)
+ private Lot lot;
- /** Masse avant l'extraction **/
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal masseDepart;
+ /** Masse avant l'extraction **/
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal masseDepart;
- /** Commentaire pour la manip */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Commentaire pour la manip */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- @IndexedEmbedded
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @IndexedEmbedded
+ private Personne createur;
- /** Extraits produits par l'extraction */
- @NotNull
- @OneToMany(mappedBy = "extraction", fetch = FetchType.EAGER, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- @ContainedIn
- private List<Extrait> extraits;
+ /** Extraits produits par l'extraction */
+ @NotNull
+ @OneToMany(mappedBy = "extraction", fetch = FetchType.EAGER, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ @ContainedIn
+ private List<Extrait> extraits;
- /**
- * Constructeur
- */
- public Extraction() {
- extraits = new ArrayList<Extrait>();
- }
+ /**
+ * Constructeur
+ */
+ public Extraction() {
+ extraits = new ArrayList<Extrait>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Extraction extraction) {
- ComparatorChain comparatorChain = new ComparatorChain();
- comparatorChain.addComparator(new BeanComparator("lot"));
- comparatorChain.addComparator(new BeanComparator("ref"));
- return comparatorChain.compare(this, extraction);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Extraction extraction) {
+ ComparatorChain comparatorChain = new ComparatorChain();
+ comparatorChain.addComparator(new BeanComparator("lot"));
+ comparatorChain.addComparator(new BeanComparator("ref"));
+ return comparatorChain.compare(this, extraction);
+ }
- /**
- * Rend les extraits triés en utilisant le comparateur {@link ExtraitsOfExtractionComp}
- * @return resultats
- */
- public List<Extrait> getSortedExtraits() {
- // comme "@Sort(type = SortType.COMPARATOR, comparator = ExtraitsOfExtractionComp.class)" ne rend pas une
- // liste triée avec List, tri dans le getter
- Collections.sort(extraits, new ExtraitsOfExtractionComp());
- return extraits;
- }
+ /**
+ * Rend les extraits triés en utilisant le comparateur {@link ExtraitsOfExtractionComp}
+ * @return resultats
+ */
+ public List<Extrait> getSortedExtraits() {
+ // comme "@Sort(type = SortType.COMPARATOR, comparator = ExtraitsOfExtractionComp.class)" ne rend pas une
+ // liste triée avec List, tri dans le getter
+ Collections.sort(extraits, new ExtraitsOfExtractionComp());
+ return extraits;
+ }
- /**
- * idExtraction getter
- * @return idExtraction
- */
- public Integer getIdExtraction() {
- return idExtraction;
- }
+ /**
+ * idExtraction getter
+ * @return idExtraction
+ */
+ public Integer getIdExtraction() {
+ return idExtraction;
+ }
- /**
- * idExtraction setter
- * @param idExtraction idExtraction
- */
- public void setIdExtraction(Integer idExtraction) {
- this.idExtraction = idExtraction;
- }
+ /**
+ * idExtraction setter
+ * @param idExtraction idExtraction
+ */
+ public void setIdExtraction(Integer idExtraction) {
+ this.idExtraction = idExtraction;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * manipulateur getter
- * @return manipulateur
- */
- public Personne getManipulateur() {
- return manipulateur;
- }
+ /**
+ * manipulateur getter
+ * @return manipulateur
+ */
+ public Personne getManipulateur() {
+ return manipulateur;
+ }
- /**
- * manipulateur setter
- * @param manipulateur manipulateur
- */
- public void setManipulateur(Personne manipulateur) {
- this.manipulateur = manipulateur;
- }
+ /**
+ * manipulateur setter
+ * @param manipulateur manipulateur
+ */
+ public void setManipulateur(Personne manipulateur) {
+ this.manipulateur = manipulateur;
+ }
- /**
- * methode getter
- * @return methode
- */
- public MethodeExtraction getMethode() {
- return methode;
- }
+ /**
+ * methode getter
+ * @return methode
+ */
+ public MethodeExtraction getMethode() {
+ return methode;
+ }
- /**
- * methode setter
- * @param methode methode
- */
- public void setMethode(MethodeExtraction methode) {
- this.methode = methode;
- }
+ /**
+ * methode setter
+ * @param methode methode
+ */
+ public void setMethode(MethodeExtraction methode) {
+ this.methode = methode;
+ }
- /**
- * date getter
- * @return date
- */
- public Date getDate() {
- return date;
- }
+ /**
+ * date getter
+ * @return date
+ */
+ public Date getDate() {
+ return date;
+ }
- /**
- * date setter
- * @param date date
- */
- public void setDate(Date date) {
- this.date = date;
- }
+ /**
+ * date setter
+ * @param date date
+ */
+ public void setDate(Date date) {
+ this.date = date;
+ }
- /**
- * lot getter
- * @return lot
- */
- public Lot getLot() {
- return lot;
- }
+ /**
+ * lot getter
+ * @return lot
+ */
+ public Lot getLot() {
+ return lot;
+ }
- /**
- * lot setter
- * @param lot lot
- */
- public void setLot(Lot lot) {
- this.lot = lot;
- }
+ /**
+ * lot setter
+ * @param lot lot
+ */
+ public void setLot(Lot lot) {
+ this.lot = lot;
+ }
- /**
- * masseDepart getter
- * @return masseDepart
- */
- public BigDecimal getMasseDepart() {
- return masseDepart;
- }
+ /**
+ * masseDepart getter
+ * @return masseDepart
+ */
+ public BigDecimal getMasseDepart() {
+ return masseDepart;
+ }
- /**
- * masseDepart setter
- * @param masseDepart masseDepart
- */
- public void setMasseDepart(BigDecimal masseDepart) {
- this.masseDepart = masseDepart;
- }
+ /**
+ * masseDepart setter
+ * @param masseDepart masseDepart
+ */
+ public void setMasseDepart(BigDecimal masseDepart) {
+ this.masseDepart = masseDepart;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * extraits getter
- * @return extraits
- */
- public List<Extrait> getExtraits() {
- return extraits;
- }
+ /**
+ * extraits getter
+ * @return extraits
+ */
+ public List<Extrait> getExtraits() {
+ return extraits;
+ }
- /**
- * extraits setter
- * @param extraits extraits
- */
- public void setExtraits(List<Extrait> extraits) {
- this.extraits = extraits;
- }
+ /**
+ * extraits setter
+ * @param extraits extraits
+ */
+ public void setExtraits(List<Extrait> extraits) {
+ this.extraits = extraits;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extrait.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extrait.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Extrait.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,90 +41,90 @@
@Embeddable
public class Extrait extends Produit {
- /** Type d'extrait */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- private TypeExtrait typeExtrait;
+ /** Type d'extrait */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ private TypeExtrait typeExtrait;
- /** Manip d'extraction dont fait partie l'extrait */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded
- private Extraction extraction;
+ /** Manip d'extraction dont fait partie l'extrait */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded
+ private Extraction extraction;
- /**
- * Constructor
- */
- public Extrait() {
- super();
- }
+ /**
+ * Constructor
+ */
+ public Extrait() {
+ super();
+ }
- /**
- * Rend le rendement calculé pour l'extrait (masseObtenue / masseDepart)
- * @return le résultat ou null si les valeurs actuelles ne donnent pas un résultat cohérent
- */
- public Float getRendement() {
- if (getExtraction() != null && getExtraction().getMasseDepart() != null
- && getExtraction().getMasseDepart().floatValue() != 0f && getMasseObtenue() != null) {
- Float rendement = getMasseObtenue().floatValue() / getExtraction().getMasseDepart().floatValue();
- if (rendement <= 1f && rendement >= 0) {
- return rendement;
- }
- }
- return null;
- }
+ /**
+ * Rend le rendement calculé pour l'extrait (masseObtenue / masseDepart)
+ * @return le résultat ou null si les valeurs actuelles ne donnent pas un résultat cohérent
+ */
+ public Float getRendement() {
+ if (getExtraction() != null && getExtraction().getMasseDepart() != null
+ && getExtraction().getMasseDepart().floatValue() != 0f && getMasseObtenue() != null) {
+ Float rendement = getMasseObtenue().floatValue() / getExtraction().getMasseDepart().floatValue();
+ if (rendement <= 1f && rendement >= 0) {
+ return rendement;
+ }
+ }
+ return null;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isExtrait() {
- return true;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isExtrait() {
+ return true;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isFraction() {
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isFraction() {
+ return false;
+ }
- /** {@inheritDoc} */
- @Override
- public Extrait clone() throws CloneNotSupportedException {
- Extrait clone = (Extrait) super.clone();
- clone.typeExtrait = typeExtrait;
- clone.extraction = extraction;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Extrait clone() throws CloneNotSupportedException {
+ Extrait clone = (Extrait) super.clone();
+ clone.typeExtrait = typeExtrait;
+ clone.extraction = extraction;
+ return clone;
+ }
- /**
- * typeExtrait getter
- * @return typeExtrait
- */
- public TypeExtrait getTypeExtrait() {
- return typeExtrait;
- }
+ /**
+ * typeExtrait getter
+ * @return typeExtrait
+ */
+ public TypeExtrait getTypeExtrait() {
+ return typeExtrait;
+ }
- /**
- * typeExtrait setter
- * @param typeExtrait typeExtrait
- */
- public void setTypeExtrait(TypeExtrait typeExtrait) {
- this.typeExtrait = typeExtrait;
- }
+ /**
+ * typeExtrait setter
+ * @param typeExtrait typeExtrait
+ */
+ public void setTypeExtrait(TypeExtrait typeExtrait) {
+ this.typeExtrait = typeExtrait;
+ }
- /**
- * extraction getter
- * @return extraction
- */
- public Extraction getExtraction() {
- return extraction;
- }
+ /**
+ * extraction getter
+ * @return extraction
+ */
+ public Extraction getExtraction() {
+ return extraction;
+ }
- /**
- * extraction setter
- * @param extraction extraction
- */
- public void setExtraction(Extraction extraction) {
- this.extraction = extraction;
- }
+ /**
+ * extraction setter
+ * @param extraction extraction
+ */
+ public void setExtraction(Extraction extraction) {
+ this.extraction = extraction;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Fraction.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Fraction.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Fraction.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -43,93 +43,93 @@
@Embeddable
public class Fraction extends Produit {
- /** indice de la fraction */
- @Length(max = 5)
- @NotEmpty
- private String indice;
+ /** indice de la fraction */
+ @Length(max = 5)
+ @NotEmpty
+ private String indice;
- // purification doit être à EAGER sinon dans certains cas, setProduit de ResultatTestBio rend une
- // LazyInitializationException (les setters semble être effectués après la requête http et par conséquent une fois
- // la session hibernate fermée)
- /** Manip de purification dont fait partie la fraction */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded
- private Purification purification;
+ // purification doit être à EAGER sinon dans certains cas, setProduit de ResultatTestBio rend une
+ // LazyInitializationException (les setters semble être effectués après la requête http et par conséquent une fois
+ // la session hibernate fermée)
+ /** Manip de purification dont fait partie la fraction */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded
+ private Purification purification;
- /**
- * Constructor
- */
- public Fraction() {
- super();
- }
+ /**
+ * Constructor
+ */
+ public Fraction() {
+ super();
+ }
- /**
- * Rend le rendement calculé pour la fraction (masseObtenue / masseDepart)
- * @return le résultat ou null si les valeurs actuelles ne donnent pas un résultat cohérent
- */
- public Float getRendement() {
- if (getPurification() != null && getPurification().getMasseDepart() != null
- && getPurification().getMasseDepart().floatValue() != 0f && getMasseObtenue() != null) {
- Float rendement = getMasseObtenue().floatValue() / getPurification().getMasseDepart().floatValue();
- if (rendement <= 1f && rendement >= 0) {
- return rendement;
- }
- }
- return null;
- }
+ /**
+ * Rend le rendement calculé pour la fraction (masseObtenue / masseDepart)
+ * @return le résultat ou null si les valeurs actuelles ne donnent pas un résultat cohérent
+ */
+ public Float getRendement() {
+ if (getPurification() != null && getPurification().getMasseDepart() != null
+ && getPurification().getMasseDepart().floatValue() != 0f && getMasseObtenue() != null) {
+ Float rendement = getMasseObtenue().floatValue() / getPurification().getMasseDepart().floatValue();
+ if (rendement <= 1f && rendement >= 0) {
+ return rendement;
+ }
+ }
+ return null;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isExtrait() {
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isExtrait() {
+ return false;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isFraction() {
- return true;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isFraction() {
+ return true;
+ }
- /** {@inheritDoc} */
- @Override
- public Fraction clone() throws CloneNotSupportedException {
- Fraction clone = (Fraction) super.clone();
- clone.indice = indice;
- clone.purification = purification;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Fraction clone() throws CloneNotSupportedException {
+ Fraction clone = (Fraction) super.clone();
+ clone.indice = indice;
+ clone.purification = purification;
+ return clone;
+ }
- /**
- * indice getter
- * @return indice
- */
- public String getIndice() {
- return indice;
- }
+ /**
+ * indice getter
+ * @return indice
+ */
+ public String getIndice() {
+ return indice;
+ }
- /**
- * indice setter
- * @param indice indice
- */
- public void setIndice(String indice) {
- this.indice = indice;
- }
+ /**
+ * indice setter
+ * @param indice indice
+ */
+ public void setIndice(String indice) {
+ this.indice = indice;
+ }
- /**
- * purification getter
- * @return purification
- */
- public Purification getPurification() {
- return purification;
- }
+ /**
+ * purification getter
+ * @return purification
+ */
+ public Purification getPurification() {
+ return purification;
+ }
- /**
- * purification setter
- * @param purification purification
- */
- public void setPurification(Purification purification) {
- this.purification = purification;
- }
+ /**
+ * purification setter
+ * @param purification purification
+ */
+ public void setPurification(Purification purification) {
+ this.purification = purification;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Groupe.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Groupe.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Groupe.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,146 +49,146 @@
@Table
public class Groupe extends AbstractModel {
- /** Droits sur les campagnes */
- @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
- @NotNull
- private List<CampagneGroupeDroits> campagnesDroits;
+ /** Droits sur les campagnes */
+ @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
+ @NotNull
+ private List<CampagneGroupeDroits> campagnesDroits;
- /** Description */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Groupe */
- @Id
- @GeneratedValue
- private Integer idGroupe;
+ /** Groupe */
+ @Id
+ @GeneratedValue
+ private Integer idGroupe;
- /** Droits sur les lots */
- @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
- @NotNull
- private List<LotGroupeDroits> lotsDroits;
+ /** Droits sur les lots */
+ @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
+ @NotNull
+ private List<LotGroupeDroits> lotsDroits;
- /** Nom */
- @Column(unique = true)
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String nom;
+ /** Nom */
+ @Column(unique = true)
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String nom;
- /** Utilisateurs */
- @OneToMany(mappedBy = "groupe", fetch = FetchType.LAZY)
- @NotNull
- private List<Utilisateur> utilisateurs;
+ /** Utilisateurs */
+ @OneToMany(mappedBy = "groupe", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Utilisateur> utilisateurs;
- /**
- * Constructeur
- */
- public Groupe() {
- utilisateurs = new ArrayList<Utilisateur>();
- campagnesDroits = new ArrayList<CampagneGroupeDroits>();
- lotsDroits = new ArrayList<LotGroupeDroits>();
- }
+ /**
+ * Constructeur
+ */
+ public Groupe() {
+ utilisateurs = new ArrayList<Utilisateur>();
+ campagnesDroits = new ArrayList<CampagneGroupeDroits>();
+ lotsDroits = new ArrayList<LotGroupeDroits>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /**
- * campagnesDroits getter
- * @return campagnesDroits
- */
- public List<CampagneGroupeDroits> getCampagnesDroits() {
- return campagnesDroits;
- }
+ /**
+ * campagnesDroits getter
+ * @return campagnesDroits
+ */
+ public List<CampagneGroupeDroits> getCampagnesDroits() {
+ return campagnesDroits;
+ }
- /**
- * campagnesDroits setter
- * @param campagnesDroits campagnesDroits
- */
- public void setCampagnesDroits(List<CampagneGroupeDroits> campagnesDroits) {
- this.campagnesDroits = campagnesDroits;
- }
+ /**
+ * campagnesDroits setter
+ * @param campagnesDroits campagnesDroits
+ */
+ public void setCampagnesDroits(List<CampagneGroupeDroits> campagnesDroits) {
+ this.campagnesDroits = campagnesDroits;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * idGroupe getter
- * @return idGroupe
- */
- public Integer getIdGroupe() {
- return idGroupe;
- }
+ /**
+ * idGroupe getter
+ * @return idGroupe
+ */
+ public Integer getIdGroupe() {
+ return idGroupe;
+ }
- /**
- * idGroupe setter
- * @param idGroupe idGroupe
- */
- public void setIdGroupe(Integer idGroupe) {
- this.idGroupe = idGroupe;
- }
+ /**
+ * idGroupe setter
+ * @param idGroupe idGroupe
+ */
+ public void setIdGroupe(Integer idGroupe) {
+ this.idGroupe = idGroupe;
+ }
- /**
- * lotsDroits getter
- * @return lotsDroits
- */
- public List<LotGroupeDroits> getLotsDroits() {
- return lotsDroits;
- }
+ /**
+ * lotsDroits getter
+ * @return lotsDroits
+ */
+ public List<LotGroupeDroits> getLotsDroits() {
+ return lotsDroits;
+ }
- /**
- * lotsDroits setter
- * @param lotsDroits lotsDroits
- */
- public void setLotsDroits(List<LotGroupeDroits> lotsDroits) {
- this.lotsDroits = lotsDroits;
- }
+ /**
+ * lotsDroits setter
+ * @param lotsDroits lotsDroits
+ */
+ public void setLotsDroits(List<LotGroupeDroits> lotsDroits) {
+ this.lotsDroits = lotsDroits;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * utilisateurs getter
- * @return utilisateurs
- */
- public List<Utilisateur> getUtilisateurs() {
- return utilisateurs;
- }
+ /**
+ * utilisateurs getter
+ * @return utilisateurs
+ */
+ public List<Utilisateur> getUtilisateurs() {
+ return utilisateurs;
+ }
- /**
- * utilisateurs setter
- * @param utilisateurs utilisateurs
- */
- public void setUtilisateurs(List<Utilisateur> utilisateurs) {
- this.utilisateurs = utilisateurs;
- }
+ /**
+ * utilisateurs setter
+ * @param utilisateurs utilisateurs
+ */
+ public void setUtilisateurs(List<Utilisateur> utilisateurs) {
+ this.utilisateurs = utilisateurs;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Lot.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Lot.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Lot.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -75,386 +75,386 @@
})
public class Lot extends AbstractModel implements Comparable<Lot> {
- /** ID */
- @Id
- @GeneratedValue
- private Integer idLot;
+ /** ID */
+ @Id
+ @GeneratedValue
+ private Integer idLot;
- /** Référence */
- @Column(unique = true)
- @NotEmpty
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Référence */
+ @Column(unique = true)
+ @NotEmpty
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Campagne */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded(depth=1)
- private Campagne campagne;
+ /** Campagne */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded(depth=1)
+ private Campagne campagne;
- /** complement */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** complement */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** createur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- @IndexedEmbedded
- private Personne createur;
+ /** createur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @IndexedEmbedded
+ private Personne createur;
- /** Date */
- @Past
- @Temporal(TemporalType.DATE)
- @NotNull
- private Date dateRecolte;
+ /** Date */
+ @Past
+ @Temporal(TemporalType.DATE)
+ @NotNull
+ private Date dateRecolte;
- /** Echantillon collecté */
- @NotNull
- private Boolean echantillonColl;
+ /** Echantillon collecté */
+ @NotNull
+ private Boolean echantillonColl;
- /** Echantillon identifié */
- @NotNull
- private Boolean echantillonIdent;
+ /** Echantillon identifié */
+ @NotNull
+ private Boolean echantillonIdent;
- /** Echantillon phylo */
- @NotNull
- private Boolean echantillonPhylo;
+ /** Echantillon phylo */
+ @NotNull
+ private Boolean echantillonPhylo;
- /** Droits attribués aux groupes */
- @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
- @NotNull
- private List<LotGroupeDroits> groupesDroits;
+ /** Droits attribués aux groupes */
+ @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
+ @NotNull
+ private List<LotGroupeDroits> groupesDroits;
- /** Masse fraîche */
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal masseFraiche;
+ /** Masse fraîche */
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal masseFraiche;
- /** Masse sèche */
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal masseSeche;
+ /** Masse sèche */
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal masseSeche;
- /** Partie */
- @ManyToOne(fetch = FetchType.EAGER, optional = true)
- private Partie partie;
+ /** Partie */
+ @ManyToOne(fetch = FetchType.EAGER, optional = true)
+ private Partie partie;
- /** Droits attribués aux personnes */
- @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
- @NotNull
- private List<LotPersonneDroits> personnesDroits;
+ /** Droits attribués aux personnes */
+ @OneToMany(mappedBy = "id.pk1", fetch = FetchType.LAZY)
+ @NotNull
+ private List<LotPersonneDroits> personnesDroits;
- /** Spécimen source */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded(depth=1)
- private Specimen specimenRef;
+ /** Spécimen source */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded(depth=1)
+ private Specimen specimenRef;
- /** Station */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded(depth=1)
- private Station station;
+ /** Station */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded(depth=1)
+ private Station station;
- /** Extractions provenants du lot */
- @OneToMany(mappedBy = "lot", fetch = FetchType.LAZY)
- @NotNull
- private List<Extraction> extractions;
+ /** Extractions provenants du lot */
+ @OneToMany(mappedBy = "lot", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Extraction> extractions;
- /**
- * Constructeur
- */
- public Lot() {
- personnesDroits = new ArrayList<LotPersonneDroits>();
- groupesDroits = new ArrayList<LotGroupeDroits>();
- extractions = new ArrayList<Extraction>();
- }
+ /**
+ * Constructeur
+ */
+ public Lot() {
+ personnesDroits = new ArrayList<LotPersonneDroits>();
+ groupesDroits = new ArrayList<LotGroupeDroits>();
+ extractions = new ArrayList<Extraction>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Lot lot) {
- return new BeanComparator("ref").compare(this, lot);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Lot lot) {
+ return new BeanComparator("ref").compare(this, lot);
+ }
- /**
- * campagne getter
- * @return campagne
- */
- public Campagne getCampagne() {
- return campagne;
- }
+ /**
+ * campagne getter
+ * @return campagne
+ */
+ public Campagne getCampagne() {
+ return campagne;
+ }
- /**
- * campagne setter
- * @param campagne campagne
- */
- public void setCampagne(Campagne campagne) {
- this.campagne = campagne;
- }
+ /**
+ * campagne setter
+ * @param campagne campagne
+ */
+ public void setCampagne(Campagne campagne) {
+ this.campagne = campagne;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * dateRecolte getter
- * @return dateRecolte
- */
- public Date getDateRecolte() {
- return dateRecolte;
- }
+ /**
+ * dateRecolte getter
+ * @return dateRecolte
+ */
+ public Date getDateRecolte() {
+ return dateRecolte;
+ }
- /**
- * dateRecolte setter
- * @param dateRecolte dateRecolte
- */
- public void setDateRecolte(Date dateRecolte) {
- this.dateRecolte = dateRecolte;
- }
+ /**
+ * dateRecolte setter
+ * @param dateRecolte dateRecolte
+ */
+ public void setDateRecolte(Date dateRecolte) {
+ this.dateRecolte = dateRecolte;
+ }
- /**
- * echantillonColl getter
- * @return echantillonColl
- */
- public Boolean getEchantillonColl() {
- return echantillonColl;
- }
+ /**
+ * echantillonColl getter
+ * @return echantillonColl
+ */
+ public Boolean getEchantillonColl() {
+ return echantillonColl;
+ }
- /**
- * echantillonColl setter
- * @param echantillonColl echantillonColl
- */
- public void setEchantillonColl(Boolean echantillonColl) {
- this.echantillonColl = echantillonColl;
- }
+ /**
+ * echantillonColl setter
+ * @param echantillonColl echantillonColl
+ */
+ public void setEchantillonColl(Boolean echantillonColl) {
+ this.echantillonColl = echantillonColl;
+ }
- /**
- * echantillonIdent getter
- * @return echantillonIdent
- */
- public Boolean getEchantillonIdent() {
- return echantillonIdent;
- }
+ /**
+ * echantillonIdent getter
+ * @return echantillonIdent
+ */
+ public Boolean getEchantillonIdent() {
+ return echantillonIdent;
+ }
- /**
- * echantillonIdent setter
- * @param echantillonIdent echantillonIdent
- */
- public void setEchantillonIdent(Boolean echantillonIdent) {
- this.echantillonIdent = echantillonIdent;
- }
+ /**
+ * echantillonIdent setter
+ * @param echantillonIdent echantillonIdent
+ */
+ public void setEchantillonIdent(Boolean echantillonIdent) {
+ this.echantillonIdent = echantillonIdent;
+ }
- /**
- * echantillonPhylo getter
- * @return echantillonPhylo
- */
- public Boolean getEchantillonPhylo() {
- return echantillonPhylo;
- }
+ /**
+ * echantillonPhylo getter
+ * @return echantillonPhylo
+ */
+ public Boolean getEchantillonPhylo() {
+ return echantillonPhylo;
+ }
- /**
- * echantillonPhylo setter
- * @param echantillonPhylo echantillonPhylo
- */
- public void setEchantillonPhylo(Boolean echantillonPhylo) {
- this.echantillonPhylo = echantillonPhylo;
- }
+ /**
+ * echantillonPhylo setter
+ * @param echantillonPhylo echantillonPhylo
+ */
+ public void setEchantillonPhylo(Boolean echantillonPhylo) {
+ this.echantillonPhylo = echantillonPhylo;
+ }
- /**
- * groupesDroits getter
- * @return groupesDroits
- */
- public List<LotGroupeDroits> getGroupesDroits() {
- return groupesDroits;
- }
+ /**
+ * groupesDroits getter
+ * @return groupesDroits
+ */
+ public List<LotGroupeDroits> getGroupesDroits() {
+ return groupesDroits;
+ }
- /**
- * groupesDroits setter
- * @param groupesDroits groupesDroits
- */
- public void setGroupesDroits(List<LotGroupeDroits> groupesDroits) {
- this.groupesDroits = groupesDroits;
- }
+ /**
+ * groupesDroits setter
+ * @param groupesDroits groupesDroits
+ */
+ public void setGroupesDroits(List<LotGroupeDroits> groupesDroits) {
+ this.groupesDroits = groupesDroits;
+ }
- /**
- * idLot getter
- * @return idLot
- */
- public Integer getIdLot() {
- return idLot;
- }
+ /**
+ * idLot getter
+ * @return idLot
+ */
+ public Integer getIdLot() {
+ return idLot;
+ }
- /**
- * idLot setter
- * @param idLot idLot
- */
- public void setIdLot(Integer idLot) {
- this.idLot = idLot;
- }
+ /**
+ * idLot setter
+ * @param idLot idLot
+ */
+ public void setIdLot(Integer idLot) {
+ this.idLot = idLot;
+ }
- /**
- * masseFraiche getter
- * @return masseFraiche
- */
- public BigDecimal getMasseFraiche() {
- return masseFraiche;
- }
+ /**
+ * masseFraiche getter
+ * @return masseFraiche
+ */
+ public BigDecimal getMasseFraiche() {
+ return masseFraiche;
+ }
- /**
- * masseFraiche setter
- * @param masseFraiche masseFraiche
- */
- public void setMasseFraiche(BigDecimal masseFraiche) {
- this.masseFraiche = masseFraiche;
- }
+ /**
+ * masseFraiche setter
+ * @param masseFraiche masseFraiche
+ */
+ public void setMasseFraiche(BigDecimal masseFraiche) {
+ this.masseFraiche = masseFraiche;
+ }
- /**
- * masseSeche getter
- * @return masseSeche
- */
- public BigDecimal getMasseSeche() {
- return masseSeche;
- }
+ /**
+ * masseSeche getter
+ * @return masseSeche
+ */
+ public BigDecimal getMasseSeche() {
+ return masseSeche;
+ }
- /**
- * masseSeche setter
- * @param masseSeche masseSeche
- */
- public void setMasseSeche(BigDecimal masseSeche) {
- this.masseSeche = masseSeche;
- }
+ /**
+ * masseSeche setter
+ * @param masseSeche masseSeche
+ */
+ public void setMasseSeche(BigDecimal masseSeche) {
+ this.masseSeche = masseSeche;
+ }
- /**
- * partie getter
- * @return partie
- */
- public Partie getPartie() {
- return partie;
- }
+ /**
+ * partie getter
+ * @return partie
+ */
+ public Partie getPartie() {
+ return partie;
+ }
- /**
- * partie setter
- * @param partie partie
- */
- public void setPartie(Partie partie) {
- this.partie = partie;
- }
+ /**
+ * partie setter
+ * @param partie partie
+ */
+ public void setPartie(Partie partie) {
+ this.partie = partie;
+ }
- /**
- * personnesDroits getter
- * @return personnesDroits
- */
- public List<LotPersonneDroits> getPersonnesDroits() {
- return personnesDroits;
- }
+ /**
+ * personnesDroits getter
+ * @return personnesDroits
+ */
+ public List<LotPersonneDroits> getPersonnesDroits() {
+ return personnesDroits;
+ }
- /**
- * personnesDroits setter
- * @param personnesDroits personnesDroits
- */
- public void setPersonnesDroits(List<LotPersonneDroits> personnesDroits) {
- this.personnesDroits = personnesDroits;
- }
+ /**
+ * personnesDroits setter
+ * @param personnesDroits personnesDroits
+ */
+ public void setPersonnesDroits(List<LotPersonneDroits> personnesDroits) {
+ this.personnesDroits = personnesDroits;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * specimenRef getter
- * @return specimenRef
- */
- public Specimen getSpecimenRef() {
- return specimenRef;
- }
+ /**
+ * specimenRef getter
+ * @return specimenRef
+ */
+ public Specimen getSpecimenRef() {
+ return specimenRef;
+ }
- /**
- * specimenRef setter
- * @param specimenRef specimenRef
- */
- public void setSpecimenRef(Specimen specimenRef) {
- this.specimenRef = specimenRef;
- }
+ /**
+ * specimenRef setter
+ * @param specimenRef specimenRef
+ */
+ public void setSpecimenRef(Specimen specimenRef) {
+ this.specimenRef = specimenRef;
+ }
- /**
- * station getter
- * @return station
- */
- public Station getStation() {
- return station;
- }
+ /**
+ * station getter
+ * @return station
+ */
+ public Station getStation() {
+ return station;
+ }
- /**
- * station setter
- * @param station station
- */
- public void setStation(Station station) {
- this.station = station;
- }
+ /**
+ * station setter
+ * @param station station
+ */
+ public void setStation(Station station) {
+ this.station = station;
+ }
- /**
- * extractions getter
- * @return extractions
- */
- public List<Extraction> getExtractions() {
- return extractions;
- }
+ /**
+ * extractions getter
+ * @return extractions
+ */
+ public List<Extraction> getExtractions() {
+ return extractions;
+ }
- /**
- * extractions setter
- * @param extractions extractions
- */
- public void setExtractions(List<Extraction> extractions) {
- this.extractions = extractions;
- }
+ /**
+ * extractions setter
+ * @param extractions extractions
+ */
+ public void setExtractions(List<Extraction> extractions) {
+ this.extractions = extractions;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotGroupeDroits.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotGroupeDroits.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotGroupeDroits.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,53 +38,53 @@
@Table
public class LotGroupeDroits extends AbstractModel {
- /** Droits */
- @NotNull
- private Droits droits;
+ /** Droits */
+ @NotNull
+ private Droits droits;
- /** ID */
- @EmbeddedId
- @NotNull
- private CompositeId<Lot, Groupe> id;
+ /** ID */
+ @EmbeddedId
+ @NotNull
+ private CompositeId<Lot, Groupe> id;
- /**
- * Constructeur
- */
- public LotGroupeDroits() {
- droits = new Droits();
- id = new CompositeId<Lot, Groupe>();
- }
+ /**
+ * Constructeur
+ */
+ public LotGroupeDroits() {
+ droits = new Droits();
+ id = new CompositeId<Lot, Groupe>();
+ }
- /**
- * droits getter
- * @return droits
- */
- public Droits getDroits() {
- return droits;
- }
+ /**
+ * droits getter
+ * @return droits
+ */
+ public Droits getDroits() {
+ return droits;
+ }
- /**
- * droits setter
- * @param droits droits
- */
- public void setDroits(Droits droits) {
- this.droits = droits;
- }
+ /**
+ * droits setter
+ * @param droits droits
+ */
+ public void setDroits(Droits droits) {
+ this.droits = droits;
+ }
- /**
- * id getter
- * @return id
- */
- public CompositeId<Lot, Groupe> getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public CompositeId<Lot, Groupe> getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(CompositeId<Lot, Groupe> id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(CompositeId<Lot, Groupe> id) {
+ this.id = id;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotPersonneDroits.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotPersonneDroits.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/LotPersonneDroits.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,62 +38,62 @@
@Table
public class LotPersonneDroits extends AbstractModel {
- /** Droits */
- @NotNull
- private Droits droits;
+ /** Droits */
+ @NotNull
+ private Droits droits;
- /** ID */
- @EmbeddedId
- @NotNull
- private CompositeId<Lot, Personne> id;
+ /** ID */
+ @EmbeddedId
+ @NotNull
+ private CompositeId<Lot, Personne> id;
- /**
- * Constructeur
- */
- public LotPersonneDroits() {
- droits = new Droits();
- id = new CompositeId<Lot, Personne>();
- }
+ /**
+ * Constructeur
+ */
+ public LotPersonneDroits() {
+ droits = new Droits();
+ id = new CompositeId<Lot, Personne>();
+ }
- /** {@inheritDoc} */
- @Override
- public final LotPersonneDroits clone() throws CloneNotSupportedException {
- LotPersonneDroits clone = new LotPersonneDroits();
- clone.id = id.clone();
- clone.droits = droits.clone();
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public final LotPersonneDroits clone() throws CloneNotSupportedException {
+ LotPersonneDroits clone = new LotPersonneDroits();
+ clone.id = id.clone();
+ clone.droits = droits.clone();
+ return clone;
+ }
- /**
- * droits getter
- * @return droits
- */
- public Droits getDroits() {
- return droits;
- }
+ /**
+ * droits getter
+ * @return droits
+ */
+ public Droits getDroits() {
+ return droits;
+ }
- /**
- * droits setter
- * @param droits droits
- */
- public void setDroits(Droits droits) {
- this.droits = droits;
- }
+ /**
+ * droits setter
+ * @param droits droits
+ */
+ public void setDroits(Droits droits) {
+ this.droits = droits;
+ }
- /**
- * id getter
- * @return id
- */
- public CompositeId<Lot, Personne> getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public CompositeId<Lot, Personne> getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(CompositeId<Lot, Personne> id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(CompositeId<Lot, Personne> id) {
+ this.id = id;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeExtraction.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeExtraction.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeExtraction.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -51,118 +51,118 @@
@Entity
public class MethodeExtraction extends AbstractModel implements Comparable<MethodeExtraction> {
- /** Id de la méthode */
- @Id
- @GeneratedValue
- private Integer idMethodeExtraction;
+ /** Id de la méthode */
+ @Id
+ @GeneratedValue
+ private Integer idMethodeExtraction;
- /** Nom de la méthode */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- private String nom;
+ /** Nom de la méthode */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ private String nom;
- /** Description de la méthode */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description de la méthode */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Types extraits définis en sortie pour la méthode */
- @OneToMany(mappedBy = "methodeExtraction", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- private List<TypeExtrait> typesEnSortie;
+ /** Types extraits définis en sortie pour la méthode */
+ @OneToMany(mappedBy = "methodeExtraction", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private List<TypeExtrait> typesEnSortie;
- /**
- * Constructor
- */
- public MethodeExtraction() {
- typesEnSortie = new ArrayList<TypeExtrait>();
- }
+ /**
+ * Constructor
+ */
+ public MethodeExtraction() {
+ typesEnSortie = new ArrayList<TypeExtrait>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(MethodeExtraction methodeExtraction) {
- return new BeanComparator("nom").compare(this, methodeExtraction);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(MethodeExtraction methodeExtraction) {
+ return new BeanComparator("nom").compare(this, methodeExtraction);
+ }
- /**
- * Rend les types d'extraits triés par initiales
- * @return Les types d'extraits
- */
- public List<TypeExtrait> getSortedTypesEnSortie() {
- Collections.sort(typesEnSortie);
- return typesEnSortie;
- }
+ /**
+ * Rend les types d'extraits triés par initiales
+ * @return Les types d'extraits
+ */
+ public List<TypeExtrait> getSortedTypesEnSortie() {
+ Collections.sort(typesEnSortie);
+ return typesEnSortie;
+ }
- /**
- * idMethodeExtraction getter
- * @return idMethodeExtraction
- */
- public Integer getIdMethodeExtraction() {
- return idMethodeExtraction;
- }
+ /**
+ * idMethodeExtraction getter
+ * @return idMethodeExtraction
+ */
+ public Integer getIdMethodeExtraction() {
+ return idMethodeExtraction;
+ }
- /**
- * idMethodeExtraction setter
- * @param idMethodeExtraction idMethodeExtraction
- */
- public void setIdMethodeExtraction(Integer idMethodeExtraction) {
- this.idMethodeExtraction = idMethodeExtraction;
- }
+ /**
+ * idMethodeExtraction setter
+ * @param idMethodeExtraction idMethodeExtraction
+ */
+ public void setIdMethodeExtraction(Integer idMethodeExtraction) {
+ this.idMethodeExtraction = idMethodeExtraction;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * typesEnSortie getter
- * @return typesEnSortie
- */
- public List<TypeExtrait> getTypesEnSortie() {
- return typesEnSortie;
- }
+ /**
+ * typesEnSortie getter
+ * @return typesEnSortie
+ */
+ public List<TypeExtrait> getTypesEnSortie() {
+ return typesEnSortie;
+ }
- /**
- * typesEnSortie setter
- * @param typesEnSortie typesEnSortie
- */
- public void setTypesEnSortie(List<TypeExtrait> typesEnSortie) {
- this.typesEnSortie = typesEnSortie;
- }
+ /**
+ * typesEnSortie setter
+ * @param typesEnSortie typesEnSortie
+ */
+ public void setTypesEnSortie(List<TypeExtrait> typesEnSortie) {
+ this.typesEnSortie = typesEnSortie;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodePurification.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodePurification.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodePurification.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -51,119 +51,119 @@
@Entity
public class MethodePurification extends AbstractModel implements Comparable<MethodePurification> {
- /** Id de la méthode */
- @Id
- @GeneratedValue
- private Integer idMethodePurification;
+ /** Id de la méthode */
+ @Id
+ @GeneratedValue
+ private Integer idMethodePurification;
- /** Nom de la méthode */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- private String nom;
+ /** Nom de la méthode */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ private String nom;
- /** Description de la méthode */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description de la méthode */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Types extraits définis en sortie pour la méthode */
- @OneToMany(mappedBy = "methodePurification", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- @OrderBy("index")
- private List<ParamMethoPuri> parametres;
+ /** Types extraits définis en sortie pour la méthode */
+ @OneToMany(mappedBy = "methodePurification", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ @OrderBy("index")
+ private List<ParamMethoPuri> parametres;
- /**
- * Constructor
- */
- public MethodePurification() {
- parametres = new ArrayList<ParamMethoPuri>();
- }
+ /**
+ * Constructor
+ */
+ public MethodePurification() {
+ parametres = new ArrayList<ParamMethoPuri>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(MethodePurification methodePurification) {
- return new BeanComparator("nom").compare(this, methodePurification);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(MethodePurification methodePurification) {
+ return new BeanComparator("nom").compare(this, methodePurification);
+ }
- /**
- * Rend les paramètres triés par index
- * @return Les paramètres
- */
- public List<ParamMethoPuri> getSortedParametres() {
- Collections.sort(parametres);
- return parametres;
- }
+ /**
+ * Rend les paramètres triés par index
+ * @return Les paramètres
+ */
+ public List<ParamMethoPuri> getSortedParametres() {
+ Collections.sort(parametres);
+ return parametres;
+ }
- /**
- * idMethodePurification getter
- * @return idMethodePurification
- */
- public Integer getIdMethodePurification() {
- return idMethodePurification;
- }
+ /**
+ * idMethodePurification getter
+ * @return idMethodePurification
+ */
+ public Integer getIdMethodePurification() {
+ return idMethodePurification;
+ }
- /**
- * idMethodePurification setter
- * @param idMethodePurification idMethodePurification
- */
- public void setIdMethodePurification(Integer idMethodePurification) {
- this.idMethodePurification = idMethodePurification;
- }
+ /**
+ * idMethodePurification setter
+ * @param idMethodePurification idMethodePurification
+ */
+ public void setIdMethodePurification(Integer idMethodePurification) {
+ this.idMethodePurification = idMethodePurification;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * parametres getter
- * @return parametres
- */
- public List<ParamMethoPuri> getParametres() {
- return parametres;
- }
+ /**
+ * parametres getter
+ * @return parametres
+ */
+ public List<ParamMethoPuri> getParametres() {
+ return parametres;
+ }
- /**
- * parametres setter
- * @param parametres parametres
- */
- public void setParametres(List<ParamMethoPuri> parametres) {
- this.parametres = parametres;
- }
+ /**
+ * parametres setter
+ * @param parametres parametres
+ */
+ public void setParametres(List<ParamMethoPuri> parametres) {
+ this.parametres = parametres;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeTestBio.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeTestBio.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/MethodeTestBio.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,188 +48,188 @@
@Embeddable
public class MethodeTestBio extends AbstractModel implements Comparable<MethodeTestBio> {
- /** Id de la méthode */
- @Id
- @GeneratedValue
- private Integer idMethodeTest;
+ /** Id de la méthode */
+ @Id
+ @GeneratedValue
+ private Integer idMethodeTest;
- /** Nom de la méthode */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String nom;
+ /** Nom de la méthode */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String nom;
- /** Cible pour un test (acronyme du nom de méthode) */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String cible;
+ /** Cible pour un test (acronyme du nom de méthode) */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String cible;
- /** Domaine de recherche pour le test */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String domaine;
+ /** Domaine de recherche pour le test */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String domaine;
- /** Description de la méthode */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description de la méthode */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Valeur mesurée pour la méthode */
- @Length(max = LENGTH_LONG_TEXT)
- @NotEmpty
- private String valeurMesuree;
+ /** Valeur mesurée pour la méthode */
+ @Length(max = LENGTH_LONG_TEXT)
+ @NotEmpty
+ private String valeurMesuree;
- /** Unité de mesure */
- @Length(max = LENGTH_TINY_TEXT)
- @NotEmpty
- private String uniteResultat;
+ /** Unité de mesure */
+ @Length(max = LENGTH_TINY_TEXT)
+ @NotEmpty
+ private String uniteResultat;
- /** Critère d'activité de la méthode */
- @Length(max = LENGTH_LONG_TEXT)
- private String critereActivite;
+ /** Critère d'activité de la méthode */
+ @Length(max = LENGTH_LONG_TEXT)
+ private String critereActivite;
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(MethodeTestBio methodeTest) {
- return new BeanComparator("nom").compare(this, methodeTest);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(MethodeTestBio methodeTest) {
+ return new BeanComparator("nom").compare(this, methodeTest);
+ }
- /**
- * idMethodeTest getter
- * @return idMethodeTest
- */
- public Integer getIdMethodeTest() {
- return idMethodeTest;
- }
+ /**
+ * idMethodeTest getter
+ * @return idMethodeTest
+ */
+ public Integer getIdMethodeTest() {
+ return idMethodeTest;
+ }
- /**
- * idMethodeTest setter
- * @param idMethodeTest idMethodeTest
- */
- public void setIdMethodeTest(Integer idMethodeTest) {
- this.idMethodeTest = idMethodeTest;
- }
+ /**
+ * idMethodeTest setter
+ * @param idMethodeTest idMethodeTest
+ */
+ public void setIdMethodeTest(Integer idMethodeTest) {
+ this.idMethodeTest = idMethodeTest;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * cible getter
- * @return cible
- */
- public String getCible() {
- return cible;
- }
+ /**
+ * cible getter
+ * @return cible
+ */
+ public String getCible() {
+ return cible;
+ }
- /**
- * cible setter
- * @param cible cible
- */
- public void setCible(String cible) {
- this.cible = cible;
- }
+ /**
+ * cible setter
+ * @param cible cible
+ */
+ public void setCible(String cible) {
+ this.cible = cible;
+ }
- /**
- * domaine getter
- * @return domaine
- */
- public String getDomaine() {
- return domaine;
- }
+ /**
+ * domaine getter
+ * @return domaine
+ */
+ public String getDomaine() {
+ return domaine;
+ }
- /**
- * domaine setter
- * @param domaine domaine
- */
- public void setDomaine(String domaine) {
- this.domaine = domaine;
- }
+ /**
+ * domaine setter
+ * @param domaine domaine
+ */
+ public void setDomaine(String domaine) {
+ this.domaine = domaine;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * valeurMesuree getter
- * @return valeurMesuree
- */
- public String getValeurMesuree() {
- return valeurMesuree;
- }
+ /**
+ * valeurMesuree getter
+ * @return valeurMesuree
+ */
+ public String getValeurMesuree() {
+ return valeurMesuree;
+ }
- /**
- * valeurMesuree setter
- * @param valeurMesuree valeurMesuree
- */
- public void setValeurMesuree(String valeurMesuree) {
- this.valeurMesuree = valeurMesuree;
- }
+ /**
+ * valeurMesuree setter
+ * @param valeurMesuree valeurMesuree
+ */
+ public void setValeurMesuree(String valeurMesuree) {
+ this.valeurMesuree = valeurMesuree;
+ }
- /**
- * uniteResultat getter
- * @return uniteResultat
- */
- public String getUniteResultat() {
- return uniteResultat;
- }
+ /**
+ * uniteResultat getter
+ * @return uniteResultat
+ */
+ public String getUniteResultat() {
+ return uniteResultat;
+ }
- /**
- * uniteResultat setter
- * @param uniteResultat uniteResultat
- */
- public void setUniteResultat(String uniteResultat) {
- this.uniteResultat = uniteResultat;
- }
+ /**
+ * uniteResultat setter
+ * @param uniteResultat uniteResultat
+ */
+ public void setUniteResultat(String uniteResultat) {
+ this.uniteResultat = uniteResultat;
+ }
- /**
- * critereActivite getter
- * @return critereActivite
- */
- public String getCritereActivite() {
- return critereActivite;
- }
+ /**
+ * critereActivite getter
+ * @return critereActivite
+ */
+ public String getCritereActivite() {
+ return critereActivite;
+ }
- /**
- * critereActivite setter
- * @param critereActivite critereActivite
- */
- public void setCritereActivite(String critereActivite) {
- this.critereActivite = critereActivite;
- }
+ /**
+ * critereActivite setter
+ * @param critereActivite critereActivite
+ */
+ public void setCritereActivite(String critereActivite) {
+ this.critereActivite = critereActivite;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuri.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuri.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuri.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -47,132 +47,132 @@
@CollectionUniqueField(fieldName = "nom", pathToCollection = "methodePurification.parametres")
public class ParamMethoPuri extends AbstractModel implements Cloneable, Comparable<ParamMethoPuri> {
- /** Id du type d'extrait */
- @Id
- @GeneratedValue
- private Integer idParamMethoPuri;
+ /** Id du type d'extrait */
+ @Id
+ @GeneratedValue
+ private Integer idParamMethoPuri;
- /** Index to order parameters */
- @NotNull
- @Min(value = 0)
- private Integer index;
+ /** Index to order parameters */
+ @NotNull
+ @Min(value = 0)
+ private Integer index;
- /** Initiales du type d'extrait */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String nom;
+ /** Initiales du type d'extrait */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String nom;
- /** Description du type d'extrait */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description du type d'extrait */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Méthode d'extraction pour laquelle est défini le type d'extrait */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private MethodePurification methodePurification;
+ /** Méthode d'extraction pour laquelle est défini le type d'extrait */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private MethodePurification methodePurification;
- /** {@inheritDoc} */
- @Override
- public ParamMethoPuri clone() throws CloneNotSupportedException {
- ParamMethoPuri clone = (ParamMethoPuri) super.clone();
- clone.idParamMethoPuri = idParamMethoPuri;
- clone.nom = nom;
- clone.description = description;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public ParamMethoPuri clone() throws CloneNotSupportedException {
+ ParamMethoPuri clone = (ParamMethoPuri) super.clone();
+ clone.idParamMethoPuri = idParamMethoPuri;
+ clone.nom = nom;
+ clone.description = description;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return this.nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return this.nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(ParamMethoPuri paramMethoPuri) {
- return new BeanComparator("index").compare(this, paramMethoPuri);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(ParamMethoPuri paramMethoPuri) {
+ return new BeanComparator("index").compare(this, paramMethoPuri);
+ }
- /**
- * idParamMethoPuri getter
- * @return idParamMethoPuri
- */
- public Integer getIdParamMethoPuri() {
- return idParamMethoPuri;
- }
+ /**
+ * idParamMethoPuri getter
+ * @return idParamMethoPuri
+ */
+ public Integer getIdParamMethoPuri() {
+ return idParamMethoPuri;
+ }
- /**
- * idParamMethoPuri setter
- * @param idParamMethoPuri idParamMethoPuri
- */
- public void setIdParamMethoPuri(Integer idParamMethoPuri) {
- this.idParamMethoPuri = idParamMethoPuri;
- }
+ /**
+ * idParamMethoPuri setter
+ * @param idParamMethoPuri idParamMethoPuri
+ */
+ public void setIdParamMethoPuri(Integer idParamMethoPuri) {
+ this.idParamMethoPuri = idParamMethoPuri;
+ }
- /**
- * index getter
- * @return index
- */
- public Integer getIndex() {
- return index;
- }
+ /**
+ * index getter
+ * @return index
+ */
+ public Integer getIndex() {
+ return index;
+ }
- /**
- * index setter
- * @param index index
- */
- public void setIndex(Integer index) {
- this.index = index;
- }
+ /**
+ * index setter
+ * @param index index
+ */
+ public void setIndex(Integer index) {
+ this.index = index;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * methodePurification getter
- * @return methodePurification
- */
- public MethodePurification getMethodePurification() {
- return methodePurification;
- }
+ /**
+ * methodePurification getter
+ * @return methodePurification
+ */
+ public MethodePurification getMethodePurification() {
+ return methodePurification;
+ }
- /**
- * methodePurification setter
- * @param methodePurification methodePurification
- */
- public void setMethodePurification(MethodePurification methodePurification) {
- this.methodePurification = methodePurification;
- }
+ /**
+ * methodePurification setter
+ * @param methodePurification methodePurification
+ */
+ public void setMethodePurification(MethodePurification methodePurification) {
+ this.methodePurification = methodePurification;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuriEffectif.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuriEffectif.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/ParamMethoPuriEffectif.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,110 +42,110 @@
@Table
public class ParamMethoPuriEffectif extends AbstractModel implements Cloneable {
- /** Id du paramètre effectif */
- @Id
- @GeneratedValue
- private Integer idParamMethoPuriEffectif;
+ /** Id du paramètre effectif */
+ @Id
+ @GeneratedValue
+ private Integer idParamMethoPuriEffectif;
- /** Paramètre */
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER)
- private ParamMethoPuri param;
+ /** Paramètre */
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER)
+ private ParamMethoPuri param;
- /** Valeur du paramètre */
- @Length(max = LENGTH_LONG_TEXT)
- private String valeur;
+ /** Valeur du paramètre */
+ @Length(max = LENGTH_LONG_TEXT)
+ private String valeur;
- /** Purification à laquelle se rattache le paramètre effectif */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Purification purification;
+ /** Purification à laquelle se rattache le paramètre effectif */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Purification purification;
- /**
- * Constructor
- */
- public ParamMethoPuriEffectif() {
- //
- }
+ /**
+ * Constructor
+ */
+ public ParamMethoPuriEffectif() {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public ParamMethoPuriEffectif clone() throws CloneNotSupportedException {
- ParamMethoPuriEffectif clone = (ParamMethoPuriEffectif) super.clone();
- clone.idParamMethoPuriEffectif = idParamMethoPuriEffectif;
- clone.param = param;
- clone.valeur = valeur;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public ParamMethoPuriEffectif clone() throws CloneNotSupportedException {
+ ParamMethoPuriEffectif clone = (ParamMethoPuriEffectif) super.clone();
+ clone.idParamMethoPuriEffectif = idParamMethoPuriEffectif;
+ clone.param = param;
+ clone.valeur = valeur;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return param + " : " + valeur;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return param + " : " + valeur;
+ }
- /**
- * idParamMethoPuriEffectif getter
- * @return idParamMethoPuriEffectif
- */
- public Integer getIdParamMethoPuriEffectif() {
- return idParamMethoPuriEffectif;
- }
+ /**
+ * idParamMethoPuriEffectif getter
+ * @return idParamMethoPuriEffectif
+ */
+ public Integer getIdParamMethoPuriEffectif() {
+ return idParamMethoPuriEffectif;
+ }
- /**
- * idParamMethoPuriEffectif setter
- * @param idParamMethoPuriEffectif idParamMethoPuriEffectif
- */
- public void setIdParamMethoPuriEffectif(Integer idParamMethoPuriEffectif) {
- this.idParamMethoPuriEffectif = idParamMethoPuriEffectif;
- }
+ /**
+ * idParamMethoPuriEffectif setter
+ * @param idParamMethoPuriEffectif idParamMethoPuriEffectif
+ */
+ public void setIdParamMethoPuriEffectif(Integer idParamMethoPuriEffectif) {
+ this.idParamMethoPuriEffectif = idParamMethoPuriEffectif;
+ }
- /**
- * param getter
- * @return param
- */
- public ParamMethoPuri getParam() {
- return param;
- }
+ /**
+ * param getter
+ * @return param
+ */
+ public ParamMethoPuri getParam() {
+ return param;
+ }
- /**
- * param setter
- * @param param param
- */
- public void setParam(ParamMethoPuri param) {
- this.param = param;
- }
+ /**
+ * param setter
+ * @param param param
+ */
+ public void setParam(ParamMethoPuri param) {
+ this.param = param;
+ }
- /**
- * valeur getter
- * @return valeur
- */
- public String getValeur() {
- return valeur;
- }
+ /**
+ * valeur getter
+ * @return valeur
+ */
+ public String getValeur() {
+ return valeur;
+ }
- /**
- * valeur setter
- * @param valeur valeur
- */
- public void setValeur(String valeur) {
- this.valeur = valeur;
- }
+ /**
+ * valeur setter
+ * @param valeur valeur
+ */
+ public void setValeur(String valeur) {
+ this.valeur = valeur;
+ }
- /**
- * purification getter
- * @return purification
- */
- public Purification getPurification() {
- return purification;
- }
+ /**
+ * purification getter
+ * @return purification
+ */
+ public Purification getPurification() {
+ return purification;
+ }
- /**
- * purification setter
- * @param purification purification
- */
- public void setPurification(Purification purification) {
- this.purification = purification;
- }
+ /**
+ * purification setter
+ * @param purification purification
+ */
+ public void setPurification(Purification purification) {
+ this.purification = purification;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Partie.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Partie.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Partie.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -43,59 +43,59 @@
@Table
public class Partie extends AbstractModel implements Comparable<Partie> {
- /** Id de la partie */
- @Id
- @GeneratedValue
- private Integer idPartie;
+ /** Id de la partie */
+ @Id
+ @GeneratedValue
+ private Integer idPartie;
- /** Nom */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- @Column(unique = true)
- private String nom;
+ /** Nom */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ @Column(unique = true)
+ private String nom;
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Partie partie) {
- return new BeanComparator("nom").compare(this, partie);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Partie partie) {
+ return new BeanComparator("nom").compare(this, partie);
+ }
- /**
- * idPartie getter
- * @return idPartie
- */
- public Integer getIdPartie() {
- return idPartie;
- }
+ /**
+ * idPartie getter
+ * @return idPartie
+ */
+ public Integer getIdPartie() {
+ return idPartie;
+ }
- /**
- * idPartie setter
- * @param idPartie idPartie
- */
- public void setIdPartie(Integer idPartie) {
- this.idPartie = idPartie;
- }
+ /**
+ * idPartie setter
+ * @param idPartie idPartie
+ */
+ public void setIdPartie(Integer idPartie) {
+ this.idPartie = idPartie;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Personne.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Personne.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Personne.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -64,503 +64,503 @@
@Inheritance(strategy = InheritanceType.JOINED)
public class Personne extends AbstractModel implements Comparable<Personne> {
- /** ID */
- @Id
- @GeneratedValue
- private Integer idPersonne;
+ /** ID */
+ @Id
+ @GeneratedValue
+ private Integer idPersonne;
- /** Adresse postale */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String adressePostale;
+ /** Adresse postale */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String adressePostale;
- /** Campagnes créées */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Campagne> campagnesCreees;
+ /** Campagnes créées */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Campagne> campagnesCreees;
- /** Droits sur les campagnes */
- @NotNull
- @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY, orphanRemoval = true)
- @MapKey(name = "id.pk1")
- @Cascade({ CascadeType.SAVE_UPDATE })
- private Map<Campagne, CampagnePersonneDroits> campagnesDroits;
+ /** Droits sur les campagnes */
+ @NotNull
+ @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY, orphanRemoval = true)
+ @MapKey(name = "id.pk1")
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private Map<Campagne, CampagnePersonneDroits> campagnesDroits;
- /** Campagnes participées */
- @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
- @NotNull
- private List<CampagnePersonneParticipant> campagnesParticipees;
+ /** Campagnes participées */
+ @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY)
+ @NotNull
+ private List<CampagnePersonneParticipant> campagnesParticipees;
- /** Code pays */
- @NotEmpty
- @Length(min = 2, max = 2)
- @CountryCode
- private String codePays;
+ /** Code pays */
+ @NotEmpty
+ @Length(min = 2, max = 2)
+ @CountryCode
+ private String codePays;
- /** Code postal */
- @Length(max = LENGTH_TINY_TEXT)
- @NotEmpty
- private String codePostal;
+ /** Code postal */
+ @Length(max = LENGTH_TINY_TEXT)
+ @NotEmpty
+ private String codePostal;
- /** Courriel */
- @Column(unique = true)
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Email
- @NotEmpty
- @Index(name = "courriel")
- private String courriel;
+ /** Courriel */
+ @Column(unique = true)
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Email
+ @NotEmpty
+ @Index(name = "courriel")
+ private String courriel;
- /** Fax */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String fax;
+ /** Fax */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String fax;
- /** Fonction */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String fonction;
+ /** Fonction */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String fonction;
- /** Lots créés */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Lot> lotsCrees;
+ /** Lots créés */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Lot> lotsCrees;
- /** Droits lots */
- @NotNull
- @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY, orphanRemoval = true)
- @MapKey(name = "id.pk1")
- @Cascade({ CascadeType.SAVE_UPDATE })
- private Map<Lot, LotPersonneDroits> lotsDroits;
+ /** Droits lots */
+ @NotNull
+ @OneToMany(mappedBy = "id.pk2", fetch = FetchType.LAZY, orphanRemoval = true)
+ @MapKey(name = "id.pk1")
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private Map<Lot, LotPersonneDroits> lotsDroits;
- /** Nom */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String nom;
+ /** Nom */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String nom;
- /** Organisme */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String organisme;
+ /** Organisme */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String organisme;
- /** Prénom */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String prenom;
+ /** Prénom */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String prenom;
- /** Téléphone */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String tel;
+ /** Téléphone */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String tel;
- /** Ville */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- private String ville;
+ /** Ville */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ private String ville;
- /** Stations créées */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Station> stationsCrees;
+ /** Stations créées */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Station> stationsCrees;
- /** Spécimens créés */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Specimen> specimensCrees;
+ /** Spécimens créés */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Specimen> specimensCrees;
- /** Extractions créées */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Extraction> extractionsCrees;
+ /** Extractions créées */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Extraction> extractionsCrees;
- /** Purification créées */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<Purification> purificationsCrees;
+ /** Purification créées */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<Purification> purificationsCrees;
- /** Tests biologiques créés */
- @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
- @NotNull
- private List<TestBio> testsBioCrees;
+ /** Tests biologiques créés */
+ @OneToMany(mappedBy = "createur", fetch = FetchType.LAZY)
+ @NotNull
+ private List<TestBio> testsBioCrees;
- /**
- * Constructeur
- */
- public Personne() {
- campagnesCreees = new ArrayList<Campagne>();
- campagnesParticipees = new ArrayList<CampagnePersonneParticipant>();
- campagnesDroits = new HashMap<Campagne, CampagnePersonneDroits>();
- lotsCrees = new ArrayList<Lot>();
- lotsDroits = new HashMap<Lot, LotPersonneDroits>();
- stationsCrees = new ArrayList<Station>();
- specimensCrees = new ArrayList<Specimen>();
- extractionsCrees = new ArrayList<Extraction>();
- purificationsCrees = new ArrayList<Purification>();
- testsBioCrees = new ArrayList<TestBio>();
- }
+ /**
+ * Constructeur
+ */
+ public Personne() {
+ campagnesCreees = new ArrayList<Campagne>();
+ campagnesParticipees = new ArrayList<CampagnePersonneParticipant>();
+ campagnesDroits = new HashMap<Campagne, CampagnePersonneDroits>();
+ lotsCrees = new ArrayList<Lot>();
+ lotsDroits = new HashMap<Lot, LotPersonneDroits>();
+ stationsCrees = new ArrayList<Station>();
+ specimensCrees = new ArrayList<Specimen>();
+ extractionsCrees = new ArrayList<Extraction>();
+ purificationsCrees = new ArrayList<Purification>();
+ testsBioCrees = new ArrayList<TestBio>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return prenom + " " + nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return prenom + " " + nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Personne personne) {
- ComparatorChain comparatorChain = new ComparatorChain();
- comparatorChain.addComparator(new BeanComparator("nom"));
- comparatorChain.addComparator(new BeanComparator("prenom"));
- return comparatorChain.compare(this, personne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Personne personne) {
+ ComparatorChain comparatorChain = new ComparatorChain();
+ comparatorChain.addComparator(new BeanComparator("nom"));
+ comparatorChain.addComparator(new BeanComparator("prenom"));
+ return comparatorChain.compare(this, personne);
+ }
- /**
- * idPersonne getter
- * @return idPersonne
- */
- public Integer getIdPersonne() {
- return idPersonne;
- }
+ /**
+ * idPersonne getter
+ * @return idPersonne
+ */
+ public Integer getIdPersonne() {
+ return idPersonne;
+ }
- /**
- * idPersonne setter
- * @param idPersonne idPersonne
- */
- public void setIdPersonne(Integer idPersonne) {
- this.idPersonne = idPersonne;
- }
+ /**
+ * idPersonne setter
+ * @param idPersonne idPersonne
+ */
+ public void setIdPersonne(Integer idPersonne) {
+ this.idPersonne = idPersonne;
+ }
- /**
- * adressePostale getter
- * @return adressePostale
- */
- public String getAdressePostale() {
- return adressePostale;
- }
+ /**
+ * adressePostale getter
+ * @return adressePostale
+ */
+ public String getAdressePostale() {
+ return adressePostale;
+ }
- /**
- * adressePostale setter
- * @param adressePostale adressePostale
- */
- public void setAdressePostale(String adressePostale) {
- this.adressePostale = adressePostale;
- }
+ /**
+ * adressePostale setter
+ * @param adressePostale adressePostale
+ */
+ public void setAdressePostale(String adressePostale) {
+ this.adressePostale = adressePostale;
+ }
- /**
- * campagnesCreees getter
- * @return campagnesCreees
- */
- public List<Campagne> getCampagnesCreees() {
- return campagnesCreees;
- }
+ /**
+ * campagnesCreees getter
+ * @return campagnesCreees
+ */
+ public List<Campagne> getCampagnesCreees() {
+ return campagnesCreees;
+ }
- /**
- * campagnesCreees setter
- * @param campagnesCreees campagnesCreees
- */
- public void setCampagnesCreees(List<Campagne> campagnesCreees) {
- this.campagnesCreees = campagnesCreees;
- }
+ /**
+ * campagnesCreees setter
+ * @param campagnesCreees campagnesCreees
+ */
+ public void setCampagnesCreees(List<Campagne> campagnesCreees) {
+ this.campagnesCreees = campagnesCreees;
+ }
- /**
- * campagnesDroits getter
- * @return campagnesDroits
- */
- public Map<Campagne, CampagnePersonneDroits> getCampagnesDroits() {
- return campagnesDroits;
- }
+ /**
+ * campagnesDroits getter
+ * @return campagnesDroits
+ */
+ public Map<Campagne, CampagnePersonneDroits> getCampagnesDroits() {
+ return campagnesDroits;
+ }
- /**
- * campagnesDroits setter
- * @param campagnesDroits campagnesDroits
- */
- public void setCampagnesDroits(Map<Campagne, CampagnePersonneDroits> campagnesDroits) {
- this.campagnesDroits = campagnesDroits;
- }
+ /**
+ * campagnesDroits setter
+ * @param campagnesDroits campagnesDroits
+ */
+ public void setCampagnesDroits(Map<Campagne, CampagnePersonneDroits> campagnesDroits) {
+ this.campagnesDroits = campagnesDroits;
+ }
- /**
- * campagnesParticipees getter
- * @return campagnesParticipees
- */
- public List<CampagnePersonneParticipant> getCampagnesParticipees() {
- return campagnesParticipees;
- }
+ /**
+ * campagnesParticipees getter
+ * @return campagnesParticipees
+ */
+ public List<CampagnePersonneParticipant> getCampagnesParticipees() {
+ return campagnesParticipees;
+ }
- /**
- * campagnesParticipees setter
- * @param campagnesParticipees campagnesParticipees
- */
- public void setCampagnesParticipees(List<CampagnePersonneParticipant> campagnesParticipees) {
- this.campagnesParticipees = campagnesParticipees;
- }
+ /**
+ * campagnesParticipees setter
+ * @param campagnesParticipees campagnesParticipees
+ */
+ public void setCampagnesParticipees(List<CampagnePersonneParticipant> campagnesParticipees) {
+ this.campagnesParticipees = campagnesParticipees;
+ }
- /**
- * codePays getter
- * @return codePays
- */
- public String getCodePays() {
- return codePays;
- }
+ /**
+ * codePays getter
+ * @return codePays
+ */
+ public String getCodePays() {
+ return codePays;
+ }
- /**
- * codePays setter
- * @param codePays codePays
- */
- public void setCodePays(String codePays) {
- this.codePays = codePays;
- }
+ /**
+ * codePays setter
+ * @param codePays codePays
+ */
+ public void setCodePays(String codePays) {
+ this.codePays = codePays;
+ }
- /**
- * codePostal getter
- * @return codePostal
- */
- public String getCodePostal() {
- return codePostal;
- }
+ /**
+ * codePostal getter
+ * @return codePostal
+ */
+ public String getCodePostal() {
+ return codePostal;
+ }
- /**
- * codePostal setter
- * @param codePostal codePostal
- */
- public void setCodePostal(String codePostal) {
- this.codePostal = codePostal;
- }
+ /**
+ * codePostal setter
+ * @param codePostal codePostal
+ */
+ public void setCodePostal(String codePostal) {
+ this.codePostal = codePostal;
+ }
- /**
- * courriel getter
- * @return courriel
- */
- public String getCourriel() {
- return courriel;
- }
+ /**
+ * courriel getter
+ * @return courriel
+ */
+ public String getCourriel() {
+ return courriel;
+ }
- /**
- * courriel setter
- * @param courriel courriel
- */
- public void setCourriel(String courriel) {
- this.courriel = courriel;
- }
+ /**
+ * courriel setter
+ * @param courriel courriel
+ */
+ public void setCourriel(String courriel) {
+ this.courriel = courriel;
+ }
- /**
- * fax getter
- * @return fax
- */
- public String getFax() {
- return fax;
- }
+ /**
+ * fax getter
+ * @return fax
+ */
+ public String getFax() {
+ return fax;
+ }
- /**
- * fax setter
- * @param fax fax
- */
- public void setFax(String fax) {
- this.fax = fax;
- }
+ /**
+ * fax setter
+ * @param fax fax
+ */
+ public void setFax(String fax) {
+ this.fax = fax;
+ }
- /**
- * fonction getter
- * @return fonction
- */
- public String getFonction() {
- return fonction;
- }
+ /**
+ * fonction getter
+ * @return fonction
+ */
+ public String getFonction() {
+ return fonction;
+ }
- /**
- * fonction setter
- * @param fonction fonction
- */
- public void setFonction(String fonction) {
- this.fonction = fonction;
- }
+ /**
+ * fonction setter
+ * @param fonction fonction
+ */
+ public void setFonction(String fonction) {
+ this.fonction = fonction;
+ }
- /**
- * lotsCrees getter
- * @return lotsCrees
- */
- public List<Lot> getLotsCrees() {
- return lotsCrees;
- }
+ /**
+ * lotsCrees getter
+ * @return lotsCrees
+ */
+ public List<Lot> getLotsCrees() {
+ return lotsCrees;
+ }
- /**
- * lotsCrees setter
- * @param lotsCrees lotsCrees
- */
- public void setLotsCrees(List<Lot> lotsCrees) {
- this.lotsCrees = lotsCrees;
- }
+ /**
+ * lotsCrees setter
+ * @param lotsCrees lotsCrees
+ */
+ public void setLotsCrees(List<Lot> lotsCrees) {
+ this.lotsCrees = lotsCrees;
+ }
- /**
- * lotsDroits getter
- * @return lotsDroits
- */
- public Map<Lot, LotPersonneDroits> getLotsDroits() {
- return lotsDroits;
- }
+ /**
+ * lotsDroits getter
+ * @return lotsDroits
+ */
+ public Map<Lot, LotPersonneDroits> getLotsDroits() {
+ return lotsDroits;
+ }
- /**
- * lotsDroits setter
- * @param lotsDroits lotsDroits
- */
- public void setLotsDroits(Map<Lot, LotPersonneDroits> lotsDroits) {
- this.lotsDroits = lotsDroits;
- }
+ /**
+ * lotsDroits setter
+ * @param lotsDroits lotsDroits
+ */
+ public void setLotsDroits(Map<Lot, LotPersonneDroits> lotsDroits) {
+ this.lotsDroits = lotsDroits;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * organisme getter
- * @return organisme
- */
- public String getOrganisme() {
- return organisme;
- }
+ /**
+ * organisme getter
+ * @return organisme
+ */
+ public String getOrganisme() {
+ return organisme;
+ }
- /**
- * organisme setter
- * @param organisme organisme
- */
- public void setOrganisme(String organisme) {
- this.organisme = organisme;
- }
+ /**
+ * organisme setter
+ * @param organisme organisme
+ */
+ public void setOrganisme(String organisme) {
+ this.organisme = organisme;
+ }
- /**
- * prenom getter
- * @return prenom
- */
- public String getPrenom() {
- return prenom;
- }
+ /**
+ * prenom getter
+ * @return prenom
+ */
+ public String getPrenom() {
+ return prenom;
+ }
- /**
- * prenom setter
- * @param prenom prenom
- */
- public void setPrenom(String prenom) {
- this.prenom = prenom;
- }
+ /**
+ * prenom setter
+ * @param prenom prenom
+ */
+ public void setPrenom(String prenom) {
+ this.prenom = prenom;
+ }
- /**
- * tel getter
- * @return tel
- */
- public String getTel() {
- return tel;
- }
+ /**
+ * tel getter
+ * @return tel
+ */
+ public String getTel() {
+ return tel;
+ }
- /**
- * tel setter
- * @param tel tel
- */
- public void setTel(String tel) {
- this.tel = tel;
- }
+ /**
+ * tel setter
+ * @param tel tel
+ */
+ public void setTel(String tel) {
+ this.tel = tel;
+ }
- /**
- * ville getter
- * @return ville
- */
- public String getVille() {
- return ville;
- }
+ /**
+ * ville getter
+ * @return ville
+ */
+ public String getVille() {
+ return ville;
+ }
- /**
- * ville setter
- * @param ville ville
- */
- public void setVille(String ville) {
- this.ville = ville;
- }
+ /**
+ * ville setter
+ * @param ville ville
+ */
+ public void setVille(String ville) {
+ this.ville = ville;
+ }
- /**
- * stationsCrees getter
- * @return stationsCrees
- */
- public List<Station> getStationsCrees() {
- return stationsCrees;
- }
+ /**
+ * stationsCrees getter
+ * @return stationsCrees
+ */
+ public List<Station> getStationsCrees() {
+ return stationsCrees;
+ }
- /**
- * stationsCrees setter
- * @param stationsCrees stationsCrees
- */
- public void setStationsCrees(List<Station> stationsCrees) {
- this.stationsCrees = stationsCrees;
- }
+ /**
+ * stationsCrees setter
+ * @param stationsCrees stationsCrees
+ */
+ public void setStationsCrees(List<Station> stationsCrees) {
+ this.stationsCrees = stationsCrees;
+ }
- /**
- * specimensCrees getter
- * @return specimensCrees
- */
- public List<Specimen> getSpecimensCrees() {
- return specimensCrees;
- }
+ /**
+ * specimensCrees getter
+ * @return specimensCrees
+ */
+ public List<Specimen> getSpecimensCrees() {
+ return specimensCrees;
+ }
- /**
- * specimensCrees setter
- * @param specimensCrees specimensCrees
- */
- public void setSpecimensCrees(List<Specimen> specimensCrees) {
- this.specimensCrees = specimensCrees;
- }
+ /**
+ * specimensCrees setter
+ * @param specimensCrees specimensCrees
+ */
+ public void setSpecimensCrees(List<Specimen> specimensCrees) {
+ this.specimensCrees = specimensCrees;
+ }
- /**
- * extractionsCrees getter
- * @return extractionsCrees
- */
- public List<Extraction> getExtractionsCrees() {
- return extractionsCrees;
- }
+ /**
+ * extractionsCrees getter
+ * @return extractionsCrees
+ */
+ public List<Extraction> getExtractionsCrees() {
+ return extractionsCrees;
+ }
- /**
- * extractionsCrees setter
- * @param extractionsCrees extractionsCrees
- */
- public void setExtractionsCrees(List<Extraction> extractionsCrees) {
- this.extractionsCrees = extractionsCrees;
- }
+ /**
+ * extractionsCrees setter
+ * @param extractionsCrees extractionsCrees
+ */
+ public void setExtractionsCrees(List<Extraction> extractionsCrees) {
+ this.extractionsCrees = extractionsCrees;
+ }
- /**
- * purificationsCrees getter
- * @return purificationsCrees
- */
- public List<Purification> getPurificationsCrees() {
- return purificationsCrees;
- }
+ /**
+ * purificationsCrees getter
+ * @return purificationsCrees
+ */
+ public List<Purification> getPurificationsCrees() {
+ return purificationsCrees;
+ }
- /**
- * purificationsCrees setter
- * @param purificationsCrees purificationsCrees
- */
- public void setPurificationsCrees(List<Purification> purificationsCrees) {
- this.purificationsCrees = purificationsCrees;
- }
+ /**
+ * purificationsCrees setter
+ * @param purificationsCrees purificationsCrees
+ */
+ public void setPurificationsCrees(List<Purification> purificationsCrees) {
+ this.purificationsCrees = purificationsCrees;
+ }
- /**
- * testsBioCrees getter
- * @return testsBioCrees
- */
- public List<TestBio> getTestsBioCrees() {
- return testsBioCrees;
- }
+ /**
+ * testsBioCrees getter
+ * @return testsBioCrees
+ */
+ public List<TestBio> getTestsBioCrees() {
+ return testsBioCrees;
+ }
- /**
- * testsBioCrees setter
- * @param testsBioCrees testsBioCrees
- */
- public void setTestsBioCrees(List<TestBio> testsBioCrees) {
- this.testsBioCrees = testsBioCrees;
- }
+ /**
+ * testsBioCrees setter
+ * @param testsBioCrees testsBioCrees
+ */
+ public void setTestsBioCrees(List<TestBio> testsBioCrees) {
+ this.testsBioCrees = testsBioCrees;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Produit.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Produit.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Produit.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -64,157 +64,157 @@
impl = ProduitBridge.class)
public abstract class Produit extends AbstractModel implements Cloneable, Comparable<Produit> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Id du produit */
- @Id
- @GeneratedValue
- private Integer id;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Id du produit */
+ @Id
+ @GeneratedValue
+ private Integer id;
- /** Réference du produit */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- @Column(unique = true)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Réference du produit */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ @Column(unique = true)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Masse obtenue pour le produit **/
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal masseObtenue;
+ /** Masse obtenue pour le produit **/
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal masseObtenue;
- /** Purifications effectuées à partir du produit */
- @NotNull
- @OneToMany(mappedBy = "produit", fetch = FetchType.LAZY)
- private List<Purification> purificationsSuivantes;
+ /** Purifications effectuées à partir du produit */
+ @NotNull
+ @OneToMany(mappedBy = "produit", fetch = FetchType.LAZY)
+ private List<Purification> purificationsSuivantes;
- /** Résultats de tests biologiques effectués à partir du produit */
- @NotNull
- @OneToMany(mappedBy = "produit", fetch = FetchType.LAZY)
- @ContainedIn
- private List<ResultatTestBio> resultatsTestsBioSuivants;
+ /** Résultats de tests biologiques effectués à partir du produit */
+ @NotNull
+ @OneToMany(mappedBy = "produit", fetch = FetchType.LAZY)
+ @ContainedIn
+ private List<ResultatTestBio> resultatsTestsBioSuivants;
- /**
- * Constructor
- */
- public Produit() {
- super();
- purificationsSuivantes = new ArrayList<Purification>();
- resultatsTestsBioSuivants = new ArrayList<ResultatTestBio>();
- }
+ /**
+ * Constructor
+ */
+ public Produit() {
+ super();
+ purificationsSuivantes = new ArrayList<Purification>();
+ resultatsTestsBioSuivants = new ArrayList<ResultatTestBio>();
+ }
- /**
- * Détermine si le produit est un extrait
- * @return true si c'est un extrait
- */
- public abstract boolean isExtrait();
+ /**
+ * Détermine si le produit est un extrait
+ * @return true si c'est un extrait
+ */
+ public abstract boolean isExtrait();
- /**
- * Détermine si le produit est une fraction
- * @return true si c'est une fraction
- */
- public abstract boolean isFraction();
+ /**
+ * Détermine si le produit est une fraction
+ * @return true si c'est une fraction
+ */
+ public abstract boolean isFraction();
- /** {@inheritDoc} */
- @Override
- public Produit clone() throws CloneNotSupportedException {
- Produit clone = (Produit) super.clone();
- clone.id = id;
- clone.ref = ref;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Produit clone() throws CloneNotSupportedException {
+ Produit clone = (Produit) super.clone();
+ clone.id = id;
+ clone.ref = ref;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return this.ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return this.ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Produit produit) {
- return new BeanComparator("ref").compare(this, produit);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Produit produit) {
+ return new BeanComparator("ref").compare(this, produit);
+ }
- /**
- * id getter
- * @return id
- */
- public Integer getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public Integer getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(Integer id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(Integer id) {
+ this.id = id;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * masseObtenue getter
- * @return masseObtenue
- */
- public BigDecimal getMasseObtenue() {
- return masseObtenue;
- }
+ /**
+ * masseObtenue getter
+ * @return masseObtenue
+ */
+ public BigDecimal getMasseObtenue() {
+ return masseObtenue;
+ }
- /**
- * masseObtenue setter
- * @param masseObtenue masseObtenue
- */
- public void setMasseObtenue(BigDecimal masseObtenue) {
- this.masseObtenue = masseObtenue;
- }
+ /**
+ * masseObtenue setter
+ * @param masseObtenue masseObtenue
+ */
+ public void setMasseObtenue(BigDecimal masseObtenue) {
+ this.masseObtenue = masseObtenue;
+ }
- /**
- * purificationsSuivantes getter
- * @return purificationsSuivantes
- */
- public List<Purification> getPurificationsSuivantes() {
- return purificationsSuivantes;
- }
+ /**
+ * purificationsSuivantes getter
+ * @return purificationsSuivantes
+ */
+ public List<Purification> getPurificationsSuivantes() {
+ return purificationsSuivantes;
+ }
- /**
- * purificationsSuivantes setter
- * @param purificationsSuivantes purificationsSuivantes
- */
- public void setPurificationsSuivantes(List<Purification> purificationsSuivantes) {
- this.purificationsSuivantes = purificationsSuivantes;
- }
+ /**
+ * purificationsSuivantes setter
+ * @param purificationsSuivantes purificationsSuivantes
+ */
+ public void setPurificationsSuivantes(List<Purification> purificationsSuivantes) {
+ this.purificationsSuivantes = purificationsSuivantes;
+ }
- /**
- * resultatsTestsBioSuivants getter
- * @return resultatsTestsBioSuivants
- */
- public List<ResultatTestBio> getResultatsTestsBioSuivants() {
- return resultatsTestsBioSuivants;
- }
+ /**
+ * resultatsTestsBioSuivants getter
+ * @return resultatsTestsBioSuivants
+ */
+ public List<ResultatTestBio> getResultatsTestsBioSuivants() {
+ return resultatsTestsBioSuivants;
+ }
- /**
- * resultatsTestsBioSuivants setter
- * @param resultatsTestsBioSuivants resultatsTestsBioSuivants
- */
- public void setResultatsTestsBioSuivants(List<ResultatTestBio> resultatsTestsBioSuivants) {
- this.resultatsTestsBioSuivants = resultatsTestsBioSuivants;
- }
+ /**
+ * resultatsTestsBioSuivants setter
+ * @param resultatsTestsBioSuivants resultatsTestsBioSuivants
+ */
+ public void setResultatsTestsBioSuivants(List<ResultatTestBio> resultatsTestsBioSuivants) {
+ this.resultatsTestsBioSuivants = resultatsTestsBioSuivants;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Purification.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Purification.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Purification.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -76,370 +76,370 @@
})
public class Purification extends AbstractModel implements Comparable<Purification> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Id de la purification */
- @Id
- @GeneratedValue
- private Integer idPurification;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Id de la purification */
+ @Id
+ @GeneratedValue
+ private Integer idPurification;
- /** Référence de la manip */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Référence de la manip */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Manipulateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Personne manipulateur;
+ /** Manipulateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Personne manipulateur;
- /** Date de la manip */
- @NotNull
- @Temporal(TemporalType.DATE)
- private Date date;
+ /** Date de la manip */
+ @NotNull
+ @Temporal(TemporalType.DATE)
+ private Date date;
- /** Méthode pour la purification **/
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- private MethodePurification methode;
+ /** Méthode pour la purification **/
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ private MethodePurification methode;
- /** Paramètres qui caractérisent la méthode pour cette purification */
- @NotNull
- @OneToMany(mappedBy = "purification", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- private List<ParamMethoPuriEffectif> paramsMetho;
+ /** Paramètres qui caractérisent la méthode pour cette purification */
+ @NotNull
+ @OneToMany(mappedBy = "purification", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ private List<ParamMethoPuriEffectif> paramsMetho;
- /** Produit utilisé pour la purification **/
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded
- private Produit produit;
+ /** Produit utilisé pour la purification **/
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded
+ private Produit produit;
- /** Masse avant l'extraction **/
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal masseDepart;
+ /** Masse avant l'extraction **/
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal masseDepart;
- /** Commentaire pour la manip */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Commentaire pour la manip */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Détermine si la manip doit être confidentielle */
- private boolean confidentiel;
+ /** Détermine si la manip doit être confidentielle */
+ private boolean confidentiel;
- /** Date jusqu'à laquelle la purification est confidentielle */
- @Future
- @Temporal(TemporalType.DATE)
- private Date dateConfidentialite;
+ /** Date jusqu'à laquelle la purification est confidentielle */
+ @Future
+ @Temporal(TemporalType.DATE)
+ private Date dateConfidentialite;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- @IndexedEmbedded
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @IndexedEmbedded
+ private Personne createur;
- /** Fractions produites par la purification */
- @NotNull
- @OneToMany(mappedBy = "purification", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.REFRESH, CascadeType.SAVE_UPDATE })
- private List<Fraction> fractions;
+ /** Fractions produites par la purification */
+ @NotNull
+ @OneToMany(mappedBy = "purification", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.REFRESH, CascadeType.SAVE_UPDATE })
+ private List<Fraction> fractions;
- /**
- * Lot dont provient la purification. Stocké en tant que propriété dans l'objet afin d'optimiser son accès
- */
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded
- private Lot lotSource;
+ /**
+ * Lot dont provient la purification. Stocké en tant que propriété dans l'objet afin d'optimiser son accès
+ */
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded
+ private Lot lotSource;
- /**
- * Constructeur
- */
- public Purification() {
- fractions = new ArrayList<Fraction>();
- paramsMetho = new ArrayList<ParamMethoPuriEffectif>();
- }
+ /**
+ * Constructeur
+ */
+ public Purification() {
+ fractions = new ArrayList<Fraction>();
+ paramsMetho = new ArrayList<ParamMethoPuriEffectif>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Purification purification) {
- ComparatorChain comparatorChain = new ComparatorChain();
- comparatorChain.addComparator(new BeanComparator("produit"));
- comparatorChain.addComparator(new BeanComparator("ref"));
- return comparatorChain.compare(this, purification);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Purification purification) {
+ ComparatorChain comparatorChain = new ComparatorChain();
+ comparatorChain.addComparator(new BeanComparator("produit"));
+ comparatorChain.addComparator(new BeanComparator("ref"));
+ return comparatorChain.compare(this, purification);
+ }
- /**
- * produit setter. Mise à jour du lot source dont provient le produit
- * @param produit produit
- */
- public void setProduit(Produit produit) {
- this.lotSource = findLotSourceFromProduit(produit);
- this.produit = produit;
- }
+ /**
+ * produit setter. Mise à jour du lot source dont provient le produit
+ * @param produit produit
+ */
+ public void setProduit(Produit produit) {
+ this.lotSource = findLotSourceFromProduit(produit);
+ this.produit = produit;
+ }
- /**
- * Rend les fractions triées en utilisant le comparateur {@link FractionsOfPurificationComp}
- * @return fractions
- */
- public List<Fraction> getSortedFractions() {
- // comme "@Sort(type = SortType.COMPARATOR, comparator = FractionsOfPurificationComp.class)" ne rend pas une
- // liste triée avec List, tri dans le getter
- Collections.sort(fractions, new FractionsOfPurificationComp());
- return fractions;
- }
+ /**
+ * Rend les fractions triées en utilisant le comparateur {@link FractionsOfPurificationComp}
+ * @return fractions
+ */
+ public List<Fraction> getSortedFractions() {
+ // comme "@Sort(type = SortType.COMPARATOR, comparator = FractionsOfPurificationComp.class)" ne rend pas une
+ // liste triée avec List, tri dans le getter
+ Collections.sort(fractions, new FractionsOfPurificationComp());
+ return fractions;
+ }
- /**
- * Rend les paramètres triés par index
- * @return Les paramètres
- */
- @SuppressWarnings("unchecked")
- public List<ParamMethoPuriEffectif> getSortedParamsMetho() {
- Collections.sort(paramsMetho, new BeanComparator("param.index"));
- return paramsMetho;
- }
+ /**
+ * Rend les paramètres triés par index
+ * @return Les paramètres
+ */
+ @SuppressWarnings("unchecked")
+ public List<ParamMethoPuriEffectif> getSortedParamsMetho() {
+ Collections.sort(paramsMetho, new BeanComparator("param.index"));
+ return paramsMetho;
+ }
- /**
- * idPurification getter
- * @return idPurification
- */
- public Integer getIdPurification() {
- return idPurification;
- }
+ /**
+ * idPurification getter
+ * @return idPurification
+ */
+ public Integer getIdPurification() {
+ return idPurification;
+ }
- /**
- * idPurification setter
- * @param idPurification idPurification
- */
- public void setIdPurification(Integer idPurification) {
- this.idPurification = idPurification;
- }
+ /**
+ * idPurification setter
+ * @param idPurification idPurification
+ */
+ public void setIdPurification(Integer idPurification) {
+ this.idPurification = idPurification;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * manipulateur getter
- * @return manipulateur
- */
- public Personne getManipulateur() {
- return manipulateur;
- }
+ /**
+ * manipulateur getter
+ * @return manipulateur
+ */
+ public Personne getManipulateur() {
+ return manipulateur;
+ }
- /**
- * manipulateur setter
- * @param manipulateur manipulateur
- */
- public void setManipulateur(Personne manipulateur) {
- this.manipulateur = manipulateur;
- }
+ /**
+ * manipulateur setter
+ * @param manipulateur manipulateur
+ */
+ public void setManipulateur(Personne manipulateur) {
+ this.manipulateur = manipulateur;
+ }
- /**
- * date getter
- * @return date
- */
- public Date getDate() {
- return date;
- }
+ /**
+ * date getter
+ * @return date
+ */
+ public Date getDate() {
+ return date;
+ }
- /**
- * date setter
- * @param date date
- */
- public void setDate(Date date) {
- this.date = date;
- }
+ /**
+ * date setter
+ * @param date date
+ */
+ public void setDate(Date date) {
+ this.date = date;
+ }
- /**
- * methode getter
- * @return methode
- */
- public MethodePurification getMethode() {
- return methode;
- }
+ /**
+ * methode getter
+ * @return methode
+ */
+ public MethodePurification getMethode() {
+ return methode;
+ }
- /**
- * methode setter
- * @param methode methode
- */
- public void setMethode(MethodePurification methode) {
- this.methode = methode;
- }
+ /**
+ * methode setter
+ * @param methode methode
+ */
+ public void setMethode(MethodePurification methode) {
+ this.methode = methode;
+ }
- /**
- * paramsMetho getter
- * @return paramsMetho
- */
- public List<ParamMethoPuriEffectif> getParamsMetho() {
- return paramsMetho;
- }
+ /**
+ * paramsMetho getter
+ * @return paramsMetho
+ */
+ public List<ParamMethoPuriEffectif> getParamsMetho() {
+ return paramsMetho;
+ }
- /**
- * paramsMetho setter
- * @param paramsMetho paramsMetho
- */
- public void setParamsMetho(List<ParamMethoPuriEffectif> paramsMetho) {
- this.paramsMetho = paramsMetho;
- }
+ /**
+ * paramsMetho setter
+ * @param paramsMetho paramsMetho
+ */
+ public void setParamsMetho(List<ParamMethoPuriEffectif> paramsMetho) {
+ this.paramsMetho = paramsMetho;
+ }
- /**
- * masseDepart getter
- * @return masseDepart
- */
- public BigDecimal getMasseDepart() {
- return masseDepart;
- }
+ /**
+ * masseDepart getter
+ * @return masseDepart
+ */
+ public BigDecimal getMasseDepart() {
+ return masseDepart;
+ }
- /**
- * masseDepart setter
- * @param masseDepart masseDepart
- */
- public void setMasseDepart(BigDecimal masseDepart) {
- this.masseDepart = masseDepart;
- }
+ /**
+ * masseDepart setter
+ * @param masseDepart masseDepart
+ */
+ public void setMasseDepart(BigDecimal masseDepart) {
+ this.masseDepart = masseDepart;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * confidentiel getter
- * @return confidentiel
- */
- public boolean isConfidentiel() {
- return confidentiel;
- }
+ /**
+ * confidentiel getter
+ * @return confidentiel
+ */
+ public boolean isConfidentiel() {
+ return confidentiel;
+ }
- /**
- * confidentiel setter
- * @param confidentiel confidentiel
- */
- public void setConfidentiel(boolean confidentiel) {
- this.confidentiel = confidentiel;
- }
+ /**
+ * confidentiel setter
+ * @param confidentiel confidentiel
+ */
+ public void setConfidentiel(boolean confidentiel) {
+ this.confidentiel = confidentiel;
+ }
- /**
- * dateConfidentialite getter
- * @return dateConfidentialite
- */
- public Date getDateConfidentialite() {
- return dateConfidentialite;
- }
+ /**
+ * dateConfidentialite getter
+ * @return dateConfidentialite
+ */
+ public Date getDateConfidentialite() {
+ return dateConfidentialite;
+ }
- /**
- * dateConfidentialite setter
- * @param dateConfidentialite dateConfidentialite
- */
- public void setDateConfidentialite(Date dateConfidentialite) {
- this.dateConfidentialite = dateConfidentialite;
- }
+ /**
+ * dateConfidentialite setter
+ * @param dateConfidentialite dateConfidentialite
+ */
+ public void setDateConfidentialite(Date dateConfidentialite) {
+ this.dateConfidentialite = dateConfidentialite;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * lotSource getter
- * @return lotSource
- */
- public Lot getLotSource() {
- return lotSource;
- }
+ /**
+ * lotSource getter
+ * @return lotSource
+ */
+ public Lot getLotSource() {
+ return lotSource;
+ }
- /**
- * fractions getter
- * @return fractions
- */
- public List<Fraction> getFractions() {
- return fractions;
- }
+ /**
+ * fractions getter
+ * @return fractions
+ */
+ public List<Fraction> getFractions() {
+ return fractions;
+ }
- /**
- * fractions setter
- * @param fractions fractions
- */
- public void setFractions(List<Fraction> fractions) {
- this.fractions = fractions;
- }
+ /**
+ * fractions setter
+ * @param fractions fractions
+ */
+ public void setFractions(List<Fraction> fractions) {
+ this.fractions = fractions;
+ }
- /**
- * lotSource setter
- * @param lotSource lotSource
- */
- public void setLotSource(Lot lotSource) {
- this.lotSource = lotSource;
- }
+ /**
+ * lotSource setter
+ * @param lotSource lotSource
+ */
+ public void setLotSource(Lot lotSource) {
+ this.lotSource = lotSource;
+ }
- /**
- * produit getter
- * @return produit
- */
- public Produit getProduit() {
- return produit;
- }
+ /**
+ * produit getter
+ * @return produit
+ */
+ public Produit getProduit() {
+ return produit;
+ }
- /**
- * Remonte au lot dont provient le produit source de la purification
- * @param produit Le produit en question
- * @return Le lot
- */
- public Lot findLotSourceFromProduit(Produit produit) {
- Produit curProd = produit;
- while (curProd.isFraction()) {
- Fraction curFraction = (Fraction) curProd;
- curProd = curFraction.getPurification().getProduit();
- }
- AssertTools.assertClassOrInterface(curProd, Extrait.class);
+ /**
+ * Remonte au lot dont provient le produit source de la purification
+ * @param produit Le produit en question
+ * @return Le lot
+ */
+ public Lot findLotSourceFromProduit(Produit produit) {
+ Produit curProd = produit;
+ while (curProd.isFraction()) {
+ Fraction curFraction = (Fraction) curProd;
+ curProd = curFraction.getPurification().getProduit();
+ }
+ AssertTools.assertClassOrInterface(curProd, Extrait.class);
- Extrait extrait = (Extrait) curProd;
+ Extrait extrait = (Extrait) curProd;
- return extrait.getExtraction().getLot();
- }
+ return extrait.getExtraction().getLot();
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Specimen.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Specimen.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Specimen.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -69,370 +69,370 @@
})
public class Specimen extends AbstractModel implements Comparable<Specimen> {
- /**
- * Types d'organisme pour un spécimen
- */
- public enum TypeOrganisme implements Comparable<TypeOrganisme> {
- /** Plante */
- PLANTE,
- /** Organisme marin */
- ORGANISME_MARIN,
- /** Microorganisme */
- MICROORGANISME,
- /** Insecte */
- INSECTE,
- /** Champignon */
- CHAMPIGNON,
- /** Lichen */
- LICHEN,
- /** Autre */
- AUTRE
- }
+ /**
+ * Types d'organisme pour un spécimen
+ */
+ public enum TypeOrganisme implements Comparable<TypeOrganisme> {
+ /** Plante */
+ PLANTE,
+ /** Organisme marin */
+ ORGANISME_MARIN,
+ /** Microorganisme */
+ MICROORGANISME,
+ /** Insecte */
+ INSECTE,
+ /** Champignon */
+ CHAMPIGNON,
+ /** Lichen */
+ LICHEN,
+ /** Autre */
+ AUTRE
+ }
- /** ID */
- @Id
- @GeneratedValue
- private Integer idSpecimen;
+ /** ID */
+ @Id
+ @GeneratedValue
+ private Integer idSpecimen;
- /** Nom */
- @Column(unique = true)
- @NotEmpty
- @Length(max = LENGTH_TINY_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Nom */
+ @Column(unique = true)
+ @NotEmpty
+ @Length(max = LENGTH_TINY_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Embranchement */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String embranchement;
+ /** Embranchement */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String embranchement;
- /** Famille */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String famille;
+ /** Famille */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String famille;
- /** Genre */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String genre;
+ /** Genre */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String genre;
- /** Espèce */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String espece;
+ /** Espèce */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String espece;
- /** Sous-espèce */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String sousEspece;
+ /** Sous-espèce */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String sousEspece;
- /** Embranchement */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String variete;
+ /** Embranchement */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String variete;
- /** Type d'organisme */
- @NotNull
- @Enumerated(EnumType.ORDINAL)
- private TypeOrganisme typeOrganisme;
+ /** Type d'organisme */
+ @NotNull
+ @Enumerated(EnumType.ORDINAL)
+ private TypeOrganisme typeOrganisme;
- /** Créateur */
- @ManyToOne(fetch = FetchType.EAGER)
- private Personne identificateur;
+ /** Créateur */
+ @ManyToOne(fetch = FetchType.EAGER)
+ private Personne identificateur;
- /** Date dépôt */
- @Temporal(TemporalType.DATE)
- private Date dateDepot;
+ /** Date dépôt */
+ @Temporal(TemporalType.DATE)
+ private Date dateDepot;
- /** Embranchement */
- @Length(max = LENGTH_TINY_TEXT)
- private String numDepot;
+ /** Embranchement */
+ @Length(max = LENGTH_TINY_TEXT)
+ private String numDepot;
- /** Embranchement */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String lieuDepot;
+ /** Embranchement */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String lieuDepot;
- /** Station */
- @ManyToOne(fetch = FetchType.EAGER)
- @IndexedEmbedded(depth=1)
- private Station station;
+ /** Station */
+ @ManyToOne(fetch = FetchType.EAGER)
+ @IndexedEmbedded(depth=1)
+ private Station station;
- /** Compléments d'information */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Compléments d'information */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- @IndexedEmbedded
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @IndexedEmbedded
+ private Personne createur;
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Specimen specimen) {
- return new BeanComparator("ref").compare(this, specimen);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Specimen specimen) {
+ return new BeanComparator("ref").compare(this, specimen);
+ }
- /**
- * idSpecimen getter
- * @return idSpecimen
- */
- public Integer getIdSpecimen() {
- return idSpecimen;
- }
+ /**
+ * idSpecimen getter
+ * @return idSpecimen
+ */
+ public Integer getIdSpecimen() {
+ return idSpecimen;
+ }
- /**
- * idSpecimen setter
- * @param idSpecimen idSpecimen
- */
- public void setIdSpecimen(Integer idSpecimen) {
- this.idSpecimen = idSpecimen;
- }
+ /**
+ * idSpecimen setter
+ * @param idSpecimen idSpecimen
+ */
+ public void setIdSpecimen(Integer idSpecimen) {
+ this.idSpecimen = idSpecimen;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * embranchement getter
- * @return embranchement
- */
- public String getEmbranchement() {
- return embranchement;
- }
+ /**
+ * embranchement getter
+ * @return embranchement
+ */
+ public String getEmbranchement() {
+ return embranchement;
+ }
- /**
- * embranchement setter
- * @param embranchement embranchement
- */
- public void setEmbranchement(String embranchement) {
- this.embranchement = embranchement;
- }
+ /**
+ * embranchement setter
+ * @param embranchement embranchement
+ */
+ public void setEmbranchement(String embranchement) {
+ this.embranchement = embranchement;
+ }
- /**
- * famille getter
- * @return famille
- */
- public String getFamille() {
- return famille;
- }
+ /**
+ * famille getter
+ * @return famille
+ */
+ public String getFamille() {
+ return famille;
+ }
- /**
- * famille setter
- * @param famille famille
- */
- public void setFamille(String famille) {
- this.famille = famille;
- }
+ /**
+ * famille setter
+ * @param famille famille
+ */
+ public void setFamille(String famille) {
+ this.famille = famille;
+ }
- /**
- * genre getter
- * @return genre
- */
- public String getGenre() {
- return genre;
- }
+ /**
+ * genre getter
+ * @return genre
+ */
+ public String getGenre() {
+ return genre;
+ }
- /**
- * genre setter
- * @param genre genre
- */
- public void setGenre(String genre) {
- this.genre = genre;
- }
+ /**
+ * genre setter
+ * @param genre genre
+ */
+ public void setGenre(String genre) {
+ this.genre = genre;
+ }
- /**
- * espece getter
- * @return espece
- */
- public String getEspece() {
- return espece;
- }
+ /**
+ * espece getter
+ * @return espece
+ */
+ public String getEspece() {
+ return espece;
+ }
- /**
- * espece setter
- * @param espece espece
- */
- public void setEspece(String espece) {
- this.espece = espece;
- }
+ /**
+ * espece setter
+ * @param espece espece
+ */
+ public void setEspece(String espece) {
+ this.espece = espece;
+ }
- /**
- * sousEspece getter
- * @return sousEspece
- */
- public String getSousEspece() {
- return sousEspece;
- }
+ /**
+ * sousEspece getter
+ * @return sousEspece
+ */
+ public String getSousEspece() {
+ return sousEspece;
+ }
- /**
- * sousEspece setter
- * @param sousEspece sousEspece
- */
- public void setSousEspece(String sousEspece) {
- this.sousEspece = sousEspece;
- }
+ /**
+ * sousEspece setter
+ * @param sousEspece sousEspece
+ */
+ public void setSousEspece(String sousEspece) {
+ this.sousEspece = sousEspece;
+ }
- /**
- * variete getter
- * @return variete
- */
- public String getVariete() {
- return variete;
- }
+ /**
+ * variete getter
+ * @return variete
+ */
+ public String getVariete() {
+ return variete;
+ }
- /**
- * variete setter
- * @param variete variete
- */
- public void setVariete(String variete) {
- this.variete = variete;
- }
+ /**
+ * variete setter
+ * @param variete variete
+ */
+ public void setVariete(String variete) {
+ this.variete = variete;
+ }
- /**
- * typeOrganisme getter
- * @return typeOrganisme
- */
- public TypeOrganisme getTypeOrganisme() {
- return typeOrganisme;
- }
+ /**
+ * typeOrganisme getter
+ * @return typeOrganisme
+ */
+ public TypeOrganisme getTypeOrganisme() {
+ return typeOrganisme;
+ }
- /**
- * typeOrganisme setter
- * @param typeOrganisme typeOrganisme
- */
- public void setTypeOrganisme(TypeOrganisme typeOrganisme) {
- this.typeOrganisme = typeOrganisme;
- }
+ /**
+ * typeOrganisme setter
+ * @param typeOrganisme typeOrganisme
+ */
+ public void setTypeOrganisme(TypeOrganisme typeOrganisme) {
+ this.typeOrganisme = typeOrganisme;
+ }
- /**
- * identificateur getter
- * @return identificateur
- */
- public Personne getIdentificateur() {
- return identificateur;
- }
+ /**
+ * identificateur getter
+ * @return identificateur
+ */
+ public Personne getIdentificateur() {
+ return identificateur;
+ }
- /**
- * identificateur setter
- * @param identificateur identificateur
- */
- public void setIdentificateur(Personne identificateur) {
- this.identificateur = identificateur;
- }
+ /**
+ * identificateur setter
+ * @param identificateur identificateur
+ */
+ public void setIdentificateur(Personne identificateur) {
+ this.identificateur = identificateur;
+ }
- /**
- * dateDepot getter
- * @return dateDepot
- */
- public Date getDateDepot() {
- return dateDepot;
- }
+ /**
+ * dateDepot getter
+ * @return dateDepot
+ */
+ public Date getDateDepot() {
+ return dateDepot;
+ }
- /**
- * dateDepot setter
- * @param dateDepot dateDepot
- */
- public void setDateDepot(Date dateDepot) {
- this.dateDepot = dateDepot;
- }
+ /**
+ * dateDepot setter
+ * @param dateDepot dateDepot
+ */
+ public void setDateDepot(Date dateDepot) {
+ this.dateDepot = dateDepot;
+ }
- /**
- * numDepot getter
- * @return numDepot
- */
- public String getNumDepot() {
- return numDepot;
- }
+ /**
+ * numDepot getter
+ * @return numDepot
+ */
+ public String getNumDepot() {
+ return numDepot;
+ }
- /**
- * numDepot setter
- * @param numDepot numDepot
- */
- public void setNumDepot(String numDepot) {
- this.numDepot = numDepot;
- }
+ /**
+ * numDepot setter
+ * @param numDepot numDepot
+ */
+ public void setNumDepot(String numDepot) {
+ this.numDepot = numDepot;
+ }
- /**
- * lieuDepot getter
- * @return lieuDepot
- */
- public String getLieuDepot() {
- return lieuDepot;
- }
+ /**
+ * lieuDepot getter
+ * @return lieuDepot
+ */
+ public String getLieuDepot() {
+ return lieuDepot;
+ }
- /**
- * lieuDepot setter
- * @param lieuDepot lieuDepot
- */
- public void setLieuDepot(String lieuDepot) {
- this.lieuDepot = lieuDepot;
- }
+ /**
+ * lieuDepot setter
+ * @param lieuDepot lieuDepot
+ */
+ public void setLieuDepot(String lieuDepot) {
+ this.lieuDepot = lieuDepot;
+ }
- /**
- * station getter
- * @return station
- */
- public Station getStation() {
- return station;
- }
+ /**
+ * station getter
+ * @return station
+ */
+ public Station getStation() {
+ return station;
+ }
- /**
- * station setter
- * @param station station
- */
- public void setStation(Station station) {
- this.station = station;
- }
+ /**
+ * station setter
+ * @param station station
+ */
+ public void setStation(Station station) {
+ this.station = station;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Station.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Station.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Station.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -74,293 +74,293 @@
})
public class Station extends AbstractModel implements Cloneable, Comparable<Station> {
- /** ID */
- @Id
- @GeneratedValue
- private Integer idStation;
+ /** ID */
+ @Id
+ @GeneratedValue
+ private Integer idStation;
- /** Nom */
- @Column(unique = true)
- @NotEmpty
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String nom;
+ /** Nom */
+ @Column(unique = true)
+ @NotEmpty
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String nom;
- /** Code pays */
- @NotNull
- @Length(min = 2, max = 2)
- @CountryCode
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String codePays;
+ /** Code pays */
+ @NotNull
+ @Length(min = 2, max = 2)
+ @CountryCode
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String codePays;
- /** Complément */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Complément */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- @IndexedEmbedded
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @IndexedEmbedded
+ private Personne createur;
- /** Localité */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String localite;
+ /** Localité */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String localite;
- /** Latitude */
- @Latitude
- private String latitude;
+ /** Latitude */
+ @Latitude
+ private String latitude;
- /** Longitude */
- @Longitude
- private String longitude;
+ /** Longitude */
+ @Longitude
+ private String longitude;
- /** Référentiel */
- @Referentiel
- private Integer referentiel;
+ /** Référentiel */
+ @Referentiel
+ private Integer referentiel;
- /** Lots */
- @NotNull
- @OneToMany(mappedBy = "station", fetch = FetchType.LAZY)
- private List<Lot> lots;
+ /** Lots */
+ @NotNull
+ @OneToMany(mappedBy = "station", fetch = FetchType.LAZY)
+ private List<Lot> lots;
- /** Stations */
- @NotNull
- @ManyToMany(mappedBy = "stations", fetch = FetchType.LAZY)
- private List<Campagne> campagnes;
+ /** Stations */
+ @NotNull
+ @ManyToMany(mappedBy = "stations", fetch = FetchType.LAZY)
+ private List<Campagne> campagnes;
- /** Spécimens de référence qui sont rattachés à cette station */
- @OneToMany(mappedBy = "station", fetch = FetchType.LAZY)
- private List<Specimen> specimensRattaches;
+ /** Spécimens de référence qui sont rattachés à cette station */
+ @OneToMany(mappedBy = "station", fetch = FetchType.LAZY)
+ private List<Specimen> specimensRattaches;
- /**
- * Constructeur
- */
- public Station() {
- lots = new ArrayList<Lot>();
- campagnes = new ArrayList<Campagne>();
- }
+ /**
+ * Constructeur
+ */
+ public Station() {
+ lots = new ArrayList<Lot>();
+ campagnes = new ArrayList<Campagne>();
+ }
- /** {@inheritDoc} */
- @Override
- public Station clone() throws CloneNotSupportedException {
- Station clone = (Station) super.clone();
- clone.idStation = idStation;
- clone.nom = nom;
- clone.codePays = codePays;
- clone.complement = complement;
- clone.createur = createur;
- clone.localite = localite;
- clone.latitude = latitude;
- clone.longitude = longitude;
- clone.referentiel = referentiel;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Station clone() throws CloneNotSupportedException {
+ Station clone = (Station) super.clone();
+ clone.idStation = idStation;
+ clone.nom = nom;
+ clone.codePays = codePays;
+ clone.complement = complement;
+ clone.createur = createur;
+ clone.localite = localite;
+ clone.latitude = latitude;
+ clone.longitude = longitude;
+ clone.referentiel = referentiel;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(Station station) {
- return new BeanComparator("nom").compare(this, station);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(Station station) {
+ return new BeanComparator("nom").compare(this, station);
+ }
- /**
- * idStation getter
- * @return idStation
- */
- public Integer getIdStation() {
- return idStation;
- }
+ /**
+ * idStation getter
+ * @return idStation
+ */
+ public Integer getIdStation() {
+ return idStation;
+ }
- /**
- * idStation setter
- * @param idStation idStation
- */
- public void setIdStation(Integer idStation) {
- this.idStation = idStation;
- }
+ /**
+ * idStation setter
+ * @param idStation idStation
+ */
+ public void setIdStation(Integer idStation) {
+ this.idStation = idStation;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * codePays getter
- * @return codePays
- */
- public String getCodePays() {
- return codePays;
- }
+ /**
+ * codePays getter
+ * @return codePays
+ */
+ public String getCodePays() {
+ return codePays;
+ }
- /**
- * codePays setter
- * @param codePays codePays
- */
- public void setCodePays(String codePays) {
- this.codePays = codePays;
- }
+ /**
+ * codePays setter
+ * @param codePays codePays
+ */
+ public void setCodePays(String codePays) {
+ this.codePays = codePays;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * localite getter
- * @return localite
- */
- public String getLocalite() {
- return localite;
- }
+ /**
+ * localite getter
+ * @return localite
+ */
+ public String getLocalite() {
+ return localite;
+ }
- /**
- * localite setter
- * @param localite localite
- */
- public void setLocalite(String localite) {
- this.localite = localite;
- }
+ /**
+ * localite setter
+ * @param localite localite
+ */
+ public void setLocalite(String localite) {
+ this.localite = localite;
+ }
- /**
- * latitude getter
- * @return latitude
- */
- public String getLatitude() {
- return latitude;
- }
+ /**
+ * latitude getter
+ * @return latitude
+ */
+ public String getLatitude() {
+ return latitude;
+ }
- /**
- * latitude setter
- * @param latitude latitude
- */
- public void setLatitude(String latitude) {
- this.latitude = latitude;
- }
+ /**
+ * latitude setter
+ * @param latitude latitude
+ */
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
- /**
- * longitude getter
- * @return longitude
- */
- public String getLongitude() {
- return longitude;
- }
+ /**
+ * longitude getter
+ * @return longitude
+ */
+ public String getLongitude() {
+ return longitude;
+ }
- /**
- * longitude setter
- * @param longitude longitude
- */
- public void setLongitude(String longitude) {
- this.longitude = longitude;
- }
+ /**
+ * longitude setter
+ * @param longitude longitude
+ */
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
- /**
- * referentiel getter
- * @return referentiel
- */
- public Integer getReferentiel() {
- return referentiel;
- }
+ /**
+ * referentiel getter
+ * @return referentiel
+ */
+ public Integer getReferentiel() {
+ return referentiel;
+ }
- /**
- * referentiel setter
- * @param referentiel referentiel
- */
- public void setReferentiel(Integer referentiel) {
- this.referentiel = referentiel;
- }
+ /**
+ * referentiel setter
+ * @param referentiel referentiel
+ */
+ public void setReferentiel(Integer referentiel) {
+ this.referentiel = referentiel;
+ }
- /**
- * lots getter
- * @return lots
- */
- public List<Lot> getLots() {
- return lots;
- }
+ /**
+ * lots getter
+ * @return lots
+ */
+ public List<Lot> getLots() {
+ return lots;
+ }
- /**
- * lots setter
- * @param lots lots
- */
- public void setLots(List<Lot> lots) {
- this.lots = lots;
- }
+ /**
+ * lots setter
+ * @param lots lots
+ */
+ public void setLots(List<Lot> lots) {
+ this.lots = lots;
+ }
- /**
- * campagnes getter
- * @return campagnes
- */
- public List<Campagne> getCampagnes() {
- return campagnes;
- }
+ /**
+ * campagnes getter
+ * @return campagnes
+ */
+ public List<Campagne> getCampagnes() {
+ return campagnes;
+ }
- /**
- * campagnes setter
- * @param campagnes campagnes
- */
- public void setCampagnes(List<Campagne> campagnes) {
- this.campagnes = campagnes;
- }
+ /**
+ * campagnes setter
+ * @param campagnes campagnes
+ */
+ public void setCampagnes(List<Campagne> campagnes) {
+ this.campagnes = campagnes;
+ }
- /**
- * specimensRattaches getter
- * @return specimensRattaches
- */
- public List<Specimen> getSpecimensRattaches() {
- return specimensRattaches;
- }
+ /**
+ * specimensRattaches getter
+ * @return specimensRattaches
+ */
+ public List<Specimen> getSpecimensRattaches() {
+ return specimensRattaches;
+ }
- /**
- * specimensRattaches setter
- * @param specimensRattaches specimensRattaches
- */
- public void setSpecimensRattaches(List<Specimen> specimensRattaches) {
- this.specimensRattaches = specimensRattaches;
- }
+ /**
+ * specimensRattaches setter
+ * @param specimensRattaches specimensRattaches
+ */
+ public void setSpecimensRattaches(List<Specimen> specimensRattaches) {
+ this.specimensRattaches = specimensRattaches;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TestBio.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TestBio.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TestBio.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -73,329 +73,329 @@
@Embeddable
public class TestBio extends AbstractModel implements Comparable<TestBio> {
- /** Id du test bio */
- @Id
- @GeneratedValue
- private Integer idTestBio;
+ /** Id du test bio */
+ @Id
+ @GeneratedValue
+ private Integer idTestBio;
- /** Référence de la manip */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @Column(unique = true)
- @NotEmpty
- @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
- private String ref;
+ /** Référence de la manip */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Column(unique = true)
+ @NotEmpty
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String ref;
- /** Manipulateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Personne manipulateur;
+ /** Manipulateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Personne manipulateur;
- /** Organisme qui a effectué le test biologique **/
- @NotNull
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String organismeTesteur;
+ /** Organisme qui a effectué le test biologique **/
+ @NotNull
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String organismeTesteur;
- /** Date de la manip */
- @NotNull
- @Temporal(TemporalType.DATE)
- private Date date;
+ /** Date de la manip */
+ @NotNull
+ @Temporal(TemporalType.DATE)
+ private Date date;
- /** Méthode pour la purification **/
- @NotNull
- @ManyToOne(fetch = FetchType.EAGER, optional = false)
- @IndexedEmbedded
- private MethodeTestBio methode;
+ /** Méthode pour la purification **/
+ @NotNull
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @IndexedEmbedded
+ private MethodeTestBio methode;
- /** Concentration/masse utilisé par défaut pour les résultats **/
- @Min(value = 0)
- @Max(value = DataContext.DECIMAL_MAX)
- @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
- private BigDecimal concMasseDefaut;
+ /** Concentration/masse utilisé par défaut pour les résultats **/
+ @Min(value = 0)
+ @Max(value = DataContext.DECIMAL_MAX)
+ @Column(precision = DataContext.DECIMAL_PRECISION, scale = DataContext.DECIMAL_SCALE)
+ private BigDecimal concMasseDefaut;
- /** Unité utilisé pour la concentration/masse par défaut */
- @Enumerated(EnumType.ORDINAL)
- private UniteConcMasse uniteConcMasseDefaut;
+ /** Unité utilisé pour la concentration/masse par défaut */
+ @Enumerated(EnumType.ORDINAL)
+ private UniteConcMasse uniteConcMasseDefaut;
- /** Référence de la manip */
- private Stade stadeDefaut;
+ /** Référence de la manip */
+ private Stade stadeDefaut;
- /** Commentaire pour la manip */
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String complement;
+ /** Commentaire pour la manip */
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String complement;
- /** Détermine si la manip doit être confidentielle */
- private boolean confidentiel;
+ /** Détermine si la manip doit être confidentielle */
+ private boolean confidentiel;
- /** Date jusqu'à laquelle la manip est confidentielle */
- @Future
- @Temporal(TemporalType.DATE)
- private Date dateConfidentialite;
+ /** Date jusqu'à laquelle la manip est confidentielle */
+ @Future
+ @Temporal(TemporalType.DATE)
+ private Date dateConfidentialite;
- /** Créateur */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private Personne createur;
+ /** Créateur */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private Personne createur;
- /** Résultats produits par le test */
- @NotNull
- @OneToMany(mappedBy = "testBio", fetch = FetchType.LAZY, orphanRemoval = true)
- @Cascade({ CascadeType.SAVE_UPDATE })
- @ContainedIn
- private List<ResultatTestBio> resultats;
+ /** Résultats produits par le test */
+ @NotNull
+ @OneToMany(mappedBy = "testBio", fetch = FetchType.LAZY, orphanRemoval = true)
+ @Cascade({ CascadeType.SAVE_UPDATE })
+ @ContainedIn
+ private List<ResultatTestBio> resultats;
- /**
- * Constructeur
- */
- public TestBio() {
- resultats = new ArrayList<ResultatTestBio>();
- }
+ /**
+ * Constructeur
+ */
+ public TestBio() {
+ resultats = new ArrayList<ResultatTestBio>();
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return ref;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return ref;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(TestBio testBio) {
- return new BeanComparator("ref").compare(this, testBio);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(TestBio testBio) {
+ return new BeanComparator("ref").compare(this, testBio);
+ }
- /**
- * Rend les résultats triés en utilisant le comparateur {@link ResultatsOfTestBioComp}
- * @return resultats
- */
- public List<ResultatTestBio> getSortedResultats() {
- // comme "@Sort(type = SortType.COMPARATOR, comparator = ResultatsOfTestBioComp.class)" ne rend pas une
- // liste triée avec List, tri dans le getter
- Collections.sort(resultats, new ResultatsOfTestBioComp());
- return resultats;
- }
+ /**
+ * Rend les résultats triés en utilisant le comparateur {@link ResultatsOfTestBioComp}
+ * @return resultats
+ */
+ public List<ResultatTestBio> getSortedResultats() {
+ // comme "@Sort(type = SortType.COMPARATOR, comparator = ResultatsOfTestBioComp.class)" ne rend pas une
+ // liste triée avec List, tri dans le getter
+ Collections.sort(resultats, new ResultatsOfTestBioComp());
+ return resultats;
+ }
- /**
- * idTestBio getter
- * @return idTestBio
- */
- public Integer getIdTestBio() {
- return idTestBio;
- }
+ /**
+ * idTestBio getter
+ * @return idTestBio
+ */
+ public Integer getIdTestBio() {
+ return idTestBio;
+ }
- /**
- * idTestBio setter
- * @param idTestBio idTestBio
- */
- public void setIdTestBio(Integer idTestBio) {
- this.idTestBio = idTestBio;
- }
+ /**
+ * idTestBio setter
+ * @param idTestBio idTestBio
+ */
+ public void setIdTestBio(Integer idTestBio) {
+ this.idTestBio = idTestBio;
+ }
- /**
- * ref getter
- * @return ref
- */
- public String getRef() {
- return ref;
- }
+ /**
+ * ref getter
+ * @return ref
+ */
+ public String getRef() {
+ return ref;
+ }
- /**
- * ref setter
- * @param ref ref
- */
- public void setRef(String ref) {
- this.ref = ref;
- }
+ /**
+ * ref setter
+ * @param ref ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
- /**
- * manipulateur getter
- * @return manipulateur
- */
- public Personne getManipulateur() {
- return manipulateur;
- }
+ /**
+ * manipulateur getter
+ * @return manipulateur
+ */
+ public Personne getManipulateur() {
+ return manipulateur;
+ }
- /**
- * manipulateur setter
- * @param manipulateur manipulateur
- */
- public void setManipulateur(Personne manipulateur) {
- this.manipulateur = manipulateur;
- }
+ /**
+ * manipulateur setter
+ * @param manipulateur manipulateur
+ */
+ public void setManipulateur(Personne manipulateur) {
+ this.manipulateur = manipulateur;
+ }
- /**
- * organismeTesteur getter
- * @return organismeTesteur
- */
- public String getOrganismeTesteur() {
- return organismeTesteur;
- }
+ /**
+ * organismeTesteur getter
+ * @return organismeTesteur
+ */
+ public String getOrganismeTesteur() {
+ return organismeTesteur;
+ }
- /**
- * organismeTesteur setter
- * @param organismeTesteur organismeTesteur
- */
- public void setOrganismeTesteur(String organismeTesteur) {
- this.organismeTesteur = organismeTesteur;
- }
+ /**
+ * organismeTesteur setter
+ * @param organismeTesteur organismeTesteur
+ */
+ public void setOrganismeTesteur(String organismeTesteur) {
+ this.organismeTesteur = organismeTesteur;
+ }
- /**
- * date getter
- * @return date
- */
- public Date getDate() {
- return date;
- }
+ /**
+ * date getter
+ * @return date
+ */
+ public Date getDate() {
+ return date;
+ }
- /**
- * date setter
- * @param date date
- */
- public void setDate(Date date) {
- this.date = date;
- }
+ /**
+ * date setter
+ * @param date date
+ */
+ public void setDate(Date date) {
+ this.date = date;
+ }
- /**
- * methode getter
- * @return methode
- */
- public MethodeTestBio getMethode() {
- return methode;
- }
+ /**
+ * methode getter
+ * @return methode
+ */
+ public MethodeTestBio getMethode() {
+ return methode;
+ }
- /**
- * methode setter
- * @param methode methode
- */
- public void setMethode(MethodeTestBio methode) {
- this.methode = methode;
- }
+ /**
+ * methode setter
+ * @param methode methode
+ */
+ public void setMethode(MethodeTestBio methode) {
+ this.methode = methode;
+ }
- /**
- * concMasseDefaut getter
- * @return concMasseDefaut
- */
- public BigDecimal getConcMasseDefaut() {
- return concMasseDefaut;
- }
+ /**
+ * concMasseDefaut getter
+ * @return concMasseDefaut
+ */
+ public BigDecimal getConcMasseDefaut() {
+ return concMasseDefaut;
+ }
- /**
- * concMasseDefaut setter
- * @param concMasseDefaut concMasseDefaut
- */
- public void setConcMasseDefaut(BigDecimal concMasseDefaut) {
- this.concMasseDefaut = concMasseDefaut;
- }
+ /**
+ * concMasseDefaut setter
+ * @param concMasseDefaut concMasseDefaut
+ */
+ public void setConcMasseDefaut(BigDecimal concMasseDefaut) {
+ this.concMasseDefaut = concMasseDefaut;
+ }
- /**
- * uniteConcMasseDefaut getter
- * @return uniteConcMasseDefaut
- */
- public UniteConcMasse getUniteConcMasseDefaut() {
- return uniteConcMasseDefaut;
- }
+ /**
+ * uniteConcMasseDefaut getter
+ * @return uniteConcMasseDefaut
+ */
+ public UniteConcMasse getUniteConcMasseDefaut() {
+ return uniteConcMasseDefaut;
+ }
- /**
- * uniteConcMasseDefaut setter
- * @param uniteConcMasseDefaut uniteConcMasseDefaut
- */
- public void setUniteConcMasseDefaut(UniteConcMasse uniteConcMasseDefaut) {
- this.uniteConcMasseDefaut = uniteConcMasseDefaut;
- }
+ /**
+ * uniteConcMasseDefaut setter
+ * @param uniteConcMasseDefaut uniteConcMasseDefaut
+ */
+ public void setUniteConcMasseDefaut(UniteConcMasse uniteConcMasseDefaut) {
+ this.uniteConcMasseDefaut = uniteConcMasseDefaut;
+ }
- /**
- * stadeDefaut getter
- * @return stadeDefaut
- */
- public Stade getStadeDefaut() {
- return stadeDefaut;
- }
+ /**
+ * stadeDefaut getter
+ * @return stadeDefaut
+ */
+ public Stade getStadeDefaut() {
+ return stadeDefaut;
+ }
- /**
- * stadeDefaut setter
- * @param stadeDefaut stadeDefaut
- */
- public void setStadeDefaut(Stade stadeDefaut) {
- this.stadeDefaut = stadeDefaut;
- }
+ /**
+ * stadeDefaut setter
+ * @param stadeDefaut stadeDefaut
+ */
+ public void setStadeDefaut(Stade stadeDefaut) {
+ this.stadeDefaut = stadeDefaut;
+ }
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * confidentiel getter
- * @return confidentiel
- */
- public boolean isConfidentiel() {
- return confidentiel;
- }
+ /**
+ * confidentiel getter
+ * @return confidentiel
+ */
+ public boolean isConfidentiel() {
+ return confidentiel;
+ }
- /**
- * confidentiel setter
- * @param confidentiel confidentiel
- */
- public void setConfidentiel(boolean confidentiel) {
- this.confidentiel = confidentiel;
- }
+ /**
+ * confidentiel setter
+ * @param confidentiel confidentiel
+ */
+ public void setConfidentiel(boolean confidentiel) {
+ this.confidentiel = confidentiel;
+ }
- /**
- * dateConfidentialite getter
- * @return dateConfidentialite
- */
- public Date getDateConfidentialite() {
- return dateConfidentialite;
- }
+ /**
+ * dateConfidentialite getter
+ * @return dateConfidentialite
+ */
+ public Date getDateConfidentialite() {
+ return dateConfidentialite;
+ }
- /**
- * dateConfidentialite setter
- * @param dateConfidentialite dateConfidentialite
- */
- public void setDateConfidentialite(Date dateConfidentialite) {
- this.dateConfidentialite = dateConfidentialite;
- }
+ /**
+ * dateConfidentialite setter
+ * @param dateConfidentialite dateConfidentialite
+ */
+ public void setDateConfidentialite(Date dateConfidentialite) {
+ this.dateConfidentialite = dateConfidentialite;
+ }
- /**
- * createur getter
- * @return createur
- */
- public Personne getCreateur() {
- return createur;
- }
+ /**
+ * createur getter
+ * @return createur
+ */
+ public Personne getCreateur() {
+ return createur;
+ }
- /**
- * createur setter
- * @param createur createur
- */
- public void setCreateur(Personne createur) {
- this.createur = createur;
- }
+ /**
+ * createur setter
+ * @param createur createur
+ */
+ public void setCreateur(Personne createur) {
+ this.createur = createur;
+ }
- /**
- * resultats getter
- * @return resultats
- */
- public List<ResultatTestBio> getResultats() {
- return resultats;
- }
+ /**
+ * resultats getter
+ * @return resultats
+ */
+ public List<ResultatTestBio> getResultats() {
+ return resultats;
+ }
- /**
- * resultats setter
- * @param resultats resultats
- */
- public void setResultats(List<ResultatTestBio> resultats) {
- this.resultats = resultats;
- }
+ /**
+ * resultats setter
+ * @param resultats resultats
+ */
+ public void setResultats(List<ResultatTestBio> resultats) {
+ this.resultats = resultats;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeDocument.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeDocument.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeDocument.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -46,133 +46,133 @@
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "nom" }) })
public class TypeDocument extends AbstractModel implements Cloneable, Comparable<TypeDocument> {
- /** Document type ID */
- @Id
- @GeneratedValue
- private Integer idTypeDocument;
+ /** Document type ID */
+ @Id
+ @GeneratedValue
+ private Integer idTypeDocument;
- /** Document type name */
- @Length(max = LENGTH_MEDIUM_TEXT)
- @NotEmpty
- @Column(unique = true)
- private String nom;
+ /** Document type name */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @NotEmpty
+ @Column(unique = true)
+ private String nom;
- /** Document type domain */
- @Length(max = LENGTH_MEDIUM_TEXT)
- private String domaine;
+ /** Document type domain */
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ private String domaine;
- /** Document type description */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Document type description */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** If the type document represents an image ? */
- @NotNull
- private Boolean estImage;
+ /** If the type document represents an image ? */
+ @NotNull
+ private Boolean estImage;
- /** {@inheritDoc} */
- @Override
- public TypeDocument clone() throws CloneNotSupportedException {
- TypeDocument clone = (TypeDocument) super.clone();
- clone.idTypeDocument = idTypeDocument;
- clone.nom = nom;
- clone.domaine = domaine;
- clone.description = description;
- clone.estImage = estImage;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public TypeDocument clone() throws CloneNotSupportedException {
+ TypeDocument clone = (TypeDocument) super.clone();
+ clone.idTypeDocument = idTypeDocument;
+ clone.nom = nom;
+ clone.domaine = domaine;
+ clone.description = description;
+ clone.estImage = estImage;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return this.nom;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return this.nom;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(TypeDocument typeExtrait) {
- return new BeanComparator("nom").compare(this, typeExtrait);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(TypeDocument typeExtrait) {
+ return new BeanComparator("nom").compare(this, typeExtrait);
+ }
- /**
- * idTypeDocument getter
- * @return idTypeDocument
- */
- public Integer getIdTypeDocument() {
- return idTypeDocument;
- }
+ /**
+ * idTypeDocument getter
+ * @return idTypeDocument
+ */
+ public Integer getIdTypeDocument() {
+ return idTypeDocument;
+ }
- /**
- * idTypeDocument setter
- * @param idTypeDocument idTypeDocument
- */
- public void setIdTypeDocument(Integer idTypeDocument) {
- this.idTypeDocument = idTypeDocument;
- }
+ /**
+ * idTypeDocument setter
+ * @param idTypeDocument idTypeDocument
+ */
+ public void setIdTypeDocument(Integer idTypeDocument) {
+ this.idTypeDocument = idTypeDocument;
+ }
- /**
- * nom getter
- * @return nom
- */
- public String getNom() {
- return nom;
- }
+ /**
+ * nom getter
+ * @return nom
+ */
+ public String getNom() {
+ return nom;
+ }
- /**
- * nom setter
- * @param nom nom
- */
- public void setNom(String nom) {
- this.nom = nom;
- }
+ /**
+ * nom setter
+ * @param nom nom
+ */
+ public void setNom(String nom) {
+ this.nom = nom;
+ }
- /**
- * domaine getter
- * @return domaine
- */
- public String getDomaine() {
- return domaine;
- }
+ /**
+ * domaine getter
+ * @return domaine
+ */
+ public String getDomaine() {
+ return domaine;
+ }
- /**
- * domaine setter
- * @param domaine domaine
- */
- public void setDomaine(String domaine) {
- this.domaine = domaine;
- }
+ /**
+ * domaine setter
+ * @param domaine domaine
+ */
+ public void setDomaine(String domaine) {
+ this.domaine = domaine;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * estImage getter
- * @return estImage
- */
- public Boolean getEstImage() {
- return estImage;
- }
+ /**
+ * estImage getter
+ * @return estImage
+ */
+ public Boolean getEstImage() {
+ return estImage;
+ }
- /**
- * estImage setter
- * @param estImage estImage
- */
- public void setEstImage(Boolean estImage) {
- this.estImage = estImage;
- }
+ /**
+ * estImage setter
+ * @param estImage estImage
+ */
+ public void setEstImage(Boolean estImage) {
+ this.estImage = estImage;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeExtrait.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeExtrait.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/TypeExtrait.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -47,112 +47,112 @@
@CollectionUniqueField(fieldName = "initiales", pathToCollection = "methodeExtraction.typesEnSortie")
public class TypeExtrait extends AbstractModel implements Cloneable, Comparable<TypeExtrait> {
- /** Id du type d'extrait */
- @Id
- @GeneratedValue
- private Integer idTypeExtrait;
+ /** Id du type d'extrait */
+ @Id
+ @GeneratedValue
+ private Integer idTypeExtrait;
- /** Initiales du type d'extrait */
- @Length(max = LENGTH_TINY_TEXT)
- @NotEmpty
- private String initiales;
+ /** Initiales du type d'extrait */
+ @Length(max = LENGTH_TINY_TEXT)
+ @NotEmpty
+ private String initiales;
- /** Description du type d'extrait */
- @NotEmpty
- @Lob
- @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
- private String description;
+ /** Description du type d'extrait */
+ @NotEmpty
+ @Lob
+ @Type(type="org.hibernate.type.StringClobType") // see HHH-6105
+ private String description;
- /** Méthode d'extraction pour laquelle est défini le type d'extrait */
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY, optional = false)
- private MethodeExtraction methodeExtraction;
+ /** Méthode d'extraction pour laquelle est défini le type d'extrait */
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ private MethodeExtraction methodeExtraction;
- /** {@inheritDoc} */
- @Override
- public TypeExtrait clone() throws CloneNotSupportedException {
- TypeExtrait clone = (TypeExtrait) super.clone();
- clone.idTypeExtrait = idTypeExtrait;
- clone.initiales = initiales;
- clone.description = description;
- clone.methodeExtraction = methodeExtraction;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public TypeExtrait clone() throws CloneNotSupportedException {
+ TypeExtrait clone = (TypeExtrait) super.clone();
+ clone.idTypeExtrait = idTypeExtrait;
+ clone.initiales = initiales;
+ clone.description = description;
+ clone.methodeExtraction = methodeExtraction;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return this.initiales;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return this.initiales;
+ }
- /** {@inheritDoc} */
- @Override
- public int compareTo(TypeExtrait typeExtrait) {
- return new BeanComparator("initiales").compare(this, typeExtrait);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compareTo(TypeExtrait typeExtrait) {
+ return new BeanComparator("initiales").compare(this, typeExtrait);
+ }
- /**
- * idTypeExtrait getter
- * @return idTypeExtrait
- */
- public Integer getIdTypeExtrait() {
- return idTypeExtrait;
- }
+ /**
+ * idTypeExtrait getter
+ * @return idTypeExtrait
+ */
+ public Integer getIdTypeExtrait() {
+ return idTypeExtrait;
+ }
- /**
- * idTypeExtrait setter
- * @param idTypeExtrait idTypeExtrait
- */
- public void setIdTypeExtrait(Integer idTypeExtrait) {
- this.idTypeExtrait = idTypeExtrait;
- }
+ /**
+ * idTypeExtrait setter
+ * @param idTypeExtrait idTypeExtrait
+ */
+ public void setIdTypeExtrait(Integer idTypeExtrait) {
+ this.idTypeExtrait = idTypeExtrait;
+ }
- /**
- * initiales getter
- * @return initiales
- */
- public String getInitiales() {
- return initiales;
- }
+ /**
+ * initiales getter
+ * @return initiales
+ */
+ public String getInitiales() {
+ return initiales;
+ }
- /**
- * initiales setter
- * @param initiales initiales
- */
- public void setInitiales(String initiales) {
- this.initiales = initiales;
- }
+ /**
+ * initiales setter
+ * @param initiales initiales
+ */
+ public void setInitiales(String initiales) {
+ this.initiales = initiales;
+ }
- /**
- * description getter
- * @return description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * description getter
+ * @return description
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * description setter
- * @param description description
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * description setter
+ * @param description description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * methodeExtraction getter
- * @return methodeExtraction
- */
- public MethodeExtraction getMethodeExtraction() {
- return methodeExtraction;
- }
+ /**
+ * methodeExtraction getter
+ * @return methodeExtraction
+ */
+ public MethodeExtraction getMethodeExtraction() {
+ return methodeExtraction;
+ }
- /**
- * methodeExtraction setter
- * @param methodeExtraction methodeExtraction
- */
- public void setMethodeExtraction(MethodeExtraction methodeExtraction) {
- this.methodeExtraction = methodeExtraction;
- }
+ /**
+ * methodeExtraction setter
+ * @param methodeExtraction methodeExtraction
+ */
+ public void setMethodeExtraction(MethodeExtraction methodeExtraction) {
+ this.methodeExtraction = methodeExtraction;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Utilisateur.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Utilisateur.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Utilisateur.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -50,125 +50,125 @@
@Embeddable
public class Utilisateur extends Personne {
- /**
- * Types droits
- */
- public enum TypeDroit implements Comparable<TypeDroit> {
- /** Administrateur */
- ADMINISTRATEUR,
- /** Utilisateur */
- UTILISATEUR
- }
+ /**
+ * Types droits
+ */
+ public enum TypeDroit implements Comparable<TypeDroit> {
+ /** Administrateur */
+ ADMINISTRATEUR,
+ /** Utilisateur */
+ UTILISATEUR
+ }
- /** Date de validité du compte */
- @Temporal(TemporalType.DATE)
- private Date dateValiditeCompte;
+ /** Date de validité du compte */
+ @Temporal(TemporalType.DATE)
+ private Date dateValiditeCompte;
- /** Est-il valide ? */
- @NotNull
- @Index(name = "estValide")
- private Boolean estValide;
+ /** Est-il valide ? */
+ @NotNull
+ @Index(name = "estValide")
+ private Boolean estValide;
- /** Groupe */
- @ManyToOne(fetch = FetchType.LAZY, optional = true)
- private Groupe groupe;
+ /** Groupe */
+ @ManyToOne(fetch = FetchType.LAZY, optional = true)
+ private Groupe groupe;
- /** Mot de passe haché */
- @Length(min = PasswordTools.SHA1_LENGTH, max = PasswordTools.SHA1_LENGTH)
- @NotNull
- private String passwordHash;
+ /** Mot de passe haché */
+ @Length(min = PasswordTools.SHA1_LENGTH, max = PasswordTools.SHA1_LENGTH)
+ @NotNull
+ private String passwordHash;
- /** Type de droit */
- @NotNull
- @Enumerated(EnumType.ORDINAL)
- @Index(name = "typeDroit")
- private TypeDroit typeDroit;
+ /** Type de droit */
+ @NotNull
+ @Enumerated(EnumType.ORDINAL)
+ @Index(name = "typeDroit")
+ private TypeDroit typeDroit;
- /**
- * Constructeur
- */
- public Utilisateur() {
- super();
- }
+ /**
+ * Constructeur
+ */
+ public Utilisateur() {
+ super();
+ }
- /**
- * dateValiditeCompte getter
- * @return dateValiditeCompte
- */
- public Date getDateValiditeCompte() {
- return dateValiditeCompte;
- }
+ /**
+ * dateValiditeCompte getter
+ * @return dateValiditeCompte
+ */
+ public Date getDateValiditeCompte() {
+ return dateValiditeCompte;
+ }
- /**
- * dateValiditeCompte setter
- * @param dateValiditeCompte dateValiditeCompte
- */
- public void setDateValiditeCompte(Date dateValiditeCompte) {
- this.dateValiditeCompte = dateValiditeCompte;
- }
+ /**
+ * dateValiditeCompte setter
+ * @param dateValiditeCompte dateValiditeCompte
+ */
+ public void setDateValiditeCompte(Date dateValiditeCompte) {
+ this.dateValiditeCompte = dateValiditeCompte;
+ }
- /**
- * estValide getter
- * @return estValide
- */
- public Boolean isValide() {
- return estValide;
- }
+ /**
+ * estValide getter
+ * @return estValide
+ */
+ public Boolean isValide() {
+ return estValide;
+ }
- /**
- * estValide setter
- * @param estValide estValide
- */
- public void setValide(Boolean estValide) {
- this.estValide = estValide;
- }
+ /**
+ * estValide setter
+ * @param estValide estValide
+ */
+ public void setValide(Boolean estValide) {
+ this.estValide = estValide;
+ }
- /**
- * groupe getter
- * @return groupe
- */
- public Groupe getGroupe() {
- return groupe;
- }
+ /**
+ * groupe getter
+ * @return groupe
+ */
+ public Groupe getGroupe() {
+ return groupe;
+ }
- /**
- * groupe setter
- * @param groupe groupe
- */
- public void setGroupe(Groupe groupe) {
- this.groupe = groupe;
- }
+ /**
+ * groupe setter
+ * @param groupe groupe
+ */
+ public void setGroupe(Groupe groupe) {
+ this.groupe = groupe;
+ }
- /**
- * passwordHash getter
- * @return passwordHash
- */
- public String getPasswordHash() {
- return passwordHash;
- }
+ /**
+ * passwordHash getter
+ * @return passwordHash
+ */
+ public String getPasswordHash() {
+ return passwordHash;
+ }
- /**
- * passwordHash setter
- * @param passwordHash passwordHash
- */
- public void setPasswordHash(String passwordHash) {
- this.passwordHash = passwordHash;
- }
+ /**
+ * passwordHash setter
+ * @param passwordHash passwordHash
+ */
+ public void setPasswordHash(String passwordHash) {
+ this.passwordHash = passwordHash;
+ }
- /**
- * typeDroit getter
- * @return typeDroit
- */
- public TypeDroit getTypeDroit() {
- return typeDroit;
- }
+ /**
+ * typeDroit getter
+ * @return typeDroit
+ */
+ public TypeDroit getTypeDroit() {
+ return typeDroit;
+ }
- /**
- * typeDroit setter
- * @param typeDroit typeDroit
- */
- public void setTypeDroit(TypeDroit typeDroit) {
- this.typeDroit = typeDroit;
- }
+ /**
+ * typeDroit setter
+ * @param typeDroit typeDroit
+ */
+ public void setTypeDroit(TypeDroit typeDroit) {
+ this.typeDroit = typeDroit;
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/CampagnePersonneDroitsComp.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/CampagnePersonneDroitsComp.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/CampagnePersonneDroitsComp.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,13 +37,13 @@
*/
public class CampagnePersonneDroitsComp implements Comparator<CampagnePersonneDroits> {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** {@inheritDoc} */
- @Override
- public int compare(CampagnePersonneDroits obj1, CampagnePersonneDroits obj2) {
- LOG.debug("compare personnes droit");
- return new BeanComparator("id.pk1").compare(obj1, obj2);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compare(CampagnePersonneDroits obj1, CampagnePersonneDroits obj2) {
+ LOG.debug("compare personnes droit");
+ return new BeanComparator("id.pk1").compare(obj1, obj2);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ExtraitsOfExtractionComp.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ExtraitsOfExtractionComp.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ExtraitsOfExtractionComp.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,11 +34,11 @@
*/
public class ExtraitsOfExtractionComp implements Comparator<Extrait> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** {@inheritDoc} */
- @Override
- public int compare(Extrait obj1, Extrait obj2) {
- return new BeanComparator("typeExtrait.initiales").compare(obj1, obj2);
- }
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** {@inheritDoc} */
+ @Override
+ public int compare(Extrait obj1, Extrait obj2) {
+ return new BeanComparator("typeExtrait.initiales").compare(obj1, obj2);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/FractionsOfPurificationComp.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/FractionsOfPurificationComp.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/FractionsOfPurificationComp.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,11 +36,11 @@
*/
public class FractionsOfPurificationComp implements Comparator<Fraction> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** {@inheritDoc} */
- @Override
- public int compare(Fraction obj1, Fraction obj2) {
- return new BeanComparator("indice", new IntuitiveStringComparator<String>()).compare(obj1, obj2);
- }
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** {@inheritDoc} */
+ @Override
+ public int compare(Fraction obj1, Fraction obj2) {
+ return new BeanComparator("indice", new IntuitiveStringComparator<String>()).compare(obj1, obj2);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/LotPersonneDroitsComp.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/LotPersonneDroitsComp.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/LotPersonneDroitsComp.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,12 +35,12 @@
*/
public class LotPersonneDroitsComp implements Comparator<LotPersonneDroits> {
- /** {@inheritDoc} */
- @Override
- public int compare(LotPersonneDroits obj1, LotPersonneDroits obj2) {
- ComparatorChain comparatorChain = new ComparatorChain();
- comparatorChain.addComparator(new BeanComparator("id.pk1.campagne"));
- comparatorChain.addComparator(new BeanComparator("id.pk1"));
- return comparatorChain.compare(obj1, obj2);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int compare(LotPersonneDroits obj1, LotPersonneDroits obj2) {
+ ComparatorChain comparatorChain = new ComparatorChain();
+ comparatorChain.addComparator(new BeanComparator("id.pk1.campagne"));
+ comparatorChain.addComparator(new BeanComparator("id.pk1"));
+ return comparatorChain.compare(obj1, obj2);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ResultatsOfTestBioComp.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ResultatsOfTestBioComp.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/comparators/ResultatsOfTestBioComp.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,11 +36,11 @@
*/
public class ResultatsOfTestBioComp implements Comparator<ResultatTestBio> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** {@inheritDoc} */
- @Override
- public int compare(ResultatTestBio obj1, ResultatTestBio obj2) {
- return new BeanComparator("repere", new IntuitiveStringComparator<String>()).compare(obj1, obj2);
- }
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** {@inheritDoc} */
+ @Override
+ public int compare(ResultatTestBio obj1, ResultatTestBio obj2) {
+ return new BeanComparator("repere", new IntuitiveStringComparator<String>()).compare(obj1, obj2);
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/AbstractModel.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/AbstractModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/AbstractModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,66 +49,66 @@
*/
public abstract class AbstractModel implements Serializable {
- /** ID fields cache (for each model class name) */
- private static final Map<String, Field> ID_FIELDS = Collections.synchronizedMap(new TreeMap<String, Field>());
+ /** ID fields cache (for each model class name) */
+ private static final Map<String, Field> ID_FIELDS = Collections.synchronizedMap(new TreeMap<String, Field>());
- /** Length: big text */
+ /** Length: big text */
protected static final int LENGTH_BIG_TEXT = 255;
- /** Length: long text */
- protected static final int LENGTH_LONG_TEXT = 100;
+ /** Length: long text */
+ protected static final int LENGTH_LONG_TEXT = 100;
- /** Length: medium text */
- protected static final int LENGTH_MEDIUM_TEXT = 60;
+ /** Length: medium text */
+ protected static final int LENGTH_MEDIUM_TEXT = 60;
- /** Length: tiny text */
- protected static final int LENGTH_TINY_TEXT = 10;
+ /** Length: tiny text */
+ protected static final int LENGTH_TINY_TEXT = 10;
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /**
- * Retrieve the @Id or @EmbeddedId field
- * @return @Id or @EmbeddedId field
- * @throws UnexpectedException If it does not exist
- */
- public final Field getIdField() {
- return getIdField(this.getClass());
- }
+ /**
+ * Retrieve the @Id or @EmbeddedId field
+ * @return @Id or @EmbeddedId field
+ * @throws UnexpectedException If it does not exist
+ */
+ public final Field getIdField() {
+ return getIdField(this.getClass());
+ }
- /**
- * Retrieve the @Id or @EmbeddedId field
- * @param clazz the class of the model
- * @return @Id or @EmbeddedId field
- * @throws UnexpectedException If it does not exist
- */
- @SuppressWarnings("unchecked")
- public final static Field getIdField(final Class<? extends AbstractModel> clazz) {
- AssertTools.assertNotNull(clazz);
- Field field = null;
- String modelClassName = clazz.getName();
- field = ID_FIELDS.get(modelClassName);
+ /**
+ * Retrieve the @Id or @EmbeddedId field
+ * @param clazz the class of the model
+ * @return @Id or @EmbeddedId field
+ * @throws UnexpectedException If it does not exist
+ */
+ @SuppressWarnings("unchecked")
+ public final static Field getIdField(final Class<? extends AbstractModel> clazz) {
+ AssertTools.assertNotNull(clazz);
+ Field field = null;
+ String modelClassName = clazz.getName();
+ field = ID_FIELDS.get(modelClassName);
- if (field == null) {
- try {
- field = BeanTools.getAnnotatedPrivateField(clazz, Id.class, EmbeddedId.class);
- } catch (NoSuchFieldException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- ID_FIELDS.put(modelClassName, field);
- }
+ if (field == null) {
+ try {
+ field = BeanTools.getAnnotatedPrivateField(clazz, Id.class, EmbeddedId.class);
+ } catch (NoSuchFieldException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ ID_FIELDS.put(modelClassName, field);
+ }
- return field;
- }
+ return field;
+ }
- /**
- * Retrieve the @Id or @EmbeddedId field value
- * @return @Id or @EmbeddedId field value
- * @throws UnexpectedException If the field does not exist
- */
- public final Serializable getIdValue() {
- return (Serializable) BeanTools.getValue(this, AccessType.GETTER, getIdField().getName());
- }
+ /**
+ * Retrieve the @Id or @EmbeddedId field value
+ * @return @Id or @EmbeddedId field value
+ * @throws UnexpectedException If the field does not exist
+ */
+ public final Serializable getIdValue() {
+ return (Serializable) BeanTools.getValue(this, AccessType.GETTER, getIdField().getName());
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/CompositeId.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/CompositeId.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/utils/CompositeId.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,69 +37,69 @@
*/
@Embeddable
public class CompositeId<PK1 extends AbstractModel, PK2 extends AbstractModel> extends AbstractModel implements
- Cloneable {
+ Cloneable {
- /** Primary key 1 */
- @ManyToOne
- @NotNull
- private PK1 pk1;
+ /** Primary key 1 */
+ @ManyToOne
+ @NotNull
+ private PK1 pk1;
- /** Primary key 2 */
- @ManyToOne
- @NotNull
- private PK2 pk2;
+ /** Primary key 2 */
+ @ManyToOne
+ @NotNull
+ private PK2 pk2;
- /** {@inheritDoc} */
- @Override
- public CompositeId<PK1, PK2> clone() throws CloneNotSupportedException {
- CompositeId<PK1, PK2> clone = GenericsTools.cast(super.clone());
- clone.pk1 = pk1;
- clone.pk2 = pk2;
- return clone;
- }
+ /** {@inheritDoc} */
+ @Override
+ public CompositeId<PK1, PK2> clone() throws CloneNotSupportedException {
+ CompositeId<PK1, PK2> clone = GenericsTools.cast(super.clone());
+ clone.pk1 = pk1;
+ clone.pk2 = pk2;
+ return clone;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean equals(Object obj) {
- return BeanTools.equals(this, obj, AccessType.GETTER, "pk1", "pk2");
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean equals(Object obj) {
+ return BeanTools.equals(this, obj, AccessType.GETTER, "pk1", "pk2");
+ }
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return BeanTools.hashCode(this, pk1, pk2);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int hashCode() {
+ return BeanTools.hashCode(this, pk1, pk2);
+ }
- /**
- * pk1 getter
- * @return pk1
- */
- public PK1 getPk1() {
- return pk1;
- }
+ /**
+ * pk1 getter
+ * @return pk1
+ */
+ public PK1 getPk1() {
+ return pk1;
+ }
- /**
- * pk1 setter
- * @param pk1 pk1
- */
- public void setPk1(PK1 pk1) {
- this.pk1 = pk1;
- }
+ /**
+ * pk1 setter
+ * @param pk1 pk1
+ */
+ public void setPk1(PK1 pk1) {
+ this.pk1 = pk1;
+ }
- /**
- * pk2 getter
- * @return pk2
- */
- public PK2 getPk2() {
- return pk2;
- }
+ /**
+ * pk2 getter
+ * @return pk2
+ */
+ public PK2 getPk2() {
+ return pk2;
+ }
- /**
- * pk2 setter
- * @param pk2 pk2
- */
- public void setPk2(PK2 pk2) {
- this.pk2 = pk2;
- }
+ /**
+ * pk2 setter
+ * @param pk2 pk2
+ */
+ public void setPk2(PK2 pk2) {
+ this.pk2 = pk2;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueField.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueField.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueField.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,28 +42,28 @@
@Documented
public @interface CollectionUniqueField {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.UniqueFieldList.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.UniqueFieldList.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
- /**
- * @return the properties path to access the collection which contain the beans. Example : beanX.cols
- */
- String pathToCollection();
+ /**
+ * @return the properties path to access the collection which contain the beans. Example : beanX.cols
+ */
+ String pathToCollection();
- /**
- * @return the name of the field which must be unique
- */
- String fieldName();
+ /**
+ * @return the name of the field which must be unique
+ */
+ String fieldName();
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueFieldValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueFieldValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CollectionUniqueFieldValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,35 +38,35 @@
*/
public final class CollectionUniqueFieldValidator implements ConstraintValidator<CollectionUniqueField, Object> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /**
- * field name of the list which must be unique
- */
- String fieldName;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /**
+ * field name of the list which must be unique
+ */
+ String fieldName;
- /**
- * properties path to access the collection which contain the beans, example : beanX.beanY.collZ
- */
- String pathToCollection;
+ /**
+ * properties path to access the collection which contain the beans, example : beanX.beanY.collZ
+ */
+ String pathToCollection;
- /** {@inheritDoc} */
- @Override
- public void initialize(CollectionUniqueField annotation) {
- this.fieldName = annotation.fieldName();
- this.pathToCollection = annotation.pathToCollection();
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(CollectionUniqueField annotation) {
+ this.fieldName = annotation.fieldName();
+ this.pathToCollection = annotation.pathToCollection();
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {
- Collection<Object> collection = GenericsTools.cast(BeanTools.getValueFromPath(value, AccessType.GETTER,
- this.pathToCollection));
- Object propertyVal = BeanTools.getValue(value, AccessType.GETTER, fieldName);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {
+ Collection<Object> collection = GenericsTools.cast(BeanTools.getValueFromPath(value, AccessType.GETTER,
+ this.pathToCollection));
+ Object propertyVal = BeanTools.getValue(value, AccessType.GETTER, fieldName);
- // each value of the field must have one occurrence in the collection
- return (propertyVal == null)
- || CollectionTools.countWithValue(collection, fieldName, AccessType.GETTER, propertyVal) == 1;
- }
+ // each value of the field must have one occurrence in the collection
+ return (propertyVal == null)
+ || CollectionTools.countWithValue(collection, fieldName, AccessType.GETTER, propertyVal) == 1;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCode.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCode.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCode.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = CountryCodeValidator.class)
@Documented
public @interface CountryCode {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.CountryCode.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.CountryCode.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCodeValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCodeValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/CountryCodeValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,15 +34,15 @@
*/
public final class CountryCodeValidator implements ConstraintValidator<CountryCode, String> {
- /** {@inheritDoc} */
- @Override
- public void initialize(CountryCode annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(CountryCode annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(String countryCode, ConstraintValidatorContext constraintContext) {
- return countryCode == null || DataContext.COUNTRY_CODES.contains(countryCode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(String countryCode, ConstraintValidatorContext constraintContext) {
+ return countryCode == null || DataContext.COUNTRY_CODES.contains(countryCode);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueField.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueField.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueField.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,29 +44,29 @@
@Documented
public @interface DbUniqueField {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.UniqueFieldList.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.UniqueFieldList.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
- /**
- * @return The classe which contain the unique field
- */
- Class<? extends AbstractModel> entity();
+ /**
+ * @return The classe which contain the unique field
+ */
+ Class<? extends AbstractModel> entity();
- /**
- * @return the name of the field which must be unique
- */
- String fieldName();
+ /**
+ * @return the name of the field which must be unique
+ */
+ String fieldName();
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueFieldValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueFieldValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/DbUniqueFieldValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,50 +42,50 @@
*/
public final class DbUniqueFieldValidator implements ConstraintValidator<DbUniqueField, Object> {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /**
- * field name of the list which must be unique
- */
- String fieldName;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /**
+ * field name of the list which must be unique
+ */
+ String fieldName;
- /**
- * The classe which contain the unique field
- */
- Class<? extends AbstractModel> entity;
+ /**
+ * The classe which contain the unique field
+ */
+ Class<? extends AbstractModel> entity;
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public void initialize(DbUniqueField annotation) {
- this.fieldName = annotation.fieldName();
- this.entity = annotation.entity();
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(DbUniqueField annotation) {
+ this.fieldName = annotation.fieldName();
+ this.entity = annotation.entity();
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {
- AssertTools.assertNotNull(value);
- Serializable fieldVal = (Serializable) BeanTools.getValue(value, AccessType.GETTER, fieldName);
- if (fieldVal == null) {
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {
+ AssertTools.assertNotNull(value);
+ Serializable fieldVal = (Serializable) BeanTools.getValue(value, AccessType.GETTER, fieldName);
+ if (fieldVal == null) {
+ return false;
+ }
- // valid if it doesn't exist different value or if it exists but with the same id (so same row in the db)
- if (!dao.exists(entity, fieldName, fieldVal)) {
- return true;
- }
- AbstractModel modelForm = (AbstractModel) value;
- AbstractModel modelWithSameVal;
- try {
- modelWithSameVal = dao.read(entity, fieldName, fieldVal);
- } catch (DataNotFoundException e) {
- return true; // never call, cover by dao.exists...
- }
- return modelForm.getIdValue().equals(modelWithSameVal.getIdValue());
- }
+ // valid if it doesn't exist different value or if it exists but with the same id (so same row in the db)
+ if (!dao.exists(entity, fieldName, fieldVal)) {
+ return true;
+ }
+ AbstractModel modelForm = (AbstractModel) value;
+ AbstractModel modelWithSameVal;
+ try {
+ modelWithSameVal = dao.read(entity, fieldName, fieldVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, cover by dao.exists...
+ }
+ return modelForm.getIdValue().equals(modelWithSameVal.getIdValue());
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Latitude.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Latitude.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Latitude.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = LatitudeValidator.class)
@Documented
public @interface Latitude {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.Latitude.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.Latitude.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientation.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientation.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientation.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = LatitudeOrientationValidator.class)
@Documented
public @interface LatitudeOrientation {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.LatitudeOrientation.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.LatitudeOrientation.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientationValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientationValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeOrientationValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,16 +37,16 @@
*/
public final class LatitudeOrientationValidator implements ConstraintValidator<LatitudeOrientation, Character> {
- /** {@inheritDoc} */
- @Override
- public void initialize(LatitudeOrientation annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(LatitudeOrientation annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(Character latitudeOrientation, ConstraintValidatorContext constraintContext) {
- return latitudeOrientation == null
- || Arrays.asList(CoordTools.LATITUDE_ORIENTATIONS).contains(latitudeOrientation);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(Character latitudeOrientation, ConstraintValidatorContext constraintContext) {
+ return latitudeOrientation == null
+ || Arrays.asList(CoordTools.LATITUDE_ORIENTATIONS).contains(latitudeOrientation);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LatitudeValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,15 +35,15 @@
*/
public final class LatitudeValidator implements ConstraintValidator<Latitude, String> {
- /** {@inheritDoc} */
- @Override
- public void initialize(Latitude annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(Latitude annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(String latitude, ConstraintValidatorContext constraintContext) {
- return latitude == null || CoordTools.validateLatitude(latitude);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(String latitude, ConstraintValidatorContext constraintContext) {
+ return latitude == null || CoordTools.validateLatitude(latitude);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Longitude.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Longitude.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Longitude.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = LongitudeValidator.class)
@Documented
public @interface Longitude {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.Longitude.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.Longitude.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientation.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientation.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientation.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = LongitudeOrientationValidator.class)
@Documented
public @interface LongitudeOrientation {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.LongitudeOrientation.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.LongitudeOrientation.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientationValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientationValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeOrientationValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,16 +37,16 @@
*/
public final class LongitudeOrientationValidator implements ConstraintValidator<LongitudeOrientation, Character> {
- /** {@inheritDoc} */
- @Override
- public void initialize(LongitudeOrientation annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(LongitudeOrientation annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(Character longitudeOrientation, ConstraintValidatorContext constraintContext) {
- return longitudeOrientation == null
- || Arrays.asList(CoordTools.LONGITUDE_ORIENTATIONS).contains(longitudeOrientation);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(Character longitudeOrientation, ConstraintValidatorContext constraintContext) {
+ return longitudeOrientation == null
+ || Arrays.asList(CoordTools.LONGITUDE_ORIENTATIONS).contains(longitudeOrientation);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/LongitudeValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,15 +35,15 @@
*/
public final class LongitudeValidator implements ConstraintValidator<Longitude, String> {
- /** {@inheritDoc} */
- @Override
- public void initialize(Longitude annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(Longitude annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(String longitude, ConstraintValidatorContext constraintContext) {
- return longitude == null || CoordTools.validateLongitude(longitude);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(String longitude, ConstraintValidatorContext constraintContext) {
+ return longitude == null || CoordTools.validateLongitude(longitude);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraint.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraint.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraint.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,26 +40,26 @@
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface QueryConstraint {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * Error msg
- * @return the message
- */
- String message() default "{nc.ird.cantharella.data.validation.QueryConstraint.message}";
+ /**
+ * Error msg
+ * @return the message
+ */
+ String message() default "{nc.ird.cantharella.data.validation.QueryConstraint.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
- /**
- * Hql query to request
- * @return The query
- */
- String hql() default "";
+ /**
+ * Hql query to request
+ * @return The query
+ */
+ String hql() default "";
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraintValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraintValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/QueryConstraintValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,91 +49,91 @@
*/
public class QueryConstraintValidator implements ConstraintValidator<QueryConstraint, String> {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Hql query to request */
- private String hql;
- /** The collection of named parameters in the HQL statement */
- private String[] params;
+ /** Hql query to request */
+ private String hql;
+ /** The collection of named parameters in the HQL statement */
+ private String[] params;
- /** session factory injected */
- @Autowired
- private SessionFactory sessionFactory;
+ /** session factory injected */
+ @Autowired
+ private SessionFactory sessionFactory;
- /**
- * {@inheritDoc}
- */
- @Override
- public void initialize(QueryConstraint queryConstraint) {
- this.hql = queryConstraint.hql();
- this.params = createParameterList(this.hql);
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void initialize(QueryConstraint queryConstraint) {
+ this.hql = queryConstraint.hql();
+ this.params = createParameterList(this.hql);
+ }
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isValid(String domainObject, ConstraintValidatorContext context) {
- BeanWrapper beanWrapper = new BeanWrapperImpl(domainObject);
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isValid(String domainObject, ConstraintValidatorContext context) {
+ BeanWrapper beanWrapper = new BeanWrapperImpl(domainObject);
- if (sessionFactory != null) {
- LOG.debug("Enabled - Validating constraint with: ");
- LOG.debug(hql);
+ if (sessionFactory != null) {
+ LOG.debug("Enabled - Validating constraint with: ");
+ LOG.debug(hql);
- Session session = sessionFactory.openSession();
- Transaction tx = session.beginTransaction();
- Query query = session.createQuery(this.hql);
+ Session session = sessionFactory.openSession();
+ Transaction tx = session.beginTransaction();
+ Query query = session.createQuery(this.hql);
- for (String parameterName : this.params) {
- query.setParameter(parameterName, beanWrapper.getPropertyValue(parameterName));
- }
+ for (String parameterName : this.params) {
+ query.setParameter(parameterName, beanWrapper.getPropertyValue(parameterName));
+ }
- boolean result = (Long) query.uniqueResult() == 0;
- // boolean result = query.list().size() == 0;
+ boolean result = (Long) query.uniqueResult() == 0;
+ // boolean result = query.list().size() == 0;
- tx.commit();
- session.close();
+ tx.commit();
+ session.close();
- return result;
- }
+ return result;
+ }
- return true;
- }
+ return true;
+ }
- /**
- * Extracts the named parameters from the specified HQL statement.
- * @param query the HQL statement to parse
- * @return an array of all the named parameters (of the form :name) found in the provided string
- */
- private String[] createParameterList(final String query) {
- final Matcher matcher = Pattern.compile(":[^\\s]*").matcher(query);
- List<String> paramList = new ArrayList<String>();
- while (matcher.find()) {
- paramList.add(this.hql.substring(matcher.start() + 1, matcher.end()));
- }
+ /**
+ * Extracts the named parameters from the specified HQL statement.
+ * @param query the HQL statement to parse
+ * @return an array of all the named parameters (of the form :name) found in the provided string
+ */
+ private String[] createParameterList(final String query) {
+ final Matcher matcher = Pattern.compile(":[^\\s]*").matcher(query);
+ List<String> paramList = new ArrayList<String>();
+ while (matcher.find()) {
+ paramList.add(this.hql.substring(matcher.start() + 1, matcher.end()));
+ }
- return paramList.toArray(new String[paramList.size()]);
- }
+ return paramList.toArray(new String[paramList.size()]);
+ }
- // public boolean isValid(String domainObject) {
- // return isValid(domainObject, null);
- // }
+ // public boolean isValid(String domainObject) {
+ // return isValid(domainObject, null);
+ // }
- /**
- * Method to determine whether or not the value passes validation.
- * <p>
- * Validation in this case refers to a value being unique.
- * @param value the value to validate for uniqueness
- * @return true if the value is unique, false otherwise
- */
- /*
- * public boolean isValid(final Object value) { Query query =
- * sessionFactory.getCurrentSession().createQuery(this.hql); Class valueClass = value.getClass(); Field field;
- * for(int i = 0; i < this.params.length; i++) { try { field = valueClass.getDeclaredField(this.params[i]);
- * field.setAccessible(true); query.setParameter(this.params[i], (null != field.get(value)) ? field.get(value) :
- * ""); } catch(final NoSuchFieldException e) { throw new SystemException(e.getMessage()); } catch(final
- * IllegalAccessException e) { throw new SystemException(e.getMessage()); } } return query.list().size() == 0; }
- */
+ /**
+ * Method to determine whether or not the value passes validation.
+ * <p>
+ * Validation in this case refers to a value being unique.
+ * @param value the value to validate for uniqueness
+ * @return true if the value is unique, false otherwise
+ */
+ /*
+ * public boolean isValid(final Object value) { Query query =
+ * sessionFactory.getCurrentSession().createQuery(this.hql); Class valueClass = value.getClass(); Field field;
+ * for(int i = 0; i < this.params.length; i++) { try { field = valueClass.getDeclaredField(this.params[i]);
+ * field.setAccessible(true); query.setParameter(this.params[i], (null != field.get(value)) ? field.get(value) :
+ * ""); } catch(final NoSuchFieldException e) { throw new SystemException(e.getMessage()); } catch(final
+ * IllegalAccessException e) { throw new SystemException(e.getMessage()); } } return query.list().size() == 0; }
+ */
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Referentiel.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Referentiel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/Referentiel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,18 +41,18 @@
@Constraint(validatedBy = ReferentielValidator.class)
@Documented
public @interface Referentiel {
- /**
- * @return Groups
- */
- Class<?>[] groups() default {};
+ /**
+ * @return Groups
+ */
+ Class<?>[] groups() default {};
- /**
- * @return Message key
- */
- String message() default "{nc.ird.cantharella.data.validation.Referentiel.message}";
+ /**
+ * @return Message key
+ */
+ String message() default "{nc.ird.cantharella.data.validation.Referentiel.message}";
- /**
- * @return Payload
- */
- Class<? extends Payload>[] payload() default {};
+ /**
+ * @return Payload
+ */
+ Class<? extends Payload>[] payload() default {};
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/ReferentielValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/ReferentielValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/ReferentielValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,15 +34,15 @@
*/
public final class ReferentielValidator implements ConstraintValidator<Referentiel, Integer> {
- /** {@inheritDoc} */
- @Override
- public void initialize(Referentiel annotation) {
- //
- }
+ /** {@inheritDoc} */
+ @Override
+ public void initialize(Referentiel annotation) {
+ //
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isValid(Integer referentiel, ConstraintValidatorContext constraintContext) {
- return referentiel == null || DataContext.REFERENTIELS.keySet().contains(referentiel);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isValid(Integer referentiel, ConstraintValidatorContext constraintContext) {
+ return referentiel == null || DataContext.REFERENTIELS.keySet().contains(referentiel);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidator.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,31 +34,31 @@
*/
public interface ModelValidator {
- /**
- * Debug properties validation for a model
- * @param <M> Model type
- * @param modelClass Model class
- * @param model Model
- */
- <M extends AbstractModel> void debug(Class<M> modelClass, M model);
+ /**
+ * Debug properties validation for a model
+ * @param <M> Model type
+ * @param modelClass Model class
+ * @param model Model
+ */
+ <M extends AbstractModel> void debug(Class<M> modelClass, M model);
- /**
- * Validate properties for a model
- * @param <M> Model type
- * @param model Model
- * @param locale Locale for error messages
- * @param properties Property names (all properties if empty array)
- * @return Constraint error messages (not null)
- */
- <M> List<String> validate(M model, Locale locale, String... properties);
+ /**
+ * Validate properties for a model
+ * @param <M> Model type
+ * @param model Model
+ * @param locale Locale for error messages
+ * @param properties Property names (all properties if empty array)
+ * @return Constraint error messages (not null)
+ */
+ <M> List<String> validate(M model, Locale locale, String... properties);
- /**
- * Validate properties for a model
- * @param <M> Model type
- * @param model Model
- * @param locale Locale for error messages
- * @param properties Property names (all properties if empty array)
- * @return Constraint error messages (not null), pair of property + message
- */
- // <M> List<Pair<String, String>> validate(M model, Locale locale, String... properties);
+ /**
+ * Validate properties for a model
+ * @param <M> Model type
+ * @param model Model
+ * @param locale Locale for error messages
+ * @param properties Property names (all properties if empty array)
+ * @return Constraint error messages (not null), pair of property + message
+ */
+ // <M> List<Pair<String, String>> validate(M model, Locale locale, String... properties);
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorEventListener.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorEventListener.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorEventListener.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,62 +48,62 @@
*/
public final class ModelValidatorEventListener implements PreInsertEventListener, PreUpdateEventListener {
- /**
- * Operation
- */
- private enum Operation {
- /** Insert */
- INSERT,
- /** Update */
- UPDATE;
- }
+ /**
+ * Operation
+ */
+ private enum Operation {
+ /** Insert */
+ INSERT,
+ /** Update */
+ UPDATE;
+ }
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Validator */
- private final Validator validator;
+ /** Validator */
+ private final Validator validator;
- /**
- * Constructor
- * @param factory Validator factory
- */
- public ModelValidatorEventListener(ValidatorFactory factory) {
- AssertTools.assertNotNull(factory);
- validator = factory.getValidator();
- }
+ /**
+ * Constructor
+ * @param factory Validator factory
+ */
+ public ModelValidatorEventListener(ValidatorFactory factory) {
+ AssertTools.assertNotNull(factory);
+ validator = factory.getValidator();
+ }
- /** {@inheritDoc} */
- @Override
- public boolean onPreInsert(PreInsertEvent event) {
- validate(event, Operation.INSERT);
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean onPreInsert(PreInsertEvent event) {
+ validate(event, Operation.INSERT);
+ return false;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean onPreUpdate(PreUpdateEvent event) {
- validate(event, Operation.UPDATE);
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean onPreUpdate(PreUpdateEvent event) {
+ validate(event, Operation.UPDATE);
+ return false;
+ }
- /**
- * Validation
- * @param event Event
- * @param operation Operation
- */
- private void validate(AbstractPreDatabaseOperationEvent event, Operation operation) {
- Object o = event.getEntity();
- if (event.getEntity() != null && event.getPersister().getEntityMode() == EntityMode.POJO) {
- Set<ConstraintViolation<Object>> violations = validator.validate(o);
- if (!violations.isEmpty()) {
- LOG.error("Validation before " + operation.name() + " " + o.getClass().getName() + ":");
- for (ConstraintViolation<Object> violation : violations) {
- LOG.error("- " + violation.getPropertyPath() + ": " + violation.getMessage());
- }
- throw new ConstraintViolationException("Validation failed before " + operation.name() + " "
- + o.getClass().getName(), new HashSet<ConstraintViolation<?>>(violations));
- }
- }
- }
+ /**
+ * Validation
+ * @param event Event
+ * @param operation Operation
+ */
+ private void validate(AbstractPreDatabaseOperationEvent event, Operation operation) {
+ Object o = event.getEntity();
+ if (event.getEntity() != null && event.getPersister().getEntityMode() == EntityMode.POJO) {
+ Set<ConstraintViolation<Object>> violations = validator.validate(o);
+ if (!violations.isEmpty()) {
+ LOG.error("Validation before " + operation.name() + " " + o.getClass().getName() + ":");
+ for (ConstraintViolation<Object> violation : violations) {
+ LOG.error("- " + violation.getPropertyPath() + ": " + violation.getMessage());
+ }
+ throw new ConstraintViolationException("Validation failed before " + operation.name() + " "
+ + o.getClass().getName(), new HashSet<ConstraintViolation<?>>(violations));
+ }
+ }
+ }
}
Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorImpl.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/validation/utils/ModelValidatorImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -51,139 +51,139 @@
*/
public final class ModelValidatorImpl implements ModelValidator {
- /** Logger */
- static final Log LOG = LogTools.getLog();
+ /** Logger */
+ static final Log LOG = LogTools.getLog();
- /** Pattern error property: "property message" */
- private static final String PATTERN_ERROR_MESSAGE = "%s - %s";
+ /** Pattern error property: "property message" */
+ private static final String PATTERN_ERROR_MESSAGE = "%s - %s";
- /** Pattern error property: "simpleClassName.property" */
- private static final String PATTERN_ERROR_PROPERTY = "%s.%s";
+ /** Pattern error property: "simpleClassName.property" */
+ private static final String PATTERN_ERROR_PROPERTY = "%s.%s";
- /** Message interpolator */
- private final MessageInterpolator messageInterpolator;
+ /** Message interpolator */
+ private final MessageInterpolator messageInterpolator;
- /** Internationalization messages */
- private MessageSourceAccessor[] messageSources;
+ /** Internationalization messages */
+ private MessageSourceAccessor[] messageSources;
- /** Validator */
- private final Validator validator;
+ /** Validator */
+ private final Validator validator;
- /**
- * Constructor
- * @param validatorFactory Validator factory
- * @param messageSourceAccessor Message source accessor
- */
- public ModelValidatorImpl(ValidatorFactory validatorFactory, MessageSourceAccessor... messageSourceAccessor) {
- AssertTools.assertNotNull(validatorFactory);
- messageInterpolator = validatorFactory.getMessageInterpolator();
- validator = validatorFactory.getValidator();
- messageSources = messageSourceAccessor;
- }
+ /**
+ * Constructor
+ * @param validatorFactory Validator factory
+ * @param messageSourceAccessor Message source accessor
+ */
+ public ModelValidatorImpl(ValidatorFactory validatorFactory, MessageSourceAccessor... messageSourceAccessor) {
+ AssertTools.assertNotNull(validatorFactory);
+ messageInterpolator = validatorFactory.getMessageInterpolator();
+ validator = validatorFactory.getValidator();
+ messageSources = messageSourceAccessor;
+ }
- /** {@inheritDoc} */
- @Override
- public <M extends AbstractModel> void debug(Class<M> modelClass, M model) {
- if (LOG.isDebugEnabled()) {
- for (ConstraintViolation<M> violation : validator.validate(model)) {
- LOG.debug(violation.getMessage());
- }
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M extends AbstractModel> void debug(Class<M> modelClass, M model) {
+ if (LOG.isDebugEnabled()) {
+ for (ConstraintViolation<M> violation : validator.validate(model)) {
+ LOG.debug(violation.getMessage());
+ }
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public <M> List<String> validate(M model, Locale locale, String... properties) {
- Set<ConstraintViolation<M>> violations = validate(model, properties);
- List<String> violationMessages = new ArrayList<String>(violations.size());
- for (final ConstraintViolation<M> violation : violations) {
- // Lookup in the bean class
- Class<?> clazz = violation.getRootBeanClass();
- // LOG.debug("clazz :" + clazz);
- String label = null;
- String labelDefault;
- // LOG.debug("getPropertyPath :" + violation.getPropertyPath().toString());
- if (StringUtils.isEmpty(violation.getPropertyPath().toString())) {
- labelDefault = getMessage(clazz.getSimpleName(), locale);
- } else {
- labelDefault = String
- .format(PATTERN_ERROR_PROPERTY, clazz.getSimpleName(), violation.getPropertyPath());
- }
- // LOG.debug("labelDefault :" + labelDefault);
- try {
- label = getMessage(labelDefault, locale);
- } catch (NoSuchMessageException e) {
- //
- }
- // LOG.debug("label :" + label);
- // Lookup in the bean superclasses
- while (label == null && !Object.class.equals(clazz)) {
- clazz = clazz.getSuperclass();
- try {
- if (StringUtils.isEmpty(violation.getPropertyPath().toString())) {
- getMessage(clazz.getSimpleName(), locale);
- } else {
- getMessage(
- String.format(PATTERN_ERROR_PROPERTY, clazz.getSimpleName(),
- violation.getPropertyPath()), locale);
- }
- } catch (NoSuchMessageException e) {
- //
- }
- }
- if (label == null) {
- label = labelDefault;
- }
+ /** {@inheritDoc} */
+ @Override
+ public <M> List<String> validate(M model, Locale locale, String... properties) {
+ Set<ConstraintViolation<M>> violations = validate(model, properties);
+ List<String> violationMessages = new ArrayList<String>(violations.size());
+ for (final ConstraintViolation<M> violation : violations) {
+ // Lookup in the bean class
+ Class<?> clazz = violation.getRootBeanClass();
+ // LOG.debug("clazz :" + clazz);
+ String label = null;
+ String labelDefault;
+ // LOG.debug("getPropertyPath :" + violation.getPropertyPath().toString());
+ if (StringUtils.isEmpty(violation.getPropertyPath().toString())) {
+ labelDefault = getMessage(clazz.getSimpleName(), locale);
+ } else {
+ labelDefault = String
+ .format(PATTERN_ERROR_PROPERTY, clazz.getSimpleName(), violation.getPropertyPath());
+ }
+ // LOG.debug("labelDefault :" + labelDefault);
+ try {
+ label = getMessage(labelDefault, locale);
+ } catch (NoSuchMessageException e) {
+ //
+ }
+ // LOG.debug("label :" + label);
+ // Lookup in the bean superclasses
+ while (label == null && !Object.class.equals(clazz)) {
+ clazz = clazz.getSuperclass();
+ try {
+ if (StringUtils.isEmpty(violation.getPropertyPath().toString())) {
+ getMessage(clazz.getSimpleName(), locale);
+ } else {
+ getMessage(
+ String.format(PATTERN_ERROR_PROPERTY, clazz.getSimpleName(),
+ violation.getPropertyPath()), locale);
+ }
+ } catch (NoSuchMessageException e) {
+ //
+ }
+ }
+ if (label == null) {
+ label = labelDefault;
+ }
- violationMessages.add(String.format(PATTERN_ERROR_MESSAGE, label,
- messageInterpolator.interpolate(violation.getMessageTemplate(), new Context() {
- @Override
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return violation.getConstraintDescriptor();
- }
+ violationMessages.add(String.format(PATTERN_ERROR_MESSAGE, label,
+ messageInterpolator.interpolate(violation.getMessageTemplate(), new Context() {
+ @Override
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return violation.getConstraintDescriptor();
+ }
- @Override
- public Object getValidatedValue() {
- return violation.getInvalidValue();
- }
- }, locale)));
- }
+ @Override
+ public Object getValidatedValue() {
+ return violation.getInvalidValue();
+ }
+ }, locale)));
+ }
- return violationMessages;
- }
+ return violationMessages;
+ }
- /**
- * Validate properties for a model
- * @param <M> Model type
- * @param model Model
- * @param properties Property names (all properties if empty array)
- * @return Constraint violations (not null)
- */
- private <M> Set<ConstraintViolation<M>> validate(M model, String... properties) {
- if (properties == null || properties.length == 0) {
- return validator.validate(model);
- }
- Set<ConstraintViolation<M>> violations = new HashSet<ConstraintViolation<M>>();
- for (String property : properties) {
- violations.addAll(validator.validateProperty(model, property));
- }
- return violations;
- }
+ /**
+ * Validate properties for a model
+ * @param <M> Model type
+ * @param model Model
+ * @param properties Property names (all properties if empty array)
+ * @return Constraint violations (not null)
+ */
+ private <M> Set<ConstraintViolation<M>> validate(M model, String... properties) {
+ if (properties == null || properties.length == 0) {
+ return validator.validate(model);
+ }
+ Set<ConstraintViolation<M>> violations = new HashSet<ConstraintViolation<M>>();
+ for (String property : properties) {
+ violations.addAll(validator.validateProperty(model, property));
+ }
+ return violations;
+ }
- /**
- * Recuperate a msg from the msg accessor given to the class
- * @param key The message key
- * @param locale The used locale
- * @return The corresponding msg, null if no such key
- */
- private String getMessage(String key, Locale locale) {
- String msg = null;
- int i = 0;
- while (msg == null && i < messageSources.length) {
- MessageSourceAccessor curMsgSource = messageSources[i];
- msg = curMsgSource.getMessage(key, null, null, locale);
- i++;
- }
- return msg;
- }
+ /**
+ * Recuperate a msg from the msg accessor given to the class
+ * @param key The message key
+ * @param locale The used locale
+ * @return The corresponding msg, null if no such key
+ */
+ private String getMessage(String key, Locale locale) {
+ String msg = null;
+ int i = 0;
+ while (msg == null && i < messageSources.length) {
+ MessageSourceAccessor curMsgSource = messageSources[i];
+ msg = curMsgSource.getMessage(key, null, null, locale);
+ i++;
+ }
+ return msg;
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/AbstractDataTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/AbstractDataTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/AbstractDataTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,11 +45,11 @@
@Transactional
public abstract class AbstractDataTest extends AbstractTransactionalJUnit4SpringContextTests {
- /**
- * Initialization
- */
- @Before
- public void setUp() {
- applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
- }
+ /**
+ * Initialization
+ */
+ @Before
+ public void setUp() {
+ applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/DataContextTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/DataContextTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/DataContextTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,15 +35,15 @@
*/
public final class DataContextTest extends AbstractDataTest {
- /** Message source */
- @Resource(name = "dataMessageSource")
- private MessageSourceAccessor serviceMessageSource;
+ /** Message source */
+ @Resource(name = "dataMessageSource")
+ private MessageSourceAccessor serviceMessageSource;
- /**
- * Message source test
- */
- @Test
- public void serviceMessageSource() {
- Assert.assertEquals("Prénom", serviceMessageSource.getMessage("Personne.prenom"));
- }
+ /**
+ * Message source test
+ */
+ @Test
+ public void serviceMessageSource() {
+ Assert.assertEquals("Prénom", serviceMessageSource.getMessage("Personne.prenom"));
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/GenericDaoTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/GenericDaoTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/GenericDaoTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,24 +36,24 @@
*/
public final class GenericDaoTest extends AbstractDataTest {
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /**
- * Check that a wrong SQL request throws a DataAccessException
- * @throws DataConstraintException -
- */
- @Test(expected = SQLGrammarException.class)
- public void execute() throws DataConstraintException {
- dao.execute("SELECT * FROM Foo");
- }
+ /**
+ * Check that a wrong SQL request throws a DataAccessException
+ * @throws DataConstraintException -
+ */
+ @Test(expected = SQLGrammarException.class)
+ public void execute() throws DataConstraintException {
+ dao.execute("SELECT * FROM Foo");
+ }
- /**
- * Basic test
- */
- @Test
- public void test() {
- Assert.assertNotNull(dao);
- }
+ /**
+ * Basic test
+ */
+ @Test
+ public void test() {
+ Assert.assertNotNull(dao);
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/SpringTransactionTestAppender.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/SpringTransactionTestAppender.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/SpringTransactionTestAppender.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,39 +30,39 @@
*/
public class SpringTransactionTestAppender extends TestAppender {
- /**
- * Constructor
- */
- public SpringTransactionTestAppender() {
- super(TransactionInterceptor.class);
- }
+ /**
+ * Constructor
+ */
+ public SpringTransactionTestAppender() {
+ super(TransactionInterceptor.class);
+ }
- /**
- * @param forClass -
- * @param forMethod -
- * @return -
- */
- public boolean isTransactionOpened(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
- return containsExactSingleLogRecord("Getting transaction for [" + forClass.getName() + "." + forMethod + "]");
- }
+ /**
+ * @param forClass -
+ * @param forMethod -
+ * @return -
+ */
+ public boolean isTransactionOpened(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
+ return containsExactSingleLogRecord("Getting transaction for [" + forClass.getName() + "." + forMethod + "]");
+ }
- /**
- * @param forClass -
- * @param forMethod -
- * @return -
- */
- public boolean isTransactionCompleted(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
- return containsExactSingleLogRecord("Completing transaction for [" + forClass.getName() + "." + forMethod + "]");
- }
+ /**
+ * @param forClass -
+ * @param forMethod -
+ * @return -
+ */
+ public boolean isTransactionCompleted(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
+ return containsExactSingleLogRecord("Completing transaction for [" + forClass.getName() + "." + forMethod + "]");
+ }
- /**
- * @param forClass -
- * @param forMethod -
- * @return -
- */
- public boolean isTransactionRollbacked(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
- return containsSingleLogRecord("Completing transaction for [" + forClass.getName() + "." + forMethod
- + "] after exception");
- }
+ /**
+ * @param forClass -
+ * @param forMethod -
+ * @return -
+ */
+ public boolean isTransactionRollbacked(@SuppressWarnings("rawtypes") Class forClass, String forMethod) {
+ return containsSingleLogRecord("Completing transaction for [" + forClass.getName() + "." + forMethod
+ + "] after exception");
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/TestAppender.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/TestAppender.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/dao/utils/TestAppender.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,183 +39,183 @@
* @version $Id: $
*/
public class TestAppender extends AppenderSkeleton {
- /** */
- private static Log log = LogFactory.getLog(TestAppender.class);
- /** */
- @SuppressWarnings("rawtypes")
- private final Class[] monitoredClasses;
- /** */
- private final LoggerInfo[] backedUpLoggers;
- /** */
- private final List<LoggingEvent> events = new ArrayList<LoggingEvent>();
+ /** */
+ private static Log log = LogFactory.getLog(TestAppender.class);
+ /** */
+ @SuppressWarnings("rawtypes")
+ private final Class[] monitoredClasses;
+ /** */
+ private final LoggerInfo[] backedUpLoggers;
+ /** */
+ private final List<LoggingEvent> events = new ArrayList<LoggingEvent>();
- /**
- * Constructor
- * @param monitoredClass -
- */
- public TestAppender(@SuppressWarnings("rawtypes") Class monitoredClass) {
- this(new Class[] { monitoredClass });
- }
+ /**
+ * Constructor
+ * @param monitoredClass -
+ */
+ public TestAppender(@SuppressWarnings("rawtypes") Class monitoredClass) {
+ this(new Class[] { monitoredClass });
+ }
- /**
- * Constructor
- * @param monitoredClasses -
- */
- public TestAppender(@SuppressWarnings("rawtypes") Class[] monitoredClasses) {
- super();
- this.monitoredClasses = monitoredClasses;
- if (log.isInfoEnabled()) {
- log.info("***************************************************************");
- log.info(" APPENDING TEST CONTROLLED LOGGING ENVIRONMENT ");
- log.info("***************************************************************");
- }
- backedUpLoggers = new LoggerInfo[monitoredClasses.length];
- for (int i = 0; i < monitoredClasses.length; i++) {
- @SuppressWarnings("rawtypes")
- Class monitoredClass = monitoredClasses[i];
- Logger logger = LogManager.getLogger(monitoredClass);
- backedUpLoggers[i] = new LoggerInfo(logger.getLevel(), logger.getAdditivity());
- logger.setLevel(Level.TRACE);
- logger.addAppender(this);
- logger.setAdditivity(true);
- }
- }
+ /**
+ * Constructor
+ * @param monitoredClasses -
+ */
+ public TestAppender(@SuppressWarnings("rawtypes") Class[] monitoredClasses) {
+ super();
+ this.monitoredClasses = monitoredClasses;
+ if (log.isInfoEnabled()) {
+ log.info("***************************************************************");
+ log.info(" APPENDING TEST CONTROLLED LOGGING ENVIRONMENT ");
+ log.info("***************************************************************");
+ }
+ backedUpLoggers = new LoggerInfo[monitoredClasses.length];
+ for (int i = 0; i < monitoredClasses.length; i++) {
+ @SuppressWarnings("rawtypes")
+ Class monitoredClass = monitoredClasses[i];
+ Logger logger = LogManager.getLogger(monitoredClass);
+ backedUpLoggers[i] = new LoggerInfo(logger.getLevel(), logger.getAdditivity());
+ logger.setLevel(Level.TRACE);
+ logger.addAppender(this);
+ logger.setAdditivity(true);
+ }
+ }
- /**
- *
- */
- public void clearLogChanges() {
- for (int i = 0; i < monitoredClasses.length; i++) {
- @SuppressWarnings("rawtypes")
- Class monitoredClass = monitoredClasses[i];
- Logger logger = LogManager.getLogger(monitoredClass);
- logger.setLevel(backedUpLoggers[i].getOriginalLevel());
- logger.setAdditivity(backedUpLoggers[i].isOriginalAdditivity());
- logger.removeAppender(this);
- }
- if (log.isInfoEnabled()) {
- log.info("***************************************************************");
- log.info(" REMOVED TEST CONTROLLED LOGGING ENVIRONMENT ");
- log.info("***************************************************************");
- }
- }
+ /**
+ *
+ */
+ public void clearLogChanges() {
+ for (int i = 0; i < monitoredClasses.length; i++) {
+ @SuppressWarnings("rawtypes")
+ Class monitoredClass = monitoredClasses[i];
+ Logger logger = LogManager.getLogger(monitoredClass);
+ logger.setLevel(backedUpLoggers[i].getOriginalLevel());
+ logger.setAdditivity(backedUpLoggers[i].isOriginalAdditivity());
+ logger.removeAppender(this);
+ }
+ if (log.isInfoEnabled()) {
+ log.info("***************************************************************");
+ log.info(" REMOVED TEST CONTROLLED LOGGING ENVIRONMENT ");
+ log.info("***************************************************************");
+ }
+ }
- /** {@inheritDoc} */
- @Override
- protected void append(LoggingEvent event) {
- synchronized (events) {
- events.add(event);
- System.out.println(">>> Capturing : " + event.getMessage());
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void append(LoggingEvent event) {
+ synchronized (events) {
+ events.add(event);
+ System.out.println(">>> Capturing : " + event.getMessage());
+ }
+ }
- /**
- * @param messagePart -
- * @return -
- */
- public int countLogRecord(String messagePart) {
- int counter = 0;
- for (LoggingEvent event : events) {
- String message = (String) event.getMessage();
- if (message != null && message.indexOf(messagePart) > -1) {
- counter++;
- }
- }
- return counter;
- }
+ /**
+ * @param messagePart -
+ * @return -
+ */
+ public int countLogRecord(String messagePart) {
+ int counter = 0;
+ for (LoggingEvent event : events) {
+ String message = (String) event.getMessage();
+ if (message != null && message.indexOf(messagePart) > -1) {
+ counter++;
+ }
+ }
+ return counter;
+ }
- /**
- * @param comparedMessage -
- * @return -
- */
- public int countExactLogRecord(String comparedMessage) {
- int counter = 0;
- for (LoggingEvent event : events) {
- String message = (String) event.getMessage();
- if (message != null && message.equals(comparedMessage)) {
- counter++;
- }
- }
- return counter;
- }
+ /**
+ * @param comparedMessage -
+ * @return -
+ */
+ public int countExactLogRecord(String comparedMessage) {
+ int counter = 0;
+ for (LoggingEvent event : events) {
+ String message = (String) event.getMessage();
+ if (message != null && message.equals(comparedMessage)) {
+ counter++;
+ }
+ }
+ return counter;
+ }
- /**
- * @param messagePart -
- * @return -
- */
- public boolean containsLogRecord(String messagePart) {
- return countLogRecord(messagePart) > 0;
- }
+ /**
+ * @param messagePart -
+ * @return -
+ */
+ public boolean containsLogRecord(String messagePart) {
+ return countLogRecord(messagePart) > 0;
+ }
- /**
- * @param messagePart -
- * @return -
- */
- public boolean containsSingleLogRecord(String messagePart) {
- return countLogRecord(messagePart) == 1;
- }
+ /**
+ * @param messagePart -
+ * @return -
+ */
+ public boolean containsSingleLogRecord(String messagePart) {
+ return countLogRecord(messagePart) == 1;
+ }
- /**
- * @param completeMessage -
- * @return -
- */
- public boolean containsExactLogRecord(String completeMessage) {
- return countExactLogRecord(completeMessage) > 0;
- }
+ /**
+ * @param completeMessage -
+ * @return -
+ */
+ public boolean containsExactLogRecord(String completeMessage) {
+ return countExactLogRecord(completeMessage) > 0;
+ }
- /**
- * @param completeMessage -
- * @return -
- */
- public boolean containsExactSingleLogRecord(String completeMessage) {
- return countExactLogRecord(completeMessage) == 1;
- }
+ /**
+ * @param completeMessage -
+ * @return -
+ */
+ public boolean containsExactSingleLogRecord(String completeMessage) {
+ return countExactLogRecord(completeMessage) == 1;
+ }
- /** {@inheritDoc} */
- @Override
- public void close() {
- events.clear();
- clearLogChanges();
- }
+ /** {@inheritDoc} */
+ @Override
+ public void close() {
+ events.clear();
+ clearLogChanges();
+ }
- /** {@inheritDoc} */
- @Override
- public boolean requiresLayout() {
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean requiresLayout() {
+ return false;
+ }
- /**
- * @author Jan Novotný
- */
- private class LoggerInfo {
- /** */
- Level originalLevel;
- /** */
- boolean originalAdditivity;
+ /**
+ * @author Jan Novotný
+ */
+ private class LoggerInfo {
+ /** */
+ Level originalLevel;
+ /** */
+ boolean originalAdditivity;
- /**
- * Constructor
- * @param originalLevel -
- * @param originalAdditivity -
- */
- public LoggerInfo(Level originalLevel, boolean originalAdditivity) {
- this.originalLevel = originalLevel;
- this.originalAdditivity = originalAdditivity;
- }
+ /**
+ * Constructor
+ * @param originalLevel -
+ * @param originalAdditivity -
+ */
+ public LoggerInfo(Level originalLevel, boolean originalAdditivity) {
+ this.originalLevel = originalLevel;
+ this.originalAdditivity = originalAdditivity;
+ }
- /**
- * @return -
- */
- public Level getOriginalLevel() {
- return originalLevel;
- }
+ /**
+ * @return -
+ */
+ public Level getOriginalLevel() {
+ return originalLevel;
+ }
- /**
- * @return -
- */
- public boolean isOriginalAdditivity() {
- return originalAdditivity;
- }
- }
+ /**
+ * @return -
+ */
+ public boolean isOriginalAdditivity() {
+ return originalAdditivity;
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,16 +35,16 @@
*/
public class GroupeTest extends AbstractDataTest {
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /**
- * Read groupes
- */
- @Test
- public void read() {
- Assert.assertNotNull(dao);
- Assert.assertNotNull(dao.readList(Groupe.class));
- }
+ /**
+ * Read groupes
+ */
+ @Test
+ public void read() {
+ Assert.assertNotNull(dao);
+ Assert.assertNotNull(dao.readList(Groupe.class));
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTransactionTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTransactionTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/GroupeTransactionTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,39 +39,39 @@
@Transactional
public class GroupeTransactionTest extends GroupeTest {
- /** For transaction logging */
- SpringTransactionTestAppender transactionTestAppender;
+ /** For transaction logging */
+ SpringTransactionTestAppender transactionTestAppender;
- /**
- * Initialization before tests
- */
- @Before
- public void initLogger() {
- transactionTestAppender = new SpringTransactionTestAppender();
- }
+ /**
+ * Initialization before tests
+ */
+ @Before
+ public void initLogger() {
+ transactionTestAppender = new SpringTransactionTestAppender();
+ }
- /**
- * Release after tests
- */
- @After
- public void closeLogger() {
- transactionTestAppender.close();
- }
+ /**
+ * Release after tests
+ */
+ @After
+ public void closeLogger() {
+ transactionTestAppender.close();
+ }
- /**
- * Test if transaction works when reading groups
- * @throws Exception -
- */
- @Test
- public void testReadGroupesTransaction() throws Exception {
- // again we run our integration test
- super.read();
+ /**
+ * Test if transaction works when reading groups
+ * @throws Exception -
+ */
+ @Test
+ public void testReadGroupesTransaction() throws Exception {
+ // again we run our integration test
+ super.read();
- // and now we verify, that opening and closing transaction operations were made by the TransactionInterceptor
- String methodName = "readList";
- assertTrue(transactionTestAppender.isTransactionOpened(HibernateTemplateDao.class, methodName));
- assertTrue(transactionTestAppender.isTransactionCompleted(HibernateTemplateDao.class, methodName));
- assertFalse(transactionTestAppender.isTransactionRollbacked(HibernateTemplateDao.class, methodName));
- }
+ // and now we verify, that opening and closing transaction operations were made by the TransactionInterceptor
+ String methodName = "readList";
+ assertTrue(transactionTestAppender.isTransactionOpened(HibernateTemplateDao.class, methodName));
+ assertTrue(transactionTestAppender.isTransactionCompleted(HibernateTemplateDao.class, methodName));
+ assertFalse(transactionTestAppender.isTransactionRollbacked(HibernateTemplateDao.class, methodName));
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/ModelValidatorTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/ModelValidatorTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/ModelValidatorTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,24 +39,24 @@
*/
public final class ModelValidatorTest extends AbstractDataTest {
- /** Validator */
- @Autowired
- private ModelValidator validator;
+ /** Validator */
+ @Autowired
+ private ModelValidator validator;
- /**
- * Test: validate
- */
- @Test
- public void validateModel() {
- Assert.assertFalse(validator.validate(new Utilisateur(), Locale.getDefault()).isEmpty());
- }
+ /**
+ * Test: validate
+ */
+ @Test
+ public void validateModel() {
+ Assert.assertFalse(validator.validate(new Utilisateur(), Locale.getDefault()).isEmpty());
+ }
- /**
- * Test: validate properties
- * @throws ValidationException In case of validation errors
- */
- @Test
- public void validateModelProperty() throws ValidationException {
- Assert.assertFalse(validator.validate(new Utilisateur(), Locale.getDefault(), "courriel").isEmpty());
- }
+ /**
+ * Test: validate properties
+ * @throws ValidationException In case of validation errors
+ */
+ @Test
+ public void validateModelProperty() throws ValidationException {
+ Assert.assertFalse(validator.validate(new Utilisateur(), Locale.getDefault(), "courriel").isEmpty());
+ }
}
Modified: trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/PersonneTest.java
===================================================================
--- trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/PersonneTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.data/src/test/java/nc/ird/cantharella/data/model/PersonneTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,20 +33,20 @@
*/
public class PersonneTest extends AbstractDataTest {
- /** DAO */
- // @Autowired
- // private GenericDao dao;
+ /** DAO */
+ // @Autowired
+ // private GenericDao dao;
- /**
- * Read personne fail //* @throws DataNotFoundException -
- */
- // test desactivated because of an
- // "no method exception found Check that an AOP invocation is in progress, and that the ExposeInvocationInterceptor is in the interceptor chain"
- // only in the test environment
- // @Test(expected = DataNotFoundException.class)
- @Test
- public void readFail() { // throws DataNotFoundException {
- // dao.read(Personne.class, 999999999);
- }
+ /**
+ * Read personne fail //* @throws DataNotFoundException -
+ */
+ // test desactivated because of an
+ // "no method exception found Check that an AOP invocation is in progress, and that the ExposeInvocationInterceptor is in the interceptor chain"
+ // only in the test environment
+ // @Test(expected = DataNotFoundException.class)
+ @Test
+ public void readFail() { // throws DataNotFoundException {
+ // dao.read(Personne.class, 999999999);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/pom.xml
===================================================================
--- trunk/cantharella.service/pom.xml 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/pom.xml 2013-01-29 09:48:04 UTC (rev 65)
@@ -1,7 +1,6 @@
<?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">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -81,20 +80,20 @@
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-orm</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-orm</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
</dependency>
<dependency>
@@ -159,7 +158,7 @@
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
</dependency>
-
+
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/config/ServiceContext.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -60,110 +60,110 @@
@Configuration
public abstract class ServiceContext {
- /** Mail SMTP: port */
- private static final int MAIL_SMTP_PORT = 25;
+ /** Mail SMTP: port */
+ private static final int MAIL_SMTP_PORT = 25;
- /** Mail SMTP: time out */
- private static final int MAIL_SMTP_TIMEOUT = 10000;
+ /** Mail SMTP: time out */
+ private static final int MAIL_SMTP_TIMEOUT = 10000;
- /** Mail activation (thus mails can be disabled for test purposes) */
- private static boolean mailActivated = true;
+ /** Mail activation (thus mails can be disabled for test purposes) */
+ private static boolean mailActivated = true;
- /** Admin default courriel */
- @Value("${admin.courriel}")
- protected String adminCourrielProperty;
+ /** Admin default courriel */
+ @Value("${admin.courriel}")
+ protected String adminCourrielProperty;
- /** Admin default password */
- @Value("${admin.password}")
- protected String adminPasswordProperty;
+ /** Admin default password */
+ @Value("${admin.password}")
+ protected String adminPasswordProperty;
- /** E-mail debug mode */
- @Value("${mail.debug}")
- protected boolean mailDebugProperty;
+ /** E-mail debug mode */
+ @Value("${mail.debug}")
+ protected boolean mailDebugProperty;
- /** E-mail "from" */
- @Value("${mail.from}")
- protected String mailFromProperty;
+ /** E-mail "from" */
+ @Value("${mail.from}")
+ protected String mailFromProperty;
- /** E-mail SMTP host */
- @Value("${mail.host}")
- protected String mailHostProperty;
+ /** E-mail SMTP host */
+ @Value("${mail.host}")
+ protected String mailHostProperty;
- /**
- * mailActivated getter
- * @return mailActivated
- */
- public static final boolean isMailActivated() {
- return mailActivated;
- }
+ /**
+ * mailActivated getter
+ * @return mailActivated
+ */
+ public static final boolean isMailActivated() {
+ return mailActivated;
+ }
- /**
- * mailActivated setter
- * @param mailActivated mailActivated
- */
- public static final void setMailActivated(boolean mailActivated) {
- ServiceContext.mailActivated = mailActivated;
- }
+ /**
+ * mailActivated setter
+ * @param mailActivated mailActivated
+ */
+ public static final void setMailActivated(boolean mailActivated) {
+ ServiceContext.mailActivated = mailActivated;
+ }
- /**
- * @return Default admin, if none already exists
- */
- @Bean
- public Utilisateur defaultAdmin() {
- Utilisateur admin = new Utilisateur();
- admin.setTypeDroit(TypeDroit.ADMINISTRATEUR);
- admin.setAdressePostale("BP A5");
- admin.setCodePostal("98848");
- admin.setCourriel(adminCourrielProperty);
- admin.setNom("ADMIN");
- admin.setOrganisme("IRD");
- admin.setPasswordHash(PasswordTools.sha1(adminPasswordProperty));
- admin.setCodePays("FR");
- admin.setPrenom("Admin");
- admin.setVille("Nouméa");
- Normalizer.normalize(PersonneNormalizer.class, admin);
- return admin;
- }
+ /**
+ * @return Default admin, if none already exists
+ */
+ @Bean
+ public Utilisateur defaultAdmin() {
+ Utilisateur admin = new Utilisateur();
+ admin.setTypeDroit(TypeDroit.ADMINISTRATEUR);
+ admin.setAdressePostale("BP A5");
+ admin.setCodePostal("98848");
+ admin.setCourriel(adminCourrielProperty);
+ admin.setNom("ADMIN");
+ admin.setOrganisme("IRD");
+ admin.setPasswordHash(PasswordTools.sha1(adminPasswordProperty));
+ admin.setCodePays("FR");
+ admin.setPrenom("Admin");
+ admin.setVille("Nouméa");
+ Normalizer.normalize(PersonneNormalizer.class, admin);
+ return admin;
+ }
- /**
- * @return E-mail message template
- */
- @Bean
- public SimpleMailMessage mailMessage() {
- SimpleMailMessage mailMessage = new SimpleMailMessage();
- mailMessage.setFrom(mailFromProperty);
- return mailMessage;
- }
+ /**
+ * @return E-mail message template
+ */
+ @Bean
+ public SimpleMailMessage mailMessage() {
+ SimpleMailMessage mailMessage = new SimpleMailMessage();
+ mailMessage.setFrom(mailFromProperty);
+ return mailMessage;
+ }
- /**
- * @return E-mail sender
- */
- @Bean
- public MailSender mailSender() {
- JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
- Properties properties = new Properties();
- properties.put("mail.debug", mailDebugProperty);
- properties.put("mail.smtp.connectiontimeout", MAIL_SMTP_TIMEOUT);
- properties.put("mail.smtp.timeout", MAIL_SMTP_TIMEOUT);
- properties.put("mail.smtp.reportsuccess", Boolean.TRUE);
- mailSender.setJavaMailProperties(properties);
- mailSender.setHost(mailHostProperty);
- mailSender.setPort(MAIL_SMTP_PORT);
- mailSender.setDefaultEncoding(DataContext.ENCODING);
- mailSender.setProtocol(JavaMailSenderImpl.DEFAULT_PROTOCOL);
- return mailSender;
- }
+ /**
+ * @return E-mail sender
+ */
+ @Bean
+ public MailSender mailSender() {
+ JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
+ Properties properties = new Properties();
+ properties.put("mail.debug", mailDebugProperty);
+ properties.put("mail.smtp.connectiontimeout", MAIL_SMTP_TIMEOUT);
+ properties.put("mail.smtp.timeout", MAIL_SMTP_TIMEOUT);
+ properties.put("mail.smtp.reportsuccess", Boolean.TRUE);
+ mailSender.setJavaMailProperties(properties);
+ mailSender.setHost(mailHostProperty);
+ mailSender.setPort(MAIL_SMTP_PORT);
+ mailSender.setDefaultEncoding(DataContext.ENCODING);
+ mailSender.setProtocol(JavaMailSenderImpl.DEFAULT_PROTOCOL);
+ return mailSender;
+ }
- /**
- * @return Internationalization messages
- */
- @Bean
- public MessageSourceAccessor serviceMessageSource() {
- // The ResourceBundleMessageSource does not handle UTF-8, so we use the Reloadable one
- ReloadableResourceBundleMessageSource serviceMessageSource = new ReloadableResourceBundleMessageSource();
- serviceMessageSource.setBasename("service");
- serviceMessageSource.setDefaultEncoding(DataContext.ENCODING);
- serviceMessageSource.setCacheSeconds(-1);
- return new MessageSourceAccessor(serviceMessageSource);
- }
+ /**
+ * @return Internationalization messages
+ */
+ @Bean
+ public MessageSourceAccessor serviceMessageSource() {
+ // The ResourceBundleMessageSource does not handle UTF-8, so we use the Reloadable one
+ ReloadableResourceBundleMessageSource serviceMessageSource = new ReloadableResourceBundleMessageSource();
+ serviceMessageSource.setBasename("service");
+ serviceMessageSource.setDefaultEncoding(DataContext.ENCODING);
+ serviceMessageSource.setCacheSeconds(-1);
+ return new MessageSourceAccessor(serviceMessageSource);
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/exceptions/EmailException.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/exceptions/EmailException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/exceptions/EmailException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,11 +30,11 @@
*/
public final class EmailException extends AbstractException {
- /**
- * Constructor
- * @param cause Cause
- */
- public EmailException(Exception cause) {
- super(cause);
- }
+ /**
+ * Constructor
+ * @param cause Cause
+ */
+ public EmailException(Exception cause) {
+ super(cause);
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/CampagneService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/CampagneService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/CampagneService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,83 +42,83 @@
*/
public interface CampagneService {
- /**
- * Compte le nombre de campagnes
- * @return Nombre de campagnes
- */
- long countCampagnes();
+ /**
+ * Compte le nombre de campagnes
+ * @return Nombre de campagnes
+ */
+ long countCampagnes();
- /**
- * Créé une campagne
- * @param campagne Campagne
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void createCampagne((a)Normalize(CampagneNormalizer.class) Campagne campagne) throws DataConstraintException;
+ /**
+ * Créé une campagne
+ * @param campagne Campagne
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void createCampagne((a)Normalize(CampagneNormalizer.class) Campagne campagne) throws DataConstraintException;
- /**
- * Supprime une campagne
- * @param campagne Campagne
- * @throws DataConstraintException Si des données liées empêchent la suppression
- */
- void deleteCampagne(Campagne campagne) throws DataConstraintException;
+ /**
+ * Supprime une campagne
+ * @param campagne Campagne
+ * @throws DataConstraintException Si des données liées empêchent la suppression
+ */
+ void deleteCampagne(Campagne campagne) throws DataConstraintException;
- /**
- * Liste les programmes des campagnes déjà saisis
- * @return Programmes des campagnes
- */
- @Transactional(readOnly = true)
- List<String> listCampagneProgrammes();
+ /**
+ * Liste les programmes des campagnes déjà saisis
+ * @return Programmes des campagnes
+ */
+ @Transactional(readOnly = true)
+ List<String> listCampagneProgrammes();
- /**
- * Liste les campagnes selon les droits d'un utilisateur (triés par nom)
- * @param utilisateur Utilisateur
- * @return Campagnes
- */
- @Transactional(readOnly = true)
- List<Campagne> listCampagnes(Utilisateur utilisateur);
+ /**
+ * Liste les campagnes selon les droits d'un utilisateur (triés par nom)
+ * @param utilisateur Utilisateur
+ * @return Campagnes
+ */
+ @Transactional(readOnly = true)
+ List<Campagne> listCampagnes(Utilisateur utilisateur);
- /**
- * Liste les campagnes selon les droits d'un utilisateur (triés par nom)
- * @param utilisateur Utilisateur
- * @return Campagnes
- */
- SortedSet<Campagne> listCampagnesForUser(Utilisateur utilisateur);
+ /**
+ * Liste les campagnes selon les droits d'un utilisateur (triés par nom)
+ * @param utilisateur Utilisateur
+ * @return Campagnes
+ */
+ SortedSet<Campagne> listCampagnesForUser(Utilisateur utilisateur);
- /**
- * Charger une campagne
- * @param idCampagne ID campagne
- * @return Campagne
- * @throws DataNotFoundException Si non trouvée
- */
- Campagne loadCampagne(Integer idCampagne) throws DataNotFoundException;
+ /**
+ * Charger une campagne
+ * @param idCampagne ID campagne
+ * @return Campagne
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Campagne loadCampagne(Integer idCampagne) throws DataNotFoundException;
- /**
- * Charger une campagne
- * @param nom Nom
- * @return Campagne
- * @throws DataNotFoundException Si non trouvée
- */
- Campagne loadCampagne((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charger une campagne
+ * @param nom Nom
+ * @return Campagne
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Campagne loadCampagne((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Rafraichit une campagne (pour éviter des LazyLoadingException)
- * @param campagne Campagne
- */
- void refreshCampagne(Campagne campagne);
+ /**
+ * Rafraichit une campagne (pour éviter des LazyLoadingException)
+ * @param campagne Campagne
+ */
+ void refreshCampagne(Campagne campagne);
- /**
- * Met à jour une campagne
- * @param campagne Campagne
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateCampagne((a)Normalize(CampagneNormalizer.class) Campagne campagne) throws DataConstraintException;
+ /**
+ * Met à jour une campagne
+ * @param campagne Campagne
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateCampagne((a)Normalize(CampagneNormalizer.class) Campagne campagne) throws DataConstraintException;
- /**
- * Détermine si un utilisateur peut modifier ou supprimer une campagne
- * @param campagne Campagne
- * @param utilisateur Utilisateur
- * @return TRUE si il a le droit
- */
- boolean updateOrdeleteCampagneEnabled(Campagne campagne, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer une campagne
+ * @param campagne Campagne
+ * @param utilisateur Utilisateur
+ * @return TRUE si il a le droit
+ */
+ boolean updateOrdeleteCampagneEnabled(Campagne campagne, Utilisateur utilisateur);
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/DocumentService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,50 +40,50 @@
*/
public interface DocumentService {
- /**
- * List the document types available
- * @return The list of document types
- */
- @Transactional(readOnly = true)
- List<TypeDocument> listTypeDocuments();
+ /**
+ * List the document types available
+ * @return The list of document types
+ */
+ @Transactional(readOnly = true)
+ List<TypeDocument> listTypeDocuments();
- /**
- * Create a document type
- * @param typeDocument The document type to create
- * @throws DataConstraintException If the document type already exists (unique constraints)
- */
- void createTypeDocument((a)Normalize(TypeDocumentNormalizer.class) TypeDocument typeDocument)
- throws DataConstraintException;
+ /**
+ * Create a document type
+ * @param typeDocument The document type to create
+ * @throws DataConstraintException If the document type already exists (unique constraints)
+ */
+ void createTypeDocument((a)Normalize(TypeDocumentNormalizer.class) TypeDocument typeDocument)
+ throws DataConstraintException;
- /**
- * Load a document type
- * @param idTypeDocument ID
- * @return The corresponding document type
- * @throws DataNotFoundException If not found
- */
- TypeDocument loadTypeDocument(Integer idTypeDocument) throws DataNotFoundException;
+ /**
+ * Load a document type
+ * @param idTypeDocument ID
+ * @return The corresponding document type
+ * @throws DataNotFoundException If not found
+ */
+ TypeDocument loadTypeDocument(Integer idTypeDocument) throws DataNotFoundException;
- /**
- * Charger a document type
- * @param nom The document type name
- * @return The corresponding document type
- * @throws DataNotFoundException If not found
- */
- TypeDocument loadTypeDocument((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charger a document type
+ * @param nom The document type name
+ * @return The corresponding document type
+ * @throws DataNotFoundException If not found
+ */
+ TypeDocument loadTypeDocument((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Modify a document type
- * @param typeDocument The document type to modify
- * @throws DataConstraintException If an unique constraint is broken with another document type
- */
- void updateTypeDocument((a)Normalize(TypeDocumentNormalizer.class) TypeDocument typeDocument)
- throws DataConstraintException;
+ /**
+ * Modify a document type
+ * @param typeDocument The document type to modify
+ * @throws DataConstraintException If an unique constraint is broken with another document type
+ */
+ void updateTypeDocument((a)Normalize(TypeDocumentNormalizer.class) TypeDocument typeDocument)
+ throws DataConstraintException;
- /**
- * Delete a document type
- * @param typeDocument The document type to delete
- * @throws DataConstraintException If the document type has linked data
- */
- void deleteTypeDocument(TypeDocument typeDocument) throws DataConstraintException;
+ /**
+ * Delete a document type
+ * @param typeDocument The document type to delete
+ * @throws DataConstraintException If the document type has linked data
+ */
+ void deleteTypeDocument(TypeDocument typeDocument) throws DataConstraintException;
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ExtractionService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ExtractionService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ExtractionService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,143 +45,143 @@
*/
public interface ExtractionService {
- /**
- * Compte le nombre d'extractions
- * @return Nombre d'extractions
- */
- long countExtractions();
+ /**
+ * Compte le nombre d'extractions
+ * @return Nombre d'extractions
+ */
+ long countExtractions();
- /**
- * Créée une manipulation d'extraction
- * @param extraction La manipulation
- * @throws DataConstraintException Si la manipulation (réf) existe déjà
- */
- void createExtraction((a)Normalize(ExtractionNormalizer.class) Extraction extraction) throws DataConstraintException;
+ /**
+ * Créée une manipulation d'extraction
+ * @param extraction La manipulation
+ * @throws DataConstraintException Si la manipulation (réf) existe déjà
+ */
+ void createExtraction((a)Normalize(ExtractionNormalizer.class) Extraction extraction) throws DataConstraintException;
- /**
- * Supprime une manipulation d'extraction
- * @param extraction L'extraction
- * @throws DataConstraintException En cas de données liées
- */
- void deleteExtraction(Extraction extraction) throws DataConstraintException;
+ /**
+ * Supprime une manipulation d'extraction
+ * @param extraction L'extraction
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteExtraction(Extraction extraction) throws DataConstraintException;
- /**
- * Liste les manipulations d'extraction selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur
- * @return la liste des extractions
- */
- @Transactional(readOnly = true)
- List<Extraction> listExtractions(Utilisateur utilisateur);
+ /**
+ * Liste les manipulations d'extraction selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur
+ * @return la liste des extractions
+ */
+ @Transactional(readOnly = true)
+ List<Extraction> listExtractions(Utilisateur utilisateur);
- /**
- * Liste les manipulations d'extraction selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur non admin
- * @return la liste des manipulations
- */
- SortedSet<Extraction> listExtractionsForUser(Utilisateur utilisateur);
+ /**
+ * Liste les manipulations d'extraction selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur non admin
+ * @return la liste des manipulations
+ */
+ SortedSet<Extraction> listExtractionsForUser(Utilisateur utilisateur);
- /**
- * Vérifie si l'extraction de référence donnée existe est unique dans la base
- * @param extraction L'extraction
- * @return TRUE si l'extraction est unique
- */
- boolean isExtractionUnique(Extraction extraction);
+ /**
+ * Vérifie si l'extraction de référence donnée existe est unique dans la base
+ * @param extraction L'extraction
+ * @return TRUE si l'extraction est unique
+ */
+ boolean isExtractionUnique(Extraction extraction);
- /**
- * Charge une manipulation d'extraction
- * @param idExtraction ID de la manipulation
- * @return La manipulation correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- Extraction loadExtraction(Integer idExtraction) throws DataNotFoundException;
+ /**
+ * Charge une manipulation d'extraction
+ * @param idExtraction ID de la manipulation
+ * @return La manipulation correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Extraction loadExtraction(Integer idExtraction) throws DataNotFoundException;
- /**
- * Charge une manipulation d'extraction
- * @param ref Référence de la manipulation
- * @return La manipulation correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- Extraction loadExtraction((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
+ /**
+ * Charge une manipulation d'extraction
+ * @param ref Référence de la manipulation
+ * @return La manipulation correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Extraction loadExtraction((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
- /**
- * Met à jour une manipulation d'extraction
- * @param extraction La manipulation
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateExtraction((a)Normalize(ExtractionNormalizer.class) Extraction extraction) throws DataConstraintException;
+ /**
+ * Met à jour une manipulation d'extraction
+ * @param extraction La manipulation
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateExtraction((a)Normalize(ExtractionNormalizer.class) Extraction extraction) throws DataConstraintException;
- /**
- * Détermine si un utilisateur peut modifier ou supprimer une extraction
- * @param extraction L'extraction
- * @param utilisateur L'utilisateur
- * @return TRUE s'il a le droit
- */
- boolean updateOrdeleteExtractionEnabled(Extraction extraction, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer une extraction
+ * @param extraction L'extraction
+ * @param utilisateur L'utilisateur
+ * @return TRUE s'il a le droit
+ */
+ boolean updateOrdeleteExtractionEnabled(Extraction extraction, Utilisateur utilisateur);
- /**
- * Créée une méthode pour une extraction
- * @param methode La méthode
- * @throws DataConstraintException Si la méthode (nom) existe déjà
- */
- void createMethodeExtraction((a)Normalize(MethodeExtractionNormalizer.class) MethodeExtraction methode)
- throws DataConstraintException;
+ /**
+ * Créée une méthode pour une extraction
+ * @param methode La méthode
+ * @throws DataConstraintException Si la méthode (nom) existe déjà
+ */
+ void createMethodeExtraction((a)Normalize(MethodeExtractionNormalizer.class) MethodeExtraction methode)
+ throws DataConstraintException;
- /**
- * Supprime une méthode pour une extraction
- * @param methode La méthode
- * @throws DataConstraintException En cas de données liées
- */
- void deleteMethodeExtraction(MethodeExtraction methode) throws DataConstraintException;
+ /**
+ * Supprime une méthode pour une extraction
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteMethodeExtraction(MethodeExtraction methode) throws DataConstraintException;
- /**
- * Liste les méthodes existantes pour une extraction (triés par nom)
- * @return la liste des méthodes
- */
- List<MethodeExtraction> listMethodesExtraction();
+ /**
+ * Liste les méthodes existantes pour une extraction (triés par nom)
+ * @return la liste des méthodes
+ */
+ List<MethodeExtraction> listMethodesExtraction();
- /**
- * Charge une méthode pour une extraction
- * @param idMethode ID de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodeExtraction loadMethodeExtraction(Integer idMethode) throws DataNotFoundException;
+ /**
+ * Charge une méthode pour une extraction
+ * @param idMethode ID de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodeExtraction loadMethodeExtraction(Integer idMethode) throws DataNotFoundException;
- /**
- * Charge une méthode pour une extraction
- * @param nom Nom de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodeExtraction loadMethodeExtraction((a)Normalize(UniqueFieldNormalizer.class) String nom)
- throws DataNotFoundException;
+ /**
+ * Charge une méthode pour une extraction
+ * @param nom Nom de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodeExtraction loadMethodeExtraction((a)Normalize(UniqueFieldNormalizer.class) String nom)
+ throws DataNotFoundException;
- /**
- * Met à jour une méthode pour une extraction
- * @param methode La méthode
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateMethodeExtraction((a)Normalize(MethodeExtractionNormalizer.class) MethodeExtraction methode)
- throws DataConstraintException;
+ /**
+ * Met à jour une méthode pour une extraction
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateMethodeExtraction((a)Normalize(MethodeExtractionNormalizer.class) MethodeExtraction methode)
+ throws DataConstraintException;
- /**
- * Rafraichit une méthode d'extraction (pour éviter des LazyLoadingException)
- * @param methode La méthode
- */
- void refreshMethodeExtraction(MethodeExtraction methode);
+ /**
+ * Rafraichit une méthode d'extraction (pour éviter des LazyLoadingException)
+ * @param methode La méthode
+ */
+ void refreshMethodeExtraction(MethodeExtraction methode);
- /**
- * Vérifie si au moins un extrait référence ce type d'extrait
- * @param typeExtrait Le type d'extrait
- * @return TRUE si le type d'extrait est référencé
- */
- boolean isTypeExtraitReferenced(TypeExtrait typeExtrait);
+ /**
+ * Vérifie si au moins un extrait référence ce type d'extrait
+ * @param typeExtrait Le type d'extrait
+ * @return TRUE si le type d'extrait est référencé
+ */
+ boolean isTypeExtraitReferenced(TypeExtrait typeExtrait);
- /**
- * Vérifie si l'extrait de référence donnée est unique dans la base
- * @param extrait L'extrait
- * @return TRUE si l'extrait est unique
- */
- boolean isExtraitUnique(Extrait extrait);
+ /**
+ * Vérifie si l'extrait de référence donnée est unique dans la base
+ * @param extrait L'extrait
+ * @return TRUE si l'extrait est unique
+ */
+ boolean isExtraitUnique(Extrait extrait);
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/LotService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/LotService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/LotService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,122 +44,122 @@
*/
public interface LotService {
- /**
- * Compte le nombre de lots
- * @return Nombre de lots
- */
- long countLots();
+ /**
+ * Compte le nombre de lots
+ * @return Nombre de lots
+ */
+ long countLots();
- /**
- * Créée un lot
- * @param lot Lot
- * @throws DataConstraintException Si le lot (nom) existe déjà
- */
- void createLot((a)Normalize(LotNormalizer.class) Lot lot) throws DataConstraintException;
+ /**
+ * Créée un lot
+ * @param lot Lot
+ * @throws DataConstraintException Si le lot (nom) existe déjà
+ */
+ void createLot((a)Normalize(LotNormalizer.class) Lot lot) throws DataConstraintException;
- /**
- * Supprime un lot
- * @param lot Lot
- * @throws DataConstraintException Si le lot a des données liées
- */
- void deleteLot(Lot lot) throws DataConstraintException;
+ /**
+ * Supprime un lot
+ * @param lot Lot
+ * @throws DataConstraintException Si le lot a des données liées
+ */
+ void deleteLot(Lot lot) throws DataConstraintException;
- /**
- * Liste les lots pour lesquelles l'utilisateur a les droits (triés par réf)
- * @param utilisateur Utilisateur
- * @return Lots
- */
- @Transactional(readOnly = true)
- List<Lot> listLots(Utilisateur utilisateur);
+ /**
+ * Liste les lots pour lesquelles l'utilisateur a les droits (triés par réf)
+ * @param utilisateur Utilisateur
+ * @return Lots
+ */
+ @Transactional(readOnly = true)
+ List<Lot> listLots(Utilisateur utilisateur);
- /**
- * Liste les lots pour lesquelles l'utilisateur a les droits (triés par réf)
- * @param utilisateur Utilisateur non admin
- * @return Lots
- */
- SortedSet<Lot> listLotsForUser(Utilisateur utilisateur);
+ /**
+ * Liste les lots pour lesquelles l'utilisateur a les droits (triés par réf)
+ * @param utilisateur Utilisateur non admin
+ * @return Lots
+ */
+ SortedSet<Lot> listLotsForUser(Utilisateur utilisateur);
- /**
- * Détermine si un utilisateur peut modifier ou supprimer un lot
- * @param lot Lot
- * @param utilisateur Utilisateur
- * @return TRUE si il a le droit
- */
- boolean updateOrdeleteLotEnabled(Lot lot, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer un lot
+ * @param lot Lot
+ * @param utilisateur Utilisateur
+ * @return TRUE si il a le droit
+ */
+ boolean updateOrdeleteLotEnabled(Lot lot, Utilisateur utilisateur);
- /**
- * Détermine si un utilisateur peut accéder à un lot
- * @param lot Lot
- * @param utilisateur Utilisateur
- * @return TRUE si il a le droit
- */
- boolean isLotAccessibleByUser(Lot lot, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut accéder à un lot
+ * @param lot Lot
+ * @param utilisateur Utilisateur
+ * @return TRUE si il a le droit
+ */
+ boolean isLotAccessibleByUser(Lot lot, Utilisateur utilisateur);
- /**
- * Liste les parties possibles pour un lot
- * @return Parties
- */
- @Transactional(readOnly = true)
- List<Partie> listParties();
+ /**
+ * Liste les parties possibles pour un lot
+ * @return Parties
+ */
+ @Transactional(readOnly = true)
+ List<Partie> listParties();
- /**
- * Charge un lot
- * @param idLot ID
- * @return Lot
- * @throws DataNotFoundException Si le lot n'existe pas
- */
- Lot loadLot(Integer idLot) throws DataNotFoundException;
+ /**
+ * Charge un lot
+ * @param idLot ID
+ * @return Lot
+ * @throws DataNotFoundException Si le lot n'existe pas
+ */
+ Lot loadLot(Integer idLot) throws DataNotFoundException;
- /**
- * Charge un lot
- * @param ref Référence
- * @return Le lot correspondant
- * @throws DataNotFoundException Si le lot n'existe pas
- */
- Lot loadLot((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
+ /**
+ * Charge un lot
+ * @param ref Référence
+ * @return Le lot correspondant
+ * @throws DataNotFoundException Si le lot n'existe pas
+ */
+ Lot loadLot((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
- /**
- * Met à jour un lot
- * @param lot Lot
- * @throws DataConstraintException Si le lot (nom) existe déjà
- */
- void updateLot((a)Normalize(LotNormalizer.class) Lot lot) throws DataConstraintException;
+ /**
+ * Met à jour un lot
+ * @param lot Lot
+ * @throws DataConstraintException Si le lot (nom) existe déjà
+ */
+ void updateLot((a)Normalize(LotNormalizer.class) Lot lot) throws DataConstraintException;
- /**
- * Créé une partie
- * @param partie Partie
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void createPartie((a)Normalize(PartieNormalizer.class) Partie partie) throws DataConstraintException;
+ /**
+ * Créé une partie
+ * @param partie Partie
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void createPartie((a)Normalize(PartieNormalizer.class) Partie partie) throws DataConstraintException;
- /**
- * Charger une partie
- * @param idPartie ID
- * @return La partie correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- Partie loadPartie(Integer idPartie) throws DataNotFoundException;
+ /**
+ * Charger une partie
+ * @param idPartie ID
+ * @return La partie correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Partie loadPartie(Integer idPartie) throws DataNotFoundException;
- /**
- * Charger une partie
- * @param nom Nom
- * @return Partie
- * @throws DataNotFoundException Si non trouvée
- */
- Partie loadPartie((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charger une partie
+ * @param nom Nom
+ * @return Partie
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Partie loadPartie((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Modifie une partie
- * @param partie Partie
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updatePartie((a)Normalize(PartieNormalizer.class) Partie partie) throws DataConstraintException;
+ /**
+ * Modifie une partie
+ * @param partie Partie
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updatePartie((a)Normalize(PartieNormalizer.class) Partie partie) throws DataConstraintException;
- /**
- * Supprime une partie
- * @param partie Partie
- * @throws DataConstraintException En cas de données liées
- */
- void deletePartie(Partie partie) throws DataConstraintException;
+ /**
+ * Supprime une partie
+ * @param partie Partie
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deletePartie(Partie partie) throws DataConstraintException;
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MailService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MailService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MailService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,48 +35,48 @@
*/
public interface MailService {
- /**
- * Send an e-mail
- * @param recipients Recipients (not empty, no null object)
- * @param subject Subject (not empty)
- * @param text Text (not empty)
- * @throws EmailException When an e-mail error occurs
- */
- void sendMail(Collection<Utilisateur> recipients, String subject, String text) throws EmailException;
+ /**
+ * Send an e-mail
+ * @param recipients Recipients (not empty, no null object)
+ * @param subject Subject (not empty)
+ * @param text Text (not empty)
+ * @throws EmailException When an e-mail error occurs
+ */
+ void sendMail(Collection<Utilisateur> recipients, String subject, String text) throws EmailException;
- /**
- * Send an e-mail
- * @param recipients Recipients (not empty, no null object)
- * @param subject Subject (not empty)
- * @param text Text (not empty)
- * @param replyTo Reply to
- * @throws EmailException When an e-mail error occurs
- */
- void sendMail(Collection<Utilisateur> recipients, String subject, String text, String replyTo)
- throws EmailException;
+ /**
+ * Send an e-mail
+ * @param recipients Recipients (not empty, no null object)
+ * @param subject Subject (not empty)
+ * @param text Text (not empty)
+ * @param replyTo Reply to
+ * @throws EmailException When an e-mail error occurs
+ */
+ void sendMail(Collection<Utilisateur> recipients, String subject, String text, String replyTo)
+ throws EmailException;
- /**
- * Send an e-mail
- * @param recipient Recipient (not null)
- * @param subject Subject (not empty)
- * @param text Text (not empty)
- * @throws EmailException When an e-mail error occurs
- */
- void sendMail(Personne recipient, String subject, String text) throws EmailException;
+ /**
+ * Send an e-mail
+ * @param recipient Recipient (not null)
+ * @param subject Subject (not empty)
+ * @param text Text (not empty)
+ * @throws EmailException When an e-mail error occurs
+ */
+ void sendMail(Personne recipient, String subject, String text) throws EmailException;
- /**
- * Send an e-mail quietly (without throwing exceptions)
- * @param recipients Recipients (not empty, no null object)
- * @param subject Subject (not empty)
- * @param text Text (not empty)
- */
- void sendMailQuietly(Collection<Utilisateur> recipients, String subject, String text);
+ /**
+ * Send an e-mail quietly (without throwing exceptions)
+ * @param recipients Recipients (not empty, no null object)
+ * @param subject Subject (not empty)
+ * @param text Text (not empty)
+ */
+ void sendMailQuietly(Collection<Utilisateur> recipients, String subject, String text);
- /**
- * Send an e-mail quietly (without throwing exceptions)
- * @param recipient Recipient (not null)
- * @param subject Subject (not empty)
- * @param text Text (not empty)
- */
- void sendMailQuietly(Personne recipient, String subject, String text);
+ /**
+ * Send an e-mail quietly (without throwing exceptions)
+ * @param recipient Recipient (not null)
+ * @param subject Subject (not empty)
+ * @param text Text (not empty)
+ */
+ void sendMailQuietly(Personne recipient, String subject, String text);
}
\ No newline at end of file
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,60 +40,60 @@
*/
public interface MoleculeService {
- /**
- * Compte le nombre de molecules
- * @return Nombre de Molecules
- */
- long countMolecules();
+ /**
+ * Compte le nombre de molecules
+ * @return Nombre de Molecules
+ */
+ long countMolecules();
- /**
- * Créée une molecule
- * @param molecule Molecule
- * @throws DataConstraintException Si la molecule existe déjà
- */
- void createMolecule((a)Normalize(MoleculeNormalizer.class) Molecule molecule) throws DataConstraintException;
+ /**
+ * Créée une molecule
+ * @param molecule Molecule
+ * @throws DataConstraintException Si la molecule existe déjà
+ */
+ void createMolecule((a)Normalize(MoleculeNormalizer.class) Molecule molecule) throws DataConstraintException;
- /**
- * Supprime une molecule
- * @param molecule Molecule
- * @throws DataConstraintException Si la molecule a des données liées
- */
- void deleteMolecule(Molecule molecule) throws DataConstraintException;
+ /**
+ * Supprime une molecule
+ * @param molecule Molecule
+ * @throws DataConstraintException Si la molecule a des données liées
+ */
+ void deleteMolecule(Molecule molecule) throws DataConstraintException;
- /**
- * Liste les molecules
- * @return Molecules
- */
- @Transactional(readOnly = true)
- List<Molecule> listMolecules();
+ /**
+ * Liste les molecules
+ * @return Molecules
+ */
+ @Transactional(readOnly = true)
+ List<Molecule> listMolecules();
- /**
- * Charge une molecule
- * @param numero numero
- * @return Le lot correspondant
- * @throws DataNotFoundException Si le lot n'existe pas
- */
- Molecule loadMolecule(Integer numero) throws DataNotFoundException;
+ /**
+ * Charge une molecule
+ * @param numero numero
+ * @return Le lot correspondant
+ * @throws DataNotFoundException Si le lot n'existe pas
+ */
+ Molecule loadMolecule(Integer numero) throws DataNotFoundException;
- /**
- * Met à jour une molecule
- * @param molecule Molecule
- * @throws DataConstraintException Si la molecule existe déjà
- */
- void updateMolecule((a)Normalize(MoleculeNormalizer.class) Molecule molecule) throws DataConstraintException;
+ /**
+ * Met à jour une molecule
+ * @param molecule Molecule
+ * @throws DataConstraintException Si la molecule existe déjà
+ */
+ void updateMolecule((a)Normalize(MoleculeNormalizer.class) Molecule molecule) throws DataConstraintException;
- /**
+ /**
* Détermine si un utilisateur peut modifier ou supprimer une molecule.
*
* @param molecule la molecule
* @param utilisateur L'utilisateur
* @return TRUE s'il a le droit
*/
- boolean updateOrdeleteMoleculeEnabled(Molecule molecule, Utilisateur utilisateur);
-
- /**
+ boolean updateOrdeleteMoleculeEnabled(Molecule molecule, Utilisateur utilisateur);
+
+ /**
* Liste les programmes des organismes déjà saisis
* @return Organisme des molécules
*/
- public List<String> listMoleculeOrganisme();
+ public List<String> listMoleculeOrganisme();
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PersonneService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PersonneService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PersonneService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,200 +42,200 @@
*/
public interface PersonneService {
- /**
- * Créée un administrateur par défaut s'il n'y en a pas
- * @throws DataConstraintException Si la personne existe déjà (champs uniques)
- */
- void checkOrCreateAdmin() throws DataConstraintException;
+ /**
+ * Créée un administrateur par défaut s'il n'y en a pas
+ * @throws DataConstraintException Si la personne existe déjà (champs uniques)
+ */
+ void checkOrCreateAdmin() throws DataConstraintException;
- /**
- * Compte le nombre de personnes
- * @return Nombre de personnes
- */
- long countPersonnes();
+ /**
+ * Compte le nombre de personnes
+ * @return Nombre de personnes
+ */
+ long countPersonnes();
- /**
- * Création d'une personne
- * @param personne Personne
- * @throws DataConstraintException Si la personne existe déjà (champs uniques)
- */
- void createPersonne((a)Normalize(PersonneNormalizer.class) Personne personne) throws DataConstraintException;
+ /**
+ * Création d'une personne
+ * @param personne Personne
+ * @throws DataConstraintException Si la personne existe déjà (champs uniques)
+ */
+ void createPersonne((a)Normalize(PersonneNormalizer.class) Personne personne) throws DataConstraintException;
- /**
- * Enregistrement d'un utilisateur
- * @param utilisateur Utilisateur
- * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
- */
- void createUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur) throws DataConstraintException;
+ /**
+ * Enregistrement d'un utilisateur
+ * @param utilisateur Utilisateur
+ * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
+ */
+ void createUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur) throws DataConstraintException;
- /**
- * Supprime une personne
- * @param personne Personne
- * @throws DataConstraintException Si des données sont liées à la personne
- */
- void deletePersonne(Personne personne) throws DataConstraintException;
+ /**
+ * Supprime une personne
+ * @param personne Personne
+ * @throws DataConstraintException Si des données sont liées à la personne
+ */
+ void deletePersonne(Personne personne) throws DataConstraintException;
- /**
- * Supprimer un utilisateur, le transformer en personne si il a des données liées. On vérifie avant qu'il y aura
- * toujours un administrateur.
- * @param utilisateur Utilisateur
- * @throws DataConstraintException Si l'utilisateur est encore référencé (créateur d'entités)
- * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
- */
- void deleteUtilisateur(Utilisateur utilisateur) throws DataConstraintException, EmailException;
+ /**
+ * Supprimer un utilisateur, le transformer en personne si il a des données liées. On vérifie avant qu'il y aura
+ * toujours un administrateur.
+ * @param utilisateur Utilisateur
+ * @throws DataConstraintException Si l'utilisateur est encore référencé (créateur d'entités)
+ * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
+ */
+ void deleteUtilisateur(Utilisateur utilisateur) throws DataConstraintException, EmailException;
- /**
- * Hachage du mot de passe
- * @param password Mot de passe
- * @return Mot de passe haché
- */
- String hashPassword(String password);
+ /**
+ * Hachage du mot de passe
+ * @param password Mot de passe
+ * @return Mot de passe haché
+ */
+ String hashPassword(String password);
- /**
- * Liste les personnes (triés par nom, prénom). Les utilisateurs non valides sont exclus.
- * @return Personnes
- */
- @Transactional(readOnly = true)
- List<Personne> listPersonnes();
+ /**
+ * Liste les personnes (triés par nom, prénom). Les utilisateurs non valides sont exclus.
+ * @return Personnes
+ */
+ @Transactional(readOnly = true)
+ List<Personne> listPersonnes();
- /**
- * Liste les personnes (triés par nom, prénom) avec y compris les utilisateurs invalides.
- * @return Personnes
- */
- @Transactional(readOnly = true)
- List<Personne> listPersonnesWithInvalidUsers();
+ /**
+ * Liste les personnes (triés par nom, prénom) avec y compris les utilisateurs invalides.
+ * @return Personnes
+ */
+ @Transactional(readOnly = true)
+ List<Personne> listPersonnesWithInvalidUsers();
- /**
- * Liste les organismes existants pour les personnes
- * @return Les organismes
- */
- @Transactional(readOnly = true)
- List<String> listPersonneOrganismes();
+ /**
+ * Liste les organismes existants pour les personnes
+ * @return Les organismes
+ */
+ @Transactional(readOnly = true)
+ List<String> listPersonneOrganismes();
- /**
- * Liste les utilisateurs à valider
- * @return Utilisateurs à valider
- */
- @Transactional(readOnly = true)
- List<Utilisateur> listUtilisateursInvalid();
+ /**
+ * Liste les utilisateurs à valider
+ * @return Utilisateurs à valider
+ */
+ @Transactional(readOnly = true)
+ List<Utilisateur> listUtilisateursInvalid();
- /**
- * Liste les utilisateurs valides
- * @return Utilisateurs valides
- */
- @Transactional(readOnly = true)
- List<Utilisateur> listUtilisateursValid();
+ /**
+ * Liste les utilisateurs valides
+ * @return Utilisateurs valides
+ */
+ @Transactional(readOnly = true)
+ List<Utilisateur> listUtilisateursValid();
- /**
- * Charge une personne
- * @param idPersonne Identifiant
- * @return Utilisateur
- * @throws DataNotFoundException Si la personne n'existe pas
- */
- Personne loadPersonne(Integer idPersonne) throws DataNotFoundException;
+ /**
+ * Charge une personne
+ * @param idPersonne Identifiant
+ * @return Utilisateur
+ * @throws DataNotFoundException Si la personne n'existe pas
+ */
+ Personne loadPersonne(Integer idPersonne) throws DataNotFoundException;
- /**
- * Charge une personne
- * @param courriel Courriel
- * @return Utilisateur
- * @throws DataNotFoundException Si la personne n'existe pas
- */
- Personne loadPersonne((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException;
+ /**
+ * Charge une personne
+ * @param courriel Courriel
+ * @return Utilisateur
+ * @throws DataNotFoundException Si la personne n'existe pas
+ */
+ Personne loadPersonne((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException;
- /**
- * Charge un utilisateur
- * @param idPersonne Identifiant
- * @return Utilisateur
- * @throws DataNotFoundException Si l'utilisateur n'existe pas
- */
- Utilisateur loadUtilisateur(Integer idPersonne) throws DataNotFoundException;
+ /**
+ * Charge un utilisateur
+ * @param idPersonne Identifiant
+ * @return Utilisateur
+ * @throws DataNotFoundException Si l'utilisateur n'existe pas
+ */
+ Utilisateur loadUtilisateur(Integer idPersonne) throws DataNotFoundException;
- /**
- * Charge un utilisateur
- * @param courriel Courriel
- * @return Utilisateur
- * @throws DataNotFoundException Si l'utilisateur n'existe pas
- */
- Utilisateur loadUtilisateur((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException;
+ /**
+ * Charge un utilisateur
+ * @param courriel Courriel
+ * @return Utilisateur
+ * @throws DataNotFoundException Si l'utilisateur n'existe pas
+ */
+ Utilisateur loadUtilisateur((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException;
- /**
- * Authentifie un utilisateur. L'utilisateur ne doit pas seulement exister mais être également validé.
- * @param courriel Courriel
- * @param passwordHash Mot de passe haché
- * @return Vrai si l'authentification réussit
- */
- boolean authenticateUtilisateur((a)Normalize(EmailNormalizer.class) String courriel, String passwordHash);
+ /**
+ * Authentifie un utilisateur. L'utilisateur ne doit pas seulement exister mais être également validé.
+ * @param courriel Courriel
+ * @param passwordHash Mot de passe haché
+ * @return Vrai si l'authentification réussit
+ */
+ boolean authenticateUtilisateur((a)Normalize(EmailNormalizer.class) String courriel, String passwordHash);
- /**
- * Rafraichit une personne (pour éviter des LazyLoadingException)
- * @param personne Personne
- */
- void refreshPersonne(Personne personne);
+ /**
+ * Rafraichit une personne (pour éviter des LazyLoadingException)
+ * @param personne Personne
+ */
+ void refreshPersonne(Personne personne);
- /**
- * Refuser un utilisateur, et le prévient par e-mail (supprimé de la BD ou transformé en personne si données liées)
- * @param utilisateur Utilisateur
- */
- void rejectUtilisateur(Utilisateur utilisateur);
+ /**
+ * Refuser un utilisateur, et le prévient par e-mail (supprimé de la BD ou transformé en personne si données liées)
+ * @param utilisateur Utilisateur
+ */
+ void rejectUtilisateur(Utilisateur utilisateur);
- /**
- * Met à jour le mot de passe (perdu) d'un utilisateur, et lui envoie un e-mail
- * @param courriel Courriel
- * @throws DataNotFoundException Si le courriel n'existe pas
- * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
- */
- void resetPasswordUtilisateur((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException,
- EmailException;
+ /**
+ * Met à jour le mot de passe (perdu) d'un utilisateur, et lui envoie un e-mail
+ * @param courriel Courriel
+ * @throws DataNotFoundException Si le courriel n'existe pas
+ * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
+ */
+ void resetPasswordUtilisateur((a)Normalize(EmailNormalizer.class) String courriel) throws DataNotFoundException,
+ EmailException;
- /**
- * Envoie un e-mail aux administrateurs
- * @param subject Sujet
- * @param message Message
- * @param replyTo Expéditeur
- * @throws EmailException En cas d'erreur lors de l'envoi
- */
- void sendMailAdmins(String subject, String message, String replyTo) throws EmailException;
+ /**
+ * Envoie un e-mail aux administrateurs
+ * @param subject Sujet
+ * @param message Message
+ * @param replyTo Expéditeur
+ * @throws EmailException En cas d'erreur lors de l'envoi
+ */
+ void sendMailAdmins(String subject, String message, String replyTo) throws EmailException;
- /**
- * Met à jour et transforme une personne en utilisateur, génère un mot de passe automatique et le prévient par
- * e-mail
- * @param personne Personne
- * @return Utilisateur créé
- * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
- * @throws DataConstraintException Si la personne existe déjà (champs uniques)
- */
- Utilisateur updateAndCreateUtilisateur((a)Normalize(PersonneNormalizer.class) Personne personne)
- throws EmailException, DataConstraintException;
+ /**
+ * Met à jour et transforme une personne en utilisateur, génère un mot de passe automatique et le prévient par
+ * e-mail
+ * @param personne Personne
+ * @return Utilisateur créé
+ * @throws EmailException En cas d'erreur dans l'envoi d'e-mail
+ * @throws DataConstraintException Si la personne existe déjà (champs uniques)
+ */
+ Utilisateur updateAndCreateUtilisateur((a)Normalize(PersonneNormalizer.class) Personne personne)
+ throws EmailException, DataConstraintException;
- /**
- * Met à jour une personne
- * @param personne Personne
- * @throws DataConstraintException Si la personne existe déjà (champs uniques)
- */
- void updatePersonne((a)Normalize(PersonneNormalizer.class) Personne personne) throws DataConstraintException;
+ /**
+ * Met à jour une personne
+ * @param personne Personne
+ * @throws DataConstraintException Si la personne existe déjà (champs uniques)
+ */
+ void updatePersonne((a)Normalize(PersonneNormalizer.class) Personne personne) throws DataConstraintException;
- /**
- * Met à jour un utilisateur, et lui envoie un e-mail si cela a été effectuée par un administrateur
- * @param utilisateur Utilisateur
- * @param admin Effectuée par un administrateur ?
- * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
- */
- void updateUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur, boolean admin)
- throws DataConstraintException;
+ /**
+ * Met à jour un utilisateur, et lui envoie un e-mail si cela a été effectuée par un administrateur
+ * @param utilisateur Utilisateur
+ * @param admin Effectuée par un administrateur ?
+ * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
+ */
+ void updateUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur, boolean admin)
+ throws DataConstraintException;
- /**
- * Valide et met à jour un utilisateur, et le prévient par e-mail
- * @param utilisateur Utilisateur
- * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
- */
- void validAndUpdateUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur)
- throws DataConstraintException;
+ /**
+ * Valide et met à jour un utilisateur, et le prévient par e-mail
+ * @param utilisateur Utilisateur
+ * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
+ */
+ void validAndUpdateUtilisateur((a)Normalize(PersonneNormalizer.class) Utilisateur utilisateur)
+ throws DataConstraintException;
- /**
- * Test de droits pour la modification ou suppression d'une personne (ou par héritage d'un utilisateur)
- * @param personne Personne à mettre à jour
- * @param modifieur L'utilisateur qui fait la modification
- * @return vrai si l'utilisateur peut modifier ou supprimer la personne
- */
- boolean updateOrDeletePersonneEnabled(Personne personne, Utilisateur modifieur);
+ /**
+ * Test de droits pour la modification ou suppression d'une personne (ou par héritage d'un utilisateur)
+ * @param personne Personne à mettre à jour
+ * @param modifieur L'utilisateur qui fait la modification
+ * @return vrai si l'utilisateur peut modifier ou supprimer la personne
+ */
+ boolean updateOrDeletePersonneEnabled(Personne personne, Utilisateur modifieur);
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ProduitService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ProduitService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/ProduitService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,37 +37,37 @@
*/
public interface ProduitService {
- /**
- * Liste les produits disponibles selon les droits d'un utilisateur (trié par réf)
- * @param utilisateur L'utilisateur
- * @return la liste des produits
- */
- @Transactional(readOnly = true)
- List<Produit> listProduits(Utilisateur utilisateur);
+ /**
+ * Liste les produits disponibles selon les droits d'un utilisateur (trié par réf)
+ * @param utilisateur L'utilisateur
+ * @return la liste des produits
+ */
+ @Transactional(readOnly = true)
+ List<Produit> listProduits(Utilisateur utilisateur);
- /**
- * Liste les produits disponibles selon les droits d'un utilisateur (trié par réf)
- * @param utilisateur L'utilisateur non admin
- * @return la liste des produits
- */
- SortedSet<Produit> listProduitsForUser(Utilisateur utilisateur);
+ /**
+ * Liste les produits disponibles selon les droits d'un utilisateur (trié par réf)
+ * @param utilisateur L'utilisateur non admin
+ * @return la liste des produits
+ */
+ SortedSet<Produit> listProduitsForUser(Utilisateur utilisateur);
- /**
- * Liste les produits disponibles selon les droits d'un utilisateur. Enlève en plus tous les produits resultants de
- * la purification donnée
- * @param utilisateur L'utilisateur
- * @param purification La purification
- * @return la liste des produits
- */
- @Transactional(readOnly = true)
- List<Produit> listProduitsWithoutChildrenOfPuri(Utilisateur utilisateur, Purification purification);
+ /**
+ * Liste les produits disponibles selon les droits d'un utilisateur. Enlève en plus tous les produits resultants de
+ * la purification donnée
+ * @param utilisateur L'utilisateur
+ * @param purification La purification
+ * @return la liste des produits
+ */
+ @Transactional(readOnly = true)
+ List<Produit> listProduitsWithoutChildrenOfPuri(Utilisateur utilisateur, Purification purification);
- /**
- * Vérifie si des données référence le produit (purification ou test biologique)
- * @param produit Le produit
- * @return TRUE si le produit est référencé au moins une fois
- */
- @Transactional(readOnly = true)
- boolean isProduitReferenced(Produit produit);
+ /**
+ * Vérifie si des données référence le produit (purification ou test biologique)
+ * @param produit Le produit
+ * @return TRUE si le produit est référencé au moins une fois
+ */
+ @Transactional(readOnly = true)
+ boolean isProduitReferenced(Produit produit);
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PurificationService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PurificationService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/PurificationService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,162 +45,162 @@
*/
public interface PurificationService {
- /**
- * Compte le nombre de purifications
- * @return Nombre de purifications
- */
- long countPurifications();
+ /**
+ * Compte le nombre de purifications
+ * @return Nombre de purifications
+ */
+ long countPurifications();
- /**
- * Créée une manipulation de purification
- * @param purification La manipulation
- * @throws DataConstraintException Si la manipulation (réf) existe déjà
- */
- void createPurification((a)Normalize(PurificationNormalizer.class) Purification purification)
- throws DataConstraintException;
+ /**
+ * Créée une manipulation de purification
+ * @param purification La manipulation
+ * @throws DataConstraintException Si la manipulation (réf) existe déjà
+ */
+ void createPurification((a)Normalize(PurificationNormalizer.class) Purification purification)
+ throws DataConstraintException;
- /**
- * Initialise les paramètres de la méthode avec des valeurs vides. Si certains paramètres existent déjà, aucune
- * modification sur eux
- * @param purification La purification
- */
- void initParamsMethoPuriEffectif(Purification purification);
+ /**
+ * Initialise les paramètres de la méthode avec des valeurs vides. Si certains paramètres existent déjà, aucune
+ * modification sur eux
+ * @param purification La purification
+ */
+ void initParamsMethoPuriEffectif(Purification purification);
- /**
- * Supprime une manipulation de purification
- * @param purification La manipulation
- * @throws DataConstraintException En cas de données liées
- */
- void deletePurification(Purification purification) throws DataConstraintException;
+ /**
+ * Supprime une manipulation de purification
+ * @param purification La manipulation
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deletePurification(Purification purification) throws DataConstraintException;
- /**
- * Liste les manipulations de purification selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur
- * @return la liste des manipulations
- */
- @Transactional(readOnly = true)
- List<Purification> listPurifications(Utilisateur utilisateur);
+ /**
+ * Liste les manipulations de purification selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur
+ * @return la liste des manipulations
+ */
+ @Transactional(readOnly = true)
+ List<Purification> listPurifications(Utilisateur utilisateur);
- /**
- * Liste les manipulations de purification selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur non admin
- * @return la liste des manipulations
- */
- SortedSet<Purification> listPurificationsForUser(Utilisateur utilisateur);
+ /**
+ * Liste les manipulations de purification selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur non admin
+ * @return la liste des manipulations
+ */
+ SortedSet<Purification> listPurificationsForUser(Utilisateur utilisateur);
- /**
- * Vérifie si la purification de référence donnée existe est unique dans la base
- * @param purification La purification
- * @return TRUE si la purification est unique
- */
- @Transactional(readOnly = true)
- boolean isPurificationUnique(Purification purification);
+ /**
+ * Vérifie si la purification de référence donnée existe est unique dans la base
+ * @param purification La purification
+ * @return TRUE si la purification est unique
+ */
+ @Transactional(readOnly = true)
+ boolean isPurificationUnique(Purification purification);
- /**
- * Charge une manipulation de purification
- * @param idPurification ID de la manipulation
- * @return La manipulation
- * @throws DataNotFoundException Si non trouvée
- */
- Purification loadPurification(Integer idPurification) throws DataNotFoundException;
+ /**
+ * Charge une manipulation de purification
+ * @param idPurification ID de la manipulation
+ * @return La manipulation
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Purification loadPurification(Integer idPurification) throws DataNotFoundException;
- /**
- * Charge une manipulation de purification
- * @param ref Référence de la manipulation
- * @return La manipulation correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- Purification loadPurification((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
+ /**
+ * Charge une manipulation de purification
+ * @param ref Référence de la manipulation
+ * @return La manipulation correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ Purification loadPurification((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
- /**
- * Met à jour une manipulation de purification
- * @param purification La manipulation
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updatePurification((a)Normalize(PurificationNormalizer.class) Purification purification)
- throws DataConstraintException;
+ /**
+ * Met à jour une manipulation de purification
+ * @param purification La manipulation
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updatePurification((a)Normalize(PurificationNormalizer.class) Purification purification)
+ throws DataConstraintException;
- /**
- * Rafraichit une purification (pour éviter des LazyLoadingException)
- * @param purification Purification
- */
- void refreshPurification(Purification purification);
+ /**
+ * Rafraichit une purification (pour éviter des LazyLoadingException)
+ * @param purification Purification
+ */
+ void refreshPurification(Purification purification);
- /**
- * Détermine si un utilisateur peut modifier ou supprimer une purification
- * @param purification La manipulation
- * @param utilisateur L'utilisateur
- * @return TRUE s'il a le droit
- */
- boolean updateOrdeletePurificationEnabled(Purification purification, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer une purification
+ * @param purification La manipulation
+ * @param utilisateur L'utilisateur
+ * @return TRUE s'il a le droit
+ */
+ boolean updateOrdeletePurificationEnabled(Purification purification, Utilisateur utilisateur);
- /**
- * Créée une méthode pour une purification
- * @param methode La méthode
- * @throws DataConstraintException Si la méthode (nom) existe déjà
- */
- void createMethodePurification((a)Normalize(MethodePurificationNormalizer.class) MethodePurification methode)
- throws DataConstraintException;
+ /**
+ * Créée une méthode pour une purification
+ * @param methode La méthode
+ * @throws DataConstraintException Si la méthode (nom) existe déjà
+ */
+ void createMethodePurification((a)Normalize(MethodePurificationNormalizer.class) MethodePurification methode)
+ throws DataConstraintException;
- /**
- * Supprime une méthode pour une purification
- * @param methode La méthode
- * @throws DataConstraintException En cas de données liées
- */
- void deleteMethodePurification(MethodePurification methode) throws DataConstraintException;
+ /**
+ * Supprime une méthode pour une purification
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteMethodePurification(MethodePurification methode) throws DataConstraintException;
- /**
- * Liste les méthodes existantes pour une purification (triés par nom)
- * @return la liste des méthodes
- */
- @Transactional(readOnly = true)
- List<MethodePurification> listMethodesPurification();
+ /**
+ * Liste les méthodes existantes pour une purification (triés par nom)
+ * @return la liste des méthodes
+ */
+ @Transactional(readOnly = true)
+ List<MethodePurification> listMethodesPurification();
- /**
- * Charge une méthode pour une purification
- * @param idMethode ID de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodePurification loadMethodePurification(Integer idMethode) throws DataNotFoundException;
+ /**
+ * Charge une méthode pour une purification
+ * @param idMethode ID de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodePurification loadMethodePurification(Integer idMethode) throws DataNotFoundException;
- /**
- * Charge une méthode pour une purification
- * @param nom Nom de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodePurification loadMethodePurification((a)Normalize(UniqueFieldNormalizer.class) String nom)
- throws DataNotFoundException;
+ /**
+ * Charge une méthode pour une purification
+ * @param nom Nom de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodePurification loadMethodePurification((a)Normalize(UniqueFieldNormalizer.class) String nom)
+ throws DataNotFoundException;
- /**
- * Met à jour une méthode pour une purification
- * @param methode La méthode
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateMethodePurification((a)Normalize(MethodePurificationNormalizer.class) MethodePurification methode)
- throws DataConstraintException;
+ /**
+ * Met à jour une méthode pour une purification
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateMethodePurification((a)Normalize(MethodePurificationNormalizer.class) MethodePurification methode)
+ throws DataConstraintException;
- /**
- * Rafraichit une méthode de purification (pour éviter des LazyLoadingException)
- * @param methode La méthode
- */
- void refreshMethodePurification(MethodePurification methode);
+ /**
+ * Rafraichit une méthode de purification (pour éviter des LazyLoadingException)
+ * @param methode La méthode
+ */
+ void refreshMethodePurification(MethodePurification methode);
- /**
- * Vérifie si au moins une purification référence le paramètre
- * @param paramMetho Le paramètre de la méthode
- * @return TRUE si le paramètre est référencé
- */
- @Transactional(readOnly = true)
- boolean isParamMethoPuriReferenced(ParamMethoPuri paramMetho);
+ /**
+ * Vérifie si au moins une purification référence le paramètre
+ * @param paramMetho Le paramètre de la méthode
+ * @return TRUE si le paramètre est référencé
+ */
+ @Transactional(readOnly = true)
+ boolean isParamMethoPuriReferenced(ParamMethoPuri paramMetho);
- /**
- * Vérifie si la fraction de référence donnée est unique dans la base
- * @param fraction La fraction
- * @return TRUE si la fraction existe
- */
- @Transactional(readOnly = true)
- boolean isFractionUnique(Fraction fraction);
+ /**
+ * Vérifie si la fraction de référence donnée est unique dans la base
+ * @param fraction La fraction
+ * @return TRUE si la fraction existe
+ */
+ @Transactional(readOnly = true)
+ boolean isFractionUnique(Fraction fraction);
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/SpecimenService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/SpecimenService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/SpecimenService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,119 +42,119 @@
*/
public interface SpecimenService {
- /**
- * Compte le nombre de specimens
- * @return Nombre de specimens
- */
- long countSpecimens();
+ /**
+ * Compte le nombre de specimens
+ * @return Nombre de specimens
+ */
+ long countSpecimens();
- /**
- * Créée un spécimen
- * @param specimen Spécimen
- * @throws DataConstraintException Si le spécimen (nom) existe déjà
- */
- void createSpecimen((a)Normalize(SpecimenNormalizer.class) Specimen specimen) throws DataConstraintException;
+ /**
+ * Créée un spécimen
+ * @param specimen Spécimen
+ * @throws DataConstraintException Si le spécimen (nom) existe déjà
+ */
+ void createSpecimen((a)Normalize(SpecimenNormalizer.class) Specimen specimen) throws DataConstraintException;
- /**
- * Supprime un spécimen
- * @param specimen Spécimen
- * @throws DataConstraintException Si le spécimen a des données liées
- */
- void deleteSpecimen(Specimen specimen) throws DataConstraintException;
+ /**
+ * Supprime un spécimen
+ * @param specimen Spécimen
+ * @throws DataConstraintException Si le spécimen a des données liées
+ */
+ void deleteSpecimen(Specimen specimen) throws DataConstraintException;
- /**
- * Liste les spécimens selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur
- * @return La liste des spécimens
- */
- @Transactional(readOnly = true)
- List<Specimen> listSpecimens(Utilisateur utilisateur);
+ /**
+ * Liste les spécimens selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur
+ * @return La liste des spécimens
+ */
+ @Transactional(readOnly = true)
+ List<Specimen> listSpecimens(Utilisateur utilisateur);
- /**
- * Liste l'ensemble des specimens selon les droits d'un utilisateur (triés par réf)
- * @param utilisateur L'utilisateur
- * @return La liste des spécimens
- */
- SortedSet<Specimen> listSpecimensForUser(Utilisateur utilisateur);
+ /**
+ * Liste l'ensemble des specimens selon les droits d'un utilisateur (triés par réf)
+ * @param utilisateur L'utilisateur
+ * @return La liste des spécimens
+ */
+ SortedSet<Specimen> listSpecimensForUser(Utilisateur utilisateur);
- /**
- * Liste les embranchements existants pour les spécimens
- * @return Les embranchements
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenEmbranchements();
+ /**
+ * Liste les embranchements existants pour les spécimens
+ * @return Les embranchements
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenEmbranchements();
- /**
- * Liste les embranchements existants pour les spécimens
- * @return Les familles
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenFamilles();
+ /**
+ * Liste les embranchements existants pour les spécimens
+ * @return Les familles
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenFamilles();
- /**
- * Liste les genres existants pour les spécimens
- * @return Les genres
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenGenres();
+ /**
+ * Liste les genres existants pour les spécimens
+ * @return Les genres
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenGenres();
- /**
- * Liste les espèces existants pour les spécimens
- * @return Les espèces
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenEspeces();
+ /**
+ * Liste les espèces existants pour les spécimens
+ * @return Les espèces
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenEspeces();
- /**
- * Liste les sous-espèces existants pour les spécimens
- * @return Les sous-espèces
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenSousEspeces();
+ /**
+ * Liste les sous-espèces existants pour les spécimens
+ * @return Les sous-espèces
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenSousEspeces();
- /**
- * Liste les variétés existants pour les spécimens
- * @return Les variétés
- */
- @Transactional(readOnly = true)
- List<String> listSpecimenVarietes();
+ /**
+ * Liste les variétés existants pour les spécimens
+ * @return Les variétés
+ */
+ @Transactional(readOnly = true)
+ List<String> listSpecimenVarietes();
- /**
- * Liste les lieux de dépots existants pour les spécimens
- * @return Les lieux de dépôt
- */
- @Transactional(readOnly = true)
- List<String> listLieuxDepot();
+ /**
+ * Liste les lieux de dépots existants pour les spécimens
+ * @return Les lieux de dépôt
+ */
+ @Transactional(readOnly = true)
+ List<String> listLieuxDepot();
- /**
- * Charge un spécimen
- * @param idSpecimen ID
- * @return Spécimen
- * @throws DataNotFoundException Si le spécimen n'existe pas
- */
- Specimen loadSpecimen(Integer idSpecimen) throws DataNotFoundException;
+ /**
+ * Charge un spécimen
+ * @param idSpecimen ID
+ * @return Spécimen
+ * @throws DataNotFoundException Si le spécimen n'existe pas
+ */
+ Specimen loadSpecimen(Integer idSpecimen) throws DataNotFoundException;
- /**
- * Charge un pécimen
- * @param ref Référence
- * @return Spécimen
- * @throws DataNotFoundException Si le spécimen n'existe pas
- */
- Specimen loadSpecimen((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
+ /**
+ * Charge un pécimen
+ * @param ref Référence
+ * @return Spécimen
+ * @throws DataNotFoundException Si le spécimen n'existe pas
+ */
+ Specimen loadSpecimen((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
- /**
- * Détermine si un utilisateur peut modifier ou supprimer un specimen
- * @param specimen Specimen
- * @param utilisateur Utilisateur
- * @return TRUE si il a le droit
- */
- boolean updateOrdeleteSpecimenEnabled(Specimen specimen, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer un specimen
+ * @param specimen Specimen
+ * @param utilisateur Utilisateur
+ * @return TRUE si il a le droit
+ */
+ boolean updateOrdeleteSpecimenEnabled(Specimen specimen, Utilisateur utilisateur);
- /**
- * Met à jour un spécimen
- * @param specimen Spécimen
- * @throws DataConstraintException Si le pécimen (nom) existe déjà
- */
- void updateSpecimen((a)Normalize(SpecimenNormalizer.class) Specimen specimen) throws DataConstraintException;
+ /**
+ * Met à jour un spécimen
+ * @param specimen Spécimen
+ * @throws DataConstraintException Si le pécimen (nom) existe déjà
+ */
+ void updateSpecimen((a)Normalize(SpecimenNormalizer.class) Specimen specimen) throws DataConstraintException;
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/StationService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/StationService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/StationService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,76 +42,76 @@
*/
public interface StationService {
- /**
- * Compte le nombre de stations
- * @return Nombre de stations
- */
- long countStations();
+ /**
+ * Compte le nombre de stations
+ * @return Nombre de stations
+ */
+ long countStations();
- /**
- * Créée une station
- * @param station Station
- * @throws DataConstraintException Si la station existe déjà
- */
- void createStation((a)Normalize(StationNormalizer.class) Station station) throws DataConstraintException;
+ /**
+ * Créée une station
+ * @param station Station
+ * @throws DataConstraintException Si la station existe déjà
+ */
+ void createStation((a)Normalize(StationNormalizer.class) Station station) throws DataConstraintException;
- /**
- * Supprime une station
- * @param station Station
- * @throws DataConstraintException Si des données liées empêchent la suppression
- */
- void deleteStation(Station station) throws DataConstraintException;
+ /**
+ * Supprime une station
+ * @param station Station
+ * @throws DataConstraintException Si des données liées empêchent la suppression
+ */
+ void deleteStation(Station station) throws DataConstraintException;
- /**
- * Liste les localités des stations
- * @return Localités
- */
- @Transactional(readOnly = true)
- List<String> listStationLocalites();
+ /**
+ * Liste les localités des stations
+ * @return Localités
+ */
+ @Transactional(readOnly = true)
+ List<String> listStationLocalites();
- /**
- * Liste les stations selon les droits d'un utilisateur (triés par nom)
- * @param utilisateur L'utilisateur
- * @return Stations
- */
- @Transactional(readOnly = true)
- List<Station> listStations(Utilisateur utilisateur);
+ /**
+ * Liste les stations selon les droits d'un utilisateur (triés par nom)
+ * @param utilisateur L'utilisateur
+ * @return Stations
+ */
+ @Transactional(readOnly = true)
+ List<Station> listStations(Utilisateur utilisateur);
- /**
- * Liste l'ensemble des stations selon les droits d'un utilisateur (triés par nom)
- * @param utilisateur L'utilisateur
- * @return la liste des stations
- */
- SortedSet<Station> listStationsForUser(Utilisateur utilisateur);
+ /**
+ * Liste l'ensemble des stations selon les droits d'un utilisateur (triés par nom)
+ * @param utilisateur L'utilisateur
+ * @return la liste des stations
+ */
+ SortedSet<Station> listStationsForUser(Utilisateur utilisateur);
- /**
- * Charge une station
- * @param idStation ID
- * @return Station
- * @throws DataNotFoundException Si la station n'existe pas
- */
- Station loadStation(Integer idStation) throws DataNotFoundException;
+ /**
+ * Charge une station
+ * @param idStation ID
+ * @return Station
+ * @throws DataNotFoundException Si la station n'existe pas
+ */
+ Station loadStation(Integer idStation) throws DataNotFoundException;
- /**
- * Charge une station
- * @param nom Nom
- * @return Station
- * @throws DataNotFoundException Si la station n'existe pas
- */
- Station loadStation((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charge une station
+ * @param nom Nom
+ * @return Station
+ * @throws DataNotFoundException Si la station n'existe pas
+ */
+ Station loadStation((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Détermine si un utilisateur peut modifier ou supprimer une station
- * @param station Station
- * @param utilisateur Utilisateur
- * @return TRUE si il a le droit
- */
- boolean updateOrdeleteStationEnabled(Station station, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer une station
+ * @param station Station
+ * @param utilisateur Utilisateur
+ * @return TRUE si il a le droit
+ */
+ boolean updateOrdeleteStationEnabled(Station station, Utilisateur utilisateur);
- /**
- * Met à jour une station
- * @param station Station
- * @throws DataConstraintException Si la station existe déjà
- */
- void updateStation((a)Normalize(StationNormalizer.class) Station station) throws DataConstraintException;
+ /**
+ * Met à jour une station
+ * @param station Station
+ * @throws DataConstraintException Si la station existe déjà
+ */
+ void updateStation((a)Normalize(StationNormalizer.class) Station station) throws DataConstraintException;
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/TestBioService.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/TestBioService.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/TestBioService.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -46,221 +46,221 @@
*/
public interface TestBioService {
- /**
- * Compte le nombre de resultats de tests biologiques
- * @return Nombre de resultats de tests biologiques
- */
- long countResultatsTestsBio();
+ /**
+ * Compte le nombre de resultats de tests biologiques
+ * @return Nombre de resultats de tests biologiques
+ */
+ long countResultatsTestsBio();
- /**
- * Créée une manipulation de testBio
- * @param testBio La manipulation
- * @throws DataConstraintException Si la manipulation (réf) existe déjà
- */
- void createTestBio((a)Normalize(TestBioNormalizer.class) TestBio testBio) throws DataConstraintException;
+ /**
+ * Créée une manipulation de testBio
+ * @param testBio La manipulation
+ * @throws DataConstraintException Si la manipulation (réf) existe déjà
+ */
+ void createTestBio((a)Normalize(TestBioNormalizer.class) TestBio testBio) throws DataConstraintException;
- /**
- * Supprime une manipulation de testBio
- * @param testBio La manipulation
- * @throws DataConstraintException En cas de données liées
- */
- void deleteTestBio(TestBio testBio) throws DataConstraintException;
+ /**
+ * Supprime une manipulation de testBio
+ * @param testBio La manipulation
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteTestBio(TestBio testBio) throws DataConstraintException;
- /**
- * Liste l'ensemble des résultats de tests biologiques selon les droits d'un utilisateur (triés par réf produit)
- * @param utilisateur L'utilisateur
- * @return la liste des résultats
- */
- @Transactional(readOnly = true)
- List<ResultatTestBio> listResultatsTestBio(Utilisateur utilisateur);
+ /**
+ * Liste l'ensemble des résultats de tests biologiques selon les droits d'un utilisateur (triés par réf produit)
+ * @param utilisateur L'utilisateur
+ * @return la liste des résultats
+ */
+ @Transactional(readOnly = true)
+ List<ResultatTestBio> listResultatsTestBio(Utilisateur utilisateur);
- /**
- * Liste l'ensemble des résultats de tests biologiques selon les droits d'un utilisateur (triés par réf produit)
- * @param utilisateur L'utilisateur non admin
- * @return la liste des résultats
- */
- SortedSet<ResultatTestBio> listResultatsTestBioForUser(Utilisateur utilisateur);
+ /**
+ * Liste l'ensemble des résultats de tests biologiques selon les droits d'un utilisateur (triés par réf produit)
+ * @param utilisateur L'utilisateur non admin
+ * @return la liste des résultats
+ */
+ SortedSet<ResultatTestBio> listResultatsTestBioForUser(Utilisateur utilisateur);
- /**
- * Liste les produits témoins existants pour les résultats de tests biologiques
- * @return Les organismes
- */
- @Transactional(readOnly = true)
- List<String> listProduitsTemoins();
+ /**
+ * Liste les produits témoins existants pour les résultats de tests biologiques
+ * @return Les organismes
+ */
+ @Transactional(readOnly = true)
+ List<String> listProduitsTemoins();
- /**
- * Vérifie si le test biologique de référence donnée est unique dans la base
- * @param testBio Le test biologique
- * @return TRUE si le tet biologique est unique
- */
- @Transactional(readOnly = true)
- boolean isTestBioUnique(TestBio testBio);
+ /**
+ * Vérifie si le test biologique de référence donnée est unique dans la base
+ * @param testBio Le test biologique
+ * @return TRUE si le tet biologique est unique
+ */
+ @Transactional(readOnly = true)
+ boolean isTestBioUnique(TestBio testBio);
- /**
- * Charge une manipulation de test biologique
- * @param idTestBio ID de la manipulation
- * @return La manipulation
- * @throws DataNotFoundException Si non trouvée
- */
- TestBio loadTestBio(Integer idTestBio) throws DataNotFoundException;
+ /**
+ * Charge une manipulation de test biologique
+ * @param idTestBio ID de la manipulation
+ * @return La manipulation
+ * @throws DataNotFoundException Si non trouvée
+ */
+ TestBio loadTestBio(Integer idTestBio) throws DataNotFoundException;
- /**
- * Charge une manipulation de test biologique
- * @param ref Référence de la manipulation
- * @return La manipulation correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- TestBio loadTestBio((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
+ /**
+ * Charge une manipulation de test biologique
+ * @param ref Référence de la manipulation
+ * @return La manipulation correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ TestBio loadTestBio((a)Normalize(UniqueFieldNormalizer.class) String ref) throws DataNotFoundException;
- /**
- * Met à jour une manipulation de test biologique
- * @param testBio La manipulation
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateTestBio((a)Normalize(TestBioNormalizer.class) TestBio testBio) throws DataConstraintException;
+ /**
+ * Met à jour une manipulation de test biologique
+ * @param testBio La manipulation
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateTestBio((a)Normalize(TestBioNormalizer.class) TestBio testBio) throws DataConstraintException;
- /**
- * Rafraichit une testBio (pour éviter des LazyLoadingException)
- * @param testBio TestBio
- */
- void refreshTestBio(TestBio testBio);
+ /**
+ * Rafraichit une testBio (pour éviter des LazyLoadingException)
+ * @param testBio TestBio
+ */
+ void refreshTestBio(TestBio testBio);
- /**
- * Détermine si un utilisateur peut modifier ou supprimer un test biologique
- * @param testBio La manipulation
- * @param utilisateur L'utilisateur
- * @return TRUE s'il a le droit
- */
- boolean updateOrdeleteTestBioEnabled(TestBio testBio, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut modifier ou supprimer un test biologique
+ * @param testBio La manipulation
+ * @param utilisateur L'utilisateur
+ * @return TRUE s'il a le droit
+ */
+ boolean updateOrdeleteTestBioEnabled(TestBio testBio, Utilisateur utilisateur);
- /**
- * Détermine si un utilisateur peut accéder à un résultat de test biologique
- * @param resultatTestBio Le résultat
- * @param utilisateur L'utilisateur
- * @return TRUE s'il a le droit
- */
- @Transactional(readOnly = true)
- boolean isResultatTestBioAccessibleByUser(ResultatTestBio resultatTestBio, Utilisateur utilisateur);
+ /**
+ * Détermine si un utilisateur peut accéder à un résultat de test biologique
+ * @param resultatTestBio Le résultat
+ * @param utilisateur L'utilisateur
+ * @return TRUE s'il a le droit
+ */
+ @Transactional(readOnly = true)
+ boolean isResultatTestBioAccessibleByUser(ResultatTestBio resultatTestBio, Utilisateur utilisateur);
- /**
- * Détermine si un résultat est unique par rapport à une une liste (si blanc : unicité sur repère, si témoin :
- * unicité sur repère + produit_témoin, si produit : unicité sur repère + produit)
- * @param resultatTestBio Le résultat de test bio
- * @param liste La liste des résultats
- * @return TRUE
- */
- @Transactional(readOnly = true)
- boolean isResultatTestBioUniqueInList(final ResultatTestBio resultatTestBio, final List<ResultatTestBio> liste);
+ /**
+ * Détermine si un résultat est unique par rapport à une une liste (si blanc : unicité sur repère, si témoin :
+ * unicité sur repère + produit_témoin, si produit : unicité sur repère + produit)
+ * @param resultatTestBio Le résultat de test bio
+ * @param liste La liste des résultats
+ * @return TRUE
+ */
+ @Transactional(readOnly = true)
+ boolean isResultatTestBioUniqueInList(final ResultatTestBio resultatTestBio, final List<ResultatTestBio> liste);
- /**
- * Créée une méthode pour un test biologique
- * @param methode La méthode
- * @throws DataConstraintException Si la méthode (nom) existe déjà
- */
- void createMethodeTestBio((a)Normalize(MethodeTestBioNormalizer.class) MethodeTestBio methode)
- throws DataConstraintException;
+ /**
+ * Créée une méthode pour un test biologique
+ * @param methode La méthode
+ * @throws DataConstraintException Si la méthode (nom) existe déjà
+ */
+ void createMethodeTestBio((a)Normalize(MethodeTestBioNormalizer.class) MethodeTestBio methode)
+ throws DataConstraintException;
- /**
- * Supprime une méthode pour un test biologique
- * @param methode La méthode
- * @throws DataConstraintException En cas de données liées
- */
- void deleteMethodeTestBio(MethodeTestBio methode) throws DataConstraintException;
+ /**
+ * Supprime une méthode pour un test biologique
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteMethodeTestBio(MethodeTestBio methode) throws DataConstraintException;
- /**
- * Liste les méthodes existantes pour un test biologique (triés par nom)
- * @return la liste des méthodes
- */
- @Transactional(readOnly = true)
- List<MethodeTestBio> listMethodesTestBio();
+ /**
+ * Liste les méthodes existantes pour un test biologique (triés par nom)
+ * @return la liste des méthodes
+ */
+ @Transactional(readOnly = true)
+ List<MethodeTestBio> listMethodesTestBio();
- /**
- * Liste les domaines existants pour les méthodes de test
- * @return Les cibles
- */
- @Transactional(readOnly = true)
- List<String> listDomainesMethodes();
+ /**
+ * Liste les domaines existants pour les méthodes de test
+ * @return Les cibles
+ */
+ @Transactional(readOnly = true)
+ List<String> listDomainesMethodes();
- /**
- * Liste les unités de résultat existants pour les méthodes de test
- * @return Les unités
- */
- @Transactional(readOnly = true)
- List<String> listUnitesResultatMethodes();
+ /**
+ * Liste les unités de résultat existants pour les méthodes de test
+ * @return Les unités
+ */
+ @Transactional(readOnly = true)
+ List<String> listUnitesResultatMethodes();
- /**
- * Charge une méthode pour un test biologique
- * @param idMethode ID de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodeTestBio loadMethodeTest(Integer idMethode) throws DataNotFoundException;
+ /**
+ * Charge une méthode pour un test biologique
+ * @param idMethode ID de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodeTestBio loadMethodeTest(Integer idMethode) throws DataNotFoundException;
- /**
- * Charge une méthode pour un test biologique
- * @param nom Nom de la méthode
- * @return La méthode correspondante
- * @throws DataNotFoundException Si non trouvée
- */
- MethodeTestBio loadMethodeTest((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charge une méthode pour un test biologique
+ * @param nom Nom de la méthode
+ * @return La méthode correspondante
+ * @throws DataNotFoundException Si non trouvée
+ */
+ MethodeTestBio loadMethodeTest((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Met à jour une méthode pour un test biologique
- * @param methode La méthode
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateMethodeTest((a)Normalize(MethodeTestBioNormalizer.class) MethodeTestBio methode)
- throws DataConstraintException;
+ /**
+ * Met à jour une méthode pour un test biologique
+ * @param methode La méthode
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateMethodeTest((a)Normalize(MethodeTestBioNormalizer.class) MethodeTestBio methode)
+ throws DataConstraintException;
- /**
- * Rafraichit une méthode de testBio (pour éviter des LazyLoadingException)
- * @param methode La méthode
- */
- void refreshMethodeTestBio(MethodeTestBio methode);
+ /**
+ * Rafraichit une méthode de testBio (pour éviter des LazyLoadingException)
+ * @param methode La méthode
+ */
+ void refreshMethodeTestBio(MethodeTestBio methode);
- /**
- * Créée une erreur pour un test biologique
- * @param erreurTest L'erreur
- * @throws DataConstraintException Si l'erreur (nom) existe déjà
- */
- void createErreurTest((a)Normalize(ErreurTestNormalizer.class) ErreurTestBio erreurTest)
- throws DataConstraintException;
+ /**
+ * Créée une erreur pour un test biologique
+ * @param erreurTest L'erreur
+ * @throws DataConstraintException Si l'erreur (nom) existe déjà
+ */
+ void createErreurTest((a)Normalize(ErreurTestNormalizer.class) ErreurTestBio erreurTest)
+ throws DataConstraintException;
- /**
- * Supprime une erreur pour un test biologique
- * @param erreurTest L'erreur
- * @throws DataConstraintException En cas de données liées
- */
- void deleteErreurTest(ErreurTestBio erreurTest) throws DataConstraintException;
+ /**
+ * Supprime une erreur pour un test biologique
+ * @param erreurTest L'erreur
+ * @throws DataConstraintException En cas de données liées
+ */
+ void deleteErreurTest(ErreurTestBio erreurTest) throws DataConstraintException;
- /**
- * Liste les erreurs existantes pour un test biologique
- * @return la liste des erreurs
- */
- List<ErreurTestBio> listErreursTestBio();
+ /**
+ * Liste les erreurs existantes pour un test biologique
+ * @return la liste des erreurs
+ */
+ List<ErreurTestBio> listErreursTestBio();
- /**
- * Charge une erreur pour un test biologique
- * @param idErreurTest ID de l'erreur
- * @return L'erreur
- * @throws DataNotFoundException Si non trouvée
- */
- ErreurTestBio loadErreurTestBio(Integer idErreurTest) throws DataNotFoundException;
+ /**
+ * Charge une erreur pour un test biologique
+ * @param idErreurTest ID de l'erreur
+ * @return L'erreur
+ * @throws DataNotFoundException Si non trouvée
+ */
+ ErreurTestBio loadErreurTestBio(Integer idErreurTest) throws DataNotFoundException;
- /**
- * Charge une erreur pour un test biologique
- * @param nom Nom de l'erreur
- * @return L'erreur
- * @throws DataNotFoundException Si non trouvée
- */
- ErreurTestBio loadErreurTestBio((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
+ /**
+ * Charge une erreur pour un test biologique
+ * @param nom Nom de l'erreur
+ * @return L'erreur
+ * @throws DataNotFoundException Si non trouvée
+ */
+ ErreurTestBio loadErreurTestBio((a)Normalize(UniqueFieldNormalizer.class) String nom) throws DataNotFoundException;
- /**
- * Met à jour une erreur pour un test biologique
- * @param erreurTest L'erreur
- * @throws DataConstraintException En cas de doublons (champs uniques)
- */
- void updateErreurTestBio((a)Normalize(ErreurTestNormalizer.class) ErreurTestBio erreurTest)
- throws DataConstraintException;
+ /**
+ * Met à jour une erreur pour un test biologique
+ * @param erreurTest L'erreur
+ * @throws DataConstraintException En cas de doublons (champs uniques)
+ */
+ void updateErreurTestBio((a)Normalize(ErreurTestNormalizer.class) ErreurTestBio erreurTest)
+ throws DataConstraintException;
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/CampagneServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/CampagneServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/CampagneServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,113 +52,113 @@
@Service
public final class CampagneServiceImpl implements CampagneService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Accès aux données */
- @Autowired
- private GenericDao dao;
+ /** Accès aux données */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public long countCampagnes() {
- return dao.count(Campagne.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countCampagnes() {
+ return dao.count(Campagne.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createCampagne(Campagne campagne) throws DataConstraintException {
- LOG.info("createCampagne " + campagne.getNom());
- dao.create(campagne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createCampagne(Campagne campagne) throws DataConstraintException {
+ LOG.info("createCampagne " + campagne.getNom());
+ dao.create(campagne);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteCampagne(Campagne campagne) throws DataConstraintException {
- AssertTools.assertNotNull(campagne);
- LOG.info("deleteCampagne " + campagne.getIdCampagne());
- try {
- dao.delete(campagne);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteCampagne(Campagne campagne) throws DataConstraintException {
+ AssertTools.assertNotNull(campagne);
+ LOG.info("deleteCampagne " + campagne.getIdCampagne());
+ try {
+ dao.delete(campagne);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listCampagneProgrammes() {
- return (List<String>) dao.list(CampagneDao.CRITERIA_DISTINCT_CAMPAGNE_PROGRAMMES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listCampagneProgrammes() {
+ return (List<String>) dao.list(CampagneDao.CRITERIA_DISTINCT_CAMPAGNE_PROGRAMMES);
+ }
- /** {@inheritDoc} */
- @Override
- public List<Campagne> listCampagnes(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- return dao.readList(Campagne.class, "nom");
- }
- SortedSet<Campagne> campagnes = listCampagnesForUser(utilisateur);
+ /** {@inheritDoc} */
+ @Override
+ public List<Campagne> listCampagnes(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ return dao.readList(Campagne.class, "nom");
+ }
+ SortedSet<Campagne> campagnes = listCampagnesForUser(utilisateur);
- return new ArrayList<Campagne>(campagnes);
- }
+ return new ArrayList<Campagne>(campagnes);
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Campagne> listCampagnesForUser(Utilisateur utilisateur) {
- // gestion des droits en plus pour les utilisateurs
- SortedSet<Campagne> campagnes = new TreeSet<Campagne>();
- campagnes.addAll(utilisateur.getCampagnesCreees());
- campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Campagne> listCampagnesForUser(Utilisateur utilisateur) {
+ // gestion des droits en plus pour les utilisateurs
+ SortedSet<Campagne> campagnes = new TreeSet<Campagne>();
+ campagnes.addAll(utilisateur.getCampagnesCreees());
+ campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
- // accès aux campagnes des lots pour lesquels l'utilisateur a les droits
- for (Lot lot : utilisateur.getLotsCrees()) {
- campagnes.add(lot.getCampagne());
- }
- for (Lot lot : utilisateur.getLotsDroits().keySet()) {
- campagnes.add(lot.getCampagne());
- }
- return campagnes;
- }
+ // accès aux campagnes des lots pour lesquels l'utilisateur a les droits
+ for (Lot lot : utilisateur.getLotsCrees()) {
+ campagnes.add(lot.getCampagne());
+ }
+ for (Lot lot : utilisateur.getLotsDroits().keySet()) {
+ campagnes.add(lot.getCampagne());
+ }
+ return campagnes;
+ }
- /** {@inheritDoc} */
- @Override
- public Campagne loadCampagne(Integer idCampagne) throws DataNotFoundException {
- AssertTools.assertNotNull(idCampagne);
- return dao.read(Campagne.class, idCampagne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Campagne loadCampagne(Integer idCampagne) throws DataNotFoundException {
+ AssertTools.assertNotNull(idCampagne);
+ return dao.read(Campagne.class, idCampagne);
+ }
- /** {@inheritDoc} */
- @Override
- public Campagne loadCampagne(String nom) throws DataNotFoundException {
- AssertTools.assertNotEmpty(nom);
- return dao.read(Campagne.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Campagne loadCampagne(String nom) throws DataNotFoundException {
+ AssertTools.assertNotEmpty(nom);
+ return dao.read(Campagne.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshCampagne(Campagne campagne) {
- AssertTools.assertNotNull(campagne);
- dao.refresh(campagne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshCampagne(Campagne campagne) {
+ AssertTools.assertNotNull(campagne);
+ dao.refresh(campagne);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateCampagne(Campagne campagne) throws DataConstraintException {
- LOG.info("updateCampagne " + campagne.getIdCampagne());
- try {
- dao.update(campagne);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateCampagne(Campagne campagne) throws DataConstraintException {
+ LOG.info("updateCampagne " + campagne.getIdCampagne());
+ try {
+ dao.update(campagne);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteCampagneEnabled(Campagne campagne, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == campagne.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteCampagneEnabled(Campagne campagne, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == campagne.getCreateur().getIdPersonne();
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/DocumentServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/DocumentServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/DocumentServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,60 +44,60 @@
@Service
public final class DocumentServiceImpl implements DocumentService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public List<TypeDocument> listTypeDocuments() {
- return dao.readList(TypeDocument.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<TypeDocument> listTypeDocuments() {
+ return dao.readList(TypeDocument.class, "nom");
+ }
- /** {@inheritDoc} */
- @Override
- public void createTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
- LOG.info("createTypeDocument: " + typeDocument.getNom());
- dao.create(typeDocument);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
+ LOG.info("createTypeDocument: " + typeDocument.getNom());
+ dao.create(typeDocument);
+ }
- /** {@inheritDoc} */
- @Override
- public TypeDocument loadTypeDocument(Integer idTypeDocument) throws DataNotFoundException {
- return dao.read(TypeDocument.class, idTypeDocument);
- }
+ /** {@inheritDoc} */
+ @Override
+ public TypeDocument loadTypeDocument(Integer idTypeDocument) throws DataNotFoundException {
+ return dao.read(TypeDocument.class, idTypeDocument);
+ }
- /** {@inheritDoc} */
- @Override
- public TypeDocument loadTypeDocument(String nom) throws DataNotFoundException {
- return dao.read(TypeDocument.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public TypeDocument loadTypeDocument(String nom) throws DataNotFoundException {
+ return dao.read(TypeDocument.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
- LOG.info("updateTypeDocument: " + typeDocument.getNom());
- try {
- dao.update(typeDocument);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
+ LOG.info("updateTypeDocument: " + typeDocument.getNom());
+ try {
+ dao.update(typeDocument);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
- AssertTools.assertNotNull(typeDocument);
- LOG.info("deleteTypeDocument: " + typeDocument.getNom());
- try {
- dao.delete(typeDocument);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteTypeDocument(TypeDocument typeDocument) throws DataConstraintException {
+ AssertTools.assertNotNull(typeDocument);
+ LOG.info("deleteTypeDocument: " + typeDocument.getNom());
+ try {
+ dao.delete(typeDocument);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ExtractionServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ExtractionServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ExtractionServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -56,212 +56,212 @@
@Service
public final class ExtractionServiceImpl implements ExtractionService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** Service : lots **/
- @Autowired
- private LotService lotService;
+ /** Service : lots **/
+ @Autowired
+ private LotService lotService;
- /** {@inheritDoc} */
- @Override
- public long countExtractions() {
- return dao.count(Extraction.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countExtractions() {
+ return dao.count(Extraction.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createExtraction(Extraction extraction) throws DataConstraintException {
- LOG.info("createExtraction: " + extraction.getRef());
- dao.create(extraction);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createExtraction(Extraction extraction) throws DataConstraintException {
+ LOG.info("createExtraction: " + extraction.getRef());
+ dao.create(extraction);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteExtraction(Extraction extraction) throws DataConstraintException {
- AssertTools.assertNotNull(extraction);
- LOG.info("deleteExtraction: " + extraction.getRef());
- try {
- dao.delete(extraction);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteExtraction(Extraction extraction) throws DataConstraintException {
+ AssertTools.assertNotNull(extraction);
+ LOG.info("deleteExtraction: " + extraction.getRef());
+ try {
+ dao.delete(extraction);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public List<Extraction> listExtractions(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- // si admin, on ajoute toutes les extractions de la base
+ /** {@inheritDoc} */
+ @Override
+ public List<Extraction> listExtractions(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ // si admin, on ajoute toutes les extractions de la base
- // SortedSet pour garder une liste "DISTINCT", sinon une ligne par extrait (OUTER JOIN avec Fetch=EAGER)
- SortedSet<Extraction> extractions = new TreeSet<Extraction>(dao.readList(Extraction.class));
- return new ArrayList<Extraction>(extractions);
- }
- // gestion des droits en plus pour les utilisateurs
- return new ArrayList<Extraction>(listExtractionsForUser(utilisateur));
- }
+ // SortedSet pour garder une liste "DISTINCT", sinon une ligne par extrait (OUTER JOIN avec Fetch=EAGER)
+ SortedSet<Extraction> extractions = new TreeSet<Extraction>(dao.readList(Extraction.class));
+ return new ArrayList<Extraction>(extractions);
+ }
+ // gestion des droits en plus pour les utilisateurs
+ return new ArrayList<Extraction>(listExtractionsForUser(utilisateur));
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Extraction> listExtractionsForUser(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- SortedSet<Extraction> extractions = new TreeSet<Extraction>();
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Extraction> listExtractionsForUser(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ SortedSet<Extraction> extractions = new TreeSet<Extraction>();
- extractions.addAll(utilisateur.getExtractionsCrees());
- SortedSet<Lot> lotsAllowed = lotService.listLotsForUser(utilisateur);
- for (Lot l : lotsAllowed) {
- extractions.addAll(l.getExtractions());
- }
- return extractions;
- }
+ extractions.addAll(utilisateur.getExtractionsCrees());
+ SortedSet<Lot> lotsAllowed = lotService.listLotsForUser(utilisateur);
+ for (Lot l : lotsAllowed) {
+ extractions.addAll(l.getExtractions());
+ }
+ return extractions;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isExtractionUnique(Extraction extraction) {
- AssertTools.assertNotNull(extraction);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isExtractionUnique(Extraction extraction) {
+ AssertTools.assertNotNull(extraction);
- // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
- if (!dao.exists(Extraction.class, "ref", extraction.getRef())) {
- return true;
- }
+ // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
+ if (!dao.exists(Extraction.class, "ref", extraction.getRef())) {
+ return true;
+ }
- Extraction extrWithSameVal;
- try {
- extrWithSameVal = dao.read(Extraction.class, "ref", extraction.getRef());
- dao.evict(extrWithSameVal);
- } catch (DataNotFoundException e) {
- return true; // never call, cover by dao.exists...
- }
- // in case of new record, id is null
- return extraction.getIdExtraction() != null
- && extraction.getIdExtraction().equals(extrWithSameVal.getIdExtraction());
- }
+ Extraction extrWithSameVal;
+ try {
+ extrWithSameVal = dao.read(Extraction.class, "ref", extraction.getRef());
+ dao.evict(extrWithSameVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, cover by dao.exists...
+ }
+ // in case of new record, id is null
+ return extraction.getIdExtraction() != null
+ && extraction.getIdExtraction().equals(extrWithSameVal.getIdExtraction());
+ }
- /** {@inheritDoc} */
- @Override
- public Extraction loadExtraction(Integer idExtraction) throws DataNotFoundException {
- LOG.debug("read Extraction");
- return dao.read(Extraction.class, idExtraction);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Extraction loadExtraction(Integer idExtraction) throws DataNotFoundException {
+ LOG.debug("read Extraction");
+ return dao.read(Extraction.class, idExtraction);
+ }
- /** {@inheritDoc} */
- @Override
- public Extraction loadExtraction(String ref) throws DataNotFoundException {
- return dao.read(Extraction.class, "ref", ref);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Extraction loadExtraction(String ref) throws DataNotFoundException {
+ return dao.read(Extraction.class, "ref", ref);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateExtraction(Extraction extraction) throws DataConstraintException {
- LOG.info("updateExtraction: " + extraction.getRef());
- try {
- dao.update(extraction);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateExtraction(Extraction extraction) throws DataConstraintException {
+ LOG.info("updateExtraction: " + extraction.getRef());
+ try {
+ dao.update(extraction);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteExtractionEnabled(Extraction extraction, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == extraction.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteExtractionEnabled(Extraction extraction, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == extraction.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public void createMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
- LOG.info("createMethodeExtraction: " + methode.getNom());
- dao.create(methode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
+ LOG.info("createMethodeExtraction: " + methode.getNom());
+ dao.create(methode);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
- AssertTools.assertNotNull(methode);
- LOG.info("deleteMethodeExtraction: " + methode.getNom());
- try {
- dao.delete(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
+ AssertTools.assertNotNull(methode);
+ LOG.info("deleteMethodeExtraction: " + methode.getNom());
+ try {
+ dao.delete(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public List<MethodeExtraction> listMethodesExtraction() {
- return dao.readList(MethodeExtraction.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<MethodeExtraction> listMethodesExtraction() {
+ return dao.readList(MethodeExtraction.class, "nom");
+ }
- /** {@inheritDoc} */
- @Override
- public MethodeExtraction loadMethodeExtraction(Integer idMethode) throws DataNotFoundException {
- return dao.read(MethodeExtraction.class, idMethode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodeExtraction loadMethodeExtraction(Integer idMethode) throws DataNotFoundException {
+ return dao.read(MethodeExtraction.class, idMethode);
+ }
- /** {@inheritDoc} */
- @Override
- public MethodeExtraction loadMethodeExtraction(String nom) throws DataNotFoundException {
- return dao.read(MethodeExtraction.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodeExtraction loadMethodeExtraction(String nom) throws DataNotFoundException {
+ return dao.read(MethodeExtraction.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
- LOG.info("updateMethodeExtraction: " + methode.getNom());
- try {
- dao.update(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateMethodeExtraction(MethodeExtraction methode) throws DataConstraintException {
+ LOG.info("updateMethodeExtraction: " + methode.getNom());
+ try {
+ dao.update(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshMethodeExtraction(MethodeExtraction methode) {
- AssertTools.assertNotNull(methode);
- dao.refresh(methode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshMethodeExtraction(MethodeExtraction methode) {
+ AssertTools.assertNotNull(methode);
+ dao.refresh(methode);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isTypeExtraitReferenced(TypeExtrait typeExtrait) {
- AssertTools.assertNotNull(typeExtrait);
- AssertTools.assertNotNull(typeExtrait.getIdTypeExtrait());
- return dao.count(ExtractionDao.getCriteriaCountExtraitOfTypeExtrait(typeExtrait.getIdTypeExtrait())) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isTypeExtraitReferenced(TypeExtrait typeExtrait) {
+ AssertTools.assertNotNull(typeExtrait);
+ AssertTools.assertNotNull(typeExtrait.getIdTypeExtrait());
+ return dao.count(ExtractionDao.getCriteriaCountExtraitOfTypeExtrait(typeExtrait.getIdTypeExtrait())) > 0;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isExtraitUnique(Extrait extrait) {
- AssertTools.assertNotNull(extrait);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isExtraitUnique(Extrait extrait) {
+ AssertTools.assertNotNull(extrait);
- // unique if it doesn't exist different value or if it exists with the same id (so same row in the db)
- if (!dao.exists(Extrait.class, "ref", extrait.getRef())) {
- return true;
- }
- Extrait extrWithSameVal;
- try {
- extrWithSameVal = dao.read(Extrait.class, "ref", extrait.getRef());
- dao.evict(extrWithSameVal);
- } catch (DataNotFoundException e) {
- return true; // never call, covers by dao.exists...
- }
- // in case of new record, id is null
- return extrait.getId() != null && extrait.getId().equals(extrWithSameVal.getId());
- }
+ // unique if it doesn't exist different value or if it exists with the same id (so same row in the db)
+ if (!dao.exists(Extrait.class, "ref", extrait.getRef())) {
+ return true;
+ }
+ Extrait extrWithSameVal;
+ try {
+ extrWithSameVal = dao.read(Extrait.class, "ref", extrait.getRef());
+ dao.evict(extrWithSameVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, covers by dao.exists...
+ }
+ // in case of new record, id is null
+ return extrait.getId() != null && extrait.getId().equals(extrWithSameVal.getId());
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/LotServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/LotServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/LotServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,169 +52,169 @@
@Service
public final class LotServiceImpl implements LotService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public long countLots() {
- return dao.count(Lot.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countLots() {
+ return dao.count(Lot.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createLot(Lot lot) throws DataConstraintException {
- LOG.info("createLot " + lot.getRef());
- dao.create(lot);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createLot(Lot lot) throws DataConstraintException {
+ LOG.info("createLot " + lot.getRef());
+ dao.create(lot);
+ }
- /** {@inheritDoc} */
- @Override
- public void createPartie(Partie partie) throws DataConstraintException {
- LOG.info("createPartie: " + partie.getNom());
- dao.create(partie);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createPartie(Partie partie) throws DataConstraintException {
+ LOG.info("createPartie: " + partie.getNom());
+ dao.create(partie);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteLot(Lot lot) throws DataConstraintException {
- AssertTools.assertNotNull(lot);
- LOG.info("deleteLot " + lot.getRef());
- try {
- dao.delete(lot);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteLot(Lot lot) throws DataConstraintException {
+ AssertTools.assertNotNull(lot);
+ LOG.info("deleteLot " + lot.getRef());
+ try {
+ dao.delete(lot);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public void deletePartie(Partie partie) throws DataConstraintException {
- AssertTools.assertNotNull(partie);
- LOG.info("deletePartie: " + partie.getNom());
- try {
- dao.delete(partie);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deletePartie(Partie partie) throws DataConstraintException {
+ AssertTools.assertNotNull(partie);
+ LOG.info("deletePartie: " + partie.getNom());
+ try {
+ dao.delete(partie);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public List<Lot> listLots(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- return dao.readList(Lot.class, "ref");
- }
- // gestion des droits en plus pour les utilisateurs
- return new ArrayList<Lot>(listLotsForUser(utilisateur));
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<Lot> listLots(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ return dao.readList(Lot.class, "ref");
+ }
+ // gestion des droits en plus pour les utilisateurs
+ return new ArrayList<Lot>(listLotsForUser(utilisateur));
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Lot> listLotsForUser(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- SortedSet<Lot> lots = new TreeSet<Lot>();
- for (Campagne c : utilisateur.getCampagnesCreees()) {
- lots.addAll(c.getLots());
- }
- for (Campagne c : utilisateur.getCampagnesDroits().keySet()) {
- lots.addAll(c.getLots());
- }
- lots.addAll(utilisateur.getLotsCrees());
- lots.addAll(utilisateur.getLotsDroits().keySet());
- return lots;
- }
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Lot> listLotsForUser(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ SortedSet<Lot> lots = new TreeSet<Lot>();
+ for (Campagne c : utilisateur.getCampagnesCreees()) {
+ lots.addAll(c.getLots());
+ }
+ for (Campagne c : utilisateur.getCampagnesDroits().keySet()) {
+ lots.addAll(c.getLots());
+ }
+ lots.addAll(utilisateur.getLotsCrees());
+ lots.addAll(utilisateur.getLotsDroits().keySet());
+ return lots;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteLotEnabled(Lot lot, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == lot.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteLotEnabled(Lot lot, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == lot.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isLotAccessibleByUser(Lot lot, Utilisateur utilisateur) {
- // si administrateur ou créateur, accès ok
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR || utilisateur.equals(lot.getCreateur())) {
- return true;
- }
- // accessible si l'utilisateur
- if (utilisateur.getCampagnesCreees().contains(lot.getCampagne())) {
- return true;
- }
- // accessible si l'utilisateur a le droit à la campagne
- if (utilisateur.getCampagnesDroits().containsKey(lot.getCampagne())) {
- return true;
- }
- // accessible si l'utilisateur a le droit au lot
- if (utilisateur.getLotsDroits().containsKey(lot)) {
- return true;
- }
- // pas d'accès sinon
- return false;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isLotAccessibleByUser(Lot lot, Utilisateur utilisateur) {
+ // si administrateur ou créateur, accès ok
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR || utilisateur.equals(lot.getCreateur())) {
+ return true;
+ }
+ // accessible si l'utilisateur
+ if (utilisateur.getCampagnesCreees().contains(lot.getCampagne())) {
+ return true;
+ }
+ // accessible si l'utilisateur a le droit à la campagne
+ if (utilisateur.getCampagnesDroits().containsKey(lot.getCampagne())) {
+ return true;
+ }
+ // accessible si l'utilisateur a le droit au lot
+ if (utilisateur.getLotsDroits().containsKey(lot)) {
+ return true;
+ }
+ // pas d'accès sinon
+ return false;
+ }
- /** {@inheritDoc} */
- @Override
- public List<Partie> listParties() {
- return dao.readList(Partie.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<Partie> listParties() {
+ return dao.readList(Partie.class, "nom");
+ }
- /** {@inheritDoc} */
- @Override
- public Lot loadLot(Integer idLot) throws DataNotFoundException {
- return dao.read(Lot.class, idLot);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Lot loadLot(Integer idLot) throws DataNotFoundException {
+ return dao.read(Lot.class, idLot);
+ }
- /** {@inheritDoc} */
- @Override
- public Lot loadLot(String ref) throws DataNotFoundException {
- AssertTools.assertNotEmpty(ref);
- return dao.read(Lot.class, "ref", ref);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Lot loadLot(String ref) throws DataNotFoundException {
+ AssertTools.assertNotEmpty(ref);
+ return dao.read(Lot.class, "ref", ref);
+ }
- /** {@inheritDoc} */
- @Override
- public Partie loadPartie(Integer idPartie) throws DataNotFoundException {
- return dao.read(Partie.class, idPartie);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Partie loadPartie(Integer idPartie) throws DataNotFoundException {
+ return dao.read(Partie.class, idPartie);
+ }
- /** {@inheritDoc} */
- @Override
- public Partie loadPartie(String nom) throws DataNotFoundException {
- return dao.read(Partie.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Partie loadPartie(String nom) throws DataNotFoundException {
+ return dao.read(Partie.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateLot(Lot lot) throws DataConstraintException {
- LOG.info("updateLot " + lot.getRef());
- try {
- dao.update(lot);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateLot(Lot lot) throws DataConstraintException {
+ LOG.info("updateLot " + lot.getRef());
+ try {
+ dao.update(lot);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void updatePartie(Partie partie) throws DataConstraintException {
- LOG.info("updatePartie: " + partie.getNom());
- try {
- dao.update(partie);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updatePartie(Partie partie) throws DataConstraintException {
+ LOG.info("updatePartie: " + partie.getNom());
+ try {
+ dao.update(partie);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MailServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MailServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MailServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,90 +48,90 @@
@Service
public final class MailServiceImpl implements MailService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** E-mail message template */
- @Autowired
- private SimpleMailMessage mailMessage;
+ /** E-mail message template */
+ @Autowired
+ private SimpleMailMessage mailMessage;
- /** E-mail sender */
- @Autowired
- private MailSender mailSender;
+ /** E-mail sender */
+ @Autowired
+ private MailSender mailSender;
- /** {@inheritDoc} */
- @Override
- public void sendMail(Collection<Utilisateur> recipients, String subject, String text) throws EmailException {
- sendMail(recipients, subject, text, null);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMail(Collection<Utilisateur> recipients, String subject, String text) throws EmailException {
+ sendMail(recipients, subject, text, null);
+ }
- /** {@inheritDoc} */
- @Override
- public void sendMail(Collection<Utilisateur> recipients, String subject, String text, String replyTo)
- throws EmailException {
- AssertTools.assertCollectionNotNull(recipients);
- String[] courriels = new String[recipients.size()];
- int i = 0;
- for (Utilisateur recipient : recipients) {
- courriels[i++] = recipient.getCourriel();
- }
- sendMail(subject, text, replyTo, courriels);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMail(Collection<Utilisateur> recipients, String subject, String text, String replyTo)
+ throws EmailException {
+ AssertTools.assertCollectionNotNull(recipients);
+ String[] courriels = new String[recipients.size()];
+ int i = 0;
+ for (Utilisateur recipient : recipients) {
+ courriels[i++] = recipient.getCourriel();
+ }
+ sendMail(subject, text, replyTo, courriels);
+ }
- /** {@inheritDoc} */
- @Override
- public void sendMail(Personne recipient, String subject, String text) throws EmailException {
- AssertTools.assertNotNull(recipient);
- sendMail(subject, text, null, recipient.getCourriel());
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMail(Personne recipient, String subject, String text) throws EmailException {
+ AssertTools.assertNotNull(recipient);
+ sendMail(subject, text, null, recipient.getCourriel());
+ }
- /**
- * Send an e-mail
- * @param subject Subject
- * @param text Text
- * @param replyTo Reply to
- * @param recipients Recipients
- * @throws EmailException In case of error while sending an e-mail
- */
- private void sendMail(String subject, String text, String replyTo, String... recipients) throws EmailException {
- LOG.info("sendMail " + subject + " [to] " + Arrays.toString(recipients));
- if (ServiceContext.isMailActivated()) {
- AssertTools.assertNotEmpty(subject);
- AssertTools.assertNotEmpty(text);
- AssertTools.assertNotEmpty(recipients);
- AssertTools.assertArrayNotEmpty(recipients);
- // Validate e-mail
- mailMessage.setTo(recipients);
- mailMessage.setSubject(subject);
- mailMessage.setText(text);
- if (!StringUtils.isEmpty(replyTo)) {
- mailMessage.setReplyTo(replyTo);
- }
- try {
- mailSender.send(mailMessage);
- } catch (Exception e) {
- throw new EmailException(e);
- }
- }
- }
+ /**
+ * Send an e-mail
+ * @param subject Subject
+ * @param text Text
+ * @param replyTo Reply to
+ * @param recipients Recipients
+ * @throws EmailException In case of error while sending an e-mail
+ */
+ private void sendMail(String subject, String text, String replyTo, String... recipients) throws EmailException {
+ LOG.info("sendMail " + subject + " [to] " + Arrays.toString(recipients));
+ if (ServiceContext.isMailActivated()) {
+ AssertTools.assertNotEmpty(subject);
+ AssertTools.assertNotEmpty(text);
+ AssertTools.assertNotEmpty(recipients);
+ AssertTools.assertArrayNotEmpty(recipients);
+ // Validate e-mail
+ mailMessage.setTo(recipients);
+ mailMessage.setSubject(subject);
+ mailMessage.setText(text);
+ if (!StringUtils.isEmpty(replyTo)) {
+ mailMessage.setReplyTo(replyTo);
+ }
+ try {
+ mailSender.send(mailMessage);
+ } catch (Exception e) {
+ throw new EmailException(e);
+ }
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void sendMailQuietly(Collection<Utilisateur> recipients, String subject, String text) {
- try {
- sendMail(recipients, subject, text);
- } catch (EmailException e) {
- LOG.warn(e.toString());
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMailQuietly(Collection<Utilisateur> recipients, String subject, String text) {
+ try {
+ sendMail(recipients, subject, text);
+ } catch (EmailException e) {
+ LOG.warn(e.toString());
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void sendMailQuietly(Personne recipient, String subject, String text) {
- try {
- sendMail(recipient, subject, text);
- } catch (EmailException e) {
- LOG.warn(e.toString());
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMailQuietly(Personne recipient, String subject, String text) {
+ try {
+ sendMail(recipient, subject, text);
+ } catch (EmailException e) {
+ LOG.warn(e.toString());
+ }
+ }
}
\ No newline at end of file
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,12 +49,12 @@
@Service
public final class MoleculeServiceImpl implements MoleculeService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
@Override
public long countMolecules() {
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PersonneServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PersonneServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PersonneServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -62,378 +62,378 @@
@Service
public final class PersonneServiceImpl implements PersonneService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Accès aux données */
- @Autowired
- private GenericDao dao;
+ /** Accès aux données */
+ @Autowired
+ private GenericDao dao;
- /** Administrateur par défaut */
- @Autowired
- private Utilisateur defaultAdmin;
+ /** Administrateur par défaut */
+ @Autowired
+ private Utilisateur defaultAdmin;
- /** Mail service */
- @Autowired
- private MailService mailService;
+ /** Mail service */
+ @Autowired
+ private MailService mailService;
- /** Messages d'internationalisation */
- @Resource(name = "serviceMessageSource")
- private MessageSourceAccessor messages;
+ /** Messages d'internationalisation */
+ @Resource(name = "serviceMessageSource")
+ private MessageSourceAccessor messages;
- /** {@inheritDoc} */
- @Override
- public void checkOrCreateAdmin() throws DataConstraintException {
- if (countAdmins() == 0L) {
- defaultAdmin.setTypeDroit(TypeDroit.ADMINISTRATEUR);
- defaultAdmin.setValide(Boolean.TRUE);
- plainCreateUtilisateur(defaultAdmin);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void checkOrCreateAdmin() throws DataConstraintException {
+ if (countAdmins() == 0L) {
+ defaultAdmin.setTypeDroit(TypeDroit.ADMINISTRATEUR);
+ defaultAdmin.setValide(Boolean.TRUE);
+ plainCreateUtilisateur(defaultAdmin);
+ }
+ }
- /**
- * Compte le nombre d'administrateurs
- * @return Nombre d'administrateurs
- */
- private Long countAdmins() {
- return dao.count(PersonneDao.CRITERIA_COUNT_ADMINS);
- }
+ /**
+ * Compte le nombre d'administrateurs
+ * @return Nombre d'administrateurs
+ */
+ private Long countAdmins() {
+ return dao.count(PersonneDao.CRITERIA_COUNT_ADMINS);
+ }
- /** {@inheritDoc} */
- @Override
- public long countPersonnes() {
- return dao.count(Personne.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countPersonnes() {
+ return dao.count(Personne.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createPersonne(Personne personne) throws DataConstraintException {
- LOG.info("createPersonne " + personne.getCourriel());
- try {
- dao.create(personne);
- } catch (DataIntegrityViolationException e) {
- throw new DataConstraintException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createPersonne(Personne personne) throws DataConstraintException {
+ LOG.info("createPersonne " + personne.getCourriel());
+ try {
+ dao.create(personne);
+ } catch (DataIntegrityViolationException e) {
+ throw new DataConstraintException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void createUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
- try {
- plainCreateUtilisateur(utilisateur);
- } catch (DataIntegrityViolationException e) {
- throw new DataConstraintException(e);
- }
- mailService.sendMailQuietly(utilisateur, messages.getMessage("register.subject"),
- messages.getMessage("register.text"));
- mailService.sendMailQuietly(
- listAdmins(),
- messages.getMessage("register.subject.admin"),
- messages.getMessage("register.text.admin", new Object[] { utilisateur.getPrenom(),
- utilisateur.getNom(), utilisateur.getCourriel() }));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
+ try {
+ plainCreateUtilisateur(utilisateur);
+ } catch (DataIntegrityViolationException e) {
+ throw new DataConstraintException(e);
+ }
+ mailService.sendMailQuietly(utilisateur, messages.getMessage("register.subject"),
+ messages.getMessage("register.text"));
+ mailService.sendMailQuietly(
+ listAdmins(),
+ messages.getMessage("register.subject.admin"),
+ messages.getMessage("register.text.admin", new Object[] { utilisateur.getPrenom(),
+ utilisateur.getNom(), utilisateur.getCourriel() }));
+ }
- /** {@inheritDoc} */
- @Override
- public void deletePersonne(Personne personne) throws DataConstraintException {
- AssertTools.assertNotNull(personne);
- LOG.info("deletePersonne " + personne.getIdPersonne());
- AssertTools.assertNotNull(personne.getIdPersonne());
- try {
- dao.delete(personne);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deletePersonne(Personne personne) throws DataConstraintException {
+ AssertTools.assertNotNull(personne);
+ LOG.info("deletePersonne " + personne.getIdPersonne());
+ AssertTools.assertNotNull(personne.getIdPersonne());
+ try {
+ dao.delete(personne);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteUtilisateur(Utilisateur utilisateur) throws DataConstraintException, EmailException {
- deleteUtilisateur(utilisateur, messages.getMessage("delete.subject"), messages.getMessage("delete.text"));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteUtilisateur(Utilisateur utilisateur) throws DataConstraintException, EmailException {
+ deleteUtilisateur(utilisateur, messages.getMessage("delete.subject"), messages.getMessage("delete.text"));
+ }
- /**
- * @param utilisateur
- * @param mailSubject
- * @param mailText
- * @throws EmailException
- * @throws DataConstraintException
- */
- /**
- * Supprime un utilisateur, ou le transforme en personne s'il a des données liées, et lui envoie un e-mail
- * @param utilisateur Utilisateur
- * @param mailSubject E-mail subject
- * @param mailText E-mail text
- * @throws EmailException En cas d'erreur lors de l'envoi de mail
- * @throws DataConstraintException Si l'utilisateur est encore référencé (créateur d'entités)
- */
- @Transactional(rollbackFor = EmailException.class)
- public void deleteUtilisateur(Utilisateur utilisateur, String mailSubject, String mailText) throws EmailException,
- DataConstraintException {
- AssertTools.assertNotNull(utilisateur);
- LOG.info("deleteUtilisateur " + utilisateur.getIdPersonne());
- AssertTools.assertNotNull(utilisateur.getIdPersonne());
- try {
- dao.delete(utilisateur);
- } catch (DataConstraintException e) {
- dao.execute(PersonneDao.SQL_DELETE_UTILISATEUR, utilisateur.getIdPersonne());
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- mailService.sendMail(utilisateur, mailSubject, mailText);
- }
+ /**
+ * @param utilisateur
+ * @param mailSubject
+ * @param mailText
+ * @throws EmailException
+ * @throws DataConstraintException
+ */
+ /**
+ * Supprime un utilisateur, ou le transforme en personne s'il a des données liées, et lui envoie un e-mail
+ * @param utilisateur Utilisateur
+ * @param mailSubject E-mail subject
+ * @param mailText E-mail text
+ * @throws EmailException En cas d'erreur lors de l'envoi de mail
+ * @throws DataConstraintException Si l'utilisateur est encore référencé (créateur d'entités)
+ */
+ @Transactional(rollbackFor = EmailException.class)
+ public void deleteUtilisateur(Utilisateur utilisateur, String mailSubject, String mailText) throws EmailException,
+ DataConstraintException {
+ AssertTools.assertNotNull(utilisateur);
+ LOG.info("deleteUtilisateur " + utilisateur.getIdPersonne());
+ AssertTools.assertNotNull(utilisateur.getIdPersonne());
+ try {
+ dao.delete(utilisateur);
+ } catch (DataConstraintException e) {
+ dao.execute(PersonneDao.SQL_DELETE_UTILISATEUR, utilisateur.getIdPersonne());
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ mailService.sendMail(utilisateur, mailSubject, mailText);
+ }
- /** {@inheritDoc} */
- @Override
- public String hashPassword(String password) {
- AssertTools.assertNotEmpty(password);
- return PasswordTools.sha1(password);
- }
+ /** {@inheritDoc} */
+ @Override
+ public String hashPassword(String password) {
+ AssertTools.assertNotEmpty(password);
+ return PasswordTools.sha1(password);
+ }
- /**
- * Liste les administrateurs
- * @return Administrateurs
- */
- @SuppressWarnings("unchecked")
- private List<Utilisateur> listAdmins() {
- return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_ADMINS);
- }
+ /**
+ * Liste les administrateurs
+ * @return Administrateurs
+ */
+ @SuppressWarnings("unchecked")
+ private List<Utilisateur> listAdmins() {
+ return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_ADMINS);
+ }
- /** {@inheritDoc} */
- @Override
- public List<Personne> listPersonnes() {
- List<Personne> allPersonnes = dao.readList(Personne.class, "nom", "prenom");
- allPersonnes.removeAll(listUtilisateursInvalid());
- return allPersonnes;
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<Personne> listPersonnes() {
+ List<Personne> allPersonnes = dao.readList(Personne.class, "nom", "prenom");
+ allPersonnes.removeAll(listUtilisateursInvalid());
+ return allPersonnes;
+ }
- /** {@inheritDoc} */
- @Override
- public List<Personne> listPersonnesWithInvalidUsers() {
- return dao.readList(Personne.class, new String[] { "nom", "prenom" });
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<Personne> listPersonnesWithInvalidUsers() {
+ return dao.readList(Personne.class, new String[] { "nom", "prenom" });
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listPersonneOrganismes() {
- return (List<String>) dao.list(PersonneDao.CRITERIA_DISTINCT_PERSONNE_ORGANISMES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listPersonneOrganismes() {
+ return (List<String>) dao.list(PersonneDao.CRITERIA_DISTINCT_PERSONNE_ORGANISMES);
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<Utilisateur> listUtilisateursInvalid() {
- return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_UTILISATEURS_INVALID);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<Utilisateur> listUtilisateursInvalid() {
+ return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_UTILISATEURS_INVALID);
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<Utilisateur> listUtilisateursValid() {
- return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_UTILISATEURS_VALID);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<Utilisateur> listUtilisateursValid() {
+ return (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_UTILISATEURS_VALID);
+ }
- /** {@inheritDoc} */
- @Override
- public Personne loadPersonne(Integer idPersonne) throws DataNotFoundException {
- AssertTools.assertNotNull(idPersonne);
- try {
- return dao.read(Personne.class, idPersonne);
- } catch (DataRetrievalFailureException e) {
- throw new DataNotFoundException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public Personne loadPersonne(Integer idPersonne) throws DataNotFoundException {
+ AssertTools.assertNotNull(idPersonne);
+ try {
+ return dao.read(Personne.class, idPersonne);
+ } catch (DataRetrievalFailureException e) {
+ throw new DataNotFoundException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public Personne loadPersonne(String courriel) throws DataNotFoundException {
- AssertTools.assertNotNull(courriel);
- return dao.read(Personne.class, "courriel", courriel);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Personne loadPersonne(String courriel) throws DataNotFoundException {
+ AssertTools.assertNotNull(courriel);
+ return dao.read(Personne.class, "courriel", courriel);
+ }
- /** {@inheritDoc} */
- @Override
- public Utilisateur loadUtilisateur(Integer idPersonne) throws DataNotFoundException {
- AssertTools.assertNotNull(idPersonne);
- try {
- return dao.read(Utilisateur.class, idPersonne);
- } catch (DataRetrievalFailureException e) {
- throw new DataNotFoundException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public Utilisateur loadUtilisateur(Integer idPersonne) throws DataNotFoundException {
+ AssertTools.assertNotNull(idPersonne);
+ try {
+ return dao.read(Utilisateur.class, idPersonne);
+ } catch (DataRetrievalFailureException e) {
+ throw new DataNotFoundException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public Utilisateur loadUtilisateur(String courriel) throws DataNotFoundException {
- AssertTools.assertNotEmpty(courriel);
- Personne personne = loadPersonne(courriel);
- if (!(personne instanceof Utilisateur)) {
- throw new DataNotFoundException(new ObjectRetrievalFailureException(Utilisateur.class, courriel));
- }
- return (Utilisateur) personne;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Utilisateur loadUtilisateur(String courriel) throws DataNotFoundException {
+ AssertTools.assertNotEmpty(courriel);
+ Personne personne = loadPersonne(courriel);
+ if (!(personne instanceof Utilisateur)) {
+ throw new DataNotFoundException(new ObjectRetrievalFailureException(Utilisateur.class, courriel));
+ }
+ return (Utilisateur) personne;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean authenticateUtilisateur((a)Normalize(EmailNormalizer.class) String courriel, String passwordHash) {
- AssertTools.assertNotEmpty(courriel);
- AssertTools.assertNotEmpty(passwordHash);
- return dao.exists(PersonneDao.getCriteriaAuthenticateUser(courriel, passwordHash));
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean authenticateUtilisateur((a)Normalize(EmailNormalizer.class) String courriel, String passwordHash) {
+ AssertTools.assertNotEmpty(courriel);
+ AssertTools.assertNotEmpty(passwordHash);
+ return dao.exists(PersonneDao.getCriteriaAuthenticateUser(courriel, passwordHash));
+ }
- /**
- * Enregistre un utilisateur de façon brute (pas de conversion d'exceptions, ni d'envoi d'e-mail)
- * @param utilisateur Utilisateur
- * @throws DataConstraintException Si l'utilisateur existe déjà
- */
- private void plainCreateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
- AssertTools.assertNotNull(utilisateur);
- LOG.info("createUtilisateur " + utilisateur.getCourriel());
- if (utilisateur.getTypeDroit() == null) {
- utilisateur.setTypeDroit(TypeDroit.UTILISATEUR);
- }
- if (utilisateur.isValide() == null) {
- utilisateur.setValide(Boolean.FALSE);
- }
- dao.create(utilisateur);
- }
+ /**
+ * Enregistre un utilisateur de façon brute (pas de conversion d'exceptions, ni d'envoi d'e-mail)
+ * @param utilisateur Utilisateur
+ * @throws DataConstraintException Si l'utilisateur existe déjà
+ */
+ private void plainCreateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
+ AssertTools.assertNotNull(utilisateur);
+ LOG.info("createUtilisateur " + utilisateur.getCourriel());
+ if (utilisateur.getTypeDroit() == null) {
+ utilisateur.setTypeDroit(TypeDroit.UTILISATEUR);
+ }
+ if (utilisateur.isValide() == null) {
+ utilisateur.setValide(Boolean.FALSE);
+ }
+ dao.create(utilisateur);
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshPersonne(Personne personne) {
- AssertTools.assertNotNull(personne);
- dao.refresh(personne);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshPersonne(Personne personne) {
+ AssertTools.assertNotNull(personne);
+ dao.refresh(personne);
+ }
- /**
- * {@inheritDoc}
- */
- @Override
- public void rejectUtilisateur(Utilisateur utilisateur) throws NoSuchMessageException {
- try {
- deleteUtilisateur(utilisateur, messages.getMessage("reject.subject"), messages.getMessage("reject.text"));
- } catch (EmailException e) {
- // Quiet
- } catch (DataConstraintException e) {
- LOG.error(e.getMessage());
- // cas impossible normalement car un utilisateur non validé ne peut avoir créé des entités
- }
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void rejectUtilisateur(Utilisateur utilisateur) throws NoSuchMessageException {
+ try {
+ deleteUtilisateur(utilisateur, messages.getMessage("reject.subject"), messages.getMessage("reject.text"));
+ } catch (EmailException e) {
+ // Quiet
+ } catch (DataConstraintException e) {
+ LOG.error(e.getMessage());
+ // cas impossible normalement car un utilisateur non validé ne peut avoir créé des entités
+ }
+ }
- /** {@inheritDoc} */
- @Override
- @Transactional(rollbackFor = { DataNotFoundException.class, EmailException.class })
- public void resetPasswordUtilisateur(String courriel) throws DataNotFoundException, EmailException {
- LOG.info("reListPasswordUtilisateur " + courriel);
- Utilisateur utilisateur;
- try {
- utilisateur = loadUtilisateur(courriel);
- } catch (DataNotFoundException e) {
- LOG.warn("Unknown e-mail: " + courriel);
- throw e;
- }
+ /** {@inheritDoc} */
+ @Override
+ @Transactional(rollbackFor = { DataNotFoundException.class, EmailException.class })
+ public void resetPasswordUtilisateur(String courriel) throws DataNotFoundException, EmailException {
+ LOG.info("reListPasswordUtilisateur " + courriel);
+ Utilisateur utilisateur;
+ try {
+ utilisateur = loadUtilisateur(courriel);
+ } catch (DataNotFoundException e) {
+ LOG.warn("Unknown e-mail: " + courriel);
+ throw e;
+ }
- String newPassword = PasswordTools.random();
- utilisateur.setPasswordHash(hashPassword(newPassword));
- try {
- dao.update(utilisateur);
- } catch (DataConstraintException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- mailService.sendMail(utilisateur, messages.getMessage("updatePassword.subject"),
- messages.getMessage("updatePassword.text", new Object[] { newPassword }));
- }
+ String newPassword = PasswordTools.random();
+ utilisateur.setPasswordHash(hashPassword(newPassword));
+ try {
+ dao.update(utilisateur);
+ } catch (DataConstraintException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ mailService.sendMail(utilisateur, messages.getMessage("updatePassword.subject"),
+ messages.getMessage("updatePassword.text", new Object[] { newPassword }));
+ }
- /** {@inheritDoc} */
- @Override
- public void sendMailAdmins(String subject, String message, String replyTo) throws EmailException {
- LOG.info("sendMailAdmins " + subject + " [reply to] " + replyTo);
- mailService.sendMail(listAdmins(), messages.getMessage("contact.subject", new String[] { subject }),
- messages.getMessage("contact.body", new String[] { replyTo, message }), replyTo);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void sendMailAdmins(String subject, String message, String replyTo) throws EmailException {
+ LOG.info("sendMailAdmins " + subject + " [reply to] " + replyTo);
+ mailService.sendMail(listAdmins(), messages.getMessage("contact.subject", new String[] { subject }),
+ messages.getMessage("contact.body", new String[] { replyTo, message }), replyTo);
+ }
- /** {@inheritDoc} */
- @Override
- @Transactional(rollbackFor = { EmailException.class, DataAccessException.class, UnexpectedException.class })
- public Utilisateur updateAndCreateUtilisateur(Personne personne) throws EmailException, DataConstraintException {
- LOG.info("updateAndCreateUtilisateur " + personne.getIdPersonne());
- String password = PasswordTools.random();
- try {
- dao.update(personne);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- dao.execute(PersonneDao.SQL_CREATE_UTILISATEUR_FROM_PERSONNE, Boolean.TRUE, hashPassword(password),
- TypeDroit.UTILISATEUR.ordinal(), personne.getIdPersonne());
- Utilisateur utilisateur;
- try {
- utilisateur = dao.read(Utilisateur.class, personne.getIdPersonne());
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- mailService.sendMail(utilisateur, messages.getMessage("create.subject"),
- messages.getMessage("create.text", new Object[] { password }));
- return utilisateur;
- }
+ /** {@inheritDoc} */
+ @Override
+ @Transactional(rollbackFor = { EmailException.class, DataAccessException.class, UnexpectedException.class })
+ public Utilisateur updateAndCreateUtilisateur(Personne personne) throws EmailException, DataConstraintException {
+ LOG.info("updateAndCreateUtilisateur " + personne.getIdPersonne());
+ String password = PasswordTools.random();
+ try {
+ dao.update(personne);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ dao.execute(PersonneDao.SQL_CREATE_UTILISATEUR_FROM_PERSONNE, Boolean.TRUE, hashPassword(password),
+ TypeDroit.UTILISATEUR.ordinal(), personne.getIdPersonne());
+ Utilisateur utilisateur;
+ try {
+ utilisateur = dao.read(Utilisateur.class, personne.getIdPersonne());
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ mailService.sendMail(utilisateur, messages.getMessage("create.subject"),
+ messages.getMessage("create.text", new Object[] { password }));
+ return utilisateur;
+ }
- /** {@inheritDoc} */
- @Override
- public void updatePersonne(Personne personne) throws DataConstraintException {
- LOG.info("updatePersonne " + personne.getIdPersonne());
- try {
- dao.update(personne);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updatePersonne(Personne personne) throws DataConstraintException {
+ LOG.info("updatePersonne " + personne.getIdPersonne());
+ try {
+ dao.update(personne);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /**
- * Met à jour un utilisateur
- * @param utilisateur Utilisateur
- * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
- */
- private void updateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
- AssertTools.assertNotNull(utilisateur);
- LOG.info("updateUtilisateur " + utilisateur.getCourriel());
- try {
- dao.update(utilisateur);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /**
+ * Met à jour un utilisateur
+ * @param utilisateur Utilisateur
+ * @throws DataConstraintException Si l'utilisateur existe déjà (champs uniques)
+ */
+ private void updateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
+ AssertTools.assertNotNull(utilisateur);
+ LOG.info("updateUtilisateur " + utilisateur.getCourriel());
+ try {
+ dao.update(utilisateur);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void updateUtilisateur(Utilisateur utilisateur, boolean admin) throws DataConstraintException {
- updateUtilisateur(utilisateur);
- if (admin) {
- mailService.sendMailQuietly(utilisateur, messages.getMessage("update.subject"),
- messages.getMessage("update.text"));
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateUtilisateur(Utilisateur utilisateur, boolean admin) throws DataConstraintException {
+ updateUtilisateur(utilisateur);
+ if (admin) {
+ mailService.sendMailQuietly(utilisateur, messages.getMessage("update.subject"),
+ messages.getMessage("update.text"));
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void validAndUpdateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
- utilisateur.setValide(true);
- updateUtilisateur(utilisateur);
- mailService.sendMailQuietly(utilisateur, messages.getMessage("valid.subject"),
- messages.getMessage("valid.text"));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void validAndUpdateUtilisateur(Utilisateur utilisateur) throws DataConstraintException {
+ utilisateur.setValide(true);
+ updateUtilisateur(utilisateur);
+ mailService.sendMailQuietly(utilisateur, messages.getMessage("valid.subject"),
+ messages.getMessage("valid.text"));
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrDeletePersonneEnabled(Personne personne, Utilisateur modifieur) {
- AssertTools.assertNotNull(personne);
- AssertTools.assertNotNull(modifieur);
- return !(personne instanceof Utilisateur) || modifieur.getTypeDroit() == TypeDroit.ADMINISTRATEUR;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrDeletePersonneEnabled(Personne personne, Utilisateur modifieur) {
+ AssertTools.assertNotNull(personne);
+ AssertTools.assertNotNull(modifieur);
+ return !(personne instanceof Utilisateur) || modifieur.getTypeDroit() == TypeDroit.ADMINISTRATEUR;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ProduitServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ProduitServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/ProduitServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,77 +52,77 @@
@Service
public final class ProduitServiceImpl implements ProduitService {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** Service pour les extractions **/
- @Autowired
- private ExtractionService extractionService;
+ /** Service pour les extractions **/
+ @Autowired
+ private ExtractionService extractionService;
- /** Service pour les purifications **/
- @Autowired
- private PurificationService purificationService;
+ /** Service pour les purifications **/
+ @Autowired
+ private PurificationService purificationService;
- /** {@inheritDoc} */
- @Override
- public List<Produit> listProduits(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
+ /** {@inheritDoc} */
+ @Override
+ public List<Produit> listProduits(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- SortedSet<Produit> produits = new TreeSet<Produit>();
- produits.addAll(dao.readList(Extrait.class, "ref"));
- produits.addAll(dao.readList(Fraction.class, "ref"));
- return new ArrayList<Produit>(produits);
- }
- // gestion des droits en plus pour les utilisateurs
- return new ArrayList<Produit>(listProduitsForUser(utilisateur));
- }
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ SortedSet<Produit> produits = new TreeSet<Produit>();
+ produits.addAll(dao.readList(Extrait.class, "ref"));
+ produits.addAll(dao.readList(Fraction.class, "ref"));
+ return new ArrayList<Produit>(produits);
+ }
+ // gestion des droits en plus pour les utilisateurs
+ return new ArrayList<Produit>(listProduitsForUser(utilisateur));
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Produit> listProduitsForUser(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- SortedSet<Produit> produits = new TreeSet<Produit>();
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Produit> listProduitsForUser(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ SortedSet<Produit> produits = new TreeSet<Produit>();
- for (Extraction curExtraction : extractionService.listExtractionsForUser(utilisateur)) {
- produits.addAll(curExtraction.getExtraits());
- }
- for (Purification curPurification : purificationService.listPurificationsForUser(utilisateur)) {
- produits.addAll(curPurification.getFractions());
- }
+ for (Extraction curExtraction : extractionService.listExtractionsForUser(utilisateur)) {
+ produits.addAll(curExtraction.getExtraits());
+ }
+ for (Purification curPurification : purificationService.listPurificationsForUser(utilisateur)) {
+ produits.addAll(curPurification.getFractions());
+ }
- return produits;
- }
+ return produits;
+ }
- /** {@inheritDoc} */
- @Override
- public List<Produit> listProduitsWithoutChildrenOfPuri(Utilisateur utilisateur, Purification purification) {
- AssertTools.assertNotNull(utilisateur);
- AssertTools.assertNotNull(purification);
+ /** {@inheritDoc} */
+ @Override
+ public List<Produit> listProduitsWithoutChildrenOfPuri(Utilisateur utilisateur, Purification purification) {
+ AssertTools.assertNotNull(utilisateur);
+ AssertTools.assertNotNull(purification);
- List<Produit> produits = listProduits(utilisateur);
+ List<Produit> produits = listProduits(utilisateur);
- // version itérative (dérécursification)
- LinkedList<Fraction> fractionsQueue = new LinkedList<Fraction>(purification.getFractions());
- while (!fractionsQueue.isEmpty()) {
- Fraction curFraction = fractionsQueue.remove();
- produits.remove(curFraction);
- // LOG.debug("-removeFraction : " + curFraction);
+ // version itérative (dérécursification)
+ LinkedList<Fraction> fractionsQueue = new LinkedList<Fraction>(purification.getFractions());
+ while (!fractionsQueue.isEmpty()) {
+ Fraction curFraction = fractionsQueue.remove();
+ produits.remove(curFraction);
+ // LOG.debug("-removeFraction : " + curFraction);
- for (Purification curPuriFromFraction : curFraction.getPurificationsSuivantes()) {
- fractionsQueue.addAll(curPuriFromFraction.getFractions());
- }
- }
- return produits;
- }
+ for (Purification curPuriFromFraction : curFraction.getPurificationsSuivantes()) {
+ fractionsQueue.addAll(curPuriFromFraction.getFractions());
+ }
+ }
+ return produits;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isProduitReferenced(Produit produit) {
- return dao.count(ProduitDao.getCriteriaCountPurifFromProduit(produit.getRef())) > 0
- && dao.count(ProduitDao.getCriteriaCountTestBioFromProduit(produit.getRef())) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isProduitReferenced(Produit produit) {
+ return dao.count(ProduitDao.getCriteriaCountPurifFromProduit(produit.getRef())) > 0
+ && dao.count(ProduitDao.getCriteriaCountTestBioFromProduit(produit.getRef())) > 0;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PurificationServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PurificationServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/PurificationServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -59,258 +59,258 @@
@Service
public final class PurificationServiceImpl implements PurificationService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** Service : extractions */
- @Autowired
- private ExtractionService extractionService;
+ /** Service : extractions */
+ @Autowired
+ private ExtractionService extractionService;
- /** {@inheritDoc} */
- @Override
- public long countPurifications() {
- return dao.count(Purification.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countPurifications() {
+ return dao.count(Purification.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createPurification(Purification purification) throws DataConstraintException {
- LOG.info("createPurification: " + purification.getRef());
- dao.create(purification);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createPurification(Purification purification) throws DataConstraintException {
+ LOG.info("createPurification: " + purification.getRef());
+ dao.create(purification);
+ }
- /** {@inheritDoc} */
- @Override
- public void initParamsMethoPuriEffectif(Purification purification) {
- AssertTools.assertNotNull(purification);
- if (purification.getMethode() != null) {
- // rafraichi la méthode pour pouvoir accéder aux paramètres accédés en LAZY
- refreshMethodePurification(purification.getMethode());
+ /** {@inheritDoc} */
+ @Override
+ public void initParamsMethoPuriEffectif(Purification purification) {
+ AssertTools.assertNotNull(purification);
+ if (purification.getMethode() != null) {
+ // rafraichi la méthode pour pouvoir accéder aux paramètres accédés en LAZY
+ refreshMethodePurification(purification.getMethode());
- refreshMethodePurification(purification.getMethode());
- purification.getParamsMetho().clear();
- for (int paramInd = 0; paramInd < purification.getMethode().getParametres().size(); paramInd++) {
- ParamMethoPuri paramMetho = purification.getMethode().getParametres().get(paramInd);
+ refreshMethodePurification(purification.getMethode());
+ purification.getParamsMetho().clear();
+ for (int paramInd = 0; paramInd < purification.getMethode().getParametres().size(); paramInd++) {
+ ParamMethoPuri paramMetho = purification.getMethode().getParametres().get(paramInd);
- ParamMethoPuriEffectif effectifParam = new ParamMethoPuriEffectif();
- effectifParam.setParam(paramMetho);
- effectifParam.setPurification(purification);
+ ParamMethoPuriEffectif effectifParam = new ParamMethoPuriEffectif();
+ effectifParam.setParam(paramMetho);
+ effectifParam.setPurification(purification);
- // effectifParam.valeur is null
- purification.getParamsMetho().add(effectifParam);
- // LOG.debug("ajout param : " + paramMetho.getNom());
- }
- }
- }
+ // effectifParam.valeur is null
+ purification.getParamsMetho().add(effectifParam);
+ // LOG.debug("ajout param : " + paramMetho.getNom());
+ }
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void deletePurification(Purification purification) throws DataConstraintException {
- AssertTools.assertNotNull(purification);
- LOG.info("deletePurification: " + purification.getRef());
- try {
- dao.delete(purification);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deletePurification(Purification purification) throws DataConstraintException {
+ AssertTools.assertNotNull(purification);
+ LOG.info("deletePurification: " + purification.getRef());
+ try {
+ dao.delete(purification);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public List<Purification> listPurifications(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- // si admin, on ajoute toutes les purifications de la base
- return dao.readList(Purification.class, "produit", "ref");
- }
- // gestion des droits en plus pour les utilisateurs
- return new ArrayList<Purification>(listPurificationsForUser(utilisateur));
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<Purification> listPurifications(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ // si admin, on ajoute toutes les purifications de la base
+ return dao.readList(Purification.class, "produit", "ref");
+ }
+ // gestion des droits en plus pour les utilisateurs
+ return new ArrayList<Purification>(listPurificationsForUser(utilisateur));
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Purification> listPurificationsForUser(Utilisateur utilisateur) {
- SortedSet<Purification> purifications = new TreeSet<Purification>();
- purifications.addAll(utilisateur.getPurificationsCrees());
- addAllPurificationsOfExtractions(purifications, extractionService.listExtractionsForUser(utilisateur));
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Purification> listPurificationsForUser(Utilisateur utilisateur) {
+ SortedSet<Purification> purifications = new TreeSet<Purification>();
+ purifications.addAll(utilisateur.getPurificationsCrees());
+ addAllPurificationsOfExtractions(purifications, extractionService.listExtractionsForUser(utilisateur));
- return purifications;
- }
+ return purifications;
+ }
- /**
- * Ajoute tous les purifications contenues dans un ensemble d'extraction à un ensemble de purifications
- * @param purifications l'ensemble de purifications destination
- * @param extractions l'ensemble des extractions sources
- */
- private void addAllPurificationsOfExtractions(Set<Purification> purifications, Set<Extraction> extractions) {
- for (Extraction curExtraction : extractions) {
- for (Extrait curExtrait : curExtraction.getExtraits()) {
- for (Purification curPurification : curExtrait.getPurificationsSuivantes()) {
- purifications.add(curPurification);
+ /**
+ * Ajoute tous les purifications contenues dans un ensemble d'extraction à un ensemble de purifications
+ * @param purifications l'ensemble de purifications destination
+ * @param extractions l'ensemble des extractions sources
+ */
+ private void addAllPurificationsOfExtractions(Set<Purification> purifications, Set<Extraction> extractions) {
+ for (Extraction curExtraction : extractions) {
+ for (Extrait curExtrait : curExtraction.getExtraits()) {
+ for (Purification curPurification : curExtrait.getPurificationsSuivantes()) {
+ purifications.add(curPurification);
- // version itérative (dérécursification)
- LinkedList<Fraction> fractionsQueue = new LinkedList<Fraction>(curPurification.getFractions());
- while (!fractionsQueue.isEmpty()) {
- Fraction curFraction = fractionsQueue.remove();
- for (Purification curPuriFromFraction : curFraction.getPurificationsSuivantes()) {
- purifications.add(curPuriFromFraction);
- fractionsQueue.addAll(curPuriFromFraction.getFractions());
- }
- }
- }
- }
- }
- }
+ // version itérative (dérécursification)
+ LinkedList<Fraction> fractionsQueue = new LinkedList<Fraction>(curPurification.getFractions());
+ while (!fractionsQueue.isEmpty()) {
+ Fraction curFraction = fractionsQueue.remove();
+ for (Purification curPuriFromFraction : curFraction.getPurificationsSuivantes()) {
+ purifications.add(curPuriFromFraction);
+ fractionsQueue.addAll(curPuriFromFraction.getFractions());
+ }
+ }
+ }
+ }
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isPurificationUnique(Purification purification) {
- AssertTools.assertNotNull(purification);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isPurificationUnique(Purification purification) {
+ AssertTools.assertNotNull(purification);
- // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
- if (!dao.exists(Purification.class, "ref", purification.getRef())) {
- return true;
- }
+ // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
+ if (!dao.exists(Purification.class, "ref", purification.getRef())) {
+ return true;
+ }
- Purification puriWithSameVal;
- try {
- puriWithSameVal = dao.read(Purification.class, "ref", purification.getRef());
- dao.evict(puriWithSameVal);
- } catch (DataNotFoundException e) {
- return true; // never call, cover by dao.exists...
- }
- // in case of new record, id is null
- return purification.getIdPurification() != null
- && purification.getIdPurification().equals(puriWithSameVal.getIdPurification());
- }
+ Purification puriWithSameVal;
+ try {
+ puriWithSameVal = dao.read(Purification.class, "ref", purification.getRef());
+ dao.evict(puriWithSameVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, cover by dao.exists...
+ }
+ // in case of new record, id is null
+ return purification.getIdPurification() != null
+ && purification.getIdPurification().equals(puriWithSameVal.getIdPurification());
+ }
- /** {@inheritDoc} */
- @Override
- public Purification loadPurification(Integer idPurification) throws DataNotFoundException {
- return dao.read(Purification.class, idPurification);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Purification loadPurification(Integer idPurification) throws DataNotFoundException {
+ return dao.read(Purification.class, idPurification);
+ }
- /** {@inheritDoc} */
- @Override
- public Purification loadPurification(String nom) throws DataNotFoundException {
- return dao.read(Purification.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Purification loadPurification(String nom) throws DataNotFoundException {
+ return dao.read(Purification.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updatePurification(Purification purification) throws DataConstraintException {
- LOG.info("updatePurification: " + purification.getRef());
- try {
- dao.update(purification);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updatePurification(Purification purification) throws DataConstraintException {
+ LOG.info("updatePurification: " + purification.getRef());
+ try {
+ dao.update(purification);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshPurification(Purification purification) {
- dao.refresh(purification);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshPurification(Purification purification) {
+ dao.refresh(purification);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeletePurificationEnabled(Purification purification, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == purification.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeletePurificationEnabled(Purification purification, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == purification.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public void createMethodePurification(MethodePurification methode) throws DataConstraintException {
- LOG.info("createMethodePurification: " + methode.getNom());
- dao.create(methode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createMethodePurification(MethodePurification methode) throws DataConstraintException {
+ LOG.info("createMethodePurification: " + methode.getNom());
+ dao.create(methode);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteMethodePurification(MethodePurification methode) throws DataConstraintException {
- AssertTools.assertNotNull(methode);
- LOG.info("deleteMethodePurification: " + methode.getNom());
- try {
- dao.delete(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteMethodePurification(MethodePurification methode) throws DataConstraintException {
+ AssertTools.assertNotNull(methode);
+ LOG.info("deleteMethodePurification: " + methode.getNom());
+ try {
+ dao.delete(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public List<MethodePurification> listMethodesPurification() {
- return dao.readList(MethodePurification.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<MethodePurification> listMethodesPurification() {
+ return dao.readList(MethodePurification.class, "nom");
+ }
- /** {@inheritDoc} */
- @Override
- public MethodePurification loadMethodePurification(Integer idMethode) throws DataNotFoundException {
- return dao.read(MethodePurification.class, idMethode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodePurification loadMethodePurification(Integer idMethode) throws DataNotFoundException {
+ return dao.read(MethodePurification.class, idMethode);
+ }
- /** {@inheritDoc} */
- @Override
- public MethodePurification loadMethodePurification(String nom) throws DataNotFoundException {
- return dao.read(MethodePurification.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodePurification loadMethodePurification(String nom) throws DataNotFoundException {
+ return dao.read(MethodePurification.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateMethodePurification(MethodePurification methode) throws DataConstraintException {
- LOG.info("updateMethodePurification: " + methode.getNom());
- try {
- dao.update(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateMethodePurification(MethodePurification methode) throws DataConstraintException {
+ LOG.info("updateMethodePurification: " + methode.getNom());
+ try {
+ dao.update(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshMethodePurification(MethodePurification methode) {
- AssertTools.assertNotNull(methode);
- dao.refresh(methode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshMethodePurification(MethodePurification methode) {
+ AssertTools.assertNotNull(methode);
+ dao.refresh(methode);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isParamMethoPuriReferenced(ParamMethoPuri paramMetho) {
- AssertTools.assertNotNull(paramMetho);
- AssertTools.assertNotNull(paramMetho.getIdParamMethoPuri());
- return dao.count(PurificationDao.COUNT_PURIF_WITH_PARAM_METHO, paramMetho.getIdParamMethoPuri()) > 0;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isParamMethoPuriReferenced(ParamMethoPuri paramMetho) {
+ AssertTools.assertNotNull(paramMetho);
+ AssertTools.assertNotNull(paramMetho.getIdParamMethoPuri());
+ return dao.count(PurificationDao.COUNT_PURIF_WITH_PARAM_METHO, paramMetho.getIdParamMethoPuri()) > 0;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isFractionUnique(Fraction fraction) {
- AssertTools.assertNotNull(fraction);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isFractionUnique(Fraction fraction) {
+ AssertTools.assertNotNull(fraction);
- // unique if it doesn't exist different value or if it exists with the same id (so same row in the db)
- if (!dao.exists(Fraction.class, "ref", fraction.getRef())) {
- return true;
- }
- Fraction fractWithSameVal;
- try {
- fractWithSameVal = dao.read(Fraction.class, "ref", fraction.getRef());
- dao.evict(fractWithSameVal);
- } catch (DataNotFoundException e) {
- return true; // never call, covers by dao.exists...
- }
- // in case of new record, id is null
- return fraction.getId() != null && fraction.getId().equals(fractWithSameVal.getId());
- }
+ // unique if it doesn't exist different value or if it exists with the same id (so same row in the db)
+ if (!dao.exists(Fraction.class, "ref", fraction.getRef())) {
+ return true;
+ }
+ Fraction fractWithSameVal;
+ try {
+ fractWithSameVal = dao.read(Fraction.class, "ref", fraction.getRef());
+ dao.evict(fractWithSameVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, covers by dao.exists...
+ }
+ // in case of new record, id is null
+ return fraction.getId() != null && fraction.getId().equals(fractWithSameVal.getId());
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SpecimenServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SpecimenServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SpecimenServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -54,163 +54,163 @@
@Service
public final class SpecimenServiceImpl implements SpecimenService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Accès aux données */
- @Autowired
- private GenericDao dao;
+ /** Accès aux données */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public long countSpecimens() {
- return dao.count(Specimen.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countSpecimens() {
+ return dao.count(Specimen.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createSpecimen(Specimen specimen) throws DataConstraintException {
- LOG.info("createSpecimen: " + specimen.getRef());
- dao.create(specimen);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createSpecimen(Specimen specimen) throws DataConstraintException {
+ LOG.info("createSpecimen: " + specimen.getRef());
+ dao.create(specimen);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteSpecimen(Specimen specimen) throws DataConstraintException {
- AssertTools.assertNotNull(specimen);
- LOG.info("deleteSpecimen " + specimen.getRef());
- try {
- dao.delete(specimen);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteSpecimen(Specimen specimen) throws DataConstraintException {
+ AssertTools.assertNotNull(specimen);
+ LOG.info("deleteSpecimen " + specimen.getRef());
+ try {
+ dao.delete(specimen);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public List<Specimen> listSpecimens(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- return dao.readList(Specimen.class, "ref");
- }
- SortedSet<Specimen> specimens = listSpecimensForUser(utilisateur);
+ /** {@inheritDoc} */
+ @Override
+ public List<Specimen> listSpecimens(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ return dao.readList(Specimen.class, "ref");
+ }
+ SortedSet<Specimen> specimens = listSpecimensForUser(utilisateur);
- return new ArrayList<Specimen>(specimens);
- }
+ return new ArrayList<Specimen>(specimens);
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Specimen> listSpecimensForUser(Utilisateur utilisateur) {
- // gestion des droits en plus pour les utilisateurs
- SortedSet<Specimen> specimens = new TreeSet<Specimen>();
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Specimen> listSpecimensForUser(Utilisateur utilisateur) {
+ // gestion des droits en plus pour les utilisateurs
+ SortedSet<Specimen> specimens = new TreeSet<Specimen>();
- // droits donnés pour les spécimens créés par l'utilisateur
- specimens.addAll(utilisateur.getSpecimensCrees());
+ // droits donnés pour les spécimens créés par l'utilisateur
+ specimens.addAll(utilisateur.getSpecimensCrees());
- // droits donnés pour l'ensemble des spécimens qui a pour station une station prospectée par les campagnes dont
- // l'utilisateur a les droits
- List<Campagne> campagnes = new ArrayList<Campagne>();
- campagnes.addAll(utilisateur.getCampagnesCreees());
- campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
- for (Campagne c : campagnes) {
- for (Station st : c.getStations()) {
- specimens.addAll(st.getSpecimensRattaches());
- }
- }
- // droits donnés également pour le spécimen de référence de chaque lot dont l'utilisateur a les droits
- List<Lot> lots = new ArrayList<Lot>();
- lots.addAll(utilisateur.getLotsCrees());
- lots.addAll(utilisateur.getLotsDroits().keySet());
- for (Lot l : lots) {
- // droit sur le spécimen de référence du lot
- if (l.getSpecimenRef().getStation() != null) {
- specimens.add(l.getSpecimenRef());
- }
- }
- return specimens;
- }
+ // droits donnés pour l'ensemble des spécimens qui a pour station une station prospectée par les campagnes dont
+ // l'utilisateur a les droits
+ List<Campagne> campagnes = new ArrayList<Campagne>();
+ campagnes.addAll(utilisateur.getCampagnesCreees());
+ campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
+ for (Campagne c : campagnes) {
+ for (Station st : c.getStations()) {
+ specimens.addAll(st.getSpecimensRattaches());
+ }
+ }
+ // droits donnés également pour le spécimen de référence de chaque lot dont l'utilisateur a les droits
+ List<Lot> lots = new ArrayList<Lot>();
+ lots.addAll(utilisateur.getLotsCrees());
+ lots.addAll(utilisateur.getLotsDroits().keySet());
+ for (Lot l : lots) {
+ // droit sur le spécimen de référence du lot
+ if (l.getSpecimenRef().getStation() != null) {
+ specimens.add(l.getSpecimenRef());
+ }
+ }
+ return specimens;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listSpecimenEmbranchements() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_EMBRANCHEMENTS);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listSpecimenEmbranchements() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_EMBRANCHEMENTS);
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listSpecimenFamilles() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_FAMILLES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listSpecimenFamilles() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_FAMILLES);
+ }
- /** {@inheritDoc} */
- @Override
- @SuppressWarnings("unchecked")
- public List<String> listSpecimenGenres() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_GENRES);
- }
+ /** {@inheritDoc} */
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<String> listSpecimenGenres() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_GENRES);
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listSpecimenEspeces() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_ESPECES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listSpecimenEspeces() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_ESPECES);
+ }
- /** {@inheritDoc} */
- @Override
- @SuppressWarnings("unchecked")
- public List<String> listSpecimenSousEspeces() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_SOUSESPECES);
- }
+ /** {@inheritDoc} */
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<String> listSpecimenSousEspeces() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_SOUSESPECES);
+ }
- /** {@inheritDoc} */
- @Override
- @SuppressWarnings("unchecked")
- public List<String> listSpecimenVarietes() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_VARIETES);
- }
+ /** {@inheritDoc} */
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<String> listSpecimenVarietes() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_SPECIMEN_VARIETES);
+ }
- /** {@inheritDoc} */
- @Override
- @SuppressWarnings("unchecked")
- public List<String> listLieuxDepot() {
- return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_LIEUX_DEPOT);
- }
+ /** {@inheritDoc} */
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<String> listLieuxDepot() {
+ return (List<String>) dao.list(SpecimenDao.CRITERIA_DISTINCT_LIEUX_DEPOT);
+ }
- /** {@inheritDoc} */
- @Override
- public Specimen loadSpecimen(Integer idSpecimen) throws DataNotFoundException {
- AssertTools.assertNotNull(idSpecimen);
- return dao.read(Specimen.class, idSpecimen);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Specimen loadSpecimen(Integer idSpecimen) throws DataNotFoundException {
+ AssertTools.assertNotNull(idSpecimen);
+ return dao.read(Specimen.class, idSpecimen);
+ }
- /** {@inheritDoc} */
- @Override
- public Specimen loadSpecimen(String ref) throws DataNotFoundException {
- AssertTools.assertNotEmpty(ref);
- return dao.read(Specimen.class, "ref", ref);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Specimen loadSpecimen(String ref) throws DataNotFoundException {
+ AssertTools.assertNotEmpty(ref);
+ return dao.read(Specimen.class, "ref", ref);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteSpecimenEnabled(Specimen specimen, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == specimen.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteSpecimenEnabled(Specimen specimen, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == specimen.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public void updateSpecimen(Specimen specimen) throws DataConstraintException {
- LOG.info("updateSpecimen " + specimen.getIdSpecimen());
- try {
- dao.update(specimen);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateSpecimen(Specimen specimen) throws DataConstraintException {
+ LOG.info("updateSpecimen " + specimen.getIdSpecimen());
+ try {
+ dao.update(specimen);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/StationServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/StationServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/StationServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -53,119 +53,119 @@
@Service
public final class StationServiceImpl implements StationService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public long countStations() {
- return dao.count(Station.class);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countStations() {
+ return dao.count(Station.class);
+ }
- /** {@inheritDoc} */
- @Override
- public void createStation(Station station) throws DataConstraintException {
- LOG.info("createStation " + station.getNom());
- dao.create(station);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createStation(Station station) throws DataConstraintException {
+ LOG.info("createStation " + station.getNom());
+ dao.create(station);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteStation(Station station) throws DataConstraintException {
- LOG.info("deleteStation " + station.getIdStation());
- try {
- dao.delete(station);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteStation(Station station) throws DataConstraintException {
+ LOG.info("deleteStation " + station.getIdStation());
+ try {
+ dao.delete(station);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listStationLocalites() {
- return (List<String>) dao.list(StationDao.CRITERIA_DISTINCT_STATION_LOCALITES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listStationLocalites() {
+ return (List<String>) dao.list(StationDao.CRITERIA_DISTINCT_STATION_LOCALITES);
+ }
- /** {@inheritDoc} */
- @Override
- public List<Station> listStations(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- return dao.readList(Station.class, "nom");
- }
- SortedSet<Station> stations = listStationsForUser(utilisateur);
+ /** {@inheritDoc} */
+ @Override
+ public List<Station> listStations(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ return dao.readList(Station.class, "nom");
+ }
+ SortedSet<Station> stations = listStationsForUser(utilisateur);
- return new ArrayList<Station>(stations);
- }
+ return new ArrayList<Station>(stations);
+ }
- /** {@inheritDoc} */
- @Override
- public SortedSet<Station> listStationsForUser(Utilisateur utilisateur) {
- // gestion des droits en plus pour les utilisateurs
- SortedSet<Station> stations = new TreeSet<Station>();
+ /** {@inheritDoc} */
+ @Override
+ public SortedSet<Station> listStationsForUser(Utilisateur utilisateur) {
+ // gestion des droits en plus pour les utilisateurs
+ SortedSet<Station> stations = new TreeSet<Station>();
- // droits donnés pour les stations crées par l'utilisateur
- stations.addAll(utilisateur.getStationsCrees());
+ // droits donnés pour les stations crées par l'utilisateur
+ stations.addAll(utilisateur.getStationsCrees());
- // droits donnés pour l'ensemble des stations prospectées des campagnes où l'utilisateur a les droits sur la
- // campagne complète
- List<Campagne> campagnes = new ArrayList<Campagne>();
- campagnes.addAll(utilisateur.getCampagnesCreees());
- campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
- for (Campagne c : campagnes) {
- stations.addAll(c.getStations());
- }
- // droits donnés également pour chaque lot qui a des droits particuliers
- List<Lot> lots = new ArrayList<Lot>();
- lots.addAll(utilisateur.getLotsCrees());
- lots.addAll(utilisateur.getLotsDroits().keySet());
- for (Lot l : lots) {
- // droit sur la station du lot
- stations.add(l.getStation());
- // droit sur la station de provenance du spécimen rattaché
- if (l.getSpecimenRef().getStation() != null) {
- stations.add(l.getSpecimenRef().getStation());
- }
- }
- return stations;
- }
+ // droits donnés pour l'ensemble des stations prospectées des campagnes où l'utilisateur a les droits sur la
+ // campagne complète
+ List<Campagne> campagnes = new ArrayList<Campagne>();
+ campagnes.addAll(utilisateur.getCampagnesCreees());
+ campagnes.addAll(utilisateur.getCampagnesDroits().keySet());
+ for (Campagne c : campagnes) {
+ stations.addAll(c.getStations());
+ }
+ // droits donnés également pour chaque lot qui a des droits particuliers
+ List<Lot> lots = new ArrayList<Lot>();
+ lots.addAll(utilisateur.getLotsCrees());
+ lots.addAll(utilisateur.getLotsDroits().keySet());
+ for (Lot l : lots) {
+ // droit sur la station du lot
+ stations.add(l.getStation());
+ // droit sur la station de provenance du spécimen rattaché
+ if (l.getSpecimenRef().getStation() != null) {
+ stations.add(l.getSpecimenRef().getStation());
+ }
+ }
+ return stations;
+ }
- /** {@inheritDoc} */
- @Override
- public Station loadStation(Integer idStation) throws DataNotFoundException {
- AssertTools.assertNotNull(idStation);
- return dao.read(Station.class, idStation);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Station loadStation(Integer idStation) throws DataNotFoundException {
+ AssertTools.assertNotNull(idStation);
+ return dao.read(Station.class, idStation);
+ }
- /** {@inheritDoc} */
- @Override
- public Station loadStation(String nom) throws DataNotFoundException {
- AssertTools.assertNotEmpty(nom);
- return dao.read(Station.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Station loadStation(String nom) throws DataNotFoundException {
+ AssertTools.assertNotEmpty(nom);
+ return dao.read(Station.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteStationEnabled(Station station, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == station.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteStationEnabled(Station station, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == station.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public void updateStation(Station station) throws DataConstraintException {
- LOG.info("updateStation " + station.getNom());
- try {
- dao.update(station);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateStation(Station station) throws DataConstraintException {
+ LOG.info("updateStation " + station.getNom());
+ try {
+ dao.update(station);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/TestBioServiceImpl.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/TestBioServiceImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/TestBioServiceImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -55,292 +55,292 @@
@Service
public final class TestBioServiceImpl implements TestBioService {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Service : lots */
- @Autowired
- private LotService lotService;
+ /** Service : lots */
+ @Autowired
+ private LotService lotService;
- /** DAO */
- @Autowired
- private GenericDao dao;
+ /** DAO */
+ @Autowired
+ private GenericDao dao;
- /** {@inheritDoc} */
- @Override
- public long countResultatsTestsBio() {
- return dao.count(TestBioDao.CRITERIA_COUNT_RESULTATS_TYPE_PRODUIT);
- }
+ /** {@inheritDoc} */
+ @Override
+ public long countResultatsTestsBio() {
+ return dao.count(TestBioDao.CRITERIA_COUNT_RESULTATS_TYPE_PRODUIT);
+ }
- /** {@inheritDoc} */
- @Override
- public void createTestBio(TestBio testBio) throws DataConstraintException {
- LOG.info("createTestBio: " + testBio.getRef());
- dao.create(testBio);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createTestBio(TestBio testBio) throws DataConstraintException {
+ LOG.info("createTestBio: " + testBio.getRef());
+ dao.create(testBio);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteTestBio(TestBio testBio) throws DataConstraintException {
- AssertTools.assertNotNull(testBio);
- LOG.info("deleteTestBio: " + testBio.getRef());
- try {
- dao.delete(testBio);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteTestBio(TestBio testBio) throws DataConstraintException {
+ AssertTools.assertNotNull(testBio);
+ LOG.info("deleteTestBio: " + testBio.getRef());
+ try {
+ dao.delete(testBio);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<ResultatTestBio> listResultatsTestBio(Utilisateur utilisateur) {
- AssertTools.assertNotNull(utilisateur);
- if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- // si admin, on ajoute toutes les testBios de la base
- return (List<ResultatTestBio>) dao.list(TestBioDao.CRITERIA_LIST_RESULTATS_TYPE_PRODUIT);
- }
- // gestion des droits en plus pour les utilisateurs
- return new ArrayList<ResultatTestBio>(listResultatsTestBioForUser(utilisateur));
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<ResultatTestBio> listResultatsTestBio(Utilisateur utilisateur) {
+ AssertTools.assertNotNull(utilisateur);
+ if (utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ // si admin, on ajoute toutes les testBios de la base
+ return (List<ResultatTestBio>) dao.list(TestBioDao.CRITERIA_LIST_RESULTATS_TYPE_PRODUIT);
+ }
+ // gestion des droits en plus pour les utilisateurs
+ return new ArrayList<ResultatTestBio>(listResultatsTestBioForUser(utilisateur));
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public SortedSet<ResultatTestBio> listResultatsTestBioForUser(Utilisateur utilisateur) {
- SortedSet<ResultatTestBio> resultats = new TreeSet<ResultatTestBio>();
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public SortedSet<ResultatTestBio> listResultatsTestBioForUser(Utilisateur utilisateur) {
+ SortedSet<ResultatTestBio> resultats = new TreeSet<ResultatTestBio>();
- // liste triée par produit afin d'optimiser
- List<ResultatTestBio> allResultTests = (List<ResultatTestBio>) dao
- .list(TestBioDao.CRITERIA_LIST_RESULTATS_TYPE_PRODUIT);
- for (ResultatTestBio curRes : allResultTests) {
- if (lotService.isLotAccessibleByUser(curRes.getLotSource(), utilisateur)) {
- resultats.add(curRes);
- }
- }
+ // liste triée par produit afin d'optimiser
+ List<ResultatTestBio> allResultTests = (List<ResultatTestBio>) dao
+ .list(TestBioDao.CRITERIA_LIST_RESULTATS_TYPE_PRODUIT);
+ for (ResultatTestBio curRes : allResultTests) {
+ if (lotService.isLotAccessibleByUser(curRes.getLotSource(), utilisateur)) {
+ resultats.add(curRes);
+ }
+ }
- return resultats;
- }
+ return resultats;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listProduitsTemoins() {
- return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_PRODUITS_TEMOINS);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listProduitsTemoins() {
+ return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_PRODUITS_TEMOINS);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isResultatTestBioAccessibleByUser(ResultatTestBio resultatTestBio, Utilisateur utilisateur) {
- return lotService.isLotAccessibleByUser(resultatTestBio.getLotSource(), utilisateur);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isResultatTestBioAccessibleByUser(ResultatTestBio resultatTestBio, Utilisateur utilisateur) {
+ return lotService.isLotAccessibleByUser(resultatTestBio.getLotSource(), utilisateur);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isResultatTestBioUniqueInList(final ResultatTestBio resultatTestBio, final List<ResultatTestBio> list) {
- AssertTools.assertNotNull(resultatTestBio.getTypeResultat());
- AssertTools.assertNotNull(resultatTestBio.getRepere());
- // as resultatTestBio is already in list, detect if more of one elements satisfy these conditions
- int count = 0;
- for (ResultatTestBio curRes : list) {
- if (resultatTestBio.getTypeResultat() == TypeResultat.BLANC
- && resultatTestBio.getRepere().equals(curRes.getRepere())) {
- count++;
- } else if (resultatTestBio.getTypeResultat() == TypeResultat.TEMOIN
- && resultatTestBio.getRepere().equals(curRes.getRepere())
- && resultatTestBio.getProduitTemoin().equals(curRes.getProduitTemoin())) {
- count++;
- } else if (resultatTestBio.getTypeResultat() == TypeResultat.PRODUIT
- && resultatTestBio.getRepere().equals(curRes.getRepere())
- && resultatTestBio.getProduit().getRef().equals(curRes.getProduit().getRef())) {
- count++;
- }
- }
- return count <= 1;
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean isResultatTestBioUniqueInList(final ResultatTestBio resultatTestBio, final List<ResultatTestBio> list) {
+ AssertTools.assertNotNull(resultatTestBio.getTypeResultat());
+ AssertTools.assertNotNull(resultatTestBio.getRepere());
+ // as resultatTestBio is already in list, detect if more of one elements satisfy these conditions
+ int count = 0;
+ for (ResultatTestBio curRes : list) {
+ if (resultatTestBio.getTypeResultat() == TypeResultat.BLANC
+ && resultatTestBio.getRepere().equals(curRes.getRepere())) {
+ count++;
+ } else if (resultatTestBio.getTypeResultat() == TypeResultat.TEMOIN
+ && resultatTestBio.getRepere().equals(curRes.getRepere())
+ && resultatTestBio.getProduitTemoin().equals(curRes.getProduitTemoin())) {
+ count++;
+ } else if (resultatTestBio.getTypeResultat() == TypeResultat.PRODUIT
+ && resultatTestBio.getRepere().equals(curRes.getRepere())
+ && resultatTestBio.getProduit().getRef().equals(curRes.getProduit().getRef())) {
+ count++;
+ }
+ }
+ return count <= 1;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean isTestBioUnique(TestBio testBio) {
- AssertTools.assertNotNull(testBio);
+ /** {@inheritDoc} */
+ @Override
+ public boolean isTestBioUnique(TestBio testBio) {
+ AssertTools.assertNotNull(testBio);
- // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
- if (!dao.exists(TestBio.class, "ref", testBio.getRef())) {
- return true;
- }
+ // unique if it doesn't exist different value or if it exists but with the same id (so same row in the db)
+ if (!dao.exists(TestBio.class, "ref", testBio.getRef())) {
+ return true;
+ }
- TestBio puriWithSameVal;
- try {
- puriWithSameVal = dao.read(TestBio.class, "ref", testBio.getRef());
- dao.evict(puriWithSameVal);
- } catch (DataNotFoundException e) {
- return true; // never call, cover by dao.exists...
- }
- // in case of new record, id is null
- return testBio.getIdTestBio() != null && testBio.getIdTestBio().equals(puriWithSameVal.getIdTestBio());
- }
+ TestBio puriWithSameVal;
+ try {
+ puriWithSameVal = dao.read(TestBio.class, "ref", testBio.getRef());
+ dao.evict(puriWithSameVal);
+ } catch (DataNotFoundException e) {
+ return true; // never call, cover by dao.exists...
+ }
+ // in case of new record, id is null
+ return testBio.getIdTestBio() != null && testBio.getIdTestBio().equals(puriWithSameVal.getIdTestBio());
+ }
- /** {@inheritDoc} */
- @Override
- public TestBio loadTestBio(Integer idTestBio) throws DataNotFoundException {
- return dao.read(TestBio.class, idTestBio);
- }
+ /** {@inheritDoc} */
+ @Override
+ public TestBio loadTestBio(Integer idTestBio) throws DataNotFoundException {
+ return dao.read(TestBio.class, idTestBio);
+ }
- /** {@inheritDoc} */
- @Override
- public TestBio loadTestBio(String nom) throws DataNotFoundException {
- return dao.read(TestBio.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public TestBio loadTestBio(String nom) throws DataNotFoundException {
+ return dao.read(TestBio.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateTestBio(TestBio testBio) throws DataConstraintException {
- LOG.info("updateTestBio: " + testBio.getRef());
- try {
- dao.update(testBio);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateTestBio(TestBio testBio) throws DataConstraintException {
+ LOG.info("updateTestBio: " + testBio.getRef());
+ try {
+ dao.update(testBio);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshTestBio(TestBio testBio) {
- dao.refresh(testBio);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshTestBio(TestBio testBio) {
+ dao.refresh(testBio);
+ }
- /** {@inheritDoc} */
- @Override
- public boolean updateOrdeleteTestBioEnabled(TestBio testBio, Utilisateur utilisateur) {
- return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || utilisateur.getIdPersonne() == testBio.getCreateur().getIdPersonne();
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean updateOrdeleteTestBioEnabled(TestBio testBio, Utilisateur utilisateur) {
+ return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || utilisateur.getIdPersonne() == testBio.getCreateur().getIdPersonne();
+ }
- /** {@inheritDoc} */
- @Override
- public void createMethodeTestBio(MethodeTestBio methode) throws DataConstraintException {
- LOG.info("createMethodeTest: " + methode.getNom());
- dao.create(methode);
+ /** {@inheritDoc} */
+ @Override
+ public void createMethodeTestBio(MethodeTestBio methode) throws DataConstraintException {
+ LOG.info("createMethodeTest: " + methode.getNom());
+ dao.create(methode);
- }
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteMethodeTestBio(MethodeTestBio methode) throws DataConstraintException {
- AssertTools.assertNotNull(methode);
- LOG.info("deleteMethodeTest: " + methode.getNom());
- try {
- dao.delete(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteMethodeTestBio(MethodeTestBio methode) throws DataConstraintException {
+ AssertTools.assertNotNull(methode);
+ LOG.info("deleteMethodeTest: " + methode.getNom());
+ try {
+ dao.delete(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public List<MethodeTestBio> listMethodesTestBio() {
- return dao.readList(MethodeTestBio.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<MethodeTestBio> listMethodesTestBio() {
+ return dao.readList(MethodeTestBio.class, "nom");
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listDomainesMethodes() {
- return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_DOMAINES_METHODES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listDomainesMethodes() {
+ return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_DOMAINES_METHODES);
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override
- public List<String> listUnitesResultatMethodes() {
- return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_UNITES_RESULTAT_METHODES);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listUnitesResultatMethodes() {
+ return (List<String>) dao.list(TestBioDao.CRITERIA_DISTINCT_UNITES_RESULTAT_METHODES);
+ }
- /** {@inheritDoc} */
- @Override
- public MethodeTestBio loadMethodeTest(Integer idMethode) throws DataNotFoundException {
- return dao.read(MethodeTestBio.class, idMethode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodeTestBio loadMethodeTest(Integer idMethode) throws DataNotFoundException {
+ return dao.read(MethodeTestBio.class, idMethode);
+ }
- /** {@inheritDoc} */
- @Override
- public MethodeTestBio loadMethodeTest(String nom) throws DataNotFoundException {
- return dao.read(MethodeTestBio.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public MethodeTestBio loadMethodeTest(String nom) throws DataNotFoundException {
+ return dao.read(MethodeTestBio.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateMethodeTest(MethodeTestBio methode) throws DataConstraintException {
- LOG.info("updateMethodeTest: " + methode.getNom());
- try {
- dao.update(methode);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateMethodeTest(MethodeTestBio methode) throws DataConstraintException {
+ LOG.info("updateMethodeTest: " + methode.getNom());
+ try {
+ dao.update(methode);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- }
+ }
- /** {@inheritDoc} */
- @Override
- public void refreshMethodeTestBio(MethodeTestBio methode) {
- AssertTools.assertNotNull(methode);
- dao.refresh(methode);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void refreshMethodeTestBio(MethodeTestBio methode) {
+ AssertTools.assertNotNull(methode);
+ dao.refresh(methode);
+ }
- /** {@inheritDoc} */
- @Override
- public void createErreurTest(ErreurTestBio erreurTest) throws DataConstraintException {
- LOG.info("createErreurTest: " + erreurTest.getNom());
- dao.create(erreurTest);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void createErreurTest(ErreurTestBio erreurTest) throws DataConstraintException {
+ LOG.info("createErreurTest: " + erreurTest.getNom());
+ dao.create(erreurTest);
+ }
- /** {@inheritDoc} */
- @Override
- public void deleteErreurTest(ErreurTestBio erreurTest) throws DataConstraintException {
- AssertTools.assertNotNull(erreurTest);
- LOG.info("deleteErreurTest: " + erreurTest.getNom());
- try {
- dao.delete(erreurTest);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void deleteErreurTest(ErreurTestBio erreurTest) throws DataConstraintException {
+ AssertTools.assertNotNull(erreurTest);
+ LOG.info("deleteErreurTest: " + erreurTest.getNom());
+ try {
+ dao.delete(erreurTest);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public List<ErreurTestBio> listErreursTestBio() {
- return dao.readList(ErreurTestBio.class, "nom");
- }
+ /** {@inheritDoc} */
+ @Override
+ public List<ErreurTestBio> listErreursTestBio() {
+ return dao.readList(ErreurTestBio.class, "nom");
+ }
- /** {@inheritDoc} */
- @Override
- public ErreurTestBio loadErreurTestBio(Integer idErreurTest) throws DataNotFoundException {
- return dao.read(ErreurTestBio.class, idErreurTest);
- }
+ /** {@inheritDoc} */
+ @Override
+ public ErreurTestBio loadErreurTestBio(Integer idErreurTest) throws DataNotFoundException {
+ return dao.read(ErreurTestBio.class, idErreurTest);
+ }
- /** {@inheritDoc} */
- @Override
- public ErreurTestBio loadErreurTestBio(String nom) throws DataNotFoundException {
- return dao.read(ErreurTestBio.class, "nom", nom);
- }
+ /** {@inheritDoc} */
+ @Override
+ public ErreurTestBio loadErreurTestBio(String nom) throws DataNotFoundException {
+ return dao.read(ErreurTestBio.class, "nom", nom);
+ }
- /** {@inheritDoc} */
- @Override
- public void updateErreurTestBio(ErreurTestBio erreurTest) throws DataConstraintException {
- LOG.info("updateErreurTest: " + erreurTest.getNom());
- try {
- dao.update(erreurTest);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void updateErreurTestBio(ErreurTestBio erreurTest) throws DataConstraintException {
+ LOG.info("updateErreurTest: " + erreurTest.getNom());
+ try {
+ dao.update(erreurTest);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/CampagneNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/CampagneNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/CampagneNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,15 +34,15 @@
*/
public final class CampagneNormalizer extends Normalizer<Campagne> {
- /** {@inheritDoc} */
- @Override
- public Campagne normalize(Campagne campagne) {
- AssertTools.assertNotNull(campagne);
- // Unique fields
- campagne.setNom(normalize(UniqueFieldNormalizer.class, campagne.getNom()));
- // Autocompleted fields
- campagne.setProgramme(new StringTransformer(campagne.getProgramme()).replaceConsecutiveWhitespaces()
- .trimToNull().capitalize().toString());
- return campagne;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Campagne normalize(Campagne campagne) {
+ AssertTools.assertNotNull(campagne);
+ // Unique fields
+ campagne.setNom(normalize(UniqueFieldNormalizer.class, campagne.getNom()));
+ // Autocompleted fields
+ campagne.setProgramme(new StringTransformer(campagne.getProgramme()).replaceConsecutiveWhitespaces()
+ .trimToNull().capitalize().toString());
+ return campagne;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ConfigNameNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ConfigNameNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ConfigNameNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,9 +31,9 @@
*/
public final class ConfigNameNormalizer extends Normalizer<String> {
- /** {@inheritDoc} */
- @Override
- protected String normalize(String uniqueName) {
- return new StringTransformer(uniqueName).replaceConsecutiveWhitespaces().trimToNull().toString();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected String normalize(String uniqueName) {
+ return new StringTransformer(uniqueName).replaceConsecutiveWhitespaces().trimToNull().toString();
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/EmailNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/EmailNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/EmailNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,9 +32,9 @@
*/
public final class EmailNormalizer extends Normalizer<String> {
- /** {@inheritDoc} */
- @Override
- public String normalize(String email) {
- return new StringTransformer(email).trimToNull().toLowerCase().toString();
- }
+ /** {@inheritDoc} */
+ @Override
+ public String normalize(String email) {
+ return new StringTransformer(email).trimToNull().toLowerCase().toString();
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ErreurTestNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ErreurTestNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ErreurTestNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,12 +32,12 @@
*/
public final class ErreurTestNormalizer extends Normalizer<ErreurTestBio> {
- /** {@inheritDoc} */
- @Override
- protected ErreurTestBio normalize(ErreurTestBio erreurTest) {
- AssertTools.assertNotNull(erreurTest);
- // Unique fields
- erreurTest.setNom(Normalizer.normalize(ConfigNameNormalizer.class, erreurTest.getNom()));
- return erreurTest;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected ErreurTestBio normalize(ErreurTestBio erreurTest) {
+ AssertTools.assertNotNull(erreurTest);
+ // Unique fields
+ erreurTest.setNom(Normalizer.normalize(ConfigNameNormalizer.class, erreurTest.getNom()));
+ return erreurTest;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ExtractionNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ExtractionNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/ExtractionNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,16 +33,16 @@
*/
public final class ExtractionNormalizer extends Normalizer<Extraction> {
- /** {@inheritDoc} */
- @Override
- protected Extraction normalize(Extraction extraction) {
- AssertTools.assertNotNull(extraction);
- // Unique fields
- extraction.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, extraction.getRef()));
- for (Extrait curExtrait : extraction.getExtraits()) {
- curExtrait.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, curExtrait.getRef()));
- }
- return extraction;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Extraction normalize(Extraction extraction) {
+ AssertTools.assertNotNull(extraction);
+ // Unique fields
+ extraction.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, extraction.getRef()));
+ for (Extrait curExtrait : extraction.getExtraits()) {
+ curExtrait.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, curExtrait.getRef()));
+ }
+ return extraction;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/LotNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/LotNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/LotNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,12 +33,12 @@
*/
public final class LotNormalizer extends Normalizer<Lot> {
- /** {@inheritDoc} */
- @Override
- protected Lot normalize(Lot lot) {
- AssertTools.assertNotNull(lot);
- // Unique fields
- lot.setRef(normalize(UniqueFieldNormalizer.class, lot.getRef()));
- return lot;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Lot normalize(Lot lot) {
+ AssertTools.assertNotNull(lot);
+ // Unique fields
+ lot.setRef(normalize(UniqueFieldNormalizer.class, lot.getRef()));
+ return lot;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeExtractionNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeExtractionNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeExtractionNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,15 +33,15 @@
*/
public final class MethodeExtractionNormalizer extends Normalizer<MethodeExtraction> {
- /** {@inheritDoc} */
- @Override
- protected MethodeExtraction normalize(MethodeExtraction methodeExtraction) {
- AssertTools.assertNotNull(methodeExtraction);
- // Unique fields
- methodeExtraction.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodeExtraction.getNom()));
- for (TypeExtrait curType : methodeExtraction.getTypesEnSortie()) {
- curType.setInitiales(Normalizer.normalize(ConfigNameNormalizer.class, curType.getInitiales()));
- }
- return methodeExtraction;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected MethodeExtraction normalize(MethodeExtraction methodeExtraction) {
+ AssertTools.assertNotNull(methodeExtraction);
+ // Unique fields
+ methodeExtraction.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodeExtraction.getNom()));
+ for (TypeExtrait curType : methodeExtraction.getTypesEnSortie()) {
+ curType.setInitiales(Normalizer.normalize(ConfigNameNormalizer.class, curType.getInitiales()));
+ }
+ return methodeExtraction;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodePurificationNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodePurificationNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodePurificationNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,16 +33,16 @@
*/
public final class MethodePurificationNormalizer extends Normalizer<MethodePurification> {
- /** {@inheritDoc} */
- @Override
- protected MethodePurification normalize(MethodePurification methodePurification) {
- AssertTools.assertNotNull(methodePurification);
- // Unique fields
- methodePurification.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodePurification.getNom()));
- for (ParamMethoPuri curParam : methodePurification.getParametres()) {
- curParam.setNom(Normalizer.normalize(ConfigNameNormalizer.class, curParam.getNom()));
- }
- return methodePurification;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected MethodePurification normalize(MethodePurification methodePurification) {
+ AssertTools.assertNotNull(methodePurification);
+ // Unique fields
+ methodePurification.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodePurification.getNom()));
+ for (ParamMethoPuri curParam : methodePurification.getParametres()) {
+ curParam.setNom(Normalizer.normalize(ConfigNameNormalizer.class, curParam.getNom()));
+ }
+ return methodePurification;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeTestBioNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeTestBioNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MethodeTestBioNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,21 +33,21 @@
*/
public final class MethodeTestBioNormalizer extends Normalizer<MethodeTestBio> {
- /** {@inheritDoc} */
- @Override
- protected MethodeTestBio normalize(MethodeTestBio methodeTest) {
- AssertTools.assertNotNull(methodeTest);
- // Unique field
- methodeTest.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodeTest.getNom()));
- methodeTest.setCible(Normalizer.normalize(ConfigNameNormalizer.class, methodeTest.getCible()));
- methodeTest.setDomaine(new StringTransformer(methodeTest.getDomaine()).trimToNull()
- .replaceConsecutiveWhitespaces().toString());
- methodeTest.setValeurMesuree(new StringTransformer(methodeTest.getValeurMesuree()).trimToNull()
- .replaceConsecutiveWhitespaces().toString());
- methodeTest.setUniteResultat(new StringTransformer(methodeTest.getUniteResultat()).trimToNull()
- .replaceConsecutiveWhitespaces().toString());
- methodeTest.setCritereActivite(new StringTransformer(methodeTest.getCritereActivite()).trimToNull()
- .replaceConsecutiveWhitespaces().toString());
- return methodeTest;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected MethodeTestBio normalize(MethodeTestBio methodeTest) {
+ AssertTools.assertNotNull(methodeTest);
+ // Unique field
+ methodeTest.setNom(Normalizer.normalize(ConfigNameNormalizer.class, methodeTest.getNom()));
+ methodeTest.setCible(Normalizer.normalize(ConfigNameNormalizer.class, methodeTest.getCible()));
+ methodeTest.setDomaine(new StringTransformer(methodeTest.getDomaine()).trimToNull()
+ .replaceConsecutiveWhitespaces().toString());
+ methodeTest.setValeurMesuree(new StringTransformer(methodeTest.getValeurMesuree()).trimToNull()
+ .replaceConsecutiveWhitespaces().toString());
+ methodeTest.setUniteResultat(new StringTransformer(methodeTest.getUniteResultat()).trimToNull()
+ .replaceConsecutiveWhitespaces().toString());
+ methodeTest.setCritereActivite(new StringTransformer(methodeTest.getCritereActivite()).trimToNull()
+ .replaceConsecutiveWhitespaces().toString());
+ return methodeTest;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MoleculeNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MoleculeNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/MoleculeNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,10 +32,10 @@
*/
public final class MoleculeNormalizer extends Normalizer<Molecule> {
- /** {@inheritDoc} */
- @Override
- protected Molecule normalize(Molecule molecule) {
- AssertTools.assertNotNull(molecule);
- return molecule;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Molecule normalize(Molecule molecule) {
+ AssertTools.assertNotNull(molecule);
+ return molecule;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PartieNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PartieNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PartieNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,12 +33,12 @@
*/
public final class PartieNormalizer extends Normalizer<Partie> {
- /** {@inheritDoc} */
- @Override
- protected Partie normalize(Partie partie) {
- AssertTools.assertNotNull(partie);
- // Unique fields
- partie.setNom(Normalizer.normalize(ConfigNameNormalizer.class, partie.getNom()));
- return partie;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Partie normalize(Partie partie) {
+ AssertTools.assertNotNull(partie);
+ // Unique fields
+ partie.setNom(Normalizer.normalize(ConfigNameNormalizer.class, partie.getNom()));
+ return partie;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PersonneNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PersonneNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PersonneNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,16 +34,16 @@
*/
public final class PersonneNormalizer extends Normalizer<Personne> {
- /** {@inheritDoc} */
- @Override
- public Personne normalize(Personne personne) {
- AssertTools.assertNotNull(personne);
- // Unique fields
- personne.setCourriel(normalize(EmailNormalizer.class, personne.getCourriel()));
- personne.setNom(new StringTransformer(personne.getNom()).replaceAccents().replaceNonAlpha()
- .replaceConsecutiveWhitespaces().trimToNull().toUpperCase().toString());
- personne.setPrenom(new StringTransformer(personne.getPrenom()).replaceAccents().replaceNonAlpha()
- .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
- return personne;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Personne normalize(Personne personne) {
+ AssertTools.assertNotNull(personne);
+ // Unique fields
+ personne.setCourriel(normalize(EmailNormalizer.class, personne.getCourriel()));
+ personne.setNom(new StringTransformer(personne.getNom()).replaceAccents().replaceNonAlpha()
+ .replaceConsecutiveWhitespaces().trimToNull().toUpperCase().toString());
+ personne.setPrenom(new StringTransformer(personne.getPrenom()).replaceAccents().replaceNonAlpha()
+ .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
+ return personne;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PurificationNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PurificationNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/PurificationNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,21 +35,21 @@
*/
public final class PurificationNormalizer extends Normalizer<Purification> {
- /** {@inheritDoc} */
- @Override
- protected Purification normalize(Purification purification) {
- AssertTools.assertNotNull(purification);
- // Unique fields
- purification.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, purification.getRef()));
- for (ParamMethoPuriEffectif param : purification.getParamsMetho()) {
- param.setValeur(new StringTransformer(param.getValeur()).trimToNull().replaceConsecutiveWhitespaces()
- .toString());
- }
- for (Fraction curFraction : purification.getFractions()) {
- curFraction.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, curFraction.getRef()));
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Purification normalize(Purification purification) {
+ AssertTools.assertNotNull(purification);
+ // Unique fields
+ purification.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, purification.getRef()));
+ for (ParamMethoPuriEffectif param : purification.getParamsMetho()) {
+ param.setValeur(new StringTransformer(param.getValeur()).trimToNull().replaceConsecutiveWhitespaces()
+ .toString());
+ }
+ for (Fraction curFraction : purification.getFractions()) {
+ curFraction.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, curFraction.getRef()));
+ }
- return purification;
- }
+ return purification;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/SpecimenNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/SpecimenNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/SpecimenNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,28 +34,28 @@
*/
public final class SpecimenNormalizer extends Normalizer<Specimen> {
- /** {@inheritDoc} */
- @Override
- protected Specimen normalize(Specimen specimen) {
- AssertTools.assertNotNull(specimen);
- // Unique fields
- specimen.setRef(normalize(UniqueFieldNormalizer.class, specimen.getRef()));
+ /** {@inheritDoc} */
+ @Override
+ protected Specimen normalize(Specimen specimen) {
+ AssertTools.assertNotNull(specimen);
+ // Unique fields
+ specimen.setRef(normalize(UniqueFieldNormalizer.class, specimen.getRef()));
- specimen.setEmbranchement(new StringTransformer(specimen.getEmbranchement()).replaceConsecutiveWhitespaces()
- .trimToNull().toLowerCase().capitalize().toString());
- specimen.setFamille(new StringTransformer(specimen.getFamille()).replaceConsecutiveWhitespaces().trimToNull()
- .toLowerCase().capitalize().toString());
- specimen.setGenre(new StringTransformer(specimen.getGenre()).replaceConsecutiveWhitespaces().trimToNull()
- .toLowerCase().capitalize().toString());
- specimen.setEspece(new StringTransformer(specimen.getEspece()).replaceConsecutiveWhitespaces().trimToNull()
- .toLowerCase().toString());
- specimen.setSousEspece(new StringTransformer(specimen.getSousEspece()).replaceConsecutiveWhitespaces()
- .trimToNull().toLowerCase().toString());
- specimen.setVariete(new StringTransformer(specimen.getVariete()).replaceConsecutiveWhitespaces().trimToNull()
- .toLowerCase().toString());
- specimen.setLieuDepot(new StringTransformer(specimen.getLieuDepot()).trimToNull()
- .replaceConsecutiveWhitespaces().toString());
+ specimen.setEmbranchement(new StringTransformer(specimen.getEmbranchement()).replaceConsecutiveWhitespaces()
+ .trimToNull().toLowerCase().capitalize().toString());
+ specimen.setFamille(new StringTransformer(specimen.getFamille()).replaceConsecutiveWhitespaces().trimToNull()
+ .toLowerCase().capitalize().toString());
+ specimen.setGenre(new StringTransformer(specimen.getGenre()).replaceConsecutiveWhitespaces().trimToNull()
+ .toLowerCase().capitalize().toString());
+ specimen.setEspece(new StringTransformer(specimen.getEspece()).replaceConsecutiveWhitespaces().trimToNull()
+ .toLowerCase().toString());
+ specimen.setSousEspece(new StringTransformer(specimen.getSousEspece()).replaceConsecutiveWhitespaces()
+ .trimToNull().toLowerCase().toString());
+ specimen.setVariete(new StringTransformer(specimen.getVariete()).replaceConsecutiveWhitespaces().trimToNull()
+ .toLowerCase().toString());
+ specimen.setLieuDepot(new StringTransformer(specimen.getLieuDepot()).trimToNull()
+ .replaceConsecutiveWhitespaces().toString());
- return specimen;
- }
+ return specimen;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/StationNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/StationNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/StationNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,15 +34,15 @@
*/
public final class StationNormalizer extends Normalizer<Station> {
- /** {@inheritDoc} */
- @Override
- protected Station normalize(Station station) {
- AssertTools.assertNotNull(station);
- // Unique fields
- station.setNom(normalize(UniqueFieldNormalizer.class, station.getNom()));
- // Autocompleted fields
- station.setLocalite(new StringTransformer(station.getLocalite()).replaceConsecutiveWhitespaces().trimToNull()
- .capitalizeFully().toString());
- return station;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Station normalize(Station station) {
+ AssertTools.assertNotNull(station);
+ // Unique fields
+ station.setNom(normalize(UniqueFieldNormalizer.class, station.getNom()));
+ // Autocompleted fields
+ station.setLocalite(new StringTransformer(station.getLocalite()).replaceConsecutiveWhitespaces().trimToNull()
+ .capitalizeFully().toString());
+ return station;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TestBioNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TestBioNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TestBioNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,22 +34,22 @@
*/
public final class TestBioNormalizer extends Normalizer<TestBio> {
- /** {@inheritDoc} */
- @Override
- protected TestBio normalize(TestBio testBio) {
- AssertTools.assertNotNull(testBio);
- // Unique fields
- testBio.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, testBio.getRef()));
- // Autocomplete field
- testBio.setOrganismeTesteur(new StringTransformer(testBio.getOrganismeTesteur())
- .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
- for (ResultatTestBio curResult : testBio.getResultats()) {
- curResult.setRepere(Normalizer.normalize(UniqueFieldNormalizer.class, curResult.getRepere()));
- // Autocomplete field
- curResult.setProduitTemoin(new StringTransformer(curResult.getProduitTemoin())
- .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
- }
+ /** {@inheritDoc} */
+ @Override
+ protected TestBio normalize(TestBio testBio) {
+ AssertTools.assertNotNull(testBio);
+ // Unique fields
+ testBio.setRef(Normalizer.normalize(UniqueFieldNormalizer.class, testBio.getRef()));
+ // Autocomplete field
+ testBio.setOrganismeTesteur(new StringTransformer(testBio.getOrganismeTesteur())
+ .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
+ for (ResultatTestBio curResult : testBio.getResultats()) {
+ curResult.setRepere(Normalizer.normalize(UniqueFieldNormalizer.class, curResult.getRepere()));
+ // Autocomplete field
+ curResult.setProduitTemoin(new StringTransformer(curResult.getProduitTemoin())
+ .replaceConsecutiveWhitespaces().trimToNull().capitalizeFully().toString());
+ }
- return testBio;
- }
+ return testBio;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TypeDocumentNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TypeDocumentNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/TypeDocumentNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,12 +32,12 @@
*/
public final class TypeDocumentNormalizer extends Normalizer<TypeDocument> {
- /** {@inheritDoc} */
- @Override
- protected TypeDocument normalize(TypeDocument typeDocument) {
- AssertTools.assertNotNull(typeDocument);
- // Unique field
- typeDocument.setNom(Normalizer.normalize(ConfigNameNormalizer.class, typeDocument.getNom()));
- return typeDocument;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected TypeDocument normalize(TypeDocument typeDocument) {
+ AssertTools.assertNotNull(typeDocument);
+ // Unique field
+ typeDocument.setNom(Normalizer.normalize(ConfigNameNormalizer.class, typeDocument.getNom()));
+ return typeDocument;
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/UniqueFieldNormalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/UniqueFieldNormalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/UniqueFieldNormalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,10 +31,10 @@
*/
public final class UniqueFieldNormalizer extends Normalizer<String> {
- /** {@inheritDoc} */
- @Override
- protected String normalize(String uniqueName) {
- return new StringTransformer(uniqueName).replaceAccents().replaceConsecutiveWhitespacesByUnderscore()
- .toUpperCase().trimToNull().toString();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected String normalize(String uniqueName) {
+ return new StringTransformer(uniqueName).replaceAccents().replaceConsecutiveWhitespacesByUnderscore()
+ .toUpperCase().trimToNull().toString();
+ }
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalize.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalize.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalize.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,8 +35,8 @@
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface Normalize {
- /**
- * @return Normalizer to use
- */
- Class<? extends Normalizer<?>> value();
+ /**
+ * @return Normalizer to use
+ */
+ Class<? extends Normalizer<?>> value();
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalizer.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalizer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/Normalizer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,45 +39,45 @@
*/
public abstract class Normalizer<O> {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Normalizers cache: normalizerClass + normalizer */
- private static final Map<Class<? extends Normalizer<?>>, Normalizer<?>> NORMALIZERS = Collections
- .synchronizedMap(new HashMap<Class<? extends Normalizer<?>>, Normalizer<?>>());
+ /** Normalizers cache: normalizerClass + normalizer */
+ private static final Map<Class<? extends Normalizer<?>>, Normalizer<?>> NORMALIZERS = Collections
+ .synchronizedMap(new HashMap<Class<? extends Normalizer<?>>, Normalizer<?>>());
- /**
- * Normalize data
- * @param <T> Data type
- * @param normalizerClass Normalizer class
- * @param object Data object
- * @return Normalized data
- */
- @SuppressWarnings("unchecked")
- public static <T> T normalize(Class<? extends Normalizer<T>> normalizerClass, T object) {
- Normalizer<T> normalizer;
- synchronized (NORMALIZERS) {
- normalizer = (Normalizer<T>) NORMALIZERS.get(normalizerClass);
- if (normalizer == null) {
- try {
- normalizer = normalizerClass.newInstance();
- } catch (InstantiationException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (IllegalAccessException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- NORMALIZERS.put(normalizerClass, normalizer);
- }
- }
- return normalizer.normalize(object);
- }
+ /**
+ * Normalize data
+ * @param <T> Data type
+ * @param normalizerClass Normalizer class
+ * @param object Data object
+ * @return Normalized data
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T normalize(Class<? extends Normalizer<T>> normalizerClass, T object) {
+ Normalizer<T> normalizer;
+ synchronized (NORMALIZERS) {
+ normalizer = (Normalizer<T>) NORMALIZERS.get(normalizerClass);
+ if (normalizer == null) {
+ try {
+ normalizer = normalizerClass.newInstance();
+ } catch (InstantiationException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (IllegalAccessException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ NORMALIZERS.put(normalizerClass, normalizer);
+ }
+ }
+ return normalizer.normalize(object);
+ }
- /**
- * Normalize data
- * @param object Data object
- * @return Normalized data object
- */
- protected abstract O normalize(O object);
+ /**
+ * Normalize data
+ * @param object Data object
+ * @return Normalized data object
+ */
+ protected abstract O normalize(O object);
}
Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/NormalizerAspect.java
===================================================================
--- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/NormalizerAspect.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/utils/normalizers/utils/NormalizerAspect.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,33 +44,33 @@
@Component
public final class NormalizerAspect {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /**
- * Automatically normalizes data by wrapping methods with Normalize annotation on its parameters
- * @param joinPoint Joint point
- * @return Return of the method
- * @throws Throwable Throwable
- */
- @SuppressWarnings("unchecked")
- @Around("execution(* nc.ird.cantharella.service.services.*Service.*(..,@Normalize (*),..))")
- public Object normalize(ProceedingJoinPoint joinPoint) throws Throwable {
- Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
- // LOG.debug(method.getDeclaringClass().getSimpleName() + "." + method.getName() + "("
- // + Arrays.asList(method.getParameterTypes()) + ")");
- Object[] args = joinPoint.getArgs();
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- for (int i = 0; i < parameterAnnotations.length; ++i) {
- for (Annotation annotation : parameterAnnotations[i]) {
- if (annotation instanceof Normalize) {
- args[i] = Normalizer.normalize((Class<Normalizer<Object>>) ((Normalize) annotation).value(),
- args[i]);
- LOG.debug("normalize : '" + args[i] + "' in " + method.getDeclaringClass().getSimpleName() + "."
- + method.getName() + "(" + Arrays.asList(method.getParameterTypes()) + ")");
- }
- }
- }
- return joinPoint.proceed(args);
- }
+ /**
+ * Automatically normalizes data by wrapping methods with Normalize annotation on its parameters
+ * @param joinPoint Joint point
+ * @return Return of the method
+ * @throws Throwable Throwable
+ */
+ @SuppressWarnings("unchecked")
+ @Around("execution(* nc.ird.cantharella.service.services.*Service.*(..,@Normalize (*),..))")
+ public Object normalize(ProceedingJoinPoint joinPoint) throws Throwable {
+ Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
+ // LOG.debug(method.getDeclaringClass().getSimpleName() + "." + method.getName() + "("
+ // + Arrays.asList(method.getParameterTypes()) + ")");
+ Object[] args = joinPoint.getArgs();
+ Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+ for (int i = 0; i < parameterAnnotations.length; ++i) {
+ for (Annotation annotation : parameterAnnotations[i]) {
+ if (annotation instanceof Normalize) {
+ args[i] = Normalizer.normalize((Class<Normalizer<Object>>) ((Normalize) annotation).value(),
+ args[i]);
+ LOG.debug("normalize : '" + args[i] + "' in " + method.getDeclaringClass().getSimpleName() + "."
+ + method.getName() + "(" + Arrays.asList(method.getParameterTypes()) + ")");
+ }
+ }
+ }
+ return joinPoint.proceed(args);
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/AbstractServiceTest.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/AbstractServiceTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/AbstractServiceTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,11 +45,11 @@
@Transactional
public abstract class AbstractServiceTest extends AbstractTransactionalJUnit4SpringContextTests {
- /**
- * Initialization
- */
- @Before
- public void setUp() {
- applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
- }
+ /**
+ * Initialization
+ */
+ @Before
+ public void setUp() {
+ applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/ServiceContextTest.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/ServiceContextTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/ServiceContextTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,11 +30,11 @@
*/
public final class ServiceContextTest extends AbstractServiceTest {
- /**
- * Test context
- */
- @Test
- public void context() {
- //
- }
+ /**
+ * Test context
+ */
+ @Test
+ public void context() {
+ //
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/exceptions/ExcelImportException.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/exceptions/ExcelImportException.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/exceptions/ExcelImportException.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,21 +30,21 @@
*/
public class ExcelImportException extends AbstractException {
- /**
- * Constructor
- * @param message Message
- */
- public ExcelImportException(String message) {
- super(message);
- }
+ /**
+ * Constructor
+ * @param message Message
+ */
+ public ExcelImportException(String message) {
+ super(message);
+ }
- /**
- * Constructor
- * @param message Message
- * @param cause Cause
- */
- public ExcelImportException(String message, Exception cause) {
- super(message, cause);
- }
+ /**
+ * Constructor
+ * @param message Message
+ * @param cause Cause
+ */
+ public ExcelImportException(String message, Exception cause) {
+ super(message, cause);
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/services/PersonneServiceTest.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/services/PersonneServiceTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/services/PersonneServiceTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,28 +38,28 @@
*/
public final class PersonneServiceTest extends AbstractServiceTest {
- /** Personne service */
- @Autowired
- private PersonneService personneService;
+ /** Personne service */
+ @Autowired
+ private PersonneService personneService;
- /**
- * Test: checkOrCreateAdmin
- * @throws DataConstraintException -
- */
- @Test
- public void checkOrCreateAdmin() throws DataConstraintException {
- personneService.checkOrCreateAdmin();
- }
+ /**
+ * Test: checkOrCreateAdmin
+ * @throws DataConstraintException -
+ */
+ @Test
+ public void checkOrCreateAdmin() throws DataConstraintException {
+ personneService.checkOrCreateAdmin();
+ }
- /**
- * Test: load
- * @throws DataNotFoundException -
- * @throws DataConstraintException
- */
- @Test
- public void load() throws DataNotFoundException, DataConstraintException {
- personneService.checkOrCreateAdmin();
- List<Personne> personnes = personneService.listPersonnes();
- personneService.loadPersonne(personnes.get(0).getCourriel().toUpperCase());
- }
+ /**
+ * Test: load
+ * @throws DataNotFoundException -
+ * @throws DataConstraintException
+ */
+ @Test
+ public void load() throws DataNotFoundException, DataConstraintException {
+ personneService.checkOrCreateAdmin();
+ List<Personne> personnes = personneService.listPersonnes();
+ personneService.loadPersonne(personnes.get(0).getCourriel().toUpperCase());
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnStructure.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnStructure.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnStructure.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -28,41 +28,41 @@
*/
public class ExcelColumnStructure {
- /** Name of the column **/
- public String name;
+ /** Name of the column **/
+ public String name;
- /**
- * Different type of value used for the importation
- */
- public enum ExcelColumnType {
- /** string **/
- STRING,
- /** integer **/
- INTEGER,
- /** float number **/
- REEL,
- /** date **/
- DATE,
- /** boolean **/
- BOOLEAN
- }
+ /**
+ * Different type of value used for the importation
+ */
+ public enum ExcelColumnType {
+ /** string **/
+ STRING,
+ /** integer **/
+ INTEGER,
+ /** float number **/
+ REEL,
+ /** date **/
+ DATE,
+ /** boolean **/
+ BOOLEAN
+ }
- /** Type of the column **/
- public ExcelColumnType type;
+ /** Type of the column **/
+ public ExcelColumnType type;
- /** If a value is required for each row of that column */
- public boolean required;
+ /** If a value is required for each row of that column */
+ public boolean required;
- /**
- * Constructor
- * @param name Name of the column
- * @param type Type of the column
- * @param required If a value is required for each row of that column
- */
- public ExcelColumnStructure(String name, ExcelColumnType type, boolean required) {
- this.name = name;
- this.type = type;
- this.required = required;
- }
+ /**
+ * Constructor
+ * @param name Name of the column
+ * @param type Type of the column
+ * @param required If a value is required for each row of that column
+ */
+ public ExcelColumnStructure(String name, ExcelColumnType type, boolean required) {
+ this.name = name;
+ this.type = type;
+ this.required = required;
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnsReader.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnsReader.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelColumnsReader.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,312 +49,312 @@
*/
public final class ExcelColumnsReader {
- /** True value in string **/
- private final static String TRUE_STRING = "true";
+ /** True value in string **/
+ private final static String TRUE_STRING = "true";
- /** False value in string **/
- private final static String FALSE_STRING = "false";
+ /** False value in string **/
+ private final static String FALSE_STRING = "false";
- /** Excel workbook which contain sheets of information **/
- private HSSFWorkbook workbook;
+ /** Excel workbook which contain sheets of information **/
+ private HSSFWorkbook workbook;
- /** current structure sheet browsed */
- private ExcelSheetStructure currentSheetStructure;
+ /** current structure sheet browsed */
+ private ExcelSheetStructure currentSheetStructure;
- /** Index of the current line of the current sheet **/
- private int currentNumLine;
+ /** Index of the current line of the current sheet **/
+ private int currentNumLine;
- /** Structure asked for the Excel file **/
- private List<ExcelSheetStructure> excelStructureAsked;
+ /** Structure asked for the Excel file **/
+ private List<ExcelSheetStructure> excelStructureAsked;
- /**
- * Give indexes of a sheet's columns. Access by the name of the sheet then by the name of the column
- **/
- private Map<String, Map<String, Integer>> columnsIndexes;
+ /**
+ * Give indexes of a sheet's columns. Access by the name of the sheet then by the name of the column
+ **/
+ private Map<String, Map<String, Integer>> columnsIndexes;
- /**
- * Constructor
- * @param inputStream Stream which contain Excel data
- * @param fileStructureAsked Structure asked for the Excel file
- * @throws IOException -
- * @throws ExcelImportException -
- */
- public ExcelColumnsReader(InputStream inputStream, List<ExcelSheetStructure> fileStructureAsked)
- throws IOException, ExcelImportException {
- POIFSFileSystem file = new POIFSFileSystem(inputStream);
- workbook = new HSSFWorkbook(file);
+ /**
+ * Constructor
+ * @param inputStream Stream which contain Excel data
+ * @param fileStructureAsked Structure asked for the Excel file
+ * @throws IOException -
+ * @throws ExcelImportException -
+ */
+ public ExcelColumnsReader(InputStream inputStream, List<ExcelSheetStructure> fileStructureAsked)
+ throws IOException, ExcelImportException {
+ POIFSFileSystem file = new POIFSFileSystem(inputStream);
+ workbook = new HSSFWorkbook(file);
- if (fileStructureAsked.isEmpty()) {
- throw new ExcelImportException("The structure given to the Excel Reader doesn't contain any sheet");
- }
- this.excelStructureAsked = fileStructureAsked;
+ if (fileStructureAsked.isEmpty()) {
+ throw new ExcelImportException("The structure given to the Excel Reader doesn't contain any sheet");
+ }
+ this.excelStructureAsked = fileStructureAsked;
- currentSheetStructure = fileStructureAsked.get(0);
- currentNumLine = workbook.getSheet(currentSheetStructure.name).getFirstRowNum();
+ currentSheetStructure = fileStructureAsked.get(0);
+ currentNumLine = workbook.getSheet(currentSheetStructure.name).getFirstRowNum();
- columnsIndexes = new HashMap<String, Map<String, Integer>>();
+ columnsIndexes = new HashMap<String, Map<String, Integer>>();
- findIndexesColumns();
- }
+ findIndexesColumns();
+ }
- /**
- * Return the names of the autorized sheet (according to the structure given at the reader)
- * @return this names
- */
- public List<String> getSheetNames() {
- List<String> names = new ArrayList<String>();
- for (ExcelSheetStructure curSheetStruct : excelStructureAsked) {
- names.add(curSheetStruct.name);
- }
- return names;
- }
+ /**
+ * Return the names of the autorized sheet (according to the structure given at the reader)
+ * @return this names
+ */
+ public List<String> getSheetNames() {
+ List<String> names = new ArrayList<String>();
+ for (ExcelSheetStructure curSheetStruct : excelStructureAsked) {
+ names.add(curSheetStruct.name);
+ }
+ return names;
+ }
- /**
- * Find the index for each column name (in the first row) of each sheet of the given structure file
- * @throws ExcelImportException if a sheet or a column name is not found
- */
- private void findIndexesColumns() throws ExcelImportException {
+ /**
+ * Find the index for each column name (in the first row) of each sheet of the given structure file
+ * @throws ExcelImportException if a sheet or a column name is not found
+ */
+ private void findIndexesColumns() throws ExcelImportException {
- for (ExcelSheetStructure structAsked : excelStructureAsked) {
- HSSFSheet curSheet = workbook.getSheet(structAsked.name);
- // verify the existance of the sheet
- if (curSheet == null) {
- throw new ExcelImportException("'" + structAsked.name + "' sheet not found in the specified Excel file");
- }
+ for (ExcelSheetStructure structAsked : excelStructureAsked) {
+ HSSFSheet curSheet = workbook.getSheet(structAsked.name);
+ // verify the existance of the sheet
+ if (curSheet == null) {
+ throw new ExcelImportException("'" + structAsked.name + "' sheet not found in the specified Excel file");
+ }
- columnsIndexes.put(structAsked.name, new HashMap<String, Integer>());
- // verify the existance of the sheet columns
- for (ExcelColumnStructure col : structAsked.columns) {
- // get the header line
- HSSFRow header = curSheet.getRow(curSheet.getFirstRowNum());
- AssertTools.assertNotNull(header);
+ columnsIndexes.put(structAsked.name, new HashMap<String, Integer>());
+ // verify the existance of the sheet columns
+ for (ExcelColumnStructure col : structAsked.columns) {
+ // get the header line
+ HSSFRow header = curSheet.getRow(curSheet.getFirstRowNum());
+ AssertTools.assertNotNull(header);
- int i = header.getFirstCellNum();
- HSSFCell curCell = header.getCell(i);
+ int i = header.getFirstCellNum();
+ HSSFCell curCell = header.getCell(i);
- boolean columnFinded = false;
- // look for the colName in the header (blank cell terminate the header)
- while (!columnFinded && curCell != null && curCell.getCellType() != Cell.CELL_TYPE_BLANK) {
- if (curCell.getStringCellValue().trim().toLowerCase().equals(col.name.toLowerCase())) {
- columnFinded = true;
- } else {
- i++;
- curCell = header.getCell(i);
- }
- }
+ boolean columnFinded = false;
+ // look for the colName in the header (blank cell terminate the header)
+ while (!columnFinded && curCell != null && curCell.getCellType() != Cell.CELL_TYPE_BLANK) {
+ if (curCell.getStringCellValue().trim().toLowerCase().equals(col.name.toLowerCase())) {
+ columnFinded = true;
+ } else {
+ i++;
+ curCell = header.getCell(i);
+ }
+ }
- if (!columnFinded) {
- throw new ExcelImportException("'" + col.name + "' not found in the header of the '"
- + structAsked.name + "' sheet");
- }
+ if (!columnFinded) {
+ throw new ExcelImportException("'" + col.name + "' not found in the header of the '"
+ + structAsked.name + "' sheet");
+ }
- // update of the index in the map
- columnsIndexes.get(structAsked.name).put(col.name, i);
- }
- }
- }
+ // update of the index in the map
+ columnsIndexes.get(structAsked.name).put(col.name, i);
+ }
+ }
+ }
- /**
- * Move to the beggining of the given sheet and return the structure of its columns
- * @param sheetName name of the sheet
- * @return the list of the columns of the sheet according to the structure given to the Excel Reader
- * @throws ExcelImportException if the sheet is not autorized according to the structure given to the Excel Reader
- */
- public List<ExcelColumnStructure> selectSheet(String sheetName) throws ExcelImportException {
+ /**
+ * Move to the beggining of the given sheet and return the structure of its columns
+ * @param sheetName name of the sheet
+ * @return the list of the columns of the sheet according to the structure given to the Excel Reader
+ * @throws ExcelImportException if the sheet is not autorized according to the structure given to the Excel Reader
+ */
+ public List<ExcelColumnStructure> selectSheet(String sheetName) throws ExcelImportException {
- Iterator<ExcelSheetStructure> itStructSheet = excelStructureAsked.iterator();
+ Iterator<ExcelSheetStructure> itStructSheet = excelStructureAsked.iterator();
- while (itStructSheet.hasNext()) {
- ExcelSheetStructure structSheet = itStructSheet.next();
- if (sheetName != null && sheetName.equals(structSheet.name)) {
- currentSheetStructure = structSheet;
- // +1 for the second line
- currentNumLine = workbook.getSheet(currentSheetStructure.name).getFirstRowNum() + 1;
- return structSheet.columns;
- }
- }
+ while (itStructSheet.hasNext()) {
+ ExcelSheetStructure structSheet = itStructSheet.next();
+ if (sheetName != null && sheetName.equals(structSheet.name)) {
+ currentSheetStructure = structSheet;
+ // +1 for the second line
+ currentNumLine = workbook.getSheet(currentSheetStructure.name).getFirstRowNum() + 1;
+ return structSheet.columns;
+ }
+ }
- throw new ExcelImportException("'" + sheetName
- + "' is not autorized according to the structure given to the Excel Reader");
- }
+ throw new ExcelImportException("'" + sheetName
+ + "' is not autorized according to the structure given to the Excel Reader");
+ }
- /**
- * Read a line of the Excel file current sheet Read the columns specified to the structure given to Excel Reader
- * @return A map which represent a line with the name of column as key
- * @throws ExcelImportException If error in retrieving a cell value
- */
- public Map<String, Object> readLine() throws ExcelImportException {
- Map<String, Object> line = new HashMap<String, Object>();
+ /**
+ * Read a line of the Excel file current sheet Read the columns specified to the structure given to Excel Reader
+ * @return A map which represent a line with the name of column as key
+ * @throws ExcelImportException If error in retrieving a cell value
+ */
+ public Map<String, Object> readLine() throws ExcelImportException {
+ Map<String, Object> line = new HashMap<String, Object>();
- HSSFRow row = workbook.getSheet(currentSheetStructure.name).getRow(currentNumLine);
- if (row != null) {
- for (ExcelColumnStructure curCol : currentSheetStructure.columns) {
- Integer indCol = columnsIndexes.get(currentSheetStructure.name).get(curCol.name);
- Object cellVal = null;
- try {
- cellVal = checkColumnValue(getCellValue(row.getCell(indCol)), curCol);
- } catch (ExcelImportException e) {
- throw new ExcelImportException("Error in retrieving the cell value : sheet '"
- + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
- + curCol.name + "'", e);
- } catch (RuntimeException e) {
- throw new ExcelImportException("Error in retrieving the cell value : sheet '"
- + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
- + curCol.name + "'", e);
- }
+ HSSFRow row = workbook.getSheet(currentSheetStructure.name).getRow(currentNumLine);
+ if (row != null) {
+ for (ExcelColumnStructure curCol : currentSheetStructure.columns) {
+ Integer indCol = columnsIndexes.get(currentSheetStructure.name).get(curCol.name);
+ Object cellVal = null;
+ try {
+ cellVal = checkColumnValue(getCellValue(row.getCell(indCol)), curCol);
+ } catch (ExcelImportException e) {
+ throw new ExcelImportException("Error in retrieving the cell value : sheet '"
+ + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
+ + curCol.name + "'", e);
+ } catch (RuntimeException e) {
+ throw new ExcelImportException("Error in retrieving the cell value : sheet '"
+ + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
+ + curCol.name + "'", e);
+ }
- line.put(curCol.name, cellVal);
- }
- currentNumLine++;
- }
- return line;
- }
+ line.put(curCol.name, cellVal);
+ }
+ currentNumLine++;
+ }
+ return line;
+ }
- /**
- * Check the cell value type according its column definition from the structure given at the Excel Reader If it's
- * possible, convert the cell value in the right type
- * @param cellValue The source value
- * @param curCol The column definition
- * @return The value in the right type
- * @throws ExcelImportException If the cellValue doesn't respect the expected type
- */
- private Object checkColumnValue(Object cellValue, ExcelColumnStructure curCol) throws ExcelImportException {
- // check is it required and no value
- if (cellValue == null && curCol.required) {
- throw new ExcelImportException("Value required for the cell value : sheet '" + currentSheetStructure.name
- + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
- }
- // check the good type of value
- switch (curCol.type) {
- case STRING:
- if (cellValue instanceof Double) {
- Double doubleVal = (Double) cellValue;
- if (new Double(Math.round(doubleVal)) == doubleVal) {
- // if no float part
- return doubleVal.toString();
- }
- // with float part
- String strVal = doubleVal.toString();
- return strVal.substring(0, strVal.length() - 2);
- }
- // if not a numeric
- if (cellValue == null) {
- return "";
- }
- return cellValue.toString();
- case REEL:
- if (cellValue instanceof Double) {
- return cellValue;
- }
- // if not a numeric, exception
- throw new ExcelImportException("The cell value must be a reel : sheet '" + currentSheetStructure.name
- + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
- case INTEGER:
- if (cellValue instanceof Double) {
- Double doubleVal = (Double) cellValue;
- if (new Double(Math.round(doubleVal)) == doubleVal) {
- // if it's an integer, ok
- return doubleVal.intValue();
- }
- // if it's a float
- throw new ExcelImportException("The cell value must be a integer : sheet '"
- + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
- + curCol.name + "'");
- }
- throw new ExcelImportException("The cell value must be a integer : sheet '"
- + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
- + curCol.name + "'");
- case DATE:
- if (cellValue instanceof Date) {
- return cellValue;
- }
- // is it's not a date
- throw new ExcelImportException("The cell value must be a date : sheet '" + currentSheetStructure.name
- + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
- case BOOLEAN:
- if (cellValue instanceof Boolean) {
- return cellValue;
- } else if (cellValue instanceof String
- && (StringUtils.lowerCase(StringUtils.trim(TRUE_STRING)).equals(
- StringUtils.lowerCase(StringUtils.trim((String) cellValue))) || StringUtils.lowerCase(
- StringUtils.trim(FALSE_STRING)).equals(
- StringUtils.lowerCase(StringUtils.trim((String) cellValue))))) {
- // if "true" or "false" are written in string
- if (StringUtils.lowerCase(StringUtils.trim(TRUE_STRING)).equals(
- StringUtils.lowerCase(StringUtils.trim((String) cellValue)))) {
- return true;
- }
- return false;
- }
- // is it's not boolean or a string
- throw new ExcelImportException("The cell value must be a date : sheet '" + currentSheetStructure.name
- + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
- }
- // for compiler
- return null;
- }
+ /**
+ * Check the cell value type according its column definition from the structure given at the Excel Reader If it's
+ * possible, convert the cell value in the right type
+ * @param cellValue The source value
+ * @param curCol The column definition
+ * @return The value in the right type
+ * @throws ExcelImportException If the cellValue doesn't respect the expected type
+ */
+ private Object checkColumnValue(Object cellValue, ExcelColumnStructure curCol) throws ExcelImportException {
+ // check is it required and no value
+ if (cellValue == null && curCol.required) {
+ throw new ExcelImportException("Value required for the cell value : sheet '" + currentSheetStructure.name
+ + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
+ }
+ // check the good type of value
+ switch (curCol.type) {
+ case STRING:
+ if (cellValue instanceof Double) {
+ Double doubleVal = (Double) cellValue;
+ if (new Double(Math.round(doubleVal)) == doubleVal) {
+ // if no float part
+ return doubleVal.toString();
+ }
+ // with float part
+ String strVal = doubleVal.toString();
+ return strVal.substring(0, strVal.length() - 2);
+ }
+ // if not a numeric
+ if (cellValue == null) {
+ return "";
+ }
+ return cellValue.toString();
+ case REEL:
+ if (cellValue instanceof Double) {
+ return cellValue;
+ }
+ // if not a numeric, exception
+ throw new ExcelImportException("The cell value must be a reel : sheet '" + currentSheetStructure.name
+ + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
+ case INTEGER:
+ if (cellValue instanceof Double) {
+ Double doubleVal = (Double) cellValue;
+ if (new Double(Math.round(doubleVal)) == doubleVal) {
+ // if it's an integer, ok
+ return doubleVal.intValue();
+ }
+ // if it's a float
+ throw new ExcelImportException("The cell value must be a integer : sheet '"
+ + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
+ + curCol.name + "'");
+ }
+ throw new ExcelImportException("The cell value must be a integer : sheet '"
+ + currentSheetStructure.name + "', line " + Integer.toString(currentNumLine) + ", column '"
+ + curCol.name + "'");
+ case DATE:
+ if (cellValue instanceof Date) {
+ return cellValue;
+ }
+ // is it's not a date
+ throw new ExcelImportException("The cell value must be a date : sheet '" + currentSheetStructure.name
+ + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
+ case BOOLEAN:
+ if (cellValue instanceof Boolean) {
+ return cellValue;
+ } else if (cellValue instanceof String
+ && (StringUtils.lowerCase(StringUtils.trim(TRUE_STRING)).equals(
+ StringUtils.lowerCase(StringUtils.trim((String) cellValue))) || StringUtils.lowerCase(
+ StringUtils.trim(FALSE_STRING)).equals(
+ StringUtils.lowerCase(StringUtils.trim((String) cellValue))))) {
+ // if "true" or "false" are written in string
+ if (StringUtils.lowerCase(StringUtils.trim(TRUE_STRING)).equals(
+ StringUtils.lowerCase(StringUtils.trim((String) cellValue)))) {
+ return true;
+ }
+ return false;
+ }
+ // is it's not boolean or a string
+ throw new ExcelImportException("The cell value must be a date : sheet '" + currentSheetStructure.name
+ + "', line " + Integer.toString(currentNumLine) + ", column '" + curCol.name + "'");
+ }
+ // for compiler
+ return null;
+ }
- /**
- * Get the value of the specified cell
- * @param cell the cell
- * @return this value according to the type of the cell<br/>
- * (BLANK -> null, STRING -> String, NUMERIC -> Double, BOOLEAN -> Boolean, FORMULA -> Double, ERROR -> exception)
- * @throws ExcelImportException Exception if error cell or formula don't get a numeric value
- */
- private Object getCellValue(HSSFCell cell) throws ExcelImportException {
- if (cell == null) {
- return null;
- }
+ /**
+ * Get the value of the specified cell
+ * @param cell the cell
+ * @return this value according to the type of the cell<br/>
+ * (BLANK -> null, STRING -> String, NUMERIC -> Double, BOOLEAN -> Boolean, FORMULA -> Double, ERROR -> exception)
+ * @throws ExcelImportException Exception if error cell or formula don't get a numeric value
+ */
+ private Object getCellValue(HSSFCell cell) throws ExcelImportException {
+ if (cell == null) {
+ return null;
+ }
- switch (cell.getCellType()) {
- case Cell.CELL_TYPE_BLANK:
- return null;
- case Cell.CELL_TYPE_STRING:
- return cell.getStringCellValue();
- case Cell.CELL_TYPE_NUMERIC:
- if (DateUtil.isCellDateFormatted(cell)) {
- // if it's a date
- return DateUtil.getJavaDate(cell.getNumericCellValue());
- }
- return cell.getNumericCellValue();
- case Cell.CELL_TYPE_BOOLEAN:
- return cell.getBooleanCellValue();
- case Cell.CELL_TYPE_FORMULA:
- Double numeric = cell.getNumericCellValue();
+ switch (cell.getCellType()) {
+ case Cell.CELL_TYPE_BLANK:
+ return null;
+ case Cell.CELL_TYPE_STRING:
+ return cell.getStringCellValue();
+ case Cell.CELL_TYPE_NUMERIC:
+ if (DateUtil.isCellDateFormatted(cell)) {
+ // if it's a date
+ return DateUtil.getJavaDate(cell.getNumericCellValue());
+ }
+ return cell.getNumericCellValue();
+ case Cell.CELL_TYPE_BOOLEAN:
+ return cell.getBooleanCellValue();
+ case Cell.CELL_TYPE_FORMULA:
+ Double numeric = cell.getNumericCellValue();
- if (numeric.isNaN()) {
- // if it's "Not a Number", exception
- throw new ExcelImportException("Impossible to get a numeric value from the formula");
- }
- return numeric;
- case Cell.CELL_TYPE_ERROR:
- throw new ExcelImportException("Error cell detected");
- }
- // no case for this return
- return null;
- }
+ if (numeric.isNaN()) {
+ // if it's "Not a Number", exception
+ throw new ExcelImportException("Impossible to get a numeric value from the formula");
+ }
+ return numeric;
+ case Cell.CELL_TYPE_ERROR:
+ throw new ExcelImportException("Error cell detected");
+ }
+ // no case for this return
+ return null;
+ }
- /**
- * fileStructureAsked getter
- * @return fileStructureAsked
- */
- public List<ExcelSheetStructure> getFileStructureAsked() {
- return excelStructureAsked;
- }
+ /**
+ * fileStructureAsked getter
+ * @return fileStructureAsked
+ */
+ public List<ExcelSheetStructure> getFileStructureAsked() {
+ return excelStructureAsked;
+ }
- /**
- * fileStructureAsked setter
- * @param fileStructureAsked fileStructureAsked
- */
- public void setFileStructureAsked(List<ExcelSheetStructure> fileStructureAsked) {
- this.excelStructureAsked = fileStructureAsked;
- }
+ /**
+ * fileStructureAsked setter
+ * @param fileStructureAsked fileStructureAsked
+ */
+ public void setFileStructureAsked(List<ExcelSheetStructure> fileStructureAsked) {
+ this.excelStructureAsked = fileStructureAsked;
+ }
- /**
- * currentNumLine getter
- * @return currentNumLine
- */
- public int getCurrentNumLine() {
- return currentNumLine;
- }
+ /**
+ * currentNumLine getter
+ * @return currentNumLine
+ */
+ public int getCurrentNumLine() {
+ return currentNumLine;
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelSheetStructure.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelSheetStructure.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/ExcelSheetStructure.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,19 +30,19 @@
*/
public final class ExcelSheetStructure {
- /** Name of the sheet **/
- public String name;
+ /** Name of the sheet **/
+ public String name;
- /** Sheet's columns **/
- public List<ExcelColumnStructure> columns;
+ /** Sheet's columns **/
+ public List<ExcelColumnStructure> columns;
- /**
- * Constructor
- * @param name The name of the sheet
- * @param columns The columns asked to the sheet
- */
- public ExcelSheetStructure(String name, List<ExcelColumnStructure> columns) {
- this.name = name;
- this.columns = columns;
- }
+ /**
+ * Constructor
+ * @param name The name of the sheet
+ * @param columns The columns asked to the sheet
+ */
+ public ExcelSheetStructure(String name, List<ExcelColumnStructure> columns) {
+ this.name = name;
+ this.columns = columns;
+ }
}
Modified: trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/PopulateDB.java
===================================================================
--- trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/PopulateDB.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.service/src/test/java/nc/ird/cantharella/service/utils/PopulateDB.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -77,581 +77,581 @@
*/
public final class PopulateDB {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Date format */
- private static final DateFormat DATE_FORMAT = new SimpleDateFormat("d/M/y");
+ /** Date format */
+ private static final DateFormat DATE_FORMAT = new SimpleDateFormat("d/M/y");
- /** Excel file structure used to import datas */
- private List<ExcelSheetStructure> excelFileStructure;
+ /** Excel file structure used to import datas */
+ private List<ExcelSheetStructure> excelFileStructure;
- /** Service : campagne */
- @Autowired
- private CampagneService campagneService;
+ /** Service : campagne */
+ @Autowired
+ private CampagneService campagneService;
- /** Service : lot */
- @Autowired
- private LotService lotService;
+ /** Service : lot */
+ @Autowired
+ private LotService lotService;
- /** Service : personne */
- @Autowired
- private PersonneService personneService;
+ /** Service : personne */
+ @Autowired
+ private PersonneService personneService;
- /** Service : spécimen */
- private SpecimenService specimenService;
+ /** Service : spécimen */
+ private SpecimenService specimenService;
- /** Service : station */
- @Autowired
- private StationService stationService;
+ /** Service : station */
+ @Autowired
+ private StationService stationService;
- /**
- * Main
- * @param args Arguments
- * @throws DataConstraintException -
- * @throws IOException -
- * @throws ExcelImportException -
- * @throws DataNotFoundException -
- */
- public static void main(String[] args) throws DataConstraintException, ExcelImportException, IOException,
- DataNotFoundException {
- new PopulateDB();
- }
+ /**
+ * Main
+ * @param args Arguments
+ * @throws DataConstraintException -
+ * @throws IOException -
+ * @throws ExcelImportException -
+ * @throws DataNotFoundException -
+ */
+ public static void main(String[] args) throws DataConstraintException, ExcelImportException, IOException,
+ DataNotFoundException {
+ new PopulateDB();
+ }
- /**
- * Constructor
- * @throws DataConstraintException -
- * @throws IOException -
- * @throws ExcelImportException -
- * @throws DataNotFoundException -
- */
- public PopulateDB() throws DataConstraintException, IOException, ExcelImportException, DataNotFoundException {
- ApplicationContext ctx = new AnnotationConfigApplicationContext(ServiceContext.class);
- ctx.getAutowireCapableBeanFactory().autowireBean(this);
+ /**
+ * Constructor
+ * @throws DataConstraintException -
+ * @throws IOException -
+ * @throws ExcelImportException -
+ * @throws DataNotFoundException -
+ */
+ public PopulateDB() throws DataConstraintException, IOException, ExcelImportException, DataNotFoundException {
+ ApplicationContext ctx = new AnnotationConfigApplicationContext(ServiceContext.class);
+ ctx.getAutowireCapableBeanFactory().autowireBean(this);
- ServiceContext.setMailActivated(false);
+ ServiceContext.setMailActivated(false);
- initExcelFileStructure();
+ initExcelFileStructure();
- InputStream excelStream = FileUtils.openInputStream(new File(
- "/home/adri/workspace/echange_doc/equipe-is/cantharella/jeu_de_donnees.xls"));
+ InputStream excelStream = FileUtils.openInputStream(new File(
+ "/home/adri/workspace/echange_doc/equipe-is/cantharella/jeu_de_donnees.xls"));
- ExcelColumnsReader excelReader = new ExcelColumnsReader(excelStream, excelFileStructure);
- populateAll(excelReader);
+ ExcelColumnsReader excelReader = new ExcelColumnsReader(excelStream, excelFileStructure);
+ populateAll(excelReader);
- excelStream.close();
- }
+ excelStream.close();
+ }
- /**
- * @param excelReader -
- * @throws DataConstraintException -
- * @throws ExcelImportException -
- * @throws DataNotFoundException -
- */
- @Transactional
- public void populateAll(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
- DataNotFoundException {
- populatePersonneUtilisateur(excelReader);
- populateCampagne(excelReader);
- populateCampagnePersonneDroits(excelReader);
- // populateCampagnePersonneParticipants(excelReader);
- populateStation(excelReader);
- }
+ /**
+ * @param excelReader -
+ * @throws DataConstraintException -
+ * @throws ExcelImportException -
+ * @throws DataNotFoundException -
+ */
+ @Transactional
+ public void populateAll(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
+ DataNotFoundException {
+ populatePersonneUtilisateur(excelReader);
+ populateCampagne(excelReader);
+ populateCampagnePersonneDroits(excelReader);
+ // populateCampagnePersonneParticipants(excelReader);
+ populateStation(excelReader);
+ }
- /**
- * Initialise the structure asked for the Excel file
- */
- private void initExcelFileStructure() {
+ /**
+ * Initialise the structure asked for the Excel file
+ */
+ private void initExcelFileStructure() {
- excelFileStructure = new ArrayList<ExcelSheetStructure>();
+ excelFileStructure = new ArrayList<ExcelSheetStructure>();
- // structure for the entities 'personne'
- ExcelColumnStructure[] personneColsArray = new ExcelColumnStructure[] {
- new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("prenom", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("organisme", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("fonction", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("tel", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("fax", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("courriel", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("adressePostale", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("codePostal", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("ville", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("typeDroit", ExcelColumnType.STRING, false) };
- ArrayList<ExcelColumnStructure> personneColsList = new ArrayList<ExcelColumnStructure>(
- Arrays.asList(personneColsArray));
- excelFileStructure.add(new ExcelSheetStructure("personne", personneColsList));
+ // structure for the entities 'personne'
+ ExcelColumnStructure[] personneColsArray = new ExcelColumnStructure[] {
+ new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("prenom", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("organisme", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("fonction", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("tel", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("fax", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("courriel", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("adressePostale", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("codePostal", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("ville", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("typeDroit", ExcelColumnType.STRING, false) };
+ ArrayList<ExcelColumnStructure> personneColsList = new ArrayList<ExcelColumnStructure>(
+ Arrays.asList(personneColsArray));
+ excelFileStructure.add(new ExcelSheetStructure("personne", personneColsList));
- // structure for the entities 'personne'
- ExcelColumnStructure[] campagneColsArray = new ExcelColumnStructure[] {
- new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("programme", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("complement", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("createur", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("dateDeb", ExcelColumnType.DATE, true),
- new ExcelColumnStructure("dateFin", ExcelColumnType.DATE, true) };
- ArrayList<ExcelColumnStructure> campagneColsList = new ArrayList<ExcelColumnStructure>(
- Arrays.asList(campagneColsArray));
- excelFileStructure.add(new ExcelSheetStructure("campagne", campagneColsList));
+ // structure for the entities 'personne'
+ ExcelColumnStructure[] campagneColsArray = new ExcelColumnStructure[] {
+ new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("programme", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("complement", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("createur", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("dateDeb", ExcelColumnType.DATE, true),
+ new ExcelColumnStructure("dateFin", ExcelColumnType.DATE, true) };
+ ArrayList<ExcelColumnStructure> campagneColsList = new ArrayList<ExcelColumnStructure>(
+ Arrays.asList(campagneColsArray));
+ excelFileStructure.add(new ExcelSheetStructure("campagne", campagneColsList));
- // structure for the entities 'campagnePersonneDroit'
- ExcelColumnStructure[] campagnePersonneDroitColsArray = new ExcelColumnStructure[] {
- new ExcelColumnStructure("campagne", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("personne", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("droitRecolte", ExcelColumnType.BOOLEAN, true),
- new ExcelColumnStructure("droitExtrait", ExcelColumnType.BOOLEAN, true),
- new ExcelColumnStructure("droitPuri", ExcelColumnType.BOOLEAN, true),
- new ExcelColumnStructure("droitTest", ExcelColumnType.BOOLEAN, true) };
- ArrayList<ExcelColumnStructure> campagnePersonneDroitColsList = new ArrayList<ExcelColumnStructure>(
- Arrays.asList(campagnePersonneDroitColsArray));
- excelFileStructure.add(new ExcelSheetStructure("campagnePersonneDroits", campagnePersonneDroitColsList));
+ // structure for the entities 'campagnePersonneDroit'
+ ExcelColumnStructure[] campagnePersonneDroitColsArray = new ExcelColumnStructure[] {
+ new ExcelColumnStructure("campagne", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("personne", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("droitRecolte", ExcelColumnType.BOOLEAN, true),
+ new ExcelColumnStructure("droitExtrait", ExcelColumnType.BOOLEAN, true),
+ new ExcelColumnStructure("droitPuri", ExcelColumnType.BOOLEAN, true),
+ new ExcelColumnStructure("droitTest", ExcelColumnType.BOOLEAN, true) };
+ ArrayList<ExcelColumnStructure> campagnePersonneDroitColsList = new ArrayList<ExcelColumnStructure>(
+ Arrays.asList(campagnePersonneDroitColsArray));
+ excelFileStructure.add(new ExcelSheetStructure("campagnePersonneDroits", campagnePersonneDroitColsList));
- // structure for the entities 'campagnePersonneParticipants'
- ExcelColumnStructure[] campagnePersonneParticipantsColsArray = new ExcelColumnStructure[] {
- new ExcelColumnStructure("campagne", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("personne", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("complement", ExcelColumnType.STRING, false) };
- ArrayList<ExcelColumnStructure> campagnePersonneParticipantsColsList = new ArrayList<ExcelColumnStructure>(
- Arrays.asList(campagnePersonneParticipantsColsArray));
- excelFileStructure.add(new ExcelSheetStructure("campagnePersonneParticipants",
- campagnePersonneParticipantsColsList));
+ // structure for the entities 'campagnePersonneParticipants'
+ ExcelColumnStructure[] campagnePersonneParticipantsColsArray = new ExcelColumnStructure[] {
+ new ExcelColumnStructure("campagne", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("personne", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("complement", ExcelColumnType.STRING, false) };
+ ArrayList<ExcelColumnStructure> campagnePersonneParticipantsColsList = new ArrayList<ExcelColumnStructure>(
+ Arrays.asList(campagnePersonneParticipantsColsArray));
+ excelFileStructure.add(new ExcelSheetStructure("campagnePersonneParticipants",
+ campagnePersonneParticipantsColsList));
- // structure for the entities 'station'
- ExcelColumnStructure[] stationColsArray = new ExcelColumnStructure[] {
- new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("localite", ExcelColumnType.STRING, true),
- new ExcelColumnStructure("latitude", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("longitude", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("referentiel", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("complement", ExcelColumnType.STRING, false),
- new ExcelColumnStructure("createur", ExcelColumnType.STRING, true) };
- ArrayList<ExcelColumnStructure> stationColsList = new ArrayList<ExcelColumnStructure>(
- Arrays.asList(stationColsArray));
- excelFileStructure.add(new ExcelSheetStructure("station", stationColsList));
+ // structure for the entities 'station'
+ ExcelColumnStructure[] stationColsArray = new ExcelColumnStructure[] {
+ new ExcelColumnStructure("nom", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("codePays", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("localite", ExcelColumnType.STRING, true),
+ new ExcelColumnStructure("latitude", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("longitude", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("referentiel", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("complement", ExcelColumnType.STRING, false),
+ new ExcelColumnStructure("createur", ExcelColumnType.STRING, true) };
+ ArrayList<ExcelColumnStructure> stationColsList = new ArrayList<ExcelColumnStructure>(
+ Arrays.asList(stationColsArray));
+ excelFileStructure.add(new ExcelSheetStructure("station", stationColsList));
- }
+ }
- /**
- * Populate the personne and utilisateur entities
- * @param excelReader The Excel reader
- * @throws ExcelImportException -
- * @throws DataConstraintException -
- */
- private void populatePersonneUtilisateur(ExcelColumnsReader excelReader) throws ExcelImportException,
- DataConstraintException {
- excelReader.selectSheet("personne");
+ /**
+ * Populate the personne and utilisateur entities
+ * @param excelReader The Excel reader
+ * @throws ExcelImportException -
+ * @throws DataConstraintException -
+ */
+ private void populatePersonneUtilisateur(ExcelColumnsReader excelReader) throws ExcelImportException,
+ DataConstraintException {
+ excelReader.selectSheet("personne");
- Map<String, Object> line = excelReader.readLine();
- while (!line.isEmpty()) {
- String nom = (String) line.get("nom");
- String prenom = (String) line.get("prenom");
- String organisme = (String) line.get("organisme");
- String fonction = (String) line.get("fonction");
- String tel = (String) line.get("tel");
- String fax = (String) line.get("fax");
- String courriel = (String) line.get("courriel");
- String adressePostale = (String) line.get("adressePostale");
- String codePostal = (String) line.get("codePostal");
- String ville = (String) line.get("ville");
- String codePays = (String) line.get("codePays");
- String typeDroit = (String) line.get("typeDroit");
- String password = "password";
- Boolean estValide = true;
- LOG.info("adding personne (xls line " + excelReader.getCurrentNumLine() + ") with values :");
- LOG.info("[nom : '" + nom + "', prenom : '" + prenom + "', organisme : '" + organisme + "', fonction : '"
- + fonction + "', tel : '" + tel + "', fax : '" + fax + "', courriel : '" + courriel
- + "', adressePostale : '" + adressePostale + "', codePays : '" + codePays + "', typeDroit : '"
- + typeDroit + "', password : '" + password + "', estValide : '" + estValide + "']");
- addUtilisateurOrPersonne(nom, prenom, organisme, fonction, tel, fax, courriel, adressePostale, codePostal,
- ville, codePays, typeDroit, password, estValide);
- line = excelReader.readLine();
- }
- }
+ Map<String, Object> line = excelReader.readLine();
+ while (!line.isEmpty()) {
+ String nom = (String) line.get("nom");
+ String prenom = (String) line.get("prenom");
+ String organisme = (String) line.get("organisme");
+ String fonction = (String) line.get("fonction");
+ String tel = (String) line.get("tel");
+ String fax = (String) line.get("fax");
+ String courriel = (String) line.get("courriel");
+ String adressePostale = (String) line.get("adressePostale");
+ String codePostal = (String) line.get("codePostal");
+ String ville = (String) line.get("ville");
+ String codePays = (String) line.get("codePays");
+ String typeDroit = (String) line.get("typeDroit");
+ String password = "password";
+ Boolean estValide = true;
+ LOG.info("adding personne (xls line " + excelReader.getCurrentNumLine() + ") with values :");
+ LOG.info("[nom : '" + nom + "', prenom : '" + prenom + "', organisme : '" + organisme + "', fonction : '"
+ + fonction + "', tel : '" + tel + "', fax : '" + fax + "', courriel : '" + courriel
+ + "', adressePostale : '" + adressePostale + "', codePays : '" + codePays + "', typeDroit : '"
+ + typeDroit + "', password : '" + password + "', estValide : '" + estValide + "']");
+ addUtilisateurOrPersonne(nom, prenom, organisme, fonction, tel, fax, courriel, adressePostale, codePostal,
+ ville, codePays, typeDroit, password, estValide);
+ line = excelReader.readLine();
+ }
+ }
- /**
- * Populate the campagne entities
- * @param excelReader The Excel reader
- * @throws ExcelImportException -
- * @throws DataConstraintException -
- * @throws DataNotFoundException -
- */
- private void populateCampagne(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
- DataNotFoundException {
- excelReader.selectSheet("campagne");
+ /**
+ * Populate the campagne entities
+ * @param excelReader The Excel reader
+ * @throws ExcelImportException -
+ * @throws DataConstraintException -
+ * @throws DataNotFoundException -
+ */
+ private void populateCampagne(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
+ DataNotFoundException {
+ excelReader.selectSheet("campagne");
- Map<String, Object> line = excelReader.readLine();
- while (!line.isEmpty()) {
- String nom = (String) line.get("nom");
- String codePays = (String) line.get("codePays");
- String programme = (String) line.get("programme");
- String complement = (String) line.get("complement");
- String createur = (String) line.get("createur");
- Date dateDeb = (Date) line.get("dateDeb");
- Date dateFin = (Date) line.get("dateFin");
+ Map<String, Object> line = excelReader.readLine();
+ while (!line.isEmpty()) {
+ String nom = (String) line.get("nom");
+ String codePays = (String) line.get("codePays");
+ String programme = (String) line.get("programme");
+ String complement = (String) line.get("complement");
+ String createur = (String) line.get("createur");
+ Date dateDeb = (Date) line.get("dateDeb");
+ Date dateFin = (Date) line.get("dateFin");
- LOG.debug("adding campagne (xls line " + excelReader.getCurrentNumLine() + ") with values :");
- LOG.debug("[nom : '" + nom + "', codePays : '" + codePays + "', programme : '" + programme
- + "', complement : '" + complement + "', createur : '" + createur + "', dateDeb : '" + dateDeb
- + "', dateFin : '" + dateFin + "']");
- addCampagne(nom, codePays, programme, complement, createur, dateDeb, dateFin);
+ LOG.debug("adding campagne (xls line " + excelReader.getCurrentNumLine() + ") with values :");
+ LOG.debug("[nom : '" + nom + "', codePays : '" + codePays + "', programme : '" + programme
+ + "', complement : '" + complement + "', createur : '" + createur + "', dateDeb : '" + dateDeb
+ + "', dateFin : '" + dateFin + "']");
+ addCampagne(nom, codePays, programme, complement, createur, dateDeb, dateFin);
- line = excelReader.readLine();
- }
- }
+ line = excelReader.readLine();
+ }
+ }
- /**
- * Populate the campagnePersonneDroits entities
- * @param excelReader The Excel reader
- * @throws ExcelImportException -
- * @throws DataConstraintException -
- * @throws DataNotFoundException -
- */
- private void populateCampagnePersonneDroits(ExcelColumnsReader excelReader) throws ExcelImportException,
- DataConstraintException, DataNotFoundException {
- excelReader.selectSheet("campagnePersonneDroits");
+ /**
+ * Populate the campagnePersonneDroits entities
+ * @param excelReader The Excel reader
+ * @throws ExcelImportException -
+ * @throws DataConstraintException -
+ * @throws DataNotFoundException -
+ */
+ private void populateCampagnePersonneDroits(ExcelColumnsReader excelReader) throws ExcelImportException,
+ DataConstraintException, DataNotFoundException {
+ excelReader.selectSheet("campagnePersonneDroits");
- Map<String, Object> line = excelReader.readLine();
- while (!line.isEmpty()) {
- String campagne = (String) line.get("campagne");
- String personne = (String) line.get("personne");
- Boolean droitRecolte = (Boolean) line.get("droitRecolte");
- Boolean droitExtrait = (Boolean) line.get("droitExtrait");
- Boolean droitPuri = (Boolean) line.get("droitPuri");
- Boolean droitTest = (Boolean) line.get("droitTest");
+ Map<String, Object> line = excelReader.readLine();
+ while (!line.isEmpty()) {
+ String campagne = (String) line.get("campagne");
+ String personne = (String) line.get("personne");
+ Boolean droitRecolte = (Boolean) line.get("droitRecolte");
+ Boolean droitExtrait = (Boolean) line.get("droitExtrait");
+ Boolean droitPuri = (Boolean) line.get("droitPuri");
+ Boolean droitTest = (Boolean) line.get("droitTest");
- LOG.debug("adding campagnePersonneDroits (xls line " + excelReader.getCurrentNumLine() + ") with values :");
- LOG.debug("[campagne : '" + campagne + "', personne : '" + personne + "', droitRecolte : '" + droitRecolte
- + "', droitExtrait : '" + droitExtrait + "', droitPuri : '" + droitPuri + "', droitTest : '"
- + droitTest + "']");
- addCampagnePersonneDroits(campagne, personne, droitExtrait, droitPuri, droitRecolte, droitTest);
+ LOG.debug("adding campagnePersonneDroits (xls line " + excelReader.getCurrentNumLine() + ") with values :");
+ LOG.debug("[campagne : '" + campagne + "', personne : '" + personne + "', droitRecolte : '" + droitRecolte
+ + "', droitExtrait : '" + droitExtrait + "', droitPuri : '" + droitPuri + "', droitTest : '"
+ + droitTest + "']");
+ addCampagnePersonneDroits(campagne, personne, droitExtrait, droitPuri, droitRecolte, droitTest);
- line = excelReader.readLine();
- }
- }
+ line = excelReader.readLine();
+ }
+ }
- /**
- * Populate the campagnePersonneParticipants entities
- * @param excelReader The Excel reader
- * @throws ExcelImportException -
- * @throws DataConstraintException -
- * @throws DataNotFoundException -
- */
- @SuppressWarnings("unused")
- private void populateCampagnePersonneParticipants(ExcelColumnsReader excelReader) throws ExcelImportException,
- DataConstraintException, DataNotFoundException {
- excelReader.selectSheet("campagnePersonneParticipants");
+ /**
+ * Populate the campagnePersonneParticipants entities
+ * @param excelReader The Excel reader
+ * @throws ExcelImportException -
+ * @throws DataConstraintException -
+ * @throws DataNotFoundException -
+ */
+ @SuppressWarnings("unused")
+ private void populateCampagnePersonneParticipants(ExcelColumnsReader excelReader) throws ExcelImportException,
+ DataConstraintException, DataNotFoundException {
+ excelReader.selectSheet("campagnePersonneParticipants");
- Map<String, Object> line = excelReader.readLine();
- while (!line.isEmpty()) {
- String campagne = (String) line.get("campagne");
- String personne = (String) line.get("personne");
- String complement = (String) line.get("complement");
+ Map<String, Object> line = excelReader.readLine();
+ while (!line.isEmpty()) {
+ String campagne = (String) line.get("campagne");
+ String personne = (String) line.get("personne");
+ String complement = (String) line.get("complement");
- LOG.debug("adding campagnePersonneParticipants (xls line " + excelReader.getCurrentNumLine()
- + ") with values :");
- LOG.debug("[campagne : '" + campagne + "', personne : '" + personne + "', complement : '" + complement
- + "']");
- addCampagnePersonneParticipants(campagne, personne, complement);
+ LOG.debug("adding campagnePersonneParticipants (xls line " + excelReader.getCurrentNumLine()
+ + ") with values :");
+ LOG.debug("[campagne : '" + campagne + "', personne : '" + personne + "', complement : '" + complement
+ + "']");
+ addCampagnePersonneParticipants(campagne, personne, complement);
- line = excelReader.readLine();
- }
- }
+ line = excelReader.readLine();
+ }
+ }
- /**
- * Populate the station entities
- * @param excelReader The Excel reader
- * @throws ExcelImportException -
- * @throws DataConstraintException -
- * @throws DataNotFoundException -
- */
- private void populateStation(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
- DataNotFoundException {
- excelReader.selectSheet("station");
+ /**
+ * Populate the station entities
+ * @param excelReader The Excel reader
+ * @throws ExcelImportException -
+ * @throws DataConstraintException -
+ * @throws DataNotFoundException -
+ */
+ private void populateStation(ExcelColumnsReader excelReader) throws ExcelImportException, DataConstraintException,
+ DataNotFoundException {
+ excelReader.selectSheet("station");
- Map<String, Object> line = excelReader.readLine();
- while (!line.isEmpty()) {
- String nom = (String) line.get("nom");
- String codePays = (String) line.get("codePays");
- String localite = (String) line.get("localite");
- String latitude = (String) line.get("latitude");
- String longitude = (String) line.get("longitude");
- String referentiel = (String) line.get("referentiel");
- String complement = (String) line.get("complement");
- String createur = (String) line.get("createur");
+ Map<String, Object> line = excelReader.readLine();
+ while (!line.isEmpty()) {
+ String nom = (String) line.get("nom");
+ String codePays = (String) line.get("codePays");
+ String localite = (String) line.get("localite");
+ String latitude = (String) line.get("latitude");
+ String longitude = (String) line.get("longitude");
+ String referentiel = (String) line.get("referentiel");
+ String complement = (String) line.get("complement");
+ String createur = (String) line.get("createur");
- LOG.debug("adding campagnePersonneParticipants (xls line " + excelReader.getCurrentNumLine()
- + ") with values :");
- LOG.debug("[nom :'" + nom + "', codePays : '" + codePays + "', localite : '" + localite + "', latitude : '"
- + latitude + "', longitude : '" + longitude + "', referentiel : '" + referentiel
- + "', complement : '" + complement + "', createur : '" + createur + "']");
- addStation(nom, codePays, localite, latitude, longitude, complement, createur, referentiel);
+ LOG.debug("adding campagnePersonneParticipants (xls line " + excelReader.getCurrentNumLine()
+ + ") with values :");
+ LOG.debug("[nom :'" + nom + "', codePays : '" + codePays + "', localite : '" + localite + "', latitude : '"
+ + latitude + "', longitude : '" + longitude + "', referentiel : '" + referentiel
+ + "', complement : '" + complement + "', createur : '" + createur + "']");
+ addStation(nom, codePays, localite, latitude, longitude, complement, createur, referentiel);
- line = excelReader.readLine();
- }
- }
+ line = excelReader.readLine();
+ }
+ }
- /**
- * Ajouter une campagne
- * @param nom -
- * @param codePays -
- * @param programme -
- * @param complement -
- * @param createur -
- * @param dateDeb -
- * @param dateFin -
- * @throws DataConstraintException -
- * @throws DataNotFoundException -
- */
- private void addCampagne(String nom, String codePays, String programme, String complement, String createur,
- Date dateDeb, Date dateFin) throws DataConstraintException, DataNotFoundException {
- Campagne c = new Campagne();
- c.setNom(nom);
- c.setCodePays(codePays);
- c.setProgramme(programme);
- c.setComplement(complement);
- c.setCreateur(personneService.loadPersonne(createur));
- c.setDateDeb(dateDeb);
- c.setDateFin(dateFin);
- campagneService.createCampagne(c);
- }
+ /**
+ * Ajouter une campagne
+ * @param nom -
+ * @param codePays -
+ * @param programme -
+ * @param complement -
+ * @param createur -
+ * @param dateDeb -
+ * @param dateFin -
+ * @throws DataConstraintException -
+ * @throws DataNotFoundException -
+ */
+ private void addCampagne(String nom, String codePays, String programme, String complement, String createur,
+ Date dateDeb, Date dateFin) throws DataConstraintException, DataNotFoundException {
+ Campagne c = new Campagne();
+ c.setNom(nom);
+ c.setCodePays(codePays);
+ c.setProgramme(programme);
+ c.setComplement(complement);
+ c.setCreateur(personneService.loadPersonne(createur));
+ c.setDateDeb(dateDeb);
+ c.setDateFin(dateFin);
+ campagneService.createCampagne(c);
+ }
- /**
- * Ajouter des droits pour une personne sur une campagne
- * @param campagne -
- * @param personne -
- * @param droitExtrait -
- * @param droitPuri -
- * @param droitRecolte -
- * @param droitTest -
- * @throws DataNotFoundException -
- * @throws DataConstraintException -
- */
- private void addCampagnePersonneDroits(String campagne, String personne, Boolean droitExtrait, Boolean droitPuri,
- Boolean droitRecolte, Boolean droitTest) throws DataNotFoundException, DataConstraintException {
- CampagnePersonneDroits d = new CampagnePersonneDroits();
- d.getId().setPk1(campagneService.loadCampagne(campagne));
- d.getId().setPk2(personneService.loadPersonne(personne));
- d.getDroits().setDroitExtrait(droitExtrait);
- d.getDroits().setDroitPuri(droitPuri);
- d.getDroits().setDroitRecolte(droitRecolte);
- d.getDroits().setDroitTestBio(droitTest);
- // d.id.pk1.personnesDroits.add(d);
- // d.id.pk2.campagnesDroits.put(d.id.pk1, d);
- personneService.updatePersonne(d.getId().getPk2());
- }
+ /**
+ * Ajouter des droits pour une personne sur une campagne
+ * @param campagne -
+ * @param personne -
+ * @param droitExtrait -
+ * @param droitPuri -
+ * @param droitRecolte -
+ * @param droitTest -
+ * @throws DataNotFoundException -
+ * @throws DataConstraintException -
+ */
+ private void addCampagnePersonneDroits(String campagne, String personne, Boolean droitExtrait, Boolean droitPuri,
+ Boolean droitRecolte, Boolean droitTest) throws DataNotFoundException, DataConstraintException {
+ CampagnePersonneDroits d = new CampagnePersonneDroits();
+ d.getId().setPk1(campagneService.loadCampagne(campagne));
+ d.getId().setPk2(personneService.loadPersonne(personne));
+ d.getDroits().setDroitExtrait(droitExtrait);
+ d.getDroits().setDroitPuri(droitPuri);
+ d.getDroits().setDroitRecolte(droitRecolte);
+ d.getDroits().setDroitTestBio(droitTest);
+ // d.id.pk1.personnesDroits.add(d);
+ // d.id.pk2.campagnesDroits.put(d.id.pk1, d);
+ personneService.updatePersonne(d.getId().getPk2());
+ }
- /**
- * Ajouter un participant à une campagne
- * @param campagne -
- * @param personne -
- * @param complement -
- * @throws DataNotFoundException -
- * @throws DataConstraintException -
- */
- private void addCampagnePersonneParticipants(String campagne, String personne, String complement)
- throws DataNotFoundException, DataConstraintException {
- CampagnePersonneParticipant p = new CampagnePersonneParticipant();
- p.getId().setPk1(campagneService.loadCampagne(campagne));
- p.getId().setPk2(personneService.loadPersonne(personne));
- p.setComplement(complement);
- p.getId().getPk1().getParticipants().add(p);
- p.getId().getPk2().getCampagnesParticipees().add(p);
- campagneService.updateCampagne(p.getId().getPk1());
- }
+ /**
+ * Ajouter un participant à une campagne
+ * @param campagne -
+ * @param personne -
+ * @param complement -
+ * @throws DataNotFoundException -
+ * @throws DataConstraintException -
+ */
+ private void addCampagnePersonneParticipants(String campagne, String personne, String complement)
+ throws DataNotFoundException, DataConstraintException {
+ CampagnePersonneParticipant p = new CampagnePersonneParticipant();
+ p.getId().setPk1(campagneService.loadCampagne(campagne));
+ p.getId().setPk2(personneService.loadPersonne(personne));
+ p.setComplement(complement);
+ p.getId().getPk1().getParticipants().add(p);
+ p.getId().getPk2().getCampagnesParticipees().add(p);
+ campagneService.updateCampagne(p.getId().getPk1());
+ }
- /**
- * Ajouter un lot
- * @param campagne -
- * @param complement -
- * @param createur -
- * @param date -
- * @param echantillonColl -
- * @param echantillonIdent -
- * @param echantillonPhylo -
- * @param masseFraiche -
- * @param masseSeche -
- * @param partie -
- * @param ref -
- * @param specimenRef -
- * @param station -
- * @throws DataNotFoundException -
- * @throws ParseException -
- */
- @SuppressWarnings("unused")
- private void addLot(String campagne, String complement, String createur, String date, String echantillonColl,
- String echantillonIdent, String echantillonPhylo, String masseFraiche, String masseSeche, String partie,
- String ref, String specimenRef, String station) throws DataNotFoundException, ParseException {
- Lot l = new Lot();
- l.setCampagne(campagneService.loadCampagne(campagne));
- l.setComplement(complement);
- l.setCreateur(personneService.loadPersonne(createur));
- l.setDateRecolte(DATE_FORMAT.parse(date));
- l.setEchantillonColl(Boolean.valueOf(echantillonColl));
- l.setEchantillonIdent(Boolean.valueOf(echantillonIdent));
- l.setEchantillonPhylo(Boolean.valueOf(echantillonPhylo));
- DecimalFormat fmt = (DecimalFormat) NumberFormat.getNumberInstance(Locale.FRENCH);
- fmt.setMaximumFractionDigits(DataContext.DECIMAL_SCALE);
- fmt.setMaximumIntegerDigits(DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
- fmt.setParseBigDecimal(true);
- l.setMasseFraiche((BigDecimal) fmt.parse(masseFraiche));
- l.setMasseSeche((BigDecimal) fmt.parse(masseSeche));
- l.setPartie(lotService.loadPartie(partie));
- l.setRef(ref);
- l.setSpecimenRef(specimenService.loadSpecimen(specimenRef));
- l.setStation(stationService.loadStation(station));
- }
+ /**
+ * Ajouter un lot
+ * @param campagne -
+ * @param complement -
+ * @param createur -
+ * @param date -
+ * @param echantillonColl -
+ * @param echantillonIdent -
+ * @param echantillonPhylo -
+ * @param masseFraiche -
+ * @param masseSeche -
+ * @param partie -
+ * @param ref -
+ * @param specimenRef -
+ * @param station -
+ * @throws DataNotFoundException -
+ * @throws ParseException -
+ */
+ @SuppressWarnings("unused")
+ private void addLot(String campagne, String complement, String createur, String date, String echantillonColl,
+ String echantillonIdent, String echantillonPhylo, String masseFraiche, String masseSeche, String partie,
+ String ref, String specimenRef, String station) throws DataNotFoundException, ParseException {
+ Lot l = new Lot();
+ l.setCampagne(campagneService.loadCampagne(campagne));
+ l.setComplement(complement);
+ l.setCreateur(personneService.loadPersonne(createur));
+ l.setDateRecolte(DATE_FORMAT.parse(date));
+ l.setEchantillonColl(Boolean.valueOf(echantillonColl));
+ l.setEchantillonIdent(Boolean.valueOf(echantillonIdent));
+ l.setEchantillonPhylo(Boolean.valueOf(echantillonPhylo));
+ DecimalFormat fmt = (DecimalFormat) NumberFormat.getNumberInstance(Locale.FRENCH);
+ fmt.setMaximumFractionDigits(DataContext.DECIMAL_SCALE);
+ fmt.setMaximumIntegerDigits(DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
+ fmt.setParseBigDecimal(true);
+ l.setMasseFraiche((BigDecimal) fmt.parse(masseFraiche));
+ l.setMasseSeche((BigDecimal) fmt.parse(masseSeche));
+ l.setPartie(lotService.loadPartie(partie));
+ l.setRef(ref);
+ l.setSpecimenRef(specimenService.loadSpecimen(specimenRef));
+ l.setStation(stationService.loadStation(station));
+ }
- /**
- * Ajouter des droits pour une personne sur un lot
- * @param lot -
- * @param personne -
- * @param droitExtrait -
- * @param droitPuri -
- * @param droitRécolte -
- * @param droitTest -
- * @throws DataNotFoundException -
- * @throws DataConstraintException -
- */
- @SuppressWarnings("unused")
- private void addLotPersonneDroits(String lot, String personne, String droitExtrait, String droitPuri,
- String droitRécolte, String droitTest) throws DataNotFoundException, DataConstraintException {
- LotPersonneDroits d = new LotPersonneDroits();
- d.getId().setPk1(lotService.loadLot(lot));
- d.getId().setPk2(personneService.loadPersonne(personne));
- d.getDroits().setDroitExtrait(Boolean.valueOf(droitExtrait));
- d.getDroits().setDroitPuri(Boolean.valueOf(droitPuri));
- d.getDroits().setDroitRecolte(Boolean.valueOf(droitRécolte));
- d.getDroits().setDroitTestBio(Boolean.valueOf(droitTest));
- d.getId().getPk1().getPersonnesDroits().add(d);
- d.getId().getPk2().getLotsDroits().put(d.getId().getPk1(), d);
- personneService.updatePersonne(d.getId().getPk2());
- }
+ /**
+ * Ajouter des droits pour une personne sur un lot
+ * @param lot -
+ * @param personne -
+ * @param droitExtrait -
+ * @param droitPuri -
+ * @param droitRécolte -
+ * @param droitTest -
+ * @throws DataNotFoundException -
+ * @throws DataConstraintException -
+ */
+ @SuppressWarnings("unused")
+ private void addLotPersonneDroits(String lot, String personne, String droitExtrait, String droitPuri,
+ String droitRécolte, String droitTest) throws DataNotFoundException, DataConstraintException {
+ LotPersonneDroits d = new LotPersonneDroits();
+ d.getId().setPk1(lotService.loadLot(lot));
+ d.getId().setPk2(personneService.loadPersonne(personne));
+ d.getDroits().setDroitExtrait(Boolean.valueOf(droitExtrait));
+ d.getDroits().setDroitPuri(Boolean.valueOf(droitPuri));
+ d.getDroits().setDroitRecolte(Boolean.valueOf(droitRécolte));
+ d.getDroits().setDroitTestBio(Boolean.valueOf(droitTest));
+ d.getId().getPk1().getPersonnesDroits().add(d);
+ d.getId().getPk2().getLotsDroits().put(d.getId().getPk1(), d);
+ personneService.updatePersonne(d.getId().getPk2());
+ }
- /**
- * Ajouter une partie
- * @param nom -
- * @throws DataConstraintException -
- */
- @SuppressWarnings("unused")
- private void addPartie(String nom) throws DataConstraintException {
- Partie p = new Partie();
- p.setNom(nom);
- lotService.createPartie(p);
- }
+ /**
+ * Ajouter une partie
+ * @param nom -
+ * @throws DataConstraintException -
+ */
+ @SuppressWarnings("unused")
+ private void addPartie(String nom) throws DataConstraintException {
+ Partie p = new Partie();
+ p.setNom(nom);
+ lotService.createPartie(p);
+ }
- /**
- * Ajouter un spécimen
- * @param ref -
- * @param embranchement -
- * @throws DataConstraintException -
- */
- @SuppressWarnings("unused")
- private void addSpecimen(String ref, String embranchement) throws DataConstraintException {
- Specimen s = new Specimen();
- s.setRef(ref);
- s.setEmbranchement(embranchement);
- specimenService.createSpecimen(s);
- }
+ /**
+ * Ajouter un spécimen
+ * @param ref -
+ * @param embranchement -
+ * @throws DataConstraintException -
+ */
+ @SuppressWarnings("unused")
+ private void addSpecimen(String ref, String embranchement) throws DataConstraintException {
+ Specimen s = new Specimen();
+ s.setRef(ref);
+ s.setEmbranchement(embranchement);
+ specimenService.createSpecimen(s);
+ }
- /**
- * Ajouter une campagne
- * @param nom -
- * @param codePays -
- * @param localite -
- * @param latitude -
- * @param longitude -
- * @param complement -
- * @param createur -
- * @param referentiel -
- * @throws DataNotFoundException -
- * @throws DataConstraintException -
- * @throws ExcelImportException -
- */
- private void addStation(String nom, String codePays, String localite, String latitude, String longitude,
- String complement, String createur, String referentiel) throws DataNotFoundException,
- DataConstraintException, ExcelImportException {
- Station s = new Station();
- s.setNom(nom);
- s.setCodePays(codePays);
- s.setComplement(complement);
- s.setCreateur(personneService.loadPersonne(createur));
- s.setLatitude(StringUtils.leftPad(StringUtils.deleteWhitespace(latitude), CoordTools.LATITUDE_LENGTH));
- s.setLongitude(StringUtils.leftPad(StringUtils.deleteWhitespace(longitude), CoordTools.LONGITUDE_LENGTH));
- s.setReferentiel(getReferentialNumber(referentiel));
- s.setLocalite(localite);
- stationService.createStation(s);
- }
+ /**
+ * Ajouter une campagne
+ * @param nom -
+ * @param codePays -
+ * @param localite -
+ * @param latitude -
+ * @param longitude -
+ * @param complement -
+ * @param createur -
+ * @param referentiel -
+ * @throws DataNotFoundException -
+ * @throws DataConstraintException -
+ * @throws ExcelImportException -
+ */
+ private void addStation(String nom, String codePays, String localite, String latitude, String longitude,
+ String complement, String createur, String referentiel) throws DataNotFoundException,
+ DataConstraintException, ExcelImportException {
+ Station s = new Station();
+ s.setNom(nom);
+ s.setCodePays(codePays);
+ s.setComplement(complement);
+ s.setCreateur(personneService.loadPersonne(createur));
+ s.setLatitude(StringUtils.leftPad(StringUtils.deleteWhitespace(latitude), CoordTools.LATITUDE_LENGTH));
+ s.setLongitude(StringUtils.leftPad(StringUtils.deleteWhitespace(longitude), CoordTools.LONGITUDE_LENGTH));
+ s.setReferentiel(getReferentialNumber(referentiel));
+ s.setLocalite(localite);
+ stationService.createStation(s);
+ }
- /**
- * Get the referentiel number associated to the given referential
- * @param referentialString referential name
- * @return the corresponding number
- * @throws ExcelImportException -
- */
- private Integer getReferentialNumber(String referentialString) throws ExcelImportException {
- for (Map.Entry<Integer, String> curEntry : DataContext.REFERENTIELS.entrySet()) {
- if (curEntry.getValue().equals(referentialString)) {
- return curEntry.getKey();
- }
- }
- throw new ExcelImportException("'" + referentialString + "' is not a allowed referential");
- }
+ /**
+ * Get the referentiel number associated to the given referential
+ * @param referentialString referential name
+ * @return the corresponding number
+ * @throws ExcelImportException -
+ */
+ private Integer getReferentialNumber(String referentialString) throws ExcelImportException {
+ for (Map.Entry<Integer, String> curEntry : DataContext.REFERENTIELS.entrySet()) {
+ if (curEntry.getValue().equals(referentialString)) {
+ return curEntry.getKey();
+ }
+ }
+ throw new ExcelImportException("'" + referentialString + "' is not a allowed referential");
+ }
- /**
- * Ajoute une personne ou un utilisateur
- * @param nom -
- * @param prenom -
- * @param organisme -
- * @param fonction -
- * @param tel -
- * @param fax -
- * @param courriel -
- * @param adressePostale -
- * @param codePostal -
- * @param ville -
- * @param codePays -
- * @param typeDroit -
- * @param password -
- * @param estValide -
- * @throws DataConstraintException -
- */
- private void addUtilisateurOrPersonne(String nom, String prenom, String organisme, String fonction, String tel,
- String fax, String courriel, String adressePostale, String codePostal, String ville, String codePays,
- String typeDroit, String password, Boolean estValide) throws DataConstraintException {
- if (StringUtils.isEmpty(typeDroit)) {
- Personne p = new Personne();
- p.setNom(nom);
- p.setPrenom(prenom);
- p.setOrganisme(organisme);
- p.setFonction(fonction);
- p.setTel(tel);
- p.setFax(fax);
- p.setCourriel(courriel);
- p.setAdressePostale(adressePostale);
- p.setCodePostal(codePostal);
- p.setVille(ville);
- p.setCodePays(codePays);
- personneService.createPersonne(p);
- } else {
- Utilisateur u = new Utilisateur();
- u.setNom(nom);
- u.setPrenom(prenom);
- u.setOrganisme(organisme);
- u.setFonction(fonction);
- u.setTel(tel);
- u.setFax(fax);
- u.setCourriel(courriel);
- u.setAdressePostale(adressePostale);
- u.setCodePostal(codePostal);
- u.setVille(ville);
- u.setCodePays(codePays);
- u.setTypeDroit(TypeDroit.valueOf(typeDroit));
- u.setPasswordHash(personneService.hashPassword(password));
- u.setValide(estValide);
- personneService.createUtilisateur(u);
- }
- }
+ /**
+ * Ajoute une personne ou un utilisateur
+ * @param nom -
+ * @param prenom -
+ * @param organisme -
+ * @param fonction -
+ * @param tel -
+ * @param fax -
+ * @param courriel -
+ * @param adressePostale -
+ * @param codePostal -
+ * @param ville -
+ * @param codePays -
+ * @param typeDroit -
+ * @param password -
+ * @param estValide -
+ * @throws DataConstraintException -
+ */
+ private void addUtilisateurOrPersonne(String nom, String prenom, String organisme, String fonction, String tel,
+ String fax, String courriel, String adressePostale, String codePostal, String ville, String codePays,
+ String typeDroit, String password, Boolean estValide) throws DataConstraintException {
+ if (StringUtils.isEmpty(typeDroit)) {
+ Personne p = new Personne();
+ p.setNom(nom);
+ p.setPrenom(prenom);
+ p.setOrganisme(organisme);
+ p.setFonction(fonction);
+ p.setTel(tel);
+ p.setFax(fax);
+ p.setCourriel(courriel);
+ p.setAdressePostale(adressePostale);
+ p.setCodePostal(codePostal);
+ p.setVille(ville);
+ p.setCodePays(codePays);
+ personneService.createPersonne(p);
+ } else {
+ Utilisateur u = new Utilisateur();
+ u.setNom(nom);
+ u.setPrenom(prenom);
+ u.setOrganisme(organisme);
+ u.setFonction(fonction);
+ u.setTel(tel);
+ u.setFax(fax);
+ u.setCourriel(courriel);
+ u.setAdressePostale(adressePostale);
+ u.setCodePostal(codePostal);
+ u.setVille(ville);
+ u.setCodePays(codePays);
+ u.setTypeDroit(TypeDroit.valueOf(typeDroit));
+ u.setPasswordHash(personneService.hashPassword(password));
+ u.setValide(estValide);
+ personneService.createUtilisateur(u);
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.utils/pom.xml
===================================================================
--- trunk/cantharella.utils/pom.xml 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/pom.xml 2013-01-29 09:48:04 UTC (rev 65)
@@ -1,7 +1,6 @@
<?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">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/AssertTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/AssertTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/AssertTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,220 +32,220 @@
*/
public final class AssertTools {
- /** Error message for wrong class argument */
- private static final String CLASS = "Argument must be of type %s";
+ /** Error message for wrong class argument */
+ private static final String CLASS = "Argument must be of type %s";
- /** Error message for not equals argument */
- private static final String EQUALS = "Argument must be equals to %s";
+ /** Error message for not equals argument */
+ private static final String EQUALS = "Argument must be equals to %s";
- /** Error message for not greater argument */
- private static final String GREATER = "Argument must be greater than %s";
+ /** Error message for not greater argument */
+ private static final String GREATER = "Argument must be greater than %s";
- /** Error message for not greater or equals argument */
- private static final String GREATER_OR_EQUALS = "Argument must be greater than or equals to %s";
+ /** Error message for not greater or equals argument */
+ private static final String GREATER_OR_EQUALS = "Argument must be greater than or equals to %s";
- /** Error message for "not in" argument */
- private static final String IN = "Argument must be in %s";
+ /** Error message for "not in" argument */
+ private static final String IN = "Argument must be in %s";
- /** Error message for not lower argument */
- private static final String LOWER = "Argument must be lower than %s";
+ /** Error message for not lower argument */
+ private static final String LOWER = "Argument must be lower than %s";
- /** Error message for not lower or equals argument */
- private static final String LOWER_OR_EQUALS = "Argument must be lower than or equals to %s";
+ /** Error message for not lower or equals argument */
+ private static final String LOWER_OR_EQUALS = "Argument must be lower than or equals to %s";
- /** Error message for empty argument */
- private static final String NOT_EMPTY = "Argument must not be empty";
+ /** Error message for empty argument */
+ private static final String NOT_EMPTY = "Argument must not be empty";
- /** Error message for equals argument */
- private static final String NOT_EQUALS = "Argument must not be equals to %s";
+ /** Error message for equals argument */
+ private static final String NOT_EQUALS = "Argument must not be equals to %s";
- /** Error message for null argument */
- private static final String NOT_NULL = "Argument must not be null";
+ /** Error message for null argument */
+ private static final String NOT_NULL = "Argument must not be null";
- /**
- * Assert that none of the string in an array is empty
- * @param strings Strings array
- */
- public static void assertArrayNotEmpty(String[] strings) {
- assertNotNull(strings);
- for (String string : strings) {
- assertNotEmpty(string);
- }
- }
+ /**
+ * Assert that none of the string in an array is empty
+ * @param strings Strings array
+ */
+ public static void assertArrayNotEmpty(String[] strings) {
+ assertNotNull(strings);
+ for (String string : strings) {
+ assertNotEmpty(string);
+ }
+ }
- /**
- * Assert that none of the objects in an array is null
- * @param objects Objects array
- */
- public static void assertArrayNotNull(Object[] objects) {
- assertNotNull(objects);
- for (Object object : objects) {
- assertNotNull(object);
- }
- }
+ /**
+ * Assert that none of the objects in an array is null
+ * @param objects Objects array
+ */
+ public static void assertArrayNotNull(Object[] objects) {
+ assertNotNull(objects);
+ for (Object object : objects) {
+ assertNotNull(object);
+ }
+ }
- /**
- * Assert that an object class/superclass/interface/superinterface
- * @param object Object
- * @param clazz Expected class/superclass/interface/superinterface
- */
- public static void assertClassOrInterface(Object object, Class<?> clazz) {
- assertNotNull(object);
- assertNotNull(clazz);
- assert clazz.isAssignableFrom(object.getClass()) : String.format(CLASS, clazz.getName());
- }
+ /**
+ * Assert that an object class/superclass/interface/superinterface
+ * @param object Object
+ * @param clazz Expected class/superclass/interface/superinterface
+ */
+ public static void assertClassOrInterface(Object object, Class<?> clazz) {
+ assertNotNull(object);
+ assertNotNull(clazz);
+ assert clazz.isAssignableFrom(object.getClass()) : String.format(CLASS, clazz.getName());
+ }
- /**
- * Assert that none of the objects in a Collection is null
- * @param objects Objects collection
- */
- public static void assertCollectionNotNull(Collection<?> objects) {
- assertNotNull(objects);
- for (Object object : objects) {
- assertNotNull(object);
- }
- }
+ /**
+ * Assert that none of the objects in a Collection is null
+ * @param objects Objects collection
+ */
+ public static void assertCollectionNotNull(Collection<?> objects) {
+ assertNotNull(objects);
+ for (Object object : objects) {
+ assertNotNull(object);
+ }
+ }
- /**
- * Assert that a value is equals to an expected value
- * @param <N> Number type
- * @param value Value
- * @param expectedValue Expected value
- */
- public static <N extends Number> void assertEquals(N value, N expectedValue) {
- assert value.doubleValue() == expectedValue.doubleValue() : String.format(EQUALS, expectedValue);
- }
+ /**
+ * Assert that a value is equals to an expected value
+ * @param <N> Number type
+ * @param value Value
+ * @param expectedValue Expected value
+ */
+ public static <N extends Number> void assertEquals(N value, N expectedValue) {
+ assert value.doubleValue() == expectedValue.doubleValue() : String.format(EQUALS, expectedValue);
+ }
- /**
- * Assert that a value is greater than to a bound
- * @param <N> Number type
- * @param value Value
- * @param bound Bound
- */
- public static <N extends Number> void assertGreater(N value, N bound) {
- assert value.doubleValue() > bound.doubleValue() : String.format(GREATER, bound);
- }
+ /**
+ * Assert that a value is greater than to a bound
+ * @param <N> Number type
+ * @param value Value
+ * @param bound Bound
+ */
+ public static <N extends Number> void assertGreater(N value, N bound) {
+ assert value.doubleValue() > bound.doubleValue() : String.format(GREATER, bound);
+ }
- /**
- * Assert that a value is greater than or equals to a bound
- * @param <N> Number type
- * @param value Value
- * @param bound Bound
- */
- public static <N extends Number> void assertGreaterOrEquals(N value, N bound) {
- assert value.doubleValue() >= bound.doubleValue() : String.format(GREATER_OR_EQUALS, bound);
- }
+ /**
+ * Assert that a value is greater than or equals to a bound
+ * @param <N> Number type
+ * @param value Value
+ * @param bound Bound
+ */
+ public static <N extends Number> void assertGreaterOrEquals(N value, N bound) {
+ assert value.doubleValue() >= bound.doubleValue() : String.format(GREATER_OR_EQUALS, bound);
+ }
- /**
- * Assert that an object is contains in a values array
- * @param <O> Object type
- * @param object Object
- * @param values Values collection
- */
- public static <O> void assertIn(O object, Collection<O> values) {
- assertNotNull(object);
- assertNotEmpty(values);
- assert values.contains(object) : String.format(IN, object);
- }
+ /**
+ * Assert that an object is contains in a values array
+ * @param <O> Object type
+ * @param object Object
+ * @param values Values collection
+ */
+ public static <O> void assertIn(O object, Collection<O> values) {
+ assertNotNull(object);
+ assertNotEmpty(values);
+ assert values.contains(object) : String.format(IN, object);
+ }
- /**
- * Assert that an object is contains in a values array
- * @param <O> Object type
- * @param object Object
- * @param values Values array
- */
- public static <O> void assertIn(O object, O... values) {
- assertNotEmpty(values);
- assertIn(object, Arrays.asList(values));
- }
+ /**
+ * Assert that an object is contains in a values array
+ * @param <O> Object type
+ * @param object Object
+ * @param values Values array
+ */
+ public static <O> void assertIn(O object, O... values) {
+ assertNotEmpty(values);
+ assertIn(object, Arrays.asList(values));
+ }
- /**
- * Assert that a value is lower than to a bound
- * @param <N> Number type
- * @param value Value
- * @param bound Bound
- */
- public static <N extends Number> void assertLower(N value, N bound) {
- assert value.doubleValue() < bound.doubleValue() : String.format(LOWER, bound);
- }
+ /**
+ * Assert that a value is lower than to a bound
+ * @param <N> Number type
+ * @param value Value
+ * @param bound Bound
+ */
+ public static <N extends Number> void assertLower(N value, N bound) {
+ assert value.doubleValue() < bound.doubleValue() : String.format(LOWER, bound);
+ }
- /**
- * Assert that a value is lower than or equals to a bound
- * @param <N> Number type
- * @param value Value
- * @param bound Bound
- */
- public static <N extends Number> void assertLowerOrEquals(N value, N bound) {
- assert value.doubleValue() <= bound.doubleValue() : String.format(LOWER_OR_EQUALS, bound);
- }
+ /**
+ * Assert that a value is lower than or equals to a bound
+ * @param <N> Number type
+ * @param value Value
+ * @param bound Bound
+ */
+ public static <N extends Number> void assertLowerOrEquals(N value, N bound) {
+ assert value.doubleValue() <= bound.doubleValue() : String.format(LOWER_OR_EQUALS, bound);
+ }
- /**
- * Assert that an array is not null or empty
- * @param collection Collection
- */
- public static void assertNotEmpty(Collection<?> collection) {
- assertNotNull(collection);
- assert !collection.isEmpty() : NOT_EMPTY;
- }
+ /**
+ * Assert that an array is not null or empty
+ * @param collection Collection
+ */
+ public static void assertNotEmpty(Collection<?> collection) {
+ assertNotNull(collection);
+ assert !collection.isEmpty() : NOT_EMPTY;
+ }
- /**
- * Assert that a collection is not null or empty
- * @param array Array
- */
- public static void assertNotEmpty(Object[] array) {
- assertNotNull(array);
- assert array.length > 0 : NOT_EMPTY;
- }
+ /**
+ * Assert that a collection is not null or empty
+ * @param array Array
+ */
+ public static void assertNotEmpty(Object[] array) {
+ assertNotNull(array);
+ assert array.length > 0 : NOT_EMPTY;
+ }
- /**
- * Assert that a string is not null or empty
- * @param string String
- */
- public static void assertNotEmpty(String string) {
- assertNotNull(string);
- assert !string.isEmpty() : NOT_EMPTY;
- }
+ /**
+ * Assert that a string is not null or empty
+ * @param string String
+ */
+ public static void assertNotEmpty(String string) {
+ assertNotNull(string);
+ assert !string.isEmpty() : NOT_EMPTY;
+ }
- /**
- * Assert that a value is not equals to an unexpected value
- * @param <N> Number type
- * @param value Value
- * @param unexpectedValue Unxpected value
- */
- public static <N extends Number> void assertNotEquals(N value, N unexpectedValue) {
- assert value.doubleValue() != unexpectedValue.doubleValue() : String.format(NOT_EQUALS, unexpectedValue);
- }
+ /**
+ * Assert that a value is not equals to an unexpected value
+ * @param <N> Number type
+ * @param value Value
+ * @param unexpectedValue Unxpected value
+ */
+ public static <N extends Number> void assertNotEquals(N value, N unexpectedValue) {
+ assert value.doubleValue() != unexpectedValue.doubleValue() : String.format(NOT_EQUALS, unexpectedValue);
+ }
- /**
- * Assert that a value is not negative
- * @param <N> Number type
- * @param value Value
- */
- public static <N extends Number> void assertNotNegative(N value) {
- assertGreaterOrEquals(value, 0);
- }
+ /**
+ * Assert that a value is not negative
+ * @param <N> Number type
+ * @param value Value
+ */
+ public static <N extends Number> void assertNotNegative(N value) {
+ assertGreaterOrEquals(value, 0);
+ }
- /**
- * Assert that an object is not null
- * @param object Object
- */
- public static void assertNotNull(Object object) {
- assert object != null : NOT_NULL;
- }
+ /**
+ * Assert that an object is not null
+ * @param object Object
+ */
+ public static void assertNotNull(Object object) {
+ assert object != null : NOT_NULL;
+ }
- /**
- * Assert that a value is positive
- * @param <N> Number type
- * @param value Value
- */
- public static <N extends Number> void assertPositive(N value) {
- assertGreater(value, 0);
- }
+ /**
+ * Assert that a value is positive
+ * @param <N> Number type
+ * @param value Value
+ */
+ public static <N extends Number> void assertPositive(N value) {
+ assertGreater(value, 0);
+ }
- /**
- * Constructor (prevents instantiation)
- */
- private AssertTools() {
- //
- }
+ /**
+ * Constructor (prevents instantiation)
+ */
+ private AssertTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanLookup.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanLookup.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanLookup.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,35 +33,35 @@
*/
public final class BeanLookup extends StrLookup {
- /** Access type */
- private final AccessType accessType;
+ /** Access type */
+ private final AccessType accessType;
- /** Bean */
- private final Object bean;
+ /** Bean */
+ private final Object bean;
- /**
- * Constructor
- * @param bean Bean
- * @param accessType Access type
- */
- public BeanLookup(Object bean, AccessType accessType) {
- super();
- AssertTools.assertNotNull(bean);
- AssertTools.assertNotNull(accessType);
- this.bean = bean;
- this.accessType = accessType;
- }
+ /**
+ * Constructor
+ * @param bean Bean
+ * @param accessType Access type
+ */
+ public BeanLookup(Object bean, AccessType accessType) {
+ super();
+ AssertTools.assertNotNull(bean);
+ AssertTools.assertNotNull(accessType);
+ this.bean = bean;
+ this.accessType = accessType;
+ }
- /** {@inheritDoc} */
- @Override
- public String lookup(String key) {
- AssertTools.assertNotNull(key);
- Object value;
- try {
- value = BeanTools.getValue(bean, accessType, key);
- } catch (IllegalArgumentException e) {
- value = null;
- }
- return value != null ? value.toString() : null;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String lookup(String key) {
+ AssertTools.assertNotNull(key);
+ Object value;
+ try {
+ value = BeanTools.getValue(bean, accessType, key);
+ } catch (IllegalArgumentException e) {
+ value = null;
+ }
+ return value != null ? value.toString() : null;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/BeanTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,496 +45,496 @@
*/
public final class BeanTools {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /**
- * Access type
- */
- public enum AccessType {
- /** Access by (public) field */
- FIELD,
- /** Access by (public) getter */
- GETTER;
- }
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /**
+ * Access type
+ */
+ public enum AccessType {
+ /** Access by (public) field */
+ FIELD,
+ /** Access by (public) getter */
+ GETTER;
+ }
- /** Error message for annotation not found in a class */
- private static final String ANNOTATION = "Argument of type %s must have a field annotated with %s";
+ /** Error message for annotation not found in a class */
+ private static final String ANNOTATION = "Argument of type %s must have a field annotated with %s";
- /** Error message for field not found in a class */
- private static final String FIELD = "Argument of type %s must have an accessible %s property";
+ /** Error message for field not found in a class */
+ private static final String FIELD = "Argument of type %s must have an accessible %s property";
- /** Parameters */
- private static final Object[] PARAMETERS = new Object[0];
+ /** Parameters */
+ private static final Object[] PARAMETERS = new Object[0];
- /**
- * Equals method
- * @param thiz First object ("this", not null)
- * @param obj Second object
- * @param accessType Access type
- * @param properties Properties (names) to check
- * @return Equality
- */
- public static boolean equals(Object thiz, Object obj, AccessType accessType, String... properties) {
- AssertTools.assertNotNull(thiz);
- AssertTools.assertNotEmpty(properties);
- AssertTools.assertArrayNotNull(properties);
- if (thiz == obj) {
- return true;
- }
- if (obj != null
- && thiz != null
- && (thiz.getClass().isAssignableFrom(obj.getClass()) || obj.getClass()
- .isAssignableFrom(thiz.getClass()))) {
- EqualsBuilder builder = new EqualsBuilder();
- for (String property : properties) {
- try {
- Object val1 = getValue(thiz, accessType, property);
- Object val2 = getValue(obj, accessType, property);
+ /**
+ * Equals method
+ * @param thiz First object ("this", not null)
+ * @param obj Second object
+ * @param accessType Access type
+ * @param properties Properties (names) to check
+ * @return Equality
+ */
+ public static boolean equals(Object thiz, Object obj, AccessType accessType, String... properties) {
+ AssertTools.assertNotNull(thiz);
+ AssertTools.assertNotEmpty(properties);
+ AssertTools.assertArrayNotNull(properties);
+ if (thiz == obj) {
+ return true;
+ }
+ if (obj != null
+ && thiz != null
+ && (thiz.getClass().isAssignableFrom(obj.getClass()) || obj.getClass()
+ .isAssignableFrom(thiz.getClass()))) {
+ EqualsBuilder builder = new EqualsBuilder();
+ for (String property : properties) {
+ try {
+ Object val1 = getValue(thiz, accessType, property);
+ Object val2 = getValue(obj, accessType, property);
- // Test hashCodes first
- if (val1 != null && val2 != null && !builder.append(val1.hashCode(), val2.hashCode()).isEquals()) {
- return false;
- }
+ // Test hashCodes first
+ if (val1 != null && val2 != null && !builder.append(val1.hashCode(), val2.hashCode()).isEquals()) {
+ return false;
+ }
- if (!builder.append(val1, val2).isEquals()) {
- return false;
- }
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), property), e);
- }
+ if (!builder.append(val1, val2).isEquals()) {
+ return false;
+ }
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), property), e);
+ }
- }
- return builder.isEquals();
- }
- return false;
- }
+ }
+ return builder.isEquals();
+ }
+ return false;
+ }
- /**
- * Equals method
- * @param thiz First object ("this", not null)
- * @param obj Second object
- * @param fields Public fields to check
- * @return Equality
- */
- public static boolean equals(Object thiz, Object obj, Field... fields) {
- AssertTools.assertNotNull(thiz);
- AssertTools.assertNotEmpty(fields);
- AssertTools.assertArrayNotNull(fields);
- if (thiz == obj) {
- return true;
- }
- if (obj != null
- && thiz != null
- && (thiz.getClass().isAssignableFrom(obj.getClass()) || obj.getClass()
- .isAssignableFrom(thiz.getClass()))) {
- EqualsBuilder builder = new EqualsBuilder();
- for (Field field : fields) {
- try {
- Object val1 = field.get(thiz);
- Object val2 = field.get(obj);
+ /**
+ * Equals method
+ * @param thiz First object ("this", not null)
+ * @param obj Second object
+ * @param fields Public fields to check
+ * @return Equality
+ */
+ public static boolean equals(Object thiz, Object obj, Field... fields) {
+ AssertTools.assertNotNull(thiz);
+ AssertTools.assertNotEmpty(fields);
+ AssertTools.assertArrayNotNull(fields);
+ if (thiz == obj) {
+ return true;
+ }
+ if (obj != null
+ && thiz != null
+ && (thiz.getClass().isAssignableFrom(obj.getClass()) || obj.getClass()
+ .isAssignableFrom(thiz.getClass()))) {
+ EqualsBuilder builder = new EqualsBuilder();
+ for (Field field : fields) {
+ try {
+ Object val1 = field.get(thiz);
+ Object val2 = field.get(obj);
- // Test hashCodes first
- if (val1 != null && val2 != null && !builder.append(val1.hashCode(), val2.hashCode()).isEquals()) {
- return false;
- }
+ // Test hashCodes first
+ if (val1 != null && val2 != null && !builder.append(val1.hashCode(), val2.hashCode()).isEquals()) {
+ return false;
+ }
- if (!builder.append(val1, val2).isEquals()) {
- return false;
- }
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), field.getName()), e);
- }
- }
- return builder.isEquals();
- }
- return false;
- }
+ if (!builder.append(val1, val2).isEquals()) {
+ return false;
+ }
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), field.getName()), e);
+ }
+ }
+ return builder.isEquals();
+ }
+ return false;
+ }
- /**
- * Retrieve an annotated public field or from inherited public field too
- * @param thiz Object
- * @param annotations Annotations to retrieve on a public field
- * @return First annotated public field
- * @throws NoSuchFieldException If an annotation cannot be found
- */
- public static Field getAnnotatedPublicField(Object thiz, Class<? extends Annotation>... annotations)
- throws NoSuchFieldException {
- AssertTools.assertNotNull(thiz);
- return getAnnotatedPublicField(thiz.getClass(), annotations);
- }
+ /**
+ * Retrieve an annotated public field or from inherited public field too
+ * @param thiz Object
+ * @param annotations Annotations to retrieve on a public field
+ * @return First annotated public field
+ * @throws NoSuchFieldException If an annotation cannot be found
+ */
+ public static Field getAnnotatedPublicField(Object thiz, Class<? extends Annotation>... annotations)
+ throws NoSuchFieldException {
+ AssertTools.assertNotNull(thiz);
+ return getAnnotatedPublicField(thiz.getClass(), annotations);
+ }
- /**
- * Retrieve an annotated from private field or from inherited private, protected or public field
- * @param clazz The class which contains annotations (or inherited class)
- * @param annotations Annotations to retrieve
- * @return First annotated field finded
- * @throws NoSuchFieldException If an annotation cannot be found
- */
- public static Field getAnnotatedPrivateField(Class<?> clazz, Class<? extends Annotation>... annotations)
- throws NoSuchFieldException {
- AssertTools.assertNotNull(clazz);
- AssertTools.assertNotEmpty(annotations);
- AssertTools.assertArrayNotNull(annotations);
- Field[] fields = clazz.getDeclaredFields();
- Field field = null;
- int i = 0;
- while (field == null && i < fields.length) {
- int j = 0;
- while (field == null && j < annotations.length) {
- if (fields[i].isAnnotationPresent(annotations[j])) {
- field = fields[i];
- }
- ++j;
- }
- ++i;
- }
- if (field == null) {
- // if not found
- if (clazz.getSuperclass() == null) {
- throw new NoSuchFieldException(String.format(ANNOTATION, clazz.getName(), Arrays.toString(annotations)));
- }
- // recursive search in the superclass
- return getAnnotatedInheritedField(clazz, clazz.getSuperclass(), annotations);
- }
- return field;
- }
+ /**
+ * Retrieve an annotated from private field or from inherited private, protected or public field
+ * @param clazz The class which contains annotations (or inherited class)
+ * @param annotations Annotations to retrieve
+ * @return First annotated field finded
+ * @throws NoSuchFieldException If an annotation cannot be found
+ */
+ public static Field getAnnotatedPrivateField(Class<?> clazz, Class<? extends Annotation>... annotations)
+ throws NoSuchFieldException {
+ AssertTools.assertNotNull(clazz);
+ AssertTools.assertNotEmpty(annotations);
+ AssertTools.assertArrayNotNull(annotations);
+ Field[] fields = clazz.getDeclaredFields();
+ Field field = null;
+ int i = 0;
+ while (field == null && i < fields.length) {
+ int j = 0;
+ while (field == null && j < annotations.length) {
+ if (fields[i].isAnnotationPresent(annotations[j])) {
+ field = fields[i];
+ }
+ ++j;
+ }
+ ++i;
+ }
+ if (field == null) {
+ // if not found
+ if (clazz.getSuperclass() == null) {
+ throw new NoSuchFieldException(String.format(ANNOTATION, clazz.getName(), Arrays.toString(annotations)));
+ }
+ // recursive search in the superclass
+ return getAnnotatedInheritedField(clazz, clazz.getSuperclass(), annotations);
+ }
+ return field;
+ }
- /**
- * Retrieve an annotated from inherited private, protected or public field
- * @param baseClazz The base clazz where the search began
- * @param browsedClazz The
- * @param annotations Annotations to retrieve
- * @return First annotated field finded
- * @throws NoSuchFieldException If an annotation cannot be found
- */
- private static Field getAnnotatedInheritedField(Class<?> baseClazz, Class<?> browsedClazz,
- Class<? extends Annotation>... annotations) throws NoSuchFieldException {
- AssertTools.assertNotNull(baseClazz);
- AssertTools.assertNotEmpty(annotations);
- AssertTools.assertArrayNotNull(annotations);
+ /**
+ * Retrieve an annotated from inherited private, protected or public field
+ * @param baseClazz The base clazz where the search began
+ * @param browsedClazz The
+ * @param annotations Annotations to retrieve
+ * @return First annotated field finded
+ * @throws NoSuchFieldException If an annotation cannot be found
+ */
+ private static Field getAnnotatedInheritedField(Class<?> baseClazz, Class<?> browsedClazz,
+ Class<? extends Annotation>... annotations) throws NoSuchFieldException {
+ AssertTools.assertNotNull(baseClazz);
+ AssertTools.assertNotEmpty(annotations);
+ AssertTools.assertArrayNotNull(annotations);
- Field[] fields = browsedClazz.getDeclaredFields();
- Field field = null;
- int i = 0;
- while (field == null && i < fields.length) {
- int j = 0;
- while (field == null && j < annotations.length) {
- if (fields[i].isAnnotationPresent(annotations[j])
- && (Modifier.isProtected(fields[i].getModifiers())
- || Modifier.isPublic(fields[i].getModifiers()) || Modifier.isPrivate(fields[i]
- .getModifiers()))) {
- field = fields[i];
- }
- ++j;
- }
- ++i;
- }
- if (field == null) {
- // if not found
- if (browsedClazz.getSuperclass() == null) {
- throw new NoSuchFieldException(String.format(ANNOTATION, baseClazz.getName(), Arrays
- .toString(annotations)));
- }
- // recursive search in the superclass
- getAnnotatedInheritedField(baseClazz, browsedClazz.getSuperclass(), annotations);
- }
- return field;
- }
+ Field[] fields = browsedClazz.getDeclaredFields();
+ Field field = null;
+ int i = 0;
+ while (field == null && i < fields.length) {
+ int j = 0;
+ while (field == null && j < annotations.length) {
+ if (fields[i].isAnnotationPresent(annotations[j])
+ && (Modifier.isProtected(fields[i].getModifiers())
+ || Modifier.isPublic(fields[i].getModifiers()) || Modifier.isPrivate(fields[i]
+ .getModifiers()))) {
+ field = fields[i];
+ }
+ ++j;
+ }
+ ++i;
+ }
+ if (field == null) {
+ // if not found
+ if (browsedClazz.getSuperclass() == null) {
+ throw new NoSuchFieldException(String.format(ANNOTATION, baseClazz.getName(), Arrays
+ .toString(annotations)));
+ }
+ // recursive search in the superclass
+ getAnnotatedInheritedField(baseClazz, browsedClazz.getSuperclass(), annotations);
+ }
+ return field;
+ }
- /**
- * Retrieve an annotated public field
- * @param clazz The class which contains annotations
- * @param annotations Annotations to retrieve on a public field
- * @return First annotated public field
- * @throws NoSuchFieldException If an annotation cannot be found
- */
- public static Field getAnnotatedPublicField(Class<?> clazz, Class<? extends Annotation>... annotations)
- throws NoSuchFieldException {
- AssertTools.assertNotNull(clazz);
- AssertTools.assertNotEmpty(annotations);
- AssertTools.assertArrayNotNull(annotations);
- Field[] fields = clazz.getFields();
- Field field = null;
- int i = 0;
- while (field == null && i < fields.length) {
- int j = 0;
- while (field == null && j < annotations.length) {
- if (fields[i].isAnnotationPresent(annotations[j])) {
- field = fields[i];
- }
- ++j;
- }
- ++i;
- }
- if (field == null) {
- throw new NoSuchFieldException(String.format(ANNOTATION, clazz.getName(), Arrays.toString(annotations)));
- }
- return field;
- }
+ /**
+ * Retrieve an annotated public field
+ * @param clazz The class which contains annotations
+ * @param annotations Annotations to retrieve on a public field
+ * @return First annotated public field
+ * @throws NoSuchFieldException If an annotation cannot be found
+ */
+ public static Field getAnnotatedPublicField(Class<?> clazz, Class<? extends Annotation>... annotations)
+ throws NoSuchFieldException {
+ AssertTools.assertNotNull(clazz);
+ AssertTools.assertNotEmpty(annotations);
+ AssertTools.assertArrayNotNull(annotations);
+ Field[] fields = clazz.getFields();
+ Field field = null;
+ int i = 0;
+ while (field == null && i < fields.length) {
+ int j = 0;
+ while (field == null && j < annotations.length) {
+ if (fields[i].isAnnotationPresent(annotations[j])) {
+ field = fields[i];
+ }
+ ++j;
+ }
+ ++i;
+ }
+ if (field == null) {
+ throw new NoSuchFieldException(String.format(ANNOTATION, clazz.getName(), Arrays.toString(annotations)));
+ }
+ return field;
+ }
- /**
- * Get an annotation on a bean property
- * @param <A> Annotation class
- * @param beanClass Bean class
- * @param annotation Annotation
- * @param property Property name
- * @return The annotation
- * @throws NoSuchFieldException If the property does not exist
- */
- public static <A extends Annotation> A getAnnotationOnProperty(Class<?> beanClass, Class<A> annotation,
- String property) throws NoSuchFieldException {
- AssertTools.assertNotNull(beanClass);
- AssertTools.assertNotNull(annotation);
- return beanClass.getField(property).getAnnotation(annotation);
- }
+ /**
+ * Get an annotation on a bean property
+ * @param <A> Annotation class
+ * @param beanClass Bean class
+ * @param annotation Annotation
+ * @param property Property name
+ * @return The annotation
+ * @throws NoSuchFieldException If the property does not exist
+ */
+ public static <A extends Annotation> A getAnnotationOnProperty(Class<?> beanClass, Class<A> annotation,
+ String property) throws NoSuchFieldException {
+ AssertTools.assertNotNull(beanClass);
+ AssertTools.assertNotNull(annotation);
+ return beanClass.getField(property).getAnnotation(annotation);
+ }
- /**
- * Get a property value for a specified bean
- * @param bean Bean
- * @param accessType Access type
- * @param property Property name
- * @return Property value
- */
- public static Object getValue(Object bean, AccessType accessType, String property) {
- AssertTools.assertNotNull(bean);
- AssertTools.assertNotNull(accessType);
- AssertTools.assertNotEmpty(property);
- Object value;
- switch (accessType) {
- case GETTER:
- try {
- value = new PropertyDescriptor(property, bean.getClass(), "is" + StringUtils.capitalize(property),
- null).getReadMethod().invoke(bean, PARAMETERS);
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- break;
- case FIELD:
- try {
- value = bean.getClass().getField(property).get(bean);
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- break;
- default:
- throw new IllegalArgumentException();
- }
- return value;
- }
+ /**
+ * Get a property value for a specified bean
+ * @param bean Bean
+ * @param accessType Access type
+ * @param property Property name
+ * @return Property value
+ */
+ public static Object getValue(Object bean, AccessType accessType, String property) {
+ AssertTools.assertNotNull(bean);
+ AssertTools.assertNotNull(accessType);
+ AssertTools.assertNotEmpty(property);
+ Object value;
+ switch (accessType) {
+ case GETTER:
+ try {
+ value = new PropertyDescriptor(property, bean.getClass(), "is" + StringUtils.capitalize(property),
+ null).getReadMethod().invoke(bean, PARAMETERS);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(e);
+ }
+ break;
+ case FIELD:
+ try {
+ value = bean.getClass().getField(property).get(bean);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(e);
+ }
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
+ return value;
+ }
- /**
- * Get a property value for a specified bean
- * @param bean Bean
- * @param accessType Access type
- * @param pathToProperty properties path to access the property, example : beanX.beanY.propZ
- * @return Property value
- */
- public static Object getValueFromPath(Object bean, AccessType accessType, String pathToProperty) {
- AssertTools.assertNotNull(bean);
- AssertTools.assertNotNull(accessType);
- AssertTools.assertNotEmpty(pathToProperty);
- List<String> beanNames = createAccessBeanList(pathToProperty);
- Object curBean = bean;
- for (String beanName : beanNames) {
- curBean = BeanTools.getValue(curBean, AccessType.GETTER, beanName);
- }
- return curBean;
- }
+ /**
+ * Get a property value for a specified bean
+ * @param bean Bean
+ * @param accessType Access type
+ * @param pathToProperty properties path to access the property, example : beanX.beanY.propZ
+ * @return Property value
+ */
+ public static Object getValueFromPath(Object bean, AccessType accessType, String pathToProperty) {
+ AssertTools.assertNotNull(bean);
+ AssertTools.assertNotNull(accessType);
+ AssertTools.assertNotEmpty(pathToProperty);
+ List<String> beanNames = createAccessBeanList(pathToProperty);
+ Object curBean = bean;
+ for (String beanName : beanNames) {
+ curBean = BeanTools.getValue(curBean, AccessType.GETTER, beanName);
+ }
+ return curBean;
+ }
- /**
- * Extract from the given path, the differents beans name to access example : "X.Y.Z.F" will give the the array
- * {"X", "Y", "Z", "F"}
- * @param propertiesPath the properties path to browse
- * @return an array of all the different bean names to access
- */
- private static List<String> createAccessBeanList(final String propertiesPath) {
- final Matcher matcher = Pattern.compile("\\w+").matcher(propertiesPath);
- List<String> paramList = new ArrayList<String>();
- while (matcher.find()) {
- paramList.add(propertiesPath.substring(matcher.start(), matcher.end()));
- }
- return paramList;
- }
+ /**
+ * Extract from the given path, the differents beans name to access example : "X.Y.Z.F" will give the the array
+ * {"X", "Y", "Z", "F"}
+ * @param propertiesPath the properties path to browse
+ * @return an array of all the different bean names to access
+ */
+ private static List<String> createAccessBeanList(final String propertiesPath) {
+ final Matcher matcher = Pattern.compile("\\w+").matcher(propertiesPath);
+ List<String> paramList = new ArrayList<String>();
+ while (matcher.find()) {
+ paramList.add(propertiesPath.substring(matcher.start(), matcher.end()));
+ }
+ return paramList;
+ }
- /**
- * HashCode method
- * @param thiz Bean (not null)
- * @param fields Public fields to considere
- * @return HashCode
- */
- public static int hashCode(Object thiz, Field... fields) {
- AssertTools.assertNotNull(thiz);
- AssertTools.assertNotEmpty(fields);
- AssertTools.assertArrayNotNull(fields);
- int seed = thiz.getClass().hashCode();
- int hashCode = seed;
- for (Field field : fields) {
- Object value;
- try {
- value = field.get(thiz);
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), field.getName()), e);
- }
- hashCode += value != null ? seed ^ value.hashCode() : 0;
- }
- return hashCode;
- }
+ /**
+ * HashCode method
+ * @param thiz Bean (not null)
+ * @param fields Public fields to considere
+ * @return HashCode
+ */
+ public static int hashCode(Object thiz, Field... fields) {
+ AssertTools.assertNotNull(thiz);
+ AssertTools.assertNotEmpty(fields);
+ AssertTools.assertArrayNotNull(fields);
+ int seed = thiz.getClass().hashCode();
+ int hashCode = seed;
+ for (Field field : fields) {
+ Object value;
+ try {
+ value = field.get(thiz);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(String.format(FIELD, thiz.getClass(), field.getName()), e);
+ }
+ hashCode += value != null ? seed ^ value.hashCode() : 0;
+ }
+ return hashCode;
+ }
- /**
- * HashCode method
- * @param thiz Bean (not null)
- * @param ids Bean IDs
- * @return HashCode
- */
- public static int hashCode(Object thiz, Object... ids) {
- AssertTools.assertNotNull(thiz);
- AssertTools.assertNotEmpty(ids);
- AssertTools.assertNotNull(ids);
- int seed = thiz.getClass().hashCode();
- int hashCode = seed;
- for (Object id : ids) {
- hashCode += id != null ? seed ^ id.hashCode() : 0;
- }
- return hashCode;
- }
+ /**
+ * HashCode method
+ * @param thiz Bean (not null)
+ * @param ids Bean IDs
+ * @return HashCode
+ */
+ public static int hashCode(Object thiz, Object... ids) {
+ AssertTools.assertNotNull(thiz);
+ AssertTools.assertNotEmpty(ids);
+ AssertTools.assertNotNull(ids);
+ int seed = thiz.getClass().hashCode();
+ int hashCode = seed;
+ for (Object id : ids) {
+ hashCode += id != null ? seed ^ id.hashCode() : 0;
+ }
+ return hashCode;
+ }
- /**
- * Is there an annotation on a bean property
- * @param <A> Annotation class
- * @param beanClass Bean class
- * @param annotation Annotation
- * @param property Property name
- * @return TRUE if the annotation is on the bean property
- * @throws NoSuchFieldException If the property does not exist
- */
- public static <A extends Annotation> boolean isAnnotationOnProperty(Class<?> beanClass, Class<A> annotation,
- String property) throws NoSuchFieldException {
- return getAnnotationOnProperty(beanClass, annotation, property) != null;
- }
+ /**
+ * Is there an annotation on a bean property
+ * @param <A> Annotation class
+ * @param beanClass Bean class
+ * @param annotation Annotation
+ * @param property Property name
+ * @return TRUE if the annotation is on the bean property
+ * @throws NoSuchFieldException If the property does not exist
+ */
+ public static <A extends Annotation> boolean isAnnotationOnProperty(Class<?> beanClass, Class<A> annotation,
+ String property) throws NoSuchFieldException {
+ return getAnnotationOnProperty(beanClass, annotation, property) != null;
+ }
- /**
- * Display a bean by listing the specified properties
- * @param bean Bean
- * @param delimiter Delimiter between properties in the resulting string
- * @param accessType Access type
- * @param pathsToProperties Path of properties to display
- * @return Bean display
- */
- public static String toString(Object bean, String delimiter, AccessType accessType, String... pathsToProperties) {
- AssertTools.assertNotNull(bean);
- AssertTools.assertNotEmpty(delimiter);
- AssertTools.assertArrayNotNull(pathsToProperties);
- Class<?> clazz = bean.getClass();
- StringBuilder builder = new StringBuilder(clazz.getName());
- for (String pathToProperty : pathsToProperties) {
- try {
- Object value = getValueFromPath(bean, accessType, pathToProperty);
- builder.append(delimiter + pathToProperty + ": " + (value != null ? value.toString() : "<null>"));
- } catch (RuntimeException e) {
- throw e;
- } catch (Exception e) {
- throw new IllegalArgumentException(String.format(FIELD, clazz, pathToProperty), e);
- }
- }
- return builder.toString();
- }
+ /**
+ * Display a bean by listing the specified properties
+ * @param bean Bean
+ * @param delimiter Delimiter between properties in the resulting string
+ * @param accessType Access type
+ * @param pathsToProperties Path of properties to display
+ * @return Bean display
+ */
+ public static String toString(Object bean, String delimiter, AccessType accessType, String... pathsToProperties) {
+ AssertTools.assertNotNull(bean);
+ AssertTools.assertNotEmpty(delimiter);
+ AssertTools.assertArrayNotNull(pathsToProperties);
+ Class<?> clazz = bean.getClass();
+ StringBuilder builder = new StringBuilder(clazz.getName());
+ for (String pathToProperty : pathsToProperties) {
+ try {
+ Object value = getValueFromPath(bean, accessType, pathToProperty);
+ builder.append(delimiter + pathToProperty + ": " + (value != null ? value.toString() : "<null>"));
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalArgumentException(String.format(FIELD, clazz, pathToProperty), e);
+ }
+ }
+ return builder.toString();
+ }
- /**
- * Display a bean by listing the specified properties (separated by "\n")
- * @param bean Bean
- * @param accessType Access type
- * @param properties Properties to display
- * @return Bean display
- */
- public static String toString(Object bean, AccessType accessType, String... properties) {
- return toString(bean, "\n- ", accessType, properties);
- }
+ /**
+ * Display a bean by listing the specified properties (separated by "\n")
+ * @param bean Bean
+ * @param accessType Access type
+ * @param properties Properties to display
+ * @return Bean display
+ */
+ public static String toString(Object bean, AccessType accessType, String... properties) {
+ return toString(bean, "\n- ", accessType, properties);
+ }
- /**
- * Constructor (prevents instantiation)
- */
- private BeanTools() {
- //
- }
+ /**
+ * Constructor (prevents instantiation)
+ */
+ private BeanTools() {
+ //
+ }
- /**
- * Display a list of beans by listing the specified properties (bean separated by "\n", properties by ", ")
- * @param beansList The beans list to browsed
- * @param accessType Access type
- * @param pathsToProperties Paths to properties to display
- * @return Bean display
- */
- public static String beanListToString(List<? extends Object> beansList, AccessType accessType,
- String... pathsToProperties) {
- return BeanTools.beanListToString(beansList, "\n", ", ", accessType, pathsToProperties);
- }
+ /**
+ * Display a list of beans by listing the specified properties (bean separated by "\n", properties by ", ")
+ * @param beansList The beans list to browsed
+ * @param accessType Access type
+ * @param pathsToProperties Paths to properties to display
+ * @return Bean display
+ */
+ public static String beanListToString(List<? extends Object> beansList, AccessType accessType,
+ String... pathsToProperties) {
+ return BeanTools.beanListToString(beansList, "\n", ", ", accessType, pathsToProperties);
+ }
- /**
- * Display a list of beans by listing the specified properties
- * @param beansList The beans list to browsed
- * @param delimiterBeans Delimiter between beans in the resulting string
- * @param delimiterProperties Delimiter between properties in the resulting string
- * @param accessType Access type
- * @param pathsToProperties Paths to properties to display
- * @return Bean display
- */
- public static String beanListToString(List<? extends Object> beansList, String delimiterBeans,
- String delimiterProperties, AccessType accessType, String... pathsToProperties) {
- AssertTools.assertNotNull(beansList);
- AssertTools.assertNotEmpty(delimiterProperties);
- AssertTools.assertNotEmpty(delimiterBeans);
- AssertTools.assertNotNull(accessType);
- StringBuilder builder = new StringBuilder();
- Iterator<? extends Object> itBeans = beansList.iterator();
- while (itBeans.hasNext()) {
- Object bean = itBeans.next();
- builder.append(toString(bean, delimiterProperties, accessType, pathsToProperties));
- if (itBeans.hasNext()) {
- builder.append(delimiterBeans);
- }
- }
- return builder.toString();
- }
+ /**
+ * Display a list of beans by listing the specified properties
+ * @param beansList The beans list to browsed
+ * @param delimiterBeans Delimiter between beans in the resulting string
+ * @param delimiterProperties Delimiter between properties in the resulting string
+ * @param accessType Access type
+ * @param pathsToProperties Paths to properties to display
+ * @return Bean display
+ */
+ public static String beanListToString(List<? extends Object> beansList, String delimiterBeans,
+ String delimiterProperties, AccessType accessType, String... pathsToProperties) {
+ AssertTools.assertNotNull(beansList);
+ AssertTools.assertNotEmpty(delimiterProperties);
+ AssertTools.assertNotEmpty(delimiterBeans);
+ AssertTools.assertNotNull(accessType);
+ StringBuilder builder = new StringBuilder();
+ Iterator<? extends Object> itBeans = beansList.iterator();
+ while (itBeans.hasNext()) {
+ Object bean = itBeans.next();
+ builder.append(toString(bean, delimiterProperties, accessType, pathsToProperties));
+ if (itBeans.hasNext()) {
+ builder.append(delimiterBeans);
+ }
+ }
+ return builder.toString();
+ }
- /**
- * Wrapping of Apache communs BeanComparator. Create a comparator which compares two beans by the specified bean
- * property. Property expression can use Apache's nested, indexed, combinated, mapped syntax. @see <a
- * href="http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/BeanCo…">Apache's Bean
- * Comparator</a> for more details.
- * @param <T> generic type
- * @param propertyExpression propertyExpression
- * @return the comparator
- */
- @SuppressWarnings("unchecked")
- public static <T> Comparator<T> createPropertyComparator(final String propertyExpression) {
- return new BeanComparator(propertyExpression);
- }
+ /**
+ * Wrapping of Apache communs BeanComparator. Create a comparator which compares two beans by the specified bean
+ * property. Property expression can use Apache's nested, indexed, combinated, mapped syntax. @see <a
+ * href="http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/BeanCo…">Apache's Bean
+ * Comparator</a> for more details.
+ * @param <T> generic type
+ * @param propertyExpression propertyExpression
+ * @return the comparator
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> Comparator<T> createPropertyComparator(final String propertyExpression) {
+ return new BeanComparator(propertyExpression);
+ }
- /**
- * Wrapping of Apache communs BeanComparator to avoid "unchecked" tag in code. Create a comparator which compares
- * two beans by the specified bean property. Property expression can use Apache's nested, indexed, combinated,
- * mapped syntax. @see <a
- * href="http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/BeanCo…">Apache's Bean
- * Comparator</a> for more details.
- * @param <T> generic type
- * @param propertyExpression PropertyExpression
- * @param comparator BeanComparator will pass the values of the specified bean property to this Comparator. If your
- * bean property is not a comparable or contains null values, a suitable comparator may be supplied in this
- * constructor
- * @return the Comparator being used to compare beans
- */
- @SuppressWarnings("unchecked")
- public static <T> Comparator<T> createPropertyComparator(final String propertyExpression, Comparator<T> comparator) {
- return new BeanComparator(propertyExpression, comparator);
- }
+ /**
+ * Wrapping of Apache communs BeanComparator to avoid "unchecked" tag in code. Create a comparator which compares
+ * two beans by the specified bean property. Property expression can use Apache's nested, indexed, combinated,
+ * mapped syntax. @see <a
+ * href="http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/BeanCo…">Apache's Bean
+ * Comparator</a> for more details.
+ * @param <T> generic type
+ * @param propertyExpression PropertyExpression
+ * @param comparator BeanComparator will pass the values of the specified bean property to this Comparator. If your
+ * bean property is not a comparable or contains null values, a suitable comparator may be supplied in this
+ * constructor
+ * @return the Comparator being used to compare beans
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> Comparator<T> createPropertyComparator(final String propertyExpression, Comparator<T> comparator) {
+ return new BeanComparator(propertyExpression, comparator);
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CaptchaTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CaptchaTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CaptchaTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,25 +30,25 @@
*/
public final class CaptchaTools {
- /** Captcha max length */
- public static final int CAPTCHA_LENGTH_MAX = 6;
+ /** Captcha max length */
+ public static final int CAPTCHA_LENGTH_MAX = 6;
- /** Captcha min length */
- public static final int CAPTCHA_LENGTH_MIN = 3;
+ /** Captcha min length */
+ public static final int CAPTCHA_LENGTH_MIN = 3;
- /**
- * Generate a random numeric catpcha
- * @return Captcha
- */
- public static String random() {
- return RandomStringUtils
- .randomNumeric((int) (Math.random() * (CAPTCHA_LENGTH_MAX - CAPTCHA_LENGTH_MIN) + CAPTCHA_LENGTH_MIN));
- }
+ /**
+ * Generate a random numeric catpcha
+ * @return Captcha
+ */
+ public static String random() {
+ return RandomStringUtils
+ .randomNumeric((int) (Math.random() * (CAPTCHA_LENGTH_MAX - CAPTCHA_LENGTH_MIN) + CAPTCHA_LENGTH_MIN));
+ }
- /**
- * Constructor (prevents from instantiation)
- */
- private CaptchaTools() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private CaptchaTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CollectionTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CollectionTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CollectionTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,205 +40,205 @@
*/
public final class CollectionTools {
- /**
- * Test if all collection's values contain always the same value
- * @param <T> Collection type
- * @param collection Collection to parse
- * @param value Value which is tested for the identity (may be null)
- * @return The answer
- */
- public static <T> boolean containsOnlySameValue(Collection<T> collection, T value) {
- AssertTools.assertNotNull(collection);
+ /**
+ * Test if all collection's values contain always the same value
+ * @param <T> Collection type
+ * @param collection Collection to parse
+ * @param value Value which is tested for the identity (may be null)
+ * @return The answer
+ */
+ public static <T> boolean containsOnlySameValue(Collection<T> collection, T value) {
+ AssertTools.assertNotNull(collection);
- if (collection.isEmpty()) {
- return false;
- }
+ if (collection.isEmpty()) {
+ return false;
+ }
- boolean hasSame = true;
- Iterator<T> itCol = collection.iterator();
- while (hasSame && itCol.hasNext()) {
- T curVal = itCol.next();
- if (!ObjectUtils.equals(curVal, value)) {
- hasSame = false;
- }
- }
- return hasSame;
- }
+ boolean hasSame = true;
+ Iterator<T> itCol = collection.iterator();
+ while (hasSame && itCol.hasNext()) {
+ T curVal = itCol.next();
+ if (!ObjectUtils.equals(curVal, value)) {
+ hasSame = false;
+ }
+ }
+ return hasSame;
+ }
- /**
- * Intersection of two sets
- * @param <T> Set type
- * @param s1 Set 1
- * @param s2 Set 2
- * @return Intersection
- */
- public static <T> Set<T> intersect(Set<T> s1, Set<T> s2) {
- Set<T> intersect = s1 == null ? new HashSet<T>() : new HashSet<T>(s1);
- intersect.retainAll(s2);
- return intersect;
- }
+ /**
+ * Intersection of two sets
+ * @param <T> Set type
+ * @param s1 Set 1
+ * @param s2 Set 2
+ * @return Intersection
+ */
+ public static <T> Set<T> intersect(Set<T> s1, Set<T> s2) {
+ Set<T> intersect = s1 == null ? new HashSet<T>() : new HashSet<T>(s1);
+ intersect.retainAll(s2);
+ return intersect;
+ }
- /**
- * Setter for collections, preserving the instance
- * @param <T> Collection type
- * @param collectionToWrite Collection to write
- * @param collectionToRead Collection to read
- */
- public static <T> void setter(Collection<T> collectionToWrite, Collection<T> collectionToRead) {
- AssertTools.assertNotNull(collectionToWrite);
- collectionToWrite.clear();
- if (collectionToRead != null) {
- collectionToWrite.addAll(collectionToRead);
- }
- }
+ /**
+ * Setter for collections, preserving the instance
+ * @param <T> Collection type
+ * @param collectionToWrite Collection to write
+ * @param collectionToRead Collection to read
+ */
+ public static <T> void setter(Collection<T> collectionToWrite, Collection<T> collectionToRead) {
+ AssertTools.assertNotNull(collectionToWrite);
+ collectionToWrite.clear();
+ if (collectionToRead != null) {
+ collectionToWrite.addAll(collectionToRead);
+ }
+ }
- /**
- * Check in a collection of beans if a property has a specific value
- * @param collection The collection to parse
- * @param pathToProperty The path to the tested bean property (for each bean in the collection), example :
- * beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @param value The value to find
- * @return true if the value is found, otherwise false
- */
- public static boolean containsWithValue(Collection<? extends Object> collection, String pathToProperty,
- AccessType accessType, Object value) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
- for (Object curBean : collection) {
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- if (curVal.equals(value)) {
- return true;
- }
- }
- return false;
- }
+ /**
+ * Check in a collection of beans if a property has a specific value
+ * @param collection The collection to parse
+ * @param pathToProperty The path to the tested bean property (for each bean in the collection), example :
+ * beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @param value The value to find
+ * @return true if the value is found, otherwise false
+ */
+ public static boolean containsWithValue(Collection<? extends Object> collection, String pathToProperty,
+ AccessType accessType, Object value) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
+ for (Object curBean : collection) {
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ if (curVal.equals(value)) {
+ return true;
+ }
+ }
+ return false;
+ }
- /**
- * Count in a collection of beans the number of beans which have a specific value
- * @param collection The collection to parse
- * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @param value The value to find
- * @return The count result
- */
- public static int countWithValue(Collection<? extends Object> collection, String pathToProperty,
- AccessType accessType, Object value) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
- int count = 0;
- for (Object curBean : collection) {
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- if (value.equals(curVal)) {
- count++;
- }
- }
- return count;
- }
+ /**
+ * Count in a collection of beans the number of beans which have a specific value
+ * @param collection The collection to parse
+ * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @param value The value to find
+ * @return The count result
+ */
+ public static int countWithValue(Collection<? extends Object> collection, String pathToProperty,
+ AccessType accessType, Object value) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
+ int count = 0;
+ for (Object curBean : collection) {
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ if (value.equals(curVal)) {
+ count++;
+ }
+ }
+ return count;
+ }
- /**
- * Get from a beans collection the first bean which have a property with a specific value. If the value is not
- * found, return null
- * @param <T> The beans class in the collection
- * @param collection The collection to parse
- * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @param value The value to find
- * @return The bean with the specific value, null if not found
- */
- public static <T extends Object> T findWithValue(List<T> collection, String pathToProperty, AccessType accessType,
- Object value) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
- for (T curBean : collection) {
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- if (value.equals(curVal)) {
- return curBean;
- }
- }
- return null;
- }
+ /**
+ * Get from a beans collection the first bean which have a property with a specific value. If the value is not
+ * found, return null
+ * @param <T> The beans class in the collection
+ * @param collection The collection to parse
+ * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @param value The value to find
+ * @return The bean with the specific value, null if not found
+ */
+ public static <T extends Object> T findWithValue(List<T> collection, String pathToProperty, AccessType accessType,
+ Object value) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
+ for (T curBean : collection) {
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ if (value.equals(curVal)) {
+ return curBean;
+ }
+ }
+ return null;
+ }
- /**
- * Remove in a collection of beans the beans which have a specific value. If the value is found, remove it and
- * return true.
- * @param collection The collection to parse
- * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @param value The value to find
- * @return true if found, false otherwise
- */
- public static boolean removeWithValue(Collection<? extends Object> collection, String pathToProperty,
- AccessType accessType, Object value) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
- boolean hasDeleted = false;
+ /**
+ * Remove in a collection of beans the beans which have a specific value. If the value is found, remove it and
+ * return true.
+ * @param collection The collection to parse
+ * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @param value The value to find
+ * @return true if found, false otherwise
+ */
+ public static boolean removeWithValue(Collection<? extends Object> collection, String pathToProperty,
+ AccessType accessType, Object value) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
+ boolean hasDeleted = false;
- Iterator<? extends Object> itList = collection.iterator();
- while (itList.hasNext()) {
- Object curBean = itList.next();
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- if (value.equals(curVal)) {
- itList.remove();
- hasDeleted = true;
- }
- }
- return hasDeleted;
- }
+ Iterator<? extends Object> itList = collection.iterator();
+ while (itList.hasNext()) {
+ Object curBean = itList.next();
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ if (value.equals(curVal)) {
+ itList.remove();
+ hasDeleted = true;
+ }
+ }
+ return hasDeleted;
+ }
- /**
- * Remove in a collection of beans the beans which have a specifics values. If on these values are found, remove
- * them and return true.
- * @param collection The collection to parse
- * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @param values The values to find
- * @return true if at least one value is found, false otherwise
- */
- public static boolean removeAllWithValue(Collection<? extends Object> collection, String pathToProperty,
- AccessType accessType, Collection<? extends Object> values) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
- boolean hasDeleted = false;
+ /**
+ * Remove in a collection of beans the beans which have a specifics values. If on these values are found, remove
+ * them and return true.
+ * @param collection The collection to parse
+ * @param pathToProperty The path to the tested bean property, example : beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @param values The values to find
+ * @return true if at least one value is found, false otherwise
+ */
+ public static boolean removeAllWithValue(Collection<? extends Object> collection, String pathToProperty,
+ AccessType accessType, Collection<? extends Object> values) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
+ boolean hasDeleted = false;
- Iterator<? extends Object> itList = collection.iterator();
- while (itList.hasNext()) {
- Object curBean = itList.next();
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- if (curVal != null && values.contains(curVal)) {
- itList.remove();
- hasDeleted = true;
- }
- }
- return hasDeleted;
- }
+ Iterator<? extends Object> itList = collection.iterator();
+ while (itList.hasNext()) {
+ Object curBean = itList.next();
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ if (curVal != null && values.contains(curVal)) {
+ itList.remove();
+ hasDeleted = true;
+ }
+ }
+ return hasDeleted;
+ }
- /**
- * Build a list from values properties of a bean list. Ex : From a beans list which contains the property "name",
- * you can build the list of these names.
- * @param collection The beans list to parse
- * @param pathToProperty The path to the bean property, example : beanX.beanY.propZ
- * @param accessType The access type to reach each property value
- * @return These values
- */
- public static List<Object> valuesFromList(Collection<? extends Object> collection, String pathToProperty,
- AccessType accessType) {
- AssertTools.assertNotNull(collection);
- AssertTools.assertNotEmpty(pathToProperty);
+ /**
+ * Build a list from values properties of a bean list. Ex : From a beans list which contains the property "name",
+ * you can build the list of these names.
+ * @param collection The beans list to parse
+ * @param pathToProperty The path to the bean property, example : beanX.beanY.propZ
+ * @param accessType The access type to reach each property value
+ * @return These values
+ */
+ public static List<Object> valuesFromList(Collection<? extends Object> collection, String pathToProperty,
+ AccessType accessType) {
+ AssertTools.assertNotNull(collection);
+ AssertTools.assertNotEmpty(pathToProperty);
- List<Object> values = new ArrayList<Object>();
- for (Object curBean : collection) {
- Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
- values.add(curVal);
- }
- return values;
- }
+ List<Object> values = new ArrayList<Object>();
+ for (Object curBean : collection) {
+ Object curVal = BeanTools.getValueFromPath(curBean, accessType, pathToProperty);
+ values.add(curVal);
+ }
+ return values;
+ }
- /**
- * Constructor (prevents instantiation)
- */
- private CollectionTools() {
- //
- }
+ /**
+ * Constructor (prevents instantiation)
+ */
+ private CollectionTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CoordTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CoordTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/CoordTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,323 +36,323 @@
*/
public final class CoordTools {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Degrees character */
- public static final char DEGREES = '°';
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Degrees character */
+ public static final char DEGREES = '°';
- /** Latitude length */
- public static final int LATITUDE_LENGTH = 11;
+ /** Latitude length */
+ public static final int LATITUDE_LENGTH = 11;
- /** Latitude max degrees */
- public static final int LATITUDE_MAX_DEGREES = 90;
+ /** Latitude max degrees */
+ public static final int LATITUDE_MAX_DEGREES = 90;
- /** Latitude max minutes */
- public static final String LATITUDE_MAX_MINUTES_STRING = "59.999";
+ /** Latitude max minutes */
+ public static final String LATITUDE_MAX_MINUTES_STRING = "59.999";
- /** Latitude max minutes */
- public static final BigDecimal LATITUDE_MAX_MINUTES = new BigDecimal(LATITUDE_MAX_MINUTES_STRING);
+ /** Latitude max minutes */
+ public static final BigDecimal LATITUDE_MAX_MINUTES = new BigDecimal(LATITUDE_MAX_MINUTES_STRING);
- /** Latitude min degrees */
- public static final int LATITUDE_MIN_DEGREES = 0;
+ /** Latitude min degrees */
+ public static final int LATITUDE_MIN_DEGREES = 0;
- /** Latitude min minutes */
- public static final String LATITUDE_MIN_MINUTES_STRING = "00.000";
+ /** Latitude min minutes */
+ public static final String LATITUDE_MIN_MINUTES_STRING = "00.000";
- /** Latitude min minutes */
- public static final BigDecimal LATITUDE_MIN_MINUTES = new BigDecimal(LATITUDE_MIN_MINUTES_STRING);
+ /** Latitude min minutes */
+ public static final BigDecimal LATITUDE_MIN_MINUTES = new BigDecimal(LATITUDE_MIN_MINUTES_STRING);
- /** Latitude orientations */
- public static final Character[] LATITUDE_ORIENTATIONS = { 'N', 'S' };
+ /** Latitude orientations */
+ public static final Character[] LATITUDE_ORIENTATIONS = { 'N', 'S' };
- /** Latitude pattern */
- private static final Pattern LATITUDE_PATTERN;
+ /** Latitude pattern */
+ private static final Pattern LATITUDE_PATTERN;
- /** Longitude length */
- public static final int LONGITUDE_LENGTH = 12;
+ /** Longitude length */
+ public static final int LONGITUDE_LENGTH = 12;
- /** Longitude max degrees */
- public static final int LONGITUDE_MAX_DEGREES = 180;
+ /** Longitude max degrees */
+ public static final int LONGITUDE_MAX_DEGREES = 180;
- /** Longitude max minutes */
- public static final String LONGITUDE_MAX_MINUTES_STRING = "59.999";
+ /** Longitude max minutes */
+ public static final String LONGITUDE_MAX_MINUTES_STRING = "59.999";
- /** Longitude max minutes */
- public static final BigDecimal LONGITUDE_MAX_MINUTES = new BigDecimal(LONGITUDE_MAX_MINUTES_STRING);
+ /** Longitude max minutes */
+ public static final BigDecimal LONGITUDE_MAX_MINUTES = new BigDecimal(LONGITUDE_MAX_MINUTES_STRING);
- /** Longitude min degrees */
- public static final int LONGITUDE_MIN_DEGREES = 0;
+ /** Longitude min degrees */
+ public static final int LONGITUDE_MIN_DEGREES = 0;
- /** Longitude min minutes */
- public static final String LONGITUDE_MIN_MINUTES_STRING = "00.000";
+ /** Longitude min minutes */
+ public static final String LONGITUDE_MIN_MINUTES_STRING = "00.000";
- /** Longitude min minutes */
- public static final BigDecimal LONGITUDE_MIN_MINUTES = new BigDecimal(LONGITUDE_MIN_MINUTES_STRING);
+ /** Longitude min minutes */
+ public static final BigDecimal LONGITUDE_MIN_MINUTES = new BigDecimal(LONGITUDE_MIN_MINUTES_STRING);
- /** Longitude orientations */
- public static final Character[] LONGITUDE_ORIENTATIONS = { 'E', 'W' };
+ /** Longitude orientations */
+ public static final Character[] LONGITUDE_ORIENTATIONS = { 'E', 'W' };
- /** Longitude pattern */
- private static final Pattern LONGITUDE_PATTERN;
+ /** Longitude pattern */
+ private static final Pattern LONGITUDE_PATTERN;
- /** Minutes character */
- public static final char MINUTES = '\'';
+ /** Minutes character */
+ public static final char MINUTES = '\'';
- /** Minutes blank */
- private static final char MINUTES_BLANK = '0';
+ /** Minutes blank */
+ private static final char MINUTES_BLANK = '0';
- /** Minutes decimal length */
- private static final int MINUTES_DECIMAL_LENGTH;
+ /** Minutes decimal length */
+ private static final int MINUTES_DECIMAL_LENGTH;
- /** Minutes integer length */
- private static final int MINUTES_INTEGER_LENGTH;
+ /** Minutes integer length */
+ private static final int MINUTES_INTEGER_LENGTH;
- /** Minutes separator */
- public static final char MINUTES_SEPARATOR = '.';
+ /** Minutes separator */
+ public static final char MINUTES_SEPARATOR = '.';
- /** Minutes separator */
- private static final String MINUTES_SEPARATOR_PATTERN = "\\.";
+ /** Minutes separator */
+ private static final String MINUTES_SEPARATOR_PATTERN = "\\.";
- static {
- String[] md = LONGITUDE_MAX_MINUTES_STRING.split(MINUTES_SEPARATOR_PATTERN);
+ static {
+ String[] md = LONGITUDE_MAX_MINUTES_STRING.split(MINUTES_SEPARATOR_PATTERN);
- MINUTES_INTEGER_LENGTH = md[0].length();
- MINUTES_DECIMAL_LENGTH = md[1].length();
+ MINUTES_INTEGER_LENGTH = md[0].length();
+ MINUTES_DECIMAL_LENGTH = md[1].length();
- String patternMinutes = "[0-9]";
- String patternDegrees = "[ 0-9]";
+ String patternMinutes = "[0-9]";
+ String patternDegrees = "[ 0-9]";
- StringBuilder pattern = new StringBuilder("^(");
- for (int i = 0; i < String.valueOf(LATITUDE_MAX_DEGREES).length(); ++i) {
- pattern.append(patternDegrees);
- }
- pattern.append(')');
- pattern.append(DEGREES);
- pattern.append('(');
- for (int i = 0; i < MINUTES_INTEGER_LENGTH; ++i) {
- pattern.append(patternMinutes);
- }
- pattern.append(")");
- pattern.append(MINUTES_SEPARATOR_PATTERN);
- pattern.append('(');
- for (int i = 0; i < MINUTES_DECIMAL_LENGTH; ++i) {
- pattern.append(patternMinutes);
- }
- pattern.append(')');
- pattern.append(MINUTES);
- pattern.append("([");
- for (char o : LATITUDE_ORIENTATIONS) {
- pattern.append(o);
- }
- pattern.append("])$");
- LATITUDE_PATTERN = Pattern.compile(pattern.toString());
+ StringBuilder pattern = new StringBuilder("^(");
+ for (int i = 0; i < String.valueOf(LATITUDE_MAX_DEGREES).length(); ++i) {
+ pattern.append(patternDegrees);
+ }
+ pattern.append(')');
+ pattern.append(DEGREES);
+ pattern.append('(');
+ for (int i = 0; i < MINUTES_INTEGER_LENGTH; ++i) {
+ pattern.append(patternMinutes);
+ }
+ pattern.append(")");
+ pattern.append(MINUTES_SEPARATOR_PATTERN);
+ pattern.append('(');
+ for (int i = 0; i < MINUTES_DECIMAL_LENGTH; ++i) {
+ pattern.append(patternMinutes);
+ }
+ pattern.append(')');
+ pattern.append(MINUTES);
+ pattern.append("([");
+ for (char o : LATITUDE_ORIENTATIONS) {
+ pattern.append(o);
+ }
+ pattern.append("])$");
+ LATITUDE_PATTERN = Pattern.compile(pattern.toString());
- pattern = new StringBuilder("^(");
- for (int i = 0; i < String.valueOf(LONGITUDE_MAX_DEGREES).length(); ++i) {
- pattern.append(patternDegrees);
- }
- pattern.append(')');
- pattern.append(DEGREES);
- pattern.append('(');
- for (int i = 0; i < MINUTES_INTEGER_LENGTH; ++i) {
- pattern.append(patternMinutes);
- }
- pattern.append(")");
- pattern.append(MINUTES_SEPARATOR_PATTERN);
- pattern.append('(');
- for (int i = 0; i < MINUTES_DECIMAL_LENGTH; ++i) {
- pattern.append(patternMinutes);
- }
- pattern.append(')');
- pattern.append(MINUTES);
- pattern.append("([");
- for (char o : LONGITUDE_ORIENTATIONS) {
- pattern.append(o);
- }
- pattern.append("])$");
+ pattern = new StringBuilder("^(");
+ for (int i = 0; i < String.valueOf(LONGITUDE_MAX_DEGREES).length(); ++i) {
+ pattern.append(patternDegrees);
+ }
+ pattern.append(')');
+ pattern.append(DEGREES);
+ pattern.append('(');
+ for (int i = 0; i < MINUTES_INTEGER_LENGTH; ++i) {
+ pattern.append(patternMinutes);
+ }
+ pattern.append(")");
+ pattern.append(MINUTES_SEPARATOR_PATTERN);
+ pattern.append('(');
+ for (int i = 0; i < MINUTES_DECIMAL_LENGTH; ++i) {
+ pattern.append(patternMinutes);
+ }
+ pattern.append(')');
+ pattern.append(MINUTES);
+ pattern.append("([");
+ for (char o : LONGITUDE_ORIENTATIONS) {
+ pattern.append(o);
+ }
+ pattern.append("])$");
- LONGITUDE_PATTERN = Pattern.compile(pattern.toString());
- }
+ LONGITUDE_PATTERN = Pattern.compile(pattern.toString());
+ }
- /**
- * Format a latitude (dd.mm.sss"o)
- * @param d Degrees (0-90)
- * @param m Minutes (00.000-59.999)
- * @param o Orientation (N-S)
- * @return Latitude
- */
- public static String latitude(Integer d, BigDecimal m, Character o) {
- // Check values
- AssertTools.assertGreaterOrEquals(d, LATITUDE_MIN_DEGREES);
- AssertTools.assertLowerOrEquals(d, LATITUDE_MAX_DEGREES);
- AssertTools.assertGreaterOrEquals(m, LATITUDE_MIN_MINUTES);
- AssertTools.assertLowerOrEquals(m, LATITUDE_MAX_MINUTES);
- AssertTools.assertIn(Character.toUpperCase(o), LATITUDE_ORIENTATIONS);
- // Format values
- // LOG.debug(m);
- // LOG.debug(NumberTools.doubleToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH));
- String[] md = NumberTools.bigDecimalToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH,
- 2).split(MINUTES_SEPARATOR_PATTERN);
- // LOG.debug(md);
- return StringUtils.leftPad(String.valueOf(d), String.valueOf(LATITUDE_MAX_DEGREES).length()) + DEGREES
- + StringUtils.leftPad(String.valueOf(md[0]), MINUTES_INTEGER_LENGTH, MINUTES_BLANK) + MINUTES_SEPARATOR
- + StringUtils.rightPad(md[1], MINUTES_DECIMAL_LENGTH, MINUTES_BLANK) + MINUTES
- + Character.toUpperCase(o);
- }
+ /**
+ * Format a latitude (dd.mm.sss"o)
+ * @param d Degrees (0-90)
+ * @param m Minutes (00.000-59.999)
+ * @param o Orientation (N-S)
+ * @return Latitude
+ */
+ public static String latitude(Integer d, BigDecimal m, Character o) {
+ // Check values
+ AssertTools.assertGreaterOrEquals(d, LATITUDE_MIN_DEGREES);
+ AssertTools.assertLowerOrEquals(d, LATITUDE_MAX_DEGREES);
+ AssertTools.assertGreaterOrEquals(m, LATITUDE_MIN_MINUTES);
+ AssertTools.assertLowerOrEquals(m, LATITUDE_MAX_MINUTES);
+ AssertTools.assertIn(Character.toUpperCase(o), LATITUDE_ORIENTATIONS);
+ // Format values
+ // LOG.debug(m);
+ // LOG.debug(NumberTools.doubleToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH));
+ String[] md = NumberTools.bigDecimalToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH,
+ 2).split(MINUTES_SEPARATOR_PATTERN);
+ // LOG.debug(md);
+ return StringUtils.leftPad(String.valueOf(d), String.valueOf(LATITUDE_MAX_DEGREES).length()) + DEGREES
+ + StringUtils.leftPad(String.valueOf(md[0]), MINUTES_INTEGER_LENGTH, MINUTES_BLANK) + MINUTES_SEPARATOR
+ + StringUtils.rightPad(md[1], MINUTES_DECIMAL_LENGTH, MINUTES_BLANK) + MINUTES
+ + Character.toUpperCase(o);
+ }
- /**
- * Retrieve the degrees from a complete latitude
- * @param latitude Latitude
- * @return Degrees
- */
- public static Integer latitudeDegrees(String latitude) {
- if (StringUtils.isEmpty(latitude)) {
- return null;
- }
- Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
- matcher.lookingAt();
- return Integer.valueOf(matcher.group(1).trim());
- }
+ /**
+ * Retrieve the degrees from a complete latitude
+ * @param latitude Latitude
+ * @return Degrees
+ */
+ public static Integer latitudeDegrees(String latitude) {
+ if (StringUtils.isEmpty(latitude)) {
+ return null;
+ }
+ Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
+ matcher.lookingAt();
+ return Integer.valueOf(matcher.group(1).trim());
+ }
- /**
- * Retrieve the minutes from a complete latitude
- * @param latitude Latitude
- * @return Minutes
- */
- public static BigDecimal latitudeMinutes(String latitude) {
- if (StringUtils.isEmpty(latitude)) {
- return null;
- }
- Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
- matcher.lookingAt();
- return NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3), Locale.ENGLISH,
- MINUTES_DECIMAL_LENGTH, 2);
- }
+ /**
+ * Retrieve the minutes from a complete latitude
+ * @param latitude Latitude
+ * @return Minutes
+ */
+ public static BigDecimal latitudeMinutes(String latitude) {
+ if (StringUtils.isEmpty(latitude)) {
+ return null;
+ }
+ Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
+ matcher.lookingAt();
+ return NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3), Locale.ENGLISH,
+ MINUTES_DECIMAL_LENGTH, 2);
+ }
- /**
- * Retrieve the orientation from a complete latitude
- * @param latitude Latitude
- * @return Orientation
- */
- public static Character latitudeOrientation(String latitude) {
- if (StringUtils.isEmpty(latitude)) {
- return null;
- }
- Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
- matcher.lookingAt();
- return Character.valueOf(matcher.group(4).charAt(0));
- }
+ /**
+ * Retrieve the orientation from a complete latitude
+ * @param latitude Latitude
+ * @return Orientation
+ */
+ public static Character latitudeOrientation(String latitude) {
+ if (StringUtils.isEmpty(latitude)) {
+ return null;
+ }
+ Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
+ matcher.lookingAt();
+ return Character.valueOf(matcher.group(4).charAt(0));
+ }
- /**
- * Format a longitude (ddd.mm'ss"o)
- * @param d Degrees (0-180)
- * @param m Minutes (00.000-59.999)
- * @param o Orientation (E-W)
- * @return Longitude
- */
- public static String longitude(Integer d, BigDecimal m, Character o) {
- // Check values
- AssertTools.assertGreaterOrEquals(d, LONGITUDE_MIN_DEGREES);
- AssertTools.assertLowerOrEquals(d, LONGITUDE_MAX_DEGREES);
- AssertTools.assertGreaterOrEquals(m, LONGITUDE_MIN_MINUTES);
- AssertTools.assertLowerOrEquals(m, LONGITUDE_MAX_MINUTES);
- AssertTools.assertIn(Character.toUpperCase(o), LONGITUDE_ORIENTATIONS);
- // Format values
- String[] md = NumberTools.bigDecimalToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH,
- 3).split(MINUTES_SEPARATOR_PATTERN);
- return StringUtils.leftPad(String.valueOf(d), String.valueOf(LONGITUDE_MAX_DEGREES).length()) + DEGREES
- + StringUtils.leftPad(String.valueOf(md[0]), MINUTES_INTEGER_LENGTH, MINUTES_BLANK) + MINUTES_SEPARATOR
- + StringUtils.rightPad(md[1], MINUTES_DECIMAL_LENGTH, MINUTES_BLANK) + MINUTES
- + Character.toUpperCase(o);
- }
+ /**
+ * Format a longitude (ddd.mm'ss"o)
+ * @param d Degrees (0-180)
+ * @param m Minutes (00.000-59.999)
+ * @param o Orientation (E-W)
+ * @return Longitude
+ */
+ public static String longitude(Integer d, BigDecimal m, Character o) {
+ // Check values
+ AssertTools.assertGreaterOrEquals(d, LONGITUDE_MIN_DEGREES);
+ AssertTools.assertLowerOrEquals(d, LONGITUDE_MAX_DEGREES);
+ AssertTools.assertGreaterOrEquals(m, LONGITUDE_MIN_MINUTES);
+ AssertTools.assertLowerOrEquals(m, LONGITUDE_MAX_MINUTES);
+ AssertTools.assertIn(Character.toUpperCase(o), LONGITUDE_ORIENTATIONS);
+ // Format values
+ String[] md = NumberTools.bigDecimalToString(m, Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, MINUTES_DECIMAL_LENGTH,
+ 3).split(MINUTES_SEPARATOR_PATTERN);
+ return StringUtils.leftPad(String.valueOf(d), String.valueOf(LONGITUDE_MAX_DEGREES).length()) + DEGREES
+ + StringUtils.leftPad(String.valueOf(md[0]), MINUTES_INTEGER_LENGTH, MINUTES_BLANK) + MINUTES_SEPARATOR
+ + StringUtils.rightPad(md[1], MINUTES_DECIMAL_LENGTH, MINUTES_BLANK) + MINUTES
+ + Character.toUpperCase(o);
+ }
- /**
- * Retrieve the degrees from a complete longitude
- * @param longitude Longitude
- * @return Degrees
- */
- public static Integer longitudeDegrees(String longitude) {
- if (StringUtils.isEmpty(longitude)) {
- return null;
- }
- Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
- matcher.lookingAt();
- return Integer.valueOf(matcher.group(1).trim());
- }
+ /**
+ * Retrieve the degrees from a complete longitude
+ * @param longitude Longitude
+ * @return Degrees
+ */
+ public static Integer longitudeDegrees(String longitude) {
+ if (StringUtils.isEmpty(longitude)) {
+ return null;
+ }
+ Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
+ matcher.lookingAt();
+ return Integer.valueOf(matcher.group(1).trim());
+ }
- /**
- * Retrieve the minutes from a complete longitude
- * @param longitude Longitude
- * @return Minutes
- */
- public static BigDecimal longitudeMinutes(String longitude) {
- if (StringUtils.isEmpty(longitude)) {
- return null;
- }
- Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
- matcher.lookingAt();
- return NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3), Locale.ENGLISH,
- MINUTES_DECIMAL_LENGTH, 3);
- }
+ /**
+ * Retrieve the minutes from a complete longitude
+ * @param longitude Longitude
+ * @return Minutes
+ */
+ public static BigDecimal longitudeMinutes(String longitude) {
+ if (StringUtils.isEmpty(longitude)) {
+ return null;
+ }
+ Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
+ matcher.lookingAt();
+ return NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3), Locale.ENGLISH,
+ MINUTES_DECIMAL_LENGTH, 3);
+ }
- /**
- * Retrieve the orientation from a complete longitude
- * @param longitude Longitude
- * @return Orientation
- */
- public static Character longitudeOrientation(String longitude) {
- if (StringUtils.isEmpty(longitude)) {
- return null;
- }
- Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
- matcher.lookingAt();
- return Character.valueOf(matcher.group(4).charAt(0));
- }
+ /**
+ * Retrieve the orientation from a complete longitude
+ * @param longitude Longitude
+ * @return Orientation
+ */
+ public static Character longitudeOrientation(String longitude) {
+ if (StringUtils.isEmpty(longitude)) {
+ return null;
+ }
+ Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
+ matcher.lookingAt();
+ return Character.valueOf(matcher.group(4).charAt(0));
+ }
- /**
- * Validate a latitude (ddd.mm.sss"o)
- * @param latitude Latitude
- * @return TRUE if the latitude is valid
- */
- public static boolean validateLatitude(String latitude) {
- AssertTools.assertNotEmpty(latitude);
+ /**
+ * Validate a latitude (ddd.mm.sss"o)
+ * @param latitude Latitude
+ * @return TRUE if the latitude is valid
+ */
+ public static boolean validateLatitude(String latitude) {
+ AssertTools.assertNotEmpty(latitude);
- Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
- if (matcher.lookingAt()) {
- int d = Integer.valueOf(matcher.group(1).trim());
- BigDecimal m = NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3),
- Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, 2);
- // if the latitude is 90 with others minutes, return false
- return d >= LATITUDE_MIN_DEGREES && d <= LATITUDE_MAX_DEGREES && LATITUDE_MIN_MINUTES.compareTo(m) <= 0
- && LATITUDE_MAX_MINUTES.compareTo(m) >= 0 && (d != 90 || new BigDecimal("0.000").compareTo(m) == 0);
- }
- return false;
- }
+ Matcher matcher = LATITUDE_PATTERN.matcher(latitude);
+ if (matcher.lookingAt()) {
+ int d = Integer.valueOf(matcher.group(1).trim());
+ BigDecimal m = NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3),
+ Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, 2);
+ // if the latitude is 90 with others minutes, return false
+ return d >= LATITUDE_MIN_DEGREES && d <= LATITUDE_MAX_DEGREES && LATITUDE_MIN_MINUTES.compareTo(m) <= 0
+ && LATITUDE_MAX_MINUTES.compareTo(m) >= 0 && (d != 90 || new BigDecimal("0.000").compareTo(m) == 0);
+ }
+ return false;
+ }
- /**
- * Validate a longitude (dd.mm.sss"o)
- * @param longitude Longitude
- * @return TRUE if the longitude is valid
- */
- public static boolean validateLongitude(String longitude) {
- AssertTools.assertNotEmpty(longitude);
- Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
- if (matcher.lookingAt()) {
- int d = Integer.valueOf(matcher.group(1).trim());
- BigDecimal m = NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3),
- Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, 3);
- // if the longitude is 180 with others minutes, return false
- return d >= LONGITUDE_MIN_DEGREES && d <= LONGITUDE_MAX_DEGREES && LONGITUDE_MIN_MINUTES.compareTo(m) <= 0
- && LATITUDE_MAX_MINUTES.compareTo(m) >= 0
- && (d != 180 || new BigDecimal("0.000").compareTo(m) == 0);
- }
- return false;
- }
+ /**
+ * Validate a longitude (dd.mm.sss"o)
+ * @param longitude Longitude
+ * @return TRUE if the longitude is valid
+ */
+ public static boolean validateLongitude(String longitude) {
+ AssertTools.assertNotEmpty(longitude);
+ Matcher matcher = LONGITUDE_PATTERN.matcher(longitude);
+ if (matcher.lookingAt()) {
+ int d = Integer.valueOf(matcher.group(1).trim());
+ BigDecimal m = NumberTools.parseBigDecimal(matcher.group(2) + MINUTES_SEPARATOR + matcher.group(3),
+ Locale.ENGLISH, MINUTES_DECIMAL_LENGTH, 3);
+ // if the longitude is 180 with others minutes, return false
+ return d >= LONGITUDE_MIN_DEGREES && d <= LONGITUDE_MAX_DEGREES && LONGITUDE_MIN_MINUTES.compareTo(m) <= 0
+ && LATITUDE_MAX_MINUTES.compareTo(m) >= 0
+ && (d != 180 || new BigDecimal("0.000").compareTo(m) == 0);
+ }
+ return false;
+ }
- /**
- * Constructor
- */
- private CoordTools() {
- //
- }
+ /**
+ * Constructor
+ */
+ private CoordTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenerateCsv.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenerateCsv.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenerateCsv.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,121 +35,121 @@
*/
public class GenerateCsv {
- /** delimiter de colonne */
- private char columnsSeparator;
- /** Copyright, pour Ird par défaut */
- private String copyright;
- /** Encoding utilisé pour le CSV */
- private String encoding;
-
- /** Copyright utilisé par défaut, pour l'IRD en français */
- private final static String DEFAULT_COPYRIGHT = "©IRD tous droits réservés";
-
- /** static varable for UTF-8 encoding */
- public static final String CHARSET_UTF_8 ="UTF-8";
+ /** delimiter de colonne */
+ private char columnsSeparator;
+ /** Copyright, pour Ird par défaut */
+ private String copyright;
+ /** Encoding utilisé pour le CSV */
+ private String encoding;
+
+ /** Copyright utilisé par défaut, pour l'IRD en français */
+ private final static String DEFAULT_COPYRIGHT = "©IRD tous droits réservés";
+
+ /** static varable for UTF-8 encoding */
+ public static final String CHARSET_UTF_8 ="UTF-8";
- /** static varable for ISO_8859_1 encoding */
- public static final String CHARSET_ISO_8859_1 ="ISO-8859-1";
-
- /**
- * Constructeur par défaut
- */
- public GenerateCsv(){
- this(';',CHARSET_UTF_8);
- }
-
- /**
- * Constructeur
- * @param encoding utilisé pour le CSV
- */
- public GenerateCsv(String encoding){
- this(';',encoding);
- }
-
- /**
- * Constructeur
- *
- * @param columnsSeparator caractère utilisé comme délimiteur de colonne
- * @param encoding utilisé pour le CSV
- */
- public GenerateCsv(char columnsSeparator, String encoding){
- setColumnsSeparator(columnsSeparator);
- setEncoding(encoding);
- setCopyright(DEFAULT_COPYRIGHT);
- }
-
- /**
- * Rend un flux qui décrit un ensemble de données en respectant le format CSV
- *
- * @param data données à écrire
- * @param withCopyright si vrai, un copyright est ajouté à la dernière ligne
- * @return le flux de donnée en sortie
- * @throws IOException exception parvenue dans les traitements entrée/sortie du fichier
- */
- public ByteArrayOutputStream writeCSV(List<String[]> data, boolean withCopyright) throws IOException{
-
- ByteArrayOutputStream csvStream = new ByteArrayOutputStream();
- OutputStreamWriter outWriter = new OutputStreamWriter(csvStream, encoding);
-
- CSVWriter csvWriter = new CSVWriter(outWriter, this.getColumnsSeparator());
- // paramétrage de l'écriture du CSV
-
- //écriture des données
- csvWriter.writeAll(data);
- if (withCopyright){
- //écriture du copyright
- csvWriter.writeNext(new String[]{getCopyright()});
- }
- csvWriter.close();
- return csvStream;
- }
-
- /**
- * copyright getter
- * @return copyright
- */
- public String getCopyright() {
- return copyright;
- }
+ /** static varable for ISO_8859_1 encoding */
+ public static final String CHARSET_ISO_8859_1 ="ISO-8859-1";
+
+ /**
+ * Constructeur par défaut
+ */
+ public GenerateCsv(){
+ this(';',CHARSET_UTF_8);
+ }
+
+ /**
+ * Constructeur
+ * @param encoding utilisé pour le CSV
+ */
+ public GenerateCsv(String encoding){
+ this(';',encoding);
+ }
+
+ /**
+ * Constructeur
+ *
+ * @param columnsSeparator caractère utilisé comme délimiteur de colonne
+ * @param encoding utilisé pour le CSV
+ */
+ public GenerateCsv(char columnsSeparator, String encoding){
+ setColumnsSeparator(columnsSeparator);
+ setEncoding(encoding);
+ setCopyright(DEFAULT_COPYRIGHT);
+ }
+
+ /**
+ * Rend un flux qui décrit un ensemble de données en respectant le format CSV
+ *
+ * @param data données à écrire
+ * @param withCopyright si vrai, un copyright est ajouté à la dernière ligne
+ * @return le flux de donnée en sortie
+ * @throws IOException exception parvenue dans les traitements entrée/sortie du fichier
+ */
+ public ByteArrayOutputStream writeCSV(List<String[]> data, boolean withCopyright) throws IOException{
+
+ ByteArrayOutputStream csvStream = new ByteArrayOutputStream();
+ OutputStreamWriter outWriter = new OutputStreamWriter(csvStream, encoding);
+
+ CSVWriter csvWriter = new CSVWriter(outWriter, this.getColumnsSeparator());
+ // paramétrage de l'écriture du CSV
+
+ //écriture des données
+ csvWriter.writeAll(data);
+ if (withCopyright){
+ //écriture du copyright
+ csvWriter.writeNext(new String[]{getCopyright()});
+ }
+ csvWriter.close();
+ return csvStream;
+ }
+
+ /**
+ * copyright getter
+ * @return copyright
+ */
+ public String getCopyright() {
+ return copyright;
+ }
- /**
- * copyright setter
- * @param copyright copyright
- */
- public void setCopyright(String copyright) {
- this.copyright = copyright;
- }
+ /**
+ * copyright setter
+ * @param copyright copyright
+ */
+ public void setCopyright(String copyright) {
+ this.copyright = copyright;
+ }
- /**
- * columnsSeparator getter
- * @return columnsSeparator
- */
- public char getColumnsSeparator() {
- return columnsSeparator;
- }
+ /**
+ * columnsSeparator getter
+ * @return columnsSeparator
+ */
+ public char getColumnsSeparator() {
+ return columnsSeparator;
+ }
- /**
- * columnsSeparator setter
- * @param columnsSeparator columnsSeparator
- */
- public void setColumnsSeparator(char columnsSeparator) {
- this.columnsSeparator = columnsSeparator;
- }
+ /**
+ * columnsSeparator setter
+ * @param columnsSeparator columnsSeparator
+ */
+ public void setColumnsSeparator(char columnsSeparator) {
+ this.columnsSeparator = columnsSeparator;
+ }
- /**
- * encoding getter
- * @return encoding
- */
- public String getEncoding() {
- return encoding;
- }
+ /**
+ * encoding getter
+ * @return encoding
+ */
+ public String getEncoding() {
+ return encoding;
+ }
- /**
- * encoding setter
- * @param encoding encoding
- */
- public void setEncoding(String encoding) {
- this.encoding = encoding;
- }
+ /**
+ * encoding setter
+ * @param encoding encoding
+ */
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenericsTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenericsTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/GenericsTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,33 +32,33 @@
@SuppressWarnings("restriction")
public final class GenericsTools {
- /**
- * Object cast
- * @param <I> Input type
- * @param <O> Output type
- * @param i Input object
- * @return Output object
- */
- @SuppressWarnings("unchecked")
- public static <I, O extends I> O cast(I i) {
- return (O) i;
- }
+ /**
+ * Object cast
+ * @param <I> Input type
+ * @param <O> Output type
+ * @param i Input object
+ * @return Output object
+ */
+ @SuppressWarnings("unchecked")
+ public static <I, O extends I> O cast(I i) {
+ return (O) i;
+ }
- /**
- * Constructor (prevents instantiation)
- */
- private GenericsTools() {
- //
- }
-
- /**
- * Return the class where this method is called
- * @return this class
- */
- public static Class<?> getCallerClass(){
- // Warning, access type of this method is forbidden (you must configure your IDE tu use it)
- // work only with SUN JVM
- return Reflection.getCallerClass(1);
- }
-
+ /**
+ * Constructor (prevents instantiation)
+ */
+ private GenericsTools() {
+ //
+ }
+
+ /**
+ * Return the class where this method is called
+ * @return this class
+ */
+ public static Class<?> getCallerClass(){
+ // Warning, access type of this method is forbidden (you must configure your IDE tu use it)
+ // work only with SUN JVM
+ return Reflection.getCallerClass(1);
+ }
+
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/IntuitiveStringComparator.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/IntuitiveStringComparator.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/IntuitiveStringComparator.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,122 +49,122 @@
*/
public class IntuitiveStringComparator<T extends CharSequence> implements Comparator<T> {
- /** string 1 */
- private T str1;
+ /** string 1 */
+ private T str1;
- /** string 2 */
- private T str2;
+ /** string 2 */
+ private T str2;
- /** posistion 1 */
- private int pos1;
+ /** posistion 1 */
+ private int pos1;
- /** position 2 */
- private int pos2;
+ /** position 2 */
+ private int pos2;
- /** lenght 1 */
- private int len1;
+ /** lenght 1 */
+ private int len1;
- /** length 2 */
- private int len2;
+ /** length 2 */
+ private int len2;
- /** {@inheritDoc} */
- @Override
- public int compare(T s1, T s2) {
- str1 = s1;
- str2 = s2;
- len1 = str1.length();
- len2 = str2.length();
- pos1 = pos2 = 0;
+ /** {@inheritDoc} */
+ @Override
+ public int compare(T s1, T s2) {
+ str1 = s1;
+ str2 = s2;
+ len1 = str1.length();
+ len2 = str2.length();
+ pos1 = pos2 = 0;
- if (len1 == 0) {
- return len2 == 0 ? 0 : -1;
- } else if (len2 == 0) {
- return 1;
- }
+ if (len1 == 0) {
+ return len2 == 0 ? 0 : -1;
+ } else if (len2 == 0) {
+ return 1;
+ }
- while (pos1 < len1 && pos2 < len2) {
- char ch1 = str1.charAt(pos1);
- char ch2 = str2.charAt(pos2);
- int result = 0;
+ while (pos1 < len1 && pos2 < len2) {
+ char ch1 = str1.charAt(pos1);
+ char ch2 = str2.charAt(pos2);
+ int result = 0;
- if (Character.isDigit(ch1)) {
- result = Character.isDigit(ch2) ? compareNumbers() : -1;
- } else if (Character.isLetter(ch1)) {
- result = Character.isLetter(ch2) ? compareOther(true) : 1;
- } else {
- result = Character.isDigit(ch2) ? 1 : Character.isLetter(ch2) ? -1 : compareOther(false);
- }
+ if (Character.isDigit(ch1)) {
+ result = Character.isDigit(ch2) ? compareNumbers() : -1;
+ } else if (Character.isLetter(ch1)) {
+ result = Character.isLetter(ch2) ? compareOther(true) : 1;
+ } else {
+ result = Character.isDigit(ch2) ? 1 : Character.isLetter(ch2) ? -1 : compareOther(false);
+ }
- if (result != 0) {
- return result;
- }
- }
+ if (result != 0) {
+ return result;
+ }
+ }
- return len1 - len2;
- }
+ return len1 - len2;
+ }
- /**
- * Compare numbers
- * @return the integer response
- */
- private int compareNumbers() {
- int delta = 0;
- int zeroes1 = 0, zeroes2 = 0;
- char ch1 = (char) 0, ch2 = (char) 0;
+ /**
+ * Compare numbers
+ * @return the integer response
+ */
+ private int compareNumbers() {
+ int delta = 0;
+ int zeroes1 = 0, zeroes2 = 0;
+ char ch1 = (char) 0, ch2 = (char) 0;
- // Skip leading zeroes, but keep a count of them.
- while (pos1 < len1 && (ch1 = str1.charAt(pos1++)) == '0') {
- zeroes1++;
- }
- while (pos2 < len2 && (ch2 = str2.charAt(pos2++)) == '0') {
- zeroes2++;
- }
+ // Skip leading zeroes, but keep a count of them.
+ while (pos1 < len1 && (ch1 = str1.charAt(pos1++)) == '0') {
+ zeroes1++;
+ }
+ while (pos2 < len2 && (ch2 = str2.charAt(pos2++)) == '0') {
+ zeroes2++;
+ }
- // If one sequence contains more significant digits than the
- // other, it's a larger number. In case they turn out to have
- // equal lengths, we compare digits at each position; the first
- // unequal pair determines which is the bigger number.
- while (true) {
- boolean noMoreDigits1 = (ch1 == 0) || !Character.isDigit(ch1);
- boolean noMoreDigits2 = (ch2 == 0) || !Character.isDigit(ch2);
+ // If one sequence contains more significant digits than the
+ // other, it's a larger number. In case they turn out to have
+ // equal lengths, we compare digits at each position; the first
+ // unequal pair determines which is the bigger number.
+ while (true) {
+ boolean noMoreDigits1 = (ch1 == 0) || !Character.isDigit(ch1);
+ boolean noMoreDigits2 = (ch2 == 0) || !Character.isDigit(ch2);
- if (noMoreDigits1 && noMoreDigits2) {
- return delta != 0 ? delta : zeroes1 - zeroes2;
- } else if (noMoreDigits1) {
- return -1;
- } else if (noMoreDigits2) {
- return 1;
- } else if (delta == 0 && ch1 != ch2) {
- delta = ch1 - ch2;
- }
+ if (noMoreDigits1 && noMoreDigits2) {
+ return delta != 0 ? delta : zeroes1 - zeroes2;
+ } else if (noMoreDigits1) {
+ return -1;
+ } else if (noMoreDigits2) {
+ return 1;
+ } else if (delta == 0 && ch1 != ch2) {
+ delta = ch1 - ch2;
+ }
- ch1 = pos1 < len1 ? str1.charAt(pos1++) : (char) 0;
- ch2 = pos2 < len2 ? str2.charAt(pos2++) : (char) 0;
- }
- }
+ ch1 = pos1 < len1 ? str1.charAt(pos1++) : (char) 0;
+ ch2 = pos2 < len2 ? str2.charAt(pos2++) : (char) 0;
+ }
+ }
- /**
- * Compare other characters
- * @param isLetters true if characters are letters
- * @return the integer response
- */
- private int compareOther(boolean isLetters) {
- char ch1 = str1.charAt(pos1++);
- char ch2 = str2.charAt(pos2++);
+ /**
+ * Compare other characters
+ * @param isLetters true if characters are letters
+ * @return the integer response
+ */
+ private int compareOther(boolean isLetters) {
+ char ch1 = str1.charAt(pos1++);
+ char ch2 = str2.charAt(pos2++);
- if (ch1 == ch2) {
- return 0;
- }
+ if (ch1 == ch2) {
+ return 0;
+ }
- if (isLetters) {
- ch1 = Character.toUpperCase(ch1);
- ch2 = Character.toUpperCase(ch2);
- if (ch1 != ch2) {
- ch1 = Character.toLowerCase(ch1);
- ch2 = Character.toLowerCase(ch2);
- }
- }
+ if (isLetters) {
+ ch1 = Character.toUpperCase(ch1);
+ ch2 = Character.toUpperCase(ch2);
+ if (ch1 != ch2) {
+ ch1 = Character.toLowerCase(ch1);
+ ch2 = Character.toLowerCase(ch2);
+ }
+ }
- return ch1 - ch2;
- }
+ return ch1 - ch2;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/LogTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/LogTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/LogTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,21 +32,21 @@
*/
public final class LogTools {
- /**
- * Create a logger by retrieving the caller class. This method is expensive, so you may use it only once in each
- * class.
- * @return Logger
- */
- public static Log getLog() {
- //old methode to get the class in a static methode
- //new LogConfigurationException().fillInStackTrace().getStackTrace()[1].getClassName()
- return LogFactory.getLog(GenericsTools.getCallerClass());
- }
+ /**
+ * Create a logger by retrieving the caller class. This method is expensive, so you may use it only once in each
+ * class.
+ * @return Logger
+ */
+ public static Log getLog() {
+ //old methode to get the class in a static methode
+ //new LogConfigurationException().fillInStackTrace().getStackTrace()[1].getClassName()
+ return LogFactory.getLog(GenericsTools.getCallerClass());
+ }
- /**
- * Constructor (prevents from instantiation)
- */
- private LogTools() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private LogTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/NumberTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/NumberTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/NumberTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,152 +37,152 @@
*/
public final class NumberTools {
- /**
- * Constructor (prevents instantiation)
- */
- private NumberTools() {
- //
- }
+ /**
+ * Constructor (prevents instantiation)
+ */
+ private NumberTools() {
+ //
+ }
- /**
- * Returns null if the value if zero
- * @param <N> Number type
- * @param n Number value
- * @return The value or null if zero
- */
- public static <N extends Number> N nullIfZero(N n) {
- return n == null || n.doubleValue() == 0D ? null : n;
- }
+ /**
+ * Returns null if the value if zero
+ * @param <N> Number type
+ * @param n Number value
+ * @return The value or null if zero
+ */
+ public static <N extends Number> N nullIfZero(N n) {
+ return n == null || n.doubleValue() == 0D ? null : n;
+ }
- /**
- * Parse a double from a String. If the number is not recognize with locale separator, try with '.' decimal
- * separator.
- * @param value String value to parse
- * @param locale The locale which define the decimal separator
- * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
- * @return The double rounded according to maxFractionDigit (HALF_UP rounding mode)
- */
- public static Double parseDouble(final String value, final Locale locale, final int maxFractionDigit) {
- AssertTools.assertNotEmpty(value);
- AssertTools.assertNotNull(locale);
+ /**
+ * Parse a double from a String. If the number is not recognize with locale separator, try with '.' decimal
+ * separator.
+ * @param value String value to parse
+ * @param locale The locale which define the decimal separator
+ * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
+ * @return The double rounded according to maxFractionDigit (HALF_UP rounding mode)
+ */
+ public static Double parseDouble(final String value, final Locale locale, final int maxFractionDigit) {
+ AssertTools.assertNotEmpty(value);
+ AssertTools.assertNotNull(locale);
- DecimalFormat fmt = (DecimalFormat) DecimalFormat.getNumberInstance(locale);
- fmt.setMaximumFractionDigits(maxFractionDigit);
- fmt.setRoundingMode(RoundingMode.HALF_UP);
+ DecimalFormat fmt = (DecimalFormat) DecimalFormat.getNumberInstance(locale);
+ fmt.setMaximumFractionDigits(maxFractionDigit);
+ fmt.setRoundingMode(RoundingMode.HALF_UP);
- ParsePosition position = new ParsePosition(0);
- Number nb = (Number) fmt.parseObject(value, position);
+ ParsePosition position = new ParsePosition(0);
+ Number nb = (Number) fmt.parseObject(value, position);
- if (position.getIndex() != value.length()) {
- // second try with '.' for decimal separator
- if (value.charAt(position.getIndex()) == '.') {
- DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
- symbols.setDecimalSeparator('.');
- fmt.setDecimalFormatSymbols(symbols);
+ if (position.getIndex() != value.length()) {
+ // second try with '.' for decimal separator
+ if (value.charAt(position.getIndex()) == '.') {
+ DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
+ symbols.setDecimalSeparator('.');
+ fmt.setDecimalFormatSymbols(symbols);
- position = new ParsePosition(0);
- nb = (Number) fmt.parseObject(value, position);
- if (position.getIndex() != value.length()) {
- throw new NumberFormatException("Cannot convert '" + value
- + "' to Double. Parse failed at position " + position.getIndex() + ".");
- }
- } else {
- throw new NumberFormatException("Cannot convert '" + value + "' to Double. Parse failed at position "
- + position.getIndex() + ".");
- }
- }
- return nb.doubleValue();
- }
+ position = new ParsePosition(0);
+ nb = (Number) fmt.parseObject(value, position);
+ if (position.getIndex() != value.length()) {
+ throw new NumberFormatException("Cannot convert '" + value
+ + "' to Double. Parse failed at position " + position.getIndex() + ".");
+ }
+ } else {
+ throw new NumberFormatException("Cannot convert '" + value + "' to Double. Parse failed at position "
+ + position.getIndex() + ".");
+ }
+ }
+ return nb.doubleValue();
+ }
- /**
- * Parse a big decimal from a String. If the number is not recognize with locale separator, try with '.' decimal
- * separator
- * @param value String value to parse
- * @param locale The locale which define the decimal separator
- * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
- * @param maxIntegerDigit The maximum number of digits allowed in the integer portion
- * @return The big decimal with a specified precision
- */
- public static BigDecimal parseBigDecimal(final String value, final Locale locale, final int maxFractionDigit,
- final int maxIntegerDigit) {
- AssertTools.assertNotEmpty(value);
- AssertTools.assertNotNull(locale);
+ /**
+ * Parse a big decimal from a String. If the number is not recognize with locale separator, try with '.' decimal
+ * separator
+ * @param value String value to parse
+ * @param locale The locale which define the decimal separator
+ * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
+ * @param maxIntegerDigit The maximum number of digits allowed in the integer portion
+ * @return The big decimal with a specified precision
+ */
+ public static BigDecimal parseBigDecimal(final String value, final Locale locale, final int maxFractionDigit,
+ final int maxIntegerDigit) {
+ AssertTools.assertNotEmpty(value);
+ AssertTools.assertNotNull(locale);
- DecimalFormat fmt = (DecimalFormat) NumberFormat.getNumberInstance(locale);
- fmt.setMaximumFractionDigits(maxFractionDigit);
- fmt.setMaximumIntegerDigits(maxIntegerDigit);
- fmt.setParseBigDecimal(true);
+ DecimalFormat fmt = (DecimalFormat) NumberFormat.getNumberInstance(locale);
+ fmt.setMaximumFractionDigits(maxFractionDigit);
+ fmt.setMaximumIntegerDigits(maxIntegerDigit);
+ fmt.setParseBigDecimal(true);
- ParsePosition position = new ParsePosition(0);
- BigDecimal bd = (BigDecimal) fmt.parseObject(value, position);
+ ParsePosition position = new ParsePosition(0);
+ BigDecimal bd = (BigDecimal) fmt.parseObject(value, position);
- if (position.getIndex() != value.length()) {
- // second try with '.' for decimal separator
- if (value.charAt(position.getIndex()) == '.') {
- DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
- symbols.setDecimalSeparator('.');
- fmt.setDecimalFormatSymbols(symbols);
+ if (position.getIndex() != value.length()) {
+ // second try with '.' for decimal separator
+ if (value.charAt(position.getIndex()) == '.') {
+ DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
+ symbols.setDecimalSeparator('.');
+ fmt.setDecimalFormatSymbols(symbols);
- position = new ParsePosition(0);
- bd = (BigDecimal) fmt.parseObject(value, position);
- if (position.getIndex() != value.length()) {
- throw new NumberFormatException("Cannot convert '" + value
- + "' to BigDecimal. Parse failed at position " + position.getIndex() + ".");
- }
- } else {
- throw new NumberFormatException("Cannot convert '" + value
- + "' to BigDecimal. Parse failed at position " + position.getIndex() + ".");
- }
- }
+ position = new ParsePosition(0);
+ bd = (BigDecimal) fmt.parseObject(value, position);
+ if (position.getIndex() != value.length()) {
+ throw new NumberFormatException("Cannot convert '" + value
+ + "' to BigDecimal. Parse failed at position " + position.getIndex() + ".");
+ }
+ } else {
+ throw new NumberFormatException("Cannot convert '" + value
+ + "' to BigDecimal. Parse failed at position " + position.getIndex() + ".");
+ }
+ }
- return bd;
- }
+ return bd;
+ }
- /**
- * Give the string representation of a double
- * @param value The double
- * @param locale The locale which define the decimal separator
- * @param minFractionDigit the minimum number of digits allowed in the fraction portion
- * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
- * @return The double rounded according to maxFractionDigit (HALF_UP rounding mode)
- */
- public static String doubleToString(final Double value, final Locale locale, final int minFractionDigit,
- final int maxFractionDigit) {
- AssertTools.assertNotNull(value);
- AssertTools.assertNotNull(locale);
+ /**
+ * Give the string representation of a double
+ * @param value The double
+ * @param locale The locale which define the decimal separator
+ * @param minFractionDigit the minimum number of digits allowed in the fraction portion
+ * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
+ * @return The double rounded according to maxFractionDigit (HALF_UP rounding mode)
+ */
+ public static String doubleToString(final Double value, final Locale locale, final int minFractionDigit,
+ final int maxFractionDigit) {
+ AssertTools.assertNotNull(value);
+ AssertTools.assertNotNull(locale);
- NumberFormat fmt = NumberFormat.getInstance(locale);
- if (fmt != null) {
- fmt.setMinimumFractionDigits(minFractionDigit);
- fmt.setMaximumFractionDigits(maxFractionDigit);
- fmt.setRoundingMode(RoundingMode.HALF_UP);
- return fmt.format(value);
- }
- return value.toString();
- }
+ NumberFormat fmt = NumberFormat.getInstance(locale);
+ if (fmt != null) {
+ fmt.setMinimumFractionDigits(minFractionDigit);
+ fmt.setMaximumFractionDigits(maxFractionDigit);
+ fmt.setRoundingMode(RoundingMode.HALF_UP);
+ return fmt.format(value);
+ }
+ return value.toString();
+ }
- /**
- * Give the string representation of a big decimal
- * @param value The big decimal
- * @param locale The locale which define the decimal separator
- * @param minFractionDigit the minimum number of digits allowed in the fraction portion
- * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
- * @param maxIntegerDigit The maximum number of digits allowed in the integer portion
- * @return The big decimal with a specified precision
- */
- public static String bigDecimalToString(final BigDecimal value, final Locale locale, final int minFractionDigit,
- final int maxFractionDigit, final int maxIntegerDigit) {
- AssertTools.assertNotNull(value);
- AssertTools.assertNotNull(locale);
+ /**
+ * Give the string representation of a big decimal
+ * @param value The big decimal
+ * @param locale The locale which define the decimal separator
+ * @param minFractionDigit the minimum number of digits allowed in the fraction portion
+ * @param maxFractionDigit The maximum number of digits allowed in the fraction portion
+ * @param maxIntegerDigit The maximum number of digits allowed in the integer portion
+ * @return The big decimal with a specified precision
+ */
+ public static String bigDecimalToString(final BigDecimal value, final Locale locale, final int minFractionDigit,
+ final int maxFractionDigit, final int maxIntegerDigit) {
+ AssertTools.assertNotNull(value);
+ AssertTools.assertNotNull(locale);
- NumberFormat fmt = NumberFormat.getInstance(locale);
- if (fmt != null) {
- fmt.setMinimumFractionDigits(minFractionDigit);
- fmt.setMaximumFractionDigits(maxFractionDigit);
- fmt.setMaximumIntegerDigits(maxIntegerDigit);
- fmt.setRoundingMode(RoundingMode.HALF_UP);
- return fmt.format(value);
- }
- return value.toString();
- }
+ NumberFormat fmt = NumberFormat.getInstance(locale);
+ if (fmt != null) {
+ fmt.setMinimumFractionDigits(minFractionDigit);
+ fmt.setMaximumFractionDigits(maxFractionDigit);
+ fmt.setMaximumIntegerDigits(maxIntegerDigit);
+ fmt.setRoundingMode(RoundingMode.HALF_UP);
+ return fmt.format(value);
+ }
+ return value.toString();
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/Pair.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/Pair.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/Pair.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,67 +35,67 @@
*/
public final class Pair<K, V> implements Entry<K, V>, Serializable {
- /** First element */
- private K key;
+ /** First element */
+ private K key;
- /** Second element */
- private V value;
+ /** Second element */
+ private V value;
- /**
- * Constructor
- */
- public Pair() {
- //
- }
+ /**
+ * Constructor
+ */
+ public Pair() {
+ //
+ }
- /**
- * Constructor
- * @param key First element
- * @param value Second element
- */
- public Pair(K key, V value) {
- this();
- this.key = key;
- this.value = value;
- }
+ /**
+ * Constructor
+ * @param key First element
+ * @param value Second element
+ */
+ public Pair(K key, V value) {
+ this();
+ this.key = key;
+ this.value = value;
+ }
- /** @see java.lang.Object#equals(java.lang.Object) */
- @Override
- public boolean equals(Object obj) {
- return BeanTools.equals(this, obj, AccessType.GETTER, "key", "value");
- }
+ /** @see java.lang.Object#equals(java.lang.Object) */
+ @Override
+ public boolean equals(Object obj) {
+ return BeanTools.equals(this, obj, AccessType.GETTER, "key", "value");
+ }
- /** {@inheritDoc} */
- @Override
- public K getKey() {
- return key;
- }
+ /** {@inheritDoc} */
+ @Override
+ public K getKey() {
+ return key;
+ }
- /** {@inheritDoc} */
- @Override
- public V getValue() {
- return value;
- }
+ /** {@inheritDoc} */
+ @Override
+ public V getValue() {
+ return value;
+ }
- /** @see java.lang.Object#hashCode() **/
- @Override
- public int hashCode() {
- return BeanTools.hashCode(this, getKey(), getValue());
- }
+ /** @see java.lang.Object#hashCode() **/
+ @Override
+ public int hashCode() {
+ return BeanTools.hashCode(this, getKey(), getValue());
+ }
- /**
- * key setter
- * @param key key
- */
- public void setKey(K key) {
- this.key = key;
- }
+ /**
+ * key setter
+ * @param key key
+ */
+ public void setKey(K key) {
+ this.key = key;
+ }
- /** {@inheritDoc} */
- @Override
- public V setValue(V value) {
- V oldValue = this.value;
- this.value = value;
- return oldValue;
- }
+ /** {@inheritDoc} */
+ @Override
+ public V setValue(V value) {
+ V oldValue = this.value;
+ this.value = value;
+ return oldValue;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/PasswordTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/PasswordTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/PasswordTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,51 +31,51 @@
*/
public final class PasswordTools {
- /** Password MD5 length */
- public static final int MD5_LENGTH = 32;
+ /** Password MD5 length */
+ public static final int MD5_LENGTH = 32;
- /** Password max length */
- public static final int PASSWORD_LENGTH_MAX = 12;
+ /** Password max length */
+ public static final int PASSWORD_LENGTH_MAX = 12;
- /** Password min length */
- public static final int PASSWORD_LENGTH_MIN = 5;
+ /** Password min length */
+ public static final int PASSWORD_LENGTH_MIN = 5;
- /** Password SHA1 length */
- public static final int SHA1_LENGTH = 40;
+ /** Password SHA1 length */
+ public static final int SHA1_LENGTH = 40;
- /**
- * Hash a password with the MD5 algorithm
- * @param password Password
- * @return Hashed password
- */
- public static String md5(String password) {
- AssertTools.assertNotNull(password);
- return DigestUtils.md5Hex(password);
- }
+ /**
+ * Hash a password with the MD5 algorithm
+ * @param password Password
+ * @return Hashed password
+ */
+ public static String md5(String password) {
+ AssertTools.assertNotNull(password);
+ return DigestUtils.md5Hex(password);
+ }
- /**
- * Generate a random password
- * @return Password
- */
- public static String random() {
- return RandomStringUtils
- .randomAlphanumeric((int) (Math.random() * (PASSWORD_LENGTH_MAX - PASSWORD_LENGTH_MIN) + PASSWORD_LENGTH_MIN));
- }
+ /**
+ * Generate a random password
+ * @return Password
+ */
+ public static String random() {
+ return RandomStringUtils
+ .randomAlphanumeric((int) (Math.random() * (PASSWORD_LENGTH_MAX - PASSWORD_LENGTH_MIN) + PASSWORD_LENGTH_MIN));
+ }
- /**
- * Hash a password with the SHA-1 algorithm
- * @param password Password
- * @return Hashed password
- */
- public static String sha1(String password) {
- AssertTools.assertNotNull(password);
- return DigestUtils.shaHex(password);
- }
+ /**
+ * Hash a password with the SHA-1 algorithm
+ * @param password Password
+ * @return Hashed password
+ */
+ public static String sha1(String password) {
+ AssertTools.assertNotNull(password);
+ return DigestUtils.shaHex(password);
+ }
- /**
- * Constructor (prevents from instantiation)
- */
- private PasswordTools() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private PasswordTools() {
+ //
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTools.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTools.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTools.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,169 +40,169 @@
*/
public final class StringTools {
- /**
- * Create a string representing a list of couples (key + value)
- * @param <O1> Keys type
- * @param <O2> Values type
- * @param couples Couples (key + value)
- * @param separatorKeysValues Separator between keys and values
- * @param separatorCouples Separator between couples
- * @return String representing the list of couples, or null if empty
- */
- public static <O1, O2> String couplesToString(Map<O1, O2> couples, String separatorKeysValues,
- String separatorCouples) {
- AssertTools.assertNotNull(couples);
- AssertTools.assertNotNull(separatorKeysValues);
- AssertTools.assertNotNull(separatorCouples);
- StringBuilder builder = new StringBuilder();
- for (Entry<O1, O2> entry : couples.entrySet()) {
- builder.append(entry.getKey() + separatorKeysValues + entry.getValue() + separatorCouples);
- }
- return StringUtils.stripToNull(truncate(builder, separatorCouples));
- }
+ /**
+ * Create a string representing a list of couples (key + value)
+ * @param <O1> Keys type
+ * @param <O2> Values type
+ * @param couples Couples (key + value)
+ * @param separatorKeysValues Separator between keys and values
+ * @param separatorCouples Separator between couples
+ * @return String representing the list of couples, or null if empty
+ */
+ public static <O1, O2> String couplesToString(Map<O1, O2> couples, String separatorKeysValues,
+ String separatorCouples) {
+ AssertTools.assertNotNull(couples);
+ AssertTools.assertNotNull(separatorKeysValues);
+ AssertTools.assertNotNull(separatorCouples);
+ StringBuilder builder = new StringBuilder();
+ for (Entry<O1, O2> entry : couples.entrySet()) {
+ builder.append(entry.getKey() + separatorKeysValues + entry.getValue() + separatorCouples);
+ }
+ return StringUtils.stripToNull(truncate(builder, separatorCouples));
+ }
- /**
- * Display a list of objects
- * @param list The list to browsed
- * @param delimiter The delimiter between each object
- * @return List display
- */
- public static String listToString(List<? extends Object> list, String delimiter) {
- AssertTools.assertNotNull(list);
- AssertTools.assertNotEmpty(delimiter);
- StringBuilder builder = new StringBuilder();
- Iterator<? extends Object> itBeans = list.iterator();
- while (itBeans.hasNext()) {
- Object bean = itBeans.next();
- builder.append(bean.toString());
- if (itBeans.hasNext()) {
- builder.append(delimiter);
- }
- }
- return builder.toString();
- }
+ /**
+ * Display a list of objects
+ * @param list The list to browsed
+ * @param delimiter The delimiter between each object
+ * @return List display
+ */
+ public static String listToString(List<? extends Object> list, String delimiter) {
+ AssertTools.assertNotNull(list);
+ AssertTools.assertNotEmpty(delimiter);
+ StringBuilder builder = new StringBuilder();
+ Iterator<? extends Object> itBeans = list.iterator();
+ while (itBeans.hasNext()) {
+ Object bean = itBeans.next();
+ builder.append(bean.toString());
+ if (itBeans.hasNext()) {
+ builder.append(delimiter);
+ }
+ }
+ return builder.toString();
+ }
- /**
- * Null-safe string length
- * @param string String
- * @return String length or -1 if null
- */
- public static int length(String string) {
- return string == null ? -1 : string.length();
- }
+ /**
+ * Null-safe string length
+ * @param string String
+ * @return String length or -1 if null
+ */
+ public static int length(String string) {
+ return string == null ? -1 : string.length();
+ }
- /**
- * Create a line iterator, without null or empty lines
- * @param string String
- * @return Iterator
- */
- public static Iterator<String> lineIterator(String string) {
- AssertTools.assertNotNull(string);
- List<String> lines = new ArrayList<String>();
- for (LineIterator i = new LineIterator(new StringReader(string)); i.hasNext();) {
- String line = StringUtils.trimToNull(i.nextLine());
- if (line != null) {
- lines.add(line);
- }
- }
- return lines.iterator();
- }
+ /**
+ * Create a line iterator, without null or empty lines
+ * @param string String
+ * @return Iterator
+ */
+ public static Iterator<String> lineIterator(String string) {
+ AssertTools.assertNotNull(string);
+ List<String> lines = new ArrayList<String>();
+ for (LineIterator i = new LineIterator(new StringReader(string)); i.hasNext();) {
+ String line = StringUtils.trimToNull(i.nextLine());
+ if (line != null) {
+ lines.add(line);
+ }
+ }
+ return lines.iterator();
+ }
- /**
- * Create a line iterator, without null or empty lines
- * @param stringBuilder String
- * @return Iterator
- */
- public static Iterator<String> lineIterator(StringBuilder stringBuilder) {
- AssertTools.assertNotNull(stringBuilder);
- return lineIterator(stringBuilder.toString());
- }
+ /**
+ * Create a line iterator, without null or empty lines
+ * @param stringBuilder String
+ * @return Iterator
+ */
+ public static Iterator<String> lineIterator(StringBuilder stringBuilder) {
+ AssertTools.assertNotNull(stringBuilder);
+ return lineIterator(stringBuilder.toString());
+ }
- /**
- * Replace accented characters by their corresponding non-accented characters
- * @param string Accented string
- * @return Non-accented string
- */
- public static String replaceAccents(String string) {
- return StringUtils.stripAccents(string);
- }
+ /**
+ * Replace accented characters by their corresponding non-accented characters
+ * @param string Accented string
+ * @return Non-accented string
+ */
+ public static String replaceAccents(String string) {
+ return StringUtils.stripAccents(string);
+ }
- /**
- * Replace consecutive whitespaces by a single whitespace
- * @param string String to transform
- * @return String transformed
- */
- public static String replaceConsecutiveWhitespaces(String string) {
- return StringUtils.isEmpty(string) ? string : string.replaceAll("\\p{Space}+", " ");
- }
+ /**
+ * Replace consecutive whitespaces by a single whitespace
+ * @param string String to transform
+ * @return String transformed
+ */
+ public static String replaceConsecutiveWhitespaces(String string) {
+ return StringUtils.isEmpty(string) ? string : string.replaceAll("\\p{Space}+", " ");
+ }
- /**
- * Replace consecutive whitespaces by an underscore
- * @param string String to transform
- * @return String transformed
- */
- public static String replaceConsecutiveWhitespacesByUnderscore(String string) {
- return StringUtils.isEmpty(string) ? string : string.replaceAll("\\p{Space}+", "_");
- }
+ /**
+ * Replace consecutive whitespaces by an underscore
+ * @param string String to transform
+ * @return String transformed
+ */
+ public static String replaceConsecutiveWhitespacesByUnderscore(String string) {
+ return StringUtils.isEmpty(string) ? string : string.replaceAll("\\p{Space}+", "_");
+ }
- /**
- * Replace non alpha characters by a whitespace (accentuated characters are considered as non alpha characters)
- * @param string String to transform
- * @return String transformed
- */
- public static String replaceNonAlpha(String string) {
- return StringUtils.isEmpty(string) ? string : string.replaceAll("[^\\p{Alpha}]", " ");
- }
+ /**
+ * Replace non alpha characters by a whitespace (accentuated characters are considered as non alpha characters)
+ * @param string String to transform
+ * @return String transformed
+ */
+ public static String replaceNonAlpha(String string) {
+ return StringUtils.isEmpty(string) ? string : string.replaceAll("[^\\p{Alpha}]", " ");
+ }
- /**
- * Truncate a string by the end
- * @param toTruncate String to truncate
- * @param truncation String to delete
- * @return Truncated string (empty if empty, null if null)
- */
- public static String truncate(String toTruncate, String truncation) {
- AssertTools.assertNotNull(truncation);
- String result = toTruncate;
- if (!StringUtils.isEmpty(toTruncate)
- && toTruncate.length() >= truncation.length()
- && truncation.equals(toTruncate.substring(toTruncate.length() - truncation.length(), toTruncate
- .length()))) {
- result = toTruncate.substring(0, toTruncate.length() - truncation.length());
- }
- return result;
- }
+ /**
+ * Truncate a string by the end
+ * @param toTruncate String to truncate
+ * @param truncation String to delete
+ * @return Truncated string (empty if empty, null if null)
+ */
+ public static String truncate(String toTruncate, String truncation) {
+ AssertTools.assertNotNull(truncation);
+ String result = toTruncate;
+ if (!StringUtils.isEmpty(toTruncate)
+ && toTruncate.length() >= truncation.length()
+ && truncation.equals(toTruncate.substring(toTruncate.length() - truncation.length(), toTruncate
+ .length()))) {
+ result = toTruncate.substring(0, toTruncate.length() - truncation.length());
+ }
+ return result;
+ }
- /**
- * Truncate a string by the end
- * @param toTruncate String to truncate
- * @param truncation String to delete
- * @return Truncated string (empty if empty, null if null)
- */
- public static String truncate(StringBuilder toTruncate, String truncation) {
- return toTruncate != null ? truncate(toTruncate.toString(), truncation) : null;
- }
+ /**
+ * Truncate a string by the end
+ * @param toTruncate String to truncate
+ * @param truncation String to delete
+ * @return Truncated string (empty if empty, null if null)
+ */
+ public static String truncate(StringBuilder toTruncate, String truncation) {
+ return toTruncate != null ? truncate(toTruncate.toString(), truncation) : null;
+ }
- /**
- * Constructor (prevents from instantiation)
- */
- private StringTools() {
- //
- }
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private StringTools() {
+ //
+ }
- /**
- * Create a comparator according to the toString method
- * @param <T> Type
- * @return Comparator
- */
- public static <T> Comparator<T> createStringComparator() {
- return new Comparator<T>() {
- @Override
- public int compare(T t1, T t2) {
- String t1String = t1 == null ? "" : t1.toString();
- String t2String = t2 == null ? "" : t2.toString();
-
- return t1String.compareTo(t2String);
- }
- };
- }
+ /**
+ * Create a comparator according to the toString method
+ * @param <T> Type
+ * @return Comparator
+ */
+ public static <T> Comparator<T> createStringComparator() {
+ return new Comparator<T>() {
+ @Override
+ public int compare(T t1, T t2) {
+ String t1String = t1 == null ? "" : t1.toString();
+ String t2String = t2 == null ? "" : t2.toString();
+
+ return t1String.compareTo(t2String);
+ }
+ };
+ }
}
Modified: trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTransformer.java
===================================================================
--- trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTransformer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/main/java/nc/ird/module/utils/StringTransformer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,120 +31,120 @@
*/
public final class StringTransformer {
- /** String to transform */
- private String string;
+ /** String to transform */
+ private String string;
- /**
- * Constructor
- * @param string String to transform
- */
- public StringTransformer(String string) {
- this.string = string;
- }
+ /**
+ * Constructor
+ * @param string String to transform
+ */
+ public StringTransformer(String string) {
+ this.string = string;
+ }
- /**
- * Capitalize
- * @return this
- * @see WordUtils
- */
- public StringTransformer capitalize() {
- string = StringUtils.isEmpty(string) ? string : WordUtils.capitalize(string);
- return this;
- }
+ /**
+ * Capitalize
+ * @return this
+ * @see WordUtils
+ */
+ public StringTransformer capitalize() {
+ string = StringUtils.isEmpty(string) ? string : WordUtils.capitalize(string);
+ return this;
+ }
- /**
- * Capitalize fully
- * @return this
- * @see WordUtils
- */
- public StringTransformer capitalizeFully() {
- string = StringUtils.isEmpty(string) ? string : WordUtils.capitalizeFully(string);
- return this;
- }
+ /**
+ * Capitalize fully
+ * @return this
+ * @see WordUtils
+ */
+ public StringTransformer capitalizeFully() {
+ string = StringUtils.isEmpty(string) ? string : WordUtils.capitalizeFully(string);
+ return this;
+ }
- /**
- * Replace accents
- * @return this
- * @see StringTools
- */
- public StringTransformer replaceAccents() {
- string = StringUtils.isEmpty(string) ? string : StringTools.replaceAccents(string);
- return this;
- }
+ /**
+ * Replace accents
+ * @return this
+ * @see StringTools
+ */
+ public StringTransformer replaceAccents() {
+ string = StringUtils.isEmpty(string) ? string : StringTools.replaceAccents(string);
+ return this;
+ }
- /**
- * Replace consecutive whitespaces
- * @return this
- * @see StringTools
- */
- public StringTransformer replaceConsecutiveWhitespaces() {
- string = StringUtils.isEmpty(string) ? string : StringTools.replaceConsecutiveWhitespaces(string);
- return this;
- }
+ /**
+ * Replace consecutive whitespaces
+ * @return this
+ * @see StringTools
+ */
+ public StringTransformer replaceConsecutiveWhitespaces() {
+ string = StringUtils.isEmpty(string) ? string : StringTools.replaceConsecutiveWhitespaces(string);
+ return this;
+ }
- /**
- * Replace consecutive whitespaces by an underscore
- * @return this
- * @see StringTools
- */
- public StringTransformer replaceConsecutiveWhitespacesByUnderscore() {
- string = StringUtils.isEmpty(string) ? string : StringTools.replaceConsecutiveWhitespacesByUnderscore(string);
- return this;
- }
+ /**
+ * Replace consecutive whitespaces by an underscore
+ * @return this
+ * @see StringTools
+ */
+ public StringTransformer replaceConsecutiveWhitespacesByUnderscore() {
+ string = StringUtils.isEmpty(string) ? string : StringTools.replaceConsecutiveWhitespacesByUnderscore(string);
+ return this;
+ }
- /**
- * Replace non alpha
- * @return this
- * @see StringTools
- */
- public StringTransformer replaceNonAlpha() {
- string = StringUtils.isEmpty(string) ? string : StringTools.replaceNonAlpha(string);
- return this;
- }
+ /**
+ * Replace non alpha
+ * @return this
+ * @see StringTools
+ */
+ public StringTransformer replaceNonAlpha() {
+ string = StringUtils.isEmpty(string) ? string : StringTools.replaceNonAlpha(string);
+ return this;
+ }
- /**
- * To lower case
- * @return this
- * @see String
- */
- public StringTransformer toLowerCase() {
- string = StringUtils.isEmpty(string) ? string : string.toLowerCase();
- return this;
- }
+ /**
+ * To lower case
+ * @return this
+ * @see String
+ */
+ public StringTransformer toLowerCase() {
+ string = StringUtils.isEmpty(string) ? string : string.toLowerCase();
+ return this;
+ }
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return string;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return string;
+ }
- /**
- * To upper case
- * @return this
- * @see String
- */
- public StringTransformer toUpperCase() {
- string = StringUtils.isEmpty(string) ? string : string.toUpperCase();
- return this;
- }
+ /**
+ * To upper case
+ * @return this
+ * @see String
+ */
+ public StringTransformer toUpperCase() {
+ string = StringUtils.isEmpty(string) ? string : string.toUpperCase();
+ return this;
+ }
- /**
- * Trim
- * @return this
- * @see String
- */
- public StringTransformer trim() {
- string = StringUtils.isEmpty(string) ? string : string.trim();
- return this;
- }
+ /**
+ * Trim
+ * @return this
+ * @see String
+ */
+ public StringTransformer trim() {
+ string = StringUtils.isEmpty(string) ? string : string.trim();
+ return this;
+ }
- /**
- * Trim to null
- * @return this
- * @see StringUtils
- */
- public StringTransformer trimToNull() {
- string = string == null ? null : StringUtils.trimToNull(string);
- return this;
- }
+ /**
+ * Trim to null
+ * @return this
+ * @see StringUtils
+ */
+ public StringTransformer trimToNull() {
+ string = string == null ? null : StringUtils.trimToNull(string);
+ return this;
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/AssertToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/AssertToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/AssertToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,366 +35,366 @@
*/
public final class AssertToolsTest {
- /**
- * assert array not empty : false (empty value)
- */
- @Test(expected = AssertionError.class)
- public void assertArrayNotEmptyFalse1() {
- AssertTools.assertArrayNotEmpty(new String[] { "toto", "" });
- }
+ /**
+ * assert array not empty : false (empty value)
+ */
+ @Test(expected = AssertionError.class)
+ public void assertArrayNotEmptyFalse1() {
+ AssertTools.assertArrayNotEmpty(new String[] { "toto", "" });
+ }
- /**
- * assert array not empty : false (null value)
- */
- @Test(expected = AssertionError.class)
- public void assertArrayNotEmptyFalse2() {
- AssertTools.assertArrayNotEmpty(new String[] { null, "toto" });
- }
+ /**
+ * assert array not empty : false (null value)
+ */
+ @Test(expected = AssertionError.class)
+ public void assertArrayNotEmptyFalse2() {
+ AssertTools.assertArrayNotEmpty(new String[] { null, "toto" });
+ }
- /**
- * assert array not empty : true
- */
- public void assertArrayNotEmptyTrue() {
- AssertTools.assertArrayNotEmpty(new String[] {});
- AssertTools.assertArrayNotEmpty(new String[] { "toto", "titi" });
- }
+ /**
+ * assert array not empty : true
+ */
+ public void assertArrayNotEmptyTrue() {
+ AssertTools.assertArrayNotEmpty(new String[] {});
+ AssertTools.assertArrayNotEmpty(new String[] { "toto", "titi" });
+ }
- /**
- * assert array not null : false
- */
- @Test(expected = AssertionError.class)
- public void assertArrayNotNullFalse() {
- AssertTools.assertArrayNotNull(new Integer[] { Integer.valueOf(0), null, Integer.valueOf(2) });
- }
+ /**
+ * assert array not null : false
+ */
+ @Test(expected = AssertionError.class)
+ public void assertArrayNotNullFalse() {
+ AssertTools.assertArrayNotNull(new Integer[] { Integer.valueOf(0), null, Integer.valueOf(2) });
+ }
- /**
- * assert array not null : true
- */
- public void assertArrayNotNullTrue() {
- AssertTools.assertArrayNotNull(new Integer[] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2) });
- }
+ /**
+ * assert array not null : true
+ */
+ public void assertArrayNotNullTrue() {
+ AssertTools.assertArrayNotNull(new Integer[] { Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2) });
+ }
- /**
- * assertClassOrInterface test: error
- */
- @Test(expected = AssertionError.class)
- public void assertClassOrInterfaceFalse() {
- AssertTools.assertClassOrInterface("", AssertToolsTest.class);
- }
+ /**
+ * assertClassOrInterface test: error
+ */
+ @Test(expected = AssertionError.class)
+ public void assertClassOrInterfaceFalse() {
+ AssertTools.assertClassOrInterface("", AssertToolsTest.class);
+ }
- /**
- * assert class or interface: false class
- */
- @Test(expected = AssertionError.class)
- public void assertClassOrInterfaceFalseClass() {
- AssertTools.assertClassOrInterface("", AssertToolsTest.class);
- }
+ /**
+ * assert class or interface: false class
+ */
+ @Test(expected = AssertionError.class)
+ public void assertClassOrInterfaceFalseClass() {
+ AssertTools.assertClassOrInterface("", AssertToolsTest.class);
+ }
- /**
- * assert class or interface: false interface
- */
- @Test(expected = AssertionError.class)
- public void assertClassOrInterfaceFalseInterface() {
- AssertTools.assertClassOrInterface("", Iterable.class);
- }
+ /**
+ * assert class or interface: false interface
+ */
+ @Test(expected = AssertionError.class)
+ public void assertClassOrInterfaceFalseInterface() {
+ AssertTools.assertClassOrInterface("", Iterable.class);
+ }
- /**
- * assertClassOrInterface test: null class
- */
- @Test(expected = AssertionError.class)
- public void assertClassOrInterfaceNullClass() {
- AssertTools.assertClassOrInterface(this, null);
- }
+ /**
+ * assertClassOrInterface test: null class
+ */
+ @Test(expected = AssertionError.class)
+ public void assertClassOrInterfaceNullClass() {
+ AssertTools.assertClassOrInterface(this, null);
+ }
- /**
- * assertClassOrInterface test: null object
- */
- @Test(expected = AssertionError.class)
- public void assertClassOrInterfaceNullObject() {
- AssertTools.assertClassOrInterface(null, AssertToolsTest.class);
- }
+ /**
+ * assertClassOrInterface test: null object
+ */
+ @Test(expected = AssertionError.class)
+ public void assertClassOrInterfaceNullObject() {
+ AssertTools.assertClassOrInterface(null, AssertToolsTest.class);
+ }
- /**
- * assertClassOrInterface test: success
- */
- @Test
- public void assertClassOrInterfaceTrue() {
- AssertTools.assertClassOrInterface(this, AssertToolsTest.class);
- AssertTools.assertClassOrInterface(this, Object.class);
- AssertTools.assertClassOrInterface(Integer.valueOf(0), Number.class);
- AssertTools.assertClassOrInterface("", Serializable.class);
- }
+ /**
+ * assertClassOrInterface test: success
+ */
+ @Test
+ public void assertClassOrInterfaceTrue() {
+ AssertTools.assertClassOrInterface(this, AssertToolsTest.class);
+ AssertTools.assertClassOrInterface(this, Object.class);
+ AssertTools.assertClassOrInterface(Integer.valueOf(0), Number.class);
+ AssertTools.assertClassOrInterface("", Serializable.class);
+ }
- /**
- * assert collection not null : not null
- */
- @Test
- public void assertCollectionNotNullNotNull() {
- AssertTools.assertCollectionNotNull(Arrays.asList(new String[] {}));
- AssertTools.assertCollectionNotNull(Arrays.asList(new String[] { "" }));
- }
+ /**
+ * assert collection not null : not null
+ */
+ @Test
+ public void assertCollectionNotNullNotNull() {
+ AssertTools.assertCollectionNotNull(Arrays.asList(new String[] {}));
+ AssertTools.assertCollectionNotNull(Arrays.asList(new String[] { "" }));
+ }
- /**
- * assert collection not null : null
- */
- @Test(expected = AssertionError.class)
- public void assertCollectionNotNullNull() {
- AssertTools.assertCollectionNotNull(Arrays.asList(new String[] { null }));
- }
+ /**
+ * assert collection not null : null
+ */
+ @Test(expected = AssertionError.class)
+ public void assertCollectionNotNullNull() {
+ AssertTools.assertCollectionNotNull(Arrays.asList(new String[] { null }));
+ }
- /**
- * assertEquals test: equals
- */
- @Test
- public void assertEqualsEquals() {
- AssertTools.assertEquals(-1, -1);
- AssertTools.assertEquals(0, 0);
- AssertTools.assertEquals(1, 1);
- }
+ /**
+ * assertEquals test: equals
+ */
+ @Test
+ public void assertEqualsEquals() {
+ AssertTools.assertEquals(-1, -1);
+ AssertTools.assertEquals(0, 0);
+ AssertTools.assertEquals(1, 1);
+ }
- /**
- * assertEquals test: equals
- */
- @Test(expected = AssertionError.class)
- public void assertEqualsNotEquals() {
- AssertTools.assertEquals(-1, 0);
- }
+ /**
+ * assertEquals test: equals
+ */
+ @Test(expected = AssertionError.class)
+ public void assertEqualsNotEquals() {
+ AssertTools.assertEquals(-1, 0);
+ }
- /**
- * assertGreaterOrEquals test: equals
- */
- @Test
- public void assertGreateOrEqualsEquals() {
- AssertTools.assertGreaterOrEquals(0, 0);
- }
+ /**
+ * assertGreaterOrEquals test: equals
+ */
+ @Test
+ public void assertGreateOrEqualsEquals() {
+ AssertTools.assertGreaterOrEquals(0, 0);
+ }
- /**
- * assertGreaterOrEquals test: greater
- */
- @Test
- public void assertGreateOrEqualsGreater() {
- AssertTools.assertGreaterOrEquals(1, 0);
- }
+ /**
+ * assertGreaterOrEquals test: greater
+ */
+ @Test
+ public void assertGreateOrEqualsGreater() {
+ AssertTools.assertGreaterOrEquals(1, 0);
+ }
- /**
- * assertGreaterOrEquals test: equals
- */
- @Test(expected = AssertionError.class)
- public void assertGreateOrEqualsLower() {
- AssertTools.assertGreaterOrEquals(-1, 0);
- }
+ /**
+ * assertGreaterOrEquals test: equals
+ */
+ @Test(expected = AssertionError.class)
+ public void assertGreateOrEqualsLower() {
+ AssertTools.assertGreaterOrEquals(-1, 0);
+ }
- /**
- * AssertIn test: false
- */
- @Test(expected = AssertionError.class)
- public void assertInArrayFalse() {
- AssertTools.assertIn("b", "a", "c");
- }
+ /**
+ * AssertIn test: false
+ */
+ @Test(expected = AssertionError.class)
+ public void assertInArrayFalse() {
+ AssertTools.assertIn("b", "a", "c");
+ }
- /**
- * AssertIn test: false
- */
- @Test(expected = AssertionError.class)
- public void assertInCollectionFalse() {
- AssertTools.assertIn("b", Arrays.asList(new String[] { "a", "c" }));
- }
+ /**
+ * AssertIn test: false
+ */
+ @Test(expected = AssertionError.class)
+ public void assertInCollectionFalse() {
+ AssertTools.assertIn("b", Arrays.asList(new String[] { "a", "c" }));
+ }
- /**
- * AssertIn test: true
- */
- @Test
- public void assertInTrue() {
- AssertTools.assertIn("b", "b");
- AssertTools.assertIn("b", "a", "b");
- AssertTools.assertIn("b", Arrays.asList(new String[] { "b" }));
- AssertTools.assertIn("b", Arrays.asList(new String[] { "a", "b" }));
- }
+ /**
+ * AssertIn test: true
+ */
+ @Test
+ public void assertInTrue() {
+ AssertTools.assertIn("b", "b");
+ AssertTools.assertIn("b", "a", "b");
+ AssertTools.assertIn("b", Arrays.asList(new String[] { "b" }));
+ AssertTools.assertIn("b", Arrays.asList(new String[] { "a", "b" }));
+ }
- /**
- * Assert lower test: equals
- */
- @Test(expected = AssertionError.class)
- public void assertLowerEquals() {
- AssertTools.assertLower(0, 0);
- }
+ /**
+ * Assert lower test: equals
+ */
+ @Test(expected = AssertionError.class)
+ public void assertLowerEquals() {
+ AssertTools.assertLower(0, 0);
+ }
- /**
- * Assert lower test: lower
- */
- @Test
- public void assertLowerLower() {
- AssertTools.assertLower(-1, 0);
- }
+ /**
+ * Assert lower test: lower
+ */
+ @Test
+ public void assertLowerLower() {
+ AssertTools.assertLower(-1, 0);
+ }
- /**
- * Assert lower or equals: lower or equals
- */
- @Test
- public void assertLowerOrEqualsLowerOrEquals() {
- AssertTools.assertLowerOrEquals(-1, 0);
- AssertTools.assertLowerOrEquals(0, 0);
- }
+ /**
+ * Assert lower or equals: lower or equals
+ */
+ @Test
+ public void assertLowerOrEqualsLowerOrEquals() {
+ AssertTools.assertLowerOrEquals(-1, 0);
+ AssertTools.assertLowerOrEquals(0, 0);
+ }
- /**
- * Assert lower or equals: upper
- */
- @Test(expected = AssertionError.class)
- public void assertLowerOrEqualsUpper() {
- AssertTools.assertLower(1, 0);
- }
+ /**
+ * Assert lower or equals: upper
+ */
+ @Test(expected = AssertionError.class)
+ public void assertLowerOrEqualsUpper() {
+ AssertTools.assertLower(1, 0);
+ }
- /**
- * Assert lower: upper
- */
- @Test(expected = AssertionError.class)
- public void assertLowerUpper() {
- AssertTools.assertLower(1, 0);
- }
+ /**
+ * Assert lower: upper
+ */
+ @Test(expected = AssertionError.class)
+ public void assertLowerUpper() {
+ AssertTools.assertLower(1, 0);
+ }
- /**
- * assertNotEmpty test: array empty
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyArrayEmpty() {
- AssertTools.assertNotEmpty(new Integer[] {});
- }
+ /**
+ * assertNotEmpty test: array empty
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyArrayEmpty() {
+ AssertTools.assertNotEmpty(new Integer[] {});
+ }
- /**
- * assertNotEmpty test: array not empty
- */
- @Test
- public void assertNotEmptyArrayNotEmpty() {
- AssertTools.assertNotEmpty(new String[] { "toto" });
- }
+ /**
+ * assertNotEmpty test: array not empty
+ */
+ @Test
+ public void assertNotEmptyArrayNotEmpty() {
+ AssertTools.assertNotEmpty(new String[] { "toto" });
+ }
- /**
- * assertNotEmpty : Null test
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyArrayNull() {
- AssertTools.assertNotEmpty((Integer[]) null);
- }
+ /**
+ * assertNotEmpty : Null test
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyArrayNull() {
+ AssertTools.assertNotEmpty((Integer[]) null);
+ }
- /**
- * assertNotEmpty test: collection empty
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyCollectionEmpty() {
- AssertTools.assertNotEmpty(new ArrayList<String>());
- }
+ /**
+ * assertNotEmpty test: collection empty
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyCollectionEmpty() {
+ AssertTools.assertNotEmpty(new ArrayList<String>());
+ }
- /**
- * assertNotEmpty test: collection not empty
- */
- @Test
- public void assertNotEmptyCollectionNotEmpty() {
- AssertTools.assertNotEmpty(Arrays.asList("toto"));
- }
+ /**
+ * assertNotEmpty test: collection not empty
+ */
+ @Test
+ public void assertNotEmptyCollectionNotEmpty() {
+ AssertTools.assertNotEmpty(Arrays.asList("toto"));
+ }
- /**
- * assertNotEmptyCollection : Null test
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyCollectionNull() {
- AssertTools.assertNotEmpty((Collection<?>) null);
- }
+ /**
+ * assertNotEmptyCollection : Null test
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyCollectionNull() {
+ AssertTools.assertNotEmpty((Collection<?>) null);
+ }
- /**
- * assertEmpty test: string empty
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyStringEmpty() {
- AssertTools.assertNotEmpty("");
- }
+ /**
+ * assertEmpty test: string empty
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyStringEmpty() {
+ AssertTools.assertNotEmpty("");
+ }
- /**
- * assertEmpty test: string not empty
- */
- @Test
- public void assertNotEmptyStringNotEmpty() {
- AssertTools.assertNotEmpty("toto");
- }
+ /**
+ * assertEmpty test: string not empty
+ */
+ @Test
+ public void assertNotEmptyStringNotEmpty() {
+ AssertTools.assertNotEmpty("toto");
+ }
- /**
- * assertNotEmpty test: string null
- */
- @Test(expected = AssertionError.class)
- public void assertNotEmptyStringNull() {
- AssertTools.assertNotEmpty((String) null);
- }
+ /**
+ * assertNotEmpty test: string null
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEmptyStringNull() {
+ AssertTools.assertNotEmpty((String) null);
+ }
- /**
- * Assert not equals test: equals
- */
- @Test(expected = AssertionError.class)
- public void assertNotEqualsEquals() {
- AssertTools.assertNotEquals(0, 0);
- }
+ /**
+ * Assert not equals test: equals
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotEqualsEquals() {
+ AssertTools.assertNotEquals(0, 0);
+ }
- /**
- * Assert not equals: upper
- */
- @Test
- public void assertNotEqualsNotEquals() {
- AssertTools.assertNotEquals(1, 0);
- AssertTools.assertNotEquals(-1, 0);
- }
+ /**
+ * Assert not equals: upper
+ */
+ @Test
+ public void assertNotEqualsNotEquals() {
+ AssertTools.assertNotEquals(1, 0);
+ AssertTools.assertNotEquals(-1, 0);
+ }
- /**
- * Assert not negative: negative
- */
- @Test(expected = AssertionError.class)
- public void assertNotNegativeNegative() {
- AssertTools.assertNotNegative(-1);
- }
+ /**
+ * Assert not negative: negative
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotNegativeNegative() {
+ AssertTools.assertNotNegative(-1);
+ }
- /**
- * Assert not negative: not negative
- */
- @Test
- public void assertNotNegativeNotNegative() {
- AssertTools.assertNotNegative(1);
- AssertTools.assertNotNegative(0);
- }
+ /**
+ * Assert not negative: not negative
+ */
+ @Test
+ public void assertNotNegativeNotNegative() {
+ AssertTools.assertNotNegative(1);
+ AssertTools.assertNotNegative(0);
+ }
- /**
- * assertNotNull test: not null
- */
- @Test
- public void assertNotNullNotNull() {
- AssertTools.assertNotNull("");
- }
+ /**
+ * assertNotNull test: not null
+ */
+ @Test
+ public void assertNotNullNotNull() {
+ AssertTools.assertNotNull("");
+ }
- /**
- * assert not null: null
- */
- @Test(expected = AssertionError.class)
- public void assertNotNullNull() {
- AssertTools.assertNotNull(null);
- }
+ /**
+ * assert not null: null
+ */
+ @Test(expected = AssertionError.class)
+ public void assertNotNullNull() {
+ AssertTools.assertNotNull(null);
+ }
- /**
- * assert positive: negative
- */
- @Test(expected = AssertionError.class)
- public void assertPositiveNegative() {
- AssertTools.assertPositive(-1);
- }
+ /**
+ * assert positive: negative
+ */
+ @Test(expected = AssertionError.class)
+ public void assertPositiveNegative() {
+ AssertTools.assertPositive(-1);
+ }
- /**
- * assert positive: positive
- */
- @Test
- public void assertPositivePositive() {
- AssertTools.assertPositive(1);
- }
+ /**
+ * assert positive: positive
+ */
+ @Test
+ public void assertPositivePositive() {
+ AssertTools.assertPositive(1);
+ }
- /**
- * assert positive: zero
- */
- @Test(expected = AssertionError.class)
- public void assertPositiveZero() {
- AssertTools.assertPositive(0);
- }
+ /**
+ * assert positive: zero
+ */
+ @Test(expected = AssertionError.class)
+ public void assertPositiveZero() {
+ AssertTools.assertPositive(0);
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanLookupTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanLookupTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanLookupTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,98 +33,98 @@
*/
public final class BeanLookupTest {
- /**
- * Bean for the test
- * @author acheype
- */
- public final class Bean {
+ /**
+ * Bean for the test
+ * @author acheype
+ */
+ public final class Bean {
- /** boolean */
- public boolean bool;
+ /** boolean */
+ public boolean bool;
- /** integer */
- public Integer integer;
+ /** integer */
+ public Integer integer;
- /** string */
- public String string;
+ /** string */
+ public String string;
- /**
- * integer getter
- * @return integer
- */
- public Integer getInteger() {
- return integer;
- }
+ /**
+ * integer getter
+ * @return integer
+ */
+ public Integer getInteger() {
+ return integer;
+ }
- /**
- * string getter
- * @return string
- */
- public String getString() {
- return string;
- }
+ /**
+ * string getter
+ * @return string
+ */
+ public String getString() {
+ return string;
+ }
- /**
- * bool getter
- * @return bool
- */
- public boolean isBool() {
- return bool;
- }
+ /**
+ * bool getter
+ * @return bool
+ */
+ public boolean isBool() {
+ return bool;
+ }
- /**
- * bool setter
- * @param bool bool
- */
- public void setBool(boolean bool) {
- this.bool = bool;
- }
+ /**
+ * bool setter
+ * @param bool bool
+ */
+ public void setBool(boolean bool) {
+ this.bool = bool;
+ }
- /**
- * integer setter
- * @param integer integer
- */
- public void setInteger(Integer integer) {
- this.integer = integer;
- }
+ /**
+ * integer setter
+ * @param integer integer
+ */
+ public void setInteger(Integer integer) {
+ this.integer = integer;
+ }
- /**
- * string setter
- * @param string string
- */
- public void setString(String string) {
- this.string = string;
- }
+ /**
+ * string setter
+ * @param string string
+ */
+ public void setString(String string) {
+ this.string = string;
+ }
- }
+ }
- /**
- * lookup test
- */
- @Test
- public void lookup() {
- Bean bean = new Bean();
- BeanLookup lookupGetter = new BeanLookup(bean, AccessType.GETTER);
- BeanLookup lookupField = new BeanLookup(bean, AccessType.FIELD);
- Assert.assertNull(lookupGetter.lookup("Toto"));
- Assert.assertNull(lookupField.lookup("Toto"));
- Assert.assertNull(lookupGetter.lookup("integer"));
- Assert.assertNull(lookupField.lookup("integer"));
- Assert.assertNull(lookupGetter.lookup("string"));
- Assert.assertNull(lookupField.lookup("string"));
- bean.setInteger(0);
- bean.setString("");
- bean.setBool(true);
- Assert.assertNull(lookupGetter.lookup("Toto"));
- Assert.assertNull(lookupField.lookup("Toto"));
- Assert.assertEquals(bean.getInteger().toString(), lookupGetter.lookup("integer"));
- Assert.assertEquals(bean.integer.toString(), lookupField.lookup("integer"));
- Assert.assertEquals(bean.getString(), lookupGetter.lookup("string"));
- Assert.assertEquals(bean.string, lookupField.lookup("string"));
- Assert.assertEquals(String.valueOf(bean.isBool()), lookupGetter.lookup("bool"));
- Assert.assertEquals(String.valueOf(bean.bool), lookupField.lookup("bool"));
- bean.setBool(false);
- Assert.assertEquals(String.valueOf(bean.isBool()), lookupGetter.lookup("bool"));
- Assert.assertEquals(String.valueOf(bean.bool), lookupField.lookup("bool"));
- }
+ /**
+ * lookup test
+ */
+ @Test
+ public void lookup() {
+ Bean bean = new Bean();
+ BeanLookup lookupGetter = new BeanLookup(bean, AccessType.GETTER);
+ BeanLookup lookupField = new BeanLookup(bean, AccessType.FIELD);
+ Assert.assertNull(lookupGetter.lookup("Toto"));
+ Assert.assertNull(lookupField.lookup("Toto"));
+ Assert.assertNull(lookupGetter.lookup("integer"));
+ Assert.assertNull(lookupField.lookup("integer"));
+ Assert.assertNull(lookupGetter.lookup("string"));
+ Assert.assertNull(lookupField.lookup("string"));
+ bean.setInteger(0);
+ bean.setString("");
+ bean.setBool(true);
+ Assert.assertNull(lookupGetter.lookup("Toto"));
+ Assert.assertNull(lookupField.lookup("Toto"));
+ Assert.assertEquals(bean.getInteger().toString(), lookupGetter.lookup("integer"));
+ Assert.assertEquals(bean.integer.toString(), lookupField.lookup("integer"));
+ Assert.assertEquals(bean.getString(), lookupGetter.lookup("string"));
+ Assert.assertEquals(bean.string, lookupField.lookup("string"));
+ Assert.assertEquals(String.valueOf(bean.isBool()), lookupGetter.lookup("bool"));
+ Assert.assertEquals(String.valueOf(bean.bool), lookupField.lookup("bool"));
+ bean.setBool(false);
+ Assert.assertEquals(String.valueOf(bean.isBool()), lookupGetter.lookup("bool"));
+ Assert.assertEquals(String.valueOf(bean.bool), lookupField.lookup("bool"));
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/BeanToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,446 +38,446 @@
*/
public final class BeanToolsTest {
- /**
- * Bean for the test
- * @author acheype
- */
- public class Bean {
+ /**
+ * Bean for the test
+ * @author acheype
+ */
+ public class Bean {
- /** integer */
- @Resource
- public Integer integer;
+ /** integer */
+ @Resource
+ public Integer integer;
- /** string */
- public String string;
+ /** string */
+ public String string;
- /**
- * integer getter
- * @return integer
- */
- public Integer getInteger() {
- return integer;
- }
+ /**
+ * integer getter
+ * @return integer
+ */
+ public Integer getInteger() {
+ return integer;
+ }
- /**
- * string getter
- * @return string
- */
- public String getString() {
- return string;
- }
+ /**
+ * string getter
+ * @return string
+ */
+ public String getString() {
+ return string;
+ }
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return BeanTools.hashCode(this, integer, string);
- }
+ /** {@inheritDoc} */
+ @Override
+ public int hashCode() {
+ return BeanTools.hashCode(this, integer, string);
+ }
- /**
- * integer setter
- * @param integer integer
- */
- public void setInteger(Integer integer) {
- this.integer = integer;
- }
+ /**
+ * integer setter
+ * @param integer integer
+ */
+ public void setInteger(Integer integer) {
+ this.integer = integer;
+ }
- /**
- * string setter
- * @param string string
- */
- public void setString(String string) {
- this.string = string;
- }
- }
+ /**
+ * string setter
+ * @param string string
+ */
+ public void setString(String string) {
+ this.string = string;
+ }
+ }
- /**
- * Sub-bean for the test
- * @author acheype
- */
- public final class SubBean extends Bean {
- /** integer */
- @Resource
- public Integer subInteger;
+ /**
+ * Sub-bean for the test
+ * @author acheype
+ */
+ public final class SubBean extends Bean {
+ /** integer */
+ @Resource
+ public Integer subInteger;
- /**
- * subInteger getter
- * @return subInteger
- */
- public Integer getSubInteger() {
- return subInteger;
- }
+ /**
+ * subInteger getter
+ * @return subInteger
+ */
+ public Integer getSubInteger() {
+ return subInteger;
+ }
- /**
- * subInteger setter
- * @param subInteger subInteger
- */
- public void setSubInteger(Integer subInteger) {
- this.subInteger = subInteger;
- }
- }
+ /**
+ * subInteger setter
+ * @param subInteger subInteger
+ */
+ public void setSubInteger(Integer subInteger) {
+ this.subInteger = subInteger;
+ }
+ }
- /**
- * Bean for the test
- * @author acheype
- */
- public final class SubBean2 extends Bean {
+ /**
+ * Bean for the test
+ * @author acheype
+ */
+ public final class SubBean2 extends Bean {
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return 1;
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public int hashCode() {
+ return 1;
+ }
+ }
- /** Bean test class 1 */
- public class Bean1 {
+ /** Bean test class 1 */
+ public class Bean1 {
- /** name test 1 */
- private String name1;
+ /** name test 1 */
+ private String name1;
- /** bean test class 2 **/
- private Bean2 bean2;
+ /** bean test class 2 **/
+ private Bean2 bean2;
- /** id */
- public int id;
+ /** id */
+ public int id;
- /**
- * name1 getter
- * @return name1
- */
- public String getName1() {
- return name1;
- }
+ /**
+ * name1 getter
+ * @return name1
+ */
+ public String getName1() {
+ return name1;
+ }
- /**
- * name1 setter
- * @param name1 name1
- */
- public void setName1(String name1) {
- this.name1 = name1;
- }
+ /**
+ * name1 setter
+ * @param name1 name1
+ */
+ public void setName1(String name1) {
+ this.name1 = name1;
+ }
- /**
- * bean2 getter
- * @return bean2
- */
- public Bean2 getBean2() {
- return bean2;
- }
+ /**
+ * bean2 getter
+ * @return bean2
+ */
+ public Bean2 getBean2() {
+ return bean2;
+ }
- /**
- * bean2 setter
- * @param bean2 bean2
- */
- public void setBean2(Bean2 bean2) {
- this.bean2 = bean2;
- }
+ /**
+ * bean2 setter
+ * @param bean2 bean2
+ */
+ public void setBean2(Bean2 bean2) {
+ this.bean2 = bean2;
+ }
- /**
- * id getter
- * @return id
- */
- public int getId() {
- return id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ public int getId() {
+ return id;
+ }
- /**
- * id setter
- * @param id id
- */
- public void setId(int id) {
- this.id = id;
- }
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+ }
- /** Bean test class 2 **/
- public class Bean2 {
+ /** Bean test class 2 **/
+ public class Bean2 {
- /** name test2 */
- public String name2;
+ /** name test2 */
+ public String name2;
- /**
- * name2 getter
- * @return name2
- */
- public String getName2() {
- return name2;
- }
+ /**
+ * name2 getter
+ * @return name2
+ */
+ public String getName2() {
+ return name2;
+ }
- /**
- * name2 setter
- * @param name2 name2
- */
- public void setName2(String name2) {
- this.name2 = name2;
- }
+ /**
+ * name2 setter
+ * @param name2 name2
+ */
+ public void setName2(String name2) {
+ this.name2 = name2;
+ }
- }
+ }
- /** Bean test class 2 **/
- public class Bean3 extends Bean1 {
+ /** Bean test class 2 **/
+ public class Bean3 extends Bean1 {
- /** name test2 */
- public String name2;
+ /** name test2 */
+ public String name2;
- /** id **/
- public int id;
+ /** id **/
+ public int id;
- /**
- * id getter
- * @return id
- */
- @Override
- public int getId() {
- return this.id;
- }
+ /**
+ * id getter
+ * @return id
+ */
+ @Override
+ public int getId() {
+ return this.id;
+ }
- /**
- * id setter
- * @param id id
- */
- @Override
- public void setId(int id) {
- this.id = id;
- }
+ /**
+ * id setter
+ * @param id id
+ */
+ @Override
+ public void setId(int id) {
+ this.id = id;
+ }
- /**
- * name2 getter
- * @return name2
- */
- public String getName2() {
- return name2;
- }
+ /**
+ * name2 getter
+ * @return name2
+ */
+ public String getName2() {
+ return name2;
+ }
- /**
- * name2 setter
- * @param name2 name2
- */
- public void setName2(String name2) {
- this.name2 = name2;
- }
- }
+ /**
+ * name2 setter
+ * @param name2 name2
+ */
+ public void setName2(String name2) {
+ this.name2 = name2;
+ }
+ }
- /**
- * equals test
- * @throws NoSuchFieldException -
- * @throws SecurityException -
- */
- @Test
- public void beanEquals() throws SecurityException, NoSuchFieldException {
+ /**
+ * equals test
+ * @throws NoSuchFieldException -
+ * @throws SecurityException -
+ */
+ @Test
+ public void beanEquals() throws SecurityException, NoSuchFieldException {
- Field fi = Bean.class.getField("integer");
- Field fs = Bean.class.getField("string");
+ Field fi = Bean.class.getField("integer");
+ Field fs = Bean.class.getField("string");
- Bean bean = new Bean();
- Bean1 bean1 = new Bean1();
- bean1.setId(455);
- Bean3 bean3 = new Bean3();
- bean3.setId(455);
- // Field fx = Bean1.class.getField("id");
- // Field fz = Bean3.class.getField("id");
+ Bean bean = new Bean();
+ Bean1 bean1 = new Bean1();
+ bean1.setId(455);
+ Bean3 bean3 = new Bean3();
+ bean3.setId(455);
+ // Field fx = Bean1.class.getField("id");
+ // Field fz = Bean3.class.getField("id");
- Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean, fi, fs));
- Assert.assertFalse(BeanTools.equals(bean, null, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, null, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, null, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean, null, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, null, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, null, fi, fs));
- Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean, fi, fs));
- Bean bean12 = new Bean();
+ Bean bean12 = new Bean();
- Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, fi, fs));
- bean.setInteger(0);
- bean.setString("");
+ bean.setInteger(0);
+ bean.setString("");
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
- bean12.setInteger(0);
- bean12.setString("");
+ bean12.setInteger(0);
+ bean12.setString("");
- Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertTrue(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertTrue(BeanTools.equals(bean12, bean, fi, fs));
- bean12.setInteger(1);
+ bean12.setInteger(1);
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
- bean12.setString("Toto");
+ bean12.setString("Toto");
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
- bean12.setInteger(0);
+ bean12.setInteger(0);
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean, bean12, fi, fs));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
- Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.GETTER, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, AccessType.FIELD, "integer", "string"));
+ Assert.assertFalse(BeanTools.equals(bean12, bean, fi, fs));
- Assert.assertTrue(BeanTools.equals(bean1, bean3, AccessType.GETTER, "id"));
- Assert.assertTrue(BeanTools.equals(bean1, bean3, AccessType.FIELD, "id"));
- }
+ Assert.assertTrue(BeanTools.equals(bean1, bean3, AccessType.GETTER, "id"));
+ Assert.assertTrue(BeanTools.equals(bean1, bean3, AccessType.FIELD, "id"));
+ }
- /**
- * hashCode test
- * @throws NoSuchFieldException -
- * @throws SecurityException -
- */
- @Test
- public void beanHashCode() throws SecurityException, NoSuchFieldException {
- Field fi = Bean.class.getField("integer");
- Field fs = Bean.class.getField("string");
- Bean bean1 = new Bean();
- Bean bean2 = new Bean();
- Assert.assertTrue(bean1.hashCode() == bean2.hashCode());
- Assert.assertTrue(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- bean1.setInteger(0);
- bean1.setString("");
- Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
- Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- bean2.setInteger(0);
- bean2.setString("");
- Assert.assertTrue(bean1.hashCode() == bean2.hashCode());
- Assert.assertTrue(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- bean2.setInteger(1);
- Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
- Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- bean2.setString("Toto");
- Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
- Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- bean2.setInteger(0);
- Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
- Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
- }
+ /**
+ * hashCode test
+ * @throws NoSuchFieldException -
+ * @throws SecurityException -
+ */
+ @Test
+ public void beanHashCode() throws SecurityException, NoSuchFieldException {
+ Field fi = Bean.class.getField("integer");
+ Field fs = Bean.class.getField("string");
+ Bean bean1 = new Bean();
+ Bean bean2 = new Bean();
+ Assert.assertTrue(bean1.hashCode() == bean2.hashCode());
+ Assert.assertTrue(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ bean1.setInteger(0);
+ bean1.setString("");
+ Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
+ Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ bean2.setInteger(0);
+ bean2.setString("");
+ Assert.assertTrue(bean1.hashCode() == bean2.hashCode());
+ Assert.assertTrue(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ bean2.setInteger(1);
+ Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
+ Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ bean2.setString("Toto");
+ Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
+ Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ bean2.setInteger(0);
+ Assert.assertFalse(bean1.hashCode() == bean2.hashCode());
+ Assert.assertFalse(BeanTools.hashCode(bean1, fi, fs) == BeanTools.hashCode(bean2, fi, fs));
+ }
- /**
- * toString test
- */
- @Test
- public void beanToString() {
- SubBean bean = new SubBean();
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: <null>\n- string: <null>\n- subInteger: <null>",
- BeanTools.toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: <null>\n- string: <null>\n- subInteger: <null>",
- BeanTools.toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
- bean.setInteger(0);
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: <null>\n- subInteger: <null>",
- BeanTools.toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: <null>\n- subInteger: <null>",
- BeanTools.toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
- bean.setString("");
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: \n- subInteger: <null>", BeanTools
- .toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: \n- subInteger: <null>", BeanTools
- .toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
- bean.setString("Toto");
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: Toto\n- subInteger: <null>", BeanTools
- .toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
- Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: Toto\n- subInteger: <null>", BeanTools
- .toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
- }
+ /**
+ * toString test
+ */
+ @Test
+ public void beanToString() {
+ SubBean bean = new SubBean();
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: <null>\n- string: <null>\n- subInteger: <null>",
+ BeanTools.toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: <null>\n- string: <null>\n- subInteger: <null>",
+ BeanTools.toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
+ bean.setInteger(0);
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: <null>\n- subInteger: <null>",
+ BeanTools.toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: <null>\n- subInteger: <null>",
+ BeanTools.toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
+ bean.setString("");
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: \n- subInteger: <null>", BeanTools
+ .toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: \n- subInteger: <null>", BeanTools
+ .toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
+ bean.setString("Toto");
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: Toto\n- subInteger: <null>", BeanTools
+ .toString(bean, AccessType.GETTER, "integer", "string", "subInteger"));
+ Assert.assertEquals(SubBean.class.getName() + "\n- integer: 0\n- string: Toto\n- subInteger: <null>", BeanTools
+ .toString(bean, AccessType.FIELD, "integer", "string", "subInteger"));
+ }
- /**
- * getAnnotatedField test KO
- * @throws SecurityException -
- * @throws NullPointerException -
- * @throws NoSuchFieldException -
- */
- @SuppressWarnings("unchecked")
- @Test(expected = NoSuchFieldException.class)
- public void getAnnotatedPublicFieldKO() throws SecurityException, NullPointerException, NoSuchFieldException {
- BeanTools.getAnnotatedPublicField(new Bean(), Deprecated.class);
- }
+ /**
+ * getAnnotatedField test KO
+ * @throws SecurityException -
+ * @throws NullPointerException -
+ * @throws NoSuchFieldException -
+ */
+ @SuppressWarnings("unchecked")
+ @Test(expected = NoSuchFieldException.class)
+ public void getAnnotatedPublicFieldKO() throws SecurityException, NullPointerException, NoSuchFieldException {
+ BeanTools.getAnnotatedPublicField(new Bean(), Deprecated.class);
+ }
- /**
- * getAnnotatedField test OK
- * @throws SecurityException -
- * @throws NullPointerException -
- * @throws NoSuchFieldException -
- */
- @SuppressWarnings("unchecked")
- @Test
- public void getAnnotatedPublicFieldOK() throws SecurityException, NullPointerException, NoSuchFieldException {
- Field f = Bean.class.getField("integer");
- Assert.assertEquals(f, BeanTools.getAnnotatedPublicField(new Bean(), Resource.class));
- }
+ /**
+ * getAnnotatedField test OK
+ * @throws SecurityException -
+ * @throws NullPointerException -
+ * @throws NoSuchFieldException -
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ public void getAnnotatedPublicFieldOK() throws SecurityException, NullPointerException, NoSuchFieldException {
+ Field f = Bean.class.getField("integer");
+ Assert.assertEquals(f, BeanTools.getAnnotatedPublicField(new Bean(), Resource.class));
+ }
- /**
- * isAnnotationOnProperty test
- * @throws SecurityException -
- * @throws NullPointerException -
- * @throws NoSuchFieldException -
- */
- @Test
- public void isAnnotationOnProperty() throws SecurityException, NullPointerException, NoSuchFieldException {
- Assert.assertTrue(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "subInteger"));
- Assert.assertTrue(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "integer"));
- Assert.assertFalse(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "string"));
- }
+ /**
+ * isAnnotationOnProperty test
+ * @throws SecurityException -
+ * @throws NullPointerException -
+ * @throws NoSuchFieldException -
+ */
+ @Test
+ public void isAnnotationOnProperty() throws SecurityException, NullPointerException, NoSuchFieldException {
+ Assert.assertTrue(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "subInteger"));
+ Assert.assertTrue(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "integer"));
+ Assert.assertFalse(BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "string"));
+ }
- /**
- * isAnnotationOnProperty fail test
- * @throws SecurityException -
- * @throws NullPointerException -
- * @throws NoSuchFieldException -
- */
- @Test(expected = NoSuchFieldException.class)
- public void isAnnotationOnPropertyError() throws SecurityException, NullPointerException, NoSuchFieldException {
- BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "toto");
- }
+ /**
+ * isAnnotationOnProperty fail test
+ * @throws SecurityException -
+ * @throws NullPointerException -
+ * @throws NoSuchFieldException -
+ */
+ @Test(expected = NoSuchFieldException.class)
+ public void isAnnotationOnPropertyError() throws SecurityException, NullPointerException, NoSuchFieldException {
+ BeanTools.isAnnotationOnProperty(SubBean.class, Resource.class, "toto");
+ }
- /**
- * getValueFromPath Test
- */
- @Test(expected = IllegalArgumentException.class)
- public void getValueFromPath() {
- Bean1 b1 = new Bean1();
- Bean2 b2 = new Bean2();
+ /**
+ * getValueFromPath Test
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void getValueFromPath() {
+ Bean1 b1 = new Bean1();
+ Bean2 b2 = new Bean2();
- b1.setName1("name1");
- b2.setName2("name2");
- b1.setBean2(b2);
+ b1.setName1("name1");
+ b2.setName2("name2");
+ b1.setBean2(b2);
- Assert.assertSame(b1.getName1(), BeanTools.getValueFromPath(b1, AccessType.GETTER, "name1"));
- Assert.assertSame(b1.getBean2().getName2(), BeanTools.getValueFromPath(b1, AccessType.GETTER, "bean2.name2"));
- BeanTools.getValueFromPath(b1, AccessType.FIELD, "bean2.nameX");
- }
+ Assert.assertSame(b1.getName1(), BeanTools.getValueFromPath(b1, AccessType.GETTER, "name1"));
+ Assert.assertSame(b1.getBean2().getName2(), BeanTools.getValueFromPath(b1, AccessType.GETTER, "bean2.name2"));
+ BeanTools.getValueFromPath(b1, AccessType.FIELD, "bean2.nameX");
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CaptchaToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,19 +32,19 @@
*/
public final class CaptchaToolsTest {
- /**
- * random test
- */
- @Test
- public void random() {
- String captcha1 = CaptchaTools.random();
- Assert.assertNotNull(captcha1);
- Assert.assertTrue(captcha1.length() >= CaptchaTools.CAPTCHA_LENGTH_MIN);
- Assert.assertTrue(captcha1.length() <= CaptchaTools.CAPTCHA_LENGTH_MAX);
- String captcha2 = CaptchaTools.random();
- Assert.assertNotNull(captcha2);
- Assert.assertTrue(captcha2.length() >= CaptchaTools.CAPTCHA_LENGTH_MIN);
- Assert.assertTrue(captcha2.length() <= CaptchaTools.CAPTCHA_LENGTH_MAX);
- Assert.assertTrue(!captcha1.equals(captcha2));
- }
+ /**
+ * random test
+ */
+ @Test
+ public void random() {
+ String captcha1 = CaptchaTools.random();
+ Assert.assertNotNull(captcha1);
+ Assert.assertTrue(captcha1.length() >= CaptchaTools.CAPTCHA_LENGTH_MIN);
+ Assert.assertTrue(captcha1.length() <= CaptchaTools.CAPTCHA_LENGTH_MAX);
+ String captcha2 = CaptchaTools.random();
+ Assert.assertNotNull(captcha2);
+ Assert.assertTrue(captcha2.length() >= CaptchaTools.CAPTCHA_LENGTH_MIN);
+ Assert.assertTrue(captcha2.length() <= CaptchaTools.CAPTCHA_LENGTH_MAX);
+ Assert.assertTrue(!captcha1.equals(captcha2));
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CollectionToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CollectionToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CollectionToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -45,204 +45,204 @@
*/
public final class CollectionToolsTest {
- /** beans collection for tests */
- public AbstractList<Bean1> beansCol = new ArrayList<Bean1>();
+ /** beans collection for tests */
+ public AbstractList<Bean1> beansCol = new ArrayList<Bean1>();
- /**
- * Constructor
- */
- public CollectionToolsTest() {
- init();
- }
+ /**
+ * Constructor
+ */
+ public CollectionToolsTest() {
+ init();
+ }
- /**
- * initialisation of tests
- */
- private void init() {
- BeanToolsTest beanTest = new BeanToolsTest();
+ /**
+ * initialisation of tests
+ */
+ private void init() {
+ BeanToolsTest beanTest = new BeanToolsTest();
- Bean1 b1 = beanTest.new Bean1();
- Bean2 b12 = beanTest.new Bean2();
- b12.setName2("name12");
- b1.setName1("name");
- b1.setBean2(b12);
+ Bean1 b1 = beanTest.new Bean1();
+ Bean2 b12 = beanTest.new Bean2();
+ b12.setName2("name12");
+ b1.setName1("name");
+ b1.setBean2(b12);
- Bean1 b2 = beanTest.new Bean1();
- Bean2 b22 = beanTest.new Bean2();
- b22.setName2("name22");
- b2.setName1("name");
- b2.setBean2(b22);
+ Bean1 b2 = beanTest.new Bean1();
+ Bean2 b22 = beanTest.new Bean2();
+ b22.setName2("name22");
+ b2.setName1("name");
+ b2.setBean2(b22);
- Bean1 b3 = beanTest.new Bean1();
- Bean2 b32 = beanTest.new Bean2();
- b32.setName2(null);
- b3.setName1("name");
- b3.setBean2(b32);
+ Bean1 b3 = beanTest.new Bean1();
+ Bean2 b32 = beanTest.new Bean2();
+ b32.setName2(null);
+ b3.setName1("name");
+ b3.setBean2(b32);
- beansCol.add(b1);
- beansCol.add(b2);
- beansCol.add(b3);
- }
+ beansCol.add(b1);
+ beansCol.add(b2);
+ beansCol.add(b3);
+ }
- /**
- * containsOnlyValue test
- */
- @Test
- public void containsOnlyValue() {
- Collection<String> col1 = new ArrayList<String>(Arrays.asList(new String[] { "fff", "fff" }));
- Collection<String> col2 = new ArrayList<String>();
- Collection<String> col3 = new ArrayList<String>(Arrays.asList(new String[] { "ab", "fff" }));
- Collection<String> col4 = new ArrayList<String>(Arrays.asList(new String[] { null, null }));
- Collection<String> col5 = new ArrayList<String>(Arrays.asList(new String[] { null, "fff" }));
- Collection<String> col6 = new ArrayList<String>(Arrays.asList(new String[] { "fff" }));
- Collection<Integer> col7 = new ArrayList<Integer>(Arrays.asList(new Integer[] { 5, 5, 5, 5, 5 }));
+ /**
+ * containsOnlyValue test
+ */
+ @Test
+ public void containsOnlyValue() {
+ Collection<String> col1 = new ArrayList<String>(Arrays.asList(new String[] { "fff", "fff" }));
+ Collection<String> col2 = new ArrayList<String>();
+ Collection<String> col3 = new ArrayList<String>(Arrays.asList(new String[] { "ab", "fff" }));
+ Collection<String> col4 = new ArrayList<String>(Arrays.asList(new String[] { null, null }));
+ Collection<String> col5 = new ArrayList<String>(Arrays.asList(new String[] { null, "fff" }));
+ Collection<String> col6 = new ArrayList<String>(Arrays.asList(new String[] { "fff" }));
+ Collection<Integer> col7 = new ArrayList<Integer>(Arrays.asList(new Integer[] { 5, 5, 5, 5, 5 }));
- Assert.assertTrue(CollectionTools.containsOnlySameValue(col1, "fff"));
- Assert.assertFalse(CollectionTools.containsOnlySameValue(col2, ""));
- Assert.assertFalse(CollectionTools.containsOnlySameValue(col3, "fff"));
- Assert.assertTrue(CollectionTools.containsOnlySameValue(col4, null));
- Assert.assertFalse(CollectionTools.containsOnlySameValue(col5, null));
- Assert.assertTrue(CollectionTools.containsOnlySameValue(col6, "fff"));
- Assert.assertTrue(CollectionTools.containsOnlySameValue(col7, 5));
- }
+ Assert.assertTrue(CollectionTools.containsOnlySameValue(col1, "fff"));
+ Assert.assertFalse(CollectionTools.containsOnlySameValue(col2, ""));
+ Assert.assertFalse(CollectionTools.containsOnlySameValue(col3, "fff"));
+ Assert.assertTrue(CollectionTools.containsOnlySameValue(col4, null));
+ Assert.assertFalse(CollectionTools.containsOnlySameValue(col5, null));
+ Assert.assertTrue(CollectionTools.containsOnlySameValue(col6, "fff"));
+ Assert.assertTrue(CollectionTools.containsOnlySameValue(col7, 5));
+ }
- /**
- * Intersect test
- */
- @Test
- public void intersect() {
- Set<Integer> s1 = new HashSet<Integer>();
- Set<Integer> s2 = new HashSet<Integer>();
- Assert.assertTrue(CollectionTools.intersect(null, null).isEmpty());
- Assert.assertTrue(CollectionTools.intersect(s1, null).isEmpty());
- Assert.assertTrue(CollectionTools.intersect(null, s2).isEmpty());
- Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
- s1.add(Integer.valueOf(0));
- Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
- s2.add(Integer.valueOf(1));
- Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
- s1.add(Integer.valueOf(2));
- s2.add(Integer.valueOf(2));
- Set<Integer> intersect = CollectionTools.intersect(s1, s2);
- Assert.assertEquals(1, intersect.size());
- Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
- s1.add(Integer.valueOf(3));
- s2.add(Integer.valueOf(3));
- intersect = CollectionTools.intersect(s1, s2);
- Assert.assertEquals(2, intersect.size());
- Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
- Assert.assertTrue(intersect.contains(Integer.valueOf(3)));
- intersect = CollectionTools.intersect(s2, s1);
- Assert.assertEquals(2, intersect.size());
- Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
- Assert.assertTrue(intersect.contains(Integer.valueOf(3)));
- }
+ /**
+ * Intersect test
+ */
+ @Test
+ public void intersect() {
+ Set<Integer> s1 = new HashSet<Integer>();
+ Set<Integer> s2 = new HashSet<Integer>();
+ Assert.assertTrue(CollectionTools.intersect(null, null).isEmpty());
+ Assert.assertTrue(CollectionTools.intersect(s1, null).isEmpty());
+ Assert.assertTrue(CollectionTools.intersect(null, s2).isEmpty());
+ Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
+ s1.add(Integer.valueOf(0));
+ Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
+ s2.add(Integer.valueOf(1));
+ Assert.assertTrue(CollectionTools.intersect(s1, s2).isEmpty());
+ s1.add(Integer.valueOf(2));
+ s2.add(Integer.valueOf(2));
+ Set<Integer> intersect = CollectionTools.intersect(s1, s2);
+ Assert.assertEquals(1, intersect.size());
+ Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
+ s1.add(Integer.valueOf(3));
+ s2.add(Integer.valueOf(3));
+ intersect = CollectionTools.intersect(s1, s2);
+ Assert.assertEquals(2, intersect.size());
+ Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
+ Assert.assertTrue(intersect.contains(Integer.valueOf(3)));
+ intersect = CollectionTools.intersect(s2, s1);
+ Assert.assertEquals(2, intersect.size());
+ Assert.assertTrue(intersect.contains(Integer.valueOf(2)));
+ Assert.assertTrue(intersect.contains(Integer.valueOf(3)));
+ }
- /**
- * setter test
- */
- @Test
- public void setter() {
- Collection<Integer> toWrite = new ArrayList<Integer>();
- Collection<Integer> toRead = null;
- toWrite.add(0);
- CollectionTools.setter(toWrite, toRead);
- Assert.assertTrue(toWrite.isEmpty());
- toWrite.add(0);
- toRead = new ArrayList<Integer>();
- CollectionTools.setter(toWrite, toRead);
- Assert.assertTrue(toWrite.isEmpty());
- toWrite.add(0);
- toRead.add(1);
- CollectionTools.setter(toWrite, toRead);
- Assert.assertArrayEquals(toRead.toArray(), toWrite.toArray());
- }
+ /**
+ * setter test
+ */
+ @Test
+ public void setter() {
+ Collection<Integer> toWrite = new ArrayList<Integer>();
+ Collection<Integer> toRead = null;
+ toWrite.add(0);
+ CollectionTools.setter(toWrite, toRead);
+ Assert.assertTrue(toWrite.isEmpty());
+ toWrite.add(0);
+ toRead = new ArrayList<Integer>();
+ CollectionTools.setter(toWrite, toRead);
+ Assert.assertTrue(toWrite.isEmpty());
+ toWrite.add(0);
+ toRead.add(1);
+ CollectionTools.setter(toWrite, toRead);
+ Assert.assertArrayEquals(toRead.toArray(), toWrite.toArray());
+ }
- /**
- * toStringComparatorTest
- */
- @Test
- public void toStringComparator() {
- List<String> list = new ArrayList<String>();
- list.add("t");
- list.add(null);
- list.add("");
- list.add("z");
- list.add("b");
- list.add(" ");
- Collections.sort(list, StringTools.createStringComparator());
- Assert.assertArrayEquals(list.toArray(new String[0]), new String[] { null, "", " ", "b", "t", "z" });
- }
+ /**
+ * toStringComparatorTest
+ */
+ @Test
+ public void toStringComparator() {
+ List<String> list = new ArrayList<String>();
+ list.add("t");
+ list.add(null);
+ list.add("");
+ list.add("z");
+ list.add("b");
+ list.add(" ");
+ Collections.sort(list, StringTools.createStringComparator());
+ Assert.assertArrayEquals(list.toArray(new String[0]), new String[] { null, "", " ", "b", "t", "z" });
+ }
- /**
- * containsFieldWithValue tests
- */
- @Test
- public void containsFieldWithValue() {
- Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "name1", AccessType.GETTER, "name"));
- Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"));
- Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name22"));
- Assert.assertFalse(CollectionTools.containsWithValue(beansCol, "name1", AccessType.GETTER, "XXX"));
- }
+ /**
+ * containsFieldWithValue tests
+ */
+ @Test
+ public void containsFieldWithValue() {
+ Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "name1", AccessType.GETTER, "name"));
+ Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"));
+ Assert.assertTrue(CollectionTools.containsWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name22"));
+ Assert.assertFalse(CollectionTools.containsWithValue(beansCol, "name1", AccessType.GETTER, "XXX"));
+ }
- /**
- * containsFieldWithValue tests
- */
- @Test
- public void countFieldWithValue() {
- Assert.assertSame(CollectionTools.countWithValue(beansCol, "name1", AccessType.GETTER, "name"), 3);
- Assert.assertSame(CollectionTools.countWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"), 1);
- Assert.assertSame(CollectionTools.countWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name22"), 1);
- Assert.assertSame(CollectionTools.countWithValue(beansCol, "name1", AccessType.GETTER, "XXX"), 0);
- }
+ /**
+ * containsFieldWithValue tests
+ */
+ @Test
+ public void countFieldWithValue() {
+ Assert.assertSame(CollectionTools.countWithValue(beansCol, "name1", AccessType.GETTER, "name"), 3);
+ Assert.assertSame(CollectionTools.countWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"), 1);
+ Assert.assertSame(CollectionTools.countWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name22"), 1);
+ Assert.assertSame(CollectionTools.countWithValue(beansCol, "name1", AccessType.GETTER, "XXX"), 0);
+ }
- /**
- * removeWithValue tests
- */
- @Test
- public void removeWithValue() {
- Assert.assertTrue(CollectionTools.removeWithValue(beansCol, "name1", AccessType.GETTER, "name"));
- Assert.assertSame(beansCol.size(), 0);
- beansCol.clear();
- init();
+ /**
+ * removeWithValue tests
+ */
+ @Test
+ public void removeWithValue() {
+ Assert.assertTrue(CollectionTools.removeWithValue(beansCol, "name1", AccessType.GETTER, "name"));
+ Assert.assertSame(beansCol.size(), 0);
+ beansCol.clear();
+ init();
- Assert.assertTrue(CollectionTools.removeWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"));
- Assert.assertSame(beansCol.size(), 2);
- beansCol.clear();
- init();
+ Assert.assertTrue(CollectionTools.removeWithValue(beansCol, "bean2.name2", AccessType.GETTER, "name12"));
+ Assert.assertSame(beansCol.size(), 2);
+ beansCol.clear();
+ init();
- Assert.assertFalse(CollectionTools.removeWithValue(beansCol, "name1", AccessType.GETTER, "XXX"));
- }
+ Assert.assertFalse(CollectionTools.removeWithValue(beansCol, "name1", AccessType.GETTER, "XXX"));
+ }
- /**
- * removeWithValue tests
- */
- @Test
- public void removeAllWithValue() {
- Assert.assertTrue(CollectionTools.removeAllWithValue(beansCol, "name1", AccessType.GETTER, Arrays
- .asList(new String[] { "name" })));
- Assert.assertSame(beansCol.size(), 0);
- beansCol.clear();
- init();
+ /**
+ * removeWithValue tests
+ */
+ @Test
+ public void removeAllWithValue() {
+ Assert.assertTrue(CollectionTools.removeAllWithValue(beansCol, "name1", AccessType.GETTER, Arrays
+ .asList(new String[] { "name" })));
+ Assert.assertSame(beansCol.size(), 0);
+ beansCol.clear();
+ init();
- Assert.assertTrue(CollectionTools.removeAllWithValue(beansCol, "bean2.name2", AccessType.GETTER, Arrays
- .asList(new String[] { "name12", "name22" })));
- Assert.assertSame(beansCol.size(), 1);
- beansCol.clear();
- init();
+ Assert.assertTrue(CollectionTools.removeAllWithValue(beansCol, "bean2.name2", AccessType.GETTER, Arrays
+ .asList(new String[] { "name12", "name22" })));
+ Assert.assertSame(beansCol.size(), 1);
+ beansCol.clear();
+ init();
- Assert.assertFalse(CollectionTools.removeAllWithValue(beansCol, "name1", AccessType.GETTER, Arrays
- .asList(new String[] { "XXX", "YYY", "ZZZ" })));
- }
+ Assert.assertFalse(CollectionTools.removeAllWithValue(beansCol, "name1", AccessType.GETTER, Arrays
+ .asList(new String[] { "XXX", "YYY", "ZZZ" })));
+ }
- /**
- * valuesFromList tests
- */
- @Test
- public void valuesFromList() {
- Assert.assertEquals(CollectionTools.valuesFromList(beansCol, "name1", AccessType.GETTER), Arrays
- .asList(new String[] { "name", "name", "name" }));
- Assert.assertEquals(CollectionTools.valuesFromList(beansCol, "bean2.name2", AccessType.GETTER), Arrays
- .asList(new String[] { "name12", "name22", null }));
- }
+ /**
+ * valuesFromList tests
+ */
+ @Test
+ public void valuesFromList() {
+ Assert.assertEquals(CollectionTools.valuesFromList(beansCol, "name1", AccessType.GETTER), Arrays
+ .asList(new String[] { "name", "name", "name" }));
+ Assert.assertEquals(CollectionTools.valuesFromList(beansCol, "bean2.name2", AccessType.GETTER), Arrays
+ .asList(new String[] { "name12", "name22", null }));
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CoordToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CoordToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/CoordToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,41 +35,41 @@
*/
public class CoordToolsTest {
- /**
- * Latitude test
- */
- @Test
- public void latitude() {
- Integer degrees = 1;
- BigDecimal minutes = new BigDecimal("2.300");
- Character orientation = 'N';
- String latitude = CoordTools.latitude(degrees, minutes, orientation);
+ /**
+ * Latitude test
+ */
+ @Test
+ public void latitude() {
+ Integer degrees = 1;
+ BigDecimal minutes = new BigDecimal("2.300");
+ Character orientation = 'N';
+ String latitude = CoordTools.latitude(degrees, minutes, orientation);
- Assert.assertTrue(CoordTools.validateLatitude(latitude));
- Assert.assertFalse(CoordTools.validateLatitude(latitude
- .replace(orientation, Character.toLowerCase(orientation))));
+ Assert.assertTrue(CoordTools.validateLatitude(latitude));
+ Assert.assertFalse(CoordTools.validateLatitude(latitude
+ .replace(orientation, Character.toLowerCase(orientation))));
- Assert.assertEquals(degrees, CoordTools.latitudeDegrees(latitude));
- Assert.assertEquals(minutes, CoordTools.latitudeMinutes(latitude));
- Assert.assertEquals(orientation, CoordTools.latitudeOrientation(latitude));
- }
+ Assert.assertEquals(degrees, CoordTools.latitudeDegrees(latitude));
+ Assert.assertEquals(minutes, CoordTools.latitudeMinutes(latitude));
+ Assert.assertEquals(orientation, CoordTools.latitudeOrientation(latitude));
+ }
- /**
- * Longitude test
- */
- @Test
- public void longitude() {
- Integer degrees = 1;
- BigDecimal minutes = new BigDecimal("52.999");
- Character orientation = 'E';
- String longitude = CoordTools.longitude(degrees, minutes, orientation);
+ /**
+ * Longitude test
+ */
+ @Test
+ public void longitude() {
+ Integer degrees = 1;
+ BigDecimal minutes = new BigDecimal("52.999");
+ Character orientation = 'E';
+ String longitude = CoordTools.longitude(degrees, minutes, orientation);
- Assert.assertTrue(CoordTools.validateLongitude(longitude));
- Assert.assertFalse(CoordTools.validateLongitude(longitude.replace(orientation, Character
- .toLowerCase(orientation))));
+ Assert.assertTrue(CoordTools.validateLongitude(longitude));
+ Assert.assertFalse(CoordTools.validateLongitude(longitude.replace(orientation, Character
+ .toLowerCase(orientation))));
- Assert.assertEquals(degrees, CoordTools.longitudeDegrees(longitude));
- Assert.assertEquals(minutes, CoordTools.longitudeMinutes(longitude));
- Assert.assertEquals(orientation, CoordTools.longitudeOrientation(longitude));
- }
+ Assert.assertEquals(degrees, CoordTools.longitudeDegrees(longitude));
+ Assert.assertEquals(minutes, CoordTools.longitudeMinutes(longitude));
+ Assert.assertEquals(orientation, CoordTools.longitudeOrientation(longitude));
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/GenericsToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/GenericsToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/GenericsToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,13 +31,13 @@
*/
public final class GenericsToolsTest {
- /**
- * cast test
- */
- @Test
- public void cast() {
- Number n = 1;
- Integer i = GenericsTools.cast(n);
- Assert.assertEquals((Integer) 1, i);
- }
+ /**
+ * cast test
+ */
+ @Test
+ public void cast() {
+ Number n = 1;
+ Integer i = GenericsTools.cast(n);
+ Assert.assertEquals((Integer) 1, i);
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/LogToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/LogToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/LogToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,13 +32,13 @@
*/
public final class LogToolsTest {
- /**
- * getLog test
- */
- @Test
- public void getLog() {
- Log log = LogTools.getLog();
- Assert.assertNotNull(log);
- log.debug(null);
- }
+ /**
+ * getLog test
+ */
+ @Test
+ public void getLog() {
+ Log log = LogTools.getLog();
+ Assert.assertNotNull(log);
+ log.debug(null);
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/NumberToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/NumberToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/NumberToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,109 +36,109 @@
*/
public final class NumberToolsTest {
- /**
- * nullIfZero test
- */
- @Test
- public void nullIfZero() {
- // AtomicInteger
- AtomicInteger ai = null;
- Assert.assertNull(NumberTools.nullIfZero(ai));
- ai = new AtomicInteger(-1);
- Assert.assertEquals(ai, NumberTools.nullIfZero(ai));
- ai.set(0);
- Assert.assertNull(NumberTools.nullIfZero(ai));
- ai.set(1);
- Assert.assertEquals(ai, NumberTools.nullIfZero(ai));
- // AtomicLong
- AtomicLong al = null;
- Assert.assertNull(NumberTools.nullIfZero(al));
- al = new AtomicLong(-1L);
- Assert.assertEquals(al, NumberTools.nullIfZero(al));
- al.set(0L);
- Assert.assertNull(NumberTools.nullIfZero(al));
- al.set(1L);
- Assert.assertEquals(al, NumberTools.nullIfZero(al));
- // BigDecimal
- BigDecimal bd = null;
- Assert.assertNull(NumberTools.nullIfZero(bd));
- bd = new BigDecimal(-1.0D);
- Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
- bd = new BigDecimal(-.5D);
- Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
- bd = new BigDecimal(0.0D);
- Assert.assertNull(NumberTools.nullIfZero(bd));
- bd = new BigDecimal(.5D);
- Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
- bd = new BigDecimal(1.0D);
- Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
- // BigInteger
- BigInteger bi = null;
- Assert.assertNull(NumberTools.nullIfZero(bi));
- bi = new BigInteger("-1");
- Assert.assertEquals(bi, NumberTools.nullIfZero(bi));
- bi = new BigInteger("0");
- Assert.assertNull(NumberTools.nullIfZero(bi));
- bi = new BigInteger("1");
- Assert.assertEquals(bi, NumberTools.nullIfZero(bi));
- // Byte
- Byte b = null;
- Assert.assertNull(NumberTools.nullIfZero(b));
- b = 0;
- Assert.assertNull(NumberTools.nullIfZero(b));
- b = 1;
- Assert.assertEquals(b, NumberTools.nullIfZero(b));
- // Double
- Double d = null;
- Assert.assertNull(NumberTools.nullIfZero(d));
- d = -1.0D;
- Assert.assertEquals(d, NumberTools.nullIfZero(d));
- d = -.5D;
- Assert.assertEquals(d, NumberTools.nullIfZero(d));
- d = 0.0D;
- Assert.assertNull(NumberTools.nullIfZero(d));
- d = .5D;
- Assert.assertEquals(d, NumberTools.nullIfZero(d));
- d = 1.0D;
- Assert.assertEquals(d, NumberTools.nullIfZero(d));
- // Float
- Float f = null;
- Assert.assertNull(NumberTools.nullIfZero(f));
- f = -1.0F;
- Assert.assertEquals(f, NumberTools.nullIfZero(f));
- f = -.5F;
- Assert.assertEquals(f, NumberTools.nullIfZero(f));
- f = 0.0F;
- Assert.assertNull(NumberTools.nullIfZero(f));
- f = .5F;
- Assert.assertEquals(f, NumberTools.nullIfZero(f));
- f = 1.0F;
- Assert.assertEquals(f, NumberTools.nullIfZero(f));
- // Integer
- Integer i = null;
- Assert.assertNull(NumberTools.nullIfZero(i));
- i = -1;
- Assert.assertEquals(i, NumberTools.nullIfZero(i));
- i = 0;
- Assert.assertNull(NumberTools.nullIfZero(i));
- i = 1;
- Assert.assertEquals(i, NumberTools.nullIfZero(i));
- // Long
- Long l = null;
- Assert.assertNull(NumberTools.nullIfZero(l));
- l = -1L;
- Assert.assertEquals(l, NumberTools.nullIfZero(l));
- l = 0L;
- Assert.assertNull(NumberTools.nullIfZero(l));
- l = 1L;
- Assert.assertEquals(l, NumberTools.nullIfZero(l));
- // Short
- Short s = null;
- Assert.assertNull(NumberTools.nullIfZero(s));
- s = -1;
- Assert.assertEquals(s, NumberTools.nullIfZero(s));
- s = 0;
- Assert.assertNull(NumberTools.nullIfZero(s));
- s = 1;
- }
+ /**
+ * nullIfZero test
+ */
+ @Test
+ public void nullIfZero() {
+ // AtomicInteger
+ AtomicInteger ai = null;
+ Assert.assertNull(NumberTools.nullIfZero(ai));
+ ai = new AtomicInteger(-1);
+ Assert.assertEquals(ai, NumberTools.nullIfZero(ai));
+ ai.set(0);
+ Assert.assertNull(NumberTools.nullIfZero(ai));
+ ai.set(1);
+ Assert.assertEquals(ai, NumberTools.nullIfZero(ai));
+ // AtomicLong
+ AtomicLong al = null;
+ Assert.assertNull(NumberTools.nullIfZero(al));
+ al = new AtomicLong(-1L);
+ Assert.assertEquals(al, NumberTools.nullIfZero(al));
+ al.set(0L);
+ Assert.assertNull(NumberTools.nullIfZero(al));
+ al.set(1L);
+ Assert.assertEquals(al, NumberTools.nullIfZero(al));
+ // BigDecimal
+ BigDecimal bd = null;
+ Assert.assertNull(NumberTools.nullIfZero(bd));
+ bd = new BigDecimal(-1.0D);
+ Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
+ bd = new BigDecimal(-.5D);
+ Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
+ bd = new BigDecimal(0.0D);
+ Assert.assertNull(NumberTools.nullIfZero(bd));
+ bd = new BigDecimal(.5D);
+ Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
+ bd = new BigDecimal(1.0D);
+ Assert.assertEquals(bd, NumberTools.nullIfZero(bd));
+ // BigInteger
+ BigInteger bi = null;
+ Assert.assertNull(NumberTools.nullIfZero(bi));
+ bi = new BigInteger("-1");
+ Assert.assertEquals(bi, NumberTools.nullIfZero(bi));
+ bi = new BigInteger("0");
+ Assert.assertNull(NumberTools.nullIfZero(bi));
+ bi = new BigInteger("1");
+ Assert.assertEquals(bi, NumberTools.nullIfZero(bi));
+ // Byte
+ Byte b = null;
+ Assert.assertNull(NumberTools.nullIfZero(b));
+ b = 0;
+ Assert.assertNull(NumberTools.nullIfZero(b));
+ b = 1;
+ Assert.assertEquals(b, NumberTools.nullIfZero(b));
+ // Double
+ Double d = null;
+ Assert.assertNull(NumberTools.nullIfZero(d));
+ d = -1.0D;
+ Assert.assertEquals(d, NumberTools.nullIfZero(d));
+ d = -.5D;
+ Assert.assertEquals(d, NumberTools.nullIfZero(d));
+ d = 0.0D;
+ Assert.assertNull(NumberTools.nullIfZero(d));
+ d = .5D;
+ Assert.assertEquals(d, NumberTools.nullIfZero(d));
+ d = 1.0D;
+ Assert.assertEquals(d, NumberTools.nullIfZero(d));
+ // Float
+ Float f = null;
+ Assert.assertNull(NumberTools.nullIfZero(f));
+ f = -1.0F;
+ Assert.assertEquals(f, NumberTools.nullIfZero(f));
+ f = -.5F;
+ Assert.assertEquals(f, NumberTools.nullIfZero(f));
+ f = 0.0F;
+ Assert.assertNull(NumberTools.nullIfZero(f));
+ f = .5F;
+ Assert.assertEquals(f, NumberTools.nullIfZero(f));
+ f = 1.0F;
+ Assert.assertEquals(f, NumberTools.nullIfZero(f));
+ // Integer
+ Integer i = null;
+ Assert.assertNull(NumberTools.nullIfZero(i));
+ i = -1;
+ Assert.assertEquals(i, NumberTools.nullIfZero(i));
+ i = 0;
+ Assert.assertNull(NumberTools.nullIfZero(i));
+ i = 1;
+ Assert.assertEquals(i, NumberTools.nullIfZero(i));
+ // Long
+ Long l = null;
+ Assert.assertNull(NumberTools.nullIfZero(l));
+ l = -1L;
+ Assert.assertEquals(l, NumberTools.nullIfZero(l));
+ l = 0L;
+ Assert.assertNull(NumberTools.nullIfZero(l));
+ l = 1L;
+ Assert.assertEquals(l, NumberTools.nullIfZero(l));
+ // Short
+ Short s = null;
+ Assert.assertNull(NumberTools.nullIfZero(s));
+ s = -1;
+ Assert.assertEquals(s, NumberTools.nullIfZero(s));
+ s = 0;
+ Assert.assertNull(NumberTools.nullIfZero(s));
+ s = 1;
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PairTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PairTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PairTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,21 +31,21 @@
*/
public final class PairTest {
- /**
- * pair test
- */
- @Test
- public void pair() {
- Pair<Integer, String> pair = new Pair<Integer, String>(1, "Toto");
- Assert.assertEquals((Integer) 1, pair.getKey());
- Assert.assertEquals("Toto", pair.getValue());
- pair.setKey(2);
- Assert.assertEquals((Integer) 2, pair.getKey());
- Assert.assertEquals("Toto", pair.setValue("Titi"));
- Assert.assertEquals("Titi", pair.getValue());
- Pair<Integer, String> pair2 = new Pair<Integer, String>(1, "Titi");
- Assert.assertNotSame(pair, pair2);
- Pair<Integer, String> pair3 = new Pair<Integer, String>(2, "Titi");
- Assert.assertEquals(pair, pair3);
- }
+ /**
+ * pair test
+ */
+ @Test
+ public void pair() {
+ Pair<Integer, String> pair = new Pair<Integer, String>(1, "Toto");
+ Assert.assertEquals((Integer) 1, pair.getKey());
+ Assert.assertEquals("Toto", pair.getValue());
+ pair.setKey(2);
+ Assert.assertEquals((Integer) 2, pair.getKey());
+ Assert.assertEquals("Toto", pair.setValue("Titi"));
+ Assert.assertEquals("Titi", pair.getValue());
+ Pair<Integer, String> pair2 = new Pair<Integer, String>(1, "Titi");
+ Assert.assertNotSame(pair, pair2);
+ Pair<Integer, String> pair3 = new Pair<Integer, String>(2, "Titi");
+ Assert.assertEquals(pair, pair3);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/PasswordToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,52 +32,52 @@
*/
public final class PasswordToolsTest {
- /**
- * md5 test
- */
- @Test
- public void md5() {
- String hash1 = PasswordTools.md5("toto");
- Assert.assertNotNull(hash1);
- Assert.assertEquals(PasswordTools.MD5_LENGTH, hash1.length());
- Assert.assertEquals(PasswordTools.md5("toto"), hash1);
- String hash2 = PasswordTools.md5("titi");
- Assert.assertNotNull(hash2);
- Assert.assertEquals(PasswordTools.MD5_LENGTH, hash2.length());
- Assert.assertEquals(PasswordTools.md5("titi"), hash2);
- Assert.assertNotNull(hash1);
- Assert.assertTrue(!hash1.equals(hash2));
- }
+ /**
+ * md5 test
+ */
+ @Test
+ public void md5() {
+ String hash1 = PasswordTools.md5("toto");
+ Assert.assertNotNull(hash1);
+ Assert.assertEquals(PasswordTools.MD5_LENGTH, hash1.length());
+ Assert.assertEquals(PasswordTools.md5("toto"), hash1);
+ String hash2 = PasswordTools.md5("titi");
+ Assert.assertNotNull(hash2);
+ Assert.assertEquals(PasswordTools.MD5_LENGTH, hash2.length());
+ Assert.assertEquals(PasswordTools.md5("titi"), hash2);
+ Assert.assertNotNull(hash1);
+ Assert.assertTrue(!hash1.equals(hash2));
+ }
- /**
- * random test
- */
- @Test
- public void random() {
- String password1 = PasswordTools.random();
- Assert.assertNotNull(password1);
- Assert.assertTrue(password1.length() >= PasswordTools.PASSWORD_LENGTH_MIN);
- Assert.assertTrue(password1.length() <= PasswordTools.PASSWORD_LENGTH_MAX);
- String password2 = PasswordTools.random();
- Assert.assertNotNull(password2);
- Assert.assertTrue(password2.length() >= PasswordTools.PASSWORD_LENGTH_MIN);
- Assert.assertTrue(password2.length() <= PasswordTools.PASSWORD_LENGTH_MAX);
- Assert.assertTrue(!password1.equals(password2));
- }
+ /**
+ * random test
+ */
+ @Test
+ public void random() {
+ String password1 = PasswordTools.random();
+ Assert.assertNotNull(password1);
+ Assert.assertTrue(password1.length() >= PasswordTools.PASSWORD_LENGTH_MIN);
+ Assert.assertTrue(password1.length() <= PasswordTools.PASSWORD_LENGTH_MAX);
+ String password2 = PasswordTools.random();
+ Assert.assertNotNull(password2);
+ Assert.assertTrue(password2.length() >= PasswordTools.PASSWORD_LENGTH_MIN);
+ Assert.assertTrue(password2.length() <= PasswordTools.PASSWORD_LENGTH_MAX);
+ Assert.assertTrue(!password1.equals(password2));
+ }
- /**
- * sha1 test
- */
- @Test
- public void sha1() {
- String hash1 = PasswordTools.sha1("toto");
- Assert.assertNotNull(hash1);
- Assert.assertEquals(PasswordTools.sha1("toto"), hash1);
- Assert.assertEquals(PasswordTools.SHA1_LENGTH, hash1.length());
- String hash2 = PasswordTools.sha1("titi");
- Assert.assertNotNull(hash2);
- Assert.assertEquals(PasswordTools.SHA1_LENGTH, hash2.length());
- Assert.assertNotNull(hash1);
- Assert.assertTrue(!hash1.equals(hash2));
- }
+ /**
+ * sha1 test
+ */
+ @Test
+ public void sha1() {
+ String hash1 = PasswordTools.sha1("toto");
+ Assert.assertNotNull(hash1);
+ Assert.assertEquals(PasswordTools.sha1("toto"), hash1);
+ Assert.assertEquals(PasswordTools.SHA1_LENGTH, hash1.length());
+ String hash2 = PasswordTools.sha1("titi");
+ Assert.assertNotNull(hash2);
+ Assert.assertEquals(PasswordTools.SHA1_LENGTH, hash2.length());
+ Assert.assertNotNull(hash1);
+ Assert.assertTrue(!hash1.equals(hash2));
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringToolsTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringToolsTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringToolsTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,136 +36,136 @@
*/
public final class StringToolsTest {
- /**
- * coupleToString test
- */
- @Test
- public void couplesToString() {
- // Empty
- Map<String, Integer> couples = new HashMap<String, Integer>();
- String toString = StringTools.couplesToString(couples, " ", " / ");
- // One couple
- couples.put("Toto", 1);
- toString = StringTools.couplesToString(couples, " ", " / ");
- Assert.assertEquals("Toto 1", toString);
- // Two couples
- couples.put("Titi", 2);
- toString = StringTools.couplesToString(couples, " ", " / ");
- Assert.assertEquals("Toto 1 / Titi 2", toString);
- }
+ /**
+ * coupleToString test
+ */
+ @Test
+ public void couplesToString() {
+ // Empty
+ Map<String, Integer> couples = new HashMap<String, Integer>();
+ String toString = StringTools.couplesToString(couples, " ", " / ");
+ // One couple
+ couples.put("Toto", 1);
+ toString = StringTools.couplesToString(couples, " ", " / ");
+ Assert.assertEquals("Toto 1", toString);
+ // Two couples
+ couples.put("Titi", 2);
+ toString = StringTools.couplesToString(couples, " ", " / ");
+ Assert.assertEquals("Toto 1 / Titi 2", toString);
+ }
- /**
- * length test
- */
- @Test
- public void length() {
- Assert.assertEquals(-1, StringTools.length(null));
- Assert.assertEquals(0, StringTools.length(""));
- Assert.assertEquals(1, StringTools.length("a"));
- }
+ /**
+ * length test
+ */
+ @Test
+ public void length() {
+ Assert.assertEquals(-1, StringTools.length(null));
+ Assert.assertEquals(0, StringTools.length(""));
+ Assert.assertEquals(1, StringTools.length("a"));
+ }
- /**
- * lineIterator test
- */
- @Test
- public void lineIterator() {
- // Empty
- StringBuilder lines = new StringBuilder();
- Iterator<String> i = StringTools.lineIterator(lines);
- Assert.assertFalse(i.hasNext());
- // One line
- lines.append("Toto");
- i = StringTools.lineIterator(lines);
- Assert.assertTrue(i.hasNext());
- Assert.assertEquals("Toto", i.next());
- Assert.assertFalse(i.hasNext());
- // Two lines with a blank one
- lines.append("\n ");
- i = StringTools.lineIterator(lines);
- Assert.assertTrue(i.hasNext());
- Assert.assertEquals("Toto", i.next());
- Assert.assertFalse(i.hasNext());
- // Three lines with a blank one
- lines.append("\nTiti");
- i = StringTools.lineIterator(lines);
- Assert.assertTrue(i.hasNext());
- Assert.assertEquals("Toto", i.next());
- Assert.assertTrue(i.hasNext());
- Assert.assertEquals("Titi", i.next());
- Assert.assertFalse(i.hasNext());
- }
+ /**
+ * lineIterator test
+ */
+ @Test
+ public void lineIterator() {
+ // Empty
+ StringBuilder lines = new StringBuilder();
+ Iterator<String> i = StringTools.lineIterator(lines);
+ Assert.assertFalse(i.hasNext());
+ // One line
+ lines.append("Toto");
+ i = StringTools.lineIterator(lines);
+ Assert.assertTrue(i.hasNext());
+ Assert.assertEquals("Toto", i.next());
+ Assert.assertFalse(i.hasNext());
+ // Two lines with a blank one
+ lines.append("\n ");
+ i = StringTools.lineIterator(lines);
+ Assert.assertTrue(i.hasNext());
+ Assert.assertEquals("Toto", i.next());
+ Assert.assertFalse(i.hasNext());
+ // Three lines with a blank one
+ lines.append("\nTiti");
+ i = StringTools.lineIterator(lines);
+ Assert.assertTrue(i.hasNext());
+ Assert.assertEquals("Toto", i.next());
+ Assert.assertTrue(i.hasNext());
+ Assert.assertEquals("Titi", i.next());
+ Assert.assertFalse(i.hasNext());
+ }
- /**
- * replaceAccents test
- */
- @Test
- public void replaceAccents() {
- Assert.assertEquals(null, StringTools.replaceAccents(null));
- Assert.assertEquals("", StringTools.replaceAccents(""));
- Assert.assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYz", StringTools.replaceAccents("AbCdEfGhIjKlMnOpQrStUvWxYz"));
- Assert.assertEquals("&e'(-e_ca)=u%*µ^¨$£}¤]@^`|[{#~", StringTools
- .replaceAccents("&é'(-è_çà)=ù%*µ^¨$£}¤]@^`|[{#~"));
- }
+ /**
+ * replaceAccents test
+ */
+ @Test
+ public void replaceAccents() {
+ Assert.assertEquals(null, StringTools.replaceAccents(null));
+ Assert.assertEquals("", StringTools.replaceAccents(""));
+ Assert.assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYz", StringTools.replaceAccents("AbCdEfGhIjKlMnOpQrStUvWxYz"));
+ Assert.assertEquals("&e'(-e_ca)=u%*µ^¨$£}¤]@^`|[{#~", StringTools
+ .replaceAccents("&é'(-è_çà)=ù%*µ^¨$£}¤]@^`|[{#~"));
+ }
- /**
- * Replace consecutive whitespaces test
- */
- @Test
- public void replaceConsecutiveWhitespaces() {
- Assert.assertNull(StringTools.replaceConsecutiveWhitespaces(null));
- Assert.assertEquals("", StringTools.replaceConsecutiveWhitespaces(""));
- Assert.assertEquals(" ", StringTools.replaceConsecutiveWhitespaces(" "));
- Assert.assertEquals(" ", StringTools.replaceConsecutiveWhitespaces(" "));
- Assert.assertEquals(" toto titi ", StringTools.replaceConsecutiveWhitespaces(" toto titi "));
- }
+ /**
+ * Replace consecutive whitespaces test
+ */
+ @Test
+ public void replaceConsecutiveWhitespaces() {
+ Assert.assertNull(StringTools.replaceConsecutiveWhitespaces(null));
+ Assert.assertEquals("", StringTools.replaceConsecutiveWhitespaces(""));
+ Assert.assertEquals(" ", StringTools.replaceConsecutiveWhitespaces(" "));
+ Assert.assertEquals(" ", StringTools.replaceConsecutiveWhitespaces(" "));
+ Assert.assertEquals(" toto titi ", StringTools.replaceConsecutiveWhitespaces(" toto titi "));
+ }
- /**
- * Replace consecutive whitespaces by underscore test
- */
- @Test
- public void replaceConsecutiveWhitespacesByUnderscore() {
- Assert.assertNull(StringTools.replaceConsecutiveWhitespaces(null));
- Assert.assertEquals("", StringTools.replaceConsecutiveWhitespacesByUnderscore(""));
- Assert.assertEquals("_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" "));
- Assert.assertEquals("_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" "));
- Assert.assertEquals("_toto_titi_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" toto titi "));
- }
+ /**
+ * Replace consecutive whitespaces by underscore test
+ */
+ @Test
+ public void replaceConsecutiveWhitespacesByUnderscore() {
+ Assert.assertNull(StringTools.replaceConsecutiveWhitespaces(null));
+ Assert.assertEquals("", StringTools.replaceConsecutiveWhitespacesByUnderscore(""));
+ Assert.assertEquals("_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" "));
+ Assert.assertEquals("_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" "));
+ Assert.assertEquals("_toto_titi_", StringTools.replaceConsecutiveWhitespacesByUnderscore(" toto titi "));
+ }
- /**
- * Replace non alpha test
- */
- @Test
- public void replaceNonAlpha() {
- Assert.assertNull(StringTools.replaceNonAlpha(null));
- Assert.assertEquals("", StringTools.replaceNonAlpha(""));
- Assert.assertEquals(" ", StringTools.replaceNonAlpha(" "));
- Assert.assertEquals("e", StringTools.replaceNonAlpha("e"));
- Assert.assertEquals(" ", StringTools.replaceNonAlpha("é"));
- Assert.assertEquals("tot ", StringTools.replaceNonAlpha("totô2"));
- }
+ /**
+ * Replace non alpha test
+ */
+ @Test
+ public void replaceNonAlpha() {
+ Assert.assertNull(StringTools.replaceNonAlpha(null));
+ Assert.assertEquals("", StringTools.replaceNonAlpha(""));
+ Assert.assertEquals(" ", StringTools.replaceNonAlpha(" "));
+ Assert.assertEquals("e", StringTools.replaceNonAlpha("e"));
+ Assert.assertEquals(" ", StringTools.replaceNonAlpha("é"));
+ Assert.assertEquals("tot ", StringTools.replaceNonAlpha("totô2"));
+ }
- /**
- * truncate test
- */
- @Test
- public void truncate() {
- String truncation = "..";
- StringBuilder toTruncate = new StringBuilder();
- // Null
- Assert.assertNull(StringTools.truncate((StringBuilder) null, truncation));
- Assert.assertNull(StringTools.truncate((String) null, truncation));
- // Empty
- Assert.assertNotNull(StringTools.truncate(toTruncate, truncation));
- Assert.assertTrue(StringTools.truncate(toTruncate, truncation).isEmpty());
- // Without truncation
- toTruncate.append(".");
- Assert.assertEquals(".", StringTools.truncate(toTruncate, truncation));
- // With truncation -> empty
- toTruncate.append(".");
- Assert.assertNotNull(StringTools.truncate(toTruncate, truncation));
- Assert.assertTrue(StringTools.truncate(toTruncate, truncation).isEmpty());
- // With truncation -> !empty
- toTruncate.append(".");
- Assert.assertEquals(".", StringTools.truncate(toTruncate, truncation));
- }
+ /**
+ * truncate test
+ */
+ @Test
+ public void truncate() {
+ String truncation = "..";
+ StringBuilder toTruncate = new StringBuilder();
+ // Null
+ Assert.assertNull(StringTools.truncate((StringBuilder) null, truncation));
+ Assert.assertNull(StringTools.truncate((String) null, truncation));
+ // Empty
+ Assert.assertNotNull(StringTools.truncate(toTruncate, truncation));
+ Assert.assertTrue(StringTools.truncate(toTruncate, truncation).isEmpty());
+ // Without truncation
+ toTruncate.append(".");
+ Assert.assertEquals(".", StringTools.truncate(toTruncate, truncation));
+ // With truncation -> empty
+ toTruncate.append(".");
+ Assert.assertNotNull(StringTools.truncate(toTruncate, truncation));
+ Assert.assertTrue(StringTools.truncate(toTruncate, truncation).isEmpty());
+ // With truncation -> !empty
+ toTruncate.append(".");
+ Assert.assertEquals(".", StringTools.truncate(toTruncate, truncation));
+ }
}
Modified: trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringTransformerTest.java
===================================================================
--- trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringTransformerTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.utils/src/test/java/nc/ird/module/utils/StringTransformerTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,125 +32,125 @@
*/
public class StringTransformerTest {
- /**
- * Capitalize test
- */
- @Test
- public void capitalize() {
- Assert.assertNull(new StringTransformer(null).capitalize().toString());
- Assert.assertEquals("", new StringTransformer("").capitalize().toString());
- Assert.assertEquals("AAa", new StringTransformer("AAa").capitalize().toString());
- Assert.assertEquals("AAa BBb", new StringTransformer("aAa bBb").capitalize().toString());
- Assert.assertEquals("AAa-bBb", new StringTransformer("aAa-bBb").capitalize().toString());
- }
+ /**
+ * Capitalize test
+ */
+ @Test
+ public void capitalize() {
+ Assert.assertNull(new StringTransformer(null).capitalize().toString());
+ Assert.assertEquals("", new StringTransformer("").capitalize().toString());
+ Assert.assertEquals("AAa", new StringTransformer("AAa").capitalize().toString());
+ Assert.assertEquals("AAa BBb", new StringTransformer("aAa bBb").capitalize().toString());
+ Assert.assertEquals("AAa-bBb", new StringTransformer("aAa-bBb").capitalize().toString());
+ }
- /**
- * Capitalize fully test
- */
- @Test
- public void capitalizeFully() {
- Assert.assertNull(new StringTransformer(null).capitalizeFully().toString());
- Assert.assertEquals("", new StringTransformer("").capitalizeFully().toString());
- Assert.assertEquals("Aaa", new StringTransformer("AAa").capitalizeFully().toString());
- Assert.assertEquals("Aaa Bbb", new StringTransformer("aAa bBb").capitalizeFully().toString());
- Assert.assertEquals("Aaa-bbb", new StringTransformer("aAa-bBb").capitalizeFully().toString());
- }
+ /**
+ * Capitalize fully test
+ */
+ @Test
+ public void capitalizeFully() {
+ Assert.assertNull(new StringTransformer(null).capitalizeFully().toString());
+ Assert.assertEquals("", new StringTransformer("").capitalizeFully().toString());
+ Assert.assertEquals("Aaa", new StringTransformer("AAa").capitalizeFully().toString());
+ Assert.assertEquals("Aaa Bbb", new StringTransformer("aAa bBb").capitalizeFully().toString());
+ Assert.assertEquals("Aaa-bbb", new StringTransformer("aAa-bBb").capitalizeFully().toString());
+ }
- /**
- * Init test
- */
- @Test
- public void init() {
- Assert.assertNull(new StringTransformer(null).toString());
- Assert.assertEquals("", new StringTransformer("").toString());
- Assert.assertEquals("toto", new StringTransformer("toto").toString());
+ /**
+ * Init test
+ */
+ @Test
+ public void init() {
+ Assert.assertNull(new StringTransformer(null).toString());
+ Assert.assertEquals("", new StringTransformer("").toString());
+ Assert.assertEquals("toto", new StringTransformer("toto").toString());
- StringTransformer st = new StringTransformer(null);
- Assert.assertEquals(st, st.trim());
- }
+ StringTransformer st = new StringTransformer(null);
+ Assert.assertEquals(st, st.trim());
+ }
- /**
- * Replace accents test
- */
- @Test
- public void replaceAccents() {
- Assert.assertNull(new StringTransformer(null).replaceAccents().toString());
- Assert.assertEquals("", new StringTransformer("").replaceAccents().toString());
- Assert.assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYz", new StringTransformer("AbCdEfGhIjKlMnOpQrStUvWxYz")
- .replaceAccents().toString());
- Assert.assertEquals("&e'(-e_ca)=u%*µ^¨$£}¤]@^`|[{#~", new StringTransformer("&é'(-è_çà)=ù%*µ^¨$£}¤]@^`|[{#~")
- .replaceAccents().toString());
- }
+ /**
+ * Replace accents test
+ */
+ @Test
+ public void replaceAccents() {
+ Assert.assertNull(new StringTransformer(null).replaceAccents().toString());
+ Assert.assertEquals("", new StringTransformer("").replaceAccents().toString());
+ Assert.assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYz", new StringTransformer("AbCdEfGhIjKlMnOpQrStUvWxYz")
+ .replaceAccents().toString());
+ Assert.assertEquals("&e'(-e_ca)=u%*µ^¨$£}¤]@^`|[{#~", new StringTransformer("&é'(-è_çà)=ù%*µ^¨$£}¤]@^`|[{#~")
+ .replaceAccents().toString());
+ }
- /**
- * Replace consecutive whitespaces test
- */
- @Test
- public void replaceConsecutiveWhitespaces() {
- Assert.assertNull(new StringTransformer(null).replaceConsecutiveWhitespaces().toString());
- Assert.assertEquals("", new StringTransformer("").replaceConsecutiveWhitespaces().toString());
- Assert.assertEquals(" ", new StringTransformer(" ").replaceConsecutiveWhitespaces().toString());
- Assert.assertEquals(" ", new StringTransformer(" ").replaceConsecutiveWhitespaces().toString());
- Assert.assertEquals(" toto titi ", new StringTransformer(" toto titi ").replaceConsecutiveWhitespaces()
- .toString());
- }
+ /**
+ * Replace consecutive whitespaces test
+ */
+ @Test
+ public void replaceConsecutiveWhitespaces() {
+ Assert.assertNull(new StringTransformer(null).replaceConsecutiveWhitespaces().toString());
+ Assert.assertEquals("", new StringTransformer("").replaceConsecutiveWhitespaces().toString());
+ Assert.assertEquals(" ", new StringTransformer(" ").replaceConsecutiveWhitespaces().toString());
+ Assert.assertEquals(" ", new StringTransformer(" ").replaceConsecutiveWhitespaces().toString());
+ Assert.assertEquals(" toto titi ", new StringTransformer(" toto titi ").replaceConsecutiveWhitespaces()
+ .toString());
+ }
- /**
- * Replace non alpha test
- */
- @Test
- public void replaceNonAlpha() {
- Assert.assertNull(new StringTransformer(null).toString());
- Assert.assertEquals("", new StringTransformer("").replaceNonAlpha().toString());
- Assert.assertEquals(" ", new StringTransformer(" ").replaceNonAlpha().toString());
- Assert.assertEquals("e", new StringTransformer("e").replaceNonAlpha().toString());
- Assert.assertEquals(" ", new StringTransformer("é").replaceNonAlpha().toString());
- Assert.assertEquals("tot ", new StringTransformer("totô2").replaceNonAlpha().toString());
- }
+ /**
+ * Replace non alpha test
+ */
+ @Test
+ public void replaceNonAlpha() {
+ Assert.assertNull(new StringTransformer(null).toString());
+ Assert.assertEquals("", new StringTransformer("").replaceNonAlpha().toString());
+ Assert.assertEquals(" ", new StringTransformer(" ").replaceNonAlpha().toString());
+ Assert.assertEquals("e", new StringTransformer("e").replaceNonAlpha().toString());
+ Assert.assertEquals(" ", new StringTransformer("é").replaceNonAlpha().toString());
+ Assert.assertEquals("tot ", new StringTransformer("totô2").replaceNonAlpha().toString());
+ }
- /**
- * To lower case test
- */
- @Test
- public void toLowerCase() {
- Assert.assertNull(new StringTransformer(null).toLowerCase().toString());
- Assert.assertEquals("", new StringTransformer("").toLowerCase().toString());
- Assert.assertEquals("a", new StringTransformer("A").toLowerCase().toString());
- Assert.assertEquals("aaaââ", new StringTransformer("aAaÂâ").toLowerCase().toString());
- }
+ /**
+ * To lower case test
+ */
+ @Test
+ public void toLowerCase() {
+ Assert.assertNull(new StringTransformer(null).toLowerCase().toString());
+ Assert.assertEquals("", new StringTransformer("").toLowerCase().toString());
+ Assert.assertEquals("a", new StringTransformer("A").toLowerCase().toString());
+ Assert.assertEquals("aaaââ", new StringTransformer("aAaÂâ").toLowerCase().toString());
+ }
- /**
- * To upper case test
- */
- @Test
- public void toUpperCase() {
- Assert.assertNull(new StringTransformer(null).toUpperCase().toString());
- Assert.assertEquals("", new StringTransformer("").toUpperCase().toString());
- Assert.assertEquals("A", new StringTransformer("a").toUpperCase().toString());
- Assert.assertEquals("AAAÂÂ", new StringTransformer("aAaÂâ").toUpperCase().toString());
- }
+ /**
+ * To upper case test
+ */
+ @Test
+ public void toUpperCase() {
+ Assert.assertNull(new StringTransformer(null).toUpperCase().toString());
+ Assert.assertEquals("", new StringTransformer("").toUpperCase().toString());
+ Assert.assertEquals("A", new StringTransformer("a").toUpperCase().toString());
+ Assert.assertEquals("AAAÂÂ", new StringTransformer("aAaÂâ").toUpperCase().toString());
+ }
- /**
- * Trim test
- */
- @Test
- public void trim() {
- Assert.assertNull(new StringTransformer(null).trim().toString());
- Assert.assertEquals("", new StringTransformer("").trim().toString());
- Assert.assertEquals("", new StringTransformer(" ").trim().toString());
- Assert.assertEquals("toto", new StringTransformer(" toto ").trim().toString());
- Assert.assertEquals("toto titi", new StringTransformer(" toto titi ").trim().toString());
- }
+ /**
+ * Trim test
+ */
+ @Test
+ public void trim() {
+ Assert.assertNull(new StringTransformer(null).trim().toString());
+ Assert.assertEquals("", new StringTransformer("").trim().toString());
+ Assert.assertEquals("", new StringTransformer(" ").trim().toString());
+ Assert.assertEquals("toto", new StringTransformer(" toto ").trim().toString());
+ Assert.assertEquals("toto titi", new StringTransformer(" toto titi ").trim().toString());
+ }
- /**
- * Trim to null test
- */
- @Test
- public void trimToNull() {
- Assert.assertNull(new StringTransformer(null).trimToNull().toString());
- Assert.assertNull(new StringTransformer("").trimToNull().toString());
- Assert.assertNull(new StringTransformer(" ").trimToNull().toString());
- Assert.assertEquals("toto", new StringTransformer(" toto ").trimToNull().toString());
- Assert.assertEquals("toto titi", new StringTransformer(" toto titi ").trim().toString());
- }
+ /**
+ * Trim to null test
+ */
+ @Test
+ public void trimToNull() {
+ Assert.assertNull(new StringTransformer(null).trimToNull().toString());
+ Assert.assertNull(new StringTransformer("").trimToNull().toString());
+ Assert.assertNull(new StringTransformer(" ").trimToNull().toString());
+ Assert.assertEquals("toto", new StringTransformer(" toto ").trimToNull().toString());
+ Assert.assertEquals("toto titi", new StringTransformer(" toto titi ").trim().toString());
+ }
}
Modified: trunk/cantharella.web/pom.xml
===================================================================
--- trunk/cantharella.web/pom.xml 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/pom.xml 2013-01-29 09:48:04 UTC (rev 65)
@@ -1,7 +1,6 @@
<?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">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -21,7 +20,7 @@
<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 -->
+ <!-- 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>
@@ -31,7 +30,7 @@
</properties>
<build>
<resources>
- <!-- for html in java packages (wicket) -->
+ <!-- for html in java packages (wicket) -->
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
@@ -266,8 +265,8 @@
</dependency>
<!--dependency>
<groupId>org.apache.wicket</groupId>
- <artifactId>wicket-auth-roles</artifactId>
- </dependency-->
+ <artifactId>wicket-auth-roles</artifactId>
+ </dependency -->
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-datetime</artifactId>
@@ -290,7 +289,7 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
-
+
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebApplicationImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -105,315 +105,315 @@
*/
public final class WebApplicationImpl extends WebApplication {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /**
- * SpringBeans injector (some objects such as Pages are automatically injected, by not all of them)
- * @param object Object to be injected
- */
- public static void injectSpringBeans(Object object) {
- Injector.get().inject(object);
- }
+ /**
+ * SpringBeans injector (some objects such as Pages are automatically injected, by not all of them)
+ * @param object Object to be injected
+ */
+ public static void injectSpringBeans(Object object) {
+ Injector.get().inject(object);
+ }
- /** Debug mode */
- private final boolean debug;
+ /** Debug mode */
+ private final boolean debug;
- /** Internationalization messages */
- private final IStringResourceLoader[] messages;
+ /** Internationalization messages */
+ private final IStringResourceLoader[] messages;
- /** Optimize mode */
- private final boolean optimize;
+ /** Optimize mode */
+ private final boolean optimize;
- /** Service: personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service: personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Wicket configuration (Application.DEVELOPMENT or Application.DEPLOYMENT) */
- private final RuntimeConfigurationType wicketConfiguration;
+ /** Wicket configuration (Application.DEVELOPMENT or Application.DEPLOYMENT) */
+ private final RuntimeConfigurationType wicketConfiguration;
- /**
- * Constructor
- * @param debug Debug mode
- * @param optimize Optimize mode
- * @param wicketConfiguration Wicket configuration (DEVELOPMENT or DEPLOYMENT)
- * @param messages Internationalization messages
- */
- public WebApplicationImpl(boolean debug, boolean optimize, RuntimeConfigurationType wicketConfiguration,
- IStringResourceLoader... messages) {
- AssertTools.assertArrayNotNull(messages);
- this.debug = debug;
- this.optimize = optimize;
- this.wicketConfiguration = wicketConfiguration;
- this.messages = messages;
- }
+ /**
+ * Constructor
+ * @param debug Debug mode
+ * @param optimize Optimize mode
+ * @param wicketConfiguration Wicket configuration (DEVELOPMENT or DEPLOYMENT)
+ * @param messages Internationalization messages
+ */
+ public WebApplicationImpl(boolean debug, boolean optimize, RuntimeConfigurationType wicketConfiguration,
+ IStringResourceLoader... messages) {
+ AssertTools.assertArrayNotNull(messages);
+ this.debug = debug;
+ this.optimize = optimize;
+ this.wicketConfiguration = wicketConfiguration;
+ this.messages = messages;
+ }
- /** {@inheritDoc} */
- @Override
- public RuntimeConfigurationType getConfigurationType() {
- return wicketConfiguration;
- }
+ /** {@inheritDoc} */
+ @Override
+ public RuntimeConfigurationType getConfigurationType() {
+ return wicketConfiguration;
+ }
- /** {@inheritDoc} */
- @Override
- public Class<HomePage> getHomePage() {
- return HomePage.class;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Class<HomePage> getHomePage() {
+ return HomePage.class;
+ }
- /** {@inheritDoc} */
- @Override
- protected void init() {
- super.init();
- getComponentInstantiationListeners().add(new SpringComponentInjector(this));
- injectSpringBeans(this);
- try {
- personneService.checkOrCreateAdmin();
- } catch (DataConstraintException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- setApplicationSettings();
- setDebugSettings();
- setExceptionSettings();
- setFrameworkSettings();
- setMarkupSettings();
- setPageSettings();
- setRequestCycleSettings();
- setRequestLoggerSettings();
- setResourceSettings();
- setSecuritySettings();
- mountUrls();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void init() {
+ super.init();
+ getComponentInstantiationListeners().add(new SpringComponentInjector(this));
+ injectSpringBeans(this);
+ try {
+ personneService.checkOrCreateAdmin();
+ } catch (DataConstraintException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ setApplicationSettings();
+ setDebugSettings();
+ setExceptionSettings();
+ setFrameworkSettings();
+ setMarkupSettings();
+ setPageSettings();
+ setRequestCycleSettings();
+ setRequestLoggerSettings();
+ setResourceSettings();
+ setSecuritySettings();
+ mountUrls();
+ }
- /** {@inheritDoc} */
- @Override
- protected IConverterLocator newConverterLocator() {
- ConverterLocator converterLocator = (ConverterLocator) super.newConverterLocator();
- converterLocator.set(Double.class, DoubleConverterImpl.INSTANCE);
- converterLocator.set(BigDecimal.class, BigDecimalConverterImpl.INSTANCE);
- return converterLocator;
- }
+ /** {@inheritDoc} */
+ @Override
+ protected IConverterLocator newConverterLocator() {
+ ConverterLocator converterLocator = (ConverterLocator) super.newConverterLocator();
+ converterLocator.set(Double.class, DoubleConverterImpl.INSTANCE);
+ converterLocator.set(BigDecimal.class, BigDecimalConverterImpl.INSTANCE);
+ return converterLocator;
+ }
- /** {@inheritDoc} */
- @Override
- public Session newSession(Request request, Response response) {
- return new AuthSession(request);
- }
+ /** {@inheritDoc} */
+ @Override
+ public Session newSession(Request request, Response response) {
+ return new AuthSession(request);
+ }
- /**
- * Application settings
- */
- private void setApplicationSettings() {
- getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);
- getApplicationSettings().setDefaultMaximumUploadSize(WebContext.HTTP_MAXIMUM_UPLOAD);
- getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
- getApplicationSettings().setPageExpiredErrorPage(PageExpiredErrorPage.class);
- }
+ /**
+ * Application settings
+ */
+ private void setApplicationSettings() {
+ getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);
+ getApplicationSettings().setDefaultMaximumUploadSize(WebContext.HTTP_MAXIMUM_UPLOAD);
+ getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
+ getApplicationSettings().setPageExpiredErrorPage(PageExpiredErrorPage.class);
+ }
- /**
- * Debug settings
- */
- private void setDebugSettings() {
- getDebugSettings().setAjaxDebugModeEnabled(debug);
- getDebugSettings().setComponentUseCheck(debug);
- getDebugSettings().setDevelopmentUtilitiesEnabled(debug);
- getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(debug);
- getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(debug);
- getDebugSettings().setOutputComponentPath(debug);
- getDebugSettings().setOutputMarkupContainerClassName(debug);
- }
+ /**
+ * Debug settings
+ */
+ private void setDebugSettings() {
+ getDebugSettings().setAjaxDebugModeEnabled(debug);
+ getDebugSettings().setComponentUseCheck(debug);
+ getDebugSettings().setDevelopmentUtilitiesEnabled(debug);
+ getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(debug);
+ getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(debug);
+ getDebugSettings().setOutputComponentPath(debug);
+ getDebugSettings().setOutputMarkupContainerClassName(debug);
+ }
- /**
- * Exception settings
- */
- private void setExceptionSettings() {
- getExceptionSettings().setUnexpectedExceptionDisplay(
- debug ? IExceptionSettings.SHOW_EXCEPTION_PAGE : IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
- }
+ /**
+ * Exception settings
+ */
+ private void setExceptionSettings() {
+ getExceptionSettings().setUnexpectedExceptionDisplay(
+ debug ? IExceptionSettings.SHOW_EXCEPTION_PAGE : IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
+ }
- /**
- * Framework settings
- */
- private void setFrameworkSettings() {
- getFrameworkSettings().setDetachListener(null);
- }
+ /**
+ * Framework settings
+ */
+ private void setFrameworkSettings() {
+ getFrameworkSettings().setDetachListener(null);
+ }
- /**
- * Markup settings
- */
- private void setMarkupSettings() {
- getMarkupSettings().setAutomaticLinking(false);
- getMarkupSettings().setCompressWhitespace(optimize);
- getMarkupSettings().setDefaultAfterDisabledLink("</strike");
- getMarkupSettings().setDefaultBeforeDisabledLink("<strike>");
- getMarkupSettings().setDefaultMarkupEncoding(DataContext.ENCODING);
- // getMarkupSettings().setMarkupCache(???);
- // getMarkupSettings().setMarkupParserFactory(???);
- getMarkupSettings().setStripComments(optimize);
- getMarkupSettings().setStripWicketTags(true);
+ /**
+ * Markup settings
+ */
+ private void setMarkupSettings() {
+ getMarkupSettings().setAutomaticLinking(false);
+ getMarkupSettings().setCompressWhitespace(optimize);
+ getMarkupSettings().setDefaultAfterDisabledLink("</strike");
+ getMarkupSettings().setDefaultBeforeDisabledLink("<strike>");
+ getMarkupSettings().setDefaultMarkupEncoding(DataContext.ENCODING);
+ // getMarkupSettings().setMarkupCache(???);
+ // getMarkupSettings().setMarkupParserFactory(???);
+ getMarkupSettings().setStripComments(optimize);
+ getMarkupSettings().setStripWicketTags(true);
- getMarkupSettings().setThrowExceptionOnMissingXmlDeclaration(false);
- }
+ getMarkupSettings().setThrowExceptionOnMissingXmlDeclaration(false);
+ }
- /**
- * Page settings
- */
- private void setPageSettings() {
- // getPageSettings().addComponentResolver(???);
- getPageSettings().setVersionPagesByDefault(true);
- }
+ /**
+ * Page settings
+ */
+ private void setPageSettings() {
+ // getPageSettings().addComponentResolver(???);
+ getPageSettings().setVersionPagesByDefault(true);
+ }
- /**
- * Request cycle settings
- */
- private void setRequestCycleSettings() {
- // getRequestCycleSettings().addResponseFilter(???);
- getRequestCycleSettings().setBufferResponse(true);
- getRequestCycleSettings().setGatherExtendedBrowserInfo(false);
- getRequestCycleSettings().setRenderStrategy(RenderStrategy.REDIRECT_TO_BUFFER);
- getRequestCycleSettings().setResponseRequestEncoding(DataContext.ENCODING);
- getRequestCycleSettings().setTimeout(WebContext.HTTP_TIME_OUT);
- }
+ /**
+ * Request cycle settings
+ */
+ private void setRequestCycleSettings() {
+ // getRequestCycleSettings().addResponseFilter(???);
+ getRequestCycleSettings().setBufferResponse(true);
+ getRequestCycleSettings().setGatherExtendedBrowserInfo(false);
+ getRequestCycleSettings().setRenderStrategy(RenderStrategy.REDIRECT_TO_BUFFER);
+ getRequestCycleSettings().setResponseRequestEncoding(DataContext.ENCODING);
+ getRequestCycleSettings().setTimeout(WebContext.HTTP_TIME_OUT);
+ }
- /**
- * Request logger settings
- */
- private void setRequestLoggerSettings() {
- getRequestLoggerSettings().setRecordSessionSize(debug);
- getRequestLoggerSettings().setRequestLoggerEnabled(debug);
- getRequestLoggerSettings().setRequestsWindowSize(WebContext.HTTP_REQUEST_LOGGER_WINDOW_SIZE);
- }
+ /**
+ * Request logger settings
+ */
+ private void setRequestLoggerSettings() {
+ getRequestLoggerSettings().setRecordSessionSize(debug);
+ getRequestLoggerSettings().setRequestLoggerEnabled(debug);
+ getRequestLoggerSettings().setRequestsWindowSize(WebContext.HTTP_REQUEST_LOGGER_WINDOW_SIZE);
+ }
- /**
- * Resource settings
- */
- private void setResourceSettings() {
- for (IStringResourceLoader message : messages) {
- getResourceSettings().getStringResourceLoaders().add(message);
- }
- getResourceSettings().setDefaultCacheDuration(optimize ? WebContext.HTTP_CACHE_DURATION : Duration.NONE);
+ /**
+ * Resource settings
+ */
+ private void setResourceSettings() {
+ for (IStringResourceLoader message : messages) {
+ getResourceSettings().getStringResourceLoaders().add(message);
+ }
+ getResourceSettings().setDefaultCacheDuration(optimize ? WebContext.HTTP_CACHE_DURATION : Duration.NONE);
- getResourceSettings().setJavaScriptCompressor(optimize ? new DefaultJavaScriptCompressor() : null);
+ getResourceSettings().setJavaScriptCompressor(optimize ? new DefaultJavaScriptCompressor() : null);
- getResourceSettings().setCssCompressor(optimize ? new NoOpTextCompressor() : null);
+ getResourceSettings().setCssCompressor(optimize ? new NoOpTextCompressor() : null);
- getResourceSettings().setParentFolderPlaceholder(null);
- getResourceSettings().setResourcePollFrequency(null);
+ getResourceSettings().setParentFolderPlaceholder(null);
+ getResourceSettings().setResourcePollFrequency(null);
- getResourceSettings().setThrowExceptionOnMissingResource(true);
- getResourceSettings().setUseDefaultOnMissingResource(!debug);
- }
+ getResourceSettings().setThrowExceptionOnMissingResource(true);
+ getResourceSettings().setUseDefaultOnMissingResource(!debug);
+ }
- /**
- * Security settings
- */
- private void setSecuritySettings() {
- getSecuritySettings().setAuthorizationStrategy(new AuthStrategy());
+ /**
+ * Security settings
+ */
+ private void setSecuritySettings() {
+ getSecuritySettings().setAuthorizationStrategy(new AuthStrategy());
- // Customize the cookie age for the authentification stategy
- IAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy(WebContext.AUTH_COOKIE_KEY) {
+ // Customize the cookie age for the authentification stategy
+ IAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy(WebContext.AUTH_COOKIE_KEY) {
- /** Cookie utils with custom settings */
- private CookieUtils cookieUtils;
+ /** Cookie utils with custom settings */
+ private CookieUtils cookieUtils;
- protected CookieUtils getCookieUtils() {
- if (cookieUtils == null) {
- cookieUtils = new CookieUtils();
- cookieUtils.getSettings().setMaxAge(WebContext.AUTH_COOKIE_MAX_AGE);
- }
- return cookieUtils;
- }
- };
- getSecuritySettings().setAuthenticationStrategy(authStrategy);
+ protected CookieUtils getCookieUtils() {
+ if (cookieUtils == null) {
+ cookieUtils = new CookieUtils();
+ cookieUtils.getSettings().setMaxAge(WebContext.AUTH_COOKIE_MAX_AGE);
+ }
+ return cookieUtils;
+ }
+ };
+ getSecuritySettings().setAuthenticationStrategy(authStrategy);
- getSecuritySettings().setEnforceMounts(false);
- }
+ getSecuritySettings().setEnforceMounts(false);
+ }
- /**
- * Configure the mapping of urls
- */
- private void mountUrls() {
+ /**
+ * Configure the mapping of urls
+ */
+ private void mountUrls() {
- getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/list", ListCampagnesPage.class));
- mountPage("/campagne/list", ListCampagnesPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/edit", ManageCampagnePage.class));
- mountPage("/campagne/edit", ManageCampagnePage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/view", ReadCampagnePage.class));
- mountPage("/campagne/view", ReadCampagnePage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/list", ListCampagnesPage.class));
+ mountPage("/campagne/list", ListCampagnesPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/edit", ManageCampagnePage.class));
+ mountPage("/campagne/edit", ManageCampagnePage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/campagne/view", ReadCampagnePage.class));
+ mountPage("/campagne/view", ReadCampagnePage.class);
- getRootRequestMapperAsCompound().add(
- new MountMapper("/config", new PackageMapper(PackageName.forClass(ListConfigurationPage.class))));
+ getRootRequestMapperAsCompound().add(
+ new MountMapper("/config", new PackageMapper(PackageName.forClass(ListConfigurationPage.class))));
- getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/list", ListExtractionsPage.class));
- mountPage("/extraction/list", ListExtractionsPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/edit", ManageExtractionPage.class));
- mountPage("/extraction/edit", ManageExtractionPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/view", ReadExtractionPage.class));
- mountPage("/extraction/view", ReadExtractionPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/list", ListExtractionsPage.class));
+ mountPage("/extraction/list", ListExtractionsPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/edit", ManageExtractionPage.class));
+ mountPage("/extraction/edit", ManageExtractionPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/extraction/view", ReadExtractionPage.class));
+ mountPage("/extraction/view", ReadExtractionPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/lot/list", ListLotsPage.class));
- mountPage("/lot/list", ListLotsPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/lot/edit", ManageLotPage.class));
- mountPage("/lot/edit", ManageLotPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/lot/view", ReadLotPage.class));
- mountPage("/lot/view", ReadLotPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/lot/list", ListLotsPage.class));
+ mountPage("/lot/list", ListLotsPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/lot/edit", ManageLotPage.class));
+ mountPage("/lot/edit", ManageLotPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/lot/view", ReadLotPage.class));
+ mountPage("/lot/view", ReadLotPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/personne/list", ListPersonnesPage.class));
- mountPage("/personne/list", ListPersonnesPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/personne/edit", ManagePersonnePage.class));
- mountPage("/personne/edit", ManagePersonnePage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/personne/view", ReadPersonnePage.class));
- mountPage("/personne/view", ReadPersonnePage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/personne/list", ListPersonnesPage.class));
+ mountPage("/personne/list", ListPersonnesPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/personne/edit", ManagePersonnePage.class));
+ mountPage("/personne/edit", ManagePersonnePage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/personne/view", ReadPersonnePage.class));
+ mountPage("/personne/view", ReadPersonnePage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/purification/list", ListPurificationsPage.class));
- mountPage("/purification/list", ListPurificationsPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/purification/edit", ManagePurificationPage.class));
- mountPage("/purification/edit", ManagePurificationPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/purification/view", ReadPurificationPage.class));
- mountPage("/purification/view", ReadPurificationPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/purification/list", ListPurificationsPage.class));
+ mountPage("/purification/list", ListPurificationsPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/purification/edit", ManagePurificationPage.class));
+ mountPage("/purification/edit", ManagePurificationPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/purification/view", ReadPurificationPage.class));
+ mountPage("/purification/view", ReadPurificationPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/list", ListSpecimensPage.class));
- mountPage("/specimen/list", ListSpecimensPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/edit", ManageSpecimenPage.class));
- mountPage("/specimen/edit", ManageSpecimenPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/view", ReadSpecimenPage.class));
- mountPage("/specimen/view", ReadSpecimenPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/list", ListSpecimensPage.class));
+ mountPage("/specimen/list", ListSpecimensPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/edit", ManageSpecimenPage.class));
+ mountPage("/specimen/edit", ManageSpecimenPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/specimen/view", ReadSpecimenPage.class));
+ mountPage("/specimen/view", ReadSpecimenPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/station/list", ListStationsPage.class));
- mountPage("/station/list", ListStationsPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/station/edit", ManageStationPage.class));
- mountPage("/station/edit", ManageStationPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/station/view", ReadStationPage.class));
- mountPage("/station/view", ReadStationPage.class);
-
- getRootRequestMapperAsCompound().add(new MountedMapper("/molecule/list", ListMoleculesPage.class));
+ getRootRequestMapperAsCompound().add(new MountedMapper("/station/list", ListStationsPage.class));
+ mountPage("/station/list", ListStationsPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/station/edit", ManageStationPage.class));
+ mountPage("/station/edit", ManageStationPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/station/view", ReadStationPage.class));
+ mountPage("/station/view", ReadStationPage.class);
+
+ getRootRequestMapperAsCompound().add(new MountedMapper("/molecule/list", ListMoleculesPage.class));
mountPage("/molecule/list", ListMoleculesPage.class);
getRootRequestMapperAsCompound().add(new MountedMapper("/molecule/edit", ManageMoleculePage.class));
mountPage("/molecule/edit", ManageMoleculePage.class);
getRootRequestMapperAsCompound().add(new MountedMapper("/molecule/view", ReadMoleculePage.class));
mountPage("/molecule/view", ReadMoleculePage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/list", ListTestsBioPage.class));
- mountPage("/testBio/list", ListTestsBioPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/edit", ManageTestBioPage.class));
- mountPage("/testBio/edit", ManageTestBioPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/view", ReadTestBioPage.class));
- mountPage("/testBio/view", ReadTestBioPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/list", ListTestsBioPage.class));
+ mountPage("/testBio/list", ListTestsBioPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/edit", ManageTestBioPage.class));
+ mountPage("/testBio/edit", ManageTestBioPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/testBio/view", ReadTestBioPage.class));
+ mountPage("/testBio/view", ReadTestBioPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/utilisateur/edit", ManageUtilisateurPage.class));
- mountPage("/utilisateur/edit", ManageUtilisateurPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/utilisateur/update", UpdateUtilisateurPage.class));
- mountPage("/utilisateur/update", UpdateUtilisateurPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/utilisateur/edit", ManageUtilisateurPage.class));
+ mountPage("/utilisateur/edit", ManageUtilisateurPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/utilisateur/update", UpdateUtilisateurPage.class));
+ mountPage("/utilisateur/update", UpdateUtilisateurPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/contact", ContactPage.class));
- mountPage("/contact", ContactPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/register", RegisterPage.class));
- mountPage("/register", RegisterPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/passwordLost", ResetPasswordPage.class));
- mountPage("/passwordLost", ResetPasswordPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/contact", ContactPage.class));
+ mountPage("/contact", ContactPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/register", RegisterPage.class));
+ mountPage("/register", RegisterPage.class);
+ getRootRequestMapperAsCompound().add(new MountedMapper("/passwordLost", ResetPasswordPage.class));
+ mountPage("/passwordLost", ResetPasswordPage.class);
- getRootRequestMapperAsCompound().add(new MountedMapper("/search", SearchPage.class));
+ getRootRequestMapperAsCompound().add(new MountedMapper("/search", SearchPage.class));
mountPage("/search", SearchPage.class);
- }
+ }
}
\ 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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/config/WebContext.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -67,133 +67,133 @@
@Configuration
public abstract class WebContext {
- /** Cookie key for authentification */
- public static final String AUTH_COOKIE_KEY = "LoggedIn";
+ /** Cookie key for authentification */
+ public static final String AUTH_COOKIE_KEY = "LoggedIn";
- /** Cookie max age for authentification */
- public static final int AUTH_COOKIE_MAX_AGE = (int) Duration.days(1).seconds();
+ /** 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;
+ /**
+ * 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) */
- public static final Map<Locale, List<String>> COUNTRY_CODES;
+ /** Country codes: Locale -> country code (sorted by country name) */
+ public static final Map<Locale, List<String>> COUNTRY_CODES;
- /** HTTP cache duraction */
- public static final Duration HTTP_CACHE_DURATION = Duration.days(1);
+ /** HTTP cache duraction */
+ public static final Duration HTTP_CACHE_DURATION = Duration.days(1);
- /** HTTP maximum upload */
- public static final Bytes HTTP_MAXIMUM_UPLOAD = Bytes.megabytes(1);
+ /** HTTP maximum upload */
+ public static final Bytes HTTP_MAXIMUM_UPLOAD = Bytes.megabytes(1);
- /** HTTP request logger window size */
- public static final int HTTP_REQUEST_LOGGER_WINDOW_SIZE = 2000;
+ /** HTTP request logger window size */
+ public static final int HTTP_REQUEST_LOGGER_WINDOW_SIZE = 2000;
- /** HTTP session max page maps */
- public static final int HTTP_SESSION_MAX_PAGE_MAPS = 5;
+ /** HTTP session max page maps */
+ public static final int HTTP_SESSION_MAX_PAGE_MAPS = 5;
- /** HTTP time out */
- public static final Duration HTTP_TIME_OUT = Duration.seconds(30);
+ /** HTTP time out */
+ public static final Duration HTTP_TIME_OUT = Duration.seconds(30);
- /** Référentiels codes */
- public static final List<Integer> REFERENTIEL_CODES = new ArrayList<Integer>(DataContext.REFERENTIELS.keySet());
+ /** Référentiels codes */
+ public static final List<Integer> REFERENTIEL_CODES = new ArrayList<Integer>(DataContext.REFERENTIELS.keySet());
- /** Percent format precision */
- public static final int PERCENT_PRECISION = 2;
+ /** Percent format precision */
+ public static final int PERCENT_PRECISION = 2;
- /** The maximum number of digits allowed in the fraction portion of doubles **/
- public static final int DOUBLE_MAX_FRACTION_DIGIT = 3;
+ /** 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 */
- public static final int ROWS_PER_PAGE = 20;
+ /** The maximum rows number displayed for a list page */
+ public static final int ROWS_PER_PAGE = 20;
- /** Message source for data layer */
- @Resource(name = "dataMessageSource")
- private MessageSourceAccessor dataMessageSource;
+ /** Message source for data layer */
+ @Resource(name = "dataMessageSource")
+ private MessageSourceAccessor dataMessageSource;
- /** Validator factory of the data layer */
- @Resource(name = "validatorFactory")
- private ValidatorFactory validatorFactory;
+ /** Validator factory of the data layer */
+ @Resource(name = "validatorFactory")
+ private ValidatorFactory validatorFactory;
- /** Debug mode */
- @Value("${app.debug}")
- protected boolean appDebugProperty;
+ /** Debug mode */
+ @Value("${app.debug}")
+ protected boolean appDebugProperty;
- /** Optimize mode */
- @Value("${app.optimize}")
- protected boolean appOptimizeProperty;
+ /** Optimize mode */
+ @Value("${app.optimize}")
+ protected boolean appOptimizeProperty;
- /** Wicket configuration string ("development" or "deployment") */
- @Value("${wicket.configuration}")
- protected String wicketConfiguration;
+ /** Wicket configuration string ("development" or "deployment") */
+ @Value("${wicket.configuration}")
+ protected String wicketConfiguration;
- static {
- Map<Locale, Map<String, String>> countries = new HashMap<Locale, Map<String, String>>(
- DataContext.LOCALES.size());
- Map<Locale, List<String>> countryCodes = new HashMap<Locale, List<String>>(DataContext.LOCALES.size());
- for (Locale locale : DataContext.LOCALES) {
- // Build (country code + country name) list
- List<Pair<String, Pair<String, String>>> sortedCountryList = new ArrayList<Pair<String, Pair<String, String>>>(
- DataContext.COUNTRY_CODES.size());
- for (String countryCode : DataContext.COUNTRY_CODES) {
- String countryName = new Locale(locale.getLanguage(), countryCode).getDisplayCountry(locale);
- sortedCountryList.add(new Pair<String, Pair<String, String>>(countryCode, new Pair<String, String>(
- StringTools.replaceAccents(countryName), countryName)));
- }
- // Sort by name (country code + country name) list
- Collections.sort(sortedCountryList, new Comparator<Pair<String, Pair<String, String>>>() {
- @Override
- public int compare(Pair<String, Pair<String, String>> pair1, Pair<String, Pair<String, String>> pair2) {
- return String.CASE_INSENSITIVE_ORDER.compare(pair1.getValue().getKey(), pair2.getValue().getKey());
- }
- });
- // Build (locale -> (country code + country name)) map (sorted by
- // name)
- // Build (locale -> (country code)) map (sorted by name)
- Map<String, String> sortedCountryMap = new LinkedHashMap<String, String>(sortedCountryList.size());
- List<String> sortedCountryCodesList = new ArrayList<String>(sortedCountryList.size());
- for (Pair<String, Pair<String, String>> countryPair : sortedCountryList) {
- sortedCountryMap.put(countryPair.getKey(), countryPair.getValue().getValue());
- sortedCountryCodesList.add(countryPair.getKey());
- }
- countries.put(locale, Collections.unmodifiableMap(sortedCountryMap));
- countryCodes.put(locale, Collections.unmodifiableList(sortedCountryCodesList));
- }
- COUNTRIES = Collections.unmodifiableMap(countries);
- COUNTRY_CODES = Collections.unmodifiableMap(countryCodes);
- }
+ static {
+ Map<Locale, Map<String, String>> countries = new HashMap<Locale, Map<String, String>>(
+ DataContext.LOCALES.size());
+ Map<Locale, List<String>> countryCodes = new HashMap<Locale, List<String>>(DataContext.LOCALES.size());
+ for (Locale locale : DataContext.LOCALES) {
+ // Build (country code + country name) list
+ List<Pair<String, Pair<String, String>>> sortedCountryList = new ArrayList<Pair<String, Pair<String, String>>>(
+ DataContext.COUNTRY_CODES.size());
+ for (String countryCode : DataContext.COUNTRY_CODES) {
+ String countryName = new Locale(locale.getLanguage(), countryCode).getDisplayCountry(locale);
+ sortedCountryList.add(new Pair<String, Pair<String, String>>(countryCode, new Pair<String, String>(
+ StringTools.replaceAccents(countryName), countryName)));
+ }
+ // Sort by name (country code + country name) list
+ Collections.sort(sortedCountryList, new Comparator<Pair<String, Pair<String, String>>>() {
+ @Override
+ public int compare(Pair<String, Pair<String, String>> pair1, Pair<String, Pair<String, String>> pair2) {
+ return String.CASE_INSENSITIVE_ORDER.compare(pair1.getValue().getKey(), pair2.getValue().getKey());
+ }
+ });
+ // Build (locale -> (country code + country name)) map (sorted by
+ // name)
+ // Build (locale -> (country code)) map (sorted by name)
+ Map<String, String> sortedCountryMap = new LinkedHashMap<String, String>(sortedCountryList.size());
+ List<String> sortedCountryCodesList = new ArrayList<String>(sortedCountryList.size());
+ for (Pair<String, Pair<String, String>> countryPair : sortedCountryList) {
+ sortedCountryMap.put(countryPair.getKey(), countryPair.getValue().getValue());
+ sortedCountryCodesList.add(countryPair.getKey());
+ }
+ countries.put(locale, Collections.unmodifiableMap(sortedCountryMap));
+ countryCodes.put(locale, Collections.unmodifiableList(sortedCountryCodesList));
+ }
+ COUNTRIES = Collections.unmodifiableMap(countries);
+ COUNTRY_CODES = Collections.unmodifiableMap(countryCodes);
+ }
- /**
- * @return Internationalization messages for web layer
- */
- @Bean
- public MessageSourceAccessor webMessageSource() {
- // The ResourceBundleMessageSource does not handle UTF-8, so we use the
- // Reloadable one
- ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
- source.setBasename("web");
- source.setDefaultEncoding(DataContext.ENCODING);
- source.setCacheSeconds(-1);
- return new MessageSourceAccessor(source);
- }
+ /**
+ * @return Internationalization messages for web layer
+ */
+ @Bean
+ public MessageSourceAccessor webMessageSource() {
+ // The ResourceBundleMessageSource does not handle UTF-8, so we use the
+ // Reloadable one
+ ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
+ source.setBasename("web");
+ source.setDefaultEncoding(DataContext.ENCODING);
+ source.setCacheSeconds(-1);
+ return new MessageSourceAccessor(source);
+ }
- /**
- * @return A Validator for models of the data & web layers
- */
- @Bean
- public ModelValidator webModelValidator() {
- return new ModelValidatorImpl(validatorFactory, webMessageSource(), dataMessageSource);
- }
+ /**
+ * @return A Validator for models of the data & web layers
+ */
+ @Bean
+ public ModelValidator webModelValidator() {
+ return new ModelValidatorImpl(validatorFactory, webMessageSource(), dataMessageSource);
+ }
- /**
- * @return Wicket application
- */
- @Bean
- public WebApplication webApplication() {
- RuntimeConfigurationType runtimeWicketConf = RuntimeConfigurationType
- .valueOf(wicketConfiguration.toUpperCase());
- return new WebApplicationImpl(appDebugProperty, appOptimizeProperty, runtimeWicketConf, new WebMessages(
- dataMessageSource), new WebMessages(webMessageSource()));
- }
+ /**
+ * @return Wicket application
+ */
+ @Bean
+ public WebApplication webApplication() {
+ RuntimeConfigurationType runtimeWicketConf = RuntimeConfigurationType
+ .valueOf(wicketConfiguration.toUpperCase());
+ return new WebApplicationImpl(appDebugProperty, appOptimizeProperty, runtimeWicketConf, new WebMessages(
+ dataMessageSource), new WebMessages(webMessageSource()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/ContactPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/ContactPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/ContactPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,94 +52,94 @@
*/
public class ContactPage extends TemplatePage {
- /** Action : send */
- private static final String ACTION_SEND = "Send";
+ /** Action : send */
+ private static final String ACTION_SEND = "Send";
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator") private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator") private ModelValidator validator;
- /**
- * Constructeur
- */
- public ContactPage() {
- super(ContactPage.class);
+ /**
+ * Constructeur
+ */
+ public ContactPage() {
+ super(ContactPage.class);
- // AuthMode = the user is authenticated, we already know his e-mail, the form is not protected with a captcha
- final boolean authMode = getSession().getRole() != AuthRole.VISITOR;
+ // AuthMode = the user is authenticated, we already know his e-mail, the form is not protected with a captcha
+ final boolean authMode = getSession().getRole() != AuthRole.VISITOR;
- // Models initialization
- final IModel<ContactModel> contactModel = new Model<ContactModel>(new ContactModel());
- final IModel<CaptchaModel> captchaModel = new Model<CaptchaModel>(new CaptchaModel());
- if (!authMode) {
- captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
- }
+ // Models initialization
+ final IModel<ContactModel> contactModel = new Model<ContactModel>(new ContactModel());
+ final IModel<CaptchaModel> captchaModel = new Model<CaptchaModel>(new CaptchaModel());
+ if (!authMode) {
+ captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
+ }
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
- // ContactModel fields
- formView.add(new TextField<String>("ContactModel.mail", authMode ? new Model<String>(getSession()
- .getUtilisateur().getCourriel()) : new PropertyModel<String>(contactModel, "mail"))
- .setEnabled(!authMode));
- formView.add(new TextField<String>("ContactModel.subject", new PropertyModel<String>(contactModel, "subject")));
- formView.add(new TextArea<String>("ContactModel.message", new PropertyModel<String>(contactModel, "message")));
+ // ContactModel fields
+ formView.add(new TextField<String>("ContactModel.mail", authMode ? new Model<String>(getSession()
+ .getUtilisateur().getCourriel()) : new PropertyModel<String>(contactModel, "mail"))
+ .setEnabled(!authMode));
+ formView.add(new TextField<String>("ContactModel.subject", new PropertyModel<String>(contactModel, "subject")));
+ formView.add(new TextArea<String>("ContactModel.message", new PropertyModel<String>(contactModel, "message")));
- // CaptchaModel fields
- MarkupContainer captcha = new WebMarkupContainer("captcha");
- captcha.setVisibilityAllowed(!authMode);
- captcha.add(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel.getObject()
- .getCaptchaTextGenerated())));
- final Component captchaTextView = new TextField<String>("CaptchaModel.captchaText", new PropertyModel<String>(
- captchaModel, "captchaText"));
- captcha.add(captchaTextView);
- formView.add(captcha);
+ // CaptchaModel fields
+ MarkupContainer captcha = new WebMarkupContainer("captcha");
+ captcha.setVisibilityAllowed(!authMode);
+ captcha.add(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel.getObject()
+ .getCaptchaTextGenerated())));
+ final Component captchaTextView = new TextField<String>("CaptchaModel.captchaText", new PropertyModel<String>(
+ captchaModel, "captchaText"));
+ captcha.add(captchaTextView);
+ formView.add(captcha);
- // Action button
- formView.add(new SubmittableButton(ACTION_SEND, new SubmittableButtonEvents() {
+ // Action button
+ formView.add(new SubmittableButton(ACTION_SEND, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws EmailException {
- personneService.sendMailAdmins(contactModel.getObject().getSubject(), contactModel.getObject()
- .getMessage(), contactModel.getObject().getMail());
- }
+ @Override
+ public void onProcess() throws EmailException {
+ personneService.sendMailAdmins(contactModel.getObject().getSubject(), contactModel.getObject()
+ .getMessage(), contactModel.getObject().getMail());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_SEND);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_SEND);
- setResponsePage(getApplication().getHomePage());
- }
+ setResponsePage(getApplication().getHomePage());
+ }
- @Override
- public void onValidate() {
- // Enforce the sender e-mail in authMode
- if (authMode) {
- contactModel.getObject().setMail(getSession().getUtilisateur().getCourriel());
- }
+ @Override
+ public void onValidate() {
+ // Enforce the sender e-mail in authMode
+ if (authMode) {
+ contactModel.getObject().setMail(getSession().getUtilisateur().getCourriel());
+ }
- // Validate ContactModel
- addValidationErrors(validator.validate(contactModel.getObject(), getSession().getLocale()));
+ // Validate ContactModel
+ addValidationErrors(validator.validate(contactModel.getObject(), getSession().getLocale()));
- // Validate CaptchaModel
- if (!authMode && !captchaModel.getObject().validate()) {
- errorCurrentPage(captchaTextView);
- }
- }
+ // Validate CaptchaModel
+ if (!authMode && !captchaModel.getObject().validate()) {
+ errorCurrentPage(captchaTextView);
+ }
+ }
- /**
- * Reset the captcha, on each page reload
- */
- /**
- * private void resetCaptcha() { if (!authMode) { captchaModel.getObject().setCaptchaText(null);
- * captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random()); formView.replace(new
- * NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(
- * captchaModel.getObject().getCaptchaTextGenerated()))); } }
- **/
- }));
+ /**
+ * Reset the captcha, on each page reload
+ */
+ /**
+ * private void resetCaptcha() { if (!authMode) { captchaModel.getObject().setCaptchaText(null);
+ * captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random()); formView.replace(new
+ * NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(
+ * captchaModel.getObject().getCaptchaTextGenerated()))); } }
+ **/
+ }));
- add(formView);
- }
+ add(formView);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/HomePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/HomePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/HomePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -81,282 +81,282 @@
*/
public final class HomePage extends TemplatePage {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Action : login */
- private static final String ACTION_LOGIN = "Login";
+ /** Action : login */
+ private static final String ACTION_LOGIN = "Login";
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /** Service : specimen */
- @SpringBean
- private SpecimenService specimenService;
+ /** Service : specimen */
+ @SpringBean
+ private SpecimenService specimenService;
- /** Service : lots */
- @SpringBean
- private LotService lotService;
+ /** Service : lots */
+ @SpringBean
+ private LotService lotService;
- /** Service : extraction */
- @SpringBean
- private ExtractionService extractionService;
+ /** Service : extraction */
+ @SpringBean
+ private ExtractionService extractionService;
- /** Service : purification */
- @SpringBean
- private PurificationService purificationService;
+ /** Service : purification */
+ @SpringBean
+ private PurificationService purificationService;
- /** Service : test biologique */
- @SpringBean
- private TestBioService testBioService;
+ /** Service : test biologique */
+ @SpringBean
+ private TestBioService testBioService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructeur
- */
- public HomePage() {
- super(HomePage.class);
- addVisitorContent();
- addUserContent();
- addAdminContent();
- }
+ /**
+ * Constructeur
+ */
+ public HomePage() {
+ super(HomePage.class);
+ addVisitorContent();
+ addUserContent();
+ addAdminContent();
+ }
- /**
- * Ajour du contenu administrateur
- */
- private void addAdminContent() {
- final AuthContainer adminContent = new AuthContainer("Content.ADMIN", AuthRole.ADMIN);
- if (adminContent.isAuthorized()) {
+ /**
+ * Ajour du contenu administrateur
+ */
+ private void addAdminContent() {
+ final AuthContainer adminContent = new AuthContainer("Content.ADMIN", AuthRole.ADMIN);
+ if (adminContent.isAuthorized()) {
- // Affiche les utilisateurs à valider sur la page d'accueil ADMIN
- final MarkupContainer invalidUtilisateursView = new WebMarkupContainer("InvalidUtilisateurs.List");
- invalidUtilisateursView.setOutputMarkupId(true);
+ // Affiche les utilisateurs à valider sur la page d'accueil ADMIN
+ final MarkupContainer invalidUtilisateursView = new WebMarkupContainer("InvalidUtilisateurs.List");
+ invalidUtilisateursView.setOutputMarkupId(true);
- final List<Utilisateur> utilisateursInvalid = personneService.listUtilisateursInvalid();
- invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
- if (invalidUtilisateursView.isVisibilityAllowed()) {
- invalidUtilisateursView.add(new DataView<Utilisateur>("InvalidUtilisateurs.List.Utilisateur",
- new LoadableDetachableSortableListDataProvider<Utilisateur>(utilisateursInvalid, getSession()
- .getLocale())) {
- @Override
- protected void populateItem(Item<Utilisateur> item) {
- Utilisateur utilisateur = item.getModelObject();
- item.add(new Label("InvalidUtilisateurs.List.Utilisateur.Label", utilisateur.toString()));
+ final List<Utilisateur> utilisateursInvalid = personneService.listUtilisateursInvalid();
+ invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
+ if (invalidUtilisateursView.isVisibilityAllowed()) {
+ invalidUtilisateursView.add(new DataView<Utilisateur>("InvalidUtilisateurs.List.Utilisateur",
+ new LoadableDetachableSortableListDataProvider<Utilisateur>(utilisateursInvalid, getSession()
+ .getLocale())) {
+ @Override
+ protected void populateItem(Item<Utilisateur> item) {
+ Utilisateur utilisateur = item.getModelObject();
+ item.add(new Label("InvalidUtilisateurs.List.Utilisateur.Label", utilisateur.toString()));
- // Action : valider l'utilisateur
- item.add(new AjaxFallbackLink<Utilisateur>("InvalidUtilisateurs.List.Utilisateur.Valid",
- new Model<Utilisateur>(utilisateur)) {
- @Override
- public void onClick(AjaxRequestTarget target) {
- try {
- // Validation
- personneService.validAndUpdateUtilisateur(getModelObject());
- successCurrentPage(ManageUtilisateurPage.class, "Update");
+ // Action : valider l'utilisateur
+ item.add(new AjaxFallbackLink<Utilisateur>("InvalidUtilisateurs.List.Utilisateur.Valid",
+ new Model<Utilisateur>(utilisateur)) {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ try {
+ // Validation
+ personneService.validAndUpdateUtilisateur(getModelObject());
+ successCurrentPage(ManageUtilisateurPage.class, "Update");
- // Mise à jour de la liste
- CollectionTools.setter(utilisateursInvalid,
- personneService.listUtilisateursInvalid());
- invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
- if (target != null) {
- target.add(invalidUtilisateursView);
- }
- } catch (DataConstraintException e) {
- errorCurrentPage(ManageUtilisateurPage.class, "Update", e);
- }
- refreshFeedbackPage(target);
- }
- });
+ // Mise à jour de la liste
+ CollectionTools.setter(utilisateursInvalid,
+ personneService.listUtilisateursInvalid());
+ invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
+ if (target != null) {
+ target.add(invalidUtilisateursView);
+ }
+ } catch (DataConstraintException e) {
+ errorCurrentPage(ManageUtilisateurPage.class, "Update", e);
+ }
+ refreshFeedbackPage(target);
+ }
+ });
- // Action : mettre à jour l'utilisateur (redirection vers le formulaire)
- item.add(new Link<Utilisateur>("InvalidUtilisateurs.List.Utilisateur.Update",
- new Model<Utilisateur>(utilisateur)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageUtilisateurPage(getModelObject().getIdPersonne(),
- new CallerPage(HomePage.class)));
- }
- });
+ // Action : mettre à jour l'utilisateur (redirection vers le formulaire)
+ item.add(new Link<Utilisateur>("InvalidUtilisateurs.List.Utilisateur.Update",
+ new Model<Utilisateur>(utilisateur)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageUtilisateurPage(getModelObject().getIdPersonne(),
+ new CallerPage(HomePage.class)));
+ }
+ });
- // Action : supprimer l'utilisateur
- Link<Utilisateur> deleteLink = new AjaxFallbackLink<Utilisateur>(
- "InvalidUtilisateurs.List.Utilisateur.Reject", new Model<Utilisateur>(utilisateur)) {
- @Override
- public void onClick(AjaxRequestTarget target) {
- // Suppression
- personneService.rejectUtilisateur(getModelObject());
- successCurrentPage(ManageUtilisateurPage.class, "Reject");
+ // Action : supprimer l'utilisateur
+ Link<Utilisateur> deleteLink = new AjaxFallbackLink<Utilisateur>(
+ "InvalidUtilisateurs.List.Utilisateur.Reject", new Model<Utilisateur>(utilisateur)) {
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ // Suppression
+ personneService.rejectUtilisateur(getModelObject());
+ successCurrentPage(ManageUtilisateurPage.class, "Reject");
- // Mise à jour de la liste
- CollectionTools.setter(utilisateursInvalid, personneService.listUtilisateursInvalid());
- invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
- if (target != null) {
- target.add(invalidUtilisateursView);
- }
- refreshFeedbackPage(target);
- }
- };
- deleteLink.add(new JSConfirmationBehavior(getString("Confirm")));
- item.add(deleteLink);
- }
- });
+ // Mise à jour de la liste
+ CollectionTools.setter(utilisateursInvalid, personneService.listUtilisateursInvalid());
+ invalidUtilisateursView.setVisibilityAllowed(!utilisateursInvalid.isEmpty());
+ if (target != null) {
+ target.add(invalidUtilisateursView);
+ }
+ refreshFeedbackPage(target);
+ }
+ };
+ deleteLink.add(new JSConfirmationBehavior(getString("Confirm")));
+ item.add(deleteLink);
+ }
+ });
- }
+ }
- adminContent.add(invalidUtilisateursView);
+ adminContent.add(invalidUtilisateursView);
- }
- add(adminContent);
- }
+ }
+ add(adminContent);
+ }
- /**
- * Ajour du contenu utilisateur (s'affiche également pour l'admin)
- */
- private void addUserContent() {
- AuthContainer userContent = new AuthContainer("Content.USER", AuthRole.USER, AuthRole.ADMIN);
- if (userContent.isAuthorized()) {
- userContent.add(new Label(getResource() + ".Statistics.Personnes", String.valueOf(personneService
- .countPersonnes())));
- userContent.add(new Label(getResource() + ".Statistics.Campagnes", String.valueOf(campagneService
- .countCampagnes())));
- userContent.add(new Label(getResource() + ".Statistics.Stations", String.valueOf(stationService
- .countStations())));
- userContent.add(new Label(getResource() + ".Statistics.Specimens", String.valueOf(specimenService
- .countSpecimens())));
- userContent.add(new Label(getResource() + ".Statistics.Lots", String.valueOf(lotService.countLots())));
- userContent.add(new Label(getResource() + ".Statistics.Extractions", String.valueOf(extractionService
- .countExtractions())));
- userContent.add(new Label(getResource() + ".Statistics.Purifications", String.valueOf(purificationService
- .countPurifications())));
- userContent.add(new Label(getResource() + ".Statistics.TestsBio", String.valueOf(testBioService
- .countResultatsTestsBio())));
+ /**
+ * Ajour du contenu utilisateur (s'affiche également pour l'admin)
+ */
+ private void addUserContent() {
+ AuthContainer userContent = new AuthContainer("Content.USER", AuthRole.USER, AuthRole.ADMIN);
+ if (userContent.isAuthorized()) {
+ userContent.add(new Label(getResource() + ".Statistics.Personnes", String.valueOf(personneService
+ .countPersonnes())));
+ userContent.add(new Label(getResource() + ".Statistics.Campagnes", String.valueOf(campagneService
+ .countCampagnes())));
+ userContent.add(new Label(getResource() + ".Statistics.Stations", String.valueOf(stationService
+ .countStations())));
+ userContent.add(new Label(getResource() + ".Statistics.Specimens", String.valueOf(specimenService
+ .countSpecimens())));
+ userContent.add(new Label(getResource() + ".Statistics.Lots", String.valueOf(lotService.countLots())));
+ userContent.add(new Label(getResource() + ".Statistics.Extractions", String.valueOf(extractionService
+ .countExtractions())));
+ userContent.add(new Label(getResource() + ".Statistics.Purifications", String.valueOf(purificationService
+ .countPurifications())));
+ userContent.add(new Label(getResource() + ".Statistics.TestsBio", String.valueOf(testBioService
+ .countResultatsTestsBio())));
- // affichage du volet droits
- Link<Utilisateur> detailsRight = new Link<Utilisateur>("HomePage.Rights.User.Details",
- new Model<Utilisateur>(getSession().getUtilisateur())) {
- @Override
- public void onClick() {
- setResponsePage(new ReadUtilisateurPage(getModelObject().getIdPersonne(), new CallerPage(
- HomePage.this)));
- }
+ // affichage du volet droits
+ Link<Utilisateur> detailsRight = new Link<Utilisateur>("HomePage.Rights.User.Details",
+ new Model<Utilisateur>(getSession().getUtilisateur())) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadUtilisateurPage(getModelObject().getIdPersonne(), new CallerPage(
+ HomePage.this)));
+ }
- /** {@inheritDoc} */
- @Override
- protected CharSequence getURL() {
- return super.getURL() + "#rights";
- }
+ /** {@inheritDoc} */
+ @Override
+ protected CharSequence getURL() {
+ return super.getURL() + "#rights";
+ }
- };
- userContent.add(detailsRight);
+ };
+ userContent.add(detailsRight);
- if (getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- userContent.add(new Label("HomePage.Rights.User1", getString("HomePage.Rights.Admin")));
- // pas d'affichage du lien de détails
- detailsRight.setVisibilityAllowed(false);
- EmptyPanel rights2 = new EmptyPanel("HomePage.Rights.User2");
- rights2.setVisibilityAllowed(false);
- userContent.add(rights2);
- } else {
- // pour l'utilisateur simple, nb de campagnes et de lots accessibles affichés
- Integer nbCampagnesDroits = getSession().getUtilisateur().getCampagnesDroits().size();
- Integer nbLotsDroits = getSession().getUtilisateur().getLotsDroits().size();
- String msgRights = MessageFormat.format(getString("HomePage.Rights.User"), nbCampagnesDroits,
- nbLotsDroits);
- userContent.add(new Label("HomePage.Rights.User1", msgRights));
+ if (getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ userContent.add(new Label("HomePage.Rights.User1", getString("HomePage.Rights.Admin")));
+ // pas d'affichage du lien de détails
+ detailsRight.setVisibilityAllowed(false);
+ EmptyPanel rights2 = new EmptyPanel("HomePage.Rights.User2");
+ rights2.setVisibilityAllowed(false);
+ userContent.add(rights2);
+ } else {
+ // pour l'utilisateur simple, nb de campagnes et de lots accessibles affichés
+ Integer nbCampagnesDroits = getSession().getUtilisateur().getCampagnesDroits().size();
+ Integer nbLotsDroits = getSession().getUtilisateur().getLotsDroits().size();
+ String msgRights = MessageFormat.format(getString("HomePage.Rights.User"), nbCampagnesDroits,
+ nbLotsDroits);
+ userContent.add(new Label("HomePage.Rights.User1", msgRights));
- Integer nbCampagnesCrees = getSession().getUtilisateur().getCampagnesCreees().size();
- String msgRights2 = MessageFormat.format(getString("HomePage.Rights.User2"), nbCampagnesCrees);
- Label rights2 = new Label("HomePage.Rights.User2", msgRights2);
- rights2.setVisibilityAllowed(nbCampagnesCrees != 0);
- userContent.add(rights2);
- }
- }
- add(userContent);
- }
+ Integer nbCampagnesCrees = getSession().getUtilisateur().getCampagnesCreees().size();
+ String msgRights2 = MessageFormat.format(getString("HomePage.Rights.User2"), nbCampagnesCrees);
+ Label rights2 = new Label("HomePage.Rights.User2", msgRights2);
+ rights2.setVisibilityAllowed(nbCampagnesCrees != 0);
+ userContent.add(rights2);
+ }
+ }
+ add(userContent);
+ }
- /**
- * Ajout du contenu visiteur
- */
- private void addVisitorContent() {
- AuthContainer visitorContent = new AuthContainer("Content.VISITOR", AuthRole.VISITOR);
- if (visitorContent.isAuthorized()) {
+ /**
+ * Ajout du contenu visiteur
+ */
+ private void addVisitorContent() {
+ AuthContainer visitorContent = new AuthContainer("Content.VISITOR", AuthRole.VISITOR);
+ if (visitorContent.isAuthorized()) {
- // Initialisation des modèles pour la connexion
- final IModel<LoginModel> loginModel = new Model<LoginModel>(new LoginModel());
- final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
+ // Initialisation des modèles pour la connexion
+ final IModel<LoginModel> loginModel = new Model<LoginModel>(new LoginModel());
+ final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
- // Formulaire de connexion
- final Form<Void> formView = new Form<Void>("Form");
+ // Formulaire de connexion
+ final Form<Void> formView = new Form<Void>("Form");
- // Champs du formulaire
- formView.add(new TextField<String>("Personne.courriel", new PropertyModel<String>(utilisateurModel,
- "courriel")));
- formView.add(new PasswordTextField("LoginModel.password", new PropertyModel<String>(loginModel, "password"))
- .setRequired(false));
- formView.add(new CheckBox("LoginModel.rememberMe", new PropertyModel<Boolean>(loginModel, "rememberMe")));
+ // Champs du formulaire
+ formView.add(new TextField<String>("Personne.courriel", new PropertyModel<String>(utilisateurModel,
+ "courriel")));
+ formView.add(new PasswordTextField("LoginModel.password", new PropertyModel<String>(loginModel, "password"))
+ .setRequired(false));
+ formView.add(new CheckBox("LoginModel.rememberMe", new PropertyModel<Boolean>(loginModel, "rememberMe")));
- // Action : connexion
- formView.add(new SubmittableButton(ACTION_LOGIN, new SubmittableButtonEvents() {
+ // Action : connexion
+ formView.add(new SubmittableButton(ACTION_LOGIN, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataNotFoundException, DataConstraintException {
- if (getSession().authenticate(utilisateurModel.getObject().getCourriel(),
- personneService.hashPassword(loginModel.getObject().getPassword()))) {
- Utilisateur user = personneService.loadUtilisateur(utilisateurModel.getObject().getCourriel());
- getSession().connectUser(user, loginModel.getObject().getRememberMe());
- LOG.info("connexion de l'utilisateur : " + user.getPrenom() + " " + user.getNom());
- } else {
- // si échec dans l'authentification
- if (CollectionTools.containsWithValue(personneService.listUtilisateursInvalid(), "courriel",
- AccessType.GETTER, utilisateurModel.getObject().getCourriel())) {
- // si le courriel est celui d'un utilisateur non validé, message d'erreur approprié
- error(getString("HomePage.Login.NotYetValid"));
- } else {
- error(getString("HomePage.Login.KO"));
- }
- // Ràz du mot de passe
- loginModel.getObject().setPassword(null);
- }
- }
+ @Override
+ public void onProcess() throws DataNotFoundException, DataConstraintException {
+ if (getSession().authenticate(utilisateurModel.getObject().getCourriel(),
+ personneService.hashPassword(loginModel.getObject().getPassword()))) {
+ Utilisateur user = personneService.loadUtilisateur(utilisateurModel.getObject().getCourriel());
+ getSession().connectUser(user, loginModel.getObject().getRememberMe());
+ LOG.info("connexion de l'utilisateur : " + user.getPrenom() + " " + user.getNom());
+ } else {
+ // si échec dans l'authentification
+ if (CollectionTools.containsWithValue(personneService.listUtilisateursInvalid(), "courriel",
+ AccessType.GETTER, utilisateurModel.getObject().getCourriel())) {
+ // si le courriel est celui d'un utilisateur non validé, message d'erreur approprié
+ error(getString("HomePage.Login.NotYetValid"));
+ } else {
+ error(getString("HomePage.Login.KO"));
+ }
+ // Ràz du mot de passe
+ loginModel.getObject().setPassword(null);
+ }
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_LOGIN);
- setResponsePage(getApplication().getHomePage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_LOGIN);
+ setResponsePage(getApplication().getHomePage());
+ }
- @Override
- public void onValidate() {
- // Validate Utilisateur
- addValidationErrors(validator.validate(utilisateurModel.getObject(), getSession().getLocale(),
- "courriel"));
- // Validate LoginModel
- addValidationErrors(validator.validate(loginModel.getObject(), getSession().getLocale(),
- "password", "rememberMe"));
- }
- }));
+ @Override
+ public void onValidate() {
+ // Validate Utilisateur
+ addValidationErrors(validator.validate(utilisateurModel.getObject(), getSession().getLocale(),
+ "courriel"));
+ // Validate LoginModel
+ addValidationErrors(validator.validate(loginModel.getObject(), getSession().getLocale(),
+ "password", "rememberMe"));
+ }
+ }));
- // Lien pour regénérer le mot de passe
- formView.add(new BookmarkablePageLink<Void>(ResetPasswordPage.class.getSimpleName(),
- ResetPasswordPage.class));
+ // Lien pour regénérer le mot de passe
+ formView.add(new BookmarkablePageLink<Void>(ResetPasswordPage.class.getSimpleName(),
+ ResetPasswordPage.class));
- // Lien pour s'enregistrer
- visitorContent.add(new BookmarkablePageLink<Void>(RegisterPage.class.getSimpleName(), RegisterPage.class));
+ // Lien pour s'enregistrer
+ visitorContent.add(new BookmarkablePageLink<Void>(RegisterPage.class.getSimpleName(), RegisterPage.class));
- visitorContent.add(formView);
+ visitorContent.add(formView);
- }
- add(visitorContent);
- }
+ }
+ add(visitorContent);
+ }
}
\ No newline at end of file
Modified: 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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/SandboxPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,55 +42,55 @@
*/
public class SandboxPage extends WebPage {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @SpringBean
- private GenericDao dao;
+ /** 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(count);
+ /** session factory hibernate **/
+ // @SpringBean
+ // private SessionFactory sf;
+ /**
+ * Constructor
+ */
+ @SuppressWarnings("unchecked")
+ public SandboxPage() {
+ long count = dao.count(PersonneDao.CRITERIA_LIST_ADMINS);
+ LOG.debug(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);
- for (Utilisateur u : users) {
- LOG.debug(u);
- }
+ 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);
+ for (Utilisateur u : users) {
+ LOG.debug(u);
+ }
- List<Utilisateur> users2 = (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_ADMINS);
- LOG.debug(users2);
- for (Utilisateur u : users2) {
- LOG.debug(u);
- }
+ List<Utilisateur> users2 = (List<Utilisateur>) dao.list(PersonneDao.CRITERIA_LIST_ADMINS);
+ LOG.debug(users2);
+ for (Utilisateur u : users2) {
+ LOG.debug(u);
+ }
- // 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);
+ // 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);
- */
+ /*
+ * 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();
- */
+ /*
+ * Map cacheEntries = sf.getStatistics() .getSecondLevelCacheStatistics(regionName) .getEntries();
+ */
- // session.close();
- }
+ // session.close();
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/TemplatePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -74,387 +74,387 @@
*/
public abstract class TemplatePage extends WebPage implements IAjaxIndicatorAware, IHeaderContributor {
- /** Action: logout */
- private static final String ACTION_LOGOUT = "Logout";
+ /** Action: logout */
+ private static final String ACTION_LOGOUT = "Logout";
- /** Ajax indicator ID */
- private static final String ID_AJAX_INDICATOR = "AjaxIndicator";
+ /** Ajax indicator ID */
+ private static final String ID_AJAX_INDICATOR = "AjaxIndicator";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Pattern: enum value label (simpleClassName.valueString) */
- public static final String PATTERN_ENUM_VALUE_LABEL = "%s.%s";
+ /** Pattern: enum value label (simpleClassName.valueString) */
+ public static final String PATTERN_ENUM_VALUE_LABEL = "%s.%s";
- /** Pattern: exception error on action (resource.action.simpleClassName) */
- private static final String PATTERN_ERROR_ACTION_EXCEPTION = "%s.%s.%s";
+ /** Pattern: exception error on action (resource.action.simpleClassName) */
+ private static final String PATTERN_ERROR_ACTION_EXCEPTION = "%s.%s.%s";
- /** Pattern: message error (resource.KO) */
- private static final String PATTERN_ERROR_MESSAGE = "%s.KO";
+ /** Pattern: message error (resource.KO) */
+ private static final String PATTERN_ERROR_MESSAGE = "%s.KO";
- /** Pattern error property: "property message" */
- private static final String PATTERN_ERROR_MESSAGE_VALIDATOR = "%s - %s";
+ /** Pattern error property: "property message" */
+ private static final String PATTERN_ERROR_MESSAGE_VALIDATOR = "%s - %s";
- /** Pattern: page title head (- resource) */
- private static final String PATTERN_PANEL_PAGE_TITLE_HEAD = " - %s";
+ /** Pattern: page title head (- resource) */
+ private static final String PATTERN_PANEL_PAGE_TITLE_HEAD = " - %s";
- /** Pattern: message success (resource.action.OK) */
- private static final String PATTERN_SUCCESS_ACTION_MESSAGE = "%s.%s.OK";
+ /** Pattern: message success (resource.action.OK) */
+ private static final String PATTERN_SUCCESS_ACTION_MESSAGE = "%s.%s.OK";
- /** Year */
- private static final String YEAR = String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
+ /** Year */
+ private static final String YEAR = String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
- /** Feedback panel container */
- private final MarkupContainer feedbackPanelContainer;
+ /** Feedback panel container */
+ private final MarkupContainer feedbackPanelContainer;
- /** Resource key */
- private final String resource;
+ /** Resource key */
+ private final String resource;
- /**
- * Constructor
- * @param page Page (permet de construire la "resource" qui servira d'identifiant à la page)
- */
- protected TemplatePage(Class<? extends TemplatePage> page) {
- super(new PageParameters());
- AssertTools.assertNotNull(page);
- resource = page.getSimpleName();
- addPageTitles();
- add(new BookmarkablePageLink<Void>(HomePage.class.getSimpleName(), getApplication().getHomePage()));
- add(createUserSatellite());
- add(createUserSearch());
- add(createVisitorMenu());
- add(createUserMenu());
- createLanguageLinks();
- feedbackPanelContainer = new WebMarkupContainer("FeedbackPageContainer");
- feedbackPanelContainer.add(new FeedbackPanel("FeedbackPage"));
- feedbackPanelContainer.setOutputMarkupId(true);
- add(feedbackPanelContainer);
- add(new Label("Year", YEAR));
- add(new BookmarkablePageLink<Void>(ContactPage.class.getSimpleName(), ContactPage.class));
- setVersioned(true);
- }
+ /**
+ * Constructor
+ * @param page Page (permet de construire la "resource" qui servira d'identifiant à la page)
+ */
+ protected TemplatePage(Class<? extends TemplatePage> page) {
+ super(new PageParameters());
+ AssertTools.assertNotNull(page);
+ resource = page.getSimpleName();
+ addPageTitles();
+ add(new BookmarkablePageLink<Void>(HomePage.class.getSimpleName(), getApplication().getHomePage()));
+ add(createUserSatellite());
+ add(createUserSearch());
+ add(createVisitorMenu());
+ add(createUserMenu());
+ createLanguageLinks();
+ feedbackPanelContainer = new WebMarkupContainer("FeedbackPageContainer");
+ feedbackPanelContainer.add(new FeedbackPanel("FeedbackPage"));
+ feedbackPanelContainer.setOutputMarkupId(true);
+ add(feedbackPanelContainer);
+ add(new Label("Year", YEAR));
+ add(new BookmarkablePageLink<Void>(ContactPage.class.getSimpleName(), ContactPage.class));
+ setVersioned(true);
+ }
- /** {@inheritDoc} */
- public void renderHead(IHeaderResponse response) {
- // dynamic declaration of the menu Css due to the internationalization
- response.renderCSSReference(getString("TemplatePage.Css.Menu"));
+ /** {@inheritDoc} */
+ public void renderHead(IHeaderResponse response) {
+ // dynamic declaration of the menu Css due to the internationalization
+ response.renderCSSReference(getString("TemplatePage.Css.Menu"));
- // scroll up to the anchor if any feedback message
- if (!getSession().getFeedbackMessages().isEmpty()) {
- response.renderOnLoadJavaScript("location.hash='header'");
- // LOG.debug("session FeedbackMessages is not empty");
- // for (FeedbackMessage msg : getSession().getFeedbackMessages()) {
- // LOG.debug(msg.getLevelAsString() + " : " + msg.getMessage() + ", from : " + msg.getReporter());
- // }
- }
- }
+ // scroll up to the anchor if any feedback message
+ if (!getSession().getFeedbackMessages().isEmpty()) {
+ response.renderOnLoadJavaScript("location.hash='header'");
+ // LOG.debug("session FeedbackMessages is not empty");
+ // for (FeedbackMessage msg : getSession().getFeedbackMessages()) {
+ // LOG.debug(msg.getLevelAsString() + " : " + msg.getMessage() + ", from : " + msg.getReporter());
+ // }
+ }
+ }
- /**
- * Création des liens vers les sélections de langue
- */
- private void createLanguageLinks() {
- this.add(new Link<Void>("SelectFrenchLang") {
- // Cas où on clique sur le drapeau français
- @Override
- public void onClick() {
- this.getSession().setLocale(Locale.FRENCH);
- }
- });
- this.add(new Link<Void>("SelectEnglishLang") {
- // Cas où on clique sur le drapeau anglais
- @Override
- public void onClick() {
- this.getSession().setLocale(Locale.ENGLISH);
- }
- });
- }
+ /**
+ * Création des liens vers les sélections de langue
+ */
+ private void createLanguageLinks() {
+ this.add(new Link<Void>("SelectFrenchLang") {
+ // Cas où on clique sur le drapeau français
+ @Override
+ public void onClick() {
+ this.getSession().setLocale(Locale.FRENCH);
+ }
+ });
+ this.add(new Link<Void>("SelectEnglishLang") {
+ // Cas où on clique sur le drapeau anglais
+ @Override
+ public void onClick() {
+ this.getSession().setLocale(Locale.ENGLISH);
+ }
+ });
+ }
- /**
- * Création de la partie satellite spécifique à un utilisateur
- * @return Le conteneur
- */
- private AuthContainer createUserSatellite() {
- AuthContainer userSatellite = new AuthContainer("Satellite.USER", AuthRole.USER, AuthRole.ADMIN);
- if (userSatellite.isAuthorized()) {
- Link<Void> link = new BookmarkablePageLink<Void>(UpdateUtilisateurPage.class.getSimpleName(),
- UpdateUtilisateurPage.class);
+ /**
+ * Création de la partie satellite spécifique à un utilisateur
+ * @return Le conteneur
+ */
+ private AuthContainer createUserSatellite() {
+ AuthContainer userSatellite = new AuthContainer("Satellite.USER", AuthRole.USER, AuthRole.ADMIN);
+ if (userSatellite.isAuthorized()) {
+ Link<Void> link = new BookmarkablePageLink<Void>(UpdateUtilisateurPage.class.getSimpleName(),
+ UpdateUtilisateurPage.class);
- link.add(new Label("Utilisateur", new PropertyModel<String>(this, "session.utilisateur")));
- userSatellite.add(link);
- userSatellite.add(new Link<Void>(TemplatePage.class.getSimpleName() + "." + ACTION_LOGOUT) {
- @Override
- public void onClick() {
- ((AuthSession) getSession()).logout();
- successNextPage(TemplatePage.class, ACTION_LOGOUT);
- setResponsePage(getApplication().getHomePage());
- }
- });
- }
- return userSatellite;
- }
+ link.add(new Label("Utilisateur", new PropertyModel<String>(this, "session.utilisateur")));
+ userSatellite.add(link);
+ userSatellite.add(new Link<Void>(TemplatePage.class.getSimpleName() + "." + ACTION_LOGOUT) {
+ @Override
+ public void onClick() {
+ ((AuthSession) getSession()).logout();
+ successNextPage(TemplatePage.class, ACTION_LOGOUT);
+ setResponsePage(getApplication().getHomePage());
+ }
+ });
+ }
+ return userSatellite;
+ }
- /**
- * Création de la partie recherche spécifique à un utilisateur
- * @return Le conteneur
- */
- private AuthContainer createUserSearch() {
- AuthContainer userSatellite = new AuthContainer("Search.USER", AuthRole.USER, AuthRole.ADMIN);
+ /**
+ * Création de la partie recherche spécifique à un utilisateur
+ * @return Le conteneur
+ */
+ private AuthContainer createUserSearch() {
+ AuthContainer userSatellite = new AuthContainer("Search.USER", AuthRole.USER, AuthRole.ADMIN);
- Form<ValueMap> searchForm = new Form<ValueMap>("Search.FORM", new CompoundPropertyModel<ValueMap>(new ValueMap())) {
- protected void onSubmit() {
- ValueMap values = getModelObject();
-
- String query = values.getString("query");
- setResponsePage(new SearchPage(query));
- }
- };
- searchForm.add(new TextField<String>("query").setType(String.class));
+ Form<ValueMap> searchForm = new Form<ValueMap>("Search.FORM", new CompoundPropertyModel<ValueMap>(new ValueMap())) {
+ protected void onSubmit() {
+ ValueMap values = getModelObject();
+
+ String query = values.getString("query");
+ setResponsePage(new SearchPage(query));
+ }
+ };
+ searchForm.add(new TextField<String>("query").setType(String.class));
- userSatellite.add(searchForm);
- return userSatellite;
- }
+ userSatellite.add(searchForm);
+ return userSatellite;
+ }
- /**
- * Création du menu visiteur
- * @return Le conteneur
- */
- private AuthContainer createVisitorMenu() {
- AuthContainer visitorMenu = new AuthContainer("Menu.VISITOR", AuthRole.VISITOR);
- return visitorMenu;
- }
+ /**
+ * Création du menu visiteur
+ * @return Le conteneur
+ */
+ private AuthContainer createVisitorMenu() {
+ AuthContainer visitorMenu = new AuthContainer("Menu.VISITOR", AuthRole.VISITOR);
+ return visitorMenu;
+ }
- /**
- * Création du menu utilisateur
- * @return Le conteneur
- */
- private AuthContainer createUserMenu() {
- AuthContainer userMenu = new AuthContainer("Menu.USER", AuthRole.USER, AuthRole.ADMIN);
- if (userMenu.isAuthorized()) {
+ /**
+ * Création du menu utilisateur
+ * @return Le conteneur
+ */
+ private AuthContainer createUserMenu() {
+ AuthContainer userMenu = new AuthContainer("Menu.USER", AuthRole.USER, AuthRole.ADMIN);
+ if (userMenu.isAuthorized()) {
- userMenu.add(createAdminMenu());
+ userMenu.add(createAdminMenu());
- userMenu.add(new BookmarkablePageLink<Void>(ListPersonnesPage.class.getSimpleName(),
- ListPersonnesPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListCampagnesPage.class.getSimpleName(),
- ListCampagnesPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListStationsPage.class.getSimpleName(), ListStationsPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListLotsPage.class.getSimpleName(), ListLotsPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListSpecimensPage.class.getSimpleName(),
- ListSpecimensPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListExtractionsPage.class.getSimpleName(),
- ListExtractionsPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListPurificationsPage.class.getSimpleName(),
- ListPurificationsPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListMoleculesPage.class.getSimpleName(), ListMoleculesPage.class));
- userMenu.add(new BookmarkablePageLink<Void>(ListTestsBioPage.class.getSimpleName(), ListTestsBioPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListPersonnesPage.class.getSimpleName(),
+ ListPersonnesPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListCampagnesPage.class.getSimpleName(),
+ ListCampagnesPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListStationsPage.class.getSimpleName(), ListStationsPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListLotsPage.class.getSimpleName(), ListLotsPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListSpecimensPage.class.getSimpleName(),
+ ListSpecimensPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListExtractionsPage.class.getSimpleName(),
+ ListExtractionsPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListPurificationsPage.class.getSimpleName(),
+ ListPurificationsPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListMoleculesPage.class.getSimpleName(), ListMoleculesPage.class));
+ userMenu.add(new BookmarkablePageLink<Void>(ListTestsBioPage.class.getSimpleName(), ListTestsBioPage.class));
- // userMenu.add(new BookmarkablePageLink<Void>(SandboxPage.class.getSimpleName(), SandboxPage.class));
- }
- return userMenu;
- }
+ // userMenu.add(new BookmarkablePageLink<Void>(SandboxPage.class.getSimpleName(), SandboxPage.class));
+ }
+ return userMenu;
+ }
- /**
- * Création du menu administrateur
- * @return Le conteneur
- */
- private AuthContainer createAdminMenu() {
- AuthContainer adminMenu = new AuthContainer("Menu.ADMIN", AuthRole.ADMIN);
- if (adminMenu.isAuthorized()) {
- adminMenu.add(new BookmarkablePageLink<Void>(ListConfigurationPage.class.getSimpleName(),
- ListConfigurationPage.class));
- }
- return adminMenu;
- }
+ /**
+ * Création du menu administrateur
+ * @return Le conteneur
+ */
+ private AuthContainer createAdminMenu() {
+ AuthContainer adminMenu = new AuthContainer("Menu.ADMIN", AuthRole.ADMIN);
+ if (adminMenu.isAuthorized()) {
+ adminMenu.add(new BookmarkablePageLink<Void>(ListConfigurationPage.class.getSimpleName(),
+ ListConfigurationPage.class));
+ }
+ return adminMenu;
+ }
- /**
- * Add page titles (in head and body)
- */
- private void addPageTitles() {
- String page = getString(getResource());
+ /**
+ * Add page titles (in head and body)
+ */
+ private void addPageTitles() {
+ String page = getString(getResource());
- add(new Label("PageTitleHead", String.format(PATTERN_PANEL_PAGE_TITLE_HEAD, page)));
- add(new Label("PageTitleBody", page));
- }
+ add(new Label("PageTitleHead", String.format(PATTERN_PANEL_PAGE_TITLE_HEAD, page)));
+ add(new Label("PageTitleBody", page));
+ }
- /**
- * Convert validation errors (violations) into readable message, and display them
- * @param violations Violations
- */
- public final void addValidationErrors(Collection<String> violations) {
- for (String violation : violations) {
- error(violation);
- }
- }
+ /**
+ * Convert validation errors (violations) into readable message, and display them
+ * @param violations Violations
+ */
+ public final void addValidationErrors(Collection<String> violations) {
+ for (String violation : violations) {
+ error(violation);
+ }
+ }
- /**
- * Convert validation errors (violations) into readable message, and display them
- * @param violations Violations
- */
- public final void addValidationErrors(List<Pair<String, String>> violations) {
- for (Pair<String, String> violation : violations) {
- String label = violation.getKey();
- try {
- label = getString(label);
- } catch (MissingResourceException e) {
- //
- }
- error(String.format(PATTERN_ERROR_MESSAGE_VALIDATOR, label, violation.getValue()));
- }
- }
+ /**
+ * Convert validation errors (violations) into readable message, and display them
+ * @param violations Violations
+ */
+ public final void addValidationErrors(List<Pair<String, String>> violations) {
+ for (Pair<String, String> violation : violations) {
+ String label = violation.getKey();
+ try {
+ label = getString(label);
+ } catch (MissingResourceException e) {
+ //
+ }
+ error(String.format(PATTERN_ERROR_MESSAGE_VALIDATOR, label, violation.getValue()));
+ }
+ }
- /**
- * Display an error message (pageClass.action.Exception) on the current page
- * @param pageClass Page class
- * @param action Action
- * @param exception Exception
- */
- public final void errorCurrentPage(Class<? extends TemplatePage> pageClass, String action, Exception exception) {
- AssertTools.assertNotNull(pageClass);
- AssertTools.assertNotEmpty(action);
- AssertTools.assertNotNull(exception);
- String errorMessage = getString(String.format(PATTERN_ERROR_ACTION_EXCEPTION, pageClass.getSimpleName(),
- action, exception.getClass().getSimpleName()));
- LOG.warn(errorMessage);
- error(errorMessage);
- }
+ /**
+ * Display an error message (pageClass.action.Exception) on the current page
+ * @param pageClass Page class
+ * @param action Action
+ * @param exception Exception
+ */
+ public final void errorCurrentPage(Class<? extends TemplatePage> pageClass, String action, Exception exception) {
+ AssertTools.assertNotNull(pageClass);
+ AssertTools.assertNotEmpty(action);
+ AssertTools.assertNotNull(exception);
+ String errorMessage = getString(String.format(PATTERN_ERROR_ACTION_EXCEPTION, pageClass.getSimpleName(),
+ action, exception.getClass().getSimpleName()));
+ LOG.warn(errorMessage);
+ error(errorMessage);
+ }
- /**
- * Display an error message (componentId.KO) on the current page
- * @param component Component
- */
- public final void errorCurrentPage(Component component) {
- AssertTools.assertNotNull(component);
- String errorMessage = String.format(PATTERN_ERROR_MESSAGE, component.getId());
- try {
- errorMessage = getString(errorMessage);
- } catch (MissingResourceException e) {
- //
- }
- LOG.warn(errorMessage);
- error(errorMessage);
- }
+ /**
+ * Display an error message (componentId.KO) on the current page
+ * @param component Component
+ */
+ public final void errorCurrentPage(Component component) {
+ AssertTools.assertNotNull(component);
+ String errorMessage = String.format(PATTERN_ERROR_MESSAGE, component.getId());
+ try {
+ errorMessage = getString(errorMessage);
+ } catch (MissingResourceException e) {
+ //
+ }
+ LOG.warn(errorMessage);
+ error(errorMessage);
+ }
- /**
- * Display an error message (resource.action.Exception) on the current page
- * @param action Action
- * @param exception Exception
- */
- public final void errorCurrentPage(String action, Exception exception) {
- AssertTools.assertNotEmpty(action);
- AssertTools.assertNotNull(exception);
- String errorMessage = getString(String.format(PATTERN_ERROR_ACTION_EXCEPTION, getResource(), action, exception
- .getClass().getSimpleName()));
- LOG.warn(errorMessage);
- error(errorMessage);
- }
+ /**
+ * Display an error message (resource.action.Exception) on the current page
+ * @param action Action
+ * @param exception Exception
+ */
+ public final void errorCurrentPage(String action, Exception exception) {
+ AssertTools.assertNotEmpty(action);
+ AssertTools.assertNotNull(exception);
+ String errorMessage = getString(String.format(PATTERN_ERROR_ACTION_EXCEPTION, getResource(), action, exception
+ .getClass().getSimpleName()));
+ LOG.warn(errorMessage);
+ error(errorMessage);
+ }
- /** {@inheritDoc} */
- @Override
- public final String getAjaxIndicatorMarkupId() {
- return ID_AJAX_INDICATOR;
- }
+ /** {@inheritDoc} */
+ @Override
+ public final String getAjaxIndicatorMarkupId() {
+ return ID_AJAX_INDICATOR;
+ }
- /**
- * resource getter
- * @return resource
- */
- protected final String getResource() {
- return resource;
- }
+ /**
+ * resource getter
+ * @return resource
+ */
+ protected final String getResource() {
+ return resource;
+ }
- /** {@inheritDoc} */
- @Override
- public final AuthSession getSession() {
- return (AuthSession) super.getSession();
- }
+ /** {@inheritDoc} */
+ @Override
+ public final AuthSession getSession() {
+ return (AuthSession) super.getSession();
+ }
- /**
- * Refresh feedback page and scroll up to the anchor if any feedback message
- * @param target Ajax target
- */
- protected final void refreshFeedbackPage(AjaxRequestTarget target) {
- if (target != null) {
- target.add(feedbackPanelContainer);
- // scroll up to the anchor if any feedback message
- if (!getSession().getFeedbackMessages().isEmpty()) {
- LOG.debug("REFRESH FEEDBACK BY AJAX");
- target.appendJavaScript("window.location.hash = '#header';");
- // unless go back to button after scrolling up to the anchor
- target.focusComponent(feedbackPanelContainer);
- }
- }
- }
+ /**
+ * Refresh feedback page and scroll up to the anchor if any feedback message
+ * @param target Ajax target
+ */
+ protected final void refreshFeedbackPage(AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(feedbackPanelContainer);
+ // scroll up to the anchor if any feedback message
+ if (!getSession().getFeedbackMessages().isEmpty()) {
+ LOG.debug("REFRESH FEEDBACK BY AJAX");
+ target.appendJavaScript("window.location.hash = '#header';");
+ // unless go back to button after scrolling up to the anchor
+ target.focusComponent(feedbackPanelContainer);
+ }
+ }
+ }
- /**
- * Display a success message on the current page (pageClass.action.OK)
- * @param pageClass Page class
- * @param action Action
- */
- public final void successCurrentPage(Class<? extends TemplatePage> pageClass, String action) {
- info(successMessage(pageClass, action));
- }
+ /**
+ * Display a success message on the current page (pageClass.action.OK)
+ * @param pageClass Page class
+ * @param action Action
+ */
+ public final void successCurrentPage(Class<? extends TemplatePage> pageClass, String action) {
+ info(successMessage(pageClass, action));
+ }
- /**
- * Display a success message on the current page (resource.action.OK)
- * @param action Action
- */
- public final void successCurrentPage(String action) {
- info(successMessage(action));
- }
+ /**
+ * Display a success message on the current page (resource.action.OK)
+ * @param action Action
+ */
+ public final void successCurrentPage(String action) {
+ info(successMessage(action));
+ }
- /**
- * Retrieve a success message (page.action.OK)
- * @param pageClass Page class
- * @param action Action
- * @return Success message
- */
- private String successMessage(Class<? extends TemplatePage> pageClass, String action) {
- AssertTools.assertNotNull(pageClass);
- AssertTools.assertNotEmpty(action);
- return getString(String.format(PATTERN_SUCCESS_ACTION_MESSAGE, pageClass.getSimpleName(), action));
- }
+ /**
+ * Retrieve a success message (page.action.OK)
+ * @param pageClass Page class
+ * @param action Action
+ * @return Success message
+ */
+ private String successMessage(Class<? extends TemplatePage> pageClass, String action) {
+ AssertTools.assertNotNull(pageClass);
+ AssertTools.assertNotEmpty(action);
+ return getString(String.format(PATTERN_SUCCESS_ACTION_MESSAGE, pageClass.getSimpleName(), action));
+ }
- /**
- * Retrieve a success message (resource.action.OK)
- * @param action Action
- * @return Success message
- */
- private String successMessage(String action) {
- AssertTools.assertNotEmpty(action);
- return getString(String.format(PATTERN_SUCCESS_ACTION_MESSAGE, getResource(), action));
- }
+ /**
+ * Retrieve a success message (resource.action.OK)
+ * @param action Action
+ * @return Success message
+ */
+ private String successMessage(String action) {
+ AssertTools.assertNotEmpty(action);
+ return getString(String.format(PATTERN_SUCCESS_ACTION_MESSAGE, getResource(), action));
+ }
- /**
- * Display a success message on the next page (pageClass.action.OK)
- * @param pageClass Page class
- * @param action Action
- */
- public final void successNextPage(Class<? extends TemplatePage> pageClass, String action) {
- getSession().info(successMessage(pageClass, action));
- }
+ /**
+ * Display a success message on the next page (pageClass.action.OK)
+ * @param pageClass Page class
+ * @param action Action
+ */
+ public final void successNextPage(Class<? extends TemplatePage> pageClass, String action) {
+ getSession().info(successMessage(pageClass, action));
+ }
- /**
- * Display a success message on the next page (resource.action.OK)
- * @param action Action
- */
- public final void successNextPage(String action) {
- getSession().info(successMessage(action));
- }
+ /**
+ * Display a success message on the next page (resource.action.OK)
+ * @param action Action
+ */
+ public final void successNextPage(String action) {
+ getSession().info(successMessage(action));
+ }
- /**
- * Retrieve an enum value message (class.value). Null-safe methode
- * @param <E> Enum type
- * @param enumValue Enum value, null is the enumValue is null
- * @return Enum value message
- */
- public final <E extends Enum<?>> String enumValueMessage(E enumValue) {
- if (enumValue == null) {
- return null;
- }
- String enumValueMessage = String.format(PATTERN_ENUM_VALUE_LABEL, enumValue.getClass().getSimpleName(),
- enumValue.toString());
+ /**
+ * Retrieve an enum value message (class.value). Null-safe methode
+ * @param <E> Enum type
+ * @param enumValue Enum value, null is the enumValue is null
+ * @return Enum value message
+ */
+ public final <E extends Enum<?>> String enumValueMessage(E enumValue) {
+ if (enumValue == null) {
+ return null;
+ }
+ String enumValueMessage = String.format(PATTERN_ENUM_VALUE_LABEL, enumValue.getClass().getSimpleName(),
+ enumValue.toString());
- return getString(enumValueMessage);
- }
+ return getString(enumValueMessage);
+ }
}
\ No newline at end of file
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/LinkProduitPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,64 +42,64 @@
*/
public abstract class LinkProduitPropertyColumn<T> extends LinkPropertyColumn<T> {
- /** page used to get messages */
- private final TemplatePage page;
+ /** page used to get messages */
+ private final TemplatePage page;
- /**
- * Constructor
- * @param displayModel displayModel
- * @param sortProperty sortProperty
- * @param propertyExpression propertyExpression
- * @param page page used to get messages
- */
- public LinkProduitPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- TemplatePage page) {
- super(displayModel, sortProperty, propertyExpression);
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param displayModel displayModel
+ * @param sortProperty sortProperty
+ * @param propertyExpression propertyExpression
+ * @param page page used to get messages
+ */
+ public LinkProduitPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ TemplatePage page) {
+ super(displayModel, sortProperty, propertyExpression);
+ this.page = page;
+ }
- /** {@inheritDoc} */
- @Override
- public void onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
- if (model.getObject() != null) {
- Produit prod = (Produit) BeanTools.getValue(model.getObject(), AccessType.GETTER, "produit");
+ /** {@inheritDoc} */
+ @Override
+ public void onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
+ if (model.getObject() != null) {
+ Produit prod = (Produit) BeanTools.getValue(model.getObject(), AccessType.GETTER, "produit");
- if (prod.isExtrait()) {
- Extrait extrait = (Extrait) prod;
- onClickIfExtrait(extrait);
- } else {
- // le produit est une fraction
- Fraction fraction = (Fraction) prod;
- onClickIfFraction(fraction);
- }
- }
- }
+ if (prod.isExtrait()) {
+ Extrait extrait = (Extrait) prod;
+ onClickIfExtrait(extrait);
+ } else {
+ // le produit est une fraction
+ Fraction fraction = (Fraction) prod;
+ onClickIfFraction(fraction);
+ }
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
- if (model.getObject() != null) {
- // title différent suivant si le produit provient d'une extraction ou d'une purification
- Produit prod = (Produit) BeanTools.getValue(model.getObject(), AccessType.GETTER, "produit");
- if (prod.isExtrait()) {
- linkTitle = page.getString("ReadExtraction");
- } else {
- linkTitle = page.getString("ReadPurification");
- }
- }
- super.populateItem(item, componentId, model);
- }
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
+ if (model.getObject() != null) {
+ // title différent suivant si le produit provient d'une extraction ou d'une purification
+ Produit prod = (Produit) BeanTools.getValue(model.getObject(), AccessType.GETTER, "produit");
+ if (prod.isExtrait()) {
+ linkTitle = page.getString("ReadExtraction");
+ } else {
+ linkTitle = page.getString("ReadPurification");
+ }
+ }
+ super.populateItem(item, componentId, model);
+ }
- /**
- * Executed on click evenement when the produis is an extrait
- * @param extrait extrait
- */
- public abstract void onClickIfExtrait(Extrait extrait);
+ /**
+ * Executed on click evenement when the produis is an extrait
+ * @param extrait extrait
+ */
+ public abstract void onClickIfExtrait(Extrait extrait);
- /**
- * Executed on click evenement when the produis is a fraction
- * @param fraction fraction
- */
- public abstract void onClickIfFraction(Fraction fraction);
+ /**
+ * Executed on click evenement when the produis is a fraction
+ * @param fraction fraction
+ */
+ public abstract void onClickIfFraction(Fraction fraction);
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/columns/TaxonomyPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,34 +41,34 @@
*/
public class TaxonomyPropertyColumn<T> extends PropertyColumn<T> implements ExportableColumn<T> {
- /**
- * Constructor
- * @param displayModel Display model
- * @param sortProperty Sort property
- * @param propertyExpression Property expression
- */
- public TaxonomyPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
- super(displayModel, sortProperty, propertyExpression);
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param sortProperty Sort property
+ * @param propertyExpression Property expression
+ */
+ public TaxonomyPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
+ super(displayModel, sortProperty, propertyExpression);
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param propertyExpression Property expression
- */
- public TaxonomyPropertyColumn(IModel<String> displayModel, String propertyExpression) {
- super(displayModel, propertyExpression);
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param propertyExpression Property expression
+ */
+ public TaxonomyPropertyColumn(IModel<String> displayModel, String propertyExpression) {
+ super(displayModel, propertyExpression);
+ }
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
- Label label = new Label(componentId, createLabelModel(rowModel));
- label.add(new AttributeModifier("class", new Model<String>("taxonomy")));
- item.add(label);
- }
-
- @Override
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
+ Label label = new Label(componentId, createLabelModel(rowModel));
+ label.add(new AttributeModifier("class", new Model<String>("taxonomy")));
+ item.add(label);
+ }
+
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ListCampagnesPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -59,87 +59,87 @@
@AuthRoles( { AuthRole.ADMIN, AuthRole.USER })
public final class ListCampagnesPage extends TemplatePage {
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /**
- * Constructeur
- */
- public ListCampagnesPage() {
- super(ListCampagnesPage.class);
+ /**
+ * Constructeur
+ */
+ public ListCampagnesPage() {
+ super(ListCampagnesPage.class);
- final CallerPage currentPage = new CallerPage(ListCampagnesPage.class);
+ final CallerPage currentPage = new CallerPage(ListCampagnesPage.class);
- // Lien pour l'age d'une nouvelle campagne
- add(new Link<Void>(getResource() + ".NewCampagne") {
- @Override
- public void onClick() {
- setResponsePage(new ManageCampagnePage(currentPage, true));
- }
+ // Lien pour l'age d'une nouvelle campagne
+ add(new Link<Void>(getResource() + ".NewCampagne") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageCampagnePage(currentPage, true));
+ }
- });
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer campagnesRefresh = new WebMarkupContainer(getResource() + ".Campagnes.Refresh");
- campagnesRefresh.setOutputMarkupId(true);
- add(campagnesRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer campagnesRefresh = new WebMarkupContainer(getResource() + ".Campagnes.Refresh");
+ campagnesRefresh.setOutputMarkupId(true);
+ add(campagnesRefresh);
- // Liste des campagnes
- final List<Campagne> campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
+ // Liste des campagnes
+ final List<Campagne> campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Campagne> campagnesDataProvider = new LoadableDetachableSortableListDataProvider<Campagne>(
- campagnes, getSession().getLocale());
+ LoadableDetachableSortableListDataProvider<Campagne> campagnesDataProvider = new LoadableDetachableSortableListDataProvider<Campagne>(
+ campagnes, getSession().getLocale());
- List<IColumn<Campagne>> columns = new ArrayList<IColumn<Campagne>>();
+ List<IColumn<Campagne>> columns = new ArrayList<IColumn<Campagne>>();
- columns.add(new LinkableImagePropertyColumn<Campagne>("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 LinkableImagePropertyColumn<Campagne>("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",
- 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",
+ 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 ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateDeb")), "dateDeb",
- "dateDeb", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateDeb")), "dateDeb",
+ "dateDeb", getLocale()));
- columns.add(new ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateFin")), "dateFin",
- "dateFin", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Campagne>(new Model<String>(getString("Campagne.dateFin")), "dateFin",
+ "dateFin", getLocale()));
- columns.add(new MapValuePropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.codePays")),
- "codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<Campagne, String>(new Model<String>(getString("Campagne.codePays")),
+ "codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- columns.add(new LinkableImagePropertyColumn<Campagne>("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<Campagne>> item, String componentId, IModel<Campagne> model) {
- if (campagneService.updateOrdeleteCampagneEnabled(model.getObject(), getSession().getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ columns.add(new LinkableImagePropertyColumn<Campagne>("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<Campagne>> item, String componentId, IModel<Campagne> model) {
+ if (campagneService.updateOrdeleteCampagneEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Campagne>> item, String componentId, IModel<Campagne> model) {
- setResponsePage(new ManageCampagnePage(model.getObject().getIdCampagne(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Campagne>> item, String componentId, IModel<Campagne> model) {
+ setResponsePage(new ManageCampagnePage(model.getObject().getIdCampagne(), currentPage));
+ }
+ });
- final DataTable<Campagne> campagnesDataTable = new AjaxFallbackDefaultDataTable<Campagne>(
- "ListCampagnesPage.Campagnes", columns, campagnesDataProvider, WebContext.ROWS_PER_PAGE);
+ final DataTable<Campagne> campagnesDataTable = new AjaxFallbackDefaultDataTable<Campagne>(
+ "ListCampagnesPage.Campagnes", columns, campagnesDataProvider, WebContext.ROWS_PER_PAGE);
- campagnesRefresh.add(campagnesDataTable);
- }
+ campagnesRefresh.add(campagnesDataTable);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ManageCampagnePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ManageCampagnePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ManageCampagnePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -92,629 +92,629 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManageCampagnePage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Bouton d'ajout d'un participant */
- private Button addParticipant;
+ /** Bouton d'ajout d'un participant */
+ private Button addParticipant;
- /** Bouton d'ajout d'une station */
- private Button addStation;
+ /** Bouton d'ajout d'une station */
+ private Button addStation;
- /** Choix d'un participant */
- private AbstractSingleSelectChoice<Personne> availablePersonnes;
+ /** Choix d'un participant */
+ private AbstractSingleSelectChoice<Personne> availablePersonnes;
- /** Choix d'une station prospectée */
- private AbstractSingleSelectChoice<Station> availableStations;
+ /** Choix d'une station prospectée */
+ private AbstractSingleSelectChoice<Station> availableStations;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Modèle : campagne */
- private final IModel<Campagne> campagneModel;
+ /** Modèle : campagne */
+ private final IModel<Campagne> campagneModel;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /** Modèle : participant */
- private final IModel<CampagnePersonneParticipant> participantModel;
+ /** Modèle : participant */
+ private final IModel<CampagnePersonneParticipant> participantModel;
- /** Modèle : station */
- private final IModel<Station> stationModel;
+ /** Modèle : station */
+ private final IModel<Station> stationModel;
- /** Liste des personnes existantes */
- private final List<Personne> personnes;
+ /** Liste des personnes existantes */
+ private final List<Personne> personnes;
- /** Liste des stations existantes */
- private final List<Station> stations;
+ /** Liste des stations existantes */
+ private final List<Station> stations;
- /** Service : personnes */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personnes */
+ @SpringBean
+ private PersonneService personneService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** ComplementView */
- FormComponent<String> complementView;
+ /** ComplementView */
+ FormComponent<String> complementView;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageCampagnePage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageCampagnePage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idCampagne ID campagne
- * @param callerPage Page appelante
- */
- public ManageCampagnePage(Integer idCampagne, CallerPage callerPage) {
- this(idCampagne, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idCampagne ID campagne
+ * @param callerPage Page appelante
+ */
+ public ManageCampagnePage(Integer idCampagne, CallerPage callerPage) {
+ this(idCampagne, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la campagne suivante)
- * @param campagne campagne
- * @param callerPage Page appelante
- */
- public ManageCampagnePage(Campagne campagne, CallerPage callerPage) {
- this(null, campagne, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la campagne suivante)
+ * @param campagne campagne
+ * @param callerPage Page appelante
+ */
+ public ManageCampagnePage(Campagne campagne, CallerPage callerPage) {
+ this(null, campagne, callerPage, true);
+ }
- /**
- * Constructeur. Si idCampagne et campagne sont null, on créée une nouvelle campagne. Si idCampagne est renseigné,
- * on édite la campagne correspondante. Si campagne est renseignée, on créée une nouvelle campagne à partir des
- * informations qu'elle contient.
- * @param idCampagne ID campagne
- * @param campagne Lot
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManageCampagnePage(Integer idCampagne, Campagne campagne, final CallerPage callerPage, boolean multipleEntry) {
- super(ManageCampagnePage.class);
- assert idCampagne == null || campagne == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si idCampagne et campagne sont null, on créée une nouvelle campagne. Si idCampagne est renseigné,
+ * on édite la campagne correspondante. Si campagne est renseignée, on créée une nouvelle campagne à partir des
+ * informations qu'elle contient.
+ * @param idCampagne ID campagne
+ * @param campagne Lot
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManageCampagnePage(Integer idCampagne, Campagne campagne, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManageCampagnePage.class);
+ assert idCampagne == null || campagne == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- // Initialisation des modèles
- try {
- campagneModel = new Model<Campagne>(idCampagne == null && campagne == null ? new Campagne()
- : campagne != null ? campagne : campagneService.loadCampagne(idCampagne));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- boolean createMode = idCampagne == null;
- if (createMode) {
- campagneModel.getObject().setCreateur(getSession().getUtilisateur());
- }
- participantModel = new Model<CampagnePersonneParticipant>(new CampagnePersonneParticipant());
- participantModel.getObject().getId().setPk1(campagneModel.getObject());
- stationModel = new Model<Station>(new Station());
+ // Initialisation des modèles
+ try {
+ campagneModel = new Model<Campagne>(idCampagne == null && campagne == null ? new Campagne()
+ : campagne != null ? campagne : campagneService.loadCampagne(idCampagne));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ boolean createMode = idCampagne == null;
+ if (createMode) {
+ campagneModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
+ participantModel = new Model<CampagnePersonneParticipant>(new CampagnePersonneParticipant());
+ participantModel.getObject().getId().setPk1(campagneModel.getObject());
+ stationModel = new Model<Station>(new Station());
- // Initialisation des listes
- List<String> programmes = campagneService.listCampagneProgrammes();
- personnes = personneService.listPersonnes();
- stations = stationService.listStations(getSession().getUtilisateur());
+ // Initialisation des listes
+ List<String> programmes = campagneService.listCampagneProgrammes();
+ personnes = personneService.listPersonnes();
+ stations = stationService.listStations(getSession().getUtilisateur());
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("Campagne.nom", new PropertyModel<String>(campagneModel, "nom")));
+ formView.add(new TextField<String>("Campagne.nom", new PropertyModel<String>(campagneModel, "nom")));
- // Choix du code pays
- formView.add(new DropDownChoice<String>("Campagne.codePays", new PropertyModel<String>(campagneModel,
- "codePays"), WebContext.COUNTRY_CODES.get(getSession().getLocale()),
- new MapChoiceRenderer<String, String>(WebContext.COUNTRIES.get(getSession().getLocale()))));
- if (campagneModel.getObject().getCodePays() == null) {
- campagneModel.getObject().setCodePays(
- WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
- }
+ // Choix du code pays
+ formView.add(new DropDownChoice<String>("Campagne.codePays", new PropertyModel<String>(campagneModel,
+ "codePays"), WebContext.COUNTRY_CODES.get(getSession().getLocale()),
+ new MapChoiceRenderer<String, String>(WebContext.COUNTRIES.get(getSession().getLocale()))));
+ if (campagneModel.getObject().getCodePays() == null) {
+ campagneModel.getObject().setCodePays(
+ WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
+ }
- // Champs de type Date
- formView.add(new DateTextField("Campagne.dateDeb", new PropertyModel<Date>(campagneModel, "dateDeb"))
- .add(new DatePicker()));
+ // Champs de type Date
+ formView.add(new DateTextField("Campagne.dateDeb", new PropertyModel<Date>(campagneModel, "dateDeb"))
+ .add(new DatePicker()));
- formView.add(new DateTextField("Campagne.dateFin", new PropertyModel<Date>(campagneModel, "dateFin"))
- .add(new DatePicker()));
+ formView.add(new DateTextField("Campagne.dateFin", new PropertyModel<Date>(campagneModel, "dateFin"))
+ .add(new DatePicker()));
- formView.add(new TextArea<String>("Campagne.mentionLegale", new PropertyModel<String>(campagneModel,
- "mentionLegale")));
- formView.add(new SimpleTooltipPanel("Campagne.mentionLegale.info", new Model<String>(
- getString("Campagne.mentionLegale.info"))));
+ formView.add(new TextArea<String>("Campagne.mentionLegale", new PropertyModel<String>(campagneModel,
+ "mentionLegale")));
+ formView.add(new SimpleTooltipPanel("Campagne.mentionLegale.info", new Model<String>(
+ getString("Campagne.mentionLegale.info"))));
- formView.add(new TextArea<String>("Campagne.complement", new PropertyModel<String>(campagneModel, "complement")));
- formView.add(new SimpleTooltipPanel("Campagne.complement.info", new Model<String>(
- getString("Campagne.complement.info"))));
+ formView.add(new TextArea<String>("Campagne.complement", new PropertyModel<String>(campagneModel, "complement")));
+ formView.add(new SimpleTooltipPanel("Campagne.complement.info", new Model<String>(
+ getString("Campagne.complement.info"))));
- formView.add(new TextField<String>("Campagne.createur", new PropertyModel<String>(campagneModel, "createur"))
- .setEnabled(false));
+ formView.add(new TextField<String>("Campagne.createur", new PropertyModel<String>(campagneModel, "createur"))
+ .setEnabled(false));
- // Champs en lecture seule
- formView.add(new AutoCompleteTextFieldString("Campagne.programme", new PropertyModel<String>(campagneModel,
- "programme"), programmes, ComparisonMode.CONTAINS));
+ // Champs en lecture seule
+ formView.add(new AutoCompleteTextFieldString("Campagne.programme", new PropertyModel<String>(campagneModel,
+ "programme"), programmes, ComparisonMode.CONTAINS));
- initParticipantsFields(formView);
- initStationsFields(formView);
+ initParticipantsFields(formView);
+ initStationsFields(formView);
- // Action : création de la campagne
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- campagneService.createCampagne(campagneModel.getObject());
- }
+ // Action : création de la campagne
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ campagneService.createCampagne(campagneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : mise à jour de la campagne
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- campagneService.updateCampagne(campagneModel.getObject());
- }
+ // Action : mise à jour de la campagne
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ campagneService.updateCampagne(campagneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode
- && campagneService.updateOrdeleteCampagneEnabled(campagneModel.getObject(), getSession()
- .getUtilisateur()));
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode
+ && campagneService.updateOrdeleteCampagneEnabled(campagneModel.getObject(), getSession()
+ .getUtilisateur()));
+ formView.add(updateButton);
- // Action : suppression de la campagne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- campagneService.deleteCampagne(campagneModel.getObject());
- }
+ // Action : suppression de la campagne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ campagneService.deleteCampagne(campagneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(!createMode
- && campagneService.updateOrdeleteCampagneEnabled(campagneModel.getObject(), getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode
+ && campagneService.updateOrdeleteCampagneEnabled(campagneModel.getObject(), getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- // Action : annulation (lien)
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) this.getPage());
- }
- });
+ // Action : annulation (lien)
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) this.getPage());
+ }
+ });
- cleanPersonnesChoice();
- cleanStationsChoice();
- add(formView);
- }
+ cleanPersonnesChoice();
+ cleanStationsChoice();
+ add(formView);
+ }
- /**
- * Initialize participants section
- * @param formView The form view
- */
- private void initParticipantsFields(final Form<Void> formView) {
- // Tableau des participants
- final MarkupContainer participantsTable = new WebMarkupContainer("Campagne.participants.Table");
- participantsTable.setOutputMarkupId(true);
+ /**
+ * Initialize participants section
+ * @param formView The form view
+ */
+ private void initParticipantsFields(final Form<Void> formView) {
+ // Tableau des participants
+ final MarkupContainer participantsTable = new WebMarkupContainer("Campagne.participants.Table");
+ participantsTable.setOutputMarkupId(true);
- // Liste des participants ajoutés
- participantsTable.add(new ListView<CampagnePersonneParticipant>("Campagne.participants.List",
- new PropertyModel<List<CampagnePersonneParticipant>>(campagneModel, "participants")) {
- @Override
- protected void populateItem(ListItem<CampagnePersonneParticipant> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des participants ajoutés
+ participantsTable.add(new ListView<CampagnePersonneParticipant>("Campagne.participants.List",
+ new PropertyModel<List<CampagnePersonneParticipant>>(campagneModel, "participants")) {
+ @Override
+ protected void populateItem(ListItem<CampagnePersonneParticipant> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final CampagnePersonneParticipant participant = item.getModelObject();
- // Colonnes
- item.add(new Label("Campagne.participants.List.personne", new PropertyModel<String>(participant,
- "id.pk2")));
- item.add(new Label("Campagne.participants.List.complement", new PropertyModel<String>(participant,
- "complement")));
+ final CampagnePersonneParticipant participant = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Campagne.participants.List.personne", new PropertyModel<String>(participant,
+ "id.pk2")));
+ item.add(new Label("Campagne.participants.List.complement", new PropertyModel<String>(participant,
+ "complement")));
- // Action : suppression d'un participant
- Button deleteButton = new AjaxFallbackButton("Campagne.participants.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- campagneModel.getObject().getParticipants().remove(participant);
- cleanPersonnesChoice();
+ // Action : suppression d'un participant
+ Button deleteButton = new AjaxFallbackButton("Campagne.participants.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ campagneModel.getObject().getParticipants().remove(participant);
+ cleanPersonnesChoice();
- // Mise à jour des listes
- refreshModel();
- if (target != null) {
- target.add(participantsTable, availablePersonnes);
- }
- }
+ // Mise à jour des listes
+ refreshModel();
+ if (target != null) {
+ target.add(participantsTable, availablePersonnes);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- // Liste des personnes "disponibles" (non encore ajoutées dans la liste des participants)
- availablePersonnes = new DropDownChoice<Personne>("Campagne.participant", new PropertyModel<Personne>(
- participantModel, "id.pk2"), new ArrayList<Personne>(), new PersonneRenderer());
- availablePersonnes.setNullValid(false);
- availablePersonnes.setOutputMarkupId(true);
+ // Liste des personnes "disponibles" (non encore ajoutées dans la liste des participants)
+ availablePersonnes = new DropDownChoice<Personne>("Campagne.participant", new PropertyModel<Personne>(
+ participantModel, "id.pk2"), new ArrayList<Personne>(), new PersonneRenderer());
+ availablePersonnes.setNullValid(false);
+ availablePersonnes.setOutputMarkupId(true);
- participantsTable.add(availablePersonnes);
+ participantsTable.add(availablePersonnes);
- complementView = new TextField<String>("CampagnePersonneParticipant.complement", new PropertyModel<String>(
- participantModel, "complement"));
- participantsTable.add(complementView);
+ complementView = new TextField<String>("CampagnePersonneParticipant.complement", new PropertyModel<String>(
+ participantModel, "complement"));
+ participantsTable.add(complementView);
- // Bouton AJAX pour ajouter un participant
- addParticipant = new AjaxFallbackButton("Campagne.participants.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- if (participantModel.getObject().getId().getPk2() != null) {
- try {
- // Ajout du participant
- campagneModel.getObject().getParticipants().add(participantModel.getObject().clone());
- cleanPersonnesChoice();
- // réinit de la ligne d'ajout
- participantModel.getObject().getId().setPk2(null);
- participantModel.getObject().setComplement(null);
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Bouton AJAX pour ajouter un participant
+ addParticipant = new AjaxFallbackButton("Campagne.participants.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ if (participantModel.getObject().getId().getPk2() != null) {
+ try {
+ // Ajout du participant
+ campagneModel.getObject().getParticipants().add(participantModel.getObject().clone());
+ cleanPersonnesChoice();
+ // réinit de la ligne d'ajout
+ participantModel.getObject().getId().setPk2(null);
+ participantModel.getObject().setComplement(null);
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- // Mise à jour des listes
- refreshModel();
- if (target != null) {
- target.add(participantsTable, availablePersonnes);
- }
- }
- }
+ // Mise à jour des listes
+ refreshModel();
+ if (target != null) {
+ target.add(participantsTable, availablePersonnes);
+ }
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- participantsTable.add(addParticipant);
+ };
+ participantsTable.add(addParticipant);
- formView.add(participantsTable);
+ formView.add(participantsTable);
- // Action : création d'une nouvelle personne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- participantsTable.add(new AjaxSubmitLink("NewPersonne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
+ // Action : création d'une nouvelle personne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ participantsTable.add(new AjaxSubmitLink("NewPersonne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
- });
- }
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ });
+ }
- /**
- * Initialize stations section
- * @param formView The form view
- */
- private void initStationsFields(final Form<Void> formView) {
- // Tableau des participants
- final MarkupContainer stationsTable = new WebMarkupContainer("Campagne.stations.Table");
- stationsTable.setOutputMarkupId(true);
+ /**
+ * Initialize stations section
+ * @param formView The form view
+ */
+ private void initStationsFields(final Form<Void> formView) {
+ // Tableau des participants
+ final MarkupContainer stationsTable = new WebMarkupContainer("Campagne.stations.Table");
+ stationsTable.setOutputMarkupId(true);
- // Liste des stations ajoutées
- stationsTable.add(new ListView<Station>("Campagne.stations.List", new PropertyModel<List<Station>>(
- campagneModel, "sortedStations")) {
- @Override
- protected void populateItem(ListItem<Station> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des stations ajoutées
+ stationsTable.add(new ListView<Station>("Campagne.stations.List", new PropertyModel<List<Station>>(
+ campagneModel, "sortedStations")) {
+ @Override
+ protected void populateItem(ListItem<Station> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final Station station = item.getModelObject();
- // Colonnes
- item.add(new Label("Campagne.stations.List.station", new PropertyModel<String>(station, "nom"))
- .add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.codePays", new DisplayMapValuePropertyModel<String>(station,
- "codePays", WebContext.COUNTRIES.get(getSession().getLocale())))
- .add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.localite", new PropertyModel<String>(station, "localite"))
- .add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.latitude", new PropertyModel<String>(station, "latitude"))
- .add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.longitude", new PropertyModel<String>(station, "longitude"))
- .add(new ReplaceEmptyLabelBehavior()));
+ final Station station = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Campagne.stations.List.station", new PropertyModel<String>(station, "nom"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.codePays", new DisplayMapValuePropertyModel<String>(station,
+ "codePays", WebContext.COUNTRIES.get(getSession().getLocale())))
+ .add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.localite", new PropertyModel<String>(station, "localite"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.latitude", new PropertyModel<String>(station, "latitude"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.longitude", new PropertyModel<String>(station, "longitude"))
+ .add(new ReplaceEmptyLabelBehavior()));
- // Action : suppression d'une station
- Button deleteButton = new AjaxFallbackButton("Campagne.stations.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- campagneModel.getObject().getStations().remove(station);
- cleanStationsChoice();
+ // Action : suppression d'une station
+ Button deleteButton = new AjaxFallbackButton("Campagne.stations.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ campagneModel.getObject().getStations().remove(station);
+ cleanStationsChoice();
- // Mise à jour des listes
- refreshModel();
- if (target != null) {
- target.add(stationsTable, availableStations);
- }
- }
+ // Mise à jour des listes
+ refreshModel();
+ if (target != null) {
+ target.add(stationsTable, availableStations);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- // Liste des stations "disponibles" (non encore ajoutées dans la liste des stations)
- availableStations = new DropDownChoice<Station>("Campagne.station", stationModel, new ArrayList<Station>());
- availableStations.setNullValid(false);
- availableStations.setOutputMarkupId(true);
+ // Liste des stations "disponibles" (non encore ajoutées dans la liste des stations)
+ availableStations = new DropDownChoice<Station>("Campagne.station", stationModel, new ArrayList<Station>());
+ availableStations.setNullValid(false);
+ availableStations.setOutputMarkupId(true);
- stationsTable.add(availableStations);
+ stationsTable.add(availableStations);
- final Label codePaysLabel = new Label("Campagne.station.codePays", new DisplayMapValuePropertyModel<String>(
- stationModel, "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
- codePaysLabel.setOutputMarkupId(true);
- stationsTable.add(codePaysLabel);
+ final Label codePaysLabel = new Label("Campagne.station.codePays", new DisplayMapValuePropertyModel<String>(
+ stationModel, "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ codePaysLabel.setOutputMarkupId(true);
+ stationsTable.add(codePaysLabel);
- final Label localiteLabel = new Label("Campagne.station.localite", new PropertyModel<String>(stationModel,
- "localite"));
- localiteLabel.setOutputMarkupId(true);
- stationsTable.add(localiteLabel);
+ final Label localiteLabel = new Label("Campagne.station.localite", new PropertyModel<String>(stationModel,
+ "localite"));
+ localiteLabel.setOutputMarkupId(true);
+ stationsTable.add(localiteLabel);
- final Label latitudeLabel = new Label("Campagne.station.latitude", new PropertyModel<String>(stationModel,
- "latitude"));
- latitudeLabel.setOutputMarkupId(true);
- stationsTable.add(latitudeLabel);
+ final Label latitudeLabel = new Label("Campagne.station.latitude", new PropertyModel<String>(stationModel,
+ "latitude"));
+ latitudeLabel.setOutputMarkupId(true);
+ stationsTable.add(latitudeLabel);
- final Label longitudeLabel = new Label("Campagne.station.longitude", new PropertyModel<String>(stationModel,
- "longitude"));
- longitudeLabel.setOutputMarkupId(true);
- stationsTable.add(longitudeLabel);
+ final Label longitudeLabel = new Label("Campagne.station.longitude", new PropertyModel<String>(stationModel,
+ "longitude"));
+ longitudeLabel.setOutputMarkupId(true);
+ stationsTable.add(longitudeLabel);
- availableStations.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- target.add(codePaysLabel, localiteLabel, latitudeLabel, longitudeLabel);
- }
- });
+ availableStations.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ target.add(codePaysLabel, localiteLabel, latitudeLabel, longitudeLabel);
+ }
+ });
- // Bouton AJAX pour ajouter une station
- addStation = new AjaxFallbackButton("Campagne.stations.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- if (stationModel.getObject() != null) {
- try {
- // Ajout du participant
- participantModel.getObject().setComplement(complementView.getValue());
- campagneModel.getObject().getStations().add(stationModel.getObject().clone());
- cleanStationsChoice();
- // réinit de la ligne d'ajout
- stationModel.setObject(new Station());
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Bouton AJAX pour ajouter une station
+ addStation = new AjaxFallbackButton("Campagne.stations.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ if (stationModel.getObject() != null) {
+ try {
+ // Ajout du participant
+ participantModel.getObject().setComplement(complementView.getValue());
+ campagneModel.getObject().getStations().add(stationModel.getObject().clone());
+ cleanStationsChoice();
+ // réinit de la ligne d'ajout
+ stationModel.setObject(new Station());
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- // Mise à jour des listes
- refreshModel();
- if (target != null) {
- target.add(stationsTable, availableStations);
- }
- }
- }
+ // Mise à jour des listes
+ refreshModel();
+ if (target != null) {
+ target.add(stationsTable, availableStations);
+ }
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- stationsTable.add(addStation);
+ };
+ stationsTable.add(addStation);
- formView.add(stationsTable);
+ formView.add(stationsTable);
- // Action : création d'une nouvelle station
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- stationsTable.add(new AjaxSubmitLink("NewStation") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManageStationPage(new CallerPage((TemplatePage) getPage()), false));
- }
+ // Action : création d'une nouvelle station
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ stationsTable.add(new AjaxSubmitLink("NewStation") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManageStationPage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageStationPage(new CallerPage((TemplatePage) getPage()), false));
- }
- });
- }
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageStationPage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ });
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Station, Spécimen ou Campagne)
- refreshModel();
- super.onBeforeRender();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Station, Spécimen ou Campagne)
+ refreshModel();
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection vers l'écran de saisie d'une nouvelle campagne, en fournissant déjà quelques données
- Campagne nextCampagne = new Campagne();
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection vers l'écran de saisie d'une nouvelle campagne, en fournissant déjà quelques données
+ Campagne nextCampagne = new Campagne();
- nextCampagne.setCodePays(campagneModel.getObject().getCodePays());
- nextCampagne.setProgramme(campagneModel.getObject().getProgramme());
- nextCampagne.setMentionLegale(campagneModel.getObject().getMentionLegale());
- setResponsePage(new ManageCampagnePage(nextCampagne, callerPage));
- } else if (callerPage != null) {
- // On passe la campagne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Campagne.class.getSimpleName(), campagneModel.getObject().getIdCampagne());
- callerPage.responsePage(this);
- }
- }
+ nextCampagne.setCodePays(campagneModel.getObject().getCodePays());
+ nextCampagne.setProgramme(campagneModel.getObject().getProgramme());
+ nextCampagne.setMentionLegale(campagneModel.getObject().getMentionLegale());
+ setResponsePage(new ManageCampagnePage(nextCampagne, callerPage));
+ } else if (callerPage != null) {
+ // On passe la campagne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Campagne.class.getSimpleName(), campagneModel.getObject().getIdCampagne());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Mets à jour les personnes disponibles (non encore ajoutées)
- */
- private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Personne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(personnes, personneService.listPersonnes());
- cleanPersonnesChoice();
- try {
- Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
- participantModel.getObject().getId().setPk2(createdPersonne);
+ /**
+ * Mets à jour les personnes disponibles (non encore ajoutées)
+ */
+ private void refreshModel() {
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Personne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(personnes, personneService.listPersonnes());
+ cleanPersonnesChoice();
+ try {
+ Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
+ participantModel.getObject().getId().setPk2(createdPersonne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
- key = Station.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(stations, stationService.listStations(getSession().getUtilisateur()));
- cleanStationsChoice();
- try {
- Station createdStation = stationService.loadStation(getPageParameters().get(key).toInt());
- stationModel.setObject(createdStation);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
+ key = Station.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(stations, stationService.listStations(getSession().getUtilisateur()));
+ cleanStationsChoice();
+ try {
+ Station createdStation = stationService.loadStation(getPageParameters().get(key).toInt());
+ stationModel.setObject(createdStation);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
- }
+ }
- /**
- * Suprimme de la liste des personnes proposées, les personnes qui sont déjà ajoutées comme participant
- */
- private void cleanPersonnesChoice() {
- List<Personne> choices = new ArrayList<Personne>(personnes);
- for (CampagnePersonneParticipant participant : campagneModel.getObject().getParticipants()) {
- for (Personne personne : personnes) {
- if (participant.getId().getPk2().getIdPersonne() == personne.getIdPersonne()) {
- choices.remove(personne);
- }
- }
- }
- availablePersonnes.setChoices(choices);
- availablePersonnes.setEnabled(!choices.isEmpty());
- addParticipant.setEnabled(!choices.isEmpty());
- complementView.setEnabled(!choices.isEmpty());
+ /**
+ * Suprimme de la liste des personnes proposées, les personnes qui sont déjà ajoutées comme participant
+ */
+ private void cleanPersonnesChoice() {
+ List<Personne> choices = new ArrayList<Personne>(personnes);
+ for (CampagnePersonneParticipant participant : campagneModel.getObject().getParticipants()) {
+ for (Personne personne : personnes) {
+ if (participant.getId().getPk2().getIdPersonne() == personne.getIdPersonne()) {
+ choices.remove(personne);
+ }
+ }
+ }
+ availablePersonnes.setChoices(choices);
+ availablePersonnes.setEnabled(!choices.isEmpty());
+ addParticipant.setEnabled(!choices.isEmpty());
+ complementView.setEnabled(!choices.isEmpty());
- }
+ }
- /**
- * Suprimme de la liste des stations proposées, les stations qui sont déjà ajoutées comme station prospectée
- */
- private void cleanStationsChoice() {
- List<Station> choices = new ArrayList<Station>(stations);
- for (Station curStationAdded : campagneModel.getObject().getStations()) {
- for (Station curStation : stations) {
- if (curStationAdded.getIdStation() == curStation.getIdStation()) {
- choices.remove(curStation);
- }
- }
- }
- availableStations.setChoices(choices);
- availableStations.setEnabled(!choices.isEmpty());
- addStation.setEnabled(!choices.isEmpty());
- availableStations.setEnabled(!choices.isEmpty());
- }
+ /**
+ * Suprimme de la liste des stations proposées, les stations qui sont déjà ajoutées comme station prospectée
+ */
+ private void cleanStationsChoice() {
+ List<Station> choices = new ArrayList<Station>(stations);
+ for (Station curStationAdded : campagneModel.getObject().getStations()) {
+ for (Station curStation : stations) {
+ if (curStationAdded.getIdStation() == curStation.getIdStation()) {
+ choices.remove(curStation);
+ }
+ }
+ }
+ availableStations.setChoices(choices);
+ availableStations.setEnabled(!choices.isEmpty());
+ addStation.setEnabled(!choices.isEmpty());
+ availableStations.setEnabled(!choices.isEmpty());
+ }
- /**
- * Validate the campagne model (for update & create)
- */
- private void validateModel() {
- if (campagneModel.getObject().getCreateur() == null) {
- campagneModel.getObject().setCreateur(getSession().getUtilisateur());
- }
- addValidationErrors(validator.validate(campagneModel.getObject(), getSession().getLocale(), "nom", "codePays",
- "programme", "complement", "createur"));
- List<String> dateErrors = validator.validate(campagneModel.getObject(), getSession().getLocale(), "dateDeb",
- "dateFin");
- addValidationErrors(dateErrors);
- if (dateErrors.size() == 0
- && (campagneModel.getObject().getDateDeb() == null || campagneModel.getObject().getDateFin() == null || !campagneModel
- .getObject().getDateDeb().before(campagneModel.getObject().getDateFin()))) {
- getPage().error(getString("Campagne.dates.KO"));
- }
- }
+ /**
+ * Validate the campagne model (for update & create)
+ */
+ private void validateModel() {
+ if (campagneModel.getObject().getCreateur() == null) {
+ campagneModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
+ addValidationErrors(validator.validate(campagneModel.getObject(), getSession().getLocale(), "nom", "codePays",
+ "programme", "complement", "createur"));
+ List<String> dateErrors = validator.validate(campagneModel.getObject(), getSession().getLocale(), "dateDeb",
+ "dateFin");
+ addValidationErrors(dateErrors);
+ if (dateErrors.size() == 0
+ && (campagneModel.getObject().getDateDeb() == null || campagneModel.getObject().getDateFin() == null || !campagneModel
+ .getObject().getDateDeb().before(campagneModel.getObject().getDateFin()))) {
+ getPage().error(getString("Campagne.dates.KO"));
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ReadCampagnePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ReadCampagnePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/campagne/ReadCampagnePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -68,252 +68,252 @@
*/
public final class ReadCampagnePage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Modèle : campagne */
- private final IModel<Campagne> campagneModel;
+ /** Modèle : campagne */
+ private final IModel<Campagne> campagneModel;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /**
- * Constructeur
- * @param idCampagne ID campagne
- * @param callerPage Page appelante
- */
- public ReadCampagnePage(Integer idCampagne, final CallerPage callerPage) {
+ /**
+ * Constructeur
+ * @param idCampagne ID campagne
+ * @param callerPage Page appelante
+ */
+ public ReadCampagnePage(Integer idCampagne, final CallerPage callerPage) {
- super(ReadCampagnePage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ super(ReadCampagnePage.class);
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation des modèles
- campagneModel = new GenericLoadableDetachableModel<Campagne>(Campagne.class, idCampagne);
+ // Initialisation des modèles
+ campagneModel = new GenericLoadableDetachableModel<Campagne>(Campagne.class, idCampagne);
- final Campagne campagne = campagneModel.getObject();
+ final Campagne campagne = campagneModel.getObject();
- // Mapping des champs du modèle
- add(new Label("Campagne.nom", new PropertyModel<String>(campagneModel, "nom"))
- .add(new ReplaceEmptyLabelBehavior()));
+ // Mapping des champs du modèle
+ add(new Label("Campagne.nom", new PropertyModel<String>(campagneModel, "nom"))
+ .add(new ReplaceEmptyLabelBehavior()));
- // Affichage du pays
- add(new Label("Campagne.codePays", new DisplayMapValuePropertyModel<String>(campagneModel, "codePays",
- WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Campagne.dateDeb", new PropertyModel<String>(campagneModel, "dateDeb"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Campagne.dateFin", new PropertyModel<String>(campagneModel, "dateFin"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Campagne.programme", new PropertyModel<String>(campagneModel, "programme"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Campagne.mentionLegale", new PropertyModel<String>(campagneModel, "mentionLegale"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new SimpleTooltipPanel("Campagne.mentionLegale.info", new Model<String>(
- getString("Campagne.mentionLegale.info2"))));
- add(new MultiLineLabel("Campagne.complement", new PropertyModel<String>(campagneModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
+ // Affichage du pays
+ add(new Label("Campagne.codePays", new DisplayMapValuePropertyModel<String>(campagneModel, "codePays",
+ WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Campagne.dateDeb", new PropertyModel<String>(campagneModel, "dateDeb"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Campagne.dateFin", new PropertyModel<String>(campagneModel, "dateFin"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Campagne.programme", new PropertyModel<String>(campagneModel, "programme"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Campagne.mentionLegale", new PropertyModel<String>(campagneModel, "mentionLegale"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new SimpleTooltipPanel("Campagne.mentionLegale.info", new Model<String>(
+ getString("Campagne.mentionLegale.info2"))));
+ add(new MultiLineLabel("Campagne.complement", new PropertyModel<String>(campagneModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Campagne.createur", new PropertyModel<Personne>(campagneModel,
- "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Campagne.createur", new PropertyModel<Personne>(campagneModel,
+ "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- initParticipantsFields(currentPage);
- initStationsFields(currentPage);
+ initParticipantsFields(currentPage);
+ initStationsFields(currentPage);
- // Ajout du formulaire pour les actions
- final Form<Void> formView = new Form<Void>("Form");
+ // Ajout du formulaire pour les actions
+ final Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<Campagne> updateLink = new Link<Campagne>(getResource() + ".Campagne.Update",
- new Model<Campagne>(campagne)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageCampagnePage(getModelObject().getIdCampagne(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(campagneService.updateOrdeleteCampagneEnabled(campagne, getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Campagne> updateLink = new Link<Campagne>(getResource() + ".Campagne.Update",
+ new Model<Campagne>(campagne)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageCampagnePage(getModelObject().getIdCampagne(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(campagneService.updateOrdeleteCampagneEnabled(campagne, getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : retour à la page précédente
- formView.add(new Link<Void>(getResource() + ".Campagne.Back") {
- @Override
- public void onClick() {
- redirect();
- }
- });
+ // Action : retour à la page précédente
+ formView.add(new Link<Void>(getResource() + ".Campagne.Back") {
+ @Override
+ public void onClick() {
+ redirect();
+ }
+ });
- // Action : suppression de la campagne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageCampagnePage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- campagneService.deleteCampagne(campagne);
- }
+ // Action : suppression de la campagne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageCampagnePage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ campagneService.deleteCampagne(campagne);
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageCampagnePage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(campagneService.updateOrdeleteCampagneEnabled(campagne, getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
- add(formView);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageCampagnePage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(campagneService.updateOrdeleteCampagneEnabled(campagne, getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
+ add(formView);
+ }
- /**
- * Initialize participants section
- * @param currentPage The current page
- */
- private void initParticipantsFields(final CallerPage currentPage) {
- ListView<CampagnePersonneParticipant> campagneParticipants = new ListView<CampagnePersonneParticipant>(
- "Campagne.participants.List", new PropertyModel<List<CampagnePersonneParticipant>>(campagneModel,
- "participants")) {
- @Override
- protected void populateItem(ListItem<CampagnePersonneParticipant> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ /**
+ * Initialize participants section
+ * @param currentPage The current page
+ */
+ private void initParticipantsFields(final CallerPage currentPage) {
+ ListView<CampagnePersonneParticipant> campagneParticipants = new ListView<CampagnePersonneParticipant>(
+ "Campagne.participants.List", new PropertyModel<List<CampagnePersonneParticipant>>(campagneModel,
+ "participants")) {
+ @Override
+ protected void populateItem(ListItem<CampagnePersonneParticipant> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- CampagnePersonneParticipant participant = item.getModelObject();
- // affichage + lien vers la fiche
- item.add(new PropertyLabelLinkPanel<Personne>("Campagne.participants.List.personne",
- new Model<Personne>(participant.getId().getPk2()), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
- item.add(new Label("Campagne.participants.List.complement", new PropertyModel<String>(participant,
- "complement")));
- }
- };
+ CampagnePersonneParticipant participant = item.getModelObject();
+ // affichage + lien vers la fiche
+ item.add(new PropertyLabelLinkPanel<Personne>("Campagne.participants.List.personne",
+ new Model<Personne>(participant.getId().getPk2()), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
+ item.add(new Label("Campagne.participants.List.complement", new PropertyModel<String>(participant,
+ "complement")));
+ }
+ };
- // Selon l'existence d'elements dans la liste on affiche la table
- MarkupContainer tableParticipants = new WebMarkupContainer("Campagne.participants.Table") {
- @Override
- public boolean isVisible() {
- return campagneModel.getObject().getParticipants().size() != 0;
- }
- };
- tableParticipants.add(campagneParticipants);
- add(tableParticipants);
+ // Selon l'existence d'elements dans la liste on affiche la table
+ MarkupContainer tableParticipants = new WebMarkupContainer("Campagne.participants.Table") {
+ @Override
+ public boolean isVisible() {
+ return campagneModel.getObject().getParticipants().size() != 0;
+ }
+ };
+ tableParticipants.add(campagneParticipants);
+ add(tableParticipants);
- // Selon la non existence d'elements dans la liste on affiche le span
- MarkupContainer noTableParticipants = new WebMarkupContainer("Campagne.participants.NoTable") {
- @Override
- public boolean isVisible() {
- return campagneModel.getObject().getParticipants().size() == 0;
- }
- };
- add(noTableParticipants);
- }
+ // Selon la non existence d'elements dans la liste on affiche le span
+ MarkupContainer noTableParticipants = new WebMarkupContainer("Campagne.participants.NoTable") {
+ @Override
+ public boolean isVisible() {
+ return campagneModel.getObject().getParticipants().size() == 0;
+ }
+ };
+ add(noTableParticipants);
+ }
- /**
- * Initialize stations section
- * @param currentPage The current page
- */
- private void initStationsFields(final CallerPage currentPage) {
+ /**
+ * Initialize stations section
+ * @param currentPage The current page
+ */
+ private void initStationsFields(final CallerPage currentPage) {
- // Selon l'existence d'elements dans la liste on affiche la table
- MarkupContainer tableStations = new WebMarkupContainer("Campagne.stations.Table") {
- @Override
- public boolean isVisible() {
- return !campagneModel.getObject().getStations().isEmpty();
- }
- };
- add(tableStations);
+ // Selon l'existence d'elements dans la liste on affiche la table
+ MarkupContainer tableStations = new WebMarkupContainer("Campagne.stations.Table") {
+ @Override
+ public boolean isVisible() {
+ return !campagneModel.getObject().getStations().isEmpty();
+ }
+ };
+ add(tableStations);
- final WebMarkupContainer stationsNotAccessiblesCont = new WebMarkupContainer(
- "Campagne.stations.stationsNotAccessibles");
- stationsNotAccessiblesCont.setOutputMarkupPlaceholderTag(true);
- tableStations.add(stationsNotAccessiblesCont);
+ final WebMarkupContainer stationsNotAccessiblesCont = new WebMarkupContainer(
+ "Campagne.stations.stationsNotAccessibles");
+ stationsNotAccessiblesCont.setOutputMarkupPlaceholderTag(true);
+ tableStations.add(stationsNotAccessiblesCont);
- // Model de liste des stations
- final LoadableDetachableModel<List<Station>> listStationsModel = new LoadableDetachableModel<List<Station>>() {
- @Override
- protected List<Station> load() {
- boolean isOneResultNotAccessible = false;
- final List<Station> accessiblesStations = stationService.listStations(getSession().getUtilisateur());
+ // Model de liste des stations
+ final LoadableDetachableModel<List<Station>> listStationsModel = new LoadableDetachableModel<List<Station>>() {
+ @Override
+ protected List<Station> load() {
+ boolean isOneResultNotAccessible = false;
+ final List<Station> accessiblesStations = stationService.listStations(getSession().getUtilisateur());
- List<Station> listStations = new ArrayList<Station>();
+ List<Station> listStations = new ArrayList<Station>();
- for (Station st : campagneModel.getObject().getSortedStations()) {
+ for (Station st : campagneModel.getObject().getSortedStations()) {
- if (accessiblesStations.contains(st)) {
- listStations.add(st);
- } else {
- isOneResultNotAccessible = true;
- }
- }
- // si une des stations non accessibles, on rend visible le message d'avertissement
- stationsNotAccessiblesCont.setVisibilityAllowed(isOneResultNotAccessible);
- return listStations;
- }
- };
+ if (accessiblesStations.contains(st)) {
+ listStations.add(st);
+ } else {
+ isOneResultNotAccessible = true;
+ }
+ }
+ // si une des stations non accessibles, on rend visible le message d'avertissement
+ stationsNotAccessiblesCont.setVisibilityAllowed(isOneResultNotAccessible);
+ return listStations;
+ }
+ };
- ListView<Station> stationsListView = new ListView<Station>("Campagne.stations.List", listStationsModel) {
- @Override
- protected void populateItem(ListItem<Station> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ ListView<Station> stationsListView = new ListView<Station>("Campagne.stations.List", listStationsModel) {
+ @Override
+ protected void populateItem(ListItem<Station> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- IModel<Station> stationModel = item.getModel();
- // affichage + lien vers la fiche
- item.add(new PropertyLabelLinkPanel<Station>("Campagne.stations.List.station", item.getModel(),
- getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
- }
- });
+ IModel<Station> stationModel = item.getModel();
+ // affichage + lien vers la fiche
+ item.add(new PropertyLabelLinkPanel<Station>("Campagne.stations.List.station", item.getModel(),
+ getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
+ }
+ });
- item.add(new Label("Campagne.stations.List.codePays", new DisplayMapValuePropertyModel<String>(
- stationModel, "codePays", WebContext.COUNTRIES.get(getSession().getLocale())))
- .add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.localite", new PropertyModel<String>(stationModel,
- "localite")).add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.latitude", new PropertyModel<String>(stationModel,
- "latitude")).add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("Campagne.stations.List.longitude", new PropertyModel<String>(stationModel,
- "longitude")).add(new ReplaceEmptyLabelBehavior()));
- }
- };
- tableStations.add(stationsListView);
+ item.add(new Label("Campagne.stations.List.codePays", new DisplayMapValuePropertyModel<String>(
+ stationModel, "codePays", WebContext.COUNTRIES.get(getSession().getLocale())))
+ .add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.localite", new PropertyModel<String>(stationModel,
+ "localite")).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.latitude", new PropertyModel<String>(stationModel,
+ "latitude")).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Campagne.stations.List.longitude", new PropertyModel<String>(stationModel,
+ "longitude")).add(new ReplaceEmptyLabelBehavior()));
+ }
+ };
+ tableStations.add(stationsListView);
- // Selon la non existence d'elements dans la liste on affiche le span
- MarkupContainer noTableStations = new WebMarkupContainer("Campagne.stations.NoTable") {
- @Override
- public boolean isVisible() {
- return campagneModel.getObject().getStations().isEmpty();
- }
- };
- add(noTableStations);
- }
+ // Selon la non existence d'elements dans la liste on affiche le span
+ MarkupContainer noTableStations = new WebMarkupContainer("Campagne.stations.NoTable") {
+ @Override
+ public boolean isVisible() {
+ return campagneModel.getObject().getStations().isEmpty();
+ }
+ };
+ add(noTableStations);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ListConfigurationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ListConfigurationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ListConfigurationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,97 +44,97 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ListConfigurationPage extends TemplatePage {
- /** The opened param value */
- final private String OPENED_PARAM_VALUE = "opened";
+ /** The opened param value */
+ final private String OPENED_PARAM_VALUE = "opened";
- /**
- * Constructor
- * @param params The page parameters
- */
- public ListConfigurationPage(PageParameters params) {
- super(ListConfigurationPage.class);
+ /**
+ * Constructor
+ * @param params The page parameters
+ */
+ public ListConfigurationPage(PageParameters params) {
+ super(ListConfigurationPage.class);
- // check the parameters to know which panel must be opened
- boolean partieOpened = checkIfPanelOpened(params, "partie");
- boolean methExtrOpened = checkIfPanelOpened(params, "methodeExtraction");
- boolean methPuriOpened = checkIfPanelOpened(params, "methodePurification");
- boolean methTestOpened = checkIfPanelOpened(params, "methodeTestBio");
- boolean errTestOpened = checkIfPanelOpened(params, "erreurTestBio");
- boolean rebIndexOpened = checkIfPanelOpened(params, "rebuildLuceneIndex");
+ // check the parameters to know which panel must be opened
+ boolean partieOpened = checkIfPanelOpened(params, "partie");
+ boolean methExtrOpened = checkIfPanelOpened(params, "methodeExtraction");
+ boolean methPuriOpened = checkIfPanelOpened(params, "methodePurification");
+ boolean methTestOpened = checkIfPanelOpened(params, "methodeTestBio");
+ boolean errTestOpened = checkIfPanelOpened(params, "erreurTestBio");
+ boolean rebIndexOpened = checkIfPanelOpened(params, "rebuildLuceneIndex");
- if (params.get("openedTab").equals("partie")) {
- partieOpened = true;
- } else if (params.get("openedTab").equals("methodeExtraction")) {
- methExtrOpened = true;
- } else
+ if (params.get("openedTab").equals("partie")) {
+ partieOpened = true;
+ } else if (params.get("openedTab").equals("methodeExtraction")) {
+ methExtrOpened = true;
+ } else
- // initialize the Partie panel
- add(new CollapsiblePanel(getResource() + ".ListPartiePanel", new Model<String>(
- getString("ListConfigurationPage.Parties")), partieOpened) {
+ // initialize the Partie panel
+ add(new CollapsiblePanel(getResource() + ".ListPartiePanel", new Model<String>(
+ getString("ListConfigurationPage.Parties")), partieOpened) {
- @Override
- protected Panel getInnerPanel(String markupId) {
- return new ListPartiePanel(markupId);
- }
- });
+ @Override
+ protected Panel getInnerPanel(String markupId) {
+ return new ListPartiePanel(markupId);
+ }
+ });
- // initialize the MethodeExtraction panel
- add(new CollapsiblePanel(getResource() + ".ListMethodeExtractionPanel", new Model<String>(
- getString("ListConfigurationPage.MethodesExtraction")), methExtrOpened) {
+ // initialize the MethodeExtraction panel
+ add(new CollapsiblePanel(getResource() + ".ListMethodeExtractionPanel", new Model<String>(
+ getString("ListConfigurationPage.MethodesExtraction")), methExtrOpened) {
- @Override
- protected Panel getInnerPanel(String markupId) {
- return new ListMethodeExtractionPanel(markupId);
- }
- });
+ @Override
+ protected Panel getInnerPanel(String markupId) {
+ return new ListMethodeExtractionPanel(markupId);
+ }
+ });
- // initialize the MethodePurification panel
- add(new CollapsiblePanel(getResource() + ".ListMethodePurificationPanel", new Model<String>(
- getString("ListConfigurationPage.MethodesPurification")), methPuriOpened) {
+ // initialize the MethodePurification panel
+ add(new CollapsiblePanel(getResource() + ".ListMethodePurificationPanel", new Model<String>(
+ getString("ListConfigurationPage.MethodesPurification")), methPuriOpened) {
- @Override
- protected Panel getInnerPanel(String markupId) {
- return new ListMethodePurificationPanel(markupId);
- }
- });
+ @Override
+ protected Panel getInnerPanel(String markupId) {
+ return new ListMethodePurificationPanel(markupId);
+ }
+ });
- // initialize the MethodeTest panel
- add(new CollapsiblePanel(getResource() + ".ListMethodeTestBioPanel", new Model<String>(
- getString("ListConfigurationPage.MethodesTestBio")), methTestOpened) {
+ // initialize the MethodeTest panel
+ add(new CollapsiblePanel(getResource() + ".ListMethodeTestBioPanel", new Model<String>(
+ getString("ListConfigurationPage.MethodesTestBio")), methTestOpened) {
- @Override
- protected Panel getInnerPanel(String markupId) {
- return new ListMethodeTestBioPanel(markupId);
- }
- });
+ @Override
+ protected Panel getInnerPanel(String markupId) {
+ return new ListMethodeTestBioPanel(markupId);
+ }
+ });
- // initialize the TestErreur panel
- add(new CollapsiblePanel(getResource() + ".ListErreurTestBioPanel", new Model<String>(
- getString("ListConfigurationPage.ErreursTestBio")), errTestOpened) {
+ // initialize the TestErreur panel
+ add(new CollapsiblePanel(getResource() + ".ListErreurTestBioPanel", new Model<String>(
+ getString("ListConfigurationPage.ErreursTestBio")), errTestOpened) {
- @Override
- protected Panel getInnerPanel(String markupId) {
- return new ListErreurTestBioPanel(markupId);
- }
- });
-
- // initialize the RebuidLuceneIndex panel
- add(new CollapsiblePanel(getResource() + ".RebuildLuceneIndexPanel", new Model<String>(
- getString("ListConfigurationPage.RebuildLuceneIndex")), rebIndexOpened) {
@Override
protected Panel getInnerPanel(String markupId) {
+ return new ListErreurTestBioPanel(markupId);
+ }
+ });
+
+ // initialize the RebuidLuceneIndex panel
+ add(new CollapsiblePanel(getResource() + ".RebuildLuceneIndexPanel", new Model<String>(
+ getString("ListConfigurationPage.RebuildLuceneIndex")), rebIndexOpened) {
+ @Override
+ protected Panel getInnerPanel(String markupId) {
return new RebuildLuceneIndexPanel(markupId);
}
});
- }
+ }
- /**
- * Check in the request parameters if a panel should be opened
- * @param params The parameters
- * @param paramName The parameter name to check
- * @return the answer
- */
- private boolean checkIfPanelOpened(PageParameters params, String paramName) {
- return params.get(paramName) != null && OPENED_PARAM_VALUE.equals(params.get(paramName).toString());
- }
+ /**
+ * Check in the request parameters if a panel should be opened
+ * @param params The parameters
+ * @param paramName The parameter name to check
+ * @return the answer
+ */
+ private boolean checkIfPanelOpened(PageParameters params, String paramName) {
+ return params.get(paramName) != null && OPENED_PARAM_VALUE.equals(params.get(paramName).toString());
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageErreurTestBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageErreurTestBioPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageErreurTestBioPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -56,152 +56,152 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManageErreurTestBioPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** The return page parameter (key and value) */
- final private String[] RETURN_PARAM = { "erreurTestBio", "opened" };
+ /** The return page parameter (key and value) */
+ final private String[] RETURN_PARAM = { "erreurTestBio", "opened" };
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** erreurTest Model */
- private final IModel<ErreurTestBio> erreurTestModel;
+ /** erreurTest Model */
+ private final IModel<ErreurTestBio> erreurTestModel;
- /** Service : test (for erreurs) */
- @SpringBean
- private TestBioService testService;
+ /** Service : test (for erreurs) */
+ @SpringBean
+ private TestBioService testService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructor
- */
- public ManageErreurTestBioPage() {
- this(null);
- }
+ /**
+ * Constructor
+ */
+ public ManageErreurTestBioPage() {
+ this(null);
+ }
- /**
- * Constructor. If idErreurTest is null, creating a new error, else editing the corresponding error
- * @param idErreurTest The ID of the erreurTest
- */
- public ManageErreurTestBioPage(Integer idErreurTest) {
- super(ManageErreurTestBioPage.class);
+ /**
+ * Constructor. If idErreurTest is null, creating a new error, else editing the corresponding error
+ * @param idErreurTest The ID of the erreurTest
+ */
+ public ManageErreurTestBioPage(Integer idErreurTest) {
+ super(ManageErreurTestBioPage.class);
- boolean createMode;
+ boolean createMode;
- // model initialization
- if (idErreurTest == null) {
- // creation mode
- erreurTestModel = new Model<ErreurTestBio>(new ErreurTestBio());
- createMode = true;
- } else {
- try {
- erreurTestModel = new Model<ErreurTestBio>(testService.loadErreurTestBio(idErreurTest));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- createMode = false;
- }
+ // model initialization
+ if (idErreurTest == null) {
+ // creation mode
+ erreurTestModel = new Model<ErreurTestBio>(new ErreurTestBio());
+ createMode = true;
+ } else {
+ try {
+ erreurTestModel = new Model<ErreurTestBio>(testService.loadErreurTestBio(idErreurTest));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ createMode = false;
+ }
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("ErreurTestBio.nom", new PropertyModel<String>(erreurTestModel, "nom")));
- formView.add(new TextArea<String>("ErreurTestBio.description", new PropertyModel<String>(erreurTestModel,
- "description")));
+ formView.add(new TextField<String>("ErreurTestBio.nom", new PropertyModel<String>(erreurTestModel, "nom")));
+ formView.add(new TextArea<String>("ErreurTestBio.description", new PropertyModel<String>(erreurTestModel,
+ "description")));
- // Action : create the erreurTest
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.createErreurTest(erreurTestModel.getObject());
- }
+ // Action : create the erreurTest
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.createErreurTest(erreurTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the erreurTest
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.updateErreurTestBio(erreurTestModel.getObject());
- }
+ // Action : update the erreurTest
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.updateErreurTestBio(erreurTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.deleteErreurTest(erreurTestModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.deleteErreurTest(erreurTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(erreurTestModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(erreurTestModel.getObject(), getSession().getLocale()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeExtractionPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeExtractionPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeExtractionPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -71,285 +71,285 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManageMethodeExtractionPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** The return page parameter (key and value) */
- final private String[] RETURN_PARAM = { "methodeExtraction", "opened" };
+ /** The return page parameter (key and value) */
+ final private String[] RETURN_PARAM = { "methodeExtraction", "opened" };
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** erreurTest Model */
- private final IModel<MethodeExtraction> methodeExtractionModel;
+ /** erreurTest Model */
+ private final IModel<MethodeExtraction> methodeExtractionModel;
- /** model for adding TypeExtrait */
- private IModel<TypeExtrait> newTypeExtraitModel;
+ /** model for adding TypeExtrait */
+ private IModel<TypeExtrait> newTypeExtraitModel;
- /** Service : extraits */
- @SpringBean
- private ExtractionService extraitService;
+ /** Service : extraits */
+ @SpringBean
+ private ExtractionService extraitService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * couple of <initiale, TypeExtrait> in order to recuperate the id of the deleted type usefull in case of delete
- * thus add of same initial type
- */
- private HashMap<String, TypeExtrait> typesDeleted;
+ /**
+ * couple of <initiale, TypeExtrait> in order to recuperate the id of the deleted type usefull in case of delete
+ * thus add of same initial type
+ */
+ private HashMap<String, TypeExtrait> typesDeleted;
- /**
- * Constructor
- */
- public ManageMethodeExtractionPage() {
- this(null);
- }
+ /**
+ * Constructor
+ */
+ public ManageMethodeExtractionPage() {
+ this(null);
+ }
- /**
- * Constructor. If idMethodeExtraction is null, creating a new methode, else editing the corresponding methode
- * @param idMethode The ID of the methode
- */
- public ManageMethodeExtractionPage(Integer idMethode) {
- super(ManageMethodeExtractionPage.class);
+ /**
+ * Constructor. If idMethodeExtraction is null, creating a new methode, else editing the corresponding methode
+ * @param idMethode The ID of the methode
+ */
+ public ManageMethodeExtractionPage(Integer idMethode) {
+ super(ManageMethodeExtractionPage.class);
- boolean createMode;
+ boolean createMode;
- typesDeleted = new HashMap<String, TypeExtrait>();
+ typesDeleted = new HashMap<String, TypeExtrait>();
- // model initialization
- newTypeExtraitModel = new Model<TypeExtrait>(new TypeExtrait());
- if (idMethode == null) {
- // creation mode
- methodeExtractionModel = new Model<MethodeExtraction>(new MethodeExtraction());
- createMode = true;
- } else {
- try {
- methodeExtractionModel = new Model<MethodeExtraction>(extraitService.loadMethodeExtraction(idMethode));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- createMode = false;
- }
+ // model initialization
+ newTypeExtraitModel = new Model<TypeExtrait>(new TypeExtrait());
+ if (idMethode == null) {
+ // creation mode
+ methodeExtractionModel = new Model<MethodeExtraction>(new MethodeExtraction());
+ createMode = true;
+ } else {
+ try {
+ methodeExtractionModel = new Model<MethodeExtraction>(extraitService.loadMethodeExtraction(idMethode));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ createMode = false;
+ }
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("MethodeExtraction.nom", new PropertyModel<String>(methodeExtractionModel,
- "nom")));
- formView.add(new TextArea<String>("MethodeExtraction.description", new PropertyModel<String>(
- methodeExtractionModel, "description")));
+ formView.add(new TextField<String>("MethodeExtraction.nom", new PropertyModel<String>(methodeExtractionModel,
+ "nom")));
+ formView.add(new TextArea<String>("MethodeExtraction.description", new PropertyModel<String>(
+ methodeExtractionModel, "description")));
- // Tableau des types en sortie
- final MarkupContainer typesEnSortieTable = new WebMarkupContainer("MethodeExtraction.typesEnSortie.Table");
- typesEnSortieTable.setOutputMarkupId(true);
+ // Tableau des types en sortie
+ final MarkupContainer typesEnSortieTable = new WebMarkupContainer("MethodeExtraction.typesEnSortie.Table");
+ typesEnSortieTable.setOutputMarkupId(true);
- // Liste des types extraits ajoutés
- typesEnSortieTable.add(new ListView<TypeExtrait>("MethodeExtraction.typesEnSortie.List",
- new PropertyModel<List<TypeExtrait>>(methodeExtractionModel, "sortedTypesEnSortie")) {
- @Override
- protected void populateItem(ListItem<TypeExtrait> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des types extraits ajoutés
+ typesEnSortieTable.add(new ListView<TypeExtrait>("MethodeExtraction.typesEnSortie.List",
+ new PropertyModel<List<TypeExtrait>>(methodeExtractionModel, "sortedTypesEnSortie")) {
+ @Override
+ protected void populateItem(ListItem<TypeExtrait> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final TypeExtrait typeExtrait = item.getModelObject();
- // Colonnes
- item.add(new Label("MethodeExtraction.typesEnSortie.List.initiales", new PropertyModel<String>(
- typeExtrait, "initiales")));
- item.add(new Label("MethodeExtraction.typesEnSortie.List.description", new PropertyModel<String>(
- typeExtrait, "description")));
+ final TypeExtrait typeExtrait = item.getModelObject();
+ // Colonnes
+ item.add(new Label("MethodeExtraction.typesEnSortie.List.initiales", new PropertyModel<String>(
+ typeExtrait, "initiales")));
+ item.add(new Label("MethodeExtraction.typesEnSortie.List.description", new PropertyModel<String>(
+ typeExtrait, "description")));
- // Action : suppression d'un type extrait
- Button deleteButton = new AjaxFallbackButton("MethodeExtraction.typesEnSortie.List.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- methodeExtractionModel.getObject().getTypesEnSortie().remove(typeExtrait);
- // keep the id of the deleted 'extrait' in case of new one with the same 'initiales'
- typesDeleted.put(typeExtrait.getInitiales(), typeExtrait);
+ // Action : suppression d'un type extrait
+ Button deleteButton = new AjaxFallbackButton("MethodeExtraction.typesEnSortie.List.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ methodeExtractionModel.getObject().getTypesEnSortie().remove(typeExtrait);
+ // keep the id of the deleted 'extrait' in case of new one with the same 'initiales'
+ typesDeleted.put(typeExtrait.getInitiales(), typeExtrait);
- if (target != null) {
- target.add(typesEnSortieTable);
- }
- }
+ if (target != null) {
+ target.add(typesEnSortieTable);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- final FormComponent<String> initialesInput = new TextField<String>("MethodeExtraction.typesEnSortie.initiales",
- new PropertyModel<String>(newTypeExtraitModel, "initiales"));
- typesEnSortieTable.add(initialesInput);
+ final FormComponent<String> initialesInput = new TextField<String>("MethodeExtraction.typesEnSortie.initiales",
+ new PropertyModel<String>(newTypeExtraitModel, "initiales"));
+ typesEnSortieTable.add(initialesInput);
- final FormComponent<String> descriptionInput = new TextField<String>(
- "MethodeExtraction.typesEnSortie.description", new PropertyModel<String>(newTypeExtraitModel,
- "description"));
- typesEnSortieTable.add(descriptionInput);
+ final FormComponent<String> descriptionInput = new TextField<String>(
+ "MethodeExtraction.typesEnSortie.description", new PropertyModel<String>(newTypeExtraitModel,
+ "description"));
+ typesEnSortieTable.add(descriptionInput);
- // Bouton AJAX pour ajouter un type extrait
- Button addButton = new AjaxFallbackButton("MethodeExtraction.typeEnSortie.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- try {
- // normalisation du type extrait
- newTypeExtraitModel.getObject().setInitiales(
- Normalizer.normalize(ConfigNameNormalizer.class, newTypeExtraitModel.getObject()
- .getInitiales()));
- // Ajout du type extrait
- newTypeExtraitModel.getObject().setMethodeExtraction(methodeExtractionModel.getObject());
- // recuperate the id if an just deleted type
- if (typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()) != null) {
- newTypeExtraitModel.getObject().setIdTypeExtrait(
- typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()).getIdTypeExtrait());
- }
+ // Bouton AJAX pour ajouter un type extrait
+ Button addButton = new AjaxFallbackButton("MethodeExtraction.typeEnSortie.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ // normalisation du type extrait
+ newTypeExtraitModel.getObject().setInitiales(
+ Normalizer.normalize(ConfigNameNormalizer.class, newTypeExtraitModel.getObject()
+ .getInitiales()));
+ // Ajout du type extrait
+ newTypeExtraitModel.getObject().setMethodeExtraction(methodeExtractionModel.getObject());
+ // recuperate the id if an just deleted type
+ if (typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()) != null) {
+ newTypeExtraitModel.getObject().setIdTypeExtrait(
+ typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()).getIdTypeExtrait());
+ }
- // ajout à la liste
- TypeExtrait typeExtraitAdded = newTypeExtraitModel.getObject().clone();
- methodeExtractionModel.getObject().getTypesEnSortie().add(typeExtraitAdded);
+ // ajout à la liste
+ TypeExtrait typeExtraitAdded = newTypeExtraitModel.getObject().clone();
+ methodeExtractionModel.getObject().getTypesEnSortie().add(typeExtraitAdded);
- List<String> errors = validator.validate(newTypeExtraitModel.getObject(), getSession().getLocale());
- if (errors.isEmpty()) {
- if (typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()) != null) {
- // si ancien extrait supprimé, on l'enlève de la liste des supprimés
- typesDeleted.remove(newTypeExtraitModel.getObject().getInitiales());
- }
+ List<String> errors = validator.validate(newTypeExtraitModel.getObject(), getSession().getLocale());
+ if (errors.isEmpty()) {
+ if (typesDeleted.get(newTypeExtraitModel.getObject().getInitiales()) != null) {
+ // si ancien extrait supprimé, on l'enlève de la liste des supprimés
+ typesDeleted.remove(newTypeExtraitModel.getObject().getInitiales());
+ }
- // réinit du champ ajout
- newTypeExtraitModel.getObject().setInitiales(null);
- newTypeExtraitModel.getObject().setDescription(null);
- } else {
- methodeExtractionModel.getObject().getTypesEnSortie().remove(typeExtraitAdded);
- addValidationErrors(errors);
- }
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // réinit du champ ajout
+ newTypeExtraitModel.getObject().setInitiales(null);
+ newTypeExtraitModel.getObject().setDescription(null);
+ } else {
+ methodeExtractionModel.getObject().getTypesEnSortie().remove(typeExtraitAdded);
+ addValidationErrors(errors);
+ }
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- if (target != null) {
- target.add(typesEnSortieTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(typesEnSortieTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- typesEnSortieTable.add(addButton);
+ };
+ typesEnSortieTable.add(addButton);
- // Action : create the methodeExtraction
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extraitService.createMethodeExtraction(methodeExtractionModel.getObject());
- }
+ // Action : create the methodeExtraction
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extraitService.createMethodeExtraction(methodeExtractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- formView.add(typesEnSortieTable);
+ formView.add(typesEnSortieTable);
- // Action : update the methodeExtraction
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extraitService.updateMethodeExtraction(methodeExtractionModel.getObject());
- }
+ // Action : update the methodeExtraction
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extraitService.updateMethodeExtraction(methodeExtractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extraitService.deleteMethodeExtraction(methodeExtractionModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extraitService.deleteMethodeExtraction(methodeExtractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
- formView.setDefaultButton(addButton);
- add(formView);
- }
+ formView.setDefaultButton(addButton);
+ add(formView);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(methodeExtractionModel.getObject(), getSession().getLocale()));
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(methodeExtractionModel.getObject(), getSession().getLocale()));
- // vérifie s'il existe des types supprimés qui sont tjr référencés
- for (TypeExtrait curDelType : typesDeleted.values()) {
- if (extraitService.isTypeExtraitReferenced(curDelType)) {
- getPage().error(
- getString("TypeExtrait.isReferenced",
- new Model<Serializable>(new Serializable[] { curDelType.getInitiales() })));
- }
- }
- }
+ // vérifie s'il existe des types supprimés qui sont tjr référencés
+ for (TypeExtrait curDelType : typesDeleted.values()) {
+ if (extraitService.isTypeExtraitReferenced(curDelType)) {
+ getPage().error(
+ getString("TypeExtrait.isReferenced",
+ new Model<Serializable>(new Serializable[] { curDelType.getInitiales() })));
+ }
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodePurificationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodePurificationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodePurificationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -71,287 +71,287 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManageMethodePurificationPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** The return page parameter (key and value) */
- final private String[] RETURN_PARAM = { "methodePurification", "opened" };
+ /** The return page parameter (key and value) */
+ final private String[] RETURN_PARAM = { "methodePurification", "opened" };
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** erreurTest Model */
- private final IModel<MethodePurification> methodePurificationModel;
+ /** erreurTest Model */
+ private final IModel<MethodePurification> methodePurificationModel;
- /** model for adding Parametre */
- private IModel<ParamMethoPuri> newParamModel;
+ /** model for adding Parametre */
+ private IModel<ParamMethoPuri> newParamModel;
- /** Service : purification */
- @SpringBean
- private PurificationService purificationService;
+ /** Service : purification */
+ @SpringBean
+ private PurificationService purificationService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * couple of <nom, param> in order to recuperate the id of the deleted parametre usefull in case of delete thus add
- * of same initial type
- */
- private HashMap<String, ParamMethoPuri> paramsDeleted;
+ /**
+ * couple of <nom, param> in order to recuperate the id of the deleted parametre usefull in case of delete thus add
+ * of same initial type
+ */
+ private HashMap<String, ParamMethoPuri> paramsDeleted;
- /**
- * Constructor
- */
- public ManageMethodePurificationPage() {
- this(null);
- }
+ /**
+ * Constructor
+ */
+ public ManageMethodePurificationPage() {
+ this(null);
+ }
- /**
- * Constructor. If idMethodePurification is null, creating a new methode, else editing the corresponding methode
- * @param idMethode The ID of the methode
- */
- public ManageMethodePurificationPage(Integer idMethode) {
- super(ManageMethodePurificationPage.class);
+ /**
+ * Constructor. If idMethodePurification is null, creating a new methode, else editing the corresponding methode
+ * @param idMethode The ID of the methode
+ */
+ public ManageMethodePurificationPage(Integer idMethode) {
+ super(ManageMethodePurificationPage.class);
- boolean createMode;
+ boolean createMode;
- paramsDeleted = new HashMap<String, ParamMethoPuri>();
+ paramsDeleted = new HashMap<String, ParamMethoPuri>();
- // model initialization
- newParamModel = new Model<ParamMethoPuri>(new ParamMethoPuri());
- if (idMethode == null) {
- // creation mode
- methodePurificationModel = new Model<MethodePurification>(new MethodePurification());
- createMode = true;
- } else {
- try {
- methodePurificationModel = new Model<MethodePurification>(
- purificationService.loadMethodePurification(idMethode));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- createMode = false;
- }
+ // model initialization
+ newParamModel = new Model<ParamMethoPuri>(new ParamMethoPuri());
+ if (idMethode == null) {
+ // creation mode
+ methodePurificationModel = new Model<MethodePurification>(new MethodePurification());
+ createMode = true;
+ } else {
+ try {
+ methodePurificationModel = new Model<MethodePurification>(
+ purificationService.loadMethodePurification(idMethode));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ createMode = false;
+ }
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("MethodePurification.nom", new PropertyModel<String>(
- methodePurificationModel, "nom")));
- formView.add(new TextArea<String>("MethodePurification.description", new PropertyModel<String>(
- methodePurificationModel, "description")));
+ formView.add(new TextField<String>("MethodePurification.nom", new PropertyModel<String>(
+ methodePurificationModel, "nom")));
+ formView.add(new TextArea<String>("MethodePurification.description", new PropertyModel<String>(
+ methodePurificationModel, "description")));
- // Tableau des types en sortie
- final MarkupContainer typesEnSortieTable = new WebMarkupContainer("MethodePurification.parametres.Table");
- typesEnSortieTable.setOutputMarkupId(true);
+ // Tableau des types en sortie
+ final MarkupContainer typesEnSortieTable = new WebMarkupContainer("MethodePurification.parametres.Table");
+ typesEnSortieTable.setOutputMarkupId(true);
- // Liste des types extraits ajoutés
- typesEnSortieTable.add(new ListView<ParamMethoPuri>("MethodePurification.parametres.List",
- new PropertyModel<List<ParamMethoPuri>>(methodePurificationModel, "sortedParametres")) {
- @Override
- protected void populateItem(final ListItem<ParamMethoPuri> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des types extraits ajoutés
+ typesEnSortieTable.add(new ListView<ParamMethoPuri>("MethodePurification.parametres.List",
+ new PropertyModel<List<ParamMethoPuri>>(methodePurificationModel, "sortedParametres")) {
+ @Override
+ protected void populateItem(final ListItem<ParamMethoPuri> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final ParamMethoPuri param = item.getModelObject();
- // Colonnes
- item.add(new Label("MethodePurification.parametres.List.nom", new PropertyModel<String>(param, "nom")));
- item.add(new Label("MethodePurification.parametres.List.description", new PropertyModel<String>(param,
- "description")));
- item.add(new Label("MethodePurification.parametres.List.index", new PropertyModel<String>(param,
- "index")));
+ final ParamMethoPuri param = item.getModelObject();
+ // Colonnes
+ item.add(new Label("MethodePurification.parametres.List.nom", new PropertyModel<String>(param, "nom")));
+ item.add(new Label("MethodePurification.parametres.List.description", new PropertyModel<String>(param,
+ "description")));
+ item.add(new Label("MethodePurification.parametres.List.index", new PropertyModel<String>(param,
+ "index")));
- // Action : suppression d'un type extrait
- Button deleteButton = new AjaxFallbackButton("MethodePurification.parametres.List.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- methodePurificationModel.getObject().getParametres().remove(param);
- // keep the id of the deleted 'extrait' in case of new one with the same 'initiales'
- paramsDeleted.put(param.getNom(), param);
- if (target != null) {
- target.add(typesEnSortieTable);
- }
- }
+ // Action : suppression d'un type extrait
+ Button deleteButton = new AjaxFallbackButton("MethodePurification.parametres.List.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ methodePurificationModel.getObject().getParametres().remove(param);
+ // keep the id of the deleted 'extrait' in case of new one with the same 'initiales'
+ paramsDeleted.put(param.getNom(), param);
+ if (target != null) {
+ target.add(typesEnSortieTable);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- final FormComponent<String> nomParamInput = new TextField<String>("MethodePurification.parametres.nom",
- new PropertyModel<String>(newParamModel, "nom"));
- typesEnSortieTable.add(nomParamInput);
+ final FormComponent<String> nomParamInput = new TextField<String>("MethodePurification.parametres.nom",
+ new PropertyModel<String>(newParamModel, "nom"));
+ typesEnSortieTable.add(nomParamInput);
- final FormComponent<String> descriptionParamInput = new TextField<String>(
- "MethodePurification.parametres.description", new PropertyModel<String>(newParamModel, "description"));
- typesEnSortieTable.add(descriptionParamInput);
+ final FormComponent<String> descriptionParamInput = new TextField<String>(
+ "MethodePurification.parametres.description", new PropertyModel<String>(newParamModel, "description"));
+ typesEnSortieTable.add(descriptionParamInput);
- final FormComponent<String> indexParamInput = new TextField<String>("MethodePurification.parametres.index",
- new PropertyModel<String>(newParamModel, "index"));
- typesEnSortieTable.add(indexParamInput);
+ final FormComponent<String> indexParamInput = new TextField<String>("MethodePurification.parametres.index",
+ new PropertyModel<String>(newParamModel, "index"));
+ typesEnSortieTable.add(indexParamInput);
- // Bouton AJAX pour ajouter un type extrait
- Button addButton = new AjaxFallbackButton("MethodePurification.parametres.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- try {
- // normalisation du type extrait
- newParamModel.getObject().setNom(
- Normalizer.normalize(ConfigNameNormalizer.class, newParamModel.getObject().getNom()));
- // Ajout du type extrait
- newParamModel.getObject().setMethodePurification(methodePurificationModel.getObject());
- // recuperate the id if an just deleted type
- if (paramsDeleted.get(newParamModel.getObject().getNom()) != null) {
- newParamModel.getObject().setIdParamMethoPuri(
- paramsDeleted.get(newParamModel.getObject().getNom()).getIdParamMethoPuri());
- }
+ // Bouton AJAX pour ajouter un type extrait
+ Button addButton = new AjaxFallbackButton("MethodePurification.parametres.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ // normalisation du type extrait
+ newParamModel.getObject().setNom(
+ Normalizer.normalize(ConfigNameNormalizer.class, newParamModel.getObject().getNom()));
+ // Ajout du type extrait
+ newParamModel.getObject().setMethodePurification(methodePurificationModel.getObject());
+ // recuperate the id if an just deleted type
+ if (paramsDeleted.get(newParamModel.getObject().getNom()) != null) {
+ newParamModel.getObject().setIdParamMethoPuri(
+ paramsDeleted.get(newParamModel.getObject().getNom()).getIdParamMethoPuri());
+ }
- // ajout à la liste
- ParamMethoPuri paramAdded = newParamModel.getObject().clone();
- methodePurificationModel.getObject().getParametres().add(paramAdded);
+ // ajout à la liste
+ ParamMethoPuri paramAdded = newParamModel.getObject().clone();
+ methodePurificationModel.getObject().getParametres().add(paramAdded);
- List<String> errors = validator.validate(newParamModel.getObject(), getSession().getLocale());
- if (errors.isEmpty()) {
- if (paramsDeleted.get(newParamModel.getObject().getNom()) != null) {
- // si ancien extrait supprimé, on l'enlève de la liste des supprimés
- paramsDeleted.remove(newParamModel.getObject().getNom());
- }
- // réinit du champ ajout
- newParamModel.getObject().setNom(null);
- newParamModel.getObject().setDescription(null);
- } else {
- methodePurificationModel.getObject().getParametres().remove(paramAdded);
- addValidationErrors(errors);
- }
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ List<String> errors = validator.validate(newParamModel.getObject(), getSession().getLocale());
+ if (errors.isEmpty()) {
+ if (paramsDeleted.get(newParamModel.getObject().getNom()) != null) {
+ // si ancien extrait supprimé, on l'enlève de la liste des supprimés
+ paramsDeleted.remove(newParamModel.getObject().getNom());
+ }
+ // réinit du champ ajout
+ newParamModel.getObject().setNom(null);
+ newParamModel.getObject().setDescription(null);
+ } else {
+ methodePurificationModel.getObject().getParametres().remove(paramAdded);
+ addValidationErrors(errors);
+ }
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- if (target != null) {
- target.add(typesEnSortieTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(typesEnSortieTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- typesEnSortieTable.add(addButton);
+ };
+ typesEnSortieTable.add(addButton);
- // Action : create the methodePurification
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.createMethodePurification(methodePurificationModel.getObject());
- }
+ // Action : create the methodePurification
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.createMethodePurification(methodePurificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- formView.add(typesEnSortieTable);
+ formView.add(typesEnSortieTable);
- // Action : update the methodePurificationModel
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.updateMethodePurification(methodePurificationModel.getObject());
- }
+ // Action : update the methodePurificationModel
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.updateMethodePurification(methodePurificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.deleteMethodePurification(methodePurificationModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.deleteMethodePurification(methodePurificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
- formView.setDefaultButton(addButton);
- add(formView);
- }
+ formView.setDefaultButton(addButton);
+ add(formView);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(methodePurificationModel.getObject(), getSession().getLocale()));
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(methodePurificationModel.getObject(), getSession().getLocale()));
- // vérifie s'il existe des paramètres supprimés qui sont tjr référencés
- for (ParamMethoPuri curDelParam : paramsDeleted.values()) {
- if (purificationService.isParamMethoPuriReferenced(curDelParam)) {
- getPage().error(
- getString("ParamMethoPuri.isReferenced", new Model<Serializable>(
- new Serializable[] { curDelParam.getNom() })));
- }
- }
- }
+ // vérifie s'il existe des paramètres supprimés qui sont tjr référencés
+ for (ParamMethoPuri curDelParam : paramsDeleted.values()) {
+ if (purificationService.isParamMethoPuriReferenced(curDelParam)) {
+ getPage().error(
+ getString("ParamMethoPuri.isReferenced", new Model<Serializable>(
+ new Serializable[] { curDelParam.getNom() })));
+ }
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeTestBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeTestBioPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManageMethodeTestBioPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -59,166 +59,166 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManageMethodeTestBioPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** The return page parameter (key and value) */
- final private String[] RETURN_PARAM = { "methodeTestBio", "opened" };
+ /** The return page parameter (key and value) */
+ final private String[] RETURN_PARAM = { "methodeTestBio", "opened" };
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** erreurTest Model */
- private final IModel<MethodeTestBio> methodeTestModel;
+ /** erreurTest Model */
+ private final IModel<MethodeTestBio> methodeTestModel;
- /** Service : test (for erreurs) */
- @SpringBean
- private TestBioService testService;
+ /** Service : test (for erreurs) */
+ @SpringBean
+ private TestBioService testService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructor
- */
- public ManageMethodeTestBioPage() {
- this(null);
- }
+ /**
+ * Constructor
+ */
+ public ManageMethodeTestBioPage() {
+ this(null);
+ }
- /**
- * Constructor. If idMethodeTest is null, creating a new methode, else editing the corresponding methode
- * @param idMethodeTest The ID of the methode
- */
- public ManageMethodeTestBioPage(Integer idMethodeTest) {
- super(ManageMethodeTestBioPage.class);
+ /**
+ * Constructor. If idMethodeTest is null, creating a new methode, else editing the corresponding methode
+ * @param idMethodeTest The ID of the methode
+ */
+ public ManageMethodeTestBioPage(Integer idMethodeTest) {
+ super(ManageMethodeTestBioPage.class);
- boolean createMode;
+ boolean createMode;
- // model initialization
- if (idMethodeTest == null) {
- // creation mode
- methodeTestModel = new Model<MethodeTestBio>(new MethodeTestBio());
- createMode = true;
- } else {
- try {
- methodeTestModel = new Model<MethodeTestBio>(testService.loadMethodeTest(idMethodeTest));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- createMode = false;
- }
+ // model initialization
+ if (idMethodeTest == null) {
+ // creation mode
+ methodeTestModel = new Model<MethodeTestBio>(new MethodeTestBio());
+ createMode = true;
+ } else {
+ try {
+ methodeTestModel = new Model<MethodeTestBio>(testService.loadMethodeTest(idMethodeTest));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ createMode = false;
+ }
- // Initialisation des liste (pour le AutoCompleteTextField)
- // liste des valeurs déjà existantes pour la propriété correspondante
- List<String> domaines = testService.listDomainesMethodes();
- List<String> unites = testService.listUnitesResultatMethodes();
+ // Initialisation des liste (pour le AutoCompleteTextField)
+ // liste des valeurs déjà existantes pour la propriété correspondante
+ List<String> domaines = testService.listDomainesMethodes();
+ List<String> unites = testService.listUnitesResultatMethodes();
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("MethodeTestBio.nom", new PropertyModel<String>(methodeTestModel, "nom")));
- formView.add(new TextField<String>("MethodeTestBio.cible", new PropertyModel<String>(methodeTestModel, "cible")));
- formView.add(new AutoCompleteTextFieldString("MethodeTestBio.domaine", new PropertyModel<String>(
- methodeTestModel, "domaine"), domaines, ComparisonMode.CONTAINS));
- formView.add(new TextArea<String>("MethodeTestBio.description", new PropertyModel<String>(methodeTestModel,
- "description")));
- formView.add(new TextField<String>("MethodeTestBio.valeurMesuree", new PropertyModel<String>(methodeTestModel,
- "valeurMesuree")));
- formView.add(new AutoCompleteTextFieldString("MethodeTestBio.uniteResultat", new PropertyModel<String>(
- methodeTestModel, "uniteResultat"), unites, ComparisonMode.STARTS_WITH));
- formView.add(new TextField<String>("MethodeTestBio.critereActivite", new PropertyModel<String>(
- methodeTestModel, "critereActivite")));
+ formView.add(new TextField<String>("MethodeTestBio.nom", new PropertyModel<String>(methodeTestModel, "nom")));
+ formView.add(new TextField<String>("MethodeTestBio.cible", new PropertyModel<String>(methodeTestModel, "cible")));
+ formView.add(new AutoCompleteTextFieldString("MethodeTestBio.domaine", new PropertyModel<String>(
+ methodeTestModel, "domaine"), domaines, ComparisonMode.CONTAINS));
+ formView.add(new TextArea<String>("MethodeTestBio.description", new PropertyModel<String>(methodeTestModel,
+ "description")));
+ formView.add(new TextField<String>("MethodeTestBio.valeurMesuree", new PropertyModel<String>(methodeTestModel,
+ "valeurMesuree")));
+ formView.add(new AutoCompleteTextFieldString("MethodeTestBio.uniteResultat", new PropertyModel<String>(
+ methodeTestModel, "uniteResultat"), unites, ComparisonMode.STARTS_WITH));
+ formView.add(new TextField<String>("MethodeTestBio.critereActivite", new PropertyModel<String>(
+ methodeTestModel, "critereActivite")));
- // Action : create the methodeTest
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.createMethodeTestBio(methodeTestModel.getObject());
- }
+ // Action : create the methodeTest
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.createMethodeTestBio(methodeTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the methodeTest
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.updateMethodeTest(methodeTestModel.getObject());
- }
+ // Action : update the methodeTest
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.updateMethodeTest(methodeTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testService.deleteMethodeTestBio(methodeTestModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testService.deleteMethodeTestBio(methodeTestModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(methodeTestModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(methodeTestModel.getObject(), getSession().getLocale()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManagePartiePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManagePartiePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/ManagePartiePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -55,150 +55,150 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManagePartiePage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** The return page parameter (key and value) */
- final private String[] RETURN_PARAM = { "partie", "opened" };
+ /** The return page parameter (key and value) */
+ final private String[] RETURN_PARAM = { "partie", "opened" };
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** partie Model */
- private final IModel<Partie> partieModel;
+ /** partie Model */
+ private final IModel<Partie> partieModel;
- /** Service : lot (for parties) */
- @SpringBean
- private LotService lotService;
+ /** Service : lot (for parties) */
+ @SpringBean
+ private LotService lotService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructor
- */
- public ManagePartiePage() {
- this(null);
- }
+ /**
+ * Constructor
+ */
+ public ManagePartiePage() {
+ this(null);
+ }
- /**
- * Constructor. If idPartie is null, creating a new partie, else editing the corresponding partie
- * @param idPartie The ID of the partie
- */
- public ManagePartiePage(Integer idPartie) {
- super(ManagePartiePage.class);
+ /**
+ * Constructor. If idPartie is null, creating a new partie, else editing the corresponding partie
+ * @param idPartie The ID of the partie
+ */
+ public ManagePartiePage(Integer idPartie) {
+ super(ManagePartiePage.class);
- boolean createMode;
+ boolean createMode;
- // model initialization
- if (idPartie == null) {
- // creation mode
- partieModel = new Model<Partie>(new Partie());
- createMode = true;
- } else {
- try {
- partieModel = new Model<Partie>(lotService.loadPartie(idPartie));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- createMode = false;
- }
+ // model initialization
+ if (idPartie == null) {
+ // creation mode
+ partieModel = new Model<Partie>(new Partie());
+ createMode = true;
+ } else {
+ try {
+ partieModel = new Model<Partie>(lotService.loadPartie(idPartie));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ createMode = false;
+ }
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("Partie.nom", new PropertyModel<String>(partieModel, "nom")));
+ formView.add(new TextField<String>("Partie.nom", new PropertyModel<String>(partieModel, "nom")));
- // Action : create the partie
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.createPartie(partieModel.getObject());
- }
+ // Action : create the partie
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.createPartie(partieModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the partie
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.updatePartie(partieModel.getObject());
- }
+ // Action : update the partie
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.updatePartie(partieModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression de la personne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.deletePartie(partieModel.getObject());
- }
+ // Action : suppression de la personne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.deletePartie(partieModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- PageParameters params = new PageParameters();
- params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
- setResponsePage(ListConfigurationPage.class, params);
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ PageParameters params = new PageParameters();
+ params.add(RETURN_PARAM[0], RETURN_PARAM[1]);
+ setResponsePage(ListConfigurationPage.class, params);
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(partieModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(partieModel.getObject(), getSession().getLocale()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListErreurTestBioPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListErreurTestBioPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListErreurTestBioPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,57 +49,57 @@
*/
public class ListErreurTestBioPanel extends Panel {
- /** Service : test */
- @SpringBean
- private TestBioService testService;
+ /** Service : test */
+ @SpringBean
+ private TestBioService testService;
- /**
- * Constructor
- * @param id The panel ID
- */
- public ListErreurTestBioPanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public ListErreurTestBioPanel(String id) {
+ super(id);
- add(new BookmarkablePageLink<Void>("ListErreurTestBioPanel.NewErreurTestBio", ManageErreurTestBioPage.class));
+ add(new BookmarkablePageLink<Void>("ListErreurTestBioPanel.NewErreurTestBio", ManageErreurTestBioPage.class));
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer erreursTestRefresh = new WebMarkupContainer(
- "ListErreurTestBioPanel.ErreursTestBio.Refresh");
- erreursTestRefresh.setOutputMarkupId(true);
- add(erreursTestRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer erreursTestRefresh = new WebMarkupContainer(
+ "ListErreurTestBioPanel.ErreursTestBio.Refresh");
+ erreursTestRefresh.setOutputMarkupId(true);
+ add(erreursTestRefresh);
- // Liste des erreursTest
- final List<ErreurTestBio> erreurTest = testService.listErreursTestBio();
- LoadableDetachableSortableListDataProvider<ErreurTestBio> erreursDataProvider = new LoadableDetachableSortableListDataProvider<ErreurTestBio>(
- erreurTest, getSession().getLocale());
+ // Liste des erreursTest
+ final List<ErreurTestBio> erreurTest = testService.listErreursTestBio();
+ LoadableDetachableSortableListDataProvider<ErreurTestBio> erreursDataProvider = new LoadableDetachableSortableListDataProvider<ErreurTestBio>(
+ erreurTest, getSession().getLocale());
- erreursTestRefresh
- .add(new DataView<ErreurTestBio>("ListErreurTestBioPanel.ErreursTestBio", erreursDataProvider) {
- @Override
- protected void populateItem(Item<ErreurTestBio> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ erreursTestRefresh
+ .add(new DataView<ErreurTestBio>("ListErreurTestBioPanel.ErreursTestBio", erreursDataProvider) {
+ @Override
+ protected void populateItem(Item<ErreurTestBio> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- ErreurTestBio erreurTest = item.getModelObject();
- // Colonnes
- item.add(new Label("ListErreurTestBioPanel.ErreursTestBio.nom", new PropertyModel<String>(
- erreurTest, "nom")));
- item.add(new Label("ListErreurTestBioPanel.ErreursTestBio.description",
- new PropertyModel<String>(erreurTest, "description")));
+ ErreurTestBio erreurTest = item.getModelObject();
+ // Colonnes
+ item.add(new Label("ListErreurTestBioPanel.ErreursTestBio.nom", new PropertyModel<String>(
+ erreurTest, "nom")));
+ item.add(new Label("ListErreurTestBioPanel.ErreursTestBio.description",
+ new PropertyModel<String>(erreurTest, "description")));
- // Action : mise à jour (redirection vers le formulaire)
- Link<ErreurTestBio> updateLink = new Link<ErreurTestBio>(
- "ListErreurTestBioPanel.ErreursTestBio.Update", new Model<ErreurTestBio>(erreurTest)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageErreurTestBioPage(getModelObject().getIdErreurTest()));
- }
- };
- item.add(updateLink);
- }
- });
- }
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<ErreurTestBio> updateLink = new Link<ErreurTestBio>(
+ "ListErreurTestBioPanel.ErreursTestBio.Update", new Model<ErreurTestBio>(erreurTest)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageErreurTestBioPage(getModelObject().getIdErreurTest()));
+ }
+ };
+ item.add(updateLink);
+ }
+ });
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeExtractionPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeExtractionPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeExtractionPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -50,64 +50,64 @@
*/
public class ListMethodeExtractionPanel extends Panel {
- /** Service : extrait */
- @SpringBean
- private ExtractionService extraitService;
+ /** Service : extrait */
+ @SpringBean
+ private ExtractionService extraitService;
- /**
- * Constructor
- * @param id The panel ID
- */
- public ListMethodeExtractionPanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public ListMethodeExtractionPanel(String id) {
+ super(id);
- add(new BookmarkablePageLink<Void>("ListMethodeExtractionPanel.NewMethodeExtraction",
- ManageMethodeExtractionPage.class));
+ add(new BookmarkablePageLink<Void>("ListMethodeExtractionPanel.NewMethodeExtraction",
+ ManageMethodeExtractionPage.class));
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer methodesExtractionRefresh = new WebMarkupContainer(
- "ListMethodeExtractionPanel.MethodesExtraction.Refresh");
- methodesExtractionRefresh.setOutputMarkupId(true);
- add(methodesExtractionRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer methodesExtractionRefresh = new WebMarkupContainer(
+ "ListMethodeExtractionPanel.MethodesExtraction.Refresh");
+ methodesExtractionRefresh.setOutputMarkupId(true);
+ add(methodesExtractionRefresh);
- // Liste des methodesExtraction
- final List<MethodeExtraction> methodesExtraction = extraitService.listMethodesExtraction();
- LoadableDetachableSortableListDataProvider<MethodeExtraction> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodeExtraction>(
- methodesExtraction, getSession().getLocale());
+ // Liste des methodesExtraction
+ final List<MethodeExtraction> methodesExtraction = extraitService.listMethodesExtraction();
+ LoadableDetachableSortableListDataProvider<MethodeExtraction> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodeExtraction>(
+ methodesExtraction, getSession().getLocale());
- methodesExtractionRefresh.add(new DataView<MethodeExtraction>("ListMethodeExtractionPanel.MethodesExtraction",
- methodesDataProvider) {
- @Override
- protected void populateItem(Item<MethodeExtraction> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ methodesExtractionRefresh.add(new DataView<MethodeExtraction>("ListMethodeExtractionPanel.MethodesExtraction",
+ methodesDataProvider) {
+ @Override
+ protected void populateItem(Item<MethodeExtraction> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- MethodeExtraction methodeExtraction = item.getModelObject();
- // Refresh the methodeExtraction for Ajax refreshes (typesEnSorties is LAZY and session different from
- // the one used for the init)
- extraitService.refreshMethodeExtraction(methodeExtraction);
- // Colonnes
- item.add(new Label("ListMethodeExtractionPanel.MethodesExtraction.nom", new PropertyModel<String>(
- methodeExtraction, "nom")));
- item.add(new MultiLineLabel("ListMethodeExtractionPanel.MethodesExtraction.description",
- new PropertyModel<String>(methodeExtraction, "description")));
- item.add(new Label("ListMethodeExtractionPanel.MethodesExtraction.typesEnSortie", StringUtils.join(
- methodeExtraction.getSortedTypesEnSortie(), ", ")));
+ MethodeExtraction methodeExtraction = item.getModelObject();
+ // Refresh the methodeExtraction for Ajax refreshes (typesEnSorties is LAZY and session different from
+ // the one used for the init)
+ extraitService.refreshMethodeExtraction(methodeExtraction);
+ // Colonnes
+ item.add(new Label("ListMethodeExtractionPanel.MethodesExtraction.nom", new PropertyModel<String>(
+ methodeExtraction, "nom")));
+ item.add(new MultiLineLabel("ListMethodeExtractionPanel.MethodesExtraction.description",
+ new PropertyModel<String>(methodeExtraction, "description")));
+ item.add(new Label("ListMethodeExtractionPanel.MethodesExtraction.typesEnSortie", StringUtils.join(
+ methodeExtraction.getSortedTypesEnSortie(), ", ")));
- // Action : mise à jour (redirection vers le formulaire)
- Link<MethodeExtraction> updateLink = new Link<MethodeExtraction>(
- "ListMethodeExtractionPanel.MethodesExtraction.Update", new Model<MethodeExtraction>(
- methodeExtraction)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageMethodeExtractionPage(getModelObject().getIdMethodeExtraction()));
- }
- };
- item.add(updateLink);
- }
- });
- }
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<MethodeExtraction> updateLink = new Link<MethodeExtraction>(
+ "ListMethodeExtractionPanel.MethodesExtraction.Update", new Model<MethodeExtraction>(
+ methodeExtraction)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageMethodeExtractionPage(getModelObject().getIdMethodeExtraction()));
+ }
+ };
+ item.add(updateLink);
+ }
+ });
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodePurificationPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodePurificationPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodePurificationPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,65 +49,65 @@
*/
public class ListMethodePurificationPanel extends Panel {
- /** Service : purification */
- @SpringBean
- private PurificationService purificationService;
+ /** Service : purification */
+ @SpringBean
+ private PurificationService purificationService;
- /**
- * Constructor
- * @param id The panel ID
- */
- public ListMethodePurificationPanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public ListMethodePurificationPanel(String id) {
+ super(id);
- add(new BookmarkablePageLink<Void>("ListMethodePurificationPanel.NewMethodePurification",
- ManageMethodePurificationPage.class));
+ add(new BookmarkablePageLink<Void>("ListMethodePurificationPanel.NewMethodePurification",
+ ManageMethodePurificationPage.class));
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer methodesPurificationRefresh = new WebMarkupContainer(
- "ListMethodePurificationPanel.MethodesPurification.Refresh");
- methodesPurificationRefresh.setOutputMarkupId(true);
- add(methodesPurificationRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer methodesPurificationRefresh = new WebMarkupContainer(
+ "ListMethodePurificationPanel.MethodesPurification.Refresh");
+ methodesPurificationRefresh.setOutputMarkupId(true);
+ add(methodesPurificationRefresh);
- // Liste des methodesPurification
- final List<MethodePurification> methodesPurification = purificationService.listMethodesPurification();
- LoadableDetachableSortableListDataProvider<MethodePurification> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodePurification>(
- methodesPurification, getSession().getLocale());
+ // Liste des methodesPurification
+ final List<MethodePurification> methodesPurification = purificationService.listMethodesPurification();
+ LoadableDetachableSortableListDataProvider<MethodePurification> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodePurification>(
+ methodesPurification, getSession().getLocale());
- methodesPurificationRefresh.add(new DataView<MethodePurification>(
- "ListMethodePurificationPanel.MethodesPurification", methodesDataProvider) {
- @Override
- protected void populateItem(Item<MethodePurification> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ methodesPurificationRefresh.add(new DataView<MethodePurification>(
+ "ListMethodePurificationPanel.MethodesPurification", methodesDataProvider) {
+ @Override
+ protected void populateItem(Item<MethodePurification> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- MethodePurification methodePurification = item.getModelObject();
- // Refresh the methodePurification for Ajax refreshes (parametres is LAZY and session different from
- // the one used for the init)
- purificationService.refreshMethodePurification(methodePurification);
- // Colonnes
- item.add(new Label("ListMethodePurificationPanel.MethodesPurification.nom", methodePurification
- .getNom()));
- item.add(new MultiLineLabel("ListMethodePurificationPanel.MethodesPurification.description",
- methodePurification.getDescription()));
- item.add(new Label("ListMethodePurificationPanel.MethodesPurification.parametres", StringUtils.join(
- methodePurification.getParametres(), ", ")));
+ MethodePurification methodePurification = item.getModelObject();
+ // Refresh the methodePurification for Ajax refreshes (parametres is LAZY and session different from
+ // the one used for the init)
+ purificationService.refreshMethodePurification(methodePurification);
+ // Colonnes
+ item.add(new Label("ListMethodePurificationPanel.MethodesPurification.nom", methodePurification
+ .getNom()));
+ item.add(new MultiLineLabel("ListMethodePurificationPanel.MethodesPurification.description",
+ methodePurification.getDescription()));
+ item.add(new Label("ListMethodePurificationPanel.MethodesPurification.parametres", StringUtils.join(
+ methodePurification.getParametres(), ", ")));
- // Action : mise à jour (redirection vers le formulaire)
- Link<MethodePurification> updateLink = new Link<MethodePurification>(
- "ListMethodePurificationPanel.MethodesPurification.Update", new Model<MethodePurification>(
- methodePurification)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageMethodePurificationPage(getModelObject().getIdMethodePurification()));
- }
- };
- item.add(updateLink);
- }
- });
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<MethodePurification> updateLink = new Link<MethodePurification>(
+ "ListMethodePurificationPanel.MethodesPurification.Update", new Model<MethodePurification>(
+ methodePurification)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageMethodePurificationPage(getModelObject().getIdMethodePurification()));
+ }
+ };
+ item.add(updateLink);
+ }
+ });
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeTestBioPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeTestBioPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListMethodeTestBioPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,68 +49,68 @@
*/
public class ListMethodeTestBioPanel extends Panel {
- /** Service : test */
- @SpringBean
- private TestBioService testService;
+ /** Service : test */
+ @SpringBean
+ private TestBioService testService;
- /**
- * Constructor
- * @param id The panel ID
- */
- public ListMethodeTestBioPanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public ListMethodeTestBioPanel(String id) {
+ super(id);
- add(new BookmarkablePageLink<Void>("ListMethodeTestBioPanel.NewMethodeTestBio", ManageMethodeTestBioPage.class));
+ add(new BookmarkablePageLink<Void>("ListMethodeTestBioPanel.NewMethodeTestBio", ManageMethodeTestBioPage.class));
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer methodesTestRefresh = new WebMarkupContainer(
- "ListMethodeTestBioPanel.MethodesTestBio.Refresh");
- methodesTestRefresh.setOutputMarkupId(true);
- add(methodesTestRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer methodesTestRefresh = new WebMarkupContainer(
+ "ListMethodeTestBioPanel.MethodesTestBio.Refresh");
+ methodesTestRefresh.setOutputMarkupId(true);
+ add(methodesTestRefresh);
- // Liste des methodesTest
- final List<MethodeTestBio> methodesTest = testService.listMethodesTestBio();
- LoadableDetachableSortableListDataProvider<MethodeTestBio> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodeTestBio>(
- methodesTest, getSession().getLocale());
+ // Liste des methodesTest
+ final List<MethodeTestBio> methodesTest = testService.listMethodesTestBio();
+ LoadableDetachableSortableListDataProvider<MethodeTestBio> methodesDataProvider = new LoadableDetachableSortableListDataProvider<MethodeTestBio>(
+ methodesTest, getSession().getLocale());
- methodesTestRefresh.add(new DataView<MethodeTestBio>("ListMethodeTestBioPanel.MethodesTestBio",
- methodesDataProvider) {
- @Override
- protected void populateItem(Item<MethodeTestBio> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ methodesTestRefresh.add(new DataView<MethodeTestBio>("ListMethodeTestBioPanel.MethodesTestBio",
+ methodesDataProvider) {
+ @Override
+ protected void populateItem(Item<MethodeTestBio> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- MethodeTestBio methodeExtraction = item.getModelObject();
+ MethodeTestBio methodeExtraction = item.getModelObject();
- // Colonnes
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.nom", new PropertyModel<String>(
- methodeExtraction, "nom")));
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.cible", new PropertyModel<String>(
- methodeExtraction, "cible")));
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.domaine", new PropertyModel<String>(
- methodeExtraction, "domaine")));
- item.add(new MultiLineLabel("ListMethodeTestBioPanel.MethodesTestBio.description",
- new PropertyModel<String>(methodeExtraction, "description")));
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.valeurMesuree", new PropertyModel<String>(
- methodeExtraction, "valeurMesuree")));
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.uniteResultat", new PropertyModel<String>(
- methodeExtraction, "uniteResultat")));
- item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.critereActivite",
- new PropertyModel<String>(methodeExtraction, "critereActivite")));
+ // Colonnes
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.nom", new PropertyModel<String>(
+ methodeExtraction, "nom")));
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.cible", new PropertyModel<String>(
+ methodeExtraction, "cible")));
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.domaine", new PropertyModel<String>(
+ methodeExtraction, "domaine")));
+ item.add(new MultiLineLabel("ListMethodeTestBioPanel.MethodesTestBio.description",
+ new PropertyModel<String>(methodeExtraction, "description")));
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.valeurMesuree", new PropertyModel<String>(
+ methodeExtraction, "valeurMesuree")));
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.uniteResultat", new PropertyModel<String>(
+ methodeExtraction, "uniteResultat")));
+ item.add(new Label("ListMethodeTestBioPanel.MethodesTestBio.critereActivite",
+ new PropertyModel<String>(methodeExtraction, "critereActivite")));
- // Action : mise à jour (redirection vers le formulaire)
- Link<MethodeTestBio> updateLink = new Link<MethodeTestBio>(
- "ListMethodeTestBioPanel.MethodesTestBio.Update", new Model<MethodeTestBio>(methodeExtraction)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageMethodeTestBioPage(getModelObject().getIdMethodeTest()));
- }
- };
- item.add(updateLink);
- }
- });
- }
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<MethodeTestBio> updateLink = new Link<MethodeTestBio>(
+ "ListMethodeTestBioPanel.MethodesTestBio.Update", new Model<MethodeTestBio>(methodeExtraction)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageMethodeTestBioPage(getModelObject().getIdMethodeTest()));
+ }
+ };
+ item.add(updateLink);
+ }
+ });
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListPartiePanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListPartiePanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/ListPartiePanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -49,51 +49,51 @@
*/
public class ListPartiePanel extends Panel {
- /** Service : lot */
- @SpringBean
- private LotService lotService;
+ /** Service : lot */
+ @SpringBean
+ private LotService lotService;
- /**
- * Constructor
- * @param id The panel ID
- */
- public ListPartiePanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public ListPartiePanel(String id) {
+ super(id);
- add(new BookmarkablePageLink<Void>("ListPartiePanel.NewPartie", ManagePartiePage.class));
+ add(new BookmarkablePageLink<Void>("ListPartiePanel.NewPartie", ManagePartiePage.class));
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer partiesRefresh = new WebMarkupContainer("ListPartiePanel.Parties.Refresh");
- partiesRefresh.setOutputMarkupId(true);
- add(partiesRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer partiesRefresh = new WebMarkupContainer("ListPartiePanel.Parties.Refresh");
+ partiesRefresh.setOutputMarkupId(true);
+ add(partiesRefresh);
- // Liste des parties
- final List<Partie> parties = lotService.listParties();
- LoadableDetachableSortableListDataProvider<Partie> partiesDataProvider = new LoadableDetachableSortableListDataProvider<Partie>(
- parties, getSession().getLocale());
+ // Liste des parties
+ final List<Partie> parties = lotService.listParties();
+ LoadableDetachableSortableListDataProvider<Partie> partiesDataProvider = new LoadableDetachableSortableListDataProvider<Partie>(
+ parties, getSession().getLocale());
- partiesRefresh.add(new DataView<Partie>("ListPartiePanel.Parties", partiesDataProvider) {
- @Override
- protected void populateItem(Item<Partie> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ partiesRefresh.add(new DataView<Partie>("ListPartiePanel.Parties", partiesDataProvider) {
+ @Override
+ protected void populateItem(Item<Partie> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- Partie partie = item.getModelObject();
- // Colonnes
- item.add(new Label("ListPartiePanel.Parties.nom", new PropertyModel<String>(partie, "nom")));
+ Partie partie = item.getModelObject();
+ // Colonnes
+ item.add(new Label("ListPartiePanel.Parties.nom", new PropertyModel<String>(partie, "nom")));
- // Action : mise à jour (redirection vers le formulaire)
- Link<Partie> updateLink = new Link<Partie>("ListPartiePanel.Parties.Update", new Model<Partie>(partie)) {
- @Override
- public void onClick() {
- setResponsePage(new ManagePartiePage(getModelObject().getIdPartie()));
- }
- };
- item.add(updateLink);
- }
- });
- }
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Partie> updateLink = new Link<Partie>("ListPartiePanel.Parties.Update", new Model<Partie>(partie)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManagePartiePage(getModelObject().getIdPartie()));
+ }
+ };
+ item.add(updateLink);
+ }
+ });
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/RebuildLuceneIndexPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/RebuildLuceneIndexPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/config/panels/RebuildLuceneIndexPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,20 +40,20 @@
*/
public class RebuildLuceneIndexPanel extends Panel {
- /** Service : test */
- @SpringBean
- private SearchService searchService;
+ /** Service : test */
+ @SpringBean
+ private SearchService searchService;
- protected Label rebuildResultLabel;
+ protected Label rebuildResultLabel;
- /**
- * Constructor
- * @param id The panel ID
- */
- public RebuildLuceneIndexPanel(String id) {
- super(id);
+ /**
+ * Constructor
+ * @param id The panel ID
+ */
+ public RebuildLuceneIndexPanel(String id) {
+ super(id);
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
Button addButton = new AjaxFallbackButton("Rebuild", formView) {
@Override
@@ -72,5 +72,5 @@
rebuildResultLabel = new Label("rebuildResult", new Model<String>(""));
formView.add(rebuildResultLabel);
add(formView);
- }
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ListExtractionsPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -68,146 +68,146 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListExtractionsPage extends TemplatePage {
- /** Service : manipExtraction */
- @SpringBean
- private ExtractionService extractionService;
+ /** Service : manipExtraction */
+ @SpringBean
+ private ExtractionService extractionService;
- /**
- * Nombre d'extraits affichés dans la colonne de résumés des extraits
- */
- private static int MAX_EXTRAITS_DISPLAY = 4;
+ /**
+ * Nombre d'extraits affichés dans la colonne de résumés des extraits
+ */
+ private static int MAX_EXTRAITS_DISPLAY = 4;
- /**
- * Constructeur
- */
- public ListExtractionsPage() {
- super(ListExtractionsPage.class);
+ /**
+ * Constructeur
+ */
+ public ListExtractionsPage() {
+ super(ListExtractionsPage.class);
- final CallerPage currentPage = new CallerPage(ListExtractionsPage.class);
+ final CallerPage currentPage = new CallerPage(ListExtractionsPage.class);
- add(new Link<Void>(getResource() + ".NewExtraction") {
- @Override
- public void onClick() {
- setResponsePage(new ManageExtractionPage(currentPage, true));
- }
- });
+ add(new Link<Void>(getResource() + ".NewExtraction") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageExtractionPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer extractionsRefresh = new WebMarkupContainer(getResource() + ".Extractions.Refresh");
- extractionsRefresh.setOutputMarkupId(true);
- add(extractionsRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer extractionsRefresh = new WebMarkupContainer(getResource() + ".Extractions.Refresh");
+ extractionsRefresh.setOutputMarkupId(true);
+ add(extractionsRefresh);
- // Liste des Extractions
- final List<Extraction> extractions = extractionService.listExtractions(getSession().getUtilisateur());
+ // Liste des Extractions
+ final List<Extraction> extractions = extractionService.listExtractions(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
- extractions, getSession().getLocale());
+ LoadableDetachableSortableListDataProvider<Extraction> extractionsDataProvider = new LoadableDetachableSortableListDataProvider<Extraction>(
+ extractions, getSession().getLocale());
- List<IColumn<Extraction>> columns = new ArrayList<IColumn<Extraction>>();
+ List<IColumn<Extraction>> columns = new ArrayList<IColumn<Extraction>>();
- columns.add(new LinkableImagePropertyColumn<Extraction>("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 LinkableImagePropertyColumn<Extraction>("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",
- getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ReadLotPage(model.getObject().getLot().getIdLot(), currentPage));
- }
- });
+ columns.add(new LinkPropertyColumn<Extraction>(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));
+ }
+ });
- columns.add(new LinkPropertyColumn<Extraction>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Extraction>(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));
+ }
+ });
- columns.add(new ShortDatePropertyColumn<Extraction>(new Model<String>(getString("Extraction.date")), "date",
- "date", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Extraction>(new Model<String>(getString("Extraction.date")), "date",
+ "date", getLocale()));
- columns.add(new PropertyColumn<Extraction>(new Model<String>(getString("Extraction.methode2")), "methode",
- "methode"));
+ columns.add(new PropertyColumn<Extraction>(new Model<String>(getString("Extraction.methode2")), "methode",
+ "methode"));
- columns.add(new DecimalPropertyColumn<Extraction>(new Model<String>(getString("Extraction.masseDepart2")),
- "masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Extraction>(new Model<String>(getString("Extraction.masseDepart2")),
+ "masseDepart", "masseDepart", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new LinkPropertyColumn<Extraction>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Extraction>(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));
+ }
+ });
- columns.add(new AbstractColumn<Extraction>(new Model<String>(getString("Extraction.extraits"))) {
- @Override
- public void populateItem(Item<ICellPopulator<Extraction>> cellItem, String componentId,
- IModel<Extraction> rowModel) {
+ columns.add(new AbstractColumn<Extraction>(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);
- }
+ // 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>("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<Extraction>> item, String componentId, IModel<Extraction> model) {
- if (extractionService.updateOrdeleteExtractionEnabled(model.getObject(), getSession().getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ columns.add(new LinkableImagePropertyColumn<Extraction>("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<Extraction>> item, String componentId, IModel<Extraction> model) {
+ if (extractionService.updateOrdeleteExtractionEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
- setResponsePage(new ManageExtractionPage(model.getObject().getIdExtraction(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Extraction>> item, String componentId, IModel<Extraction> model) {
+ setResponsePage(new ManageExtractionPage(model.getObject().getIdExtraction(), currentPage));
+ }
+ });
- final DataTable<Extraction> extractionsDataTable = new AjaxFallbackDefaultDataTable<Extraction>(
- "ListExtractionsPage.Extractions", columns, extractionsDataProvider, WebContext.ROWS_PER_PAGE);
- extractionsRefresh.add(extractionsDataTable);
+ final DataTable<Extraction> extractionsDataTable = new AjaxFallbackDefaultDataTable<Extraction>(
+ "ListExtractionsPage.Extractions", columns, extractionsDataProvider, WebContext.ROWS_PER_PAGE);
+ extractionsRefresh.add(extractionsDataTable);
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ManageExtractionPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ManageExtractionPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ManageExtractionPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -97,692 +97,692 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManageExtractionPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** extraction Model */
- private final IModel<Extraction> extractionModel;
+ /** extraction Model */
+ private final IModel<Extraction> extractionModel;
- /** model for adding Extrait */
- private IModel<Extrait> newExtraitModel;
+ /** model for adding Extrait */
+ private IModel<Extrait> newExtraitModel;
- /** Service : extraits */
- @SpringBean
- private ExtractionService extractionService;
+ /** Service : extraits */
+ @SpringBean
+ private ExtractionService extractionService;
- /** Service : personnes */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personnes */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : produits */
- @SpringBean
- private ProduitService produitService;
+ /** Service : produits */
+ @SpringBean
+ private ProduitService produitService;
- /** Service : lots */
- @SpringBean
- private LotService lotService;
+ /** Service : lots */
+ @SpringBean
+ private LotService lotService;
- /** Liste des personnes existantes */
- private final List<Personne> personnes;
+ /** Liste des personnes existantes */
+ private final List<Personne> personnes;
- /** Liste des méthodes d'extraction existantes */
- private final List<MethodeExtraction> methodes;
+ /** Liste des méthodes d'extraction existantes */
+ private final List<MethodeExtraction> methodes;
- /** Liste des types d'extraits issue de la méthode sélectionnée */
- private List<TypeExtrait> typesExtrait;
+ /** Liste des types d'extraits issue de la méthode sélectionnée */
+ private List<TypeExtrait> typesExtrait;
- /** Liste des lots existants */
- private List<Lot> lots;
+ /** Liste des lots existants */
+ private List<Lot> lots;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /** createMode true si le formulaire est en creation, false en édition **/
- private boolean createMode;
+ /** createMode true si le formulaire est en creation, false en édition **/
+ private boolean createMode;
- /**
- * Couple of <ref, id> in order to recuperate the id of the deleted type usefull in case of delete thus add of same
- * initial type
- */
- private HashMap<String, Integer> extraitsDeleted;
+ /**
+ * Couple of <ref, id> in order to recuperate the id of the deleted type usefull in case of delete thus add of same
+ * initial type
+ */
+ private HashMap<String, Integer> extraitsDeleted;
- /** Container pour la table des extraits (ajoutés, et saisie) */
- private MarkupContainer extraitsTable;
+ /** Container pour la table des extraits (ajoutés, et saisie) */
+ private MarkupContainer extraitsTable;
- /** Saisie typeExtrait pour l'ajout d'un extrait */
- private AbstractSingleSelectChoice<TypeExtrait> typeExtraitInput;
+ /** Saisie typeExtrait pour l'ajout d'un extrait */
+ private AbstractSingleSelectChoice<TypeExtrait> typeExtraitInput;
- /** Info-bulle comprenant la description du type d'extrait **/
- private SimpleTooltipPanel typeExtraitTooltip;
+ /** Info-bulle comprenant la description du type d'extrait **/
+ private SimpleTooltipPanel typeExtraitTooltip;
- /** Saisie ref pour l'ajout d'un extrait */
- private FormComponent<String> refInput;
+ /** Saisie ref pour l'ajout d'un extrait */
+ private FormComponent<String> refInput;
- /** Saisie masse pour l'ajout d'un extrait */
- private FormComponent<BigDecimal> masseObtenueInput;
+ /** Saisie masse pour l'ajout d'un extrait */
+ private FormComponent<BigDecimal> masseObtenueInput;
- /** Bouton d'ajout d'un extrait **/
- private Button addExtraitButton;
+ /** Bouton d'ajout d'un extrait **/
+ private Button addExtraitButton;
- /** Pattern pour le renseignement automatique des réf d'extrait */
- private static final String PATTERN_REF_EXTRAIT = "%s%s";
+ /** Pattern pour le renseignement automatique des réf d'extrait */
+ private static final String PATTERN_REF_EXTRAIT = "%s%s";
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageExtractionPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageExtractionPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idManip Id de la manip d'extraction
- * @param callerPage Page appelante
- */
- public ManageExtractionPage(Integer idManip, CallerPage callerPage) {
- this(idManip, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idManip Id de la manip d'extraction
+ * @param callerPage Page appelante
+ */
+ public ManageExtractionPage(Integer idManip, CallerPage callerPage) {
+ this(idManip, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la manip suivante)
- * @param manip Manip d'extraction
- * @param callerPage Page appelante
- */
- public ManageExtractionPage(Extraction manip, CallerPage callerPage) {
- this(null, manip, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la manip suivante)
+ * @param manip Manip d'extraction
+ * @param callerPage Page appelante
+ */
+ public ManageExtractionPage(Extraction manip, CallerPage callerPage) {
+ this(null, manip, callerPage, true);
+ }
- /**
- * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'extraction. Si refManip est
- * renseignée, on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir
- * des informations qu'elle contient.
- * @param idManip Id de la manip d'extraction
- * @param manip Manip d'extraction
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManageExtractionPage(Integer idManip, Extraction manip, final CallerPage callerPage, boolean multipleEntry) {
- super(ManageExtractionPage.class);
- assert idManip == null || manip == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'extraction. Si refManip est
+ * renseignée, on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir
+ * des informations qu'elle contient.
+ * @param idManip Id de la manip d'extraction
+ * @param manip Manip d'extraction
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManageExtractionPage(Integer idManip, Extraction manip, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManageExtractionPage.class);
+ assert idManip == null || manip == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- extraitsDeleted = new HashMap<String, Integer>();
- newExtraitModel = new Model<Extrait>(new Extrait());
+ extraitsDeleted = new HashMap<String, Integer>();
+ newExtraitModel = new Model<Extrait>(new Extrait());
- // Initialisation du modèle
- try {
- extractionModel = new Model<Extraction>(idManip == null && manip == null ? new Extraction()
- : manip != null ? manip : extractionService.loadExtraction(idManip));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Initialisation du modèle
+ try {
+ extractionModel = new Model<Extraction>(idManip == null && manip == null ? new Extraction()
+ : manip != null ? manip : extractionService.loadExtraction(idManip));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- createMode = idManip == null;
- if (createMode) {
- extractionModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ createMode = idManip == null;
+ if (createMode) {
+ extractionModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes (pour le dropDownChoice)
- personnes = personneService.listPersonnes();
- methodes = extractionService.listMethodesExtraction();
- lots = lotService.listLots(getSession().getUtilisateur());
+ // Initialisation des listes (pour le dropDownChoice)
+ personnes = personneService.listPersonnes();
+ methodes = extractionService.listMethodesExtraction();
+ lots = lotService.listLots(getSession().getUtilisateur());
- if (manip != null) {
- // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
- // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
- // l'égalité entre les objets)
- extractionModel.getObject().setManipulateur(
- CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, extractionModel
- .getObject().getManipulateur().getIdPersonne()));
- extractionModel.getObject().setMethode(
- CollectionTools.findWithValue(methodes, "idMethodeExtraction", AccessType.GETTER, extractionModel
- .getObject().getMethode().getIdMethodeExtraction()));
- }
+ if (manip != null) {
+ // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
+ // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
+ // l'égalité entre les objets)
+ extractionModel.getObject().setManipulateur(
+ CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, extractionModel
+ .getObject().getManipulateur().getIdPersonne()));
+ extractionModel.getObject().setMethode(
+ CollectionTools.findWithValue(methodes, "idMethodeExtraction", AccessType.GETTER, extractionModel
+ .getObject().getMethode().getIdMethodeExtraction()));
+ }
- typesExtrait = new ArrayList<TypeExtrait>();
+ typesExtrait = new ArrayList<TypeExtrait>();
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- initPrincipalFields(formView);
+ initPrincipalFields(formView);
- initMethodeFields(formView);
+ initMethodeFields(formView);
- initExtraitsFields(formView);
+ initExtraitsFields(formView);
- // Action : create the extraction
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extractionService.createExtraction(extractionModel.getObject());
- }
+ // Action : create the extraction
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extractionService.createExtraction(extractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
+ @Override
+ public void onValidate() {
+ validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the extraction
- Button updateButton = new SubmittableButton(ACTION_UPDATE, ManageExtractionPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extractionService.updateExtraction(extractionModel.getObject());
- }
+ // Action : update the extraction
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, ManageExtractionPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extractionService.updateExtraction(extractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extractionService.deleteExtraction(extractionModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extractionService.deleteExtraction(extractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- formView.setDefaultButton(addExtraitButton);
- add(formView);
- }
+ formView.setDefaultButton(addExtraitButton);
+ add(formView);
+ }
- /**
- * Initialise les champs principaux
- * @param formView le formulaire
- */
- private void initPrincipalFields(final Form<Void> formView) {
- formView.add(new TextField<String>("Extraction.ref", new PropertyModel<String>(extractionModel, "ref")));
+ /**
+ * Initialise les champs principaux
+ * @param formView le formulaire
+ */
+ private void initPrincipalFields(final Form<Void> formView) {
+ formView.add(new TextField<String>("Extraction.ref", new PropertyModel<String>(extractionModel, "ref")));
- DropDownChoice<Personne> pers = new DropDownChoice<Personne>("Extraction.manipulateur",
- new PropertyModel<Personne>(extractionModel, "manipulateur"), personnes, new PersonneRenderer());
- pers.setNullValid(false);
+ DropDownChoice<Personne> pers = new DropDownChoice<Personne>("Extraction.manipulateur",
+ new PropertyModel<Personne>(extractionModel, "manipulateur"), personnes, new PersonneRenderer());
+ pers.setNullValid(false);
- pers.setModelObject(extractionModel.getObject().getManipulateur());
- formView.add(pers);
- pers.getChoices().indexOf(pers.getModelObject());
- // Action : création d'une nouvelle personne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewPersonne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
+ pers.setModelObject(extractionModel.getObject().getManipulateur());
+ formView.add(pers);
+ pers.getChoices().indexOf(pers.getModelObject());
+ // Action : création d'une nouvelle personne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewPersonne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ });
- formView.add(new DateTextField("Extraction.date", new PropertyModel<Date>(extractionModel, "date"))
- .add(new DatePicker()));
+ formView.add(new DateTextField("Extraction.date", new PropertyModel<Date>(extractionModel, "date"))
+ .add(new DatePicker()));
- final AbstractSingleSelectChoice<Lot> lotsChoice = new DropDownChoice<Lot>("Extraction.lot",
- new PropertyModel<Lot>(extractionModel, "lot"), lots);
- lotsChoice.setNullValid(false);
- lotsChoice.setEnabled(createMode);
- lotsChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- updateRefExtrait(target);
- }
- });
- formView.add(lotsChoice);
+ final AbstractSingleSelectChoice<Lot> lotsChoice = new DropDownChoice<Lot>("Extraction.lot",
+ new PropertyModel<Lot>(extractionModel, "lot"), lots);
+ lotsChoice.setNullValid(false);
+ lotsChoice.setEnabled(createMode);
+ lotsChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ updateRefExtrait(target);
+ }
+ });
+ formView.add(lotsChoice);
- // Action : création d'un nouveau lot
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- AbstractLink newLot = new AjaxSubmitLink("NewLot") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManageLotPage(new CallerPage((TemplatePage) getPage()), false));
- }
+ // Action : création d'un nouveau lot
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ AbstractLink newLot = new AjaxSubmitLink("NewLot") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManageLotPage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageLotPage(new CallerPage((TemplatePage) getPage()), false));
- }
- };
- newLot.setOutputMarkupPlaceholderTag(true);
- newLot.setVisibilityAllowed(createMode);
- formView.add(newLot);
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageLotPage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ };
+ newLot.setOutputMarkupPlaceholderTag(true);
+ newLot.setVisibilityAllowed(createMode);
+ formView.add(newLot);
- TextField<BigDecimal> masseDepartInput = new TextField<BigDecimal>("Extraction.masseDepart",
- new PropertyModel<BigDecimal>(extractionModel, "masseDepart"));
- masseDepartInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- };
- });
- formView.add(masseDepartInput);
+ TextField<BigDecimal> masseDepartInput = new TextField<BigDecimal>("Extraction.masseDepart",
+ new PropertyModel<BigDecimal>(extractionModel, "masseDepart"));
+ masseDepartInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ };
+ });
+ formView.add(masseDepartInput);
- formView.add(new TextArea<String>("Extraction.complement", new PropertyModel<String>(extractionModel,
- "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Extraction.createur",
- new PropertyModel<String>(extractionModel, "createur")).setEnabled(false));
- }
+ formView.add(new TextArea<String>("Extraction.complement", new PropertyModel<String>(extractionModel,
+ "complement")));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Extraction.createur",
+ new PropertyModel<String>(extractionModel, "createur")).setEnabled(false));
+ }
- /**
- * Initialise les champs relatifs à la méthode
- * @param formView le formulaire
- */
- private void initMethodeFields(final Form<Void> formView) {
- // Champs méthode
+ /**
+ * Initialise les champs relatifs à la méthode
+ * @param formView le formulaire
+ */
+ private void initMethodeFields(final Form<Void> formView) {
+ // Champs méthode
- final WebMarkupContainer descriptionMethoContainer = new WebMarkupContainer("TestBio.descriptionMethodeCont") {
- @Override
- public boolean isVisible() {
- // description cachée si pas de méthode sélectionnée
- return extractionModel.getObject().getMethode() != null;
- }
- };
- descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
- descriptionMethoContainer.setOutputMarkupPlaceholderTag(true); // pour accéder à l'élement html qd son état est
- // non visible
- formView.add(descriptionMethoContainer);
+ final WebMarkupContainer descriptionMethoContainer = new WebMarkupContainer("TestBio.descriptionMethodeCont") {
+ @Override
+ public boolean isVisible() {
+ // description cachée si pas de méthode sélectionnée
+ return extractionModel.getObject().getMethode() != null;
+ }
+ };
+ descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
+ descriptionMethoContainer.setOutputMarkupPlaceholderTag(true); // pour accéder à l'élement html qd son état est
+ // non visible
+ formView.add(descriptionMethoContainer);
- descriptionMethoContainer.add(new MultiLineLabel("Extraction.methode.description", new PropertyModel<String>(
- extractionModel, "methode.description")));
+ descriptionMethoContainer.add(new MultiLineLabel("Extraction.methode.description", new PropertyModel<String>(
+ extractionModel, "methode.description")));
- final DropDownChoice<MethodeExtraction> methodeChoice = new DropDownChoice<MethodeExtraction>(
- "Extraction.methode.nom", new PropertyModel<MethodeExtraction>(extractionModel, "methode"), methodes);
- methodeChoice.setNullValid(false);
- methodeChoice.setOutputMarkupId(true); // pour l'update Ajax
- // mise à jour de la description de la méthode et des extraits lors de la sélection de la méthode
- methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- extractionModel.getObject().getExtraits().clear();
- // maj de la liste des typesExtraits suivant la sélection
- typesExtrait.clear();
- if (extractionModel.getObject().getMethode() != null) {
- // rafraichi la méthode pour pouvoir accéder aux types en sortie accédés en LAZY
- extractionService.refreshMethodeExtraction(extractionModel.getObject().getMethode());
- typesExtrait.addAll(extractionModel.getObject().getMethode().getSortedTypesEnSortie());
- }
- // mise à jour de typesExtrait
- updateTypesExtrait(true, target);
+ final DropDownChoice<MethodeExtraction> methodeChoice = new DropDownChoice<MethodeExtraction>(
+ "Extraction.methode.nom", new PropertyModel<MethodeExtraction>(extractionModel, "methode"), methodes);
+ methodeChoice.setNullValid(false);
+ methodeChoice.setOutputMarkupId(true); // pour l'update Ajax
+ // mise à jour de la description de la méthode et des extraits lors de la sélection de la méthode
+ methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ extractionModel.getObject().getExtraits().clear();
+ // maj de la liste des typesExtraits suivant la sélection
+ typesExtrait.clear();
+ if (extractionModel.getObject().getMethode() != null) {
+ // rafraichi la méthode pour pouvoir accéder aux types en sortie accédés en LAZY
+ extractionService.refreshMethodeExtraction(extractionModel.getObject().getMethode());
+ typesExtrait.addAll(extractionModel.getObject().getMethode().getSortedTypesEnSortie());
+ }
+ // mise à jour de typesExtrait
+ updateTypesExtrait(true, target);
- target.add(methodeChoice, descriptionMethoContainer);
- }
- });
- formView.add(methodeChoice);
- }
+ target.add(methodeChoice, descriptionMethoContainer);
+ }
+ });
+ formView.add(methodeChoice);
+ }
- /**
- * Initialise les champs relatifs aux extraits
- * @param formView le formulaire
- */
- private void initExtraitsFields(final Form<Void> formView) {
+ /**
+ * Initialise les champs relatifs aux extraits
+ * @param formView le formulaire
+ */
+ private void initExtraitsFields(final Form<Void> formView) {
- extraitsTable = new WebMarkupContainer("Extraction.extraits.Table");
- // Contenu tableaux extrait
- // Liste des types extraits ajoutés (pour raffraichissements)
- extraitsTable.add(new ListView<Extrait>("Extraction.extraits.List", new PropertyModel<List<Extrait>>(
- extractionModel, "sortedExtraits")) {
- @Override
- protected void populateItem(ListItem<Extrait> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ extraitsTable = new WebMarkupContainer("Extraction.extraits.Table");
+ // Contenu tableaux extrait
+ // Liste des types extraits ajoutés (pour raffraichissements)
+ extraitsTable.add(new ListView<Extrait>("Extraction.extraits.List", new PropertyModel<List<Extrait>>(
+ extractionModel, "sortedExtraits")) {
+ @Override
+ protected void populateItem(ListItem<Extrait> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- IModel<Extrait> extraitModel = item.getModel();
- final Extrait extrait = item.getModelObject();
- // Colonnes
- item.add(new Label("Extraction.extraits.List.typeExtrait", new PropertyModel<String>(extrait,
- "typeExtrait")));
- // info-bulle comprenant la description du type d'extrait
- item.add(new SimpleTooltipPanel("Extraction.extraits.List.typeExtrait.info", new PropertyModel<String>(
- extrait, "typeExtrait.description")));
- item.add(new Label("Extraction.extraits.List.ref", new PropertyModel<String>(extrait, "ref")));
- item.add(new Label("Extraction.extraits.List.masseObtenue", new PropertyModel<String>(extrait,
- "masseObtenue")));
+ IModel<Extrait> extraitModel = item.getModel();
+ final Extrait extrait = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Extraction.extraits.List.typeExtrait", new PropertyModel<String>(extrait,
+ "typeExtrait")));
+ // info-bulle comprenant la description du type d'extrait
+ item.add(new SimpleTooltipPanel("Extraction.extraits.List.typeExtrait.info", new PropertyModel<String>(
+ extrait, "typeExtrait.description")));
+ item.add(new Label("Extraction.extraits.List.ref", new PropertyModel<String>(extrait, "ref")));
+ item.add(new Label("Extraction.extraits.List.masseObtenue", new PropertyModel<String>(extrait,
+ "masseObtenue")));
- item.add(new Label("Extraction.extraits.List.rendement", new DisplayPercentPropertyModel(extraitModel,
- "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Extraction.extraits.List.rendement", new DisplayPercentPropertyModel(extraitModel,
+ "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
- // Action : suppression d'un extrait
- Button deleteButton = new AjaxFallbackButton("Extraction.extraits.List.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // vérification si des données liées existe
- if (produitService.isProduitReferenced(extrait)) {
- getPage().error(getString("Extrait.isReferenced"));
- } else {
- // Suppression
- extractionModel.getObject().getExtraits().remove(extrait);
- // keep the id of the deleted 'extrait' for the case of a new one with the same 'ref'
- extraitsDeleted.put(extrait.getRef(), extrait.getId());
+ // Action : suppression d'un extrait
+ Button deleteButton = new AjaxFallbackButton("Extraction.extraits.List.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // vérification si des données liées existe
+ if (produitService.isProduitReferenced(extrait)) {
+ getPage().error(getString("Extrait.isReferenced"));
+ } else {
+ // Suppression
+ extractionModel.getObject().getExtraits().remove(extrait);
+ // keep the id of the deleted 'extrait' for the case of a new one with the same 'ref'
+ extraitsDeleted.put(extrait.getRef(), extrait.getId());
- // mise à jour de l'extrait
- updateTypesExtrait(false, target);
- }
- if (target != null) {
- target.add(extraitsTable);
- refreshFeedbackPage(target);
- }
- }
+ // mise à jour de l'extrait
+ updateTypesExtrait(false, target);
+ }
+ if (target != null) {
+ target.add(extraitsTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
- extraitsTable.setOutputMarkupId(true);
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
+ extraitsTable.setOutputMarkupId(true);
- typeExtraitInput = new DropDownChoice<TypeExtrait>("Extraction.extraits.typeExtrait",
- new PropertyModel<TypeExtrait>(newExtraitModel, "typeExtrait"), typesExtrait).setNullValid(false);
- // info-bulle comprenant la description du type d'extrait
- typeExtraitTooltip = new SimpleTooltipPanel("Extraction.extraits.typeExtrait.info", new PropertyModel<String>(
- newExtraitModel, "typeExtrait.description"));
- // permet la mise en visibité ou non en Ajax
- typeExtraitTooltip.setOutputMarkupId(true);
- typeExtraitTooltip.setOutputMarkupPlaceholderTag(true);
- extraitsTable.add(typeExtraitTooltip);
+ typeExtraitInput = new DropDownChoice<TypeExtrait>("Extraction.extraits.typeExtrait",
+ new PropertyModel<TypeExtrait>(newExtraitModel, "typeExtrait"), typesExtrait).setNullValid(false);
+ // info-bulle comprenant la description du type d'extrait
+ typeExtraitTooltip = new SimpleTooltipPanel("Extraction.extraits.typeExtrait.info", new PropertyModel<String>(
+ newExtraitModel, "typeExtrait.description"));
+ // permet la mise en visibité ou non en Ajax
+ typeExtraitTooltip.setOutputMarkupId(true);
+ typeExtraitTooltip.setOutputMarkupPlaceholderTag(true);
+ extraitsTable.add(typeExtraitTooltip);
- typeExtraitInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- updateRefExtrait(target);
- target.add(typeExtraitTooltip);
- }
- });
- extraitsTable.add(typeExtraitInput);
+ typeExtraitInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ updateRefExtrait(target);
+ target.add(typeExtraitTooltip);
+ }
+ });
+ extraitsTable.add(typeExtraitInput);
- refInput = new TextField<String>("Extraction.extraits.ref", new PropertyModel<String>(newExtraitModel, "ref"));
- refInput.setOutputMarkupId(true);
- extraitsTable.add(refInput);
+ refInput = new TextField<String>("Extraction.extraits.ref", new PropertyModel<String>(newExtraitModel, "ref"));
+ refInput.setOutputMarkupId(true);
+ extraitsTable.add(refInput);
- masseObtenueInput = new TextField<BigDecimal>("Extraction.extraits.masseObtenue",
- new PropertyModel<BigDecimal>(newExtraitModel, "masseObtenue"));
- masseObtenueInput.setOutputMarkupId(true);
- extraitsTable.add(masseObtenueInput);
+ masseObtenueInput = new TextField<BigDecimal>("Extraction.extraits.masseObtenue",
+ new PropertyModel<BigDecimal>(newExtraitModel, "masseObtenue"));
+ masseObtenueInput.setOutputMarkupId(true);
+ extraitsTable.add(masseObtenueInput);
- // Bouton AJAX pour ajouter un extrait
- addExtraitButton = new AjaxFallbackButton("Extraction.extraits.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- try {
- // normalisation de l'extrait
- newExtraitModel.getObject().setRef(
- Normalizer.normalize(UniqueFieldNormalizer.class, newExtraitModel.getObject().getRef()));
- // Ajout du type extrait
- newExtraitModel.getObject().setExtraction(extractionModel.getObject());
- // recuperate the id if an just deleted type, null otherwise
- newExtraitModel.getObject().setId(extraitsDeleted.get(newExtraitModel.getObject().getRef()));
+ // Bouton AJAX pour ajouter un extrait
+ addExtraitButton = new AjaxFallbackButton("Extraction.extraits.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ // normalisation de l'extrait
+ newExtraitModel.getObject().setRef(
+ Normalizer.normalize(UniqueFieldNormalizer.class, newExtraitModel.getObject().getRef()));
+ // Ajout du type extrait
+ newExtraitModel.getObject().setExtraction(extractionModel.getObject());
+ // recuperate the id if an just deleted type, null otherwise
+ newExtraitModel.getObject().setId(extraitsDeleted.get(newExtraitModel.getObject().getRef()));
- // ajout à la liste
- Extrait extraitAdded = newExtraitModel.getObject().clone();
- extractionModel.getObject().getExtraits().add(extraitAdded);
+ // ajout à la liste
+ Extrait extraitAdded = newExtraitModel.getObject().clone();
+ extractionModel.getObject().getExtraits().add(extraitAdded);
- List<String> errors = validator.validate(newExtraitModel.getObject(), getSession().getLocale());
- // test si unicité dans la base
- // erreur si non unique dans la base ET extrait de même réf non supprimé de la liste (dans ce
- // dernier cas, ajout avec son ancien id) ET non pris en compte par la validation de
- // CollectionUniqueFieldValidator
- if (!extractionService.isExtraitUnique(extraitAdded)
- && extraitAdded.getRef() != null
- && extraitsDeleted.get(extraitAdded.getRef()) == null
- && CollectionTools.countWithValue(extraitAdded.getExtraction().getExtraits(), "ref",
- AccessType.GETTER, extraitAdded.getRef()) == 1) {
- errors.add(getString("Extrait.notUnique"));
- }
+ List<String> errors = validator.validate(newExtraitModel.getObject(), getSession().getLocale());
+ // test si unicité dans la base
+ // erreur si non unique dans la base ET extrait de même réf non supprimé de la liste (dans ce
+ // dernier cas, ajout avec son ancien id) ET non pris en compte par la validation de
+ // CollectionUniqueFieldValidator
+ if (!extractionService.isExtraitUnique(extraitAdded)
+ && extraitAdded.getRef() != null
+ && extraitsDeleted.get(extraitAdded.getRef()) == null
+ && CollectionTools.countWithValue(extraitAdded.getExtraction().getExtraits(), "ref",
+ AccessType.GETTER, extraitAdded.getRef()) == 1) {
+ errors.add(getString("Extrait.notUnique"));
+ }
- if (errors.isEmpty()) {
- // réinit du champ ajout
- newExtraitModel.getObject().setRef(null);
- newExtraitModel.getObject().setMasseObtenue(null);
+ if (errors.isEmpty()) {
+ // réinit du champ ajout
+ newExtraitModel.getObject().setRef(null);
+ newExtraitModel.getObject().setMasseObtenue(null);
- // mise à jour de typesExtrait
- updateTypesExtrait(true, target);
- } else {
- extractionModel.getObject().getExtraits().remove(extraitAdded);
- addValidationErrors(errors);
- }
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // mise à jour de typesExtrait
+ updateTypesExtrait(true, target);
+ } else {
+ extractionModel.getObject().getExtraits().remove(extraitAdded);
+ addValidationErrors(errors);
+ }
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- if (target != null) {
- target.add(extraitsTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(extraitsTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- addExtraitButton.setOutputMarkupId(true);
- extraitsTable.add(addExtraitButton);
+ };
+ addExtraitButton.setOutputMarkupId(true);
+ extraitsTable.add(addExtraitButton);
- formView.add(extraitsTable);
- updateTypesExtrait(true, null);
- }
+ formView.add(extraitsTable);
+ updateTypesExtrait(true, null);
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Personne ou Lot)
- refreshModel();
- super.onBeforeRender();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Personne ou Lot)
+ refreshModel();
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection de nouveau vers l'écran de saisie d'une nouvelle extraction
- Extraction nextManip = new Extraction();
- nextManip.setManipulateur(extractionModel.getObject().getManipulateur());
- nextManip.setMethode(extractionModel.getObject().getMethode());
- nextManip.setMasseDepart(extractionModel.getObject().getMasseDepart());
- setResponsePage(new ManageExtractionPage(nextManip, callerPage));
- } else if (callerPage != null) {
- // On passe l'id de l'extraction associée à cette page, en paramètre de la prochaine page, pour lui
- // permettre de
- // l'exploiter si besoin
- callerPage
- .addPageParameter(Extraction.class.getSimpleName(), extractionModel.getObject().getIdExtraction());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection de nouveau vers l'écran de saisie d'une nouvelle extraction
+ Extraction nextManip = new Extraction();
+ nextManip.setManipulateur(extractionModel.getObject().getManipulateur());
+ nextManip.setMethode(extractionModel.getObject().getMethode());
+ nextManip.setMasseDepart(extractionModel.getObject().getMasseDepart());
+ setResponsePage(new ManageExtractionPage(nextManip, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id de l'extraction associée à cette page, en paramètre de la prochaine page, pour lui
+ // permettre de
+ // l'exploiter si besoin
+ callerPage
+ .addPageParameter(Extraction.class.getSimpleName(), extractionModel.getObject().getIdExtraction());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Refresh model, appelé au rechargement de la page
- */
- private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Personne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(personnes, personneService.listPersonnes());
- try {
- Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
- extractionModel.getObject().setManipulateur(createdPersonne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
+ /**
+ * Refresh model, appelé au rechargement de la page
+ */
+ private void refreshModel() {
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Personne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(personnes, personneService.listPersonnes());
+ try {
+ Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
+ extractionModel.getObject().setManipulateur(createdPersonne);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
- key = Lot.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(lots, lotService.listLots(getSession().getUtilisateur()));
- try {
- Lot createdLot = lotService.loadLot(getPageParameters().get(key).toInt());
- extractionModel.getObject().setLot(createdLot);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
+ key = Lot.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(lots, lotService.listLots(getSession().getUtilisateur()));
+ try {
+ Lot createdLot = lotService.loadLot(getPageParameters().get(key).toInt());
+ extractionModel.getObject().setLot(createdLot);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
- // mise à jour du champ réf d'un nouvel extrait au cas où retour sur le formulaire avec un nouveau lot
- // sélectionné
- updateRefExtrait(null);
- }
+ // mise à jour du champ réf d'un nouvel extrait au cas où retour sur le formulaire avec un nouveau lot
+ // sélectionné
+ updateRefExtrait(null);
+ }
- /**
- * Update the extrait reference with an auto-generated value (ref and typeExtrait concatenated)
- * @param target An AjaxRequestTarget, null if not a ajax request
- */
- private void updateRefExtrait(AjaxRequestTarget target) {
- if (extractionModel.getObject().getLot() != null && newExtraitModel.getObject().getTypeExtrait() != null) {
- // met à jour la réf de l'extrait suivant celle du lot et le type d'extrait
- newExtraitModel.getObject().setRef(
- String.format(PATTERN_REF_EXTRAIT, extractionModel.getObject().getLot().getRef(), newExtraitModel
- .getObject().getTypeExtrait().getInitiales()));
- if (target != null) {
- target.add(refInput);
- }
- }
- }
+ /**
+ * Update the extrait reference with an auto-generated value (ref and typeExtrait concatenated)
+ * @param target An AjaxRequestTarget, null if not a ajax request
+ */
+ private void updateRefExtrait(AjaxRequestTarget target) {
+ if (extractionModel.getObject().getLot() != null && newExtraitModel.getObject().getTypeExtrait() != null) {
+ // met à jour la réf de l'extrait suivant celle du lot et le type d'extrait
+ newExtraitModel.getObject().setRef(
+ String.format(PATTERN_REF_EXTRAIT, extractionModel.getObject().getLot().getRef(), newExtraitModel
+ .getObject().getTypeExtrait().getInitiales()));
+ if (target != null) {
+ target.add(refInput);
+ }
+ }
+ }
- /**
- * Met à jour la liste des types extrait (suivant la méthode et les extraits déjà saisis)
- * @param target An AjaxRequestTarget, null if not a ajax request
- * @param selectFirstTypeExtrait If the first element of the TypeExtraits combobox need to be selected
- */
- private void updateTypesExtrait(boolean selectFirstTypeExtrait, AjaxRequestTarget target) {
- if (extractionModel.getObject().getMethode() != null) {
- CollectionTools.setter(typesExtrait, extractionModel.getObject().getMethode().getSortedTypesEnSortie());
- for (Extrait curExtrait : extractionModel.getObject().getExtraits()) {
- typesExtrait.remove(curExtrait.getTypeExtrait());
- }
- }
- configureExtraitInputs();
+ /**
+ * Met à jour la liste des types extrait (suivant la méthode et les extraits déjà saisis)
+ * @param target An AjaxRequestTarget, null if not a ajax request
+ * @param selectFirstTypeExtrait If the first element of the TypeExtraits combobox need to be selected
+ */
+ private void updateTypesExtrait(boolean selectFirstTypeExtrait, AjaxRequestTarget target) {
+ if (extractionModel.getObject().getMethode() != null) {
+ CollectionTools.setter(typesExtrait, extractionModel.getObject().getMethode().getSortedTypesEnSortie());
+ for (Extrait curExtrait : extractionModel.getObject().getExtraits()) {
+ typesExtrait.remove(curExtrait.getTypeExtrait());
+ }
+ }
+ configureExtraitInputs();
- if (selectFirstTypeExtrait) {
- // Si liste des types extraits non vide, sélection du premier élement
- newExtraitModel.getObject().setTypeExtrait(
- typeExtraitInput.getChoices().isEmpty() ? null : typeExtraitInput.getChoices().get(0));
- }
+ if (selectFirstTypeExtrait) {
+ // Si liste des types extraits non vide, sélection du premier élement
+ newExtraitModel.getObject().setTypeExtrait(
+ typeExtraitInput.getChoices().isEmpty() ? null : typeExtraitInput.getChoices().get(0));
+ }
- updateRefExtrait(target);
+ updateRefExtrait(target);
- if (target != null) {
- target.add(typeExtraitInput, typeExtraitTooltip, refInput, masseObtenueInput, addExtraitButton);
- }
- }
+ if (target != null) {
+ target.add(typeExtraitInput, typeExtraitTooltip, refInput, masseObtenueInput, addExtraitButton);
+ }
+ }
- /**
- * Configure les composants pour la saisie d'extraits
- */
- private void configureExtraitInputs() {
- // désactivation de la saisie d'un extrait si pas de méthode ou si déjà un extrait par type d'extrait
- if (extractionModel.getObject().getMethode() == null
- || extractionModel.getObject().getExtraits() != null
- && extractionModel.getObject().getExtraits().size() == extractionModel.getObject().getMethode()
- .getTypesEnSortie().size()) {
- disableExtraitAdding();
- } else {
- enableExtraitAdding();
- }
- }
+ /**
+ * Configure les composants pour la saisie d'extraits
+ */
+ private void configureExtraitInputs() {
+ // désactivation de la saisie d'un extrait si pas de méthode ou si déjà un extrait par type d'extrait
+ if (extractionModel.getObject().getMethode() == null
+ || extractionModel.getObject().getExtraits() != null
+ && extractionModel.getObject().getExtraits().size() == extractionModel.getObject().getMethode()
+ .getTypesEnSortie().size()) {
+ disableExtraitAdding();
+ } else {
+ enableExtraitAdding();
+ }
+ }
- /**
- * Active la saisie pour ajouter un nouvel extrait
- */
- private void enableExtraitAdding() {
- typeExtraitInput.setEnabled(true);
- typeExtraitTooltip.setVisibilityAllowed(true);
- refInput.setEnabled(true);
- masseObtenueInput.setEnabled(true);
- addExtraitButton.setEnabled(true);
- }
+ /**
+ * Active la saisie pour ajouter un nouvel extrait
+ */
+ private void enableExtraitAdding() {
+ typeExtraitInput.setEnabled(true);
+ typeExtraitTooltip.setVisibilityAllowed(true);
+ refInput.setEnabled(true);
+ masseObtenueInput.setEnabled(true);
+ addExtraitButton.setEnabled(true);
+ }
- /**
- * Désactive la saisie pour ajouter un nouvel extrait
- */
- private void disableExtraitAdding() {
- typeExtraitInput.setEnabled(false);
- typeExtraitTooltip.setVisibilityAllowed(false);
- refInput.setEnabled(false);
- masseObtenueInput.setEnabled(false);
- addExtraitButton.setEnabled(false);
- }
+ /**
+ * Désactive la saisie pour ajouter un nouvel extrait
+ */
+ private void disableExtraitAdding() {
+ typeExtraitInput.setEnabled(false);
+ typeExtraitTooltip.setVisibilityAllowed(false);
+ refInput.setEnabled(false);
+ masseObtenueInput.setEnabled(false);
+ addExtraitButton.setEnabled(false);
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(extractionModel.getObject(), getSession().getLocale()));
- if (!extractionService.isExtractionUnique(extractionModel.getObject())) {
- error(getString("Extraction.notUnique"));
- }
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(extractionModel.getObject(), getSession().getLocale()));
+ if (!extractionService.isExtractionUnique(extractionModel.getObject())) {
+ error(getString("Extraction.notUnique"));
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ReadExtractionPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ReadExtractionPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/extraction/ReadExtractionPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -68,171 +68,171 @@
*/
public final class ReadExtractionPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** extraction Model */
- private final IModel<Extraction> extractionModel;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** extraction Model */
+ private final IModel<Extraction> extractionModel;
- /** Service : extraits */
- @SpringBean
- private ExtractionService extractionService;
+ /** Service : extraits */
+ @SpringBean
+ private ExtractionService extractionService;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Container contenant la liste des extraits */
- private MarkupContainer extraitsTable;
+ /** Container contenant la liste des extraits */
+ private MarkupContainer extraitsTable;
- /**
- * Constructeur
- * @param idExtraction identifiant de la manip
- * @param callerPage Page appelante
- */
- public ReadExtractionPage(Integer idExtraction, final CallerPage callerPage) {
- super(ReadExtractionPage.class);
- this.callerPage = callerPage;
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ /**
+ * Constructeur
+ * @param idExtraction identifiant de la manip
+ * @param callerPage Page appelante
+ */
+ public ReadExtractionPage(Integer idExtraction, final CallerPage callerPage) {
+ super(ReadExtractionPage.class);
+ this.callerPage = callerPage;
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- // Initialisation du modèle
- extractionModel = new GenericLoadableDetachableModel<Extraction>(Extraction.class, idExtraction);
+ // Initialisation du modèle
+ extractionModel = new GenericLoadableDetachableModel<Extraction>(Extraction.class, idExtraction);
- add(new Label("Extraction.ref", new PropertyModel<String>(extractionModel, "ref"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Extraction.ref", new PropertyModel<String>(extractionModel, "ref"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Extraction.manipulateur", new PropertyModel<Personne>(
- extractionModel, "manipulateur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Extraction.manipulateur", new PropertyModel<Personne>(
+ extractionModel, "manipulateur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- add(new Label("Extraction.date", new PropertyModel<Date>(extractionModel, "date"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Extraction.date", new PropertyModel<Date>(extractionModel, "date"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Lot>("Extraction.lot", new PropertyModel<Lot>(extractionModel, "lot"),
- getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadLotPage(getModelObject().getIdLot(), currentPage));
- }
- });
- add(new Label("Extraction.masseDepart", new DisplayDecimalPropertyModel(extractionModel, "masseDepart",
- DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Extraction.complement", new PropertyModel<String>(extractionModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new PropertyLabelLinkPanel<Lot>("Extraction.lot", new PropertyModel<Lot>(extractionModel, "lot"),
+ getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadLotPage(getModelObject().getIdLot(), currentPage));
+ }
+ });
+ add(new Label("Extraction.masseDepart", new DisplayDecimalPropertyModel(extractionModel, "masseDepart",
+ DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Extraction.complement", new PropertyModel<String>(extractionModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Extraction.createur", new PropertyModel<Personne>(extractionModel,
- "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Extraction.createur", new PropertyModel<Personne>(extractionModel,
+ "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- // Méthode d'extraction
- add(new MultiLineLabel("Extraction.methode.description", new PropertyModel<String>(extractionModel,
- "methode.description")).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Extraction.methode.nom", new PropertyModel<MethodeExtraction>(extractionModel, "methode"))
- .add(new ReplaceEmptyLabelBehavior()));
+ // Méthode d'extraction
+ add(new MultiLineLabel("Extraction.methode.description", new PropertyModel<String>(extractionModel,
+ "methode.description")).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Extraction.methode.nom", new PropertyModel<MethodeExtraction>(extractionModel, "methode"))
+ .add(new ReplaceEmptyLabelBehavior()));
- // Déclaration tableau des extraits
- extraitsTable = new WebMarkupContainer("Extraction.extraits.Table") {
- @Override
- public boolean isVisible() {
- return extractionModel.getObject().getExtraits().size() > 0;
- }
- };
- extraitsTable.setOutputMarkupId(true);
+ // Déclaration tableau des extraits
+ extraitsTable = new WebMarkupContainer("Extraction.extraits.Table") {
+ @Override
+ public boolean isVisible() {
+ return extractionModel.getObject().getExtraits().size() > 0;
+ }
+ };
+ extraitsTable.setOutputMarkupId(true);
- // Contenu tableaux extrait
- // Liste des types extraits ajoutés
- extraitsTable.add(new ListView<Extrait>("Extraction.extraits.List", new PropertyModel<List<Extrait>>(
- extractionModel, "sortedExtraits")) {
- @Override
- protected void populateItem(ListItem<Extrait> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Contenu tableaux extrait
+ // Liste des types extraits ajoutés
+ extraitsTable.add(new ListView<Extrait>("Extraction.extraits.List", new PropertyModel<List<Extrait>>(
+ extractionModel, "sortedExtraits")) {
+ @Override
+ protected void populateItem(ListItem<Extrait> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- IModel<Extrait> extraitModel = item.getModel();
- final Extrait extrait = item.getModelObject();
- // Colonnes
- item.add(new Label("Extraction.extraits.List.typeExtrait", new PropertyModel<String>(extrait,
- "typeExtrait")));
- // info-bulle comprenant la description du type d'extrait
- item.add(new SimpleTooltipPanel("Extraction.extraits.List.typeExtrait.info", new PropertyModel<String>(
- extrait, "typeExtrait.description")));
- item.add(new Label("Extraction.extraits.List.ref", new PropertyModel<String>(extrait, "ref")));
- item.add(new Label("Extraction.extraits.List.masseObtenue", new DisplayDecimalPropertyModel(
- extraitModel, "masseObtenue", DecimalDisplFormat.SMALL, getLocale())));
+ IModel<Extrait> extraitModel = item.getModel();
+ final Extrait extrait = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Extraction.extraits.List.typeExtrait", new PropertyModel<String>(extrait,
+ "typeExtrait")));
+ // info-bulle comprenant la description du type d'extrait
+ item.add(new SimpleTooltipPanel("Extraction.extraits.List.typeExtrait.info", new PropertyModel<String>(
+ extrait, "typeExtrait.description")));
+ item.add(new Label("Extraction.extraits.List.ref", new PropertyModel<String>(extrait, "ref")));
+ item.add(new Label("Extraction.extraits.List.masseObtenue", new DisplayDecimalPropertyModel(
+ extraitModel, "masseObtenue", DecimalDisplFormat.SMALL, getLocale())));
- item.add(new Label("Extraction.extraits.List.rendement", new DisplayPercentPropertyModel(extraitModel,
- "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
- }
- });
- add(extraitsTable);
+ item.add(new Label("Extraction.extraits.List.rendement", new DisplayPercentPropertyModel(extraitModel,
+ "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ }
+ });
+ add(extraitsTable);
- // Selon la non existence d'elements dans la liste on affiche le span
- add(new WebMarkupContainer("Extraction.extraits.noTable") {
- @Override
- public boolean isVisible() {
- return !extraitsTable.isVisible();
- }
- });
+ // Selon la non existence d'elements dans la liste on affiche le span
+ add(new WebMarkupContainer("Extraction.extraits.noTable") {
+ @Override
+ public boolean isVisible() {
+ return !extraitsTable.isVisible();
+ }
+ });
- // Formulaire des actions
- final Form<Void> formView = new Form<Void>("Form");
+ // Formulaire des actions
+ final Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<Extraction> updateLink = new Link<Extraction>(getResource() + ".Extraction.Update", new Model<Extraction>(
- extractionModel.getObject())) {
- @Override
- public void onClick() {
- setResponsePage(new ManageExtractionPage(getModelObject().getIdExtraction(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(extractionService.updateOrdeleteExtractionEnabled(extractionModel.getObject(),
- getSession().getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Extraction> updateLink = new Link<Extraction>(getResource() + ".Extraction.Update", new Model<Extraction>(
+ extractionModel.getObject())) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageExtractionPage(getModelObject().getIdExtraction(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(extractionService.updateOrdeleteExtractionEnabled(extractionModel.getObject(),
+ getSession().getUtilisateur()));
+ formView.add(updateLink);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageExtractionPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- extractionService.deleteExtraction(extractionModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageExtractionPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ extractionService.deleteExtraction(extractionModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageExtractionPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(extractionService.updateOrdeleteExtractionEnabled(
- extractionModel.getObject(), getSession().getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageExtractionPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(extractionService.updateOrdeleteExtractionEnabled(
+ extractionModel.getObject(), getSession().getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- // Action : retour
- formView.add(new Link<Void>(getResource() + ".Extraction.Back") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- add(formView);
- }
+ // Action : retour
+ formView.add(new Link<Void>(getResource() + ".Extraction.Back") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ListLotsPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -66,127 +66,127 @@
@AuthRoles( { AuthRole.ADMIN, AuthRole.USER })
public final class ListLotsPage extends TemplatePage {
- /** Service : lot */
- @SpringBean
- private LotService lotService;
+ /** Service : lot */
+ @SpringBean
+ private LotService lotService;
- /**
- * Constructeur
- */
- public ListLotsPage() {
- super(ListLotsPage.class);
- final CallerPage currentPage = new CallerPage(ListLotsPage.class);
+ /**
+ * Constructeur
+ */
+ public ListLotsPage() {
+ super(ListLotsPage.class);
+ final CallerPage currentPage = new CallerPage(ListLotsPage.class);
- add(new Link<Void>(getResource() + ".NewLot") {
- @Override
- public void onClick() {
- setResponsePage(new ManageLotPage(currentPage, true));
- }
- });
+ add(new Link<Void>(getResource() + ".NewLot") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageLotPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer lotsRefresh = new WebMarkupContainer(getResource() + ".Lots.Refresh");
- lotsRefresh.setOutputMarkupId(true);
- add(lotsRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer lotsRefresh = new WebMarkupContainer(getResource() + ".Lots.Refresh");
+ lotsRefresh.setOutputMarkupId(true);
+ add(lotsRefresh);
- // Liste des lots
- final List<Lot> lots = lotService.listLots(getSession().getUtilisateur());
+ // Liste des lots
+ final List<Lot> lots = lotService.listLots(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
- lots, getSession().getLocale());
+ LoadableDetachableSortableListDataProvider<Lot> lotsDataProvider = new LoadableDetachableSortableListDataProvider<Lot>(
+ lots, getSession().getLocale());
- List<IColumn<Lot>> columns = new ArrayList<IColumn<Lot>>();
+ List<IColumn<Lot>> columns = new ArrayList<IColumn<Lot>>();
- columns.add(new LinkableImagePropertyColumn<Lot>("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 LinkableImagePropertyColumn<Lot>("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",
- 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",
+ 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 PropertyColumn<Lot>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
- "dateRecolte"));
+ columns.add(new PropertyColumn<Lot>(new Model<String>(getString("Lot.dateRecolte2")), "dateRecolte",
+ "dateRecolte"));
- columns.add(new LinkPropertyColumn<Lot>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Lot>(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));
+ }
+ });
- columns.add(new LinkPropertyColumn<Lot>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Lot>(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));
+ }
+ });
- columns.add(new EnumPropertyColumn<Lot>(new Model<String>(getString("Specimen.typeOrganisme")),
- "specimenRef.typeOrganisme", "specimenRef.typeOrganisme", ListLotsPage.this));
+ columns.add(new EnumPropertyColumn<Lot>(new Model<String>(getString("Specimen.typeOrganisme")),
+ "specimenRef.typeOrganisme", "specimenRef.typeOrganisme", ListLotsPage.this));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.embranchement")),
- "specimenRef.embranchement", "specimenRef.embranchement"));
+ columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.embranchement")),
+ "specimenRef.embranchement", "specimenRef.embranchement"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.famille")),
- "specimenRef.famille", "specimenRef.famille"));
+ columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.famille")),
+ "specimenRef.famille", "specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.genre")),
- "specimenRef.genre", "specimenRef.genre"));
+ columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.genre")),
+ "specimenRef.genre", "specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<Lot>(new Model<String>(getString("Specimen.espece")),
- "specimenRef.espece", "specimenRef.espece"));
+ columns.add(new TaxonomyPropertyColumn<Lot>(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>(new Model<String>(getString("Lot.partie")), "partie", "partie"));
- columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
- "masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseFraiche2")), "masseFraiche",
+ "masseFraiche", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
- "masseSeche", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<Lot>(new Model<String>(getString("Lot.masseSeche2")), "masseSeche",
+ "masseSeche", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new LinkPropertyColumn<Lot>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Lot>(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));
+ }
+ });
- columns.add(new MapValuePropertyColumn<Lot, String>(new Model<String>(getString("Campagne.codePays")),
- "campagne.codePays", "campagne.codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<Lot, 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")) {
- // 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())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ columns.add(new LinkableImagePropertyColumn<Lot>("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) {
+ if (lotService.updateOrdeleteLotEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
- setResponsePage(new ManageLotPage(model.getObject().getIdLot(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Lot>> item, String componentId, IModel<Lot> model) {
+ setResponsePage(new ManageLotPage(model.getObject().getIdLot(), currentPage));
+ }
+ });
- final DataTable<Lot> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot>("ListLotsPage.Lots", columns,
- lotsDataProvider, WebContext.ROWS_PER_PAGE);
- lotsRefresh.add(lotsDataTable);
+ final DataTable<Lot> lotsDataTable = new AjaxFallbackDefaultDataTable<Lot>("ListLotsPage.Lots", columns,
+ lotsDataProvider, WebContext.ROWS_PER_PAGE);
+ lotsRefresh.add(lotsDataTable);
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ManageLotPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ManageLotPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ManageLotPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -80,364 +80,364 @@
@AuthRoles({ AuthRole.USER, AuthRole.ADMIN })
public final class ManageLotPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Campagnes */
- private final List<Campagne> campagnes;
+ /** Campagnes */
+ private final List<Campagne> campagnes;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Modèle : lot */
- private final IModel<Lot> lotModel;
+ /** Modèle : lot */
+ private final IModel<Lot> lotModel;
- /** Service : lot */
- @SpringBean
- private LotService lotService;
+ /** Service : lot */
+ @SpringBean
+ private LotService lotService;
- /** Spécimens */
- private final List<Specimen> specimens;
+ /** Spécimens */
+ private final List<Specimen> specimens;
- /** Service : specimen */
- @SpringBean
- private SpecimenService specimenService;
+ /** Service : specimen */
+ @SpringBean
+ private SpecimenService specimenService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageLotPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageLotPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idLot ID lot
- * @param callerPage Page appelante
- */
- public ManageLotPage(Integer idLot, CallerPage callerPage) {
- this(idLot, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idLot ID lot
+ * @param callerPage Page appelante
+ */
+ public ManageLotPage(Integer idLot, CallerPage callerPage) {
+ this(idLot, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie du lot suivante)
- * @param lot Lot
- * @param callerPage Page appelante
- */
- public ManageLotPage(Lot lot, CallerPage callerPage) {
- this(null, lot, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie du lot suivante)
+ * @param lot Lot
+ * @param callerPage Page appelante
+ */
+ public ManageLotPage(Lot lot, CallerPage callerPage) {
+ this(null, lot, callerPage, true);
+ }
- /**
- * Constructeur. Si idLot et lot sont null, on créée un nouveau Lot. Si idLot est renseigné, on édite le lot
- * correspondant. Si lot est renseigné, on créée un nouveau lot à partir des informations qu'il contient.
- * @param idLot ID lot
- * @param lot Lot
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManageLotPage(Integer idLot, Lot lot, final CallerPage callerPage, boolean multipleEntry) {
- super(ManageLotPage.class);
- assert idLot == null || lot == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si idLot et lot sont null, on créée un nouveau Lot. Si idLot est renseigné, on édite le lot
+ * correspondant. Si lot est renseigné, on créée un nouveau lot à partir des informations qu'il contient.
+ * @param idLot ID lot
+ * @param lot Lot
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManageLotPage(Integer idLot, Lot lot, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManageLotPage.class);
+ assert idLot == null || lot == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- final CallerPage currentPage = new CallerPage(this);
+ final CallerPage currentPage = new CallerPage(this);
- // Initialisation du modèle
- try {
- lotModel = new Model<Lot>(idLot == null && lot == null ? new Lot() : lot != null ? lot
- : lotService.loadLot(idLot));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Initialisation du modèle
+ try {
+ lotModel = new Model<Lot>(idLot == null && lot == null ? new Lot() : lot != null ? lot
+ : lotService.loadLot(idLot));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- boolean createMode = idLot == null;
- if (createMode) {
- lotModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ boolean createMode = idLot == null;
+ if (createMode) {
+ lotModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes
- campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
- specimens = specimenService.listSpecimens(getSession().getUtilisateur());
+ // Initialisation des listes
+ campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
+ specimens = specimenService.listSpecimens(getSession().getUtilisateur());
- List<Partie> parties = lotService.listParties();
+ List<Partie> parties = lotService.listParties();
- if (lot != null) {
- // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
- // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
- // l'égalité entre les objets)
- lotModel.getObject().setCampagne(
- CollectionTools.findWithValue(campagnes, "idCampagne", AccessType.GETTER, lotModel.getObject()
- .getCampagne().getIdCampagne()));
- // normalement pas nul car un bean campagne (le modèle donné en l'occurence) bien formé comporte une
- // campagne de renseigné
- if (lotModel.getObject().getCampagne() != null) {
- List<Station> stations = lotModel.getObject().getCampagne().getStations();
- lotModel.getObject().setStation(
- CollectionTools.findWithValue(stations, "idStation", AccessType.GETTER, lotModel.getObject()
- .getStation().getIdStation()));
- }
- if (lotModel.getObject().getPartie() != null) {
- lotModel.getObject().setPartie(
- CollectionTools.findWithValue(parties, "idPartie", AccessType.GETTER, lotModel.getObject()
- .getPartie().getIdPartie()));
- }
- } else if (idLot != null) {
+ if (lot != null) {
+ // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
+ // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
+ // l'égalité entre les objets)
+ lotModel.getObject().setCampagne(
+ CollectionTools.findWithValue(campagnes, "idCampagne", AccessType.GETTER, lotModel.getObject()
+ .getCampagne().getIdCampagne()));
+ // normalement pas nul car un bean campagne (le modèle donné en l'occurence) bien formé comporte une
+ // campagne de renseigné
+ if (lotModel.getObject().getCampagne() != null) {
+ List<Station> stations = lotModel.getObject().getCampagne().getStations();
+ lotModel.getObject().setStation(
+ CollectionTools.findWithValue(stations, "idStation", AccessType.GETTER, lotModel.getObject()
+ .getStation().getIdStation()));
+ }
+ if (lotModel.getObject().getPartie() != null) {
+ lotModel.getObject().setPartie(
+ CollectionTools.findWithValue(parties, "idPartie", AccessType.GETTER, lotModel.getObject()
+ .getPartie().getIdPartie()));
+ }
+ } else if (idLot != null) {
- }
+ }
- final Form<Void> formView = new Form<Void>("Form");
- DropDownChoice<Campagne> campagnesInput = new DropDownChoice<Campagne>("Lot.campagne",
- new PropertyModel<Campagne>(lotModel, "campagne"), campagnes);
- campagnesInput.setNullValid(false);
- formView.add(campagnesInput);
+ final Form<Void> formView = new Form<Void>("Form");
+ DropDownChoice<Campagne> campagnesInput = new DropDownChoice<Campagne>("Lot.campagne",
+ new PropertyModel<Campagne>(lotModel, "campagne"), campagnes);
+ campagnesInput.setNullValid(false);
+ formView.add(campagnesInput);
- // Action : création d'une nouvelle campagne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewCampagne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManageCampagnePage(currentPage, false));
- }
+ // Action : création d'une nouvelle campagne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewCampagne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManageCampagnePage(currentPage, false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageCampagnePage(currentPage, false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageCampagnePage(currentPage, false));
+ }
+ });
- final DropDownChoice<Station> stationsInput = new DropDownChoice<Station>("Lot.station",
- new PropertyModel<Station>(lotModel, "station"),
- lotModel.getObject().getCampagne() == null ? new ArrayList<Station>() : lotModel.getObject()
- .getCampagne().getStations());
- stationsInput.setOutputMarkupId(true);
- stationsInput.setNullValid(false);
- stationsInput.setEnabled(lotModel.getObject().getCampagne() != null);
- formView.add(stationsInput);
- formView.add(new SimpleTooltipPanel("Lot.station.info", new Model<String>(getString("Lot.station.info"))));
+ final DropDownChoice<Station> stationsInput = new DropDownChoice<Station>("Lot.station",
+ new PropertyModel<Station>(lotModel, "station"),
+ lotModel.getObject().getCampagne() == null ? new ArrayList<Station>() : lotModel.getObject()
+ .getCampagne().getStations());
+ stationsInput.setOutputMarkupId(true);
+ stationsInput.setNullValid(false);
+ stationsInput.setEnabled(lotModel.getObject().getCampagne() != null);
+ formView.add(stationsInput);
+ formView.add(new SimpleTooltipPanel("Lot.station.info", new Model<String>(getString("Lot.station.info"))));
- campagnesInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- List<Station> stations = new ArrayList<Station>();
- if (lotModel.getObject().getCampagne() != null) {
- campagneService.refreshCampagne(lotModel.getObject().getCampagne());
- stations = lotModel.getObject().getCampagne().getSortedStations();
- }
- stationsInput.setChoices(stations);
- stationsInput.setEnabled(lotModel.getObject().getCampagne() != null);
- lotModel.getObject().setStation(null);
- // refresh the station choices component
- target.add(stationsInput);
- }
- });
+ campagnesInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ List<Station> stations = new ArrayList<Station>();
+ if (lotModel.getObject().getCampagne() != null) {
+ campagneService.refreshCampagne(lotModel.getObject().getCampagne());
+ stations = lotModel.getObject().getCampagne().getSortedStations();
+ }
+ stationsInput.setChoices(stations);
+ stationsInput.setEnabled(lotModel.getObject().getCampagne() != null);
+ lotModel.getObject().setStation(null);
+ // refresh the station choices component
+ target.add(stationsInput);
+ }
+ });
- formView.add(new DateTextField("Lot.dateRecolte", new PropertyModel<Date>(lotModel, "dateRecolte"))
- .add(new DatePicker()));
- formView.add(new TextField<String>("Lot.ref", new PropertyModel<String>(lotModel, "ref")));
- formView.add(new DropDownChoice<Specimen>("Lot.specimenRef", new PropertyModel<Specimen>(lotModel,
- "specimenRef"), specimens).setNullValid(false));
+ formView.add(new DateTextField("Lot.dateRecolte", new PropertyModel<Date>(lotModel, "dateRecolte"))
+ .add(new DatePicker()));
+ formView.add(new TextField<String>("Lot.ref", new PropertyModel<String>(lotModel, "ref")));
+ formView.add(new DropDownChoice<Specimen>("Lot.specimenRef", new PropertyModel<Specimen>(lotModel,
+ "specimenRef"), specimens).setNullValid(false));
- // Action : création d'un nouveau spécimen
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewSpecimen") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManageSpecimenPage(currentPage, false));
- }
+ // Action : création d'un nouveau spécimen
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewSpecimen") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManageSpecimenPage(currentPage, false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageSpecimenPage(currentPage, false));
- }
- });
- formView.add(new DropDownChoice<Partie>("Lot.partie", new PropertyModel<Partie>(lotModel, "partie"), parties)
- .setNullValid(true));
- formView.add(new TextField<BigDecimal>("Lot.masseFraiche", new PropertyModel<BigDecimal>(lotModel,
- "masseFraiche")));
- formView.add(new TextField<BigDecimal>("Lot.masseSeche", new PropertyModel<BigDecimal>(lotModel, "masseSeche")));
- formView.add(new CheckBox("Lot.echantillonColl", new PropertyModel<Boolean>(lotModel, "echantillonColl")));
- formView.add(new CheckBox("Lot.echantillonIdent", new PropertyModel<Boolean>(lotModel, "echantillonIdent")));
- formView.add(new CheckBox("Lot.echantillonPhylo", new PropertyModel<Boolean>(lotModel, "echantillonPhylo")));
- formView.add(new TextArea<String>("Lot.complement", new PropertyModel<String>(lotModel, "complement")));
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageSpecimenPage(currentPage, false));
+ }
+ });
+ formView.add(new DropDownChoice<Partie>("Lot.partie", new PropertyModel<Partie>(lotModel, "partie"), parties)
+ .setNullValid(true));
+ formView.add(new TextField<BigDecimal>("Lot.masseFraiche", new PropertyModel<BigDecimal>(lotModel,
+ "masseFraiche")));
+ formView.add(new TextField<BigDecimal>("Lot.masseSeche", new PropertyModel<BigDecimal>(lotModel, "masseSeche")));
+ formView.add(new CheckBox("Lot.echantillonColl", new PropertyModel<Boolean>(lotModel, "echantillonColl")));
+ formView.add(new CheckBox("Lot.echantillonIdent", new PropertyModel<Boolean>(lotModel, "echantillonIdent")));
+ formView.add(new CheckBox("Lot.echantillonPhylo", new PropertyModel<Boolean>(lotModel, "echantillonPhylo")));
+ formView.add(new TextArea<String>("Lot.complement", new PropertyModel<String>(lotModel, "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Lot.createur", new PropertyModel<String>(lotModel, "createur"))
- .setEnabled(false));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Lot.createur", new PropertyModel<String>(lotModel, "createur"))
+ .setEnabled(false));
- // Action : création du lot
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.createLot(lotModel.getObject());
- }
+ // Action : création du lot
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.createLot(lotModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : mise à jour du lot
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.updateLot(lotModel.getObject());
- }
+ // Action : mise à jour du lot
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.updateLot(lotModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode
- && lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession().getUtilisateur()));
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode
+ && lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession().getUtilisateur()));
+ formView.add(updateButton);
- // Action : suppression du lot
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.deleteLot(lotModel.getObject());
- }
+ // Action : suppression du lot
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.deleteLot(lotModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode
- && lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession().getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode
+ && lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession().getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) this.getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) this.getPage());
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Station, Spécimen ou Campagne)
- refreshModel();
- super.onBeforeRender();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Station, Spécimen ou Campagne)
+ refreshModel();
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection vers l'écran de saisie d'un nouveau lot, en fournissant déjà quelques données
- Lot nextLot = new Lot();
- nextLot.setCampagne(lotModel.getObject().getCampagne());
- nextLot.setStation(lotModel.getObject().getStation());
- nextLot.setDateRecolte(lotModel.getObject().getDateRecolte());
- nextLot.setPartie(lotModel.getObject().getPartie());
- setResponsePage(new ManageLotPage(nextLot, callerPage));
- } else if (callerPage != null) {
- // On passe l'id du lot associé à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Lot.class.getSimpleName(), lotModel.getObject().getIdLot());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection vers l'écran de saisie d'un nouveau lot, en fournissant déjà quelques données
+ Lot nextLot = new Lot();
+ nextLot.setCampagne(lotModel.getObject().getCampagne());
+ nextLot.setStation(lotModel.getObject().getStation());
+ nextLot.setDateRecolte(lotModel.getObject().getDateRecolte());
+ nextLot.setPartie(lotModel.getObject().getPartie());
+ setResponsePage(new ManageLotPage(nextLot, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id du lot associé à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Lot.class.getSimpleName(), lotModel.getObject().getIdLot());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Refresh model
- */
- private void refreshModel() {
+ /**
+ * Refresh model
+ */
+ private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Campagne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(campagnes, campagneService.listCampagnes(getSession().getUtilisateur()));
- try {
- Campagne createdCampagne = campagneService.loadCampagne(getPageParameters().get(key).toInt());
- lotModel.getObject().setCampagne(createdCampagne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Campagne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(campagnes, campagneService.listCampagnes(getSession().getUtilisateur()));
+ try {
+ Campagne createdCampagne = campagneService.loadCampagne(getPageParameters().get(key).toInt());
+ lotModel.getObject().setCampagne(createdCampagne);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
- key = Specimen.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(specimens, specimenService.listSpecimens(getSession().getUtilisateur()));
- try {
- Specimen createdSpecimen = specimenService.loadSpecimen(getPageParameters().get(key).toInt());
- lotModel.getObject().setSpecimenRef(createdSpecimen);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
- }
+ key = Specimen.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(specimens, specimenService.listSpecimens(getSession().getUtilisateur()));
+ try {
+ Specimen createdSpecimen = specimenService.loadSpecimen(getPageParameters().get(key).toInt());
+ lotModel.getObject().setSpecimenRef(createdSpecimen);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- if (lotModel.getObject().getCreateur() == null) {
- lotModel.getObject().setCreateur(getSession().getUtilisateur());
- }
- addValidationErrors(validator.validate(lotModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ if (lotModel.getObject().getCreateur() == null) {
+ lotModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
+ addValidationErrors(validator.validate(lotModel.getObject(), getSession().getLocale()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ReadLotPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ReadLotPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/lot/ReadLotPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -61,131 +61,131 @@
*/
public final class ReadLotPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Modèle : lot */
- private final IModel<Lot> lotModel;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Modèle : lot */
+ private final IModel<Lot> lotModel;
- /** Service : lot */
- @SpringBean
- private LotService lotService;
+ /** Service : lot */
+ @SpringBean
+ private LotService lotService;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /**
- * Constructeur
- * @param idLot ID lot
- * @param callerPage Page appelante
- */
- public ReadLotPage(Integer idLot, final CallerPage callerPage) {
- super(ReadLotPage.class);
- this.callerPage = callerPage;
- final CallerPage currentPage = new CallerPage(this);
+ /**
+ * Constructeur
+ * @param idLot ID lot
+ * @param callerPage Page appelante
+ */
+ public ReadLotPage(Integer idLot, final CallerPage callerPage) {
+ super(ReadLotPage.class);
+ this.callerPage = callerPage;
+ final CallerPage currentPage = new CallerPage(this);
- // Initialisation du modèle
- lotModel = new GenericLoadableDetachableModel<Lot>(Lot.class, idLot);
+ // Initialisation du modèle
+ lotModel = new GenericLoadableDetachableModel<Lot>(Lot.class, idLot);
- add(new PropertyLabelLinkPanel<Campagne>("Lot.campagne", new PropertyModel<Campagne>(lotModel, "campagne"),
- getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Campagne>("Lot.campagne", new PropertyModel<Campagne>(lotModel, "campagne"),
+ getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), currentPage));
+ }
+ });
- add(new PropertyLabelLinkPanel<Station>("Lot.station", new PropertyModel<Station>(lotModel, "station"),
- getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Station>("Lot.station", new PropertyModel<Station>(lotModel, "station"),
+ getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
+ }
+ });
- add(new Label("Lot.dateRecolte", new PropertyModel<String>(lotModel, "dateRecolte")) // formatShortDateValue(lotModel.getDateRecolte()))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.ref", new PropertyModel<String>(lotModel, "ref")).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.dateRecolte", new PropertyModel<String>(lotModel, "dateRecolte")) // formatShortDateValue(lotModel.getDateRecolte()))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.ref", new PropertyModel<String>(lotModel, "ref")).add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Specimen>("Lot.specimenRef",
- new PropertyModel<Specimen>(lotModel, "specimenRef"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadSpecimenPage(getModelObject().getIdSpecimen(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Specimen>("Lot.specimenRef",
+ new PropertyModel<Specimen>(lotModel, "specimenRef"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadSpecimenPage(getModelObject().getIdSpecimen(), currentPage));
+ }
+ });
- add(new Label("Lot.partie", new PropertyModel<String>(lotModel, "partie")).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.masseFraiche", new DisplayDecimalPropertyModel(lotModel, "masseFraiche",
- DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.masseSeche", new DisplayDecimalPropertyModel(lotModel, "masseSeche",
- DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.echantillonColl", new DisplayBooleanPropertyModel(lotModel, "echantillonColl", this))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.echantillonIdent", new DisplayBooleanPropertyModel(lotModel, "echantillonIdent", this))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Lot.echantillonPhylo", new DisplayBooleanPropertyModel(lotModel, "echantillonPhylo", this))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Lot.complement", new PropertyModel<String>(lotModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.partie", new PropertyModel<String>(lotModel, "partie")).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.masseFraiche", new DisplayDecimalPropertyModel(lotModel, "masseFraiche",
+ DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.masseSeche", new DisplayDecimalPropertyModel(lotModel, "masseSeche",
+ DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.echantillonColl", new DisplayBooleanPropertyModel(lotModel, "echantillonColl", this))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.echantillonIdent", new DisplayBooleanPropertyModel(lotModel, "echantillonIdent", this))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Lot.echantillonPhylo", new DisplayBooleanPropertyModel(lotModel, "echantillonPhylo", this))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Lot.complement", new PropertyModel<String>(lotModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Lot.createur", new PropertyModel<Personne>(lotModel, "createur"),
- getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Lot.createur", new PropertyModel<Personne>(lotModel, "createur"),
+ getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- // Formulaire des actions
- final Form<Void> formView = new Form<Void>("Form");
+ // Formulaire des actions
+ final Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<Lot> updateLink = new Link<Lot>(getResource() + ".Lot.Update", new Model<Lot>(lotModel.getObject())) {
- @Override
- public void onClick() {
- setResponsePage(new ManageLotPage(getModelObject().getIdLot(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Lot> updateLink = new Link<Lot>(getResource() + ".Lot.Update", new Model<Lot>(lotModel.getObject())) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageLotPage(getModelObject().getIdLot(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageLotPage.class, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- lotService.deleteLot(lotModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageLotPage.class, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ lotService.deleteLot(lotModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageLotPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageLotPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(lotService.updateOrdeleteLotEnabled(lotModel.getObject(), getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- // Action : retour
- formView.add(new Link<Void>(getResource() + ".Lot.Back") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- add(formView);
- }
+ // Action : retour
+ formView.add(new Link<Void>(getResource() + ".Lot.Back") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -93,118 +93,118 @@
@AuthRoles({ AuthRole.USER, AuthRole.ADMIN })
public final class ManageMoleculePage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Campagnes */
- private final List<Campagne> campagnes;
+ /** Campagnes */
+ private final List<Campagne> campagnes;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Service : produit */
- @SpringBean
- private ProduitService produitService;
+ /** Service : produit */
+ @SpringBean
+ private ProduitService produitService;
- /** Modèle : molecule */
- private final IModel<Molecule> moleculeModel;
+ /** Modèle : molecule */
+ private final IModel<Molecule> moleculeModel;
- /** Modèle to add new provenance. */
- private Model<MoleculeProvenance> newProvenanceModel;
+ /** Modèle to add new provenance. */
+ private Model<MoleculeProvenance> newProvenanceModel;
- /** Service : molecule */
- @SpringBean
- private MoleculeService moleculeService;
+ /** Service : molecule */
+ @SpringBean
+ private MoleculeService moleculeService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
-
- /** Bouton d'ajout d'une provenance **/
+ /** Page appelante */
+ private final CallerPage callerPage;
+
+ /** Bouton d'ajout d'une provenance **/
Button addProvenanceButton;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageMoleculePage(CallerPage callerPage) {
- this(null, callerPage);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageMoleculePage(CallerPage callerPage) {
+ this(null, callerPage);
+ }
- /**
- * Constructeur. Si idMolecule est null, on créée une nouvelle Molecule. Si idMolecule est renseigné, on édite la molecule
- * correspondante.
- * @param idMolecule ID molecule
- * @param lot Lot
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageMoleculePage(Integer idMolecule, final CallerPage callerPage) {
- super(ManageMoleculePage.class);
- this.callerPage = callerPage;
+ /**
+ * Constructeur. Si idMolecule est null, on créée une nouvelle Molecule. Si idMolecule est renseigné, on édite la molecule
+ * correspondante.
+ * @param idMolecule ID molecule
+ * @param lot Lot
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageMoleculePage(Integer idMolecule, final CallerPage callerPage) {
+ super(ManageMoleculePage.class);
+ this.callerPage = callerPage;
- final CallerPage currentPage = new CallerPage(this);
+ final CallerPage currentPage = new CallerPage(this);
- newProvenanceModel = new Model<MoleculeProvenance>(new MoleculeProvenance());
+ newProvenanceModel = new Model<MoleculeProvenance>(new MoleculeProvenance());
- // Initialisation du modèle
- try {
- moleculeModel = new Model<Molecule>(idMolecule == null ? new Molecule() : moleculeService.loadMolecule(idMolecule));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Initialisation du modèle
+ try {
+ moleculeModel = new Model<Molecule>(idMolecule == null ? new Molecule() : moleculeService.loadMolecule(idMolecule));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- boolean createMode = idMolecule == null;
- if (createMode) {
- moleculeModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ boolean createMode = idMolecule == null;
+ if (createMode) {
+ moleculeModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes
- List<String> organismes = moleculeService.listMoleculeOrganisme();
- campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
+ // Initialisation des listes
+ List<String> organismes = moleculeService.listMoleculeOrganisme();
+ campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
- final Form<Void> formView = new Form<Void>("Form");
- initProvenanceFields(formView, currentPage);
-
- formView.add(new TextField<String>("Molecule.nomCommun", new PropertyModel<String>(moleculeModel, "nomCommun")));
- formView.add(new TextField<String>("Molecule.familleChimique", new PropertyModel<String>(moleculeModel, "familleChimique")));
- formView.add(new HiddenField<String>("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol"))
+ final Form<Void> formView = new Form<Void>("Form");
+ initProvenanceFields(formView, currentPage);
+
+ formView.add(new TextField<String>("Molecule.nomCommun", new PropertyModel<String>(moleculeModel, "nomCommun")));
+ formView.add(new TextField<String>("Molecule.familleChimique", new PropertyModel<String>(moleculeModel, "familleChimique")));
+ formView.add(new HiddenField<String>("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol"))
.add(new MoleculeEditorBehavior(new PropertyModel<String>(moleculeModel, "formuleDevMol")))); //moleculeModel.getObject().getFormuleDevMol())));
- formView.add(new TextField<String>("Molecule.nomIupca", new PropertyModel<String>(moleculeModel, "nomIupca")));
- formView.add(new TextField<String>("Molecule.formuleBrute", new PropertyModel<String>(moleculeModel, "formuleBrute")));
-
- TextField<String> masseMolaireField = new TextField<String>("Molecule.masseMolaire", new PropertyModel<String>(moleculeModel, "masseMolaire"));
- masseMolaireField.setRequired(true);
- formView.add(masseMolaireField);
-
+ formView.add(new TextField<String>("Molecule.nomIupca", new PropertyModel<String>(moleculeModel, "nomIupca")));
+ formView.add(new TextField<String>("Molecule.formuleBrute", new PropertyModel<String>(moleculeModel, "formuleBrute")));
+
+ TextField<String> masseMolaireField = new TextField<String>("Molecule.masseMolaire", new PropertyModel<String>(moleculeModel, "masseMolaire"));
+ masseMolaireField.setRequired(true);
+ formView.add(masseMolaireField);
+
- // div qui englobe les champs visible ssi nouvMolecul est coché
- final MarkupContainer nouvMoleculRefresh = new WebMarkupContainer("Molecule.nouvMolecul.Refresh");
- nouvMoleculRefresh.setOutputMarkupId(true);
- nouvMoleculRefresh.setVisible(moleculeModel.getObject().isNouvMolecul());
- formView.add(nouvMoleculRefresh);
+ // div qui englobe les champs visible ssi nouvMolecul est coché
+ final MarkupContainer nouvMoleculRefresh = new WebMarkupContainer("Molecule.nouvMolecul.Refresh");
+ nouvMoleculRefresh.setOutputMarkupId(true);
+ nouvMoleculRefresh.setVisible(moleculeModel.getObject().isNouvMolecul());
+ formView.add(nouvMoleculRefresh);
- // predéclaration des champs activé par la chec
- formView.add(new CheckBox("Molecule.nouvMolecul", new PropertyModel<Boolean>(moleculeModel, "nouvMolecul")) {
+ // predéclaration des champs activé par la chec
+ formView.add(new CheckBox("Molecule.nouvMolecul", new PropertyModel<Boolean>(moleculeModel, "nouvMolecul")) {
@Override
protected void onSelectionChanged(Boolean newSelection) {
nouvMoleculRefresh.setVisible(newSelection);
@@ -213,13 +213,13 @@
protected boolean wantOnSelectionChangedNotifications() {
return true;
}
- });
+ });
- AutoCompleteTextFieldString identifieeParInput = new AutoCompleteTextFieldString("Molecule.identifieePar",
- new PropertyModel<String>(moleculeModel, "identifieePar"), organismes, ComparisonMode.CONTAINS);
- nouvMoleculRefresh.add(identifieeParInput);
+ AutoCompleteTextFieldString identifieeParInput = new AutoCompleteTextFieldString("Molecule.identifieePar",
+ new PropertyModel<String>(moleculeModel, "identifieePar"), organismes, ComparisonMode.CONTAINS);
+ nouvMoleculRefresh.add(identifieeParInput);
- DropDownChoice<Campagne> campagnesInput = new DropDownChoice<Campagne>("Molecule.campagne",
+ DropDownChoice<Campagne> campagnesInput = new DropDownChoice<Campagne>("Molecule.campagne",
new PropertyModel<Campagne>(moleculeModel, "campagne"), campagnes);
//campagnesInput.setNullValid(false);
nouvMoleculRefresh.add(campagnesInput);
@@ -243,88 +243,88 @@
formView.add(new TextArea<String>("Molecule.complement", new PropertyModel<String>(moleculeModel, "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Molecule.createur", new PropertyModel<String>(moleculeModel, "createur"))
- .setEnabled(false));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Molecule.createur", new PropertyModel<String>(moleculeModel, "createur"))
+ .setEnabled(false));
- // Action : création du lot
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- moleculeService.createMolecule(moleculeModel.getObject());
- }
+ // Action : création du lot
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ moleculeService.createMolecule(moleculeModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : mise à jour du lot
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- moleculeService.updateMolecule(moleculeModel.getObject());
- }
+ // Action : mise à jour du lot
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ moleculeService.updateMolecule(moleculeModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression du lot
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- moleculeService.deleteMolecule(moleculeModel.getObject());
- }
+ // Action : suppression du lot
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ moleculeService.deleteMolecule(moleculeModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) this.getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) this.getPage());
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Init provenance table.
- *
- * @param formView
- */
- private void initProvenanceFields(final Form<Void> formView, final CallerPage currentPage) {
- // Déclaration tableau des provenances
+ /**
+ * Init provenance table.
+ *
+ * @param formView
+ */
+ private void initProvenanceFields(final Form<Void> formView, final CallerPage currentPage) {
+ // Déclaration tableau des provenances
final MarkupContainer provenanceTable = new WebMarkupContainer("Molecule.provenance.Table");
provenanceTable.setOutputMarkupId(true);
@@ -459,24 +459,24 @@
provenanceTable.add(addProvenanceButton);
formView.add(provenanceTable);
- }
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (callerPage != null) {
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (callerPage != null) {
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- if (moleculeModel.getObject().getCreateur() == null) {
- moleculeModel.getObject().setCreateur(getSession().getUtilisateur());
- }
- addValidationErrors(validator.validate(moleculeModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ if (moleculeModel.getObject().getCreateur() == null) {
+ moleculeModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
+ addValidationErrors(validator.validate(moleculeModel.getObject(), getSession().getLocale()));
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ListPersonnesPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -64,124 +64,124 @@
@AuthRoles( { AuthRole.ADMIN, AuthRole.USER })
public final class ListPersonnesPage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructeur
- */
- public ListPersonnesPage() {
- super(ListPersonnesPage.class);
+ /**
+ * Constructeur
+ */
+ public ListPersonnesPage() {
+ super(ListPersonnesPage.class);
- final CallerPage currentPage = new CallerPage(ListPersonnesPage.class);
+ final CallerPage currentPage = new CallerPage(ListPersonnesPage.class);
- // Lien pour créer une nouvelle personne
- add(new Link<Personne>(getResource() + ".NewPersonne") {
- @Override
- public void onClick() {
- setResponsePage(new ManagePersonnePage(currentPage, true));
- }
+ // Lien pour créer une nouvelle personne
+ add(new Link<Personne>(getResource() + ".NewPersonne") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManagePersonnePage(currentPage, true));
+ }
- });
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra rafraichir quand la liste évoluera
- final MarkupContainer personnesRefresh = new WebMarkupContainer(getResource() + ".Personnes.Refresh");
- personnesRefresh.setOutputMarkupId(true);
- add(personnesRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra rafraichir quand la liste évoluera
+ final MarkupContainer personnesRefresh = new WebMarkupContainer(getResource() + ".Personnes.Refresh");
+ personnesRefresh.setOutputMarkupId(true);
+ add(personnesRefresh);
- // Liste des personnes
- final List<Personne> personnes;
- if (getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
- personnes = personneService.listPersonnesWithInvalidUsers();
- } else {
- personnes = personneService.listPersonnes();
- }
+ // Liste des personnes
+ final List<Personne> personnes;
+ if (getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR) {
+ personnes = personneService.listPersonnesWithInvalidUsers();
+ } else {
+ personnes = personneService.listPersonnes();
+ }
- final LoadableDetachableSortableListDataProvider<Personne> personnesDataProvider = new LoadableDetachableSortableListDataProvider<Personne>(
- personnes, getSession().getLocale());
+ final LoadableDetachableSortableListDataProvider<Personne> personnesDataProvider = new LoadableDetachableSortableListDataProvider<Personne>(
+ personnes, getSession().getLocale());
- List<IColumn<Personne>> columns = new ArrayList<IColumn<Personne>>();
+ List<IColumn<Personne>> columns = new ArrayList<IColumn<Personne>>();
- columns.add(new LinkableImagePropertyColumn<Personne>("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) {
- setResponsePage(new ReadUtilisateurPage(model.getObject().getIdPersonne(), currentPage));
- } else { // sinon c'est une "Personne"
- assert (model.getObject() instanceof Personne);
- setResponsePage(new ReadPersonnePage(model.getObject().getIdPersonne(), currentPage));
- }
- }
- });
+ columns.add(new LinkableImagePropertyColumn<Personne>("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) {
+ setResponsePage(new ReadUtilisateurPage(model.getObject().getIdPersonne(), currentPage));
+ } else { // sinon c'est une "Personne"
+ assert (model.getObject() instanceof Personne);
+ setResponsePage(new ReadPersonnePage(model.getObject().getIdPersonne(), currentPage));
+ }
+ }
+ });
- columns.add(new PropertyColumn<Personne>(new Model<String>(getString("Personne.nom")), "nom", "nom"));
+ columns.add(new PropertyColumn<Personne>(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>(new Model<String>(getString("Personne.prenom")), "prenom", "prenom"));
- columns.add(new LinkPropertyColumn<Personne>(new Model<String>(getString("Personne.courriel")), "courriel",
- "courriel", getString("Read")) {
- @Override
- public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
- if (rowModel.getObject() instanceof Utilisateur) {
- setResponsePage(new ReadUtilisateurPage(rowModel.getObject().getIdPersonne(), currentPage));
- } else { // sinon c'est une "Personne"
- assert (rowModel.getObject() instanceof Personne);
- setResponsePage(new ReadPersonnePage(rowModel.getObject().getIdPersonne(), currentPage));
- }
- }
- });
+ columns.add(new LinkPropertyColumn<Personne>(new Model<String>(getString("Personne.courriel")), "courriel",
+ "courriel", getString("Read")) {
+ @Override
+ public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
+ if (rowModel.getObject() instanceof Utilisateur) {
+ setResponsePage(new ReadUtilisateurPage(rowModel.getObject().getIdPersonne(), currentPage));
+ } else { // sinon c'est une "Personne"
+ assert (rowModel.getObject() instanceof Personne);
+ setResponsePage(new ReadPersonnePage(rowModel.getObject().getIdPersonne(), currentPage));
+ }
+ }
+ });
- columns.add(new AbstractColumn<Personne>(new Model<String>(getString("Utilisateur.typeDroit"))) {
- @Override
- public void populateItem(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
- String typeDroit;
- if (rowModel.getObject() instanceof Utilisateur) {
- Utilisateur util = (Utilisateur) rowModel.getObject();
- typeDroit = enumValueMessage(util.getTypeDroit())
- + (util.isValide() ? "" : " " + getString(getResource() + ".IsNotValid"));
- } else {
- typeDroit = getString(Personne.class.getSimpleName());
- }
- item.add(new Label(componentId, typeDroit));
- }
- });
+ columns.add(new AbstractColumn<Personne>(new Model<String>(getString("Utilisateur.typeDroit"))) {
+ @Override
+ public void populateItem(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> rowModel) {
+ String typeDroit;
+ if (rowModel.getObject() instanceof Utilisateur) {
+ Utilisateur util = (Utilisateur) rowModel.getObject();
+ typeDroit = enumValueMessage(util.getTypeDroit())
+ + (util.isValide() ? "" : " " + getString(getResource() + ".IsNotValid"));
+ } else {
+ typeDroit = getString(Personne.class.getSimpleName());
+ }
+ item.add(new Label(componentId, typeDroit));
+ }
+ });
- columns.add(new LinkableImagePropertyColumn<Personne>("images/edit.png", getString("Update"),
- getString("Update")) {
+ columns.add(new LinkableImagePropertyColumn<Personne>("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<Personne>> item, String componentId, IModel<Personne> model) {
- if (personneService.updateOrDeletePersonneEnabled(model.getObject(), getSession().getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ // pas de lien d'édition si l'utilisateur n'a pas les droits
+ @Override
+ public void populateItem(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> model) {
+ if (personneService.updateOrDeletePersonneEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> model) {
- if (model.getObject() instanceof Utilisateur) {
- // Si l'utilisateur est l'utilisateur "courant", alors on le redirige vers la page de mise à
- // jour de son profil sinon vers la page de gestion d'un utilisateur
- setResponsePage(model.getObject().getIdPersonne().equals(
- getSession().getUtilisateur().getIdPersonne()) ? new UpdateUtilisateurPage(currentPage)
- : new ManageUtilisateurPage(model.getObject().getIdPersonne(), currentPage));
- } else { // sinon c'est une "Personne"
- assert (model.getObject() instanceof Personne);
- setResponsePage(new ManagePersonnePage(model.getObject().getIdPersonne(), currentPage));
- }
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Personne>> item, String componentId, IModel<Personne> model) {
+ if (model.getObject() instanceof Utilisateur) {
+ // Si l'utilisateur est l'utilisateur "courant", alors on le redirige vers la page de mise à
+ // jour de son profil sinon vers la page de gestion d'un utilisateur
+ setResponsePage(model.getObject().getIdPersonne().equals(
+ getSession().getUtilisateur().getIdPersonne()) ? new UpdateUtilisateurPage(currentPage)
+ : new ManageUtilisateurPage(model.getObject().getIdPersonne(), currentPage));
+ } else { // sinon c'est une "Personne"
+ assert (model.getObject() instanceof Personne);
+ setResponsePage(new ManagePersonnePage(model.getObject().getIdPersonne(), currentPage));
+ }
+ }
+ });
- final DataTable<Personne> personnesDataTable = new AjaxFallbackDefaultDataTable<Personne>(
- "ListPersonnesPage.Personnes", columns, personnesDataProvider, WebContext.ROWS_PER_PAGE);
+ final DataTable<Personne> personnesDataTable = new AjaxFallbackDefaultDataTable<Personne>(
+ "ListPersonnesPage.Personnes", columns, personnesDataProvider, WebContext.ROWS_PER_PAGE);
- personnesRefresh.add(personnesDataTable);
+ personnesRefresh.add(personnesDataTable);
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ManagePersonnePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ManagePersonnePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ManagePersonnePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -55,206 +55,206 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManagePersonnePage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : create utilisateur */
- private static final String ACTION_CREATE_UTILISATEUR = "CreateUtilisateur";
+ /** Action : create utilisateur */
+ private static final String ACTION_CREATE_UTILISATEUR = "CreateUtilisateur";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /** Modèle : personne */
- private final IModel<Personne> personneModel;
+ /** Modèle : personne */
+ private final IModel<Personne> personneModel;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManagePersonnePage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManagePersonnePage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idPersonne ID lot
- * @param callerPage Page appelante
- */
- public ManagePersonnePage(Integer idPersonne, CallerPage callerPage) {
- this(idPersonne, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idPersonne ID lot
+ * @param callerPage Page appelante
+ */
+ public ManagePersonnePage(Integer idPersonne, CallerPage callerPage) {
+ this(idPersonne, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la personne suivante)
- * @param personne Personne
- * @param callerPage Page appelante
- */
- public ManagePersonnePage(Personne personne, CallerPage callerPage) {
- this(null, personne, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la personne suivante)
+ * @param personne Personne
+ * @param callerPage Page appelante
+ */
+ public ManagePersonnePage(Personne personne, CallerPage callerPage) {
+ this(null, personne, callerPage, true);
+ }
- /**
- * Constructeur. Si idPersonne et personne sont null, on créée une nouveau personne. Si idPersonne est renseigné, on
- * édite la personne correspondante. Si personne est renseignée, on créée une nouvelle personne à partir des
- * informations qu'elle contient.
- * @param idPersonne ID personne
- * @param personne Personne
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManagePersonnePage(Integer idPersonne, Personne personne, final CallerPage callerPage, boolean multipleEntry) {
- super(ManagePersonnePage.class);
- assert idPersonne == null || personne == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si idPersonne et personne sont null, on créée une nouveau personne. Si idPersonne est renseigné, on
+ * édite la personne correspondante. Si personne est renseignée, on créée une nouvelle personne à partir des
+ * informations qu'elle contient.
+ * @param idPersonne ID personne
+ * @param personne Personne
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManagePersonnePage(Integer idPersonne, Personne personne, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManagePersonnePage.class);
+ assert idPersonne == null || personne == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- // Initialisation du modèle
- try {
- personneModel = new Model<Personne>(idPersonne == null && personne == null ? new Personne()
- : personne != null ? personne : personneService.loadPersonne(idPersonne));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Initialisation du modèle
+ try {
+ personneModel = new Model<Personne>(idPersonne == null && personne == null ? new Personne()
+ : personne != null ? personne : personneService.loadPersonne(idPersonne));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- boolean createMode = idPersonne == null;
- final Form<Personne> formView = new Form<Personne>("Form", personneModel);
+ boolean createMode = idPersonne == null;
+ final Form<Personne> formView = new Form<Personne>("Form", personneModel);
- final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", personneModel);
- formView.add(personnePanel);
+ final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", personneModel);
+ formView.add(personnePanel);
- // Action : création de la personne
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.createPersonne(personneModel.getObject());
- }
+ // Action : création de la personne
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.createPersonne(personneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- personnePanel.validate();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ personnePanel.validate();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : mise à jour de la personne
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.updatePersonne(personneModel.getObject());
- }
+ // Action : mise à jour de la personne
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.updatePersonne(personneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- personnePanel.validate();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ personnePanel.validate();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : transformation de la personne en utilisateur
- Button createUtilisateurButton = new SubmittableButton(ACTION_CREATE_UTILISATEUR,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws EmailException, DataConstraintException {
- personneService.updateAndCreateUtilisateur(personneModel.getObject());
- }
+ // Action : transformation de la personne en utilisateur
+ Button createUtilisateurButton = new SubmittableButton(ACTION_CREATE_UTILISATEUR,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws EmailException, DataConstraintException {
+ personneService.updateAndCreateUtilisateur(personneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE_UTILISATEUR);
- // redirect all the time to ReadUtilisateur
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE_UTILISATEUR);
+ // redirect all the time to ReadUtilisateur
+ }
- @Override
- public void onValidate() {
- personnePanel.validate();
- }
- });
- createUtilisateurButton.setVisibilityAllowed(!createMode
- && getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR);
- formView.add(createUtilisateurButton);
+ @Override
+ public void onValidate() {
+ personnePanel.validate();
+ }
+ });
+ createUtilisateurButton.setVisibilityAllowed(!createMode
+ && getSession().getUtilisateur().getTypeDroit() == TypeDroit.ADMINISTRATEUR);
+ formView.add(createUtilisateurButton);
- // Action : suppression de la personne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.deletePersonne(personneModel.getObject());
- }
+ // Action : suppression de la personne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.deletePersonne(personneModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- if (callerPage != null) {
- callerPage.responsePage((TemplatePage) this.getPage());
- }
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ if (callerPage != null) {
+ callerPage.responsePage((TemplatePage) this.getPage());
+ }
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection vers l'écran de saisie d'un nouveau lot, en fournissant déjà quelques données
- Personne nextPersonne = new Personne();
- nextPersonne.setOrganisme(personneModel.getObject().getOrganisme());
- nextPersonne.setAdressePostale(personneModel.getObject().getAdressePostale());
- nextPersonne.setCodePostal(personneModel.getObject().getCodePostal());
- nextPersonne.setVille(personneModel.getObject().getVille());
- nextPersonne.setCodePays(personneModel.getObject().getCodePays());
- setResponsePage(new ManagePersonnePage(nextPersonne, callerPage));
- } else if (callerPage != null) {
- // On passe l'id de la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre
- // de
- // l'exploiter si besoin
- callerPage.addPageParameter(Personne.class.getSimpleName(), personneModel.getObject().getIdPersonne());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection vers l'écran de saisie d'un nouveau lot, en fournissant déjà quelques données
+ Personne nextPersonne = new Personne();
+ nextPersonne.setOrganisme(personneModel.getObject().getOrganisme());
+ nextPersonne.setAdressePostale(personneModel.getObject().getAdressePostale());
+ nextPersonne.setCodePostal(personneModel.getObject().getCodePostal());
+ nextPersonne.setVille(personneModel.getObject().getVille());
+ nextPersonne.setCodePays(personneModel.getObject().getCodePays());
+ setResponsePage(new ManagePersonnePage(nextPersonne, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id de la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre
+ // de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Personne.class.getSimpleName(), personneModel.getObject().getIdPersonne());
+ callerPage.responsePage(this);
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ReadPersonnePage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ReadPersonnePage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/ReadPersonnePage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -46,92 +46,92 @@
*/
public final class ReadPersonnePage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Modèle : personne */
- private final IModel<Personne> personneModel;
+ /** Modèle : personne */
+ private final IModel<Personne> personneModel;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructeur
- * @param idPersonne ID personne
- * @param callerPage Page appelante
- */
- public ReadPersonnePage(Integer idPersonne, CallerPage callerPage) {
- super(ReadPersonnePage.class);
+ /**
+ * Constructeur
+ * @param idPersonne ID personne
+ * @param callerPage Page appelante
+ */
+ public ReadPersonnePage(Integer idPersonne, CallerPage callerPage) {
+ super(ReadPersonnePage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation du modèle
- personneModel = new GenericLoadableDetachableModel<Personne>(Personne.class, idPersonne);
+ // Initialisation du modèle
+ personneModel = new GenericLoadableDetachableModel<Personne>(Personne.class, idPersonne);
- final Personne personne = personneModel.getObject();
+ final Personne personne = personneModel.getObject();
- // Ajout du formulaire pour les actions
- final Form<Personne> formView = new Form<Personne>("Form", personneModel);
+ // Ajout du formulaire pour les actions
+ final Form<Personne> formView = new Form<Personne>("Form", personneModel);
- // Ajout du panel ReadPersonnePanel
- final ReadPersonnePanel personnePanel = new ReadPersonnePanel("ReadPersonnePanel", personneModel);
- add(personnePanel);
+ // Ajout du panel ReadPersonnePanel
+ final ReadPersonnePanel personnePanel = new ReadPersonnePanel("ReadPersonnePanel", personneModel);
+ add(personnePanel);
- // Action : mise à jour (redirection vers le formulaire)
- Link<Personne> updateLink = new Link<Personne>(getResource() + ".Personne.Update",
- new Model<Personne>(personne)) {
- @Override
- public void onClick() {
- setResponsePage(new ManagePersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(personne, getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Personne> updateLink = new Link<Personne>(getResource() + ".Personne.Update",
+ new Model<Personne>(personne)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManagePersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(personne, getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : retour à la page précédente
- formView.add(new Link<Void>(getResource() + ".Personne.Back") {
- @Override
- public void onClick() {
- redirect();
- }
- });
+ // Action : retour à la page précédente
+ formView.add(new Link<Void>(getResource() + ".Personne.Back") {
+ @Override
+ public void onClick() {
+ redirect();
+ }
+ });
- // Action : suppression de la personne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePersonnePage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.deletePersonne(personne);
- }
+ // Action : suppression de la personne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePersonnePage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.deletePersonne(personne);
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManagePersonnePage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(personne, getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
- add(formView);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ManagePersonnePage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(personne, getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- // On passe la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Personne.class.getSimpleName(), personneModel.getObject());
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ // On passe la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Personne.class.getSimpleName(), personneModel.getObject());
+ callerPage.responsePage(this);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ManagePersonnePanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ManagePersonnePanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ManagePersonnePanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,51 +48,51 @@
*/
public final class ManagePersonnePanel extends Panel {
- /** Model validateur */
- @SpringBean(name = "webModelValidator") private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator") private ModelValidator validator;
- /** Services : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Services : personne */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructeur
- * @param id ID
- * @param personneModel Modèle
- */
- public ManagePersonnePanel(String id, IModel<? extends Personne> personneModel) {
- super(id, personneModel);
+ /**
+ * Constructeur
+ * @param id ID
+ * @param personneModel Modèle
+ */
+ public ManagePersonnePanel(String id, IModel<? extends Personne> personneModel) {
+ super(id, personneModel);
- // liste des organismes suggérés à la saisie
- final List<String> organismes = personneService.listPersonneOrganismes();
+ // liste des organismes suggérés à la saisie
+ final List<String> organismes = personneService.listPersonneOrganismes();
- add(new TextField<String>("Personne.prenom", new PropertyModel<String>(personneModel, "prenom")));
- add(new TextField<String>("Personne.nom", new PropertyModel<String>(personneModel, "nom")));
- add(new AutoCompleteTextFieldString("Personne.organisme",
- new PropertyModel<String>(personneModel, "organisme"), organismes, ComparisonMode.CONTAINS));
- add(new TextField<String>("Personne.fonction", new PropertyModel<String>(personneModel, "fonction")));
- add(new TextField<String>("Personne.tel", new PropertyModel<String>(personneModel, "tel")));
- add(new TextField<String>("Personne.fax", new PropertyModel<String>(personneModel, "fax")));
- add(new TextField<String>("Personne.courriel", new PropertyModel<String>(personneModel, "courriel")));
- add(new TextArea<String>("Personne.adressePostale", new PropertyModel<String>(personneModel, "adressePostale")));
- add(new TextField<String>("Personne.codePostal", new PropertyModel<String>(personneModel, "codePostal")));
- add(new TextField<String>("Personne.ville", new PropertyModel<String>(personneModel, "ville")));
- add(new DropDownChoice<String>("Personne.codePays", new PropertyModel<String>(personneModel, "codePays"),
- WebContext.COUNTRY_CODES.get(getSession().getLocale()), new MapChoiceRenderer<String, String>(
- WebContext.COUNTRIES.get(getSession().getLocale()))));
- if (personneModel.getObject().getCodePays() == null) {
- personneModel.getObject().setCodePays(
- WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
- }
+ add(new TextField<String>("Personne.prenom", new PropertyModel<String>(personneModel, "prenom")));
+ add(new TextField<String>("Personne.nom", new PropertyModel<String>(personneModel, "nom")));
+ add(new AutoCompleteTextFieldString("Personne.organisme",
+ new PropertyModel<String>(personneModel, "organisme"), organismes, ComparisonMode.CONTAINS));
+ add(new TextField<String>("Personne.fonction", new PropertyModel<String>(personneModel, "fonction")));
+ add(new TextField<String>("Personne.tel", new PropertyModel<String>(personneModel, "tel")));
+ add(new TextField<String>("Personne.fax", new PropertyModel<String>(personneModel, "fax")));
+ add(new TextField<String>("Personne.courriel", new PropertyModel<String>(personneModel, "courriel")));
+ add(new TextArea<String>("Personne.adressePostale", new PropertyModel<String>(personneModel, "adressePostale")));
+ add(new TextField<String>("Personne.codePostal", new PropertyModel<String>(personneModel, "codePostal")));
+ add(new TextField<String>("Personne.ville", new PropertyModel<String>(personneModel, "ville")));
+ add(new DropDownChoice<String>("Personne.codePays", new PropertyModel<String>(personneModel, "codePays"),
+ WebContext.COUNTRY_CODES.get(getSession().getLocale()), new MapChoiceRenderer<String, String>(
+ WebContext.COUNTRIES.get(getSession().getLocale()))));
+ if (personneModel.getObject().getCodePays() == null) {
+ personneModel.getObject().setCodePays(
+ WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
+ }
- }
+ }
- /**
- * Validation
- */
- public void validate() {
- ((TemplatePage) getPage()).addValidationErrors(validator.validate((Personne) getDefaultModelObject(),
- getSession().getLocale(), "prenom", "nom", "organisme", "fonction", "tel", "fax", "courriel",
- "adressePostale", "codePostal", "ville", "codePays"));
- }
+ /**
+ * Validation
+ */
+ public void validate() {
+ ((TemplatePage) getPage()).addValidationErrors(validator.validate((Personne) getDefaultModelObject(),
+ getSession().getLocale(), "prenom", "nom", "organisme", "fonction", "tel", "fax", "courriel",
+ "adressePostale", "codePostal", "ville", "codePays"));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ReadPersonnePanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ReadPersonnePanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/personne/panels/ReadPersonnePanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,34 +39,34 @@
*/
public final class ReadPersonnePanel extends Panel {
- /**
- * Constructeur
- * @param id ID
- * @param personneModel Modèle
- */
- public ReadPersonnePanel(String id, IModel<? extends Personne> personneModel) {
- super(id, personneModel);
- add(new Label("Personne.prenom", new PropertyModel<String>(personneModel, "prenom"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.nom", new PropertyModel<String>(personneModel, "nom"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.organisme", new PropertyModel<String>(personneModel, "organisme"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.fonction", new PropertyModel<String>(personneModel, "fonction"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.tel", new PropertyModel<String>(personneModel, "tel"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.fax", new PropertyModel<String>(personneModel, "fax"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.courriel", new PropertyModel<String>(personneModel, "courriel"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Personne.adressePostale", new PropertyModel<String>(personneModel, "adressePostale"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.codePostal", new PropertyModel<String>(personneModel, "codePostal"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.ville", new PropertyModel<String>(personneModel, "ville"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Personne.codePays", new DisplayMapValuePropertyModel<String>(personneModel, "codePays",
- WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
- }
+ /**
+ * Constructeur
+ * @param id ID
+ * @param personneModel Modèle
+ */
+ public ReadPersonnePanel(String id, IModel<? extends Personne> personneModel) {
+ super(id, personneModel);
+ add(new Label("Personne.prenom", new PropertyModel<String>(personneModel, "prenom"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.nom", new PropertyModel<String>(personneModel, "nom"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.organisme", new PropertyModel<String>(personneModel, "organisme"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.fonction", new PropertyModel<String>(personneModel, "fonction"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.tel", new PropertyModel<String>(personneModel, "tel"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.fax", new PropertyModel<String>(personneModel, "fax"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.courriel", new PropertyModel<String>(personneModel, "courriel"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Personne.adressePostale", new PropertyModel<String>(personneModel, "adressePostale"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.codePostal", new PropertyModel<String>(personneModel, "codePostal"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.ville", new PropertyModel<String>(personneModel, "ville"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Personne.codePays", new DisplayMapValuePropertyModel<String>(personneModel, "codePays",
+ WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ListPurificationsPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -64,116 +64,116 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListPurificationsPage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Service : manipPurification */
- @SpringBean
- private PurificationService purificationService;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Service : manipPurification */
+ @SpringBean
+ private PurificationService purificationService;
- /**
- * Constructeur
- */
- public ListPurificationsPage() {
- super(ListPurificationsPage.class);
+ /**
+ * Constructeur
+ */
+ public ListPurificationsPage() {
+ super(ListPurificationsPage.class);
- final CallerPage currentPage = new CallerPage(ListPurificationsPage.class);
+ final CallerPage currentPage = new CallerPage(ListPurificationsPage.class);
- add(new Link<Void>(getResource() + ".NewPurification") {
- @Override
- public void onClick() {
- setResponsePage(new ManagePurificationPage(currentPage, true));
- }
- });
+ add(new Link<Void>(getResource() + ".NewPurification") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManagePurificationPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer purificationsRefresh = new WebMarkupContainer(getResource() + ".Purifications.Refresh");
- purificationsRefresh.setOutputMarkupId(true);
- add(purificationsRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer purificationsRefresh = new WebMarkupContainer(getResource() + ".Purifications.Refresh");
+ purificationsRefresh.setOutputMarkupId(true);
+ add(purificationsRefresh);
- // Liste des Purifications
- final List<Purification> purifications = purificationService.listPurifications(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
- purifications, getSession().getLocale());
+ // Liste des Purifications
+ final List<Purification> purifications = purificationService.listPurifications(getSession().getUtilisateur());
+ LoadableDetachableSortableListDataProvider<Purification> purificationsDataProvider = new LoadableDetachableSortableListDataProvider<Purification>(
+ purifications, getSession().getLocale());
- List<IColumn<Purification>> columns = new ArrayList<IColumn<Purification>>();
+ List<IColumn<Purification>> columns = new ArrayList<IColumn<Purification>>();
- columns.add(new LinkableImagePropertyColumn<Purification>("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 LinkableImagePropertyColumn<Purification>("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>(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 LinkPropertyColumn<Purification>(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>(
- new Model<String>(getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
+ columns.add(new LinkProduitPropertyColumn<Purification>(
+ 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));
- }
- });
+ @Override
+ public void onClickIfFraction(Fraction fraction) {
+ setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
+ }
+ });
- columns.add(new LinkPropertyColumn<Purification>(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 LinkPropertyColumn<Purification>(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>(new Model<String>(getString("Purification.date")),
- "date", "date", getLocale()));
+ columns.add(new ShortDatePropertyColumn<Purification>(new Model<String>(getString("Purification.date")),
+ "date", "date", getLocale()));
- columns.add(new PropertyColumn<Purification>(new Model<String>(getString("Purification.methode2")), "methode",
- "methode"));
+ columns.add(new PropertyColumn<Purification>(new Model<String>(getString("Purification.methode2")), "methode",
+ "methode"));
- columns.add(new LinkPropertyColumn<Purification>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Purification>(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));
+ }
+ });
- columns.add(new LinkableImagePropertyColumn<Purification>("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<Purification>> item, String componentId,
- IModel<Purification> model) {
- if (purificationService.updateOrdeletePurificationEnabled(model.getObject(), getSession()
- .getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ columns.add(new LinkableImagePropertyColumn<Purification>("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<Purification>> item, String componentId,
+ IModel<Purification> model) {
+ if (purificationService.updateOrdeletePurificationEnabled(model.getObject(), getSession()
+ .getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
- setResponsePage(new ManagePurificationPage(model.getObject().getIdPurification(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Purification>> item, String componentId, IModel<Purification> model) {
+ setResponsePage(new ManagePurificationPage(model.getObject().getIdPurification(), currentPage));
+ }
+ });
- final DataTable<Purification> purificationsDataTable = new AjaxFallbackDefaultDataTable<Purification>(
- "ListPurificationsPage.Purifications", columns, purificationsDataProvider, WebContext.ROWS_PER_PAGE);
- purificationsRefresh.add(purificationsDataTable);
+ final DataTable<Purification> purificationsDataTable = new AjaxFallbackDefaultDataTable<Purification>(
+ "ListPurificationsPage.Purifications", columns, purificationsDataProvider, WebContext.ROWS_PER_PAGE);
+ purificationsRefresh.add(purificationsDataTable);
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ManagePurificationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ManagePurificationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ManagePurificationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -95,543 +95,543 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManagePurificationPage extends TemplatePage {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** purification Model */
- private final IModel<Purification> purificationModel;
+ /** purification Model */
+ private final IModel<Purification> purificationModel;
- /** model for adding fraction */
- private Model<Fraction> newFractionModel;
+ /** model for adding fraction */
+ private Model<Fraction> newFractionModel;
- /** Service : purifications */
- @SpringBean
- private PurificationService purificationService;
+ /** Service : purifications */
+ @SpringBean
+ private PurificationService purificationService;
- /** Service : personnes */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personnes */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : produits */
- @SpringBean
- private ProduitService produitService;
+ /** Service : produits */
+ @SpringBean
+ private ProduitService produitService;
- /** Liste des personnes existantes */
- private final List<Personne> personnes;
+ /** Liste des personnes existantes */
+ private final List<Personne> personnes;
- /** Liste des méthodes de purification existantes */
- private final List<MethodePurification> methodes;
+ /** Liste des méthodes de purification existantes */
+ private final List<MethodePurification> methodes;
- /** Liste des produits existants */
- private final List<Produit> produits;
+ /** Liste des produits existants */
+ private final List<Produit> produits;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /** createMode true si le formulaire est en creation, false en édition **/
- private boolean createMode;
+ /** createMode true si le formulaire est en creation, false en édition **/
+ private boolean createMode;
- /**
- * Couple of <ref, id> in order to recuperate the id of the deleted type usefull in case of delete thus add of same
- * initial type
- */
- private HashMap<String, Integer> fractionsDeleted;
+ /**
+ * Couple of <ref, id> in order to recuperate the id of the deleted type usefull in case of delete thus add of same
+ * initial type
+ */
+ private HashMap<String, Integer> fractionsDeleted;
- /** Bouton d'ajout d'un purification **/
- Button addPurificationButton;
+ /** Bouton d'ajout d'un purification **/
+ Button addPurificationButton;
- /** Container pour l'affichage de la description de la méthode **/
- MarkupContainer descriptionMethoContainer;
+ /** Container pour l'affichage de la description de la méthode **/
+ MarkupContainer descriptionMethoContainer;
- /** Container pour l'affichage des paramètres de la méthode **/
- MarkupContainer paramsMethoContainer;
+ /** Container pour l'affichage des paramètres de la méthode **/
+ MarkupContainer paramsMethoContainer;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManagePurificationPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManagePurificationPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idManip Id de la manip d'purification
- * @param callerPage Page appelante
- */
- public ManagePurificationPage(Integer idManip, CallerPage callerPage) {
- this(idManip, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idManip Id de la manip d'purification
+ * @param callerPage Page appelante
+ */
+ public ManagePurificationPage(Integer idManip, CallerPage callerPage) {
+ this(idManip, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la manip suivante)
- * @param manip Manip d'purification
- * @param callerPage Page appelante
- */
- public ManagePurificationPage(Purification manip, CallerPage callerPage) {
- this(null, manip, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la manip suivante)
+ * @param manip Manip d'purification
+ * @param callerPage Page appelante
+ */
+ public ManagePurificationPage(Purification manip, CallerPage callerPage) {
+ this(null, manip, callerPage, true);
+ }
- /**
- * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'purification. Si refManip est
- * renseignée, on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir
- * des informations qu'elle contient.
- * @param idManip Id de la manip d'purification
- * @param manip Manip d'purification
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManagePurificationPage(Integer idManip, Purification manip, final CallerPage callerPage,
- boolean multipleEntry) {
- super(ManagePurificationPage.class);
- assert idManip == null || manip == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'purification. Si refManip est
+ * renseignée, on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir
+ * des informations qu'elle contient.
+ * @param idManip Id de la manip d'purification
+ * @param manip Manip d'purification
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManagePurificationPage(Integer idManip, Purification manip, final CallerPage callerPage,
+ boolean multipleEntry) {
+ super(ManagePurificationPage.class);
+ assert idManip == null || manip == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- fractionsDeleted = new HashMap<String, Integer>();
- newFractionModel = new Model<Fraction>(new Fraction());
+ fractionsDeleted = new HashMap<String, Integer>();
+ newFractionModel = new Model<Fraction>(new Fraction());
- // Initialisation du modèle
- try {
- purificationModel = new Model<Purification>(idManip == null && manip == null ? new Purification()
- : manip != null ? manip : purificationService.loadPurification(idManip));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // Initialisation du modèle
+ try {
+ purificationModel = new Model<Purification>(idManip == null && manip == null ? new Purification()
+ : manip != null ? manip : purificationService.loadPurification(idManip));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- createMode = idManip == null;
- if (createMode) {
- purificationModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ createMode = idManip == null;
+ if (createMode) {
+ purificationModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes (pour le dropDownChoice)
- personnes = personneService.listPersonnes();
- methodes = purificationService.listMethodesPurification();
- produits = produitService.listProduits(getSession().getUtilisateur());
+ // Initialisation des listes (pour le dropDownChoice)
+ personnes = personneService.listPersonnes();
+ methodes = purificationService.listMethodesPurification();
+ produits = produitService.listProduits(getSession().getUtilisateur());
- if (manip != null) {
- // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
- // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
- // l'égalité entre les objets)
- purificationModel.getObject().setManipulateur(
- CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, purificationModel
- .getObject().getManipulateur().getIdPersonne()));
- }
+ if (manip != null) {
+ // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
+ // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
+ // l'égalité entre les objets)
+ purificationModel.getObject().setManipulateur(
+ CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, purificationModel
+ .getObject().getManipulateur().getIdPersonne()));
+ }
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- // initialisation du formulaire
- initPrincipalFields(formView);
- initMethodeFields(formView);
- initFractionsFields(formView);
+ // initialisation du formulaire
+ initPrincipalFields(formView);
+ initMethodeFields(formView);
+ initFractionsFields(formView);
- // Action : create the purification
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.createPurification(purificationModel.getObject());
- }
+ // Action : create the purification
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.createPurification(purificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the purification
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.updatePurification(purificationModel.getObject());
- }
+ // Action : update the purification
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.updatePurification(purificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePurificationPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.deletePurification(purificationModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePurificationPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.deletePurification(purificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- formView.setDefaultButton(addPurificationButton);
- add(formView);
+ formView.setDefaultButton(addPurificationButton);
+ add(formView);
- }
+ }
- /**
- * Initialise les champs principaux
- * @param formView le formulaire
- */
- private void initPrincipalFields(Form<Void> formView) {
- formView.add(new TextField<String>("Purification.ref", new PropertyModel<String>(purificationModel, "ref")));
+ /**
+ * Initialise les champs principaux
+ * @param formView le formulaire
+ */
+ private void initPrincipalFields(Form<Void> formView) {
+ formView.add(new TextField<String>("Purification.ref", new PropertyModel<String>(purificationModel, "ref")));
- formView.add(new DropDownChoice<Personne>("Purification.manipulateur", new PropertyModel<Personne>(
- purificationModel, "manipulateur"), personnes, new PersonneRenderer()).setNullValid(false));
- // Action : création d'une nouvelle personne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewPersonne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
+ formView.add(new DropDownChoice<Personne>("Purification.manipulateur", new PropertyModel<Personne>(
+ purificationModel, "manipulateur"), personnes, new PersonneRenderer()).setNullValid(false));
+ // Action : création d'une nouvelle personne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewPersonne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ });
- formView.add(new DateTextField("Purification.date", new PropertyModel<Date>(purificationModel, "date"))
- .add(new DatePicker()));
+ formView.add(new DateTextField("Purification.date", new PropertyModel<Date>(purificationModel, "date"))
+ .add(new DatePicker()));
- AbstractSingleSelectChoice<Produit> produitsChoice = new DropDownChoice<Produit>("Purification.produit",
- new PropertyModel<Produit>(purificationModel, "produit"), produits);
- produitsChoice.setNullValid(false);
- produitsChoice.setEnabled(createMode);
- formView.add(produitsChoice);
+ AbstractSingleSelectChoice<Produit> produitsChoice = new DropDownChoice<Produit>("Purification.produit",
+ new PropertyModel<Produit>(purificationModel, "produit"), produits);
+ produitsChoice.setNullValid(false);
+ produitsChoice.setEnabled(createMode);
+ formView.add(produitsChoice);
- TextField<BigDecimal> masseDepartInput = new TextField<BigDecimal>("Purification.masseDepart",
- new PropertyModel<BigDecimal>(purificationModel, "masseDepart"));
- masseDepartInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- };
- });
- formView.add(masseDepartInput);
+ TextField<BigDecimal> masseDepartInput = new TextField<BigDecimal>("Purification.masseDepart",
+ new PropertyModel<BigDecimal>(purificationModel, "masseDepart"));
+ masseDepartInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ };
+ });
+ formView.add(masseDepartInput);
- formView.add(new TextArea<String>("Purification.complement", new PropertyModel<String>(purificationModel,
- "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Purification.createur", new PropertyModel<String>(purificationModel,
- "createur")).setEnabled(false));
- }
+ formView.add(new TextArea<String>("Purification.complement", new PropertyModel<String>(purificationModel,
+ "complement")));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Purification.createur", new PropertyModel<String>(purificationModel,
+ "createur")).setEnabled(false));
+ }
- /**
- * Initialise les champs relatifs à la méthode
- * @param formView le formulaire
- */
- private void initMethodeFields(final Form<Void> formView) {
+ /**
+ * Initialise les champs relatifs à la méthode
+ * @param formView le formulaire
+ */
+ private void initMethodeFields(final Form<Void> formView) {
- final WebMarkupContainer methodeCont = new WebMarkupContainer("Purification.methode");
- methodeCont.setOutputMarkupId(true);
- formView.add(methodeCont);
+ final WebMarkupContainer methodeCont = new WebMarkupContainer("Purification.methode");
+ methodeCont.setOutputMarkupId(true);
+ formView.add(methodeCont);
- // Champs pour la méthode
- descriptionMethoContainer = new WebMarkupContainer("Purification.descriptionMethodeCont") {
- @Override
- public boolean isVisible() {
- // description cachée si pas de méthode sélectionnée
- return purificationModel.getObject().getMethode() != null;
- }
- };
- descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
- descriptionMethoContainer.setOutputMarkupPlaceholderTag(true);
- methodeCont.add(descriptionMethoContainer);
- final MultiLineLabel methodeDesc = new MultiLineLabel("Purification.descriptionMethode",
- new PropertyModel<String>(purificationModel, "methode.description"));
- methodeDesc.setOutputMarkupId(true);
- descriptionMethoContainer.add(methodeDesc);
+ // Champs pour la méthode
+ descriptionMethoContainer = new WebMarkupContainer("Purification.descriptionMethodeCont") {
+ @Override
+ public boolean isVisible() {
+ // description cachée si pas de méthode sélectionnée
+ return purificationModel.getObject().getMethode() != null;
+ }
+ };
+ descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
+ descriptionMethoContainer.setOutputMarkupPlaceholderTag(true);
+ methodeCont.add(descriptionMethoContainer);
+ final MultiLineLabel methodeDesc = new MultiLineLabel("Purification.descriptionMethode",
+ new PropertyModel<String>(purificationModel, "methode.description"));
+ methodeDesc.setOutputMarkupId(true);
+ descriptionMethoContainer.add(methodeDesc);
- // Déclaration du container des paramètres de la méthode
- paramsMethoContainer = new WebMarkupContainer("Purification.paramsMethode") {
- @Override
- public boolean isVisible() {
- // paramètres cachés si pas de méthode sélectionnée
- return purificationModel.getObject().getMethode() != null;
- }
- };
- final MarkupContainer paramsMethoTable = new WebMarkupContainer("Purification.paramsMethode.Table");
- paramsMethoContainer.add(paramsMethoTable);
- paramsMethoContainer.setOutputMarkupId(true);
- paramsMethoContainer.setOutputMarkupPlaceholderTag(true);
+ // Déclaration du container des paramètres de la méthode
+ paramsMethoContainer = new WebMarkupContainer("Purification.paramsMethode") {
+ @Override
+ public boolean isVisible() {
+ // paramètres cachés si pas de méthode sélectionnée
+ return purificationModel.getObject().getMethode() != null;
+ }
+ };
+ final MarkupContainer paramsMethoTable = new WebMarkupContainer("Purification.paramsMethode.Table");
+ paramsMethoContainer.add(paramsMethoTable);
+ paramsMethoContainer.setOutputMarkupId(true);
+ paramsMethoContainer.setOutputMarkupPlaceholderTag(true);
- paramsMethoTable.add(new ListView<ParamMethoPuriEffectif>("Purification.paramsMethode.List",
- new PropertyModel<List<ParamMethoPuriEffectif>>(purificationModel, "sortedParamsMetho")) {
- @Override
- protected void populateItem(ListItem<ParamMethoPuriEffectif> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ paramsMethoTable.add(new ListView<ParamMethoPuriEffectif>("Purification.paramsMethode.List",
+ new PropertyModel<List<ParamMethoPuriEffectif>>(purificationModel, "sortedParamsMetho")) {
+ @Override
+ protected void populateItem(ListItem<ParamMethoPuriEffectif> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final ParamMethoPuriEffectif param = item.getModelObject();
- // Colonnes
- item.add(new Label("Purification.paramsMethode.nom", new PropertyModel<String>(param, "param.nom")));
- item.add(new SimpleTooltipPanel("Purification.paramsMethode.nom.info", new PropertyModel<String>(param,
- "param.description")));
- item.add(new TextField<String>("Purification.paramsMethode.valeur", new PropertyModel<String>(param,
- "valeur")));
- }
- });
+ final ParamMethoPuriEffectif param = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Purification.paramsMethode.nom", new PropertyModel<String>(param, "param.nom")));
+ item.add(new SimpleTooltipPanel("Purification.paramsMethode.nom.info", new PropertyModel<String>(param,
+ "param.description")));
+ item.add(new TextField<String>("Purification.paramsMethode.valeur", new PropertyModel<String>(param,
+ "valeur")));
+ }
+ });
- methodeCont.add(paramsMethoContainer);
+ methodeCont.add(paramsMethoContainer);
- final DropDownChoice<MethodePurification> methodeChoice = new DropDownChoice<MethodePurification>(
- "Purification.nomMethode", new PropertyModel<MethodePurification>(purificationModel, "methode"),
- methodes);
- methodeChoice.setNullValid(false);
- // mise à jour de la description de la méthode et des fractions lors de la sélection de la méthode
- methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- // Intialisation des paramètres
- purificationService.initParamsMethoPuriEffectif(purificationModel.getObject());
- // mise à jour de la description et des paramètres
- target.add(methodeCont);
- }
- });
- methodeCont.add(methodeChoice);
- }
+ final DropDownChoice<MethodePurification> methodeChoice = new DropDownChoice<MethodePurification>(
+ "Purification.nomMethode", new PropertyModel<MethodePurification>(purificationModel, "methode"),
+ methodes);
+ methodeChoice.setNullValid(false);
+ // mise à jour de la description de la méthode et des fractions lors de la sélection de la méthode
+ methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ // Intialisation des paramètres
+ purificationService.initParamsMethoPuriEffectif(purificationModel.getObject());
+ // mise à jour de la description et des paramètres
+ target.add(methodeCont);
+ }
+ });
+ methodeCont.add(methodeChoice);
+ }
- /**
- * Initialise les champs relatifs aux fractions
- * @param formView Le formulaire
- */
- private void initFractionsFields(final Form<Void> formView) {
+ /**
+ * Initialise les champs relatifs aux fractions
+ * @param formView Le formulaire
+ */
+ private void initFractionsFields(final Form<Void> formView) {
- // Déclaration tableau des fractions
- final MarkupContainer purificationsTable = new WebMarkupContainer("Purification.fractions.Table");
- purificationsTable.setOutputMarkupId(true);
+ // Déclaration tableau des fractions
+ final MarkupContainer purificationsTable = new WebMarkupContainer("Purification.fractions.Table");
+ purificationsTable.setOutputMarkupId(true);
- // Contenu tableaux fractions
- purificationsTable.add(new ListView<Fraction>("Purification.fractions.List", new PropertyModel<List<Fraction>>(
- purificationModel, "sortedFractions")) {
- @Override
- protected void populateItem(ListItem<Fraction> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Contenu tableaux fractions
+ purificationsTable.add(new ListView<Fraction>("Purification.fractions.List", new PropertyModel<List<Fraction>>(
+ purificationModel, "sortedFractions")) {
+ @Override
+ protected void populateItem(ListItem<Fraction> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final Fraction fraction = item.getModelObject();
- // Colonnes
- item.add(new Label("Purification.fractions.List.indice", new PropertyModel<String>(fraction, "indice")));
- item.add(new Label("Purification.fractions.List.ref", new PropertyModel<String>(fraction, "ref")));
- item.add(new Label("Purification.fractions.List.masseObtenue", new DisplayDecimalPropertyModel(
- fraction, "masseObtenue", DecimalDisplFormat.LARGE, getLocale())));
+ final Fraction fraction = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Purification.fractions.List.indice", new PropertyModel<String>(fraction, "indice")));
+ item.add(new Label("Purification.fractions.List.ref", new PropertyModel<String>(fraction, "ref")));
+ item.add(new Label("Purification.fractions.List.masseObtenue", new DisplayDecimalPropertyModel(
+ fraction, "masseObtenue", DecimalDisplFormat.LARGE, getLocale())));
- item.add(new Label("Purification.fractions.List.rendement", new DisplayPercentPropertyModel(fraction,
- "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("Purification.fractions.List.rendement", new DisplayPercentPropertyModel(fraction,
+ "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
- // Action : suppression d'une fraction
- Button deleteButton = new AjaxFallbackButton("Purification.fractions.List.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // vérification si des données liées existe
- if (produitService.isProduitReferenced(fraction)) {
- getPage().error(getString("Fraction.isReferenced"));
- } else {
- // Suppression
- purificationModel.getObject().getFractions().remove(fraction);
- // keep the id of the deleted 'fraction' for the case of a new one with the same 'ref'
- fractionsDeleted.put(fraction.getRef(), fraction.getId());
- }
- if (target != null) {
- target.add(purificationsTable);
- refreshFeedbackPage(target);
- }
- }
+ // Action : suppression d'une fraction
+ Button deleteButton = new AjaxFallbackButton("Purification.fractions.List.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // vérification si des données liées existe
+ if (produitService.isProduitReferenced(fraction)) {
+ getPage().error(getString("Fraction.isReferenced"));
+ } else {
+ // Suppression
+ purificationModel.getObject().getFractions().remove(fraction);
+ // keep the id of the deleted 'fraction' for the case of a new one with the same 'ref'
+ fractionsDeleted.put(fraction.getRef(), fraction.getId());
+ }
+ if (target != null) {
+ target.add(purificationsTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- final FormComponent<String> indiceInput = new TextField<String>("Purification.fractions.indice",
- new PropertyModel<String>(newFractionModel, "indice"));
- purificationsTable.add(indiceInput);
+ final FormComponent<String> indiceInput = new TextField<String>("Purification.fractions.indice",
+ new PropertyModel<String>(newFractionModel, "indice"));
+ purificationsTable.add(indiceInput);
- final FormComponent<String> refInput = new TextField<String>("Purification.fractions.ref",
- new PropertyModel<String>(newFractionModel, "ref"));
- purificationsTable.add(refInput);
+ final FormComponent<String> refInput = new TextField<String>("Purification.fractions.ref",
+ new PropertyModel<String>(newFractionModel, "ref"));
+ purificationsTable.add(refInput);
- final FormComponent<BigDecimal> masseObtenueInput = new TextField<BigDecimal>(
- "Purification.fractions.masseObtenue", new PropertyModel<BigDecimal>(newFractionModel, "masseObtenue"));
- purificationsTable.add(masseObtenueInput);
+ final FormComponent<BigDecimal> masseObtenueInput = new TextField<BigDecimal>(
+ "Purification.fractions.masseObtenue", new PropertyModel<BigDecimal>(newFractionModel, "masseObtenue"));
+ purificationsTable.add(masseObtenueInput);
- // Bouton AJAX pour ajouter une fraction
- addPurificationButton = new AjaxFallbackButton("Purification.fractions.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- try {
- // normalisation de la fraction
- newFractionModel.getObject().setRef(
- Normalizer.normalize(UniqueFieldNormalizer.class, newFractionModel.getObject().getRef()));
- // ajout du type purification
- newFractionModel.getObject().setPurification(purificationModel.getObject());
- // recuperate the id if an just deleted type
- newFractionModel.getObject().setId(fractionsDeleted.get(newFractionModel.getObject().getRef()));
+ // Bouton AJAX pour ajouter une fraction
+ addPurificationButton = new AjaxFallbackButton("Purification.fractions.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ // normalisation de la fraction
+ newFractionModel.getObject().setRef(
+ Normalizer.normalize(UniqueFieldNormalizer.class, newFractionModel.getObject().getRef()));
+ // ajout du type purification
+ newFractionModel.getObject().setPurification(purificationModel.getObject());
+ // recuperate the id if an just deleted type
+ newFractionModel.getObject().setId(fractionsDeleted.get(newFractionModel.getObject().getRef()));
- // ajout à la liste
- Fraction fractionAdded = newFractionModel.getObject().clone();
- purificationModel.getObject().getFractions().add(fractionAdded);
+ // ajout à la liste
+ Fraction fractionAdded = newFractionModel.getObject().clone();
+ purificationModel.getObject().getFractions().add(fractionAdded);
- List<String> errors = validator.validate(newFractionModel.getObject(), getSession().getLocale());
- // test si unicité dans la base
- // erreur si non unique dans la base ET extrait de même réf non supprimé de la liste (dans ce
- // dernier cas, ajout avec son ancien id) ET non pris en compte par la validation de
- // CollectionUniqueFieldValidator
- if (!purificationService.isFractionUnique(fractionAdded)
- && fractionAdded.getRef() != null
- && fractionsDeleted.get(fractionAdded.getRef()) == null
- && CollectionTools.countWithValue(fractionAdded.getPurification().getFractions(), "ref",
- AccessType.GETTER, fractionAdded.getRef()) == 1) {
- errors.add(getString("Fraction.notUnique"));
- }
+ List<String> errors = validator.validate(newFractionModel.getObject(), getSession().getLocale());
+ // test si unicité dans la base
+ // erreur si non unique dans la base ET extrait de même réf non supprimé de la liste (dans ce
+ // dernier cas, ajout avec son ancien id) ET non pris en compte par la validation de
+ // CollectionUniqueFieldValidator
+ if (!purificationService.isFractionUnique(fractionAdded)
+ && fractionAdded.getRef() != null
+ && fractionsDeleted.get(fractionAdded.getRef()) == null
+ && CollectionTools.countWithValue(fractionAdded.getPurification().getFractions(), "ref",
+ AccessType.GETTER, fractionAdded.getRef()) == 1) {
+ errors.add(getString("Fraction.notUnique"));
+ }
- if (errors.isEmpty()) {
- // réinit du champ ajout
- newFractionModel.getObject().setIndice(null);
- newFractionModel.getObject().setRef(null);
- newFractionModel.getObject().setMasseObtenue(null);
- } else {
- purificationModel.getObject().getFractions().remove(fractionAdded);
- addValidationErrors(errors);
- }
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ if (errors.isEmpty()) {
+ // réinit du champ ajout
+ newFractionModel.getObject().setIndice(null);
+ newFractionModel.getObject().setRef(null);
+ newFractionModel.getObject().setMasseObtenue(null);
+ } else {
+ purificationModel.getObject().getFractions().remove(fractionAdded);
+ addValidationErrors(errors);
+ }
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- if (target != null) {
- target.add(purificationsTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(purificationsTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- purificationsTable.add(addPurificationButton);
+ };
+ purificationsTable.add(addPurificationButton);
- formView.add(purificationsTable);
- }
+ formView.add(purificationsTable);
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Personne ou Lot)
- refreshModel();
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Personne ou Lot)
+ refreshModel();
- super.onBeforeRender();
- }
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. CAs où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection de nouveau vers l'écran de saisie d'une nouvelle purification
- Purification nextManip = new Purification();
- nextManip.setManipulateur(purificationModel.getObject().getManipulateur());
- setResponsePage(new ManagePurificationPage(nextManip, callerPage));
- } else if (callerPage != null) {
- // On passe l'id de la purification associée à cette page, en paramètre de la prochaine page, pour lui
- // permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Purification.class.getSimpleName(), purificationModel.getObject()
- .getIdPurification());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. CAs où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection de nouveau vers l'écran de saisie d'une nouvelle purification
+ Purification nextManip = new Purification();
+ nextManip.setManipulateur(purificationModel.getObject().getManipulateur());
+ setResponsePage(new ManagePurificationPage(nextManip, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id de la purification associée à cette page, en paramètre de la prochaine page, pour lui
+ // permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Purification.class.getSimpleName(), purificationModel.getObject()
+ .getIdPurification());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Refresh model, appelé au rechargement de la page
- */
- private void refreshModel() {
+ /**
+ * Refresh model, appelé au rechargement de la page
+ */
+ private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Personne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(personnes, personneService.listPersonnes());
- try {
- Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
- purificationModel.getObject().setManipulateur(createdPersonne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
- }
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Personne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(personnes, personneService.listPersonnes());
+ try {
+ Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
+ purificationModel.getObject().setManipulateur(createdPersonne);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(purificationModel.getObject(), getSession().getLocale()));
- if (!purificationService.isPurificationUnique(purificationModel.getObject())) {
- error(getString("Purification.notUnique"));
- }
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(purificationModel.getObject(), getSession().getLocale()));
+ if (!purificationService.isPurificationUnique(purificationModel.getObject())) {
+ error(getString("Purification.notUnique"));
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ReadPurificationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ReadPurificationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/purification/ReadPurificationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -72,214 +72,214 @@
*/
public final class ReadPurificationPage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** purification Model */
- private final IModel<Purification> purificationModel;
+ /** purification Model */
+ private final IModel<Purification> purificationModel;
- /** Service : purifications */
- @SpringBean
- private PurificationService purificationService;
+ /** Service : purifications */
+ @SpringBean
+ private PurificationService purificationService;
- /** Container pour l'affichage de la description de la méthode */
- MarkupContainer descriptionMethoContainer;
+ /** Container pour l'affichage de la description de la méthode */
+ MarkupContainer descriptionMethoContainer;
- /** Container pour l'affichage des paramètres de la méthode */
- MarkupContainer paramsMethoContainer;
+ /** Container pour l'affichage des paramètres de la méthode */
+ MarkupContainer paramsMethoContainer;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /**
- * Constructeur
- * @param idPurification identifiant de la manip
- * @param callerPage Page appelante
- */
- public ReadPurificationPage(Integer idPurification, final CallerPage callerPage) {
- super(ReadPurificationPage.class);
- this.callerPage = callerPage;
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ /**
+ * Constructeur
+ * @param idPurification identifiant de la manip
+ * @param callerPage Page appelante
+ */
+ public ReadPurificationPage(Integer idPurification, final CallerPage callerPage) {
+ super(ReadPurificationPage.class);
+ this.callerPage = callerPage;
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- // Initialisation du modèle
- purificationModel = new GenericLoadableDetachableModel<Purification>(Purification.class, idPurification);
+ // Initialisation du modèle
+ purificationModel = new GenericLoadableDetachableModel<Purification>(Purification.class, idPurification);
- add(new Label("Purification.ref", new PropertyModel<String>(purificationModel, "ref"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Purification.manipulateur", new PropertyModel<Personne>(purificationModel, "manipulateur"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Purification.date", new PropertyModel<Date>(purificationModel, "date"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Purification.ref", new PropertyModel<String>(purificationModel, "ref"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Purification.manipulateur", new PropertyModel<Personne>(purificationModel, "manipulateur"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Purification.date", new PropertyModel<Date>(purificationModel, "date"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkProduitPanel("Purification.produit", new PropertyModel<Produit>(purificationModel,
- "produit"), (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
+ add(new PropertyLabelLinkProduitPanel("Purification.produit", new PropertyModel<Produit>(purificationModel,
+ "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));
- }
- });
+ @Override
+ public void onClickIfFraction(Fraction fraction) {
+ setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
+ }
+ });
- add(new Label("Purification.masseDepart", new PropertyModel<BigInteger>(purificationModel, "masseDepart"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Purification.complement", new PropertyModel<String>(purificationModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Purification.createur", new PropertyModel<Personne>(
- purificationModel, "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
- // Méthode purification
- final WebMarkupContainer methodeCont = new WebMarkupContainer("Purification.methode");
- methodeCont.add(new Label("Purification.nomMethode", new PropertyModel<MethodePurification>(purificationModel,
- "methode")));
- methodeCont.setOutputMarkupId(true);
- add(methodeCont);
+ add(new Label("Purification.masseDepart", new PropertyModel<BigInteger>(purificationModel, "masseDepart"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Purification.complement", new PropertyModel<String>(purificationModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new PropertyLabelLinkPanel<Personne>("Purification.createur", new PropertyModel<Personne>(
+ purificationModel, "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
+ // Méthode purification
+ final WebMarkupContainer methodeCont = new WebMarkupContainer("Purification.methode");
+ methodeCont.add(new Label("Purification.nomMethode", new PropertyModel<MethodePurification>(purificationModel,
+ "methode")));
+ methodeCont.setOutputMarkupId(true);
+ add(methodeCont);
- // Champs pour la méthode
- descriptionMethoContainer = new WebMarkupContainer("Purification.descriptionMethodeCont") {
- @Override
- public boolean isVisible() {
- // description cachée si pas de méthode sélectionnée
- return purificationModel.getObject().getMethode() != null;
- }
- };
- methodeCont.add(descriptionMethoContainer);
- final MultiLineLabel methodeDesc = new MultiLineLabel("Purification.descriptionMethode",
- new PropertyModel<String>(purificationModel, "methode.description"));
- methodeDesc.setOutputMarkupId(true);
- descriptionMethoContainer.add(methodeDesc);
+ // Champs pour la méthode
+ descriptionMethoContainer = new WebMarkupContainer("Purification.descriptionMethodeCont") {
+ @Override
+ public boolean isVisible() {
+ // description cachée si pas de méthode sélectionnée
+ return purificationModel.getObject().getMethode() != null;
+ }
+ };
+ methodeCont.add(descriptionMethoContainer);
+ final MultiLineLabel methodeDesc = new MultiLineLabel("Purification.descriptionMethode",
+ new PropertyModel<String>(purificationModel, "methode.description"));
+ methodeDesc.setOutputMarkupId(true);
+ descriptionMethoContainer.add(methodeDesc);
- // Déclaration du container des paramètres de la méthode
- paramsMethoContainer = new WebMarkupContainer("Purification.paramsMethode") {
- @Override
- public boolean isVisible() {
- // paramètres cachés si pas de méthode sélectionnée
- return purificationModel.getObject().getMethode() != null;
- }
- };
- final MarkupContainer paramsMethoTable = new WebMarkupContainer("Purification.paramsMethode.Table");
- paramsMethoContainer.add(paramsMethoTable);
+ // Déclaration du container des paramètres de la méthode
+ paramsMethoContainer = new WebMarkupContainer("Purification.paramsMethode") {
+ @Override
+ public boolean isVisible() {
+ // paramètres cachés si pas de méthode sélectionnée
+ return purificationModel.getObject().getMethode() != null;
+ }
+ };
+ final MarkupContainer paramsMethoTable = new WebMarkupContainer("Purification.paramsMethode.Table");
+ paramsMethoContainer.add(paramsMethoTable);
- ListView<ParamMethoPuriEffectif> paramMethodes = new ListView<ParamMethoPuriEffectif>(
- "Purification.paramsMethode.List", new PropertyModel<List<ParamMethoPuriEffectif>>(purificationModel,
- "sortedParamsMetho")) {
- @Override
- protected void populateItem(ListItem<ParamMethoPuriEffectif> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ ListView<ParamMethoPuriEffectif> paramMethodes = new ListView<ParamMethoPuriEffectif>(
+ "Purification.paramsMethode.List", new PropertyModel<List<ParamMethoPuriEffectif>>(purificationModel,
+ "sortedParamsMetho")) {
+ @Override
+ protected void populateItem(ListItem<ParamMethoPuriEffectif> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final ParamMethoPuriEffectif param = item.getModelObject();
- // Colonnes
- item.add(new Label("Purification.paramsMethode.nom", new PropertyModel<String>(param, "param.nom")));
- item.add(new SimpleTooltipPanel("Purification.paramsMethode.nom.info", new PropertyModel<String>(param,
- "param.description")));
- item.add(new Label("Purification.paramsMethode.valeur", new PropertyModel<String>(param, "valeur"))
- .add(new ReplaceEmptyLabelBehavior()));
- }
- };
- paramsMethoTable.add(paramMethodes);
- methodeCont.add(paramsMethoContainer);
+ final ParamMethoPuriEffectif param = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Purification.paramsMethode.nom", new PropertyModel<String>(param, "param.nom")));
+ item.add(new SimpleTooltipPanel("Purification.paramsMethode.nom.info", new PropertyModel<String>(param,
+ "param.description")));
+ item.add(new Label("Purification.paramsMethode.valeur", new PropertyModel<String>(param, "valeur"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ }
+ };
+ paramsMethoTable.add(paramMethodes);
+ methodeCont.add(paramsMethoContainer);
- add(methodeCont);
+ add(methodeCont);
- // Fractions
- // Déclaration tableau des fractions
- final MarkupContainer purificationsTable = new WebMarkupContainer("Purification.fractions.Table") {
- @Override
- public boolean isVisible() {
- return purificationModel.getObject().getFractions().size() > 0;
- }
- };
- purificationsTable.setOutputMarkupId(true);
+ // Fractions
+ // Déclaration tableau des fractions
+ final MarkupContainer purificationsTable = new WebMarkupContainer("Purification.fractions.Table") {
+ @Override
+ public boolean isVisible() {
+ return purificationModel.getObject().getFractions().size() > 0;
+ }
+ };
+ purificationsTable.setOutputMarkupId(true);
- // Contenu tableaux fractions
- purificationsTable.add(new ListView<Fraction>("Purification.fractions.List", new PropertyModel<List<Fraction>>(
- purificationModel, "sortedFractions")) {
- @Override
- protected void populateItem(ListItem<Fraction> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Contenu tableaux fractions
+ purificationsTable.add(new ListView<Fraction>("Purification.fractions.List", new PropertyModel<List<Fraction>>(
+ purificationModel, "sortedFractions")) {
+ @Override
+ protected void populateItem(ListItem<Fraction> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final Fraction fraction = item.getModelObject();
- // Colonnes
- item.add(new Label("Purification.fractions.List.indice", new PropertyModel<String>(fraction, "indice")));
- item.add(new Label("Purification.fractions.List.ref", new PropertyModel<String>(fraction, "ref")));
- item.add(new Label("Purification.fractions.List.masseObtenue", new DisplayDecimalPropertyModel(item
- .getModel(), "masseObtenue", DecimalDisplFormat.LARGE, getLocale())));
- item.add(new Label("Purification.fractions.List.rendement", new DisplayPercentPropertyModel(item
- .getModel(), "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
- }
- });
- add(purificationsTable);
+ final Fraction fraction = item.getModelObject();
+ // Colonnes
+ item.add(new Label("Purification.fractions.List.indice", new PropertyModel<String>(fraction, "indice")));
+ item.add(new Label("Purification.fractions.List.ref", new PropertyModel<String>(fraction, "ref")));
+ item.add(new Label("Purification.fractions.List.masseObtenue", new DisplayDecimalPropertyModel(item
+ .getModel(), "masseObtenue", DecimalDisplFormat.LARGE, getLocale())));
+ item.add(new Label("Purification.fractions.List.rendement", new DisplayPercentPropertyModel(item
+ .getModel(), "rendement", getLocale())).add(new ReplaceEmptyLabelBehavior()));
+ }
+ });
+ add(purificationsTable);
- // Selon la non existence d'elements dans la liste on affiche le span
- add(new WebMarkupContainer("Purification.fractions.noTable") {
- @Override
- public boolean isVisible() {
- return !purificationsTable.isVisible();
- }
- });
+ // Selon la non existence d'elements dans la liste on affiche le span
+ add(new WebMarkupContainer("Purification.fractions.noTable") {
+ @Override
+ public boolean isVisible() {
+ return !purificationsTable.isVisible();
+ }
+ });
- // Formulaire des actions
- final Form<Void> formView = new Form<Void>("Form");
+ // Formulaire des actions
+ final Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<Purification> updateLink = new Link<Purification>(getResource() + ".Purification.Update",
- new Model<Purification>(purificationModel.getObject())) {
- @Override
- public void onClick() {
- setResponsePage(new ManagePurificationPage(getModelObject().getIdPurification(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(purificationService.updateOrdeletePurificationEnabled(
- purificationModel.getObject(), getSession().getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Purification> updateLink = new Link<Purification>(getResource() + ".Purification.Update",
+ new Model<Purification>(purificationModel.getObject())) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManagePurificationPage(getModelObject().getIdPurification(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(purificationService.updateOrdeletePurificationEnabled(
+ purificationModel.getObject(), getSession().getUtilisateur()));
+ formView.add(updateLink);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePurificationPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- purificationService.deletePurification(purificationModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManagePurificationPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ purificationService.deletePurification(purificationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManagePurificationPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(purificationService.updateOrdeletePurificationEnabled(
- purificationModel.getObject(), getSession().getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ManagePurificationPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(purificationService.updateOrdeletePurificationEnabled(
+ purificationModel.getObject(), getSession().getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- // Action : retour
- formView.add(new Link<Void>(getResource() + ".Purification.Back") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- add(formView);
- }
+ // Action : retour
+ formView.add(new Link<Void>(getResource() + ".Purification.Back") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ListSpecimensPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -61,102 +61,102 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListSpecimensPage extends TemplatePage {
- /** Service : specimen */
- @SpringBean
- private SpecimenService specimenService;
+ /** Service : specimen */
+ @SpringBean
+ private SpecimenService specimenService;
- /**
- * Constructeur
- */
- public ListSpecimensPage() {
- super(ListSpecimensPage.class);
+ /**
+ * Constructeur
+ */
+ public ListSpecimensPage() {
+ super(ListSpecimensPage.class);
- final CallerPage currentPage = new CallerPage(ListSpecimensPage.class);
+ final CallerPage currentPage = new CallerPage(ListSpecimensPage.class);
- add(new Link<Void>(getResource() + ".NewSpecimen") {
- @Override
- public void onClick() {
- setResponsePage(new ManageSpecimenPage(currentPage, true));
- }
- });
+ add(new Link<Void>(getResource() + ".NewSpecimen") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageSpecimenPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer specimensRefresh = new WebMarkupContainer(getResource() + ".Specimens.Refresh");
- specimensRefresh.setOutputMarkupId(true);
- add(specimensRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer specimensRefresh = new WebMarkupContainer(getResource() + ".Specimens.Refresh");
+ specimensRefresh.setOutputMarkupId(true);
+ add(specimensRefresh);
- // Liste des Specimens
- final List<Specimen> specimens = specimenService.listSpecimens(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
- specimens, getSession().getLocale());
+ // Liste des Specimens
+ final List<Specimen> specimens = specimenService.listSpecimens(getSession().getUtilisateur());
+ LoadableDetachableSortableListDataProvider<Specimen> specimensDataProvider = new LoadableDetachableSortableListDataProvider<Specimen>(
+ specimens, getSession().getLocale());
- List<IColumn<Specimen>> columns = new ArrayList<IColumn<Specimen>>();
+ List<IColumn<Specimen>> columns = new ArrayList<IColumn<Specimen>>();
- columns.add(new LinkableImagePropertyColumn<Specimen>("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 LinkableImagePropertyColumn<Specimen>("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",
- 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",
+ 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 EnumPropertyColumn<Specimen>(new Model<String>(getString("Specimen.typeOrganisme")),
- "typeOrganisme", "typeOrganisme", ListSpecimensPage.this));
+ columns.add(new EnumPropertyColumn<Specimen>(new Model<String>(getString("Specimen.typeOrganisme")),
+ "typeOrganisme", "typeOrganisme", ListSpecimensPage.this));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.embranchement")),
- "embranchement", "embranchement"));
+ columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.embranchement")),
+ "embranchement", "embranchement"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.famille")), "famille",
- "famille"));
+ columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.famille")), "famille",
+ "famille"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.genre")), "genre",
- "genre"));
+ columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.genre")), "genre",
+ "genre"));
- columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.espece")), "espece",
- "espece"));
+ columns.add(new TaxonomyPropertyColumn<Specimen>(new Model<String>(getString("Specimen.espece")), "espece",
+ "espece"));
- columns.add(new LinkPropertyColumn<Specimen>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<Specimen>(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));
+ }
+ });
- columns.add(new LinkableImagePropertyColumn<Specimen>("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<Specimen>> item, String componentId, IModel<Specimen> model) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ columns.add(new LinkableImagePropertyColumn<Specimen>("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<Specimen>> item, String componentId, IModel<Specimen> model) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- if (specimenService.updateOrdeleteSpecimenEnabled(model.getObject(), getSession().getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ if (specimenService.updateOrdeleteSpecimenEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
- setResponsePage(new ManageSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Specimen>> item, String componentId, IModel<Specimen> model) {
+ setResponsePage(new ManageSpecimenPage(model.getObject().getIdSpecimen(), currentPage));
+ }
+ });
- final DataTable<Specimen> specimensDataTable = new AjaxFallbackDefaultDataTable<Specimen>(
- "ListSpecimensPage.Specimens", columns, specimensDataProvider, WebContext.ROWS_PER_PAGE);
+ final DataTable<Specimen> specimensDataTable = new AjaxFallbackDefaultDataTable<Specimen>(
+ "ListSpecimensPage.Specimens", columns, specimensDataProvider, WebContext.ROWS_PER_PAGE);
- specimensRefresh.add(specimensDataTable);
- }
+ specimensRefresh.add(specimensDataTable);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ManageSpecimenPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ManageSpecimenPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ManageSpecimenPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -79,353 +79,353 @@
@AuthRoles({ AuthRole.USER, AuthRole.ADMIN })
public final class ManageSpecimenPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Modèle : specimen */
- private final IModel<Specimen> specimenModel;
+ /** Modèle : specimen */
+ private final IModel<Specimen> specimenModel;
- /** Service : specimen */
- @SpringBean
- private SpecimenService specimenService;
+ /** Service : specimen */
+ @SpringBean
+ private SpecimenService specimenService;
- /** Liste des personnes existantes */
- private final List<Personne> personnes;
+ /** Liste des personnes existantes */
+ private final List<Personne> personnes;
- /** Liste des stations existantes */
- private final List<Station> stations;
+ /** Liste des stations existantes */
+ private final List<Station> stations;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageSpecimenPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageSpecimenPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idSpecimen Id du specimen
- * @param callerPage Page appelante
- */
- public ManageSpecimenPage(Integer idSpecimen, CallerPage callerPage) {
- this(idSpecimen, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idSpecimen Id du specimen
+ * @param callerPage Page appelante
+ */
+ public ManageSpecimenPage(Integer idSpecimen, CallerPage callerPage) {
+ this(idSpecimen, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie du specimen suivant)
- * @param specimen Specimen
- * @param callerPage Page appelante
- */
- public ManageSpecimenPage(Specimen specimen, CallerPage callerPage) {
- this(null, specimen, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie du specimen suivant)
+ * @param specimen Specimen
+ * @param callerPage Page appelante
+ */
+ public ManageSpecimenPage(Specimen specimen, CallerPage callerPage) {
+ this(null, specimen, callerPage, true);
+ }
- /**
- * Constructeur. Si refSpecimen et specimen sont nuls, on créée un nouveau Specimen. Si refSpecimen est renseigné,
- * on édite le specimen correspondant. Si specimen est renseigné, on créée un nouveau specimen à partir des
- * informations qu'il contient.
- * @param idSpecimen Id du specimen
- * @param specimen Specimen
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManageSpecimenPage(Integer idSpecimen, Specimen specimen, final CallerPage callerPage, boolean multipleEntry) {
- super(ManageSpecimenPage.class);
- assert idSpecimen == null || specimen == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si refSpecimen et specimen sont nuls, on créée un nouveau Specimen. Si refSpecimen est renseigné,
+ * on édite le specimen correspondant. Si specimen est renseigné, on créée un nouveau specimen à partir des
+ * informations qu'il contient.
+ * @param idSpecimen Id du specimen
+ * @param specimen Specimen
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManageSpecimenPage(Integer idSpecimen, Specimen specimen, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManageSpecimenPage.class);
+ assert idSpecimen == null || specimen == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- final CallerPage currentPage = new CallerPage(this);
+ final CallerPage currentPage = new CallerPage(this);
- // Initialisation du modèle
- try {
- specimenModel = new Model<Specimen>(idSpecimen == null && specimen == null ? new Specimen()
- : specimen != null ? specimen : specimenService.loadSpecimen(idSpecimen));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- boolean createMode = idSpecimen == null;
- if (createMode) {
- specimenModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ // Initialisation du modèle
+ try {
+ specimenModel = new Model<Specimen>(idSpecimen == null && specimen == null ? new Specimen()
+ : specimen != null ? specimen : specimenService.loadSpecimen(idSpecimen));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ boolean createMode = idSpecimen == null;
+ if (createMode) {
+ specimenModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes (pour le dropDownChoice)
- personnes = personneService.listPersonnes();
- stations = stationService.listStations(getSession().getUtilisateur());
+ // Initialisation des listes (pour le dropDownChoice)
+ personnes = personneService.listPersonnes();
+ stations = stationService.listStations(getSession().getUtilisateur());
- // Initialisation des listes (pour le AutoCompleteTextField)
- // liste des valeurs déjà existantes pour la propriété correspondante
- List<String> embranchements = specimenService.listSpecimenEmbranchements();
- List<String> familles = specimenService.listSpecimenFamilles();
- List<String> genres = specimenService.listSpecimenGenres();
- List<String> especes = specimenService.listSpecimenEspeces();
- List<String> sousEspeces = specimenService.listSpecimenSousEspeces();
- List<String> varietes = specimenService.listSpecimenVarietes();
- List<String> lieuxDepot = specimenService.listLieuxDepot();
+ // Initialisation des listes (pour le AutoCompleteTextField)
+ // liste des valeurs déjà existantes pour la propriété correspondante
+ List<String> embranchements = specimenService.listSpecimenEmbranchements();
+ List<String> familles = specimenService.listSpecimenFamilles();
+ List<String> genres = specimenService.listSpecimenGenres();
+ List<String> especes = specimenService.listSpecimenEspeces();
+ List<String> sousEspeces = specimenService.listSpecimenSousEspeces();
+ List<String> varietes = specimenService.listSpecimenVarietes();
+ List<String> lieuxDepot = specimenService.listLieuxDepot();
- if (specimen != null) {
- // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
- // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
- // l'égalité entre les objets)
- if (specimenModel.getObject().getIdentificateur() != null) {
- specimenModel.getObject().setIdentificateur(
- CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, specimenModel
- .getObject().getIdentificateur().getIdPersonne()));
- }
- if (specimenModel.getObject().getStation() != null) {
- specimenModel.getObject().setStation(
- CollectionTools.findWithValue(stations, "idStation", AccessType.GETTER, specimenModel
- .getObject().getStation().getIdStation()));
- }
- }
+ if (specimen != null) {
+ // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
+ // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
+ // l'égalité entre les objets)
+ if (specimenModel.getObject().getIdentificateur() != null) {
+ specimenModel.getObject().setIdentificateur(
+ CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, specimenModel
+ .getObject().getIdentificateur().getIdPersonne()));
+ }
+ if (specimenModel.getObject().getStation() != null) {
+ specimenModel.getObject().setStation(
+ CollectionTools.findWithValue(stations, "idStation", AccessType.GETTER, specimenModel
+ .getObject().getStation().getIdStation()));
+ }
+ }
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("Specimen.ref", new PropertyModel<String>(specimenModel, "ref")));
- formView.add(new AutoCompleteTextFieldString("Specimen.embranchement", new PropertyModel<String>(specimenModel,
- "embranchement"), embranchements, ComparisonMode.CONTAINS));
- formView.add(new AutoCompleteTextFieldString("Specimen.famille", new PropertyModel<String>(specimenModel,
- "famille"), familles, ComparisonMode.CONTAINS));
- formView.add(new AutoCompleteTextFieldString("Specimen.genre",
- new PropertyModel<String>(specimenModel, "genre"), genres, ComparisonMode.CONTAINS));
- formView.add(new AutoCompleteTextFieldString("Specimen.espece", new PropertyModel<String>(specimenModel,
- "espece"), especes, ComparisonMode.CONTAINS));
- formView.add(new AutoCompleteTextFieldString("Specimen.sousEspece", new PropertyModel<String>(specimenModel,
- "sousEspece"), sousEspeces, ComparisonMode.CONTAINS));
- formView.add(new AutoCompleteTextFieldString("Specimen.variete", new PropertyModel<String>(specimenModel,
- "variete"), varietes, ComparisonMode.CONTAINS));
+ formView.add(new TextField<String>("Specimen.ref", new PropertyModel<String>(specimenModel, "ref")));
+ formView.add(new AutoCompleteTextFieldString("Specimen.embranchement", new PropertyModel<String>(specimenModel,
+ "embranchement"), embranchements, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("Specimen.famille", new PropertyModel<String>(specimenModel,
+ "famille"), familles, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("Specimen.genre",
+ new PropertyModel<String>(specimenModel, "genre"), genres, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("Specimen.espece", new PropertyModel<String>(specimenModel,
+ "espece"), especes, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("Specimen.sousEspece", new PropertyModel<String>(specimenModel,
+ "sousEspece"), sousEspeces, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("Specimen.variete", new PropertyModel<String>(specimenModel,
+ "variete"), varietes, ComparisonMode.CONTAINS));
- DropDownChoice<TypeOrganisme> typeOrganismeInput = new DropDownChoice<TypeOrganisme>("Specimen.typeOrganisme",
- new PropertyModel<TypeOrganisme>(specimenModel, "typeOrganisme"),
- Arrays.asList(TypeOrganisme.values()), new EnumChoiceRenderer<TypeOrganisme>(this));
- typeOrganismeInput.setNullValid(false);
- formView.add(typeOrganismeInput);
+ DropDownChoice<TypeOrganisme> typeOrganismeInput = new DropDownChoice<TypeOrganisme>("Specimen.typeOrganisme",
+ new PropertyModel<TypeOrganisme>(specimenModel, "typeOrganisme"),
+ Arrays.asList(TypeOrganisme.values()), new EnumChoiceRenderer<TypeOrganisme>(this));
+ typeOrganismeInput.setNullValid(false);
+ formView.add(typeOrganismeInput);
- formView.add(new DropDownChoice<Personne>("Specimen.identificateur", new PropertyModel<Personne>(specimenModel,
- "identificateur"), personnes, new PersonneRenderer()).setNullValid(true));
- // Action : création d'une nouvelle personne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewPersonne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManagePersonnePage(currentPage, false));
- }
+ formView.add(new DropDownChoice<Personne>("Specimen.identificateur", new PropertyModel<Personne>(specimenModel,
+ "identificateur"), personnes, new PersonneRenderer()).setNullValid(true));
+ // Action : création d'une nouvelle personne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewPersonne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManagePersonnePage(currentPage, false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManagePersonnePage(currentPage, false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManagePersonnePage(currentPage, false));
+ }
+ });
- formView.add(new DropDownChoice<Station>("Specimen.station", new PropertyModel<Station>(specimenModel,
- "station"), stations).setNullValid(true));
+ formView.add(new DropDownChoice<Station>("Specimen.station", new PropertyModel<Station>(specimenModel,
+ "station"), stations).setNullValid(true));
- // Action : création d'une nouvelle station
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewStation") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManageStationPage(currentPage, false));
- }
+ // Action : création d'une nouvelle station
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewStation") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManageStationPage(currentPage, false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManageStationPage(currentPage, false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManageStationPage(currentPage, false));
+ }
+ });
- formView.add(new TextArea<String>("Specimen.complement", new PropertyModel<String>(specimenModel, "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Specimen.createur", new PropertyModel<String>(specimenModel, "createur"))
- .setEnabled(false));
+ formView.add(new TextArea<String>("Specimen.complement", new PropertyModel<String>(specimenModel, "complement")));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Specimen.createur", new PropertyModel<String>(specimenModel, "createur"))
+ .setEnabled(false));
- // champs dépôt
- formView.add(new TextField<String>("Specimen.numDepot", new PropertyModel<String>(specimenModel, "numDepot")));
- formView.add(new DateTextField("Specimen.dateDepot", new PropertyModel<Date>(specimenModel, "dateDepot"))
- .add(new DatePicker()));
- formView.add(new AutoCompleteTextFieldString("Specimen.lieuDepot", new PropertyModel<String>(specimenModel,
- "lieuDepot"), lieuxDepot, ComparisonMode.CONTAINS));
+ // champs dépôt
+ formView.add(new TextField<String>("Specimen.numDepot", new PropertyModel<String>(specimenModel, "numDepot")));
+ formView.add(new DateTextField("Specimen.dateDepot", new PropertyModel<Date>(specimenModel, "dateDepot"))
+ .add(new DatePicker()));
+ formView.add(new AutoCompleteTextFieldString("Specimen.lieuDepot", new PropertyModel<String>(specimenModel,
+ "lieuDepot"), lieuxDepot, ComparisonMode.CONTAINS));
- // Action : création du specimen
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- specimenService.createSpecimen(specimenModel.getObject());
- }
+ // Action : création du specimen
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ specimenService.createSpecimen(specimenModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : mise à jour du specimen
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- specimenService.updateSpecimen(specimenModel.getObject());
- }
+ // Action : mise à jour du specimen
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ specimenService.updateSpecimen(specimenModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode
- && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
- .getUtilisateur()));
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode
+ && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
+ .getUtilisateur()));
+ formView.add(updateButton);
- // Action : suppression du specimen
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- specimenService.deleteSpecimen(specimenModel.getObject());
- }
+ // Action : suppression du specimen
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ specimenService.deleteSpecimen(specimenModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode
- && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode
+ && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Station, Spécimen ou Campagne)
- refreshModel();
- super.onBeforeRender();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Station, Spécimen ou Campagne)
+ refreshModel();
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection de nouveau vers l'écran de saisie d'un nouveau spécimen
- Specimen nextSpecimen = new Specimen();
- nextSpecimen.setTypeOrganisme(specimenModel.getObject().getTypeOrganisme());
- nextSpecimen.setEmbranchement(specimenModel.getObject().getEmbranchement());
- nextSpecimen.setIdentificateur(specimenModel.getObject().getIdentificateur());
- nextSpecimen.setStation(specimenModel.getObject().getStation());
- nextSpecimen.setLieuDepot(specimenModel.getObject().getLieuDepot());
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection de nouveau vers l'écran de saisie d'un nouveau spécimen
+ Specimen nextSpecimen = new Specimen();
+ nextSpecimen.setTypeOrganisme(specimenModel.getObject().getTypeOrganisme());
+ nextSpecimen.setEmbranchement(specimenModel.getObject().getEmbranchement());
+ nextSpecimen.setIdentificateur(specimenModel.getObject().getIdentificateur());
+ nextSpecimen.setStation(specimenModel.getObject().getStation());
+ nextSpecimen.setLieuDepot(specimenModel.getObject().getLieuDepot());
- setResponsePage(new ManageSpecimenPage(nextSpecimen, callerPage));
- } else if (callerPage != null) {
- // On passe l'id du specimen associée à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Specimen.class.getSimpleName(), specimenModel.getObject().getIdSpecimen());
- callerPage.responsePage(this);
- }
- }
+ setResponsePage(new ManageSpecimenPage(nextSpecimen, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id du specimen associée à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Specimen.class.getSimpleName(), specimenModel.getObject().getIdSpecimen());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Refresh model
- */
- private void refreshModel() {
+ /**
+ * Refresh model
+ */
+ private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Personne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(personnes, personneService.listPersonnes());
- try {
- Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
- specimenModel.getObject().setIdentificateur(createdPersonne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
- key = Station.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(stations, stationService.listStations(getSession().getUtilisateur()));
- try {
- Station createdStation = stationService.loadStation(getPageParameters().get(key).toInt());
- specimenModel.getObject().setStation(createdStation);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
- }
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Personne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(personnes, personneService.listPersonnes());
+ try {
+ Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
+ specimenModel.getObject().setIdentificateur(createdPersonne);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
+ key = Station.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(stations, stationService.listStations(getSession().getUtilisateur()));
+ try {
+ Station createdStation = stationService.loadStation(getPageParameters().get(key).toInt());
+ specimenModel.getObject().setStation(createdStation);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(specimenModel.getObject(), getSession().getLocale()));
- }
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(specimenModel.getObject(), getSession().getLocale()));
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ReadSpecimenPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ReadSpecimenPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/specimen/ReadSpecimenPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -57,142 +57,142 @@
*/
public final class ReadSpecimenPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Modèle : specimen */
- private final IModel<Specimen> specimenModel;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Modèle : specimen */
+ private final IModel<Specimen> specimenModel;
- /** Service : specimen */
- @SpringBean
- private SpecimenService specimenService;
+ /** Service : specimen */
+ @SpringBean
+ private SpecimenService specimenService;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /**
- * Constructeur
- * @param idSpecimen identifiant du spécimen
- * @param callerPage Page appelante
- */
- public ReadSpecimenPage(Integer idSpecimen, final CallerPage callerPage) {
- super(ReadSpecimenPage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ /**
+ * Constructeur
+ * @param idSpecimen identifiant du spécimen
+ * @param callerPage Page appelante
+ */
+ public ReadSpecimenPage(Integer idSpecimen, final CallerPage callerPage) {
+ super(ReadSpecimenPage.class);
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation du modèle
- specimenModel = new GenericLoadableDetachableModel<Specimen>(Specimen.class, idSpecimen);
+ // Initialisation du modèle
+ specimenModel = new GenericLoadableDetachableModel<Specimen>(Specimen.class, idSpecimen);
- boolean createMode = idSpecimen == null;
- if (createMode) {
- specimenModel.getObject().setCreateur(getSession().getUtilisateur());
- }
- final Specimen specimen = specimenModel.getObject();
+ boolean createMode = idSpecimen == null;
+ if (createMode) {
+ specimenModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
+ final Specimen specimen = specimenModel.getObject();
- // Mapping
- add(new Label("Specimen.ref", new PropertyModel<String>(specimenModel, "ref"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.embranchement", new PropertyModel<String>(specimenModel, "embranchement"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.famille", new PropertyModel<String>(specimenModel, "famille"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.genre", new PropertyModel<String>(specimenModel, "genre"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.espece", new PropertyModel<String>(specimenModel, "espece"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.sousEspece", new PropertyModel<String>(specimenModel, "sousEspece"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.variete", new PropertyModel<String>(specimenModel, "variete"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.typeOrganisme", new DisplayEnumPropertyModel(specimenModel, "typeOrganisme", this)));
+ // Mapping
+ add(new Label("Specimen.ref", new PropertyModel<String>(specimenModel, "ref"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.embranchement", new PropertyModel<String>(specimenModel, "embranchement"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.famille", new PropertyModel<String>(specimenModel, "famille"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.genre", new PropertyModel<String>(specimenModel, "genre"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.espece", new PropertyModel<String>(specimenModel, "espece"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.sousEspece", new PropertyModel<String>(specimenModel, "sousEspece"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.variete", new PropertyModel<String>(specimenModel, "variete"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.typeOrganisme", new DisplayEnumPropertyModel(specimenModel, "typeOrganisme", this)));
- add(new PropertyLabelLinkPanel<Personne>("Specimen.identificateur", new PropertyModel<Personne>(specimenModel,
- "identificateur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Specimen.identificateur", new PropertyModel<Personne>(specimenModel,
+ "identificateur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- add(new PropertyLabelLinkPanel<Station>("Specimen.station",
- new PropertyModel<Station>(specimenModel, "station"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
- }
- }.add(new ReplaceEmptyLabelBehavior()));
+ add(new PropertyLabelLinkPanel<Station>("Specimen.station",
+ new PropertyModel<Station>(specimenModel, "station"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadStationPage(getModelObject().getIdStation(), currentPage));
+ }
+ }.add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("Specimen.complement", new PropertyModel<String>(specimenModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("Specimen.complement", new PropertyModel<String>(specimenModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Specimen.createur", new PropertyModel<Personne>(specimenModel,
- "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("Specimen.createur", new PropertyModel<Personne>(specimenModel,
+ "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- // champs dépôt
- add(new Label("Specimen.numDepot", new PropertyModel<String>(specimenModel, "numDepot"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.dateDepot", new PropertyModel<Date>(specimenModel, "dateDepot"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Specimen.lieuDepot", new PropertyModel<String>(specimenModel, "lieuDepot"))
- .add(new ReplaceEmptyLabelBehavior()));
+ // champs dépôt
+ add(new Label("Specimen.numDepot", new PropertyModel<String>(specimenModel, "numDepot"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.dateDepot", new PropertyModel<Date>(specimenModel, "dateDepot"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Specimen.lieuDepot", new PropertyModel<String>(specimenModel, "lieuDepot"))
+ .add(new ReplaceEmptyLabelBehavior()));
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour
- Link<Specimen> updateLink = new Link<Specimen>(getResource() + ".Specimen.Update",
- new Model<Specimen>(specimen)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageSpecimenPage(getModelObject().getIdSpecimen(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(specimenService.updateOrdeleteSpecimenEnabled(specimen, getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour
+ Link<Specimen> updateLink = new Link<Specimen>(getResource() + ".Specimen.Update",
+ new Model<Specimen>(specimen)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageSpecimenPage(getModelObject().getIdSpecimen(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(specimenService.updateOrdeleteSpecimenEnabled(specimen, getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : suppression du specimen
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageSpecimenPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- specimenService.deleteSpecimen(specimenModel.getObject());
- }
+ // Action : suppression du specimen
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageSpecimenPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ specimenService.deleteSpecimen(specimenModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageSpecimenPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(!createMode
- && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageSpecimenPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode
+ && specimenService.updateOrdeleteSpecimenEnabled(specimenModel.getObject(), getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- // Action : retour
- formView.add(new Link<Void>(getResource() + ".Specimen.Back") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ // Action : retour
+ formView.add(new Link<Void>(getResource() + ".Specimen.Back") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ListStationsPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -60,92 +60,92 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListStationsPage extends TemplatePage {
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /**
- * Constructeur
- */
- public ListStationsPage() {
- super(ListStationsPage.class);
+ /**
+ * Constructeur
+ */
+ public ListStationsPage() {
+ super(ListStationsPage.class);
- final CallerPage currentPage = new CallerPage(ListStationsPage.class);
+ final CallerPage currentPage = new CallerPage(ListStationsPage.class);
- // Lien pour ajouter une nouvelle station
- add(new Link<Station>(getResource() + ".NewStation") {
- @Override
- public void onClick() {
- setResponsePage(new ManageStationPage(currentPage, true));
- }
- });
+ // Lien pour ajouter une nouvelle station
+ add(new Link<Station>(getResource() + ".NewStation") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageStationPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer stationsRefresh = new WebMarkupContainer(getResource() + ".Stations.Refresh");
- stationsRefresh.setOutputMarkupId(true);
- add(stationsRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer stationsRefresh = new WebMarkupContainer(getResource() + ".Stations.Refresh");
+ stationsRefresh.setOutputMarkupId(true);
+ add(stationsRefresh);
- // Liste des stations
- final List<Station> stations = stationService.listStations(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
- stations, getSession().getLocale());
+ // Liste des stations
+ final List<Station> stations = stationService.listStations(getSession().getUtilisateur());
+ LoadableDetachableSortableListDataProvider<Station> stationsDataProvider = new LoadableDetachableSortableListDataProvider<Station>(
+ stations, getSession().getLocale());
- List<IColumn<Station>> columns = new ArrayList<IColumn<Station>>();
+ List<IColumn<Station>> columns = new ArrayList<IColumn<Station>>();
- columns.add(new LinkableImagePropertyColumn<Station>("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 LinkableImagePropertyColumn<Station>("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",
- 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",
+ 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>(new Model<String>(getString("Station.codePays")),
- "codePays", "codePays", WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<Station, 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",
- "localite"));
+ columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.localite")), "localite",
+ "localite"));
- columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.latitude")), "latitude",
- "latitude"));
+ columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.latitude")), "latitude",
+ "latitude"));
- columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.longitude")), "longitude",
- "longitude"));
+ columns.add(new PropertyColumn<Station>(new Model<String>(getString("Station.longitude")), "longitude",
+ "longitude"));
- columns.add(new LinkableImagePropertyColumn<Station>("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<Station>> item, String componentId, IModel<Station> model) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ columns.add(new LinkableImagePropertyColumn<Station>("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<Station>> item, String componentId, IModel<Station> model) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- if (stationService.updateOrdeleteStationEnabled(model.getObject(), getSession().getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ if (stationService.updateOrdeleteStationEnabled(model.getObject(), getSession().getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
- setResponsePage(new ManageStationPage(model.getObject().getIdStation(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<Station>> item, String componentId, IModel<Station> model) {
+ setResponsePage(new ManageStationPage(model.getObject().getIdStation(), currentPage));
+ }
+ });
- final DataTable<Station> stationsDataTable = new AjaxFallbackDefaultDataTable<Station>(
- "ListStationsPage.Stations", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
+ final DataTable<Station> stationsDataTable = new AjaxFallbackDefaultDataTable<Station>(
+ "ListStationsPage.Stations", columns, stationsDataProvider, WebContext.ROWS_PER_PAGE);
- stationsRefresh.add(stationsDataTable);
- }
+ stationsRefresh.add(stationsDataTable);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ManageStationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ManageStationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ManageStationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -69,335 +69,335 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManageStationPage extends TemplatePage {
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update */
- public static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ public static final String ACTION_UPDATE = "Update";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /** Modèle : manage station */
- private final IModel<ManageStationModel> manageStationModel;
+ /** Modèle : manage station */
+ private final IModel<ManageStationModel> manageStationModel;
- /** Modèle : station */
- private final IModel<Station> stationModel;
+ /** Modèle : station */
+ private final IModel<Station> stationModel;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructor (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie de stations multiples
- */
- public ManageStationPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructor (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie de stations multiples
+ */
+ public ManageStationPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idStation ID station
- * @param callerPage Page appelante
- */
- public ManageStationPage(Integer idStation, CallerPage callerPage) {
- this(idStation, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idStation ID station
+ * @param callerPage Page appelante
+ */
+ public ManageStationPage(Integer idStation, CallerPage callerPage) {
+ this(idStation, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la station suivante)
- * @param station Station
- * @param callerPage Page appelante
- */
- public ManageStationPage(Station station, CallerPage callerPage) {
- this(null, station, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la station suivante)
+ * @param station Station
+ * @param callerPage Page appelante
+ */
+ public ManageStationPage(Station station, CallerPage callerPage) {
+ this(null, station, callerPage, true);
+ }
- /**
- * Constructeur. Si idStation et station sont null, on créée une nouvelle Station. Si idStation est renseigné, on
- * édite la station correspondante. Si station est renseigné, on créée une nouvelle station à partir des
- * informations qu'il contient.
- * @param idStation ID station
- * @param station Station
- * @param callerPage Page appelante
- * @param multipleEntry Saisie de stations multiples
- */
- private ManageStationPage(Integer idStation, Station station, final CallerPage callerPage,
- final boolean multipleEntry) {
- super(ManageStationPage.class);
- assert idStation == null || station == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si idStation et station sont null, on créée une nouvelle Station. Si idStation est renseigné, on
+ * édite la station correspondante. Si station est renseigné, on créée une nouvelle station à partir des
+ * informations qu'il contient.
+ * @param idStation ID station
+ * @param station Station
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie de stations multiples
+ */
+ private ManageStationPage(Integer idStation, Station station, final CallerPage callerPage,
+ final boolean multipleEntry) {
+ super(ManageStationPage.class);
+ assert idStation == null || station == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- // Initialisation du modèle
- manageStationModel = new Model<ManageStationModel>(new ManageStationModel());
- try {
- stationModel = new Model<Station>(idStation == null && station == null ? new Station()
- : station != null ? station : stationService.loadStation(idStation));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- boolean createMode = idStation == null;
- if (createMode) {
- stationModel.getObject().setCreateur(getSession().getUtilisateur());
- if (station != null) {
- // cas où édition d'une station à partir de champs préremplies de l'ancienne station
- // on met à jour le modèle intermédiaire pour les coordonnées (pas les minutes de longitude et latitude
- // par contre)
- manageStationModel.getObject().setLatitudeDegrees(
- CoordTools.latitudeDegrees(stationModel.getObject().getLatitude()));
- manageStationModel.getObject().setLatitudeOrientation(
- CoordTools.latitudeOrientation(stationModel.getObject().getLatitude()));
- manageStationModel.getObject().setLongitudeDegrees(
- CoordTools.longitudeDegrees(stationModel.getObject().getLongitude()));
- manageStationModel.getObject().setLongitudeOrientation(
- CoordTools.longitudeOrientation(stationModel.getObject().getLongitude()));
- }
- } else {
- // mode édition, mise à jour du modèle intermédiaire pour les coordonnées
- manageStationModel.getObject().setLatitudeDegrees(
- CoordTools.latitudeDegrees(stationModel.getObject().getLatitude()));
- manageStationModel.getObject().setLatitudeMinutes(
- CoordTools.latitudeMinutes(stationModel.getObject().getLatitude()));
- manageStationModel.getObject().setLatitudeOrientation(
- CoordTools.latitudeOrientation(stationModel.getObject().getLatitude()));
- manageStationModel.getObject().setLongitudeDegrees(
- CoordTools.longitudeDegrees(stationModel.getObject().getLongitude()));
- manageStationModel.getObject().setLongitudeMinutes(
- CoordTools.longitudeMinutes(stationModel.getObject().getLongitude()));
- manageStationModel.getObject().setLongitudeOrientation(
- CoordTools.longitudeOrientation(stationModel.getObject().getLongitude()));
- }
+ // Initialisation du modèle
+ manageStationModel = new Model<ManageStationModel>(new ManageStationModel());
+ try {
+ stationModel = new Model<Station>(idStation == null && station == null ? new Station()
+ : station != null ? station : stationService.loadStation(idStation));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ boolean createMode = idStation == null;
+ if (createMode) {
+ stationModel.getObject().setCreateur(getSession().getUtilisateur());
+ if (station != null) {
+ // cas où édition d'une station à partir de champs préremplies de l'ancienne station
+ // on met à jour le modèle intermédiaire pour les coordonnées (pas les minutes de longitude et latitude
+ // par contre)
+ manageStationModel.getObject().setLatitudeDegrees(
+ CoordTools.latitudeDegrees(stationModel.getObject().getLatitude()));
+ manageStationModel.getObject().setLatitudeOrientation(
+ CoordTools.latitudeOrientation(stationModel.getObject().getLatitude()));
+ manageStationModel.getObject().setLongitudeDegrees(
+ CoordTools.longitudeDegrees(stationModel.getObject().getLongitude()));
+ manageStationModel.getObject().setLongitudeOrientation(
+ CoordTools.longitudeOrientation(stationModel.getObject().getLongitude()));
+ }
+ } else {
+ // mode édition, mise à jour du modèle intermédiaire pour les coordonnées
+ manageStationModel.getObject().setLatitudeDegrees(
+ CoordTools.latitudeDegrees(stationModel.getObject().getLatitude()));
+ manageStationModel.getObject().setLatitudeMinutes(
+ CoordTools.latitudeMinutes(stationModel.getObject().getLatitude()));
+ manageStationModel.getObject().setLatitudeOrientation(
+ CoordTools.latitudeOrientation(stationModel.getObject().getLatitude()));
+ manageStationModel.getObject().setLongitudeDegrees(
+ CoordTools.longitudeDegrees(stationModel.getObject().getLongitude()));
+ manageStationModel.getObject().setLongitudeMinutes(
+ CoordTools.longitudeMinutes(stationModel.getObject().getLongitude()));
+ manageStationModel.getObject().setLongitudeOrientation(
+ CoordTools.longitudeOrientation(stationModel.getObject().getLongitude()));
+ }
- // Initialisation des listes
- List<String> localites = stationService.listStationLocalites();
- final Form<Void> formView = new Form<Void>("Form");
- formView.add(new TextField<String>("Station.nom", new PropertyModel<String>(stationModel, "nom")));
- formView.add(new DropDownChoice<String>("Station.codePays",
- new PropertyModel<String>(stationModel, "codePays"), WebContext.COUNTRY_CODES.get(getSession()
- .getLocale()), new MapChoiceRenderer<String, String>(WebContext.COUNTRIES.get(getSession()
- .getLocale()))));
- formView.add(new AutoCompleteTextFieldString("Station.localite", new PropertyModel<String>(stationModel,
- "localite"), localites, ComparisonMode.CONTAINS));
- formView.add(new TextArea<String>("Station.complement", new PropertyModel<String>(stationModel, "complement")));
+ // Initialisation des listes
+ List<String> localites = stationService.listStationLocalites();
+ final Form<Void> formView = new Form<Void>("Form");
+ formView.add(new TextField<String>("Station.nom", new PropertyModel<String>(stationModel, "nom")));
+ formView.add(new DropDownChoice<String>("Station.codePays",
+ new PropertyModel<String>(stationModel, "codePays"), WebContext.COUNTRY_CODES.get(getSession()
+ .getLocale()), new MapChoiceRenderer<String, String>(WebContext.COUNTRIES.get(getSession()
+ .getLocale()))));
+ formView.add(new AutoCompleteTextFieldString("Station.localite", new PropertyModel<String>(stationModel,
+ "localite"), localites, ComparisonMode.CONTAINS));
+ formView.add(new TextArea<String>("Station.complement", new PropertyModel<String>(stationModel, "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("Station.createur", new PropertyModel<String>(stationModel, "createur"))
- .setEnabled(false));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("Station.createur", new PropertyModel<String>(stationModel, "createur"))
+ .setEnabled(false));
- formView.add(new TextField<Integer>("ManageStationModel.latitudeDegrees", new PropertyModel<Integer>(
- manageStationModel, "latitudeDegrees")));
- formView.add(new Label("Coordonnate.degrees.latitude", String.valueOf(CoordTools.DEGREES)));
- formView.add(new TextField<BigDecimal>("ManageStationModel.latitudeMinutes", new PropertyModel<BigDecimal>(
- manageStationModel, "latitudeMinutes")));
- formView.add(new Label("Coordonnate.minutes.latitude", String.valueOf(CoordTools.MINUTES)));
- formView.add(new DropDownChoice<Character>("ManageStationModel.latitudeOrientation",
- new PropertyModel<Character>(manageStationModel, "latitudeOrientation"), Arrays
- .asList(CoordTools.LATITUDE_ORIENTATIONS)));
- formView.add(new TextField<Integer>("ManageStationModel.longitudeDegrees", new PropertyModel<Integer>(
- manageStationModel, "longitudeDegrees")));
- formView.add(new Label("Coordonnate.degrees.longitude", String.valueOf(CoordTools.DEGREES)));
- formView.add(new TextField<BigDecimal>("ManageStationModel.longitudeMinutes", new PropertyModel<BigDecimal>(
- manageStationModel, "longitudeMinutes")));
- formView.add(new Label("Coordonnate.minutes.longitude", String.valueOf(CoordTools.MINUTES)));
- formView.add(new DropDownChoice<Character>("ManageStationModel.longitudeOrientation",
- new PropertyModel<Character>(manageStationModel, "longitudeOrientation"), Arrays
- .asList(CoordTools.LONGITUDE_ORIENTATIONS)));
+ formView.add(new TextField<Integer>("ManageStationModel.latitudeDegrees", new PropertyModel<Integer>(
+ manageStationModel, "latitudeDegrees")));
+ formView.add(new Label("Coordonnate.degrees.latitude", String.valueOf(CoordTools.DEGREES)));
+ formView.add(new TextField<BigDecimal>("ManageStationModel.latitudeMinutes", new PropertyModel<BigDecimal>(
+ manageStationModel, "latitudeMinutes")));
+ formView.add(new Label("Coordonnate.minutes.latitude", String.valueOf(CoordTools.MINUTES)));
+ formView.add(new DropDownChoice<Character>("ManageStationModel.latitudeOrientation",
+ new PropertyModel<Character>(manageStationModel, "latitudeOrientation"), Arrays
+ .asList(CoordTools.LATITUDE_ORIENTATIONS)));
+ formView.add(new TextField<Integer>("ManageStationModel.longitudeDegrees", new PropertyModel<Integer>(
+ manageStationModel, "longitudeDegrees")));
+ formView.add(new Label("Coordonnate.degrees.longitude", String.valueOf(CoordTools.DEGREES)));
+ formView.add(new TextField<BigDecimal>("ManageStationModel.longitudeMinutes", new PropertyModel<BigDecimal>(
+ manageStationModel, "longitudeMinutes")));
+ formView.add(new Label("Coordonnate.minutes.longitude", String.valueOf(CoordTools.MINUTES)));
+ formView.add(new DropDownChoice<Character>("ManageStationModel.longitudeOrientation",
+ new PropertyModel<Character>(manageStationModel, "longitudeOrientation"), Arrays
+ .asList(CoordTools.LONGITUDE_ORIENTATIONS)));
- formView.add(new DropDownChoice<Integer>("Station.referentiel", new PropertyModel<Integer>(stationModel,
- "referentiel"), WebContext.REFERENTIEL_CODES, new MapChoiceRenderer<Integer, String>(
- DataContext.REFERENTIELS)));
+ formView.add(new DropDownChoice<Integer>("Station.referentiel", new PropertyModel<Integer>(stationModel,
+ "referentiel"), WebContext.REFERENTIEL_CODES, new MapChoiceRenderer<Integer, String>(
+ DataContext.REFERENTIELS)));
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- if (manageStationModel.getObject().getLatitudeDegrees() == null) {
- stationModel.getObject().setReferentiel(null);
- }
- stationService.createStation(stationModel.getObject());
- }
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ if (manageStationModel.getObject().getLatitudeDegrees() == null) {
+ stationModel.getObject().setReferentiel(null);
+ }
+ stationService.createStation(stationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- if (manageStationModel.getObject().getLatitudeDegrees() == null) {
- stationModel.getObject().setReferentiel(null);
- }
- stationService.updateStation(stationModel.getObject());
- }
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ if (manageStationModel.getObject().getLatitudeDegrees() == null) {
+ stationModel.getObject().setReferentiel(null);
+ }
+ stationService.updateStation(stationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton
- .setVisibilityAllowed(!createMode
- && stationService.updateOrdeleteStationEnabled(stationModel.getObject(), getSession()
- .getUtilisateur()));
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton
+ .setVisibilityAllowed(!createMode
+ && stationService.updateOrdeleteStationEnabled(stationModel.getObject(), getSession()
+ .getUtilisateur()));
+ formView.add(updateButton);
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- stationService.deleteStation(stationModel.getObject());
- }
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ stationService.deleteStation(stationModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- redirect();
- }
- });
- deleteButton
- .setVisibilityAllowed(!createMode
- && stationService.updateOrdeleteStationEnabled(stationModel.getObject(), getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- deleteButton.setDefaultFormProcessing(false);
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton
+ .setVisibilityAllowed(!createMode
+ && stationService.updateOrdeleteStationEnabled(stationModel.getObject(), getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ deleteButton.setDefaultFormProcessing(false);
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) this.getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) this.getPage());
+ }
+ });
- if (createMode) {
- // Données par défaut du modèle
- if (stationModel.getObject().getCodePays() == null) {
- stationModel.getObject().setCodePays(
- WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
- }
- if (stationModel.getObject().getReferentiel() == null) {
- stationModel.getObject().setReferentiel(WebContext.REFERENTIEL_CODES.get(0));
- }
- // Données par défaut du modèle intermédiaire
- if (manageStationModel.getObject().getLatitudeOrientation() == null) {
- manageStationModel.getObject().setLatitudeOrientation(CoordTools.LATITUDE_ORIENTATIONS[1]);
- }
- if (manageStationModel.getObject().getLongitudeOrientation() == null) {
- manageStationModel.getObject().setLongitudeOrientation(CoordTools.LONGITUDE_ORIENTATIONS[0]);
- }
- }
+ if (createMode) {
+ // Données par défaut du modèle
+ if (stationModel.getObject().getCodePays() == null) {
+ stationModel.getObject().setCodePays(
+ WebContext.COUNTRIES.get(getSession().getLocale()).entrySet().iterator().next().getKey());
+ }
+ if (stationModel.getObject().getReferentiel() == null) {
+ stationModel.getObject().setReferentiel(WebContext.REFERENTIEL_CODES.get(0));
+ }
+ // Données par défaut du modèle intermédiaire
+ if (manageStationModel.getObject().getLatitudeOrientation() == null) {
+ manageStationModel.getObject().setLatitudeOrientation(CoordTools.LATITUDE_ORIENTATIONS[1]);
+ }
+ if (manageStationModel.getObject().getLongitudeOrientation() == null) {
+ manageStationModel.getObject().setLongitudeOrientation(CoordTools.LONGITUDE_ORIENTATIONS[0]);
+ }
+ }
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Page redirection. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection vers l'écran de saisie d'une nouvelle station, en fournissant déjà quelques données
- Station nextStation = new Station();
- nextStation.setCodePays(stationModel.getObject().getCodePays());
- if (manageStationModel.getObject().getLatitudeDegrees() != null) {
- nextStation.setLatitude(stationModel.getObject().getLatitude());
- nextStation.setLongitude(stationModel.getObject().getLongitude());
- nextStation.setReferentiel(stationModel.getObject().getReferentiel());
- }
- setResponsePage(new ManageStationPage(nextStation, callerPage));
- } else {
- // On passe l'id de la station associée à cette page, en paramètre de la prochaine page, pour lui permettre
- // de
- // l'exploiter si besoin
- callerPage.addPageParameter(Station.class.getSimpleName(), stationModel.getObject().getIdStation());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Page redirection. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection vers l'écran de saisie d'une nouvelle station, en fournissant déjà quelques données
+ Station nextStation = new Station();
+ nextStation.setCodePays(stationModel.getObject().getCodePays());
+ if (manageStationModel.getObject().getLatitudeDegrees() != null) {
+ nextStation.setLatitude(stationModel.getObject().getLatitude());
+ nextStation.setLongitude(stationModel.getObject().getLongitude());
+ nextStation.setReferentiel(stationModel.getObject().getReferentiel());
+ }
+ setResponsePage(new ManageStationPage(nextStation, callerPage));
+ } else {
+ // On passe l'id de la station associée à cette page, en paramètre de la prochaine page, pour lui permettre
+ // de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Station.class.getSimpleName(), stationModel.getObject().getIdStation());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Validate the campagne model (for update & create)
- */
- private void validateModel() {
- if (stationModel.getObject().getCreateur() == null) {
- stationModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ /**
+ * Validate the campagne model (for update & create)
+ */
+ private void validateModel() {
+ if (stationModel.getObject().getCreateur() == null) {
+ stationModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- List<String> referentielErrors = validator.validate(stationModel.getObject(), getSession().getLocale(),
- "referentiel");
- List<String> coordErrors = validator.validate(manageStationModel.getObject(), getSession().getLocale());
+ List<String> referentielErrors = validator.validate(stationModel.getObject(), getSession().getLocale(),
+ "referentiel");
+ List<String> coordErrors = validator.validate(manageStationModel.getObject(), getSession().getLocale());
- // On ne considère les coordonnées que si au moins un des champs a été renseigné
- if (manageStationModel.getObject().getLatitudeDegrees() != null
- || manageStationModel.getObject().getLatitudeMinutes() != null
- || manageStationModel.getObject().getLongitudeDegrees() != null
- || manageStationModel.getObject().getLongitudeMinutes() != null) {
- // Tous les champs doivent avoir été renseignées pour que les coordonnées soient valides
- if (manageStationModel.getObject().getLatitudeDegrees() != null
- && manageStationModel.getObject().getLatitudeMinutes() != null
- && manageStationModel.getObject().getLatitudeOrientation() != null
- && manageStationModel.getObject().getLongitudeDegrees() != null
- && manageStationModel.getObject().getLongitudeMinutes() != null
- && manageStationModel.getObject().getLongitudeOrientation() != null
- && stationModel.getObject().getReferentiel() != null) {
- // Construction des coordonnées
- if (referentielErrors.isEmpty() && coordErrors.isEmpty()) {
- stationModel.getObject().setLatitude(
- CoordTools.latitude(manageStationModel.getObject().getLatitudeDegrees(), manageStationModel
- .getObject().getLatitudeMinutes(), manageStationModel.getObject()
- .getLatitudeOrientation()));
- stationModel.getObject().setLongitude(
- CoordTools.longitude(manageStationModel.getObject().getLongitudeDegrees(),
- manageStationModel.getObject().getLongitudeMinutes(), manageStationModel
- .getObject().getLongitudeOrientation()));
- }
- } else {
- getPage().error(getString("Station.coordonnees.KO"));
- }
- } else {
- // si tous les champs sont vide, on met à null les coordonnées
- if (manageStationModel.getObject().getLatitudeDegrees() == null
- && manageStationModel.getObject().getLatitudeMinutes() == null
- && manageStationModel.getObject().getLongitudeDegrees() == null
- && manageStationModel.getObject().getLongitudeMinutes() == null) {
- stationModel.getObject().setLatitude(null);
- stationModel.getObject().setLongitude(null);
- }
- }
+ // On ne considère les coordonnées que si au moins un des champs a été renseigné
+ if (manageStationModel.getObject().getLatitudeDegrees() != null
+ || manageStationModel.getObject().getLatitudeMinutes() != null
+ || manageStationModel.getObject().getLongitudeDegrees() != null
+ || manageStationModel.getObject().getLongitudeMinutes() != null) {
+ // Tous les champs doivent avoir été renseignées pour que les coordonnées soient valides
+ if (manageStationModel.getObject().getLatitudeDegrees() != null
+ && manageStationModel.getObject().getLatitudeMinutes() != null
+ && manageStationModel.getObject().getLatitudeOrientation() != null
+ && manageStationModel.getObject().getLongitudeDegrees() != null
+ && manageStationModel.getObject().getLongitudeMinutes() != null
+ && manageStationModel.getObject().getLongitudeOrientation() != null
+ && stationModel.getObject().getReferentiel() != null) {
+ // Construction des coordonnées
+ if (referentielErrors.isEmpty() && coordErrors.isEmpty()) {
+ stationModel.getObject().setLatitude(
+ CoordTools.latitude(manageStationModel.getObject().getLatitudeDegrees(), manageStationModel
+ .getObject().getLatitudeMinutes(), manageStationModel.getObject()
+ .getLatitudeOrientation()));
+ stationModel.getObject().setLongitude(
+ CoordTools.longitude(manageStationModel.getObject().getLongitudeDegrees(),
+ manageStationModel.getObject().getLongitudeMinutes(), manageStationModel
+ .getObject().getLongitudeOrientation()));
+ }
+ } else {
+ getPage().error(getString("Station.coordonnees.KO"));
+ }
+ } else {
+ // si tous les champs sont vide, on met à null les coordonnées
+ if (manageStationModel.getObject().getLatitudeDegrees() == null
+ && manageStationModel.getObject().getLatitudeMinutes() == null
+ && manageStationModel.getObject().getLongitudeDegrees() == null
+ && manageStationModel.getObject().getLongitudeMinutes() == null) {
+ stationModel.getObject().setLatitude(null);
+ stationModel.getObject().setLongitude(null);
+ }
+ }
- addValidationErrors(validator.validate(stationModel.getObject(), getSession().getLocale(), "nom", "codePays",
- "localite", "complement", "createur", "latitude", "longitude"));
- addValidationErrors(referentielErrors);
- addValidationErrors(coordErrors);
- }
+ addValidationErrors(validator.validate(stationModel.getObject(), getSession().getLocale(), "nom", "codePays",
+ "localite", "complement", "createur", "latitude", "longitude"));
+ addValidationErrors(referentielErrors);
+ addValidationErrors(coordErrors);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ReadStationPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ReadStationPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/station/ReadStationPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -55,108 +55,108 @@
*/
public final class ReadStationPage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Modèle : campagne */
- private final IModel<Station> stationModel;
+ /** Modèle : campagne */
+ private final IModel<Station> stationModel;
- /** Service : station */
- @SpringBean
- private StationService stationService;
+ /** Service : station */
+ @SpringBean
+ private StationService stationService;
- /**
- * Constructeur
- * @param idStation ID station
- * @param callerPage Page appelante
- */
- public ReadStationPage(Integer idStation, CallerPage callerPage) {
- super(ReadStationPage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ /**
+ * Constructeur
+ * @param idStation ID station
+ * @param callerPage Page appelante
+ */
+ public ReadStationPage(Integer idStation, CallerPage callerPage) {
+ super(ReadStationPage.class);
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation des modèles
- stationModel = new GenericLoadableDetachableModel<Station>(Station.class, idStation);
+ // Initialisation des modèles
+ stationModel = new GenericLoadableDetachableModel<Station>(Station.class, idStation);
- final Station station = stationModel.getObject();
+ final Station station = stationModel.getObject();
- // Mapping des champs du modèle
- add(new Label("Station.nom", new PropertyModel<String>(stationModel, "nom"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Station.codePays", new DisplayMapValuePropertyModel<String>(stationModel, "codePays",
- WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Station.localite", new PropertyModel<String>(stationModel, "localite"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("Station.createur", new PropertyModel<Personne>(stationModel,
- "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
- add(new MultiLineLabel("Station.complement", new PropertyModel<String>(stationModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Station.latitude", new PropertyModel<String>(stationModel, "latitude"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Station.longitude", new PropertyModel<String>(stationModel, "longitude"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Station.referentiel", new DisplayMapValuePropertyModel<Integer>(stationModel, "referentiel",
- DataContext.REFERENTIELS)).add(new ReplaceEmptyLabelBehavior()));
+ // Mapping des champs du modèle
+ add(new Label("Station.nom", new PropertyModel<String>(stationModel, "nom"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Station.codePays", new DisplayMapValuePropertyModel<String>(stationModel, "codePays",
+ WebContext.COUNTRIES.get(getSession().getLocale()))).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Station.localite", new PropertyModel<String>(stationModel, "localite"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new PropertyLabelLinkPanel<Personne>("Station.createur", new PropertyModel<Personne>(stationModel,
+ "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
+ add(new MultiLineLabel("Station.complement", new PropertyModel<String>(stationModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Station.latitude", new PropertyModel<String>(stationModel, "latitude"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Station.longitude", new PropertyModel<String>(stationModel, "longitude"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Station.referentiel", new DisplayMapValuePropertyModel<Integer>(stationModel, "referentiel",
+ DataContext.REFERENTIELS)).add(new ReplaceEmptyLabelBehavior()));
- // Ajout du formulaire pour les actions
- Form<Void> formView = new Form<Void>("Form");
+ // Ajout du formulaire pour les actions
+ Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<Station> updateLink = new Link<Station>(getResource() + ".Station.Update", new Model<Station>(station)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageStationPage(getModelObject().getIdStation(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(stationService.updateOrdeleteStationEnabled(station, getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Station> updateLink = new Link<Station>(getResource() + ".Station.Update", new Model<Station>(station)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageStationPage(getModelObject().getIdStation(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(stationService.updateOrdeleteStationEnabled(station, getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : retour à la page précédente
- formView.add(new Link<Void>(getResource() + ".Station.Back") {
- @Override
- public void onClick() {
- redirect();
- }
- });
+ // Action : retour à la page précédente
+ formView.add(new Link<Void>(getResource() + ".Station.Back") {
+ @Override
+ public void onClick() {
+ redirect();
+ }
+ });
- // Action : suppression de la station
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageStationPage.class,
- new SubmittableButtonEvents() {
+ // Action : suppression de la station
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageStationPage.class,
+ new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- stationService.deleteStation(station);
- }
+ @Override
+ public void onProcess() throws DataConstraintException {
+ stationService.deleteStation(station);
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageStationPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(stationService.updateOrdeleteStationEnabled(station, getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
- add(formView);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageStationPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(stationService.updateOrdeleteStationEnabled(station, getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ListTestsBioPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -69,145 +69,145 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ListTestsBioPage extends TemplatePage {
- /** Service : test biologique */
- @SpringBean
- private TestBioService testBioService;
+ /** Service : test biologique */
+ @SpringBean
+ private TestBioService testBioService;
- /**
- * Constructeur
- */
- public ListTestsBioPage() {
- super(ListTestsBioPage.class);
+ /**
+ * Constructeur
+ */
+ public ListTestsBioPage() {
+ super(ListTestsBioPage.class);
- final CallerPage currentPage = new CallerPage(ListTestsBioPage.class);
+ final CallerPage currentPage = new CallerPage(ListTestsBioPage.class);
- add(new Link<Void>("ListTestsBioPage.NewTestBio") {
- @Override
- public void onClick() {
- setResponsePage(new ManageTestBioPage(currentPage, true));
- }
- });
+ add(new Link<Void>("ListTestsBioPage.NewTestBio") {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageTestBioPage(currentPage, true));
+ }
+ });
- // On englobe le "DataView" dans un composant neutre que l'on pourra
- // rafraichir quand la liste évoluera
- final MarkupContainer resTestsBiosRefresh = new WebMarkupContainer("ListTestsBioPage.ResultatsTestsBio.Refresh");
- resTestsBiosRefresh.setOutputMarkupId(true);
- add(resTestsBiosRefresh);
+ // On englobe le "DataView" dans un composant neutre que l'on pourra
+ // rafraichir quand la liste évoluera
+ final MarkupContainer resTestsBiosRefresh = new WebMarkupContainer("ListTestsBioPage.ResultatsTestsBio.Refresh");
+ resTestsBiosRefresh.setOutputMarkupId(true);
+ add(resTestsBiosRefresh);
- // Liste des résultats de tests biologiques
- final List<ResultatTestBio> resTestsBios = testBioService.listResultatsTestBio(getSession().getUtilisateur());
+ // Liste des résultats de tests biologiques
+ final List<ResultatTestBio> resTestsBios = testBioService.listResultatsTestBio(getSession().getUtilisateur());
- LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
- resTestsBios, getSession().getLocale());
+ LoadableDetachableSortableListDataProvider<ResultatTestBio> resTestBiosDataProvider = new LoadableDetachableSortableListDataProvider<ResultatTestBio>(
+ resTestsBios, getSession().getLocale());
- List<IColumn<ResultatTestBio>> columns = new ArrayList<IColumn<ResultatTestBio>>();
+ List<IColumn<ResultatTestBio>> columns = new ArrayList<IColumn<ResultatTestBio>>();
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("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 LinkableImagePropertyColumn<ResultatTestBio>("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 TextFilteredPropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
+ columns.add(new TextFilteredPropertyColumn<ResultatTestBio, String>(new Model<String>(
+ getString("MethodeTestBio.cible2")), "testBio.methode.cible", "testBio.methode.cible"));
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(
- getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
- getLocale()));
+ columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(
+ getString("ResultatTestBio.concMasse2")), "concMasse", "concMasse", DecimalDisplFormat.SMALL,
+ getLocale()));
- columns.add(new EnumPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.uniteConcMasse2")),
- "uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
+ columns.add(new EnumPropertyColumn<ResultatTestBio>(new Model<String>(getString("TestBio.uniteConcMasse2")),
+ "uniteConcMasse", "uniteConcMasse", (TemplatePage) getPage()));
- columns.add(new LinkProduitPropertyColumn<ResultatTestBio>(new Model<String>(
- getString("ResultatTestBio.produit")), "produit", "produit", (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
+ columns.add(new LinkProduitPropertyColumn<ResultatTestBio>(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));
- }
- });
+ @Override
+ public void onClickIfFraction(Fraction fraction) {
+ setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(), currentPage));
+ }
+ });
- columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.valeur")),
- "valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
+ columns.add(new DecimalPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.valeur")),
+ "valeur", "valeur", DecimalDisplFormat.SMALL, getLocale()));
- columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
- "testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
+ columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("MethodeTestBio.uniteResultat2")),
+ "testBio.methode.uniteResultat", "testBio.methode.uniteResultat"));
- columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("Extrait.typeExtrait2")),
- "typeExtraitSource", "typeExtraitSource"));
+ columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("Extrait.typeExtrait2")),
+ "typeExtraitSource", "typeExtraitSource"));
- columns.add(new BooleanPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.actif")),
- "actif", "actif", (TemplatePage) getPage()));
+ columns.add(new BooleanPropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.actif")),
+ "actif", "actif", (TemplatePage) getPage()));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.famille")),
- "lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.famille")),
+ "lotSource.specimenRef.famille", "lotSource.specimenRef.famille"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.genre")),
- "lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.genre")),
+ "lotSource.specimenRef.genre", "lotSource.specimenRef.genre"));
- columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.espece")),
- "lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
+ columns.add(new TaxonomyPropertyColumn<ResultatTestBio>(new Model<String>(getString("Specimen.espece")),
+ "lotSource.specimenRef.espece", "lotSource.specimenRef.espece"));
- columns.add(new MapValuePropertyColumn<ResultatTestBio, String>(new Model<String>(
- getString("Campagne.codePays")), "lotSource.campagne.codePays", "lotSource.campagne.codePays",
- WebContext.COUNTRIES.get(getSession().getLocale())));
+ columns.add(new MapValuePropertyColumn<ResultatTestBio, 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")),
- "repere", "repere"));
+ columns.add(new PropertyColumn<ResultatTestBio>(new Model<String>(getString("ResultatTestBio.repere")),
+ "repere", "repere"));
- columns.add(new LinkPropertyColumn<ResultatTestBio>(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));
- }
- });
+ columns.add(new LinkPropertyColumn<ResultatTestBio>(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));
+ }
+ });
- columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("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<ResultatTestBio>> item, String componentId,
- IModel<ResultatTestBio> model) {
- if (testBioService.updateOrdeleteTestBioEnabled(model.getObject().getTestBio(), getSession()
- .getUtilisateur())) {
- item.add(new LinkableImagePanel(item, componentId, model));
- } else {
- // label vide
- item.add(new Label(componentId));
- }
- }
+ columns.add(new LinkableImagePropertyColumn<ResultatTestBio>("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<ResultatTestBio>> item, String componentId,
+ IModel<ResultatTestBio> model) {
+ if (testBioService.updateOrdeleteTestBioEnabled(model.getObject().getTestBio(), getSession()
+ .getUtilisateur())) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ } else {
+ // label vide
+ item.add(new Label(componentId));
+ }
+ }
- @Override
- public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
- IModel<ResultatTestBio> model) {
- setResponsePage(new ManageTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
- }
- });
+ @Override
+ public void onClick(Item<ICellPopulator<ResultatTestBio>> item, String componentId,
+ IModel<ResultatTestBio> model) {
+ setResponsePage(new ManageTestBioPage(model.getObject().getTestBio().getIdTestBio(), currentPage));
+ }
+ });
- final DataTable<ResultatTestBio> resTestBiosDataTable = new AjaxFallbackDefaultDataTable<ResultatTestBio>(
- "ListTestsBioPage.ResultatsTestsBio", columns, resTestBiosDataProvider, WebContext.ROWS_PER_PAGE);
+ final DataTable<ResultatTestBio> resTestBiosDataTable = new AjaxFallbackDefaultDataTable<ResultatTestBio>(
+ "ListTestsBioPage.ResultatsTestsBio", columns, resTestBiosDataProvider, WebContext.ROWS_PER_PAGE);
- // DRAFT FOR FILTER TABLE
- // resTestBiosDataTable.addTopToolbar(new NavigationToolbar(resTestBiosDataTable));
- // resTestBiosDataTable.addTopToolbar(new HeadersToolbar(resTestBiosDataTable, resTestBiosDataProvider));
+ // DRAFT FOR FILTER TABLE
+ // resTestBiosDataTable.addTopToolbar(new NavigationToolbar(resTestBiosDataTable));
+ // resTestBiosDataTable.addTopToolbar(new HeadersToolbar(resTestBiosDataTable, resTestBiosDataProvider));
- // create the form used to contain all filter components
- /*
- * final FilterForm filterForm = new FilterForm("filter-form", resTestBiosDataProvider) { private static final
- * long serialVersionUID = 1L;
- * @Override protected void onSubmit() { resTestBiosDataTable.setCurrentPage(0); } }; resTestBiosDataTable
- * .addTopToolbar(new FilterToolbar(resTestBiosDataTable, filterForm, resTestBiosDataProvider));
- */
- resTestsBiosRefresh.add(resTestBiosDataTable);
+ // create the form used to contain all filter components
+ /*
+ * final FilterForm filterForm = new FilterForm("filter-form", resTestBiosDataProvider) { private static final
+ * long serialVersionUID = 1L;
+ * @Override protected void onSubmit() { resTestBiosDataTable.setCurrentPage(0); } }; resTestBiosDataTable
+ * .addTopToolbar(new FilterToolbar(resTestBiosDataTable, filterForm, resTestBiosDataProvider));
+ */
+ resTestsBiosRefresh.add(resTestBiosDataTable);
- }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ManageTestBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ManageTestBioPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ManageTestBioPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -106,886 +106,886 @@
@AuthRoles({ AuthRole.ADMIN, AuthRole.USER })
public final class ManageTestBioPage extends TemplatePage {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Action : create */
- private static final String ACTION_CREATE = "Create";
+ /** Action : create */
+ private static final String ACTION_CREATE = "Create";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** testBio Model */
- private final IModel<TestBio> testBioModel;
+ /** testBio Model */
+ private final IModel<TestBio> testBioModel;
- /** model for adding resultat */
- private Model<ResultatTestBio> newResultatModel;
+ /** model for adding resultat */
+ private Model<ResultatTestBio> newResultatModel;
- /** Service : testBios */
- @SpringBean
- private TestBioService testBioService;
+ /** Service : testBios */
+ @SpringBean
+ private TestBioService testBioService;
- /** Service : personnes */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personnes */
+ @SpringBean
+ private PersonneService personneService;
- /** Service : produits */
- @SpringBean
- private ProduitService produitService;
+ /** Service : produits */
+ @SpringBean
+ private ProduitService produitService;
- /** Liste des personnes existantes */
- private final List<Personne> personnes;
+ /** Liste des personnes existantes */
+ private final List<Personne> personnes;
- /** Liste des méthodes de testBio existantes */
- private final List<MethodeTestBio> methodes;
+ /** Liste des méthodes de testBio existantes */
+ private final List<MethodeTestBio> methodes;
- /** Liste des organismes testeurs déjà renseignés pour les personnes */
- private final List<String> organismes;
+ /** Liste des organismes testeurs déjà renseignés pour les personnes */
+ private final List<String> organismes;
- /** Liste des produits témoins testeurs déjà renseignés pour résultats de test */
- private final List<String> produitsTemoins;
+ /** Liste des produits témoins testeurs déjà renseignés pour résultats de test */
+ private final List<String> produitsTemoins;
- /** Liste des produits existants */
- private final List<Produit> produits;
+ /** Liste des produits existants */
+ private final List<Produit> produits;
- /** Liste des erreurs de test existantes */
- private final List<ErreurTestBio> erreurs;
+ /** Liste des erreurs de test existantes */
+ private final List<ErreurTestBio> erreurs;
- /** Model validateur */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Model validateur */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Saisie multiple */
- private boolean multipleEntry;
+ /** Saisie multiple */
+ private boolean multipleEntry;
- /** Bouton d'ajout d'un résultat de test bio **/
- Button addResultatButton;
+ /** Bouton d'ajout d'un résultat de test bio **/
+ Button addResultatButton;
- /** Container pour l'affichage de la description de la méthode **/
- MarkupContainer descriptionMethoContainer;
+ /** Container pour l'affichage de la description de la méthode **/
+ MarkupContainer descriptionMethoContainer;
- /** Container pour l'affichage des paramètres de la méthode **/
- MarkupContainer paramsMethoContainer;
+ /** Container pour l'affichage des paramètres de la méthode **/
+ MarkupContainer paramsMethoContainer;
- /** Input du conc./masse par défaut du test bio **/
- TextField<BigDecimal> concMasseDefautInput;
+ /** Input du conc./masse par défaut du test bio **/
+ TextField<BigDecimal> concMasseDefautInput;
- /** Input pour l'unité de conc./masse par défaut du test bio **/
- DropDownChoice<UniteConcMasse> uniteConcMasseDefautInput;
+ /** Input pour l'unité de conc./masse par défaut du test bio **/
+ DropDownChoice<UniteConcMasse> uniteConcMasseDefautInput;
- /** Input du conc./masse du résultat courant **/
- TextField<BigInteger> concMasseInput;
+ /** Input du conc./masse du résultat courant **/
+ TextField<BigInteger> concMasseInput;
- /** Input pour l'unité de conc./masse du résultat courant **/
- DropDownChoice<UniteConcMasse> uniteConcMasseInput;
+ /** Input pour l'unité de conc./masse du résultat courant **/
+ DropDownChoice<UniteConcMasse> uniteConcMasseInput;
- /** Input pour le stade du résultat courant **/
- DropDownChoice<Stade> stadeInput;
+ /** Input pour le stade du résultat courant **/
+ DropDownChoice<Stade> stadeInput;
- /**
- * Constructeur (mode création)
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- public ManageTestBioPage(CallerPage callerPage, boolean multipleEntry) {
- this(null, null, callerPage, multipleEntry);
- }
+ /**
+ * Constructeur (mode création)
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ public ManageTestBioPage(CallerPage callerPage, boolean multipleEntry) {
+ this(null, null, callerPage, multipleEntry);
+ }
- /**
- * Constructeur (mode édition)
- * @param idManip Id de la manip d'testBio
- * @param callerPage Page appelante
- */
- public ManageTestBioPage(Integer idManip, CallerPage callerPage) {
- this(idManip, null, callerPage, false);
- }
+ /**
+ * Constructeur (mode édition)
+ * @param idManip Id de la manip d'testBio
+ * @param callerPage Page appelante
+ */
+ public ManageTestBioPage(Integer idManip, CallerPage callerPage) {
+ this(idManip, null, callerPage, false);
+ }
- /**
- * Constructeur (mode saisie de la manip suivante)
- * @param manip Manip d'testBio
- * @param callerPage Page appelante
- */
- public ManageTestBioPage(TestBio manip, CallerPage callerPage) {
- this(null, manip, callerPage, true);
- }
+ /**
+ * Constructeur (mode saisie de la manip suivante)
+ * @param manip Manip d'testBio
+ * @param callerPage Page appelante
+ */
+ public ManageTestBioPage(TestBio manip, CallerPage callerPage) {
+ this(null, manip, callerPage, true);
+ }
- /**
- * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'testBio. Si refManip est renseignée,
- * on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir des
- * informations qu'elle contient.
- * @param idManip Id de la manip d'testBio
- * @param manip Manip d'testBio
- * @param callerPage Page appelante
- * @param multipleEntry Saisie multiple
- */
- private ManageTestBioPage(Integer idManip, TestBio manip, final CallerPage callerPage, boolean multipleEntry) {
- super(ManageTestBioPage.class);
- assert idManip == null || manip == null;
- this.callerPage = callerPage;
- this.multipleEntry = multipleEntry;
+ /**
+ * Constructeur. Si refManip et manip sont nuls, on créée une nouvelle manip d'testBio. Si refManip est renseignée,
+ * on édite la manip correspondante. Si manip est renseigné, on créée une nouvelle manipulation à partir des
+ * informations qu'elle contient.
+ * @param idManip Id de la manip d'testBio
+ * @param manip Manip d'testBio
+ * @param callerPage Page appelante
+ * @param multipleEntry Saisie multiple
+ */
+ private ManageTestBioPage(Integer idManip, TestBio manip, final CallerPage callerPage, boolean multipleEntry) {
+ super(ManageTestBioPage.class);
+ assert idManip == null || manip == null;
+ this.callerPage = callerPage;
+ this.multipleEntry = multipleEntry;
- newResultatModel = new Model<ResultatTestBio>(new ResultatTestBio());
+ newResultatModel = new Model<ResultatTestBio>(new ResultatTestBio());
- // Initialisation du modèle
- try {
- testBioModel = new Model<TestBio>(idManip == null && manip == null ? new TestBio() : manip != null ? manip
- : testBioService.loadTestBio(idManip));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- boolean createMode = idManip == null;
- if (createMode) {
- testBioModel.getObject().setCreateur(getSession().getUtilisateur());
- }
+ // Initialisation du modèle
+ try {
+ testBioModel = new Model<TestBio>(idManip == null && manip == null ? new TestBio() : manip != null ? manip
+ : testBioService.loadTestBio(idManip));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ boolean createMode = idManip == null;
+ if (createMode) {
+ testBioModel.getObject().setCreateur(getSession().getUtilisateur());
+ }
- // Initialisation des listes (pour le dropDownChoice)
- personnes = personneService.listPersonnes();
- methodes = testBioService.listMethodesTestBio();
- produits = produitService.listProduits((Utilisateur) getSession().getUtilisateur());
- erreurs = testBioService.listErreursTestBio();
+ // Initialisation des listes (pour le dropDownChoice)
+ personnes = personneService.listPersonnes();
+ methodes = testBioService.listMethodesTestBio();
+ produits = produitService.listProduits((Utilisateur) getSession().getUtilisateur());
+ erreurs = testBioService.listErreursTestBio();
- if (manip != null) {
- // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
- // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
- // l'égalité entre les objets)
- testBioModel.getObject().setManipulateur(
- CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, testBioModel.getObject()
- .getManipulateur().getIdPersonne()));
- testBioModel.getObject().setMethode(
- CollectionTools.findWithValue(methodes, "idMethodeTest", AccessType.GETTER, testBioModel
- .getObject().getMethode().getIdMethodeTest()));
- }
+ if (manip != null) {
+ // qd saisie multiple avec préremplissage, hack nécessaire afin d'avoir dans le model le même objet que
+ // celui de la liste de choix (sinon comme les objets viennent de sessions hibernate différentes, on n'a pas
+ // l'égalité entre les objets)
+ testBioModel.getObject().setManipulateur(
+ CollectionTools.findWithValue(personnes, "idPersonne", AccessType.GETTER, testBioModel.getObject()
+ .getManipulateur().getIdPersonne()));
+ testBioModel.getObject().setMethode(
+ CollectionTools.findWithValue(methodes, "idMethodeTest", AccessType.GETTER, testBioModel
+ .getObject().getMethode().getIdMethodeTest()));
+ }
- // liste des organismes suggérés à la saisie
- organismes = personneService.listPersonneOrganismes();
- produitsTemoins = testBioService.listProduitsTemoins();
+ // liste des organismes suggérés à la saisie
+ organismes = personneService.listPersonneOrganismes();
+ produitsTemoins = testBioService.listProduitsTemoins();
- // bind with markup
- final Form<Void> formView = new Form<Void>("Form");
+ // bind with markup
+ final Form<Void> formView = new Form<Void>("Form");
- // initialisation du formulaire
- initPrincipalFields(formView);
- initMethodeFields(formView);
- initResultatsFields(formView);
+ // initialisation du formulaire
+ initPrincipalFields(formView);
+ initMethodeFields(formView);
+ initResultatsFields(formView);
- // Action : create the testBio
- Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testBioService.createTestBio(testBioModel.getObject());
- }
+ // Action : create the testBio
+ Button createButton = new SubmittableButton(ACTION_CREATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testBioService.createTestBio(testBioModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_CREATE);
- redirect();
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_CREATE);
+ redirect();
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- createButton.setVisibilityAllowed(createMode);
- formView.add(createButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ createButton.setVisibilityAllowed(createMode);
+ formView.add(createButton);
- // Action : update the testBio
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testBioService.updateTestBio(testBioModel.getObject());
- }
+ // Action : update the testBio
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testBioService.updateTestBio(testBioModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- validateModel();
- }
- });
- updateButton.setVisibilityAllowed(!createMode);
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ validateModel();
+ }
+ });
+ updateButton.setVisibilityAllowed(!createMode);
+ formView.add(updateButton);
- // Action : suppression
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testBioService.deleteTestBio(testBioModel.getObject());
- }
+ // Action : suppression
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testBioService.deleteTestBio(testBioModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- deleteButton.setVisibilityAllowed(!createMode);
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ deleteButton.setVisibilityAllowed(!createMode);
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- formView.add(new Link<Void>("Cancel") {
- // Cas où le formulaire est annulé
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ formView.add(new Link<Void>("Cancel") {
+ // Cas où le formulaire est annulé
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- formView.setDefaultButton(addResultatButton);
- add(formView);
+ formView.setDefaultButton(addResultatButton);
+ add(formView);
- }
+ }
- /**
- * Initialise les champs principaux
- * @param formView le formulaire
- */
- private void initPrincipalFields(Form<Void> formView) {
- formView.add(new TextField<String>("TestBio.ref", new PropertyModel<String>(testBioModel, "ref")));
+ /**
+ * Initialise les champs principaux
+ * @param formView le formulaire
+ */
+ private void initPrincipalFields(Form<Void> formView) {
+ formView.add(new TextField<String>("TestBio.ref", new PropertyModel<String>(testBioModel, "ref")));
- formView.add(new DropDownChoice<Personne>("TestBio.manipulateur", new PropertyModel<Personne>(testBioModel,
- "manipulateur"), personnes, new PersonneRenderer()).setNullValid(false));
+ formView.add(new DropDownChoice<Personne>("TestBio.manipulateur", new PropertyModel<Personne>(testBioModel,
+ "manipulateur"), personnes, new PersonneRenderer()).setNullValid(false));
- // Action : création d'une nouvelle personne
- // ajaxSubmitLink permet de sauvegarder l'état du formulaire
- formView.add(new AjaxSubmitLink("NewPersonne") {
- @Override
- protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
+ // Action : création d'une nouvelle personne
+ // ajaxSubmitLink permet de sauvegarder l'état du formulaire
+ formView.add(new AjaxSubmitLink("NewPersonne") {
+ @Override
+ protected void onSubmit(AjaxRequestTarget arg0, Form<?> arg1) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
- // si erreur, le formulaire est également enregistré puis la redirection effectuée
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
- }
- });
+ // si erreur, le formulaire est également enregistré puis la redirection effectuée
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ setResponsePage(new ManagePersonnePage(new CallerPage((TemplatePage) getPage()), false));
+ }
+ });
- formView.add(new AutoCompleteTextFieldString("TestBio.organismeTesteur", new PropertyModel<String>(
- testBioModel, "organismeTesteur"), organismes, ComparisonMode.CONTAINS));
+ formView.add(new AutoCompleteTextFieldString("TestBio.organismeTesteur", new PropertyModel<String>(
+ testBioModel, "organismeTesteur"), organismes, ComparisonMode.CONTAINS));
- formView.add(new DateTextField("TestBio.date", new PropertyModel<Date>(testBioModel, "date"))
- .add(new DatePicker()));
+ formView.add(new DateTextField("TestBio.date", new PropertyModel<Date>(testBioModel, "date"))
+ .add(new DatePicker()));
- concMasseDefautInput = new TextField<BigDecimal>("TestBio.concMasseDefaut", new PropertyModel<BigDecimal>(
- testBioModel, "concMasseDefaut"));
- concMasseDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- // maj du champ concMasse du résultat si résultat de type produit ou témoin
- if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
- || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
- newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
- target.add(concMasseInput);
- }
- };
- });
- formView.add(concMasseDefautInput);
+ concMasseDefautInput = new TextField<BigDecimal>("TestBio.concMasseDefaut", new PropertyModel<BigDecimal>(
+ testBioModel, "concMasseDefaut"));
+ concMasseDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ // maj du champ concMasse du résultat si résultat de type produit ou témoin
+ if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
+ || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
+ newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
+ target.add(concMasseInput);
+ }
+ };
+ });
+ formView.add(concMasseDefautInput);
- uniteConcMasseDefautInput = new DropDownChoice<UniteConcMasse>("TestBio.uniteConcMasseDefaut",
- new PropertyModel<UniteConcMasse>(testBioModel, "uniteConcMasseDefaut"), Arrays.asList(UniteConcMasse
- .values()), new EnumChoiceRenderer<UniteConcMasse>(this));
- uniteConcMasseDefautInput.setNullValid(true);
+ uniteConcMasseDefautInput = new DropDownChoice<UniteConcMasse>("TestBio.uniteConcMasseDefaut",
+ new PropertyModel<UniteConcMasse>(testBioModel, "uniteConcMasseDefaut"), Arrays.asList(UniteConcMasse
+ .values()), new EnumChoiceRenderer<UniteConcMasse>(this));
+ uniteConcMasseDefautInput.setNullValid(true);
- uniteConcMasseDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- // maj du champ uniteConcMasse du résultat si résultat de type produit
- if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
- || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
- newResultatModel.getObject().setUniteConcMasse(uniteConcMasseDefautInput.getModelObject());
- target.add(uniteConcMasseInput);
- }
- }
- });
- formView.add(uniteConcMasseDefautInput);
+ uniteConcMasseDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ // maj du champ uniteConcMasse du résultat si résultat de type produit
+ if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
+ || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
+ newResultatModel.getObject().setUniteConcMasse(uniteConcMasseDefautInput.getModelObject());
+ target.add(uniteConcMasseInput);
+ }
+ }
+ });
+ formView.add(uniteConcMasseDefautInput);
- final AbstractSingleSelectChoice<Stade> stadeDefautInput = new DropDownChoice<Stade>("TestBio.stadeDefaut",
- new PropertyModel<Stade>(testBioModel, "stadeDefaut"), Arrays.asList(Stade.values()),
- new EnumChoiceRenderer<Stade>(this));
- stadeDefautInput.setNullValid(true);
+ final AbstractSingleSelectChoice<Stade> stadeDefautInput = new DropDownChoice<Stade>("TestBio.stadeDefaut",
+ new PropertyModel<Stade>(testBioModel, "stadeDefaut"), Arrays.asList(Stade.values()),
+ new EnumChoiceRenderer<Stade>(this));
+ stadeDefautInput.setNullValid(true);
- stadeDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- // maj du champ stade du résultat si résultat de type produit
- if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
- || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
- newResultatModel.getObject().setStade(stadeDefautInput.getModelObject());
- target.add(stadeInput);
- }
- }
- });
- formView.add(stadeDefautInput);
+ stadeDefautInput.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ // maj du champ stade du résultat si résultat de type produit
+ if (newResultatModel.getObject().getTypeResultat() == TypeResultat.PRODUIT
+ || newResultatModel.getObject().getTypeResultat() == TypeResultat.TEMOIN) {
+ newResultatModel.getObject().setStade(stadeDefautInput.getModelObject());
+ target.add(stadeInput);
+ }
+ }
+ });
+ formView.add(stadeDefautInput);
- formView.add(new TextArea<String>("TestBio.complement", new PropertyModel<String>(testBioModel, "complement")));
- // Créateur en lecture seule
- formView.add(new TextField<String>("TestBio.createur", new PropertyModel<String>(testBioModel, "createur"))
- .setEnabled(false));
- }
+ formView.add(new TextArea<String>("TestBio.complement", new PropertyModel<String>(testBioModel, "complement")));
+ // Créateur en lecture seule
+ formView.add(new TextField<String>("TestBio.createur", new PropertyModel<String>(testBioModel, "createur"))
+ .setEnabled(false));
+ }
- /**
- * Initialise les champs relatifs à la méthode
- * @param formView le formulaire
- */
- private void initMethodeFields(final Form<Void> formView) {
+ /**
+ * Initialise les champs relatifs à la méthode
+ * @param formView le formulaire
+ */
+ private void initMethodeFields(final Form<Void> formView) {
- final WebMarkupContainer methodeCont = new WebMarkupContainer("TestBio.methode");
- methodeCont.setOutputMarkupId(true);
- formView.add(methodeCont);
+ final WebMarkupContainer methodeCont = new WebMarkupContainer("TestBio.methode");
+ methodeCont.setOutputMarkupId(true);
+ formView.add(methodeCont);
- // Champs pour la méthode
- descriptionMethoContainer = new WebMarkupContainer("TestBio.descriptionMethodeCont") {
- @Override
- public boolean isVisible() {
- // description cachée si pas de méthode sélectionnée
- return testBioModel.getObject().getMethode() != null;
- }
- };
- descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
- descriptionMethoContainer.setOutputMarkupPlaceholderTag(true); // pour accéder à l'élement html qd son état est
- // non visible
- methodeCont.add(descriptionMethoContainer);
+ // Champs pour la méthode
+ descriptionMethoContainer = new WebMarkupContainer("TestBio.descriptionMethodeCont") {
+ @Override
+ public boolean isVisible() {
+ // description cachée si pas de méthode sélectionnée
+ return testBioModel.getObject().getMethode() != null;
+ }
+ };
+ descriptionMethoContainer.setOutputMarkupId(true); // pour l'update Ajax
+ descriptionMethoContainer.setOutputMarkupPlaceholderTag(true); // pour accéder à l'élement html qd son état est
+ // non visible
+ methodeCont.add(descriptionMethoContainer);
- Label methodeCible = new Label("TestBio.cibleMethode", new PropertyModel<String>(testBioModel, "methode.cible"));
- descriptionMethoContainer.add(methodeCible);
+ Label methodeCible = new Label("TestBio.cibleMethode", new PropertyModel<String>(testBioModel, "methode.cible"));
+ descriptionMethoContainer.add(methodeCible);
- Label methodeDomaine = new Label("TestBio.domaineMethode", new PropertyModel<String>(testBioModel,
- "methode.domaine"));
- descriptionMethoContainer.add(methodeDomaine);
+ Label methodeDomaine = new Label("TestBio.domaineMethode", new PropertyModel<String>(testBioModel,
+ "methode.domaine"));
+ descriptionMethoContainer.add(methodeDomaine);
- MultiLineLabel methodeDesc = new MultiLineLabel("TestBio.descriptionMethode", new PropertyModel<String>(
- testBioModel, "methode.description"));
- descriptionMethoContainer.add(methodeDesc);
+ MultiLineLabel methodeDesc = new MultiLineLabel("TestBio.descriptionMethode", new PropertyModel<String>(
+ testBioModel, "methode.description"));
+ descriptionMethoContainer.add(methodeDesc);
- Label methodeValeurMesuree = new Label("TestBio.valeurMesureeMethode", new PropertyModel<String>(testBioModel,
- "methode.valeurMesuree"));
- descriptionMethoContainer.add(methodeValeurMesuree);
+ Label methodeValeurMesuree = new Label("TestBio.valeurMesureeMethode", new PropertyModel<String>(testBioModel,
+ "methode.valeurMesuree"));
+ descriptionMethoContainer.add(methodeValeurMesuree);
- Label methodeCritereActivite = new Label("TestBio.critereActiviteMethode", new PropertyModel<String>(
- testBioModel, "methode.critereActivite"));
- descriptionMethoContainer.add(methodeCritereActivite);
+ Label methodeCritereActivite = new Label("TestBio.critereActiviteMethode", new PropertyModel<String>(
+ testBioModel, "methode.critereActivite"));
+ descriptionMethoContainer.add(methodeCritereActivite);
- Label methodeUniteResultat = new Label("TestBio.uniteResultatMethode", new PropertyModel<String>(testBioModel,
- "methode.uniteResultat"));
- descriptionMethoContainer.add(methodeUniteResultat);
+ Label methodeUniteResultat = new Label("TestBio.uniteResultatMethode", new PropertyModel<String>(testBioModel,
+ "methode.uniteResultat"));
+ descriptionMethoContainer.add(methodeUniteResultat);
- final DropDownChoice<MethodeTestBio> methodeChoice = new DropDownChoice<MethodeTestBio>("TestBio.nomMethode",
- new PropertyModel<MethodeTestBio>(testBioModel, "methode"), methodes);
- methodeChoice.setNullValid(false);
- // mise à jour de la description de la méthode et des fractions lors de la sélection de la méthode
- methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- // mise à jour de la description et des paramètres
- target.add(methodeCont);
- }
- });
- methodeCont.add(methodeChoice);
- }
+ final DropDownChoice<MethodeTestBio> methodeChoice = new DropDownChoice<MethodeTestBio>("TestBio.nomMethode",
+ new PropertyModel<MethodeTestBio>(testBioModel, "methode"), methodes);
+ methodeChoice.setNullValid(false);
+ // mise à jour de la description de la méthode et des fractions lors de la sélection de la méthode
+ methodeChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ // mise à jour de la description et des paramètres
+ target.add(methodeCont);
+ }
+ });
+ methodeCont.add(methodeChoice);
+ }
- /**
- * Initialise les champs relatifs aux résultats de test
- * @param formView Le formulaire
- */
- private void initResultatsFields(final Form<Void> formView) {
+ /**
+ * Initialise les champs relatifs aux résultats de test
+ * @param formView Le formulaire
+ */
+ private void initResultatsFields(final Form<Void> formView) {
- // Déclaration tableau des resultats
- final MarkupContainer testsBioTable = new WebMarkupContainer("TestBio.resultats.Table");
- testsBioTable.setOutputMarkupId(true);
+ // Déclaration tableau des resultats
+ final MarkupContainer testsBioTable = new WebMarkupContainer("TestBio.resultats.Table");
+ testsBioTable.setOutputMarkupId(true);
- // Contenu tableaux resultats
- testsBioTable.add(new ListView<ResultatTestBio>("TestBio.resultats.List",
- new PropertyModel<List<ResultatTestBio>>(testBioModel, "sortedResultats")) {
- @Override
- protected void populateItem(ListItem<ResultatTestBio> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Contenu tableaux resultats
+ testsBioTable.add(new ListView<ResultatTestBio>("TestBio.resultats.List",
+ new PropertyModel<List<ResultatTestBio>>(testBioModel, "sortedResultats")) {
+ @Override
+ protected void populateItem(ListItem<ResultatTestBio> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final IModel<ResultatTestBio> resultatModel = item.getModel();
- final ResultatTestBio resultat = item.getModelObject();
+ final IModel<ResultatTestBio> resultatModel = item.getModel();
+ final ResultatTestBio resultat = item.getModelObject();
- // Colonnes
- item.add(new Label("TestBio.resultats.List.repere", new PropertyModel<String>(resultat, "repere")));
- item.add(new Label("TestBio.resultats.List.typeResultat", new DisplayEnumPropertyModel(resultat,
- "typeResultat", (TemplatePage) this.getPage())));
- item.add(new Label("TestBio.resultats.List.produit", new PropertyModel<String>(resultat, "produit.ref")));
+ // Colonnes
+ item.add(new Label("TestBio.resultats.List.repere", new PropertyModel<String>(resultat, "repere")));
+ item.add(new Label("TestBio.resultats.List.typeResultat", new DisplayEnumPropertyModel(resultat,
+ "typeResultat", (TemplatePage) this.getPage())));
+ item.add(new Label("TestBio.resultats.List.produit", new PropertyModel<String>(resultat, "produit.ref")));
- item.add(new Label("TestBio.resultats.List.produitTemoin", new PropertyModel<String>(resultat,
- "produitTemoin")));
+ item.add(new Label("TestBio.resultats.List.produitTemoin", new PropertyModel<String>(resultat,
+ "produitTemoin")));
- // concatenation de concMasse et de uniteConcMasse
- item.add(new Label("TestBio.resultats.List.concMasse", new Model<Serializable>(resultat) {
+ // concatenation de concMasse et de uniteConcMasse
+ item.add(new Label("TestBio.resultats.List.concMasse", new Model<Serializable>(resultat) {
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasse",
- DecimalDisplFormat.SMALL, getLocale()).getObject();
- if (masse == null) {
- masse = "";
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasse",
+ DecimalDisplFormat.SMALL, getLocale()).getObject();
+ if (masse == null) {
+ masse = "";
+ }
- String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasse",
- (TemplatePage) getPage()).getObject();
- if (unite == null) {
- unite = "";
- }
- return masse + " " + unite;
- }
- }));
+ String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasse",
+ (TemplatePage) getPage()).getObject();
+ if (unite == null) {
+ unite = "";
+ }
+ return masse + " " + unite;
+ }
+ }));
- item.add(new Label("TestBio.resultats.List.stade", new DisplayEnumPropertyModel(resultat, "stade",
- (TemplatePage) this.getPage())));
- item.add(new Label("TestBio.resultats.List.valeur", new DisplayDecimalPropertyModel(resultat, "valeur",
- DecimalDisplFormat.SMALL, getSession().getLocale())));
- item.add(new Label("TestBio.resultats.List.actif", new DisplayBooleanPropertyModel(resultatModel,
- "estActif", (TemplatePage) this.getPage())).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("TestBio.resultats.List.stade", new DisplayEnumPropertyModel(resultat, "stade",
+ (TemplatePage) this.getPage())));
+ item.add(new Label("TestBio.resultats.List.valeur", new DisplayDecimalPropertyModel(resultat, "valeur",
+ DecimalDisplFormat.SMALL, getSession().getLocale())));
+ item.add(new Label("TestBio.resultats.List.actif", new DisplayBooleanPropertyModel(resultatModel,
+ "estActif", (TemplatePage) this.getPage())).add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("TestBio.resultats.List.erreur", new PropertyModel<String>(resultat, "erreur.nom")));
- // info-bulle comprenant la description de l'erreur
- item.add(new SimpleTooltipPanel("TestBio.resultats.List.erreur.info", new PropertyModel<String>(
- resultat, "erreur.description")) {
- /** {@inheritDoc} */
- @Override
- public boolean isVisible() {
- return resultat.getErreur() != null;
- }
- });
+ item.add(new Label("TestBio.resultats.List.erreur", new PropertyModel<String>(resultat, "erreur.nom")));
+ // info-bulle comprenant la description de l'erreur
+ item.add(new SimpleTooltipPanel("TestBio.resultats.List.erreur.info", new PropertyModel<String>(
+ resultat, "erreur.description")) {
+ /** {@inheritDoc} */
+ @Override
+ public boolean isVisible() {
+ return resultat.getErreur() != null;
+ }
+ });
- // Action : suppression d'un résultat de test
- Button deleteButton = new AjaxFallbackButton("TestBio.resultats.List.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- testBioModel.getObject().getResultats().remove(resultat);
+ // Action : suppression d'un résultat de test
+ Button deleteButton = new AjaxFallbackButton("TestBio.resultats.List.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ testBioModel.getObject().getResultats().remove(resultat);
- if (target != null) {
- target.add(testsBioTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(testsBioTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteButton.setDefaultFormProcessing(false);
- item.add(deleteButton);
- }
- });
+ };
+ deleteButton.setDefaultFormProcessing(false);
+ item.add(deleteButton);
+ }
+ });
- // champs d'input
- testsBioTable.add(new TextField<String>("TestBio.resultats.repere", new PropertyModel<String>(newResultatModel,
- "repere")) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- // champs requis uniquement qd le bouton d'ajout de résultat est activé
- // de même pour les autres composants ci-dessous
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton;
- }
- });
+ // champs d'input
+ testsBioTable.add(new TextField<String>("TestBio.resultats.repere", new PropertyModel<String>(newResultatModel,
+ "repere")) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ // champs requis uniquement qd le bouton d'ajout de résultat est activé
+ // de même pour les autres composants ci-dessous
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton;
+ }
+ });
- final DropDownChoice<TypeResultat> typeResultatChoice = new DropDownChoice<TypeResultat>(
- "TestBio.resultats.typeResultat", new PropertyModel<TypeResultat>(newResultatModel, "typeResultat"),
- Arrays.asList(TypeResultat.values()), new EnumChoiceRenderer<TypeResultat>(this)) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton;
- }
- };
- typeResultatChoice.setNullValid(false);
- testsBioTable.add(typeResultatChoice);
+ final DropDownChoice<TypeResultat> typeResultatChoice = new DropDownChoice<TypeResultat>(
+ "TestBio.resultats.typeResultat", new PropertyModel<TypeResultat>(newResultatModel, "typeResultat"),
+ Arrays.asList(TypeResultat.values()), new EnumChoiceRenderer<TypeResultat>(this)) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton;
+ }
+ };
+ typeResultatChoice.setNullValid(false);
+ testsBioTable.add(typeResultatChoice);
- final DropDownChoice<Produit> produitChoice = new DropDownChoice<Produit>("TestBio.resultats.produit",
- new PropertyModel<Produit>(newResultatModel, "produit"), produits) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton
- && typeResultatChoice.getModelObject() == TypeResultat.PRODUIT;
- }
- };
- produitChoice.setOutputMarkupId(true);
- produitChoice.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(produitChoice);
+ final DropDownChoice<Produit> produitChoice = new DropDownChoice<Produit>("TestBio.resultats.produit",
+ new PropertyModel<Produit>(newResultatModel, "produit"), produits) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton
+ && typeResultatChoice.getModelObject() == TypeResultat.PRODUIT;
+ }
+ };
+ produitChoice.setOutputMarkupId(true);
+ produitChoice.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(produitChoice);
- final AutoCompleteTextFieldString produitTemoinInput = new AutoCompleteTextFieldString(
- "TestBio.resultats.produitTemoin", new PropertyModel<String>(newResultatModel, "produitTemoin"),
- produitsTemoins, ComparisonMode.CONTAINS) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton
- && typeResultatChoice.getModelObject() == TypeResultat.TEMOIN;
- }
- };
- produitTemoinInput.setOutputMarkupId(true);
- produitTemoinInput.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(produitTemoinInput);
+ final AutoCompleteTextFieldString produitTemoinInput = new AutoCompleteTextFieldString(
+ "TestBio.resultats.produitTemoin", new PropertyModel<String>(newResultatModel, "produitTemoin"),
+ produitsTemoins, ComparisonMode.CONTAINS) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton
+ && typeResultatChoice.getModelObject() == TypeResultat.TEMOIN;
+ }
+ };
+ produitTemoinInput.setOutputMarkupId(true);
+ produitTemoinInput.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(produitTemoinInput);
- concMasseInput = new TextField<BigInteger>("TestBio.resultats.concMasse", new PropertyModel<BigInteger>(
- newResultatModel, "concMasse"));
- concMasseInput.setOutputMarkupId(true);
- concMasseInput.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(concMasseInput);
+ concMasseInput = new TextField<BigInteger>("TestBio.resultats.concMasse", new PropertyModel<BigInteger>(
+ newResultatModel, "concMasse"));
+ concMasseInput.setOutputMarkupId(true);
+ concMasseInput.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(concMasseInput);
- uniteConcMasseInput = new DropDownChoice<UniteConcMasse>("TestBio.resultats.uniteConcMasse",
- new PropertyModel<UniteConcMasse>(newResultatModel, "uniteConcMasse"), Arrays.asList(UniteConcMasse
- .values()), new EnumChoiceRenderer<UniteConcMasse>(this));
- uniteConcMasseInput.setOutputMarkupId(true);
- uniteConcMasseInput.setOutputMarkupPlaceholderTag(true);
- uniteConcMasseInput.setNullValid(true);
+ uniteConcMasseInput = new DropDownChoice<UniteConcMasse>("TestBio.resultats.uniteConcMasse",
+ new PropertyModel<UniteConcMasse>(newResultatModel, "uniteConcMasse"), Arrays.asList(UniteConcMasse
+ .values()), new EnumChoiceRenderer<UniteConcMasse>(this));
+ uniteConcMasseInput.setOutputMarkupId(true);
+ uniteConcMasseInput.setOutputMarkupPlaceholderTag(true);
+ uniteConcMasseInput.setNullValid(true);
- testsBioTable.add(uniteConcMasseInput);
+ testsBioTable.add(uniteConcMasseInput);
- stadeInput = new DropDownChoice<Stade>("TestBio.resultats.stade", new PropertyModel<Stade>(newResultatModel,
- "stade"), Arrays.asList(Stade.values()), new EnumChoiceRenderer<Stade>(this)) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton
- && typeResultatChoice.getModelObject() == TypeResultat.PRODUIT;
- }
- };
- stadeInput.setOutputMarkupId(true);
- stadeInput.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(stadeInput);
+ stadeInput = new DropDownChoice<Stade>("TestBio.resultats.stade", new PropertyModel<Stade>(newResultatModel,
+ "stade"), Arrays.asList(Stade.values()), new EnumChoiceRenderer<Stade>(this)) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton
+ && typeResultatChoice.getModelObject() == TypeResultat.PRODUIT;
+ }
+ };
+ stadeInput.setOutputMarkupId(true);
+ stadeInput.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(stadeInput);
- testsBioTable
- .add(new CheckBox("TestBio.resultats.actif", new PropertyModel<Boolean>(newResultatModel, "actif")));
+ testsBioTable
+ .add(new CheckBox("TestBio.resultats.actif", new PropertyModel<Boolean>(newResultatModel, "actif")));
- final DropDownChoice<ErreurTestBio> erreurChoice = new DropDownChoice<ErreurTestBio>(
- "TestBio.resultats.erreur", new PropertyModel<ErreurTestBio>(newResultatModel, "erreur"), erreurs);
- erreurChoice.setNullValid(true);
- testsBioTable.add(erreurChoice);
+ final DropDownChoice<ErreurTestBio> erreurChoice = new DropDownChoice<ErreurTestBio>(
+ "TestBio.resultats.erreur", new PropertyModel<ErreurTestBio>(newResultatModel, "erreur"), erreurs);
+ erreurChoice.setNullValid(true);
+ testsBioTable.add(erreurChoice);
- // info-bulle comprenant la description de l'erreur
- final SimpleTooltipPanel infoBulle = new SimpleTooltipPanel("TestBio.resultats.erreur.info",
- new PropertyModel<String>(newResultatModel, "erreur.description"));
- infoBulle.setVisibilityAllowed(false);
- // permet la mise en visibité ou non en Ajax
- infoBulle.setOutputMarkupId(true);
- infoBulle.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(infoBulle);
+ // info-bulle comprenant la description de l'erreur
+ final SimpleTooltipPanel infoBulle = new SimpleTooltipPanel("TestBio.resultats.erreur.info",
+ new PropertyModel<String>(newResultatModel, "erreur.description"));
+ infoBulle.setVisibilityAllowed(false);
+ // permet la mise en visibité ou non en Ajax
+ infoBulle.setOutputMarkupId(true);
+ infoBulle.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(infoBulle);
- final TextField<BigDecimal> valeurInput = new TextField<BigDecimal>("TestBio.resultats.valeur",
- new PropertyModel<BigDecimal>(newResultatModel, "valeur")) {
- @Override
- @SuppressWarnings("unchecked")
- public boolean isRequired() {
- Form<Void> form = (Form<Void>) findParent(Form.class);
- return form.getRootForm().findSubmittingButton() == addResultatButton
- && erreurChoice.getModelObject() == null;
- }
- };
- valeurInput.setOutputMarkupId(true);
- valeurInput.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(valeurInput);
+ final TextField<BigDecimal> valeurInput = new TextField<BigDecimal>("TestBio.resultats.valeur",
+ new PropertyModel<BigDecimal>(newResultatModel, "valeur")) {
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean isRequired() {
+ Form<Void> form = (Form<Void>) findParent(Form.class);
+ return form.getRootForm().findSubmittingButton() == addResultatButton
+ && erreurChoice.getModelObject() == null;
+ }
+ };
+ valeurInput.setOutputMarkupId(true);
+ valeurInput.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(valeurInput);
- // comportement dynamique sur les inputs
- typeResultatChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- if (typeResultatChoice.getModelObject() == TypeResultat.BLANC) {
- activeInputsForBlancType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
- stadeInput, target);
- } else if (typeResultatChoice.getModelObject() == TypeResultat.TEMOIN) {
- activeInputsForTemoinType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
- stadeInput, target);
- } else {
- activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
- stadeInput, true, target);
- }
- }
- });
+ // comportement dynamique sur les inputs
+ typeResultatChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ if (typeResultatChoice.getModelObject() == TypeResultat.BLANC) {
+ activeInputsForBlancType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
+ stadeInput, target);
+ } else if (typeResultatChoice.getModelObject() == TypeResultat.TEMOIN) {
+ activeInputsForTemoinType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
+ stadeInput, target);
+ } else {
+ activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput,
+ stadeInput, true, target);
+ }
+ }
+ });
- erreurChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- protected void onUpdate(AjaxRequestTarget target) {
- if (erreurChoice.getModelObject() != null) {
- // si une erreur est sélectionnée, le champ valeur est désactivé et l'info-bulle affichée
- valeurInput.setVisibilityAllowed(false);
- newResultatModel.getObject().setValeur(null);
- infoBulle.setVisibilityAllowed(true);
- } else {
- // si une erreur est sélectionnée, le champ valeur est désactivé et l'info-bulle désactivée
- valeurInput.setVisibilityAllowed(true);
- infoBulle.setVisibilityAllowed(false);
- }
- target.add(valeurInput, infoBulle);
- }
- });
+ erreurChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ protected void onUpdate(AjaxRequestTarget target) {
+ if (erreurChoice.getModelObject() != null) {
+ // si une erreur est sélectionnée, le champ valeur est désactivé et l'info-bulle affichée
+ valeurInput.setVisibilityAllowed(false);
+ newResultatModel.getObject().setValeur(null);
+ infoBulle.setVisibilityAllowed(true);
+ } else {
+ // si une erreur est sélectionnée, le champ valeur est désactivé et l'info-bulle désactivée
+ valeurInput.setVisibilityAllowed(true);
+ infoBulle.setVisibilityAllowed(false);
+ }
+ target.add(valeurInput, infoBulle);
+ }
+ });
- // Bouton AJAX pour ajouter un résultat de test
- addResultatButton = new AjaxFallbackButton("TestBio.resultats.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- try {
- // normalisation du résultat
- newResultatModel.getObject()
- .setRepere(
- Normalizer.normalize(UniqueFieldNormalizer.class, newResultatModel.getObject()
- .getRepere()));
- // ajout du type testBio
- newResultatModel.getObject().setTestBio(testBioModel.getObject());
+ // Bouton AJAX pour ajouter un résultat de test
+ addResultatButton = new AjaxFallbackButton("TestBio.resultats.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ // normalisation du résultat
+ newResultatModel.getObject()
+ .setRepere(
+ Normalizer.normalize(UniqueFieldNormalizer.class, newResultatModel.getObject()
+ .getRepere()));
+ // ajout du type testBio
+ newResultatModel.getObject().setTestBio(testBioModel.getObject());
- // ajout à la liste
- ResultatTestBio resultatAdded = newResultatModel.getObject().clone();
- testBioModel.getObject().getResultats().add(resultatAdded);
+ // ajout à la liste
+ ResultatTestBio resultatAdded = newResultatModel.getObject().clone();
+ testBioModel.getObject().getResultats().add(resultatAdded);
- List<String> errors = validator.validate(newResultatModel.getObject(), getSession().getLocale());
+ List<String> errors = validator.validate(newResultatModel.getObject(), getSession().getLocale());
- // si une saisie existe pour concMasse, on s'assure que les deux composantes sont bien renseignées
- if ((newResultatModel.getObject().getConcMasse() != null && newResultatModel.getObject()
- .getUniteConcMasse() == null)
- || (newResultatModel.getObject().getConcMasse() == null && newResultatModel.getObject()
- .getUniteConcMasse() != null)) {
- errors.add(getString("TestBio.resultats.concMasse.KO"));
- }
+ // si une saisie existe pour concMasse, on s'assure que les deux composantes sont bien renseignées
+ if ((newResultatModel.getObject().getConcMasse() != null && newResultatModel.getObject()
+ .getUniteConcMasse() == null)
+ || (newResultatModel.getObject().getConcMasse() == null && newResultatModel.getObject()
+ .getUniteConcMasse() != null)) {
+ errors.add(getString("TestBio.resultats.concMasse.KO"));
+ }
- if (errors.isEmpty()) {
- // réinit des champs de la ligne "ajout"
- newResultatModel.getObject().setRepere(null);
- newResultatModel.getObject().setTypeResultat(TypeResultat.PRODUIT);
- activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput,
- uniteConcMasseInput, stadeInput, true, target);
- newResultatModel.getObject().setProduit(null);
+ if (errors.isEmpty()) {
+ // réinit des champs de la ligne "ajout"
+ newResultatModel.getObject().setRepere(null);
+ newResultatModel.getObject().setTypeResultat(TypeResultat.PRODUIT);
+ activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput,
+ uniteConcMasseInput, stadeInput, true, target);
+ newResultatModel.getObject().setProduit(null);
- // si non vide, ajout du témoin produit à la liste des propositions
- if (StringUtils.isNotEmpty(newResultatModel.getObject().getProduitTemoin())) {
- produitTemoinInput.addChoice(newResultatModel.getObject().getProduitTemoin());
- }
- newResultatModel.getObject().setProduitTemoin(null);
+ // si non vide, ajout du témoin produit à la liste des propositions
+ if (StringUtils.isNotEmpty(newResultatModel.getObject().getProduitTemoin())) {
+ produitTemoinInput.addChoice(newResultatModel.getObject().getProduitTemoin());
+ }
+ newResultatModel.getObject().setProduitTemoin(null);
- // concMasse et uniteConcMasse prennent les valeurs par défaut
- newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
- newResultatModel.getObject().setUniteConcMasse(uniteConcMasseDefautInput.getModelObject());
- newResultatModel.getObject().setStade(stadeInput.getModelObject());
- newResultatModel.getObject().setValeur(null);
- newResultatModel.getObject().setActif(null);
- newResultatModel.getObject().setErreur(null);
- // réactivation du champ valeur en cas d'ancienne sélection d'erreur
- valeurInput.setVisibilityAllowed(true);
- } else {
- testBioModel.getObject().getResultats().remove(resultatAdded);
- addValidationErrors(errors);
- }
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
+ // concMasse et uniteConcMasse prennent les valeurs par défaut
+ newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
+ newResultatModel.getObject().setUniteConcMasse(uniteConcMasseDefautInput.getModelObject());
+ newResultatModel.getObject().setStade(stadeInput.getModelObject());
+ newResultatModel.getObject().setValeur(null);
+ newResultatModel.getObject().setActif(null);
+ newResultatModel.getObject().setErreur(null);
+ // réactivation du champ valeur en cas d'ancienne sélection d'erreur
+ valeurInput.setVisibilityAllowed(true);
+ } else {
+ testBioModel.getObject().getResultats().remove(resultatAdded);
+ addValidationErrors(errors);
+ }
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
- if (target != null) {
- target.add(testsBioTable);
- refreshFeedbackPage(target);
- }
- }
+ if (target != null) {
+ target.add(testsBioTable);
+ refreshFeedbackPage(target);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- testsBioTable.add(addResultatButton);
- formView.add(testsBioTable);
+ };
+ testsBioTable.add(addResultatButton);
+ formView.add(testsBioTable);
- // pre-initialisation of the value Produit for TypeProduit
- newResultatModel.getObject().setTypeResultat(TypeResultat.PRODUIT);
- activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput, stadeInput,
- false, null);
- }
+ // pre-initialisation of the value Produit for TypeProduit
+ newResultatModel.getObject().setTypeResultat(TypeResultat.PRODUIT);
+ activeInputsForProduitType(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseInput, stadeInput,
+ false, null);
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
- // Personne ou Lot)
- refreshModel();
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ // On rafraichit le modèle lorsque la page est rechargée (par exemple après l'ajout d'une nouvelle entité
+ // Personne ou Lot)
+ refreshModel();
- super.onBeforeRender();
- }
+ super.onBeforeRender();
+ }
- /**
- * Redirection vers une autre page. Cas où le formulaire est validé
- */
- private void redirect() {
- if (multipleEntry) {
- // Redirection de nouveau vers l'écran de saisie d'une nouvelle testBio
- TestBio nextManip = new TestBio();
- nextManip.setManipulateur(testBioModel.getObject().getManipulateur());
- nextManip.setOrganismeTesteur(testBioModel.getObject().getOrganismeTesteur());
- nextManip.setMethode(testBioModel.getObject().getMethode());
- setResponsePage(new ManageTestBioPage(nextManip, callerPage));
- } else if (callerPage != null) {
- // On passe l'id du testBio associée à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(TestBio.class.getSimpleName(), testBioModel.getObject());
- callerPage.responsePage(this);
- }
- }
+ /**
+ * Redirection vers une autre page. Cas où le formulaire est validé
+ */
+ private void redirect() {
+ if (multipleEntry) {
+ // Redirection de nouveau vers l'écran de saisie d'une nouvelle testBio
+ TestBio nextManip = new TestBio();
+ nextManip.setManipulateur(testBioModel.getObject().getManipulateur());
+ nextManip.setOrganismeTesteur(testBioModel.getObject().getOrganismeTesteur());
+ nextManip.setMethode(testBioModel.getObject().getMethode());
+ setResponsePage(new ManageTestBioPage(nextManip, callerPage));
+ } else if (callerPage != null) {
+ // On passe l'id du testBio associée à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(TestBio.class.getSimpleName(), testBioModel.getObject());
+ callerPage.responsePage(this);
+ }
+ }
- /**
- * Refresh model, appelé au rechargement de la page
- */
- private void refreshModel() {
+ /**
+ * Refresh model, appelé au rechargement de la page
+ */
+ private void refreshModel() {
- // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
- String key = Personne.class.getSimpleName();
- if (getPageParameters().getNamedKeys().contains(key)) {
- CollectionTools.setter(personnes, personneService.listPersonnes());
- try {
- Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
- testBioModel.getObject().setManipulateur(createdPersonne);
- } catch (StringValueConversionException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- getPageParameters().remove(key);
- }
- }
+ // Récupère (et supprime) les éventuels nouveaux objets créés dans les paramètres de la page.
+ String key = Personne.class.getSimpleName();
+ if (getPageParameters().getNamedKeys().contains(key)) {
+ CollectionTools.setter(personnes, personneService.listPersonnes());
+ try {
+ Personne createdPersonne = personneService.loadPersonne(getPageParameters().get(key).toInt());
+ testBioModel.getObject().setManipulateur(createdPersonne);
+ } catch (StringValueConversionException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ getPageParameters().remove(key);
+ }
+ }
- /**
- * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "blanc"
- * @param produitChoice Liste des produits
- * @param produitTemoinInput Texte pour le produit témoin
- * @param concMasseInput Texte pour la conc./masse
- * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
- * @param stadeChoice Liste des stades
- * @param target Cible de la requête ajax
- */
- private void activeInputsForBlancType(final DropDownChoice<Produit> produitChoice,
- final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
- final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
- AjaxRequestTarget target) {
- // si blanc, aucune saisie pour produit, produit témoin, conc., unité conc., stade
- produitChoice.setNullValid(true);
- newResultatModel.getObject().setProduit(null);
- produitChoice.setVisibilityAllowed(false);
+ /**
+ * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "blanc"
+ * @param produitChoice Liste des produits
+ * @param produitTemoinInput Texte pour le produit témoin
+ * @param concMasseInput Texte pour la conc./masse
+ * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
+ * @param stadeChoice Liste des stades
+ * @param target Cible de la requête ajax
+ */
+ private void activeInputsForBlancType(final DropDownChoice<Produit> produitChoice,
+ final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
+ final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
+ AjaxRequestTarget target) {
+ // si blanc, aucune saisie pour produit, produit témoin, conc., unité conc., stade
+ produitChoice.setNullValid(true);
+ newResultatModel.getObject().setProduit(null);
+ produitChoice.setVisibilityAllowed(false);
- newResultatModel.getObject().setProduitTemoin(null);
- produitTemoinInput.setVisibilityAllowed(false);
+ newResultatModel.getObject().setProduitTemoin(null);
+ produitTemoinInput.setVisibilityAllowed(false);
- newResultatModel.getObject().setConcMasse(null);
- concMasseInput.setVisibilityAllowed(false);
+ newResultatModel.getObject().setConcMasse(null);
+ concMasseInput.setVisibilityAllowed(false);
- newResultatModel.getObject().setUniteConcMasse(null);
- uniteConcMasseChoice.setVisibilityAllowed(false);
+ newResultatModel.getObject().setUniteConcMasse(null);
+ uniteConcMasseChoice.setVisibilityAllowed(false);
- stadeChoice.setNullValid(true);
- newResultatModel.getObject().setStade(null);
- stadeChoice.setVisibilityAllowed(false);
+ stadeChoice.setNullValid(true);
+ newResultatModel.getObject().setStade(null);
+ stadeChoice.setVisibilityAllowed(false);
- target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
- }
+ target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
+ }
- /**
- * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "témoin"
- * @param produitChoice Liste des produits
- * @param produitTemoinInput Texte pour le produit témoin
- * @param concMasseInput Texte pour la conc./masse
- * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
- * @param stadeChoice Liste des stades
- * @param target Cible de la requête ajax
- */
- private void activeInputsForTemoinType(final DropDownChoice<Produit> produitChoice,
- final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
- final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
- AjaxRequestTarget target) {
- // si témoin, aucune saisie pour produit et stade
- produitChoice.setNullValid(true);
- newResultatModel.getObject().setProduit(null);
- produitChoice.setVisibilityAllowed(false);
+ /**
+ * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "témoin"
+ * @param produitChoice Liste des produits
+ * @param produitTemoinInput Texte pour le produit témoin
+ * @param concMasseInput Texte pour la conc./masse
+ * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
+ * @param stadeChoice Liste des stades
+ * @param target Cible de la requête ajax
+ */
+ private void activeInputsForTemoinType(final DropDownChoice<Produit> produitChoice,
+ final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
+ final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
+ AjaxRequestTarget target) {
+ // si témoin, aucune saisie pour produit et stade
+ produitChoice.setNullValid(true);
+ newResultatModel.getObject().setProduit(null);
+ produitChoice.setVisibilityAllowed(false);
- stadeChoice.setNullValid(true);
- newResultatModel.getObject().setStade(null);
- stadeChoice.setVisibilityAllowed(false);
+ stadeChoice.setNullValid(true);
+ newResultatModel.getObject().setStade(null);
+ stadeChoice.setVisibilityAllowed(false);
- // saisie pour le reste
- produitTemoinInput.setVisibilityAllowed(true);
+ // saisie pour le reste
+ produitTemoinInput.setVisibilityAllowed(true);
- // masse/conc. par défaut comme valeur
- newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
- concMasseInput.setVisibilityAllowed(true);
+ // masse/conc. par défaut comme valeur
+ newResultatModel.getObject().setConcMasse(concMasseDefautInput.getModelObject());
+ concMasseInput.setVisibilityAllowed(true);
- // unité masse/conc. par défaut comme valeur
- newResultatModel.getObject().setUniteConcMasse(testBioModel.getObject().getUniteConcMasseDefaut());
- uniteConcMasseChoice.setVisibilityAllowed(true);
+ // unité masse/conc. par défaut comme valeur
+ newResultatModel.getObject().setUniteConcMasse(testBioModel.getObject().getUniteConcMasseDefaut());
+ uniteConcMasseChoice.setVisibilityAllowed(true);
- target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
- }
+ target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
+ }
- /**
- * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "produit"
- * @param produitChoice Liste des produits
- * @param produitTemoinInput Texte pour le produit témoin
- * @param concMasseInput Texte pour la conc./masse
- * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
- * @param stadeChoice Liste des stades
- * @param isAjaxRequete Vrai si l'initialisation se fait via une requête ajax
- * @param target Cible de la requête ajax, null si non appelé par une requête ajax
- */
- private void activeInputsForProduitType(final DropDownChoice<Produit> produitChoice,
- final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
- final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
- boolean isAjaxRequete, AjaxRequestTarget target) {
- // cas où type est produit, produit témoin désactivé et produit, conc., unité conc., stade activés
- newResultatModel.getObject().setProduitTemoin(null);
- produitTemoinInput.setVisibilityAllowed(false);
+ /**
+ * Initialise les champs produit, conc., unité conc.n stade pour un résultat de type "produit"
+ * @param produitChoice Liste des produits
+ * @param produitTemoinInput Texte pour le produit témoin
+ * @param concMasseInput Texte pour la conc./masse
+ * @param uniteConcMasseChoice Liste pour l'unité de la conc./masse
+ * @param stadeChoice Liste des stades
+ * @param isAjaxRequete Vrai si l'initialisation se fait via une requête ajax
+ * @param target Cible de la requête ajax, null si non appelé par une requête ajax
+ */
+ private void activeInputsForProduitType(final DropDownChoice<Produit> produitChoice,
+ final TextField<String> produitTemoinInput, final TextField<BigInteger> concMasseInput,
+ final DropDownChoice<UniteConcMasse> uniteConcMasseChoice, final DropDownChoice<Stade> stadeChoice,
+ boolean isAjaxRequete, AjaxRequestTarget target) {
+ // cas où type est produit, produit témoin désactivé et produit, conc., unité conc., stade activés
+ newResultatModel.getObject().setProduitTemoin(null);
+ produitTemoinInput.setVisibilityAllowed(false);
- produitChoice.setNullValid(false);
- produitChoice.setVisibilityAllowed(true);
+ produitChoice.setNullValid(false);
+ produitChoice.setVisibilityAllowed(true);
- // masse/conc. par défaut comme valeur
- newResultatModel.getObject().setConcMasse(testBioModel.getObject().getConcMasseDefaut());
- concMasseInput.setVisibilityAllowed(true);
+ // masse/conc. par défaut comme valeur
+ newResultatModel.getObject().setConcMasse(testBioModel.getObject().getConcMasseDefaut());
+ concMasseInput.setVisibilityAllowed(true);
- // unité masse/conc. par défaut comme valeur
- newResultatModel.getObject().setUniteConcMasse(testBioModel.getObject().getUniteConcMasseDefaut());
- uniteConcMasseChoice.setVisibilityAllowed(true);
+ // unité masse/conc. par défaut comme valeur
+ newResultatModel.getObject().setUniteConcMasse(testBioModel.getObject().getUniteConcMasseDefaut());
+ uniteConcMasseChoice.setVisibilityAllowed(true);
- stadeChoice.setNullValid(false);
- // stade par défaut comme valeur
- newResultatModel.getObject().setStade(testBioModel.getObject().getStadeDefaut());
- stadeChoice.setVisibilityAllowed(true);
+ stadeChoice.setNullValid(false);
+ // stade par défaut comme valeur
+ newResultatModel.getObject().setStade(testBioModel.getObject().getStadeDefaut());
+ stadeChoice.setVisibilityAllowed(true);
- if (isAjaxRequete) {
- target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
- }
- }
+ if (isAjaxRequete) {
+ target.add(produitChoice, produitTemoinInput, concMasseInput, uniteConcMasseChoice, stadeChoice);
+ }
+ }
- /**
- * Validate model
- */
- private void validateModel() {
- addValidationErrors(validator.validate(testBioModel.getObject(), getSession().getLocale()));
+ /**
+ * Validate model
+ */
+ private void validateModel() {
+ addValidationErrors(validator.validate(testBioModel.getObject(), getSession().getLocale()));
- if (!CollectionTools.containsWithValue(testBioModel.getObject().getResultats(), "typeResultat",
- AccessType.GETTER, TypeResultat.PRODUIT)) {
- error(getString("TestBio.resultats.noProduit"));
- }
- if (!testBioService.isTestBioUnique(testBioModel.getObject())) {
- error(getString("TestBio.notUnique"));
- }
- }
+ if (!CollectionTools.containsWithValue(testBioModel.getObject().getResultats(), "typeResultat",
+ AccessType.GETTER, TypeResultat.PRODUIT)) {
+ error(getString("TestBio.resultats.noProduit"));
+ }
+ if (!testBioService.isTestBioUnique(testBioModel.getObject())) {
+ error(getString("TestBio.notUnique"));
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ReadTestBioPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ReadTestBioPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/testBio/ReadTestBioPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -77,310 +77,310 @@
*/
public final class ReadTestBioPage extends TemplatePage {
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Action : update */
- private static final String ACTION_DELETE = "Delete";
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Action : update */
+ private static final String ACTION_DELETE = "Delete";
- /** testBio Model */
- private IModel<TestBio> testBioModel;
+ /** testBio Model */
+ private IModel<TestBio> testBioModel;
- /** Service : testBios */
- @SpringBean
- private TestBioService testBioService;
+ /** Service : testBios */
+ @SpringBean
+ private TestBioService testBioService;
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Bouton d'ajout d'un résultat de test bio **/
- Button addResultatButton;
+ /** Bouton d'ajout d'un résultat de test bio **/
+ Button addResultatButton;
- /** Container pour l'affichage des paramètres de la méthode **/
- MarkupContainer paramsMethoContainer;
+ /** Container pour l'affichage des paramètres de la méthode **/
+ MarkupContainer paramsMethoContainer;
- /**
- * Constructeur
- * @param idTestBio identifiant de la manip
- * @param callerPage Page appelante
- */
- public ReadTestBioPage(Integer idTestBio, CallerPage callerPage) {
- super(ReadTestBioPage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ /**
+ * Constructeur
+ * @param idTestBio identifiant de la manip
+ * @param callerPage Page appelante
+ */
+ public ReadTestBioPage(Integer idTestBio, CallerPage callerPage) {
+ super(ReadTestBioPage.class);
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation du modèle
- testBioModel = new GenericLoadableDetachableModel<TestBio>(TestBio.class, idTestBio);
+ // Initialisation du modèle
+ testBioModel = new GenericLoadableDetachableModel<TestBio>(TestBio.class, idTestBio);
- final TestBio testBio = testBioModel.getObject();
+ final TestBio testBio = testBioModel.getObject();
- initPrincipalFields(testBioModel, currentPage);
- initTestMethodFields(idTestBio);
- initResultsFields(idTestBio, currentPage);
+ initPrincipalFields(testBioModel, currentPage);
+ initTestMethodFields(idTestBio);
+ initResultsFields(idTestBio, currentPage);
- // Ajout du formulaire pour les actions
- Form<Void> formView = new Form<Void>("Form");
+ // Ajout du formulaire pour les actions
+ Form<Void> formView = new Form<Void>("Form");
- // Action : mise à jour (redirection vers le formulaire)
- Link<TestBio> updateLink = new Link<TestBio>(getResource() + ".TestBio.Update", new Model<TestBio>(testBio)) {
- @Override
- public void onClick() {
- setResponsePage(new ManageTestBioPage(getModelObject().getIdTestBio(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(testBioService.updateOrdeleteTestBioEnabled(testBio, getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<TestBio> updateLink = new Link<TestBio>(getResource() + ".TestBio.Update", new Model<TestBio>(testBio)) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageTestBioPage(getModelObject().getIdTestBio(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(testBioService.updateOrdeleteTestBioEnabled(testBio, getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : retour à la page précédente
- formView.add(new Link<Void>(getResource() + ".TestBio.Back") {
- @Override
- public void onClick() {
- redirect();
- }
- });
+ // Action : retour à la page précédente
+ formView.add(new Link<Void>(getResource() + ".TestBio.Back") {
+ @Override
+ public void onClick() {
+ redirect();
+ }
+ });
- // Action : suppression de la testBio
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageTestBioPage.class,
- new SubmittableButtonEvents() {
+ // Action : suppression de la testBio
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageTestBioPage.class,
+ new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- testBioService.deleteTestBio(testBio);
- }
+ @Override
+ public void onProcess() throws DataConstraintException {
+ testBioService.deleteTestBio(testBio);
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageTestBioPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(testBioService.updateOrdeleteTestBioEnabled(testBio, getSession()
- .getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
- add(formView);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageTestBioPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(testBioService.updateOrdeleteTestBioEnabled(testBio, getSession()
+ .getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
+ add(formView);
+ }
- /**
- * Bind principal data to the markup
- * @param testBioModel tbm
- * @param currentPage currentPage
- */
- private void initPrincipalFields(IModel<TestBio> testBioModel, final CallerPage currentPage) {
+ /**
+ * Bind principal data to the markup
+ * @param testBioModel tbm
+ * @param currentPage currentPage
+ */
+ private void initPrincipalFields(IModel<TestBio> testBioModel, final CallerPage currentPage) {
- add(new Label("TestBio.ref", new PropertyModel<String>(testBioModel, "ref"))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("TestBio.ref", new PropertyModel<String>(testBioModel, "ref"))
+ .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("TestBio.manipulateur", new PropertyModel<Personne>(testBioModel,
- "manipulateur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
+ add(new PropertyLabelLinkPanel<Personne>("TestBio.manipulateur", new PropertyModel<Personne>(testBioModel,
+ "manipulateur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
- add(new Label("TestBio.organismeTesteur", new PropertyModel<String>(testBioModel, "organismeTesteur"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new Label("TestBio.date", new DisplayShortDatePropertyModel(testBioModel, "date", getLocale()))
- .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("TestBio.organismeTesteur", new PropertyModel<String>(testBioModel, "organismeTesteur"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("TestBio.date", new DisplayShortDatePropertyModel(testBioModel, "date", getLocale()))
+ .add(new ReplaceEmptyLabelBehavior()));
- // concatenation de concMasse par défaut et de uniteConcMasse par défaut
- add(new Label("TestBio.concMasseDefaut", new Model<Serializable>(testBioModel) {
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasseDefaut",
- DecimalDisplFormat.SMALL, getLocale()).getObject();
+ // concatenation de concMasse par défaut et de uniteConcMasse par défaut
+ add(new Label("TestBio.concMasseDefaut", new Model<Serializable>(testBioModel) {
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasseDefaut",
+ DecimalDisplFormat.SMALL, getLocale()).getObject();
- String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasseDefaut",
- (TemplatePage) getPage()).getObject();
+ String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasseDefaut",
+ (TemplatePage) getPage()).getObject();
- if (masse == null && unite == null) {
- return ReplaceEmptyLabelBehavior.NULL_PROPERTY;
- } else if (masse == null) {
- return ReplaceEmptyLabelBehavior.NULL_PROPERTY + unite;
- } else if (unite == null) {
- return masse + ReplaceEmptyLabelBehavior.NULL_PROPERTY;
- }
- return masse + " " + unite;
- }
- }));
+ if (masse == null && unite == null) {
+ return ReplaceEmptyLabelBehavior.NULL_PROPERTY;
+ } else if (masse == null) {
+ return ReplaceEmptyLabelBehavior.NULL_PROPERTY + unite;
+ } else if (unite == null) {
+ return masse + ReplaceEmptyLabelBehavior.NULL_PROPERTY;
+ }
+ return masse + " " + unite;
+ }
+ }));
- add(new Label("TestBio.stadeDefaut", new DisplayEnumPropertyModel(testBioModel, "stadeDefaut", this))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new MultiLineLabel("TestBio.complement", new PropertyModel<String>(testBioModel, "complement"))
- .add(new ReplaceEmptyLabelBehavior()));
- add(new PropertyLabelLinkPanel<Personne>("TestBio.createur", new PropertyModel<Personne>(testBioModel,
- "createur"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
- }
- });
- }
+ add(new Label("TestBio.stadeDefaut", new DisplayEnumPropertyModel(testBioModel, "stadeDefaut", this))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new MultiLineLabel("TestBio.complement", new PropertyModel<String>(testBioModel, "complement"))
+ .add(new ReplaceEmptyLabelBehavior()));
+ add(new PropertyLabelLinkPanel<Personne>("TestBio.createur", new PropertyModel<Personne>(testBioModel,
+ "createur"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadPersonnePage(getModelObject().getIdPersonne(), currentPage));
+ }
+ });
+ }
- /**
- * Bind fields for test method to the markup
- * @param idTestBio itb
- */
- private void initTestMethodFields(Integer idTestBio) {
- WebMarkupContainer methodeCont = new WebMarkupContainer("TestBio.methode") {
- @Override
- public boolean isVisible() {
- // description cachée si pas de méthode sélectionnée
- return testBioModel.getObject().getMethode() != null;
- }
- };
- methodeCont.setOutputMarkupId(true);
- add(methodeCont);
+ /**
+ * Bind fields for test method to the markup
+ * @param idTestBio itb
+ */
+ private void initTestMethodFields(Integer idTestBio) {
+ WebMarkupContainer methodeCont = new WebMarkupContainer("TestBio.methode") {
+ @Override
+ public boolean isVisible() {
+ // description cachée si pas de méthode sélectionnée
+ return testBioModel.getObject().getMethode() != null;
+ }
+ };
+ methodeCont.setOutputMarkupId(true);
+ add(methodeCont);
- Label methodeCible = new Label("TestBio.cibleMethode", new PropertyModel<String>(testBioModel, "methode.cible"));
- methodeCont.add(methodeCible);
+ Label methodeCible = new Label("TestBio.cibleMethode", new PropertyModel<String>(testBioModel, "methode.cible"));
+ methodeCont.add(methodeCible);
- Label methodeDomaine = new Label("TestBio.domaineMethode", new PropertyModel<String>(testBioModel,
- "methode.domaine"));
- methodeCont.add(methodeDomaine);
+ Label methodeDomaine = new Label("TestBio.domaineMethode", new PropertyModel<String>(testBioModel,
+ "methode.domaine"));
+ methodeCont.add(methodeDomaine);
- MultiLineLabel methodeDesc = new MultiLineLabel("TestBio.descriptionMethode", new PropertyModel<String>(
- testBioModel, "methode.description"));
- methodeCont.add(methodeDesc);
+ MultiLineLabel methodeDesc = new MultiLineLabel("TestBio.descriptionMethode", new PropertyModel<String>(
+ testBioModel, "methode.description"));
+ methodeCont.add(methodeDesc);
- Label methodeValeurMesuree = new Label("TestBio.valeurMesureeMethode", new PropertyModel<String>(testBioModel,
- "methode.valeurMesuree"));
- methodeCont.add(methodeValeurMesuree);
+ Label methodeValeurMesuree = new Label("TestBio.valeurMesureeMethode", new PropertyModel<String>(testBioModel,
+ "methode.valeurMesuree"));
+ methodeCont.add(methodeValeurMesuree);
- Label methodeCritereActivite = new Label("TestBio.critereActiviteMethode", new PropertyModel<String>(
- testBioModel, "methode.critereActivite"));
- methodeCont.add(methodeCritereActivite);
+ Label methodeCritereActivite = new Label("TestBio.critereActiviteMethode", new PropertyModel<String>(
+ testBioModel, "methode.critereActivite"));
+ methodeCont.add(methodeCritereActivite);
- Label methodeUniteResultat = new Label("TestBio.uniteResultatMethode", new PropertyModel<String>(testBioModel,
- "methode.uniteResultat"));
- methodeCont.add(methodeUniteResultat);
+ Label methodeUniteResultat = new Label("TestBio.uniteResultatMethode", new PropertyModel<String>(testBioModel,
+ "methode.uniteResultat"));
+ methodeCont.add(methodeUniteResultat);
- Label nomMethode = new Label("TestBio.nomMethode", new PropertyModel<String>(testBioModel, "methode.nom"));
- methodeCont.add(nomMethode);
+ Label nomMethode = new Label("TestBio.nomMethode", new PropertyModel<String>(testBioModel, "methode.nom"));
+ methodeCont.add(nomMethode);
- }
+ }
- /**
- * Bind fields concerning results
- * @param idTestBio itb
- * @param currentPage currentPage
- */
- private void initResultsFields(Integer idTestBio, final CallerPage currentPage) {
- // Déclaration tableau des resultats
- // Pas de possibilité d'avoir le tableau vide car toujours au moins un résultat de type produit
- final MarkupContainer testsBioTable = new WebMarkupContainer("TestBio.resultats.Table");
- testsBioTable.setOutputMarkupId(true);
- add(testsBioTable);
+ /**
+ * Bind fields concerning results
+ * @param idTestBio itb
+ * @param currentPage currentPage
+ */
+ private void initResultsFields(Integer idTestBio, final CallerPage currentPage) {
+ // Déclaration tableau des resultats
+ // Pas de possibilité d'avoir le tableau vide car toujours au moins un résultat de type produit
+ final MarkupContainer testsBioTable = new WebMarkupContainer("TestBio.resultats.Table");
+ testsBioTable.setOutputMarkupId(true);
+ add(testsBioTable);
- final WebMarkupContainer resultNotAccessibleCont = new WebMarkupContainer(
- "TestBio.resultats.resultsNotAccessibles");
- resultNotAccessibleCont.setOutputMarkupPlaceholderTag(true);
- testsBioTable.add(resultNotAccessibleCont);
+ final WebMarkupContainer resultNotAccessibleCont = new WebMarkupContainer(
+ "TestBio.resultats.resultsNotAccessibles");
+ resultNotAccessibleCont.setOutputMarkupPlaceholderTag(true);
+ testsBioTable.add(resultNotAccessibleCont);
- // Model de liste des résultats
- final LoadableDetachableModel<List<ResultatTestBio>> listResultsModel = new LoadableDetachableModel<List<ResultatTestBio>>() {
- @Override
- protected List<ResultatTestBio> load() {
- boolean isOneResultNotAccessible = false;
+ // Model de liste des résultats
+ final LoadableDetachableModel<List<ResultatTestBio>> listResultsModel = new LoadableDetachableModel<List<ResultatTestBio>>() {
+ @Override
+ protected List<ResultatTestBio> load() {
+ boolean isOneResultNotAccessible = false;
- List<ResultatTestBio> listResults = new ArrayList<ResultatTestBio>();
+ List<ResultatTestBio> listResults = new ArrayList<ResultatTestBio>();
- for (ResultatTestBio res : testBioModel.getObject().getSortedResultats()) {
- // les résultats de type blanc ou témoin sont tjr accessibles
- if (res.getTypeResultat() != TypeResultat.PRODUIT
- || testBioService.isResultatTestBioAccessibleByUser(res, ((AuthSession) getPage()
- .getSession()).getUtilisateur())) {
- listResults.add(res);
- } else {
- isOneResultNotAccessible = true;
- }
- }
- // si un des résultats non accessible, on rend visible le message d'avertissement
- resultNotAccessibleCont.setVisibilityAllowed(isOneResultNotAccessible);
- return listResults;
- }
- };
+ for (ResultatTestBio res : testBioModel.getObject().getSortedResultats()) {
+ // les résultats de type blanc ou témoin sont tjr accessibles
+ if (res.getTypeResultat() != TypeResultat.PRODUIT
+ || testBioService.isResultatTestBioAccessibleByUser(res, ((AuthSession) getPage()
+ .getSession()).getUtilisateur())) {
+ listResults.add(res);
+ } else {
+ isOneResultNotAccessible = true;
+ }
+ }
+ // si un des résultats non accessible, on rend visible le message d'avertissement
+ resultNotAccessibleCont.setVisibilityAllowed(isOneResultNotAccessible);
+ return listResults;
+ }
+ };
- // Contenu tableaux resultats
- testsBioTable.add(new ListView<ResultatTestBio>("TestBio.resultats.List", listResultsModel) {
- @Override
- protected void populateItem(ListItem<ResultatTestBio> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Contenu tableaux resultats
+ testsBioTable.add(new ListView<ResultatTestBio>("TestBio.resultats.List", listResultsModel) {
+ @Override
+ protected void populateItem(ListItem<ResultatTestBio> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final IModel<ResultatTestBio> resultatModel = item.getModel();
- final ResultatTestBio resultat = resultatModel.getObject();
- // Colonnes
- item.add(new Label("TestBio.resultats.List.repere", new PropertyModel<String>(resultat, "repere")));
- item.add(new Label("TestBio.resultats.List.typeResultat", new DisplayEnumPropertyModel(resultat,
- "typeResultat", (TemplatePage) this.getPage())));
+ final IModel<ResultatTestBio> resultatModel = item.getModel();
+ final ResultatTestBio resultat = resultatModel.getObject();
+ // Colonnes
+ item.add(new Label("TestBio.resultats.List.repere", new PropertyModel<String>(resultat, "repere")));
+ item.add(new Label("TestBio.resultats.List.typeResultat", new DisplayEnumPropertyModel(resultat,
+ "typeResultat", (TemplatePage) this.getPage())));
- item.add(new PropertyLabelLinkProduitPanel("TestBio.resultats.List.produit",
- new PropertyModel<Produit>(resultat, "produit"), (TemplatePage) getPage()) {
- @Override
- public void onClickIfExtrait(Extrait extrait) {
- setResponsePage(new ReadExtractionPage(extrait.getExtraction().getIdExtraction(), currentPage));
- }
+ item.add(new PropertyLabelLinkProduitPanel("TestBio.resultats.List.produit",
+ new PropertyModel<Produit>(resultat, "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));
- }
- });
+ @Override
+ public void onClickIfFraction(Fraction fraction) {
+ setResponsePage(new ReadPurificationPage(fraction.getPurification().getIdPurification(),
+ currentPage));
+ }
+ });
- item.add(new Label("TestBio.resultats.List.produitTemoin", new PropertyModel<String>(resultat,
- "produitTemoin")));
- // concaténation de concMasse et uniteMasse
- item.add(new Label("TestBio.resultats.List.concMasse", new Model<Serializable>(resultat) {
+ item.add(new Label("TestBio.resultats.List.produitTemoin", new PropertyModel<String>(resultat,
+ "produitTemoin")));
+ // concaténation de concMasse et uniteMasse
+ item.add(new Label("TestBio.resultats.List.concMasse", new Model<Serializable>(resultat) {
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasse",
- DecimalDisplFormat.SMALL, getLocale()).getObject();
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ String masse = (String) new DisplayDecimalPropertyModel(super.getObject(), "concMasse",
+ DecimalDisplFormat.SMALL, getLocale()).getObject();
- String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasse",
- (TemplatePage) getPage()).getObject();
+ String unite = (String) new DisplayEnumPropertyModel(super.getObject(), "uniteConcMasse",
+ (TemplatePage) getPage()).getObject();
- if (masse == null && unite == null) {
- return ReplaceEmptyLabelBehavior.NULL_PROPERTY;
- } else if (masse == null) {
- return ReplaceEmptyLabelBehavior.NULL_PROPERTY + unite;
- } else if (unite == null) {
- return masse + ReplaceEmptyLabelBehavior.NULL_PROPERTY;
- }
- return masse + " " + unite;
- }
- }));
+ if (masse == null && unite == null) {
+ return ReplaceEmptyLabelBehavior.NULL_PROPERTY;
+ } else if (masse == null) {
+ return ReplaceEmptyLabelBehavior.NULL_PROPERTY + unite;
+ } else if (unite == null) {
+ return masse + ReplaceEmptyLabelBehavior.NULL_PROPERTY;
+ }
+ return masse + " " + unite;
+ }
+ }));
- item.add(new Label("TestBio.resultats.List.stade", new DisplayEnumPropertyModel(resultat, "stade",
- (TemplatePage) this.getPage())));
- item.add(new Label("TestBio.resultats.List.valeur", new DisplayDecimalPropertyModel(resultat, "valeur",
- DecimalDisplFormat.SMALL, getSession().getLocale())));
- item.add(new Label("TestBio.resultats.List.actif", new DisplayBooleanPropertyModel(resultatModel,
- "estActif", (TemplatePage) this.getPage())).add(new ReplaceEmptyLabelBehavior()));
- item.add(new Label("TestBio.resultats.List.erreur", new PropertyModel<String>(resultat, "erreur.nom")));
- // info-bulle comprenant la description de l'erreur
- item.add(new SimpleTooltipPanel("TestBio.resultats.List.erreur.info", new PropertyModel<String>(
- resultat, "erreur.description")) {
- /** {@inheritDoc} */
- @Override
- public boolean isVisible() {
- return resultat.getErreur() != null;
- }
- });
- }
- });
- }
+ item.add(new Label("TestBio.resultats.List.stade", new DisplayEnumPropertyModel(resultat, "stade",
+ (TemplatePage) this.getPage())));
+ item.add(new Label("TestBio.resultats.List.valeur", new DisplayDecimalPropertyModel(resultat, "valeur",
+ DecimalDisplFormat.SMALL, getSession().getLocale())));
+ item.add(new Label("TestBio.resultats.List.actif", new DisplayBooleanPropertyModel(resultatModel,
+ "estActif", (TemplatePage) this.getPage())).add(new ReplaceEmptyLabelBehavior()));
+ item.add(new Label("TestBio.resultats.List.erreur", new PropertyModel<String>(resultat, "erreur.nom")));
+ // info-bulle comprenant la description de l'erreur
+ item.add(new SimpleTooltipPanel("TestBio.resultats.List.erreur.info", new PropertyModel<String>(
+ resultat, "erreur.description")) {
+ /** {@inheritDoc} */
+ @Override
+ public boolean isVisible() {
+ return resultat.getErreur() != null;
+ }
+ });
+ }
+ });
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ callerPage.responsePage(this);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ManageUtilisateurPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ManageUtilisateurPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ManageUtilisateurPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -85,410 +85,410 @@
@AuthRoles({ AuthRole.ADMIN })
public final class ManageUtilisateurPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : reject */
- public static final String ACTION_REJECT = "Reject";
+ /** Action : reject */
+ public static final String ACTION_REJECT = "Reject";
- /** Action : update */
- private static final String ACTION_UPDATE = "Update";
+ /** Action : update */
+ private static final String ACTION_UPDATE = "Update";
- /** Action : validate */
- public static final String ACTION_VALID = "Valid";
+ /** Action : validate */
+ public static final String ACTION_VALID = "Valid";
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Ajout d'une autorisation sur une campagne ou un lot */
- private final Button addAuthorization;
+ /** Ajout d'une autorisation sur une campagne ou un lot */
+ private final Button addAuthorization;
- /** Campagnes disponibles pour ajouter des droits */
- private final AbstractSingleSelectChoice<Campagne> availableCampagnes;
+ /** Campagnes disponibles pour ajouter des droits */
+ private final AbstractSingleSelectChoice<Campagne> availableCampagnes;
- /** Lots disponibles pour ajouter des droits */
- private final AbstractSingleSelectChoice<Lot> availableLots;
+ /** Lots disponibles pour ajouter des droits */
+ private final AbstractSingleSelectChoice<Lot> availableLots;
- /** Modèle : droits sur une campagne, en cours de saisie */
- private final IModel<CampagnePersonneDroits> campagnePersonneDroitsModel;
+ /** Modèle : droits sur une campagne, en cours de saisie */
+ private final IModel<CampagnePersonneDroits> campagnePersonneDroitsModel;
- /** Campagnes */
- private final List<Campagne> campagnes;
+ /** Campagnes */
+ private final List<Campagne> campagnes;
- /** Service : campagne */
- @SpringBean
- private CampagneService campagneService;
+ /** Service : campagne */
+ @SpringBean
+ private CampagneService campagneService;
- /** Modèle : droits sur un lot, en cours de saisie */
- private final IModel<LotPersonneDroits> lotsPersonneDroitsModel;
+ /** Modèle : droits sur un lot, en cours de saisie */
+ private final IModel<LotPersonneDroits> lotsPersonneDroitsModel;
- /** Modèle : campagne en cours de sélection */
- private final IModel<ManageUtilisateurModel> manageUtilisateurModel;
+ /** Modèle : campagne en cours de sélection */
+ private final IModel<ManageUtilisateurModel> manageUtilisateurModel;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Modèle : utilisateur */
- private final IModel<Utilisateur> utilisateurModel;
+ /** Modèle : utilisateur */
+ private final IModel<Utilisateur> utilisateurModel;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructeur
- * @param idPersonne Identifiant utilisateur
- * @param callerPage Page appelante (pour redirection)
- */
- public ManageUtilisateurPage(Integer idPersonne, final CallerPage callerPage) {
- super(ManageUtilisateurPage.class);
+ /**
+ * Constructeur
+ * @param idPersonne Identifiant utilisateur
+ * @param callerPage Page appelante (pour redirection)
+ */
+ public ManageUtilisateurPage(Integer idPersonne, final CallerPage callerPage) {
+ super(ManageUtilisateurPage.class);
- // Initialisation des modèles
- try {
- utilisateurModel = new Model<Utilisateur>(personneService.loadUtilisateur(idPersonne));
- } catch (DataNotFoundException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- manageUtilisateurModel = new Model<ManageUtilisateurModel>(new ManageUtilisateurModel());
+ // Initialisation des modèles
+ try {
+ utilisateurModel = new Model<Utilisateur>(personneService.loadUtilisateur(idPersonne));
+ } catch (DataNotFoundException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ manageUtilisateurModel = new Model<ManageUtilisateurModel>(new ManageUtilisateurModel());
- manageUtilisateurModel.getObject().setCampagnesDroits(utilisateurModel.getObject().getCampagnesDroits());
- manageUtilisateurModel.getObject().getCampagnes()
- .addAll(utilisateurModel.getObject().getCampagnesDroits().keySet());
- manageUtilisateurModel.getObject().setLotsDroits(utilisateurModel.getObject().getLotsDroits());
- manageUtilisateurModel.getObject().getLots().addAll(utilisateurModel.getObject().getLotsDroits().keySet());
+ manageUtilisateurModel.getObject().setCampagnesDroits(utilisateurModel.getObject().getCampagnesDroits());
+ manageUtilisateurModel.getObject().getCampagnes()
+ .addAll(utilisateurModel.getObject().getCampagnesDroits().keySet());
+ manageUtilisateurModel.getObject().setLotsDroits(utilisateurModel.getObject().getLotsDroits());
+ manageUtilisateurModel.getObject().getLots().addAll(utilisateurModel.getObject().getLotsDroits().keySet());
- campagnePersonneDroitsModel = new Model<CampagnePersonneDroits>(new CampagnePersonneDroits());
- campagnePersonneDroitsModel.getObject().getId().setPk2(utilisateurModel.getObject());
- campagnePersonneDroitsModel.getObject().getDroits().setDroitExtrait(Boolean.TRUE);
- campagnePersonneDroitsModel.getObject().getDroits().setDroitPuri(Boolean.TRUE);
- campagnePersonneDroitsModel.getObject().getDroits().setDroitRecolte(Boolean.TRUE);
- campagnePersonneDroitsModel.getObject().getDroits().setDroitTestBio(Boolean.TRUE);
- lotsPersonneDroitsModel = new Model<LotPersonneDroits>(new LotPersonneDroits());
- lotsPersonneDroitsModel.getObject().getId().setPk2(utilisateurModel.getObject());
- lotsPersonneDroitsModel.getObject().getDroits().setDroitExtrait(Boolean.TRUE);
- lotsPersonneDroitsModel.getObject().getDroits().setDroitPuri(Boolean.TRUE);
- lotsPersonneDroitsModel.getObject().getDroits().setDroitRecolte(Boolean.TRUE);
- lotsPersonneDroitsModel.getObject().getDroits().setDroitTestBio(Boolean.TRUE);
+ campagnePersonneDroitsModel = new Model<CampagnePersonneDroits>(new CampagnePersonneDroits());
+ campagnePersonneDroitsModel.getObject().getId().setPk2(utilisateurModel.getObject());
+ campagnePersonneDroitsModel.getObject().getDroits().setDroitExtrait(Boolean.TRUE);
+ campagnePersonneDroitsModel.getObject().getDroits().setDroitPuri(Boolean.TRUE);
+ campagnePersonneDroitsModel.getObject().getDroits().setDroitRecolte(Boolean.TRUE);
+ campagnePersonneDroitsModel.getObject().getDroits().setDroitTestBio(Boolean.TRUE);
+ lotsPersonneDroitsModel = new Model<LotPersonneDroits>(new LotPersonneDroits());
+ lotsPersonneDroitsModel.getObject().getId().setPk2(utilisateurModel.getObject());
+ lotsPersonneDroitsModel.getObject().getDroits().setDroitExtrait(Boolean.TRUE);
+ lotsPersonneDroitsModel.getObject().getDroits().setDroitPuri(Boolean.TRUE);
+ lotsPersonneDroitsModel.getObject().getDroits().setDroitRecolte(Boolean.TRUE);
+ lotsPersonneDroitsModel.getObject().getDroits().setDroitTestBio(Boolean.TRUE);
- // Initialisation des listes
- campagnes = Collections.unmodifiableList(campagneService.listCampagnes(getSession().getUtilisateur()));
+ // Initialisation des listes
+ campagnes = Collections.unmodifiableList(campagneService.listCampagnes(getSession().getUtilisateur()));
- final Form<Void> formView = new Form<Void>("Form");
+ final Form<Void> formView = new Form<Void>("Form");
- final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", utilisateurModel);
- formView.add(personnePanel);
+ final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", utilisateurModel);
+ formView.add(personnePanel);
- formView.add(new RadioChoice<TypeDroit>("Utilisateur.typeDroit", new PropertyModel<TypeDroit>(utilisateurModel,
- "typeDroit"), Arrays.asList(TypeDroit.values()), new EnumChoiceRenderer<TypeDroit>(this)));
+ formView.add(new RadioChoice<TypeDroit>("Utilisateur.typeDroit", new PropertyModel<TypeDroit>(utilisateurModel,
+ "typeDroit"), Arrays.asList(TypeDroit.values()), new EnumChoiceRenderer<TypeDroit>(this)));
- // Gestion des campagnes et lots autorisés
- final MarkupContainer campagnesContainer = new WebMarkupContainer(getResource()
- + ".Authorizations.Campagnes.Table");
- campagnesContainer.setOutputMarkupId(true);
+ // Gestion des campagnes et lots autorisés
+ final MarkupContainer campagnesContainer = new WebMarkupContainer(getResource()
+ + ".Authorizations.Campagnes.Table");
+ campagnesContainer.setOutputMarkupId(true);
- // Liste des campagnes autorisées
- campagnesContainer.add(new ListView<Campagne>(getResource() + ".Authorizations.Campagnes.List",
- manageUtilisateurModel.getObject().getCampagnes()) {
- @Override
- protected void populateItem(final ListItem<Campagne> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des campagnes autorisées
+ campagnesContainer.add(new ListView<Campagne>(getResource() + ".Authorizations.Campagnes.List",
+ manageUtilisateurModel.getObject().getCampagnes()) {
+ @Override
+ protected void populateItem(final ListItem<Campagne> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final Campagne campagne = item.getModelObject();
- item.add(new Label(getResource() + ".Authorizations.Campagnes.Campagne.nom", campagne.getNom()));
- // Bouton de suppression des droits sur une campagne
- AjaxFallbackButton deleteAuthorization = new AjaxFallbackButton(
- "ManageUtilisateurPage.Authorizations.Campagnes.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- manageUtilisateurModel.getObject().getCampagnesDroits().remove(campagne);
- // Mise à jour des listes
- updateAvailableCampagnes();
- if (target != null) {
- target.add(campagnesContainer);
- }
- }
+ final Campagne campagne = item.getModelObject();
+ item.add(new Label(getResource() + ".Authorizations.Campagnes.Campagne.nom", campagne.getNom()));
+ // Bouton de suppression des droits sur une campagne
+ AjaxFallbackButton deleteAuthorization = new AjaxFallbackButton(
+ "ManageUtilisateurPage.Authorizations.Campagnes.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ manageUtilisateurModel.getObject().getCampagnesDroits().remove(campagne);
+ // Mise à jour des listes
+ updateAvailableCampagnes();
+ if (target != null) {
+ target.add(campagnesContainer);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteAuthorization.setDefaultFormProcessing(false);
- item.add(deleteAuthorization);
- }
- });
+ };
+ deleteAuthorization.setDefaultFormProcessing(false);
+ item.add(deleteAuthorization);
+ }
+ });
- // Liste des lots autorisés
- campagnesContainer.add(new ListView<Lot>(getResource() + ".Authorizations.Lots.List", manageUtilisateurModel
- .getObject().getLots()) {
- @Override
- protected void populateItem(ListItem<Lot> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des lots autorisés
+ campagnesContainer.add(new ListView<Lot>(getResource() + ".Authorizations.Lots.List", manageUtilisateurModel
+ .getObject().getLots()) {
+ @Override
+ protected void populateItem(ListItem<Lot> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- final Lot lot = item.getModelObject();
- item.add(new Label(getResource() + ".Authorizations.Lots.Campagne.nom", lot.getCampagne().getNom()));
- item.add(new Label(getResource() + ".Authorizations.Lots.Lot.ref", lot.getRef()));
- // Bouton de suppression des droits sur un lot
- AjaxFallbackButton deleteAuthorization = new AjaxFallbackButton(
- "ManageUtilisateurPage.Authorizations.Lots.Delete", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // Suppression
- manageUtilisateurModel.getObject().getLotsDroits().remove(lot);
- // Mise à jour des listes
- updateAvailableCampagnes();
- if (target != null) {
- target.add(campagnesContainer);
- }
- }
+ final Lot lot = item.getModelObject();
+ item.add(new Label(getResource() + ".Authorizations.Lots.Campagne.nom", lot.getCampagne().getNom()));
+ item.add(new Label(getResource() + ".Authorizations.Lots.Lot.ref", lot.getRef()));
+ // Bouton de suppression des droits sur un lot
+ AjaxFallbackButton deleteAuthorization = new AjaxFallbackButton(
+ "ManageUtilisateurPage.Authorizations.Lots.Delete", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // Suppression
+ manageUtilisateurModel.getObject().getLotsDroits().remove(lot);
+ // Mise à jour des listes
+ updateAvailableCampagnes();
+ if (target != null) {
+ target.add(campagnesContainer);
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // never called
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // never called
+ }
- };
- deleteAuthorization.setDefaultFormProcessing(false);
- item.add(deleteAuthorization);
- }
- });
+ };
+ deleteAuthorization.setDefaultFormProcessing(false);
+ item.add(deleteAuthorization);
+ }
+ });
- // Liste des campagnes disponibles (pour ajouter les droits)
- availableCampagnes = new DropDownChoice<Campagne>(getResource() + ".Authorizations.Campagnes.Campagne",
- new PropertyModel<Campagne>(campagnePersonneDroitsModel, "id.pk1"), new ArrayList<Campagne>());
- availableCampagnes.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- @Override
- protected void onUpdate(AjaxRequestTarget target) {
- // Mise à jour des listes lorsqu'une campagne a été sélectionnée
- updateAvailableCampagnes();
- target.add(availableLots);
- }
- });
- campagnesContainer.add(availableCampagnes);
+ // Liste des campagnes disponibles (pour ajouter les droits)
+ availableCampagnes = new DropDownChoice<Campagne>(getResource() + ".Authorizations.Campagnes.Campagne",
+ new PropertyModel<Campagne>(campagnePersonneDroitsModel, "id.pk1"), new ArrayList<Campagne>());
+ availableCampagnes.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ // Mise à jour des listes lorsqu'une campagne a été sélectionnée
+ updateAvailableCampagnes();
+ target.add(availableLots);
+ }
+ });
+ campagnesContainer.add(availableCampagnes);
- // Liste des lots disponibles (pour ajouter les droits)
- availableLots = new DropDownChoice<Lot>(getResource() + ".Authorizations.Campagnes.Lot",
- new PropertyModel<Lot>(lotsPersonneDroitsModel, "id.pk1"), new ArrayList<Lot>());
- availableLots.setOutputMarkupId(true);
- campagnesContainer.add(availableLots);
+ // Liste des lots disponibles (pour ajouter les droits)
+ availableLots = new DropDownChoice<Lot>(getResource() + ".Authorizations.Campagnes.Lot",
+ new PropertyModel<Lot>(lotsPersonneDroitsModel, "id.pk1"), new ArrayList<Lot>());
+ availableLots.setOutputMarkupId(true);
+ campagnesContainer.add(availableLots);
- // Ajout de droits sur une campagne ou un lot
- addAuthorization = new AjaxFallbackButton(getResource() + ".Authorizations.Campagnes.Add", formView) {
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- if (campagnePersonneDroitsModel.getObject().getId().getPk1() != null) {
- if (lotsPersonneDroitsModel.getObject().getId().getPk1() == null) {
- // Ajout de droits sur une campagne
- CampagnePersonneDroits droits;
- try {
- droits = campagnePersonneDroitsModel.getObject().clone();
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- // Recharge la campagne pour éviter une LazyLoadingException
- campagneService.refreshCampagne(droits.getId().getPk1());
- manageUtilisateurModel.getObject().getCampagnesDroits().put(droits.getId().getPk1(), droits);
+ // Ajout de droits sur une campagne ou un lot
+ addAuthorization = new AjaxFallbackButton(getResource() + ".Authorizations.Campagnes.Add", formView) {
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ if (campagnePersonneDroitsModel.getObject().getId().getPk1() != null) {
+ if (lotsPersonneDroitsModel.getObject().getId().getPk1() == null) {
+ // Ajout de droits sur une campagne
+ CampagnePersonneDroits droits;
+ try {
+ droits = campagnePersonneDroitsModel.getObject().clone();
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ // Recharge la campagne pour éviter une LazyLoadingException
+ campagneService.refreshCampagne(droits.getId().getPk1());
+ manageUtilisateurModel.getObject().getCampagnesDroits().put(droits.getId().getPk1(), droits);
- // puisque droits sur Campagne-Tous, suppression des Campagne-Lot de cette campagne
- // Se base sur le réf de lot plutôt que l'objet pour être indépendant du contexte de persistance
- // d'où provient l'entité
- CollectionTools.removeAllWithValue(manageUtilisateurModel.getObject().getLotsDroits().keySet(),
- "ref", AccessType.GETTER, CollectionTools.valuesFromList(droits.getId().getPk1()
- .getLots(), "ref", AccessType.GETTER));
+ // puisque droits sur Campagne-Tous, suppression des Campagne-Lot de cette campagne
+ // Se base sur le réf de lot plutôt que l'objet pour être indépendant du contexte de persistance
+ // d'où provient l'entité
+ CollectionTools.removeAllWithValue(manageUtilisateurModel.getObject().getLotsDroits().keySet(),
+ "ref", AccessType.GETTER, CollectionTools.valuesFromList(droits.getId().getPk1()
+ .getLots(), "ref", AccessType.GETTER));
- } else {
- // Ajout de droits sur un lot
- LotPersonneDroits droits;
- try {
- droits = lotsPersonneDroitsModel.getObject().clone();
- } catch (CloneNotSupportedException e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- manageUtilisateurModel.getObject().getLotsDroits().put(droits.getId().getPk1(), droits);
- }
- // Mise à jour des listes
- updateAvailableCampagnes();
- if (target != null) {
- target.add(campagnesContainer);
- }
- }
- }
+ } else {
+ // Ajout de droits sur un lot
+ LotPersonneDroits droits;
+ try {
+ droits = lotsPersonneDroitsModel.getObject().clone();
+ } catch (CloneNotSupportedException e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ manageUtilisateurModel.getObject().getLotsDroits().put(droits.getId().getPk1(), droits);
+ }
+ // Mise à jour des listes
+ updateAvailableCampagnes();
+ if (target != null) {
+ target.add(campagnesContainer);
+ }
+ }
+ }
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- refreshFeedbackPage(target);
- }
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ refreshFeedbackPage(target);
+ }
- };
- campagnesContainer.add(addAuthorization);
+ };
+ campagnesContainer.add(addAuthorization);
- updateAvailableCampagnes();
- formView.add(campagnesContainer);
+ updateAvailableCampagnes();
+ formView.add(campagnesContainer);
- // Action : mise à jour de l'utilisateur
- Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.updateUtilisateur(utilisateurModel.getObject(), true);
- }
+ // Action : mise à jour de l'utilisateur
+ Button updateButton = new SubmittableButton(ACTION_UPDATE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.updateUtilisateur(utilisateurModel.getObject(), true);
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_UPDATE);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_UPDATE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- utilisateurModel.getObject()
- .setCampagnesDroits(manageUtilisateurModel.getObject().getCampagnesDroits());
- utilisateurModel.getObject().setLotsDroits(manageUtilisateurModel.getObject().getLotsDroits());
- personnePanel.validate();
- validator.validate(utilisateurModel.getObject(), getSession().getLocale(), "typeDroit");
- }
- });
- updateButton.setVisibilityAllowed(utilisateurEstValide());
- formView.add(updateButton);
+ @Override
+ public void onValidate() {
+ utilisateurModel.getObject()
+ .setCampagnesDroits(manageUtilisateurModel.getObject().getCampagnesDroits());
+ utilisateurModel.getObject().setLotsDroits(manageUtilisateurModel.getObject().getLotsDroits());
+ personnePanel.validate();
+ validator.validate(utilisateurModel.getObject(), getSession().getLocale(), "typeDroit");
+ }
+ });
+ updateButton.setVisibilityAllowed(utilisateurEstValide());
+ formView.add(updateButton);
- // Action validation de l'utilisateur
- Button validButton = new SubmittableButton(ACTION_VALID, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.validAndUpdateUtilisateur(utilisateurModel.getObject());
- }
+ // Action validation de l'utilisateur
+ Button validButton = new SubmittableButton(ACTION_VALID, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.validAndUpdateUtilisateur(utilisateurModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_VALID);
- callerPage.responsePage((TemplatePage) getPage());
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_VALID);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
- @Override
- public void onValidate() {
- utilisateurModel.getObject()
- .setCampagnesDroits(manageUtilisateurModel.getObject().getCampagnesDroits());
- utilisateurModel.getObject().setLotsDroits(manageUtilisateurModel.getObject().getLotsDroits());
- personnePanel.validate();
- validator.validate(utilisateurModel.getObject(), getSession().getLocale(), "typeDroit");
- }
- });
- validButton.setVisibilityAllowed(!utilisateurEstValide());
- formView.add(validButton);
+ @Override
+ public void onValidate() {
+ utilisateurModel.getObject()
+ .setCampagnesDroits(manageUtilisateurModel.getObject().getCampagnesDroits());
+ utilisateurModel.getObject().setLotsDroits(manageUtilisateurModel.getObject().getLotsDroits());
+ personnePanel.validate();
+ validator.validate(utilisateurModel.getObject(), getSession().getLocale(), "typeDroit");
+ }
+ });
+ validButton.setVisibilityAllowed(!utilisateurEstValide());
+ formView.add(validButton);
- // Action : suppression de l'utilisateur
- Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException, EmailException {
- personneService.deleteUtilisateur(utilisateurModel.getObject());
- }
+ // Action : suppression de l'utilisateur
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException, EmailException {
+ personneService.deleteUtilisateur(utilisateurModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_DELETE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- // impossible de supprimer son propre utilisateur
- deleteButton.setVisibilityAllowed(utilisateurEstValide()
- && getSession().getUtilisateur().getIdPersonne() != utilisateurModel.getObject().getIdPersonne());
- deleteButton.setDefaultFormProcessing(false);
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_DELETE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ // impossible de supprimer son propre utilisateur
+ deleteButton.setVisibilityAllowed(utilisateurEstValide()
+ && getSession().getUtilisateur().getIdPersonne() != utilisateurModel.getObject().getIdPersonne());
+ deleteButton.setDefaultFormProcessing(false);
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
- // Action : rejet de l'utilisateur
- Button rejectButton = new SubmittableButton(ACTION_REJECT, new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.rejectUtilisateur(utilisateurModel.getObject());
- }
+ // Action : rejet de l'utilisateur
+ Button rejectButton = new SubmittableButton(ACTION_REJECT, new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.rejectUtilisateur(utilisateurModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ACTION_REJECT);
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
- rejectButton.setVisibilityAllowed(!utilisateurEstValide());
- rejectButton.setDefaultFormProcessing(false);
- rejectButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(rejectButton);
+ @Override
+ public void onSuccess() {
+ successNextPage(ACTION_REJECT);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
+ rejectButton.setVisibilityAllowed(!utilisateurEstValide());
+ rejectButton.setDefaultFormProcessing(false);
+ rejectButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(rejectButton);
- // Action : annulation
- formView.add(new Link<Void>("Cancel") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- });
+ // Action : annulation
+ formView.add(new Link<Void>("Cancel") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ });
- add(formView);
- }
+ add(formView);
+ }
- /**
- * Mets à jour les campagnes et lots disponibles
- */
- @SuppressWarnings("unchecked")
- private void updateAvailableCampagnes() {
- CollectionTools.setter(manageUtilisateurModel.getObject().getCampagnes(), manageUtilisateurModel.getObject()
- .getCampagnesDroits().keySet());
- // tri pour affichage
- Collections.sort(manageUtilisateurModel.getObject().getCampagnes(), BeanTools.createPropertyComparator("nom"));
+ /**
+ * Mets à jour les campagnes et lots disponibles
+ */
+ @SuppressWarnings("unchecked")
+ private void updateAvailableCampagnes() {
+ CollectionTools.setter(manageUtilisateurModel.getObject().getCampagnes(), manageUtilisateurModel.getObject()
+ .getCampagnesDroits().keySet());
+ // tri pour affichage
+ Collections.sort(manageUtilisateurModel.getObject().getCampagnes(), BeanTools.createPropertyComparator("nom"));
- CollectionTools.setter(manageUtilisateurModel.getObject().getLots(), manageUtilisateurModel.getObject()
- .getLotsDroits().keySet());
- // tri pour affichage
- ComparatorChain campagneComp = new ComparatorChain(BeanTools.createPropertyComparator("campagne.nom"));
- campagneComp.addComparator(BeanTools.createPropertyComparator("ref"));
- Collections.sort(manageUtilisateurModel.getObject().getLots(), campagneComp);
+ CollectionTools.setter(manageUtilisateurModel.getObject().getLots(), manageUtilisateurModel.getObject()
+ .getLotsDroits().keySet());
+ // tri pour affichage
+ ComparatorChain campagneComp = new ComparatorChain(BeanTools.createPropertyComparator("campagne.nom"));
+ campagneComp.addComparator(BeanTools.createPropertyComparator("ref"));
+ Collections.sort(manageUtilisateurModel.getObject().getLots(), campagneComp);
- // Campagnes
- List<Campagne> campagnesList = new ArrayList<Campagne>(campagnes);
- // Supprime les campagnes dont l'utilisateur a déjà les droits
- // Se base sur le nom de campagne plutôt que l'objet pour être indépendant du contexte de persistance d'où
- // provient l'entité
- CollectionTools.removeAllWithValue(campagnesList, "nom", AccessType.GETTER, CollectionTools.valuesFromList(
- manageUtilisateurModel.getObject().getCampagnes(), "nom", AccessType.GETTER));
- // campagnesList.removeAll(manageUtilisateurModel.getObject().getCampagnes());
- availableCampagnes.setChoices(campagnesList);
- campagnePersonneDroitsModel.getObject().getId()
- .setPk1(campagnesList.isEmpty() ? null : availableCampagnes.getModelObject());
- availableCampagnes.setEnabled(!campagnesList.isEmpty());
+ // Campagnes
+ List<Campagne> campagnesList = new ArrayList<Campagne>(campagnes);
+ // Supprime les campagnes dont l'utilisateur a déjà les droits
+ // Se base sur le nom de campagne plutôt que l'objet pour être indépendant du contexte de persistance d'où
+ // provient l'entité
+ CollectionTools.removeAllWithValue(campagnesList, "nom", AccessType.GETTER, CollectionTools.valuesFromList(
+ manageUtilisateurModel.getObject().getCampagnes(), "nom", AccessType.GETTER));
+ // campagnesList.removeAll(manageUtilisateurModel.getObject().getCampagnes());
+ availableCampagnes.setChoices(campagnesList);
+ campagnePersonneDroitsModel.getObject().getId()
+ .setPk1(campagnesList.isEmpty() ? null : availableCampagnes.getModelObject());
+ availableCampagnes.setEnabled(!campagnesList.isEmpty());
- // Lots
- List<Lot> lotsList = new ArrayList<Lot>();
- availableLots.setEnabled(campagnePersonneDroitsModel.getObject().getId().getPk1() != null);
- if (availableLots.isEnabled()) {
- // Evite une LazyLoadingException car la campagne n'est plus dans la session
- campagneService.refreshCampagne(campagnePersonneDroitsModel.getObject().getId().getPk1());
- lotsList.addAll(campagnePersonneDroitsModel.getObject().getId().getPk1().getLots());
- // Supprime les lots pour lequels l'utilisateur a déjà les droits
- // Se base sur le réf de lot plutôt que l'objet pour être indépendant du contexte de persistance d'où
- // provient l'entité
- CollectionTools.removeAllWithValue(lotsList, "ref", AccessType.GETTER, CollectionTools.valuesFromList(
- manageUtilisateurModel.getObject().getLots(), "ref", AccessType.GETTER));
+ // Lots
+ List<Lot> lotsList = new ArrayList<Lot>();
+ availableLots.setEnabled(campagnePersonneDroitsModel.getObject().getId().getPk1() != null);
+ if (availableLots.isEnabled()) {
+ // Evite une LazyLoadingException car la campagne n'est plus dans la session
+ campagneService.refreshCampagne(campagnePersonneDroitsModel.getObject().getId().getPk1());
+ lotsList.addAll(campagnePersonneDroitsModel.getObject().getId().getPk1().getLots());
+ // Supprime les lots pour lequels l'utilisateur a déjà les droits
+ // Se base sur le réf de lot plutôt que l'objet pour être indépendant du contexte de persistance d'où
+ // provient l'entité
+ CollectionTools.removeAllWithValue(lotsList, "ref", AccessType.GETTER, CollectionTools.valuesFromList(
+ manageUtilisateurModel.getObject().getLots(), "ref", AccessType.GETTER));
- availableLots.setChoices(lotsList);
- }
- lotsPersonneDroitsModel.getObject().getId().setPk1(null);
+ availableLots.setChoices(lotsList);
+ }
+ lotsPersonneDroitsModel.getObject().getId().setPk1(null);
- addAuthorization.setEnabled(!campagnesList.isEmpty());
- }
+ addAuthorization.setEnabled(!campagnesList.isEmpty());
+ }
- /**
- * L'utilisateur est-il valide?
- * @return Validité
- */
- private boolean utilisateurEstValide() {
- return utilisateurModel.getObject().isValide();
- }
+ /**
+ * L'utilisateur est-il valide?
+ * @return Validité
+ */
+ private boolean utilisateurEstValide() {
+ return utilisateurModel.getObject().isValide();
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ReadUtilisateurPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ReadUtilisateurPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ReadUtilisateurPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,107 +52,107 @@
*/
public final class ReadUtilisateurPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** Page appelante */
- private final CallerPage callerPage;
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** Page appelante */
+ private final CallerPage callerPage;
- /** Modèle : personne */
- private final IModel<Utilisateur> utilisateurModel;
+ /** Modèle : personne */
+ private final IModel<Utilisateur> utilisateurModel;
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructeur
- * @param idUtilisateur ID de l'utilisateur
- * @param callerPage Page appelante
- */
- public ReadUtilisateurPage(Integer idUtilisateur, CallerPage callerPage) {
- super(ReadUtilisateurPage.class);
+ /**
+ * Constructeur
+ * @param idUtilisateur ID de l'utilisateur
+ * @param callerPage Page appelante
+ */
+ public ReadUtilisateurPage(Integer idUtilisateur, CallerPage callerPage) {
+ super(ReadUtilisateurPage.class);
- final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
- this.callerPage = callerPage;
+ final CallerPage currentPage = new CallerPage((TemplatePage) getPage());
+ this.callerPage = callerPage;
- // Initialisation du modèle
- utilisateurModel = new GenericLoadableDetachableModel<Utilisateur>(Utilisateur.class, idUtilisateur);
+ // Initialisation du modèle
+ utilisateurModel = new GenericLoadableDetachableModel<Utilisateur>(Utilisateur.class, idUtilisateur);
- // Ajout du panel ReadPersonnePanel
- add(new ReadPersonnePanel("ReadPersonnePanel", utilisateurModel));
+ // Ajout du panel ReadPersonnePanel
+ add(new ReadPersonnePanel("ReadPersonnePanel", utilisateurModel));
- add(new Label("Utilisateur.typeDroits", new DisplayEnumPropertyModel(utilisateurModel, "typeDroit", this)));
+ add(new Label("Utilisateur.typeDroits", new DisplayEnumPropertyModel(utilisateurModel, "typeDroit", this)));
- // Ajout du formulaire pour les actions
- final Form<Utilisateur> formView = new Form<Utilisateur>("Form", utilisateurModel);
+ // Ajout du formulaire pour les actions
+ final Form<Utilisateur> formView = new Form<Utilisateur>("Form", utilisateurModel);
- // Fieldset pour les droits de l'utilisateur (affiché uniquement si l'utilisateur est administrateur ou s'il
- // affiche son propre profil)
- MarkupContainer autorizationsFieldset = new WebMarkupContainer("ReadUtilisateurPage.AutorizationsFieldset") {
- /** {@inheritDoc} */
- @Override
- public boolean isVisible() {
- Utilisateur currentUser = ReadUtilisateurPage.this.getSession().getUtilisateur();
- return currentUser.getTypeDroit() == TypeDroit.ADMINISTRATEUR
- || currentUser.getIdPersonne().equals(utilisateurModel.getObject().getIdPersonne());
- }
- };
+ // Fieldset pour les droits de l'utilisateur (affiché uniquement si l'utilisateur est administrateur ou s'il
+ // affiche son propre profil)
+ MarkupContainer autorizationsFieldset = new WebMarkupContainer("ReadUtilisateurPage.AutorizationsFieldset") {
+ /** {@inheritDoc} */
+ @Override
+ public boolean isVisible() {
+ Utilisateur currentUser = ReadUtilisateurPage.this.getSession().getUtilisateur();
+ return currentUser.getTypeDroit() == TypeDroit.ADMINISTRATEUR
+ || currentUser.getIdPersonne().equals(utilisateurModel.getObject().getIdPersonne());
+ }
+ };
- autorizationsFieldset.add(new ReadDroitsUtilisateurPanel("ReadDroitsUtilisateurPanel", utilisateurModel));
- add(autorizationsFieldset);
+ autorizationsFieldset.add(new ReadDroitsUtilisateurPanel("ReadDroitsUtilisateurPanel", utilisateurModel));
+ add(autorizationsFieldset);
- // Action : mise à jour (redirection vers le formulaire)
- Link<Utilisateur> updateLink = new Link<Utilisateur>(getResource() + ".Personne.Update", utilisateurModel) {
- @Override
- public void onClick() {
- setResponsePage(new ManageUtilisateurPage(getModelObject().getIdPersonne(), currentPage));
- }
- };
- updateLink.setVisibilityAllowed(getSession().getUtilisateur().getIdPersonne() != utilisateurModel.getObject()
- .getIdPersonne()
- && personneService.updateOrDeletePersonneEnabled(utilisateurModel.getObject(), getSession()
- .getUtilisateur()));
- formView.add(updateLink);
+ // Action : mise à jour (redirection vers le formulaire)
+ Link<Utilisateur> updateLink = new Link<Utilisateur>(getResource() + ".Personne.Update", utilisateurModel) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ManageUtilisateurPage(getModelObject().getIdPersonne(), currentPage));
+ }
+ };
+ updateLink.setVisibilityAllowed(getSession().getUtilisateur().getIdPersonne() != utilisateurModel.getObject()
+ .getIdPersonne()
+ && personneService.updateOrDeletePersonneEnabled(utilisateurModel.getObject(), getSession()
+ .getUtilisateur()));
+ formView.add(updateLink);
- // Action : retour à la page précédente
- formView.add(new Link<Void>(getResource() + ".Personne.Back") {
- @Override
- public void onClick() {
- redirect();
- }
- });
+ // Action : retour à la page précédente
+ formView.add(new Link<Void>(getResource() + ".Personne.Back") {
+ @Override
+ public void onClick() {
+ redirect();
+ }
+ });
- // Action : suppression de la personne
- Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageUtilisateurPage.class,
- new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.deletePersonne(utilisateurModel.getObject());
- }
+ // Action : suppression de la personne
+ Button deleteButton = new SubmittableButton(ACTION_DELETE, ManageUtilisateurPage.class,
+ new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.deletePersonne(utilisateurModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage(ManageUtilisateurPage.class, ACTION_DELETE);
- redirect();
- }
- });
- deleteButton.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(utilisateurModel.getObject(),
- getSession().getUtilisateur()));
- deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
- formView.add(deleteButton);
- add(formView);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage(ManageUtilisateurPage.class, ACTION_DELETE);
+ redirect();
+ }
+ });
+ deleteButton.setVisibilityAllowed(personneService.updateOrDeletePersonneEnabled(utilisateurModel.getObject(),
+ getSession().getUtilisateur()));
+ deleteButton.add(new JSConfirmationBehavior(getString("Confirm")));
+ formView.add(deleteButton);
+ add(formView);
+ }
- /**
- * Redirection vers une autre page
- */
- private void redirect() {
- // On passe la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
- // l'exploiter si besoin
- callerPage.addPageParameter(Personne.class.getSimpleName(), utilisateurModel.getObject());
- callerPage.responsePage(this);
- }
+ /**
+ * Redirection vers une autre page
+ */
+ private void redirect() {
+ // On passe la personne associée à cette page, en paramètre de la prochaine page, pour lui permettre de
+ // l'exploiter si besoin
+ callerPage.addPageParameter(Personne.class.getSimpleName(), utilisateurModel.getObject());
+ callerPage.responsePage(this);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/RegisterPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/RegisterPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/RegisterPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -58,88 +58,88 @@
@AuthRoles(AuthRole.VISITOR)
public final class RegisterPage extends TemplatePage {
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator") private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator") private ModelValidator validator;
- /**
- * Constructeur
- */
- public RegisterPage() {
- super(RegisterPage.class);
+ /**
+ * Constructeur
+ */
+ public RegisterPage() {
+ super(RegisterPage.class);
- // Initialisation des modèles (registerModel, CaptchaModel, Utilisateur)
- final IModel<RegisterModel> registerModel = new Model<RegisterModel>(new RegisterModel());
- final IModel<CaptchaModel> captchaModel = new Model<CaptchaModel>(new CaptchaModel());
- captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
- final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
+ // Initialisation des modèles (registerModel, CaptchaModel, Utilisateur)
+ final IModel<RegisterModel> registerModel = new Model<RegisterModel>(new RegisterModel());
+ final IModel<CaptchaModel> captchaModel = new Model<CaptchaModel>(new CaptchaModel());
+ captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
+ final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
- // Formulaire
- final Form<Void> formView = new Form<Void>("Form");
- final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", utilisateurModel);
- formView.add(personnePanel);
+ // Formulaire
+ final Form<Void> formView = new Form<Void>("Form");
+ final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel", utilisateurModel);
+ formView.add(personnePanel);
- // Champs n'apparaissant pas dans le "ManagePersonnePanel"
- formView.add(new PasswordTextField("RegisterModel.password", new PropertyModel<String>(registerModel,
- "password")).setRequired(false));
- final Component passwordConfirmationView = new PasswordTextField("RegisterModel.passwordConfirmation",
- new PropertyModel<String>(registerModel, "passwordConfirmation")).setRequired(false);
- formView.add(passwordConfirmationView);
- formView.add(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel.getObject()
- .getCaptchaTextGenerated())));
- final Component captchaTextView = new TextField<String>("CaptchaModel.captchaText", new PropertyModel<String>(
- captchaModel, "captchaText"));
- formView.add(captchaTextView);
+ // Champs n'apparaissant pas dans le "ManagePersonnePanel"
+ formView.add(new PasswordTextField("RegisterModel.password", new PropertyModel<String>(registerModel,
+ "password")).setRequired(false));
+ final Component passwordConfirmationView = new PasswordTextField("RegisterModel.passwordConfirmation",
+ new PropertyModel<String>(registerModel, "passwordConfirmation")).setRequired(false);
+ formView.add(passwordConfirmationView);
+ formView.add(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel.getObject()
+ .getCaptchaTextGenerated())));
+ final Component captchaTextView = new TextField<String>("CaptchaModel.captchaText", new PropertyModel<String>(
+ captchaModel, "captchaText"));
+ formView.add(captchaTextView);
- // Action : enregistrement de l'utilisateur
- formView.add(new SubmittableButton("Register", new SubmittableButtonEvents() {
- @Override
- public void onError() {
- // Remise à zéro de certains champs
- registerModel.getObject().setPassword(null);
- registerModel.getObject().setPasswordConfirmation(null);
- captchaModel.getObject().setCaptchaText(null);
- captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
- formView.replace(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel
- .getObject().getCaptchaTextGenerated())));
- }
+ // Action : enregistrement de l'utilisateur
+ formView.add(new SubmittableButton("Register", new SubmittableButtonEvents() {
+ @Override
+ public void onError() {
+ // Remise à zéro de certains champs
+ registerModel.getObject().setPassword(null);
+ registerModel.getObject().setPasswordConfirmation(null);
+ captchaModel.getObject().setCaptchaText(null);
+ captchaModel.getObject().setCaptchaTextGenerated(CaptchaTools.random());
+ formView.replace(new NonCachingImage("CaptchaModel.captchaImage", new CaptchaImageResource(captchaModel
+ .getObject().getCaptchaTextGenerated())));
+ }
- @Override
- public void onProcess() throws DataConstraintException {
- // Cryptage du mot de passe
- utilisateurModel.getObject().setPasswordHash(
- personneService.hashPassword(registerModel.getObject().getPassword()));
- // Mise à jour de l'utilisateur
- personneService.createUtilisateur(utilisateurModel.getObject());
- }
+ @Override
+ public void onProcess() throws DataConstraintException {
+ // Cryptage du mot de passe
+ utilisateurModel.getObject().setPasswordHash(
+ personneService.hashPassword(registerModel.getObject().getPassword()));
+ // Mise à jour de l'utilisateur
+ personneService.createUtilisateur(utilisateurModel.getObject());
+ }
- @Override
- public void onSuccess() {
- successNextPage("Register");
- setResponsePage(HomePage.class);
- }
+ @Override
+ public void onSuccess() {
+ successNextPage("Register");
+ setResponsePage(HomePage.class);
+ }
- @Override
- public void onValidate() {
- personnePanel.validate();
- List<String> passwordErrors = validator.validate(registerModel.getObject(), getSession().getLocale(),
- "password");
- if (passwordErrors.isEmpty()) {
- if (!registerModel.getObject().validate()) {
- errorCurrentPage(passwordConfirmationView);
- }
- } else {
- addValidationErrors(passwordErrors);
- }
- if (!captchaModel.getObject().validate()) {
- errorCurrentPage(captchaTextView);
- }
- }
- }));
+ @Override
+ public void onValidate() {
+ personnePanel.validate();
+ List<String> passwordErrors = validator.validate(registerModel.getObject(), getSession().getLocale(),
+ "password");
+ if (passwordErrors.isEmpty()) {
+ if (!registerModel.getObject().validate()) {
+ errorCurrentPage(passwordConfirmationView);
+ }
+ } else {
+ addValidationErrors(passwordErrors);
+ }
+ if (!captchaModel.getObject().validate()) {
+ errorCurrentPage(captchaTextView);
+ }
+ }
+ }));
- add(formView);
- }
+ add(formView);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ResetPasswordPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ResetPasswordPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/ResetPasswordPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,46 +48,46 @@
@AuthRoles(AuthRole.VISITOR)
public final class ResetPasswordPage extends TemplatePage {
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator") private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator") private ModelValidator validator;
- /**
- * Constructeur
- */
- public ResetPasswordPage() {
- super(ResetPasswordPage.class);
- // Modèle
- final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
- // Formulaire
- Form<Utilisateur> formView = new Form<Utilisateur>("Form", utilisateurModel);
- formView
- .add(new TextField<String>("Personne.courriel", new PropertyModel<String>(utilisateurModel, "courriel")));
+ /**
+ * Constructeur
+ */
+ public ResetPasswordPage() {
+ super(ResetPasswordPage.class);
+ // Modèle
+ final IModel<Utilisateur> utilisateurModel = new Model<Utilisateur>(new Utilisateur());
+ // Formulaire
+ Form<Utilisateur> formView = new Form<Utilisateur>("Form", utilisateurModel);
+ formView
+ .add(new TextField<String>("Personne.courriel", new PropertyModel<String>(utilisateurModel, "courriel")));
- // Action : regénération du mot de passe
- formView.add(new SubmittableButton("Reset", new SubmittableButtonEvents() {
- @Override
- public void onProcess() throws DataNotFoundException, EmailException {
- personneService.resetPasswordUtilisateur(utilisateurModel.getObject().getCourriel());
- }
+ // Action : regénération du mot de passe
+ formView.add(new SubmittableButton("Reset", new SubmittableButtonEvents() {
+ @Override
+ public void onProcess() throws DataNotFoundException, EmailException {
+ personneService.resetPasswordUtilisateur(utilisateurModel.getObject().getCourriel());
+ }
- @Override
- public void onSuccess() {
- successNextPage("Reset");
+ @Override
+ public void onSuccess() {
+ successNextPage("Reset");
- setResponsePage(getApplication().getHomePage());
- }
+ setResponsePage(getApplication().getHomePage());
+ }
- @Override
- public void onValidate() {
- addValidationErrors(validator.validate(utilisateurModel.getObject(), getSession().getLocale(),
- "courriel"));
- }
- }));
+ @Override
+ public void onValidate() {
+ addValidationErrors(validator.validate(utilisateurModel.getObject(), getSession().getLocale(),
+ "courriel"));
+ }
+ }));
- add(formView);
- }
+ add(formView);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/UpdateUtilisateurPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/UpdateUtilisateurPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/UpdateUtilisateurPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -54,166 +54,166 @@
@AuthRoles( { AuthRole.USER, AuthRole.ADMIN })
public final class UpdateUtilisateurPage extends TemplatePage {
- /** Action : delete */
- public static final String ACTION_DELETE = "Delete";
+ /** Action : delete */
+ public static final String ACTION_DELETE = "Delete";
- /** Action : update password */
- private static final String ACTION_UPDATE_PASSWORD = "UpdatePassword";
+ /** Action : update password */
+ private static final String ACTION_UPDATE_PASSWORD = "UpdatePassword";
- /** Action : update profile */
- private static final String ACTION_UPDATE_PROFILE = "UpdateProfile";
+ /** Action : update profile */
+ private static final String ACTION_UPDATE_PROFILE = "UpdateProfile";
- /** Service : personne */
- @SpringBean
- private PersonneService personneService;
+ /** Service : personne */
+ @SpringBean
+ private PersonneService personneService;
- /** Validateur modèle */
- @SpringBean(name = "webModelValidator")
- private ModelValidator validator;
+ /** Validateur modèle */
+ @SpringBean(name = "webModelValidator")
+ private ModelValidator validator;
- /**
- * Constructeur
- */
- public UpdateUtilisateurPage() {
- this(null);
- }
+ /**
+ * Constructeur
+ */
+ public UpdateUtilisateurPage() {
+ this(null);
+ }
- /**
- * Constructeur
- * @param callerPage Page appelante (pour redirection)
- */
- public UpdateUtilisateurPage(final CallerPage callerPage) {
- super(UpdateUtilisateurPage.class);
+ /**
+ * Constructeur
+ * @param callerPage Page appelante (pour redirection)
+ */
+ public UpdateUtilisateurPage(final CallerPage callerPage) {
+ super(UpdateUtilisateurPage.class);
- // Initialisation du modèle (pour le profil)
- final IModel<Utilisateur> utilisateurProfileModel = new Model<Utilisateur>(getSession().getUtilisateur());
+ // Initialisation du modèle (pour le profil)
+ final IModel<Utilisateur> utilisateurProfileModel = new Model<Utilisateur>(getSession().getUtilisateur());
- // Initialisation du modèle supplémentaire
- final IModel<UpdateUtilisateurModel> utilisateurPasswordModel = new Model<UpdateUtilisateurModel>(
- new UpdateUtilisateurModel());
+ // Initialisation du modèle supplémentaire
+ final IModel<UpdateUtilisateurModel> utilisateurPasswordModel = new Model<UpdateUtilisateurModel>(
+ new UpdateUtilisateurModel());
- // Formulaire de mise à jour du profil
- final Form<Utilisateur> formProfileView = new Form<Utilisateur>("FormProfile", utilisateurProfileModel);
+ // Formulaire de mise à jour du profil
+ final Form<Utilisateur> formProfileView = new Form<Utilisateur>("FormProfile", utilisateurProfileModel);
- final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel",
- utilisateurProfileModel);
- formProfileView.add(personnePanel);
+ final ManagePersonnePanel personnePanel = new ManagePersonnePanel("ManagePersonnePanel",
+ utilisateurProfileModel);
+ formProfileView.add(personnePanel);
- // Action : mise à jour du profil
- formProfileView.add(new SubmittableButton(ACTION_UPDATE_PROFILE, new SubmittableButtonEvents() {
- @Override
- public void onError() {
- utilisateurPasswordModel.getObject().setPassword(null);
- }
+ // Action : mise à jour du profil
+ formProfileView.add(new SubmittableButton(ACTION_UPDATE_PROFILE, new SubmittableButtonEvents() {
+ @Override
+ public void onError() {
+ utilisateurPasswordModel.getObject().setPassword(null);
+ }
- @Override
- public void onProcess() throws DataConstraintException {
- personneService.updateUtilisateur(utilisateurProfileModel.getObject(), false);
- getSession().update(utilisateurProfileModel.getObject());
- }
+ @Override
+ public void onProcess() throws DataConstraintException {
+ personneService.updateUtilisateur(utilisateurProfileModel.getObject(), false);
+ getSession().update(utilisateurProfileModel.getObject());
+ }
- @Override
- public void onSuccess() {
- if (callerPage == null) {
- successCurrentPage(ACTION_UPDATE_PROFILE);
- } else {
- successNextPage(ACTION_UPDATE_PROFILE);
- callerPage.responsePage((TemplatePage) getPage());
- }
- }
+ @Override
+ public void onSuccess() {
+ if (callerPage == null) {
+ successCurrentPage(ACTION_UPDATE_PROFILE);
+ } else {
+ successNextPage(ACTION_UPDATE_PROFILE);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ }
- @Override
- public void onValidate() {
- personnePanel.validate();
- }
- }));
+ @Override
+ public void onValidate() {
+ personnePanel.validate();
+ }
+ }));
- // Action : annulation
- Link<Void> cancelProfileLink = new Link<Void>("CancelProfile") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- };
- cancelProfileLink.setVisibilityAllowed(callerPage != null);
- formProfileView.add(cancelProfileLink);
- add(formProfileView);
+ // Action : annulation
+ Link<Void> cancelProfileLink = new Link<Void>("CancelProfile") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ };
+ cancelProfileLink.setVisibilityAllowed(callerPage != null);
+ formProfileView.add(cancelProfileLink);
+ add(formProfileView);
- // Formulaire de mise à jour du mot de passe
- final Form<UpdateUtilisateurModel> formPasswordView = new Form<UpdateUtilisateurModel>("FormPassword",
- utilisateurPasswordModel);
+ // Formulaire de mise à jour du mot de passe
+ final Form<UpdateUtilisateurModel> formPasswordView = new Form<UpdateUtilisateurModel>("FormPassword",
+ utilisateurPasswordModel);
- final Component currentPasswordView = new PasswordTextField("UpdateUtilisateurModel.currentPassword",
- new PropertyModel<String>(utilisateurPasswordModel, "currentPassword")).setRequired(false);
- formPasswordView.add(currentPasswordView);
- formPasswordView.add(new PasswordTextField("UpdateUtilisateurModel.newPassword", new PropertyModel<String>(
- utilisateurPasswordModel, "newPassword")).setRequired(false));
- final Component newPasswordConfirmationView = new PasswordTextField(
- "UpdateUtilisateurModel.newPasswordConfirmation", new PropertyModel<String>(utilisateurPasswordModel,
- "newPasswordConfirmation")).setRequired(false);
- formPasswordView.add(newPasswordConfirmationView);
+ final Component currentPasswordView = new PasswordTextField("UpdateUtilisateurModel.currentPassword",
+ new PropertyModel<String>(utilisateurPasswordModel, "currentPassword")).setRequired(false);
+ formPasswordView.add(currentPasswordView);
+ formPasswordView.add(new PasswordTextField("UpdateUtilisateurModel.newPassword", new PropertyModel<String>(
+ utilisateurPasswordModel, "newPassword")).setRequired(false));
+ final Component newPasswordConfirmationView = new PasswordTextField(
+ "UpdateUtilisateurModel.newPasswordConfirmation", new PropertyModel<String>(utilisateurPasswordModel,
+ "newPasswordConfirmation")).setRequired(false);
+ formPasswordView.add(newPasswordConfirmationView);
- // Action : mise à jour du mot de passe
- formPasswordView.add(new SubmittableButton(ACTION_UPDATE_PASSWORD, new SubmittableButtonEvents() {
- @Override
- public void onError() {
- utilisateurPasswordModel.getObject().setCurrentPassword(null);
- utilisateurPasswordModel.getObject().setNewPassword(null);
- utilisateurPasswordModel.getObject().setNewPasswordConfirmation(null);
- }
+ // Action : mise à jour du mot de passe
+ formPasswordView.add(new SubmittableButton(ACTION_UPDATE_PASSWORD, new SubmittableButtonEvents() {
+ @Override
+ public void onError() {
+ utilisateurPasswordModel.getObject().setCurrentPassword(null);
+ utilisateurPasswordModel.getObject().setNewPassword(null);
+ utilisateurPasswordModel.getObject().setNewPasswordConfirmation(null);
+ }
- @Override
- public void onProcess() throws DataConstraintException {
- utilisateurProfileModel.getObject().setPasswordHash(
- personneService.hashPassword(utilisateurPasswordModel.getObject().getNewPassword()));
- personneService.updateUtilisateur(utilisateurProfileModel.getObject(), false);
- getSession().update(utilisateurProfileModel.getObject());
- }
+ @Override
+ public void onProcess() throws DataConstraintException {
+ utilisateurProfileModel.getObject().setPasswordHash(
+ personneService.hashPassword(utilisateurPasswordModel.getObject().getNewPassword()));
+ personneService.updateUtilisateur(utilisateurProfileModel.getObject(), false);
+ getSession().update(utilisateurProfileModel.getObject());
+ }
- @Override
- public void onSuccess() {
- if (callerPage == null) {
- successCurrentPage(ACTION_UPDATE_PASSWORD);
- } else {
- successNextPage(ACTION_UPDATE_PASSWORD);
- callerPage.responsePage((TemplatePage) getPage());
- }
- }
+ @Override
+ public void onSuccess() {
+ if (callerPage == null) {
+ successCurrentPage(ACTION_UPDATE_PASSWORD);
+ } else {
+ successNextPage(ACTION_UPDATE_PASSWORD);
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ }
- @Override
- public void onValidate() {
- // Erreurs mot de passe courant
- List<String> passwordErrors = validator.validate(utilisateurPasswordModel.getObject(), getSession()
- .getLocale(), "currentPassword");
- addValidationErrors(passwordErrors);
- if (passwordErrors.isEmpty()
- && !utilisateurProfileModel.getObject().getPasswordHash()
- .equals(
- personneService.hashPassword(utilisateurPasswordModel.getObject()
- .getCurrentPassword()))) {
- errorCurrentPage(currentPasswordView);
- }
- // Erreurs nouveau mot de passe
- passwordErrors = validator.validate(utilisateurPasswordModel.getObject(), getSession().getLocale(),
- "newPassword");
- addValidationErrors(passwordErrors);
- if (passwordErrors.isEmpty() && !utilisateurPasswordModel.getObject().validate()) {
- errorCurrentPage(newPasswordConfirmationView);
- }
- }
+ @Override
+ public void onValidate() {
+ // Erreurs mot de passe courant
+ List<String> passwordErrors = validator.validate(utilisateurPasswordModel.getObject(), getSession()
+ .getLocale(), "currentPassword");
+ addValidationErrors(passwordErrors);
+ if (passwordErrors.isEmpty()
+ && !utilisateurProfileModel.getObject().getPasswordHash()
+ .equals(
+ personneService.hashPassword(utilisateurPasswordModel.getObject()
+ .getCurrentPassword()))) {
+ errorCurrentPage(currentPasswordView);
+ }
+ // Erreurs nouveau mot de passe
+ passwordErrors = validator.validate(utilisateurPasswordModel.getObject(), getSession().getLocale(),
+ "newPassword");
+ addValidationErrors(passwordErrors);
+ if (passwordErrors.isEmpty() && !utilisateurPasswordModel.getObject().validate()) {
+ errorCurrentPage(newPasswordConfirmationView);
+ }
+ }
- }));
+ }));
- // Action : annulation
- Link<Void> cancelPasswordLink = new Link<Void>("CancelPassword") {
- @Override
- public void onClick() {
- callerPage.responsePage((TemplatePage) getPage());
- }
- };
- cancelPasswordLink.setVisibilityAllowed(callerPage != null);
- formPasswordView.add(cancelPasswordLink);
+ // Action : annulation
+ Link<Void> cancelPasswordLink = new Link<Void>("CancelPassword") {
+ @Override
+ public void onClick() {
+ callerPage.responsePage((TemplatePage) getPage());
+ }
+ };
+ cancelPasswordLink.setVisibilityAllowed(callerPage != null);
+ formPasswordView.add(cancelPasswordLink);
- add(formPasswordView);
- }
+ add(formPasswordView);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/panels/ReadDroitsUtilisateurPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/panels/ReadDroitsUtilisateurPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/utilisateur/panels/ReadDroitsUtilisateurPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -56,101 +56,101 @@
*/
public final class ReadDroitsUtilisateurPanel extends Panel {
- /**
- * Constructeur
- * @param id Id du composant
- * @param utilisateurModel Modèle de l'utilisateur concerné
- */
- public ReadDroitsUtilisateurPanel(String id, final IModel<? extends Utilisateur> utilisateurModel) {
- super(id, utilisateurModel);
+ /**
+ * Constructeur
+ * @param id Id du composant
+ * @param utilisateurModel Modèle de l'utilisateur concerné
+ */
+ public ReadDroitsUtilisateurPanel(String id, final IModel<? extends Utilisateur> utilisateurModel) {
+ super(id, utilisateurModel);
- // Gestion des campagnes et lots autorisés
- final MarkupContainer autorisationsContainer = new WebMarkupContainer("Authorizations.Table") {
- @Override
- public boolean isVisible() {
- return utilisateurModel.getObject().getCampagnesDroits().size() != 0
- || utilisateurModel.getObject().getLotsDroits().size() != 0;
- }
- };
- autorisationsContainer.setOutputMarkupId(true);
+ // Gestion des campagnes et lots autorisés
+ final MarkupContainer autorisationsContainer = new WebMarkupContainer("Authorizations.Table") {
+ @Override
+ public boolean isVisible() {
+ return utilisateurModel.getObject().getCampagnesDroits().size() != 0
+ || utilisateurModel.getObject().getLotsDroits().size() != 0;
+ }
+ };
+ autorisationsContainer.setOutputMarkupId(true);
- final LoadableDetachableModel<List<CampagnePersonneDroits>> campagnesModel = new LoadableDetachableModel<List<CampagnePersonneDroits>>() {
- @Override
- protected List<CampagnePersonneDroits> load() {
- List<CampagnePersonneDroits> listCampagnesDroits = new ArrayList<CampagnePersonneDroits>(
- utilisateurModel.getObject().getCampagnesDroits().values());
+ final LoadableDetachableModel<List<CampagnePersonneDroits>> campagnesModel = new LoadableDetachableModel<List<CampagnePersonneDroits>>() {
+ @Override
+ protected List<CampagnePersonneDroits> load() {
+ List<CampagnePersonneDroits> listCampagnesDroits = new ArrayList<CampagnePersonneDroits>(
+ utilisateurModel.getObject().getCampagnesDroits().values());
- // tri pour affichage
- Collections.sort(listCampagnesDroits, new CampagnePersonneDroitsComp());
- return listCampagnesDroits;
- }
- };
+ // tri pour affichage
+ Collections.sort(listCampagnesDroits, new CampagnePersonneDroitsComp());
+ return listCampagnesDroits;
+ }
+ };
- // Liste des campagnes autorisées
- autorisationsContainer
- .add(new ListView<CampagnePersonneDroits>("Authorizations.Campagnes.List", campagnesModel) {
- @Override
- protected void populateItem(final ListItem<CampagnePersonneDroits> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des campagnes autorisées
+ autorisationsContainer
+ .add(new ListView<CampagnePersonneDroits>("Authorizations.Campagnes.List", campagnesModel) {
+ @Override
+ protected void populateItem(final ListItem<CampagnePersonneDroits> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- item.add(new PropertyLabelLinkPanel<Campagne>("Authorizations.Campagnes.Campagne.nom",
- new PropertyModel<Campagne>(item.getModel(), "id.pk1"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), new CallerPage(
- (TemplatePage) getPage())));
- }
- });
- }
- });
+ item.add(new PropertyLabelLinkPanel<Campagne>("Authorizations.Campagnes.Campagne.nom",
+ new PropertyModel<Campagne>(item.getModel(), "id.pk1"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), new CallerPage(
+ (TemplatePage) getPage())));
+ }
+ });
+ }
+ });
- // Liste des lots autorisés
- final LoadableDetachableModel<List<LotPersonneDroits>> lotsModel = new LoadableDetachableModel<List<LotPersonneDroits>>() {
- protected List<LotPersonneDroits> load() {
- List<LotPersonneDroits> listLotsDroits = new ArrayList<LotPersonneDroits>(utilisateurModel.getObject()
- .getLotsDroits().values());
- // tri pour affichage
- Collections.sort(listLotsDroits, new LotPersonneDroitsComp());
- return listLotsDroits;
- }
- };
- autorisationsContainer.add(new ListView<LotPersonneDroits>("Authorizations.Lots.List", lotsModel) {
- @Override
- protected void populateItem(ListItem<LotPersonneDroits> item) {
- if (item.getIndex() % 2 == 1) {
- item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
- }
+ // Liste des lots autorisés
+ final LoadableDetachableModel<List<LotPersonneDroits>> lotsModel = new LoadableDetachableModel<List<LotPersonneDroits>>() {
+ protected List<LotPersonneDroits> load() {
+ List<LotPersonneDroits> listLotsDroits = new ArrayList<LotPersonneDroits>(utilisateurModel.getObject()
+ .getLotsDroits().values());
+ // tri pour affichage
+ Collections.sort(listLotsDroits, new LotPersonneDroitsComp());
+ return listLotsDroits;
+ }
+ };
+ autorisationsContainer.add(new ListView<LotPersonneDroits>("Authorizations.Lots.List", lotsModel) {
+ @Override
+ protected void populateItem(ListItem<LotPersonneDroits> item) {
+ if (item.getIndex() % 2 == 1) {
+ item.add(new AttributeModifier("class", item.getIndex() % 2 == 0 ? "even" : "odd"));
+ }
- item.add(new PropertyLabelLinkPanel<Campagne>("Authorizations.Lots.Campagne.nom",
- new PropertyModel<Campagne>(item.getModel(), "id.pk1.campagne"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), new CallerPage(
- (TemplatePage) getPage())));
- }
- });
+ item.add(new PropertyLabelLinkPanel<Campagne>("Authorizations.Lots.Campagne.nom",
+ new PropertyModel<Campagne>(item.getModel(), "id.pk1.campagne"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadCampagnePage(getModelObject().getIdCampagne(), new CallerPage(
+ (TemplatePage) getPage())));
+ }
+ });
- item.add(new PropertyLabelLinkPanel<Lot>("Authorizations.Lots.Lot.ref", new PropertyModel<Lot>(item
- .getModel(), "id.pk1"), getString("Read")) {
- @Override
- public void onClick() {
- setResponsePage(new ReadLotPage(getModelObject().getIdLot(), new CallerPage(
- (TemplatePage) getPage())));
- }
- });
- }
- });
- add(autorisationsContainer);
+ item.add(new PropertyLabelLinkPanel<Lot>("Authorizations.Lots.Lot.ref", new PropertyModel<Lot>(item
+ .getModel(), "id.pk1"), getString("Read")) {
+ @Override
+ public void onClick() {
+ setResponsePage(new ReadLotPage(getModelObject().getIdLot(), new CallerPage(
+ (TemplatePage) getPage())));
+ }
+ });
+ }
+ });
+ add(autorisationsContainer);
- // Selon la non existence d'elements dans la table on affiche le span pour remplacer
- MarkupContainer emptyCampagnesContainer = new WebMarkupContainer("Authorizations.emptyTable") {
- @Override
- public boolean isVisible() {
- return !autorisationsContainer.isVisible();
- }
- };
- add(emptyCampagnesContainer);
- }
+ // Selon la non existence d'elements dans la table on affiche le span pour remplacer
+ MarkupContainer emptyCampagnesContainer = new WebMarkupContainer("Authorizations.emptyTable") {
+ @Override
+ public boolean isVisible() {
+ return !autorisationsContainer.isVisible();
+ }
+ };
+ add(emptyCampagnesContainer);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/AccessDeniedPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/AccessDeniedPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/AccessDeniedPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -27,5 +27,5 @@
* @author Mickael Tricot
*/
public final class AccessDeniedPage extends ErrorPage {
- //
+ //
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/ErrorPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/ErrorPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/ErrorPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,26 +32,26 @@
*/
public abstract class ErrorPage extends TemplatePage {
- /** Error message pattern: resource.classSimpleName */
- private static final String PATTERN_ERROR_MSG = "%s.%s";
+ /** Error message pattern: resource.classSimpleName */
+ private static final String PATTERN_ERROR_MSG = "%s.%s";
- /**
- * Constructor
- */
- public ErrorPage() {
- super(ErrorPage.class);
- String errorMsgKey = String.format(PATTERN_ERROR_MSG, getResource(), getClass().getSimpleName());
- try {
- errorMsgKey = getString(errorMsgKey);
- } catch (MissingResourceException e) {
- //
- }
- error(errorMsgKey);
- }
+ /**
+ * Constructor
+ */
+ public ErrorPage() {
+ super(ErrorPage.class);
+ String errorMsgKey = String.format(PATTERN_ERROR_MSG, getResource(), getClass().getSimpleName());
+ try {
+ errorMsgKey = getString(errorMsgKey);
+ } catch (MissingResourceException e) {
+ //
+ }
+ error(errorMsgKey);
+ }
- /** {@inheritDoc} */
- @Override
- public final boolean isErrorPage() {
- return true;
- }
+ /** {@inheritDoc} */
+ @Override
+ public final boolean isErrorPage() {
+ return true;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/InternalErrorPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/InternalErrorPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/InternalErrorPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -27,5 +27,5 @@
* @author Mickael Tricot
*/
public final class InternalErrorPage extends ErrorPage {
- //
+ //
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/PageExpiredErrorPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/PageExpiredErrorPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/errors/PageExpiredErrorPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -27,5 +27,5 @@
* @author Mickael Tricot
*/
public final class PageExpiredErrorPage extends ErrorPage {
- //
+ //
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/CaptchaModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/CaptchaModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/CaptchaModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,51 +33,51 @@
*/
public final class CaptchaModel implements Serializable {
- /** Texte captcha */
- @NotEmpty
- private String captchaText;
+ /** Texte captcha */
+ @NotEmpty
+ private String captchaText;
- /** Texte généré pour le captcha */
- private String captchaTextGenerated;
+ /** Texte généré pour le captcha */
+ private String captchaTextGenerated;
- /**
- * Validate the model
- * @return TRUE if it is valid
- */
- public boolean validate() {
- return !StringUtils.isEmpty(captchaText) && captchaTextGenerated.equals(captchaText);
- }
+ /**
+ * Validate the model
+ * @return TRUE if it is valid
+ */
+ public boolean validate() {
+ return !StringUtils.isEmpty(captchaText) && captchaTextGenerated.equals(captchaText);
+ }
- /**
- * captchaText getter
- * @return captchaText
- */
- public String getCaptchaText() {
- return captchaText;
- }
+ /**
+ * captchaText getter
+ * @return captchaText
+ */
+ public String getCaptchaText() {
+ return captchaText;
+ }
- /**
- * captchaText setter
- * @param captchaText captchaText
- */
- public void setCaptchaText(String captchaText) {
- this.captchaText = captchaText;
- }
+ /**
+ * captchaText setter
+ * @param captchaText captchaText
+ */
+ public void setCaptchaText(String captchaText) {
+ this.captchaText = captchaText;
+ }
- /**
- * captchaTextGenerated getter
- * @return captchaTextGenerated
- */
- public String getCaptchaTextGenerated() {
- return captchaTextGenerated;
- }
+ /**
+ * captchaTextGenerated getter
+ * @return captchaTextGenerated
+ */
+ public String getCaptchaTextGenerated() {
+ return captchaTextGenerated;
+ }
- /**
- * captchaTextGenerated setter
- * @param captchaTextGenerated captchaTextGenerated
- */
- public void setCaptchaTextGenerated(String captchaTextGenerated) {
- this.captchaTextGenerated = captchaTextGenerated;
- }
+ /**
+ * captchaTextGenerated setter
+ * @param captchaTextGenerated captchaTextGenerated
+ */
+ public void setCaptchaTextGenerated(String captchaTextGenerated) {
+ this.captchaTextGenerated = captchaTextGenerated;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ContactModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ContactModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ContactModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -33,64 +33,64 @@
*/
public class ContactModel implements Serializable {
- /** E-mail (from) */
- @NotEmpty
- @Email
- private String mail;
+ /** E-mail (from) */
+ @NotEmpty
+ @Email
+ private String mail;
- /** Message */
- @NotEmpty
- private String message;
+ /** Message */
+ @NotEmpty
+ private String message;
- /** Subject */
- @NotEmpty
- private String subject;
+ /** Subject */
+ @NotEmpty
+ private String subject;
- /**
- * mail getter
- * @return mail
- */
- public String getMail() {
- return mail;
- }
+ /**
+ * mail getter
+ * @return mail
+ */
+ public String getMail() {
+ return mail;
+ }
- /**
- * mail setter
- * @param mail mail
- */
- public void setMail(String mail) {
- this.mail = mail;
- }
+ /**
+ * mail setter
+ * @param mail mail
+ */
+ public void setMail(String mail) {
+ this.mail = mail;
+ }
- /**
- * message getter
- * @return message
- */
- public String getMessage() {
- return message;
- }
+ /**
+ * message getter
+ * @return message
+ */
+ public String getMessage() {
+ return message;
+ }
- /**
- * message setter
- * @param message message
- */
- public void setMessage(String message) {
- this.message = message;
- }
+ /**
+ * message setter
+ * @param message message
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
- /**
- * subject getter
- * @return subject
- */
- public String getSubject() {
- return subject;
- }
+ /**
+ * subject getter
+ * @return subject
+ */
+ public String getSubject() {
+ return subject;
+ }
- /**
- * subject setter
- * @param subject subject
- */
- public void setSubject(String subject) {
- this.subject = subject;
- }
+ /**
+ * subject setter
+ * @param subject subject
+ */
+ public void setSubject(String subject) {
+ this.subject = subject;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/LoginModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/LoginModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/LoginModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,44 +34,44 @@
*/
public final class LoginModel implements Serializable {
- /** Mot de passe */
- @NotEmpty
- private String password;
+ /** Mot de passe */
+ @NotEmpty
+ private String password;
- /** Se souvenir de moi */
- @NotNull
- private Boolean rememberMe;
+ /** Se souvenir de moi */
+ @NotNull
+ private Boolean rememberMe;
- /**
- * password getter
- * @return password
- */
- public String getPassword() {
- return password;
- }
+ /**
+ * password getter
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
- /**
- * password setter
- * @param password password
- */
- public void setPassword(String password) {
- this.password = password;
- }
+ /**
+ * password setter
+ * @param password password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
- /**
- * rememberMe getter
- * @return rememberMe
- */
- public Boolean getRememberMe() {
- return rememberMe;
- }
+ /**
+ * rememberMe getter
+ * @return rememberMe
+ */
+ public Boolean getRememberMe() {
+ return rememberMe;
+ }
- /**
- * rememberMe setter
- * @param rememberMe rememberMe
- */
- public void setRememberMe(Boolean rememberMe) {
- this.rememberMe = rememberMe;
- }
+ /**
+ * rememberMe setter
+ * @param rememberMe rememberMe
+ */
+ public void setRememberMe(Boolean rememberMe) {
+ this.rememberMe = rememberMe;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageCampagneModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageCampagneModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageCampagneModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,42 +32,42 @@
*/
public final class ManageCampagneModel implements Serializable {
- /** complement associé à la personne sélectionnée */
- private String complement;
+ /** complement associé à la personne sélectionnée */
+ private String complement;
- /** Personne sélectionnée */
- private Personne selectedPersonne;
+ /** Personne sélectionnée */
+ private Personne selectedPersonne;
- /**
- * complement getter
- * @return complement
- */
- public String getComplement() {
- return complement;
- }
+ /**
+ * complement getter
+ * @return complement
+ */
+ public String getComplement() {
+ return complement;
+ }
- /**
- * complement setter
- * @param complement complement
- */
- public void setComplement(String complement) {
- this.complement = complement;
- }
+ /**
+ * complement setter
+ * @param complement complement
+ */
+ public void setComplement(String complement) {
+ this.complement = complement;
+ }
- /**
- * selectedPersonne getter
- * @return selectedPersonne
- */
- public Personne getSelectedPersonne() {
- return selectedPersonne;
- }
+ /**
+ * selectedPersonne getter
+ * @return selectedPersonne
+ */
+ public Personne getSelectedPersonne() {
+ return selectedPersonne;
+ }
- /**
- * selectedPersonne setter
- * @param selectedPersonne selectedPersonne
- */
- public void setSelectedPersonne(Personne selectedPersonne) {
- this.selectedPersonne = selectedPersonne;
- }
+ /**
+ * selectedPersonne setter
+ * @param selectedPersonne selectedPersonne
+ */
+ public void setSelectedPersonne(Personne selectedPersonne) {
+ this.selectedPersonne = selectedPersonne;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageStationModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageStationModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageStationModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,126 +40,126 @@
*/
public final class ManageStationModel implements Serializable {
- /** Latitude : degrés */
- @Range(min = CoordTools.LATITUDE_MIN_DEGREES, max = CoordTools.LATITUDE_MAX_DEGREES)
- private Integer latitudeDegrees;
+ /** Latitude : degrés */
+ @Range(min = CoordTools.LATITUDE_MIN_DEGREES, max = CoordTools.LATITUDE_MAX_DEGREES)
+ private Integer latitudeDegrees;
- /** Latitude : minutes */
- @DecimalMin(CoordTools.LATITUDE_MIN_MINUTES_STRING)
- @DecimalMax(CoordTools.LATITUDE_MAX_MINUTES_STRING)
- private BigDecimal latitudeMinutes;
+ /** Latitude : minutes */
+ @DecimalMin(CoordTools.LATITUDE_MIN_MINUTES_STRING)
+ @DecimalMax(CoordTools.LATITUDE_MAX_MINUTES_STRING)
+ private BigDecimal latitudeMinutes;
- /** Latitude : orientation */
- @LatitudeOrientation
- private Character latitudeOrientation;
+ /** Latitude : orientation */
+ @LatitudeOrientation
+ private Character latitudeOrientation;
- /** Longitude : degrés */
- @Range(min = CoordTools.LONGITUDE_MIN_DEGREES, max = CoordTools.LONGITUDE_MAX_DEGREES)
- private Integer longitudeDegrees;
+ /** Longitude : degrés */
+ @Range(min = CoordTools.LONGITUDE_MIN_DEGREES, max = CoordTools.LONGITUDE_MAX_DEGREES)
+ private Integer longitudeDegrees;
- /** Longitude : minutes */
- @DecimalMin(CoordTools.LONGITUDE_MIN_MINUTES_STRING)
- @DecimalMax(CoordTools.LONGITUDE_MAX_MINUTES_STRING)
- private BigDecimal longitudeMinutes;
+ /** Longitude : minutes */
+ @DecimalMin(CoordTools.LONGITUDE_MIN_MINUTES_STRING)
+ @DecimalMax(CoordTools.LONGITUDE_MAX_MINUTES_STRING)
+ private BigDecimal longitudeMinutes;
- /** Longitude : orientation */
- @LongitudeOrientation
- private Character longitudeOrientation;
+ /** Longitude : orientation */
+ @LongitudeOrientation
+ private Character longitudeOrientation;
- /**
- * latitudeDegrees getter
- * @return latitudeDegrees
- */
- public Integer getLatitudeDegrees() {
- return latitudeDegrees;
- }
+ /**
+ * latitudeDegrees getter
+ * @return latitudeDegrees
+ */
+ public Integer getLatitudeDegrees() {
+ return latitudeDegrees;
+ }
- /**
- * latitudeDegrees setter
- * @param latitudeDegrees latitudeDegrees
- */
- public void setLatitudeDegrees(Integer latitudeDegrees) {
- this.latitudeDegrees = latitudeDegrees;
- }
+ /**
+ * latitudeDegrees setter
+ * @param latitudeDegrees latitudeDegrees
+ */
+ public void setLatitudeDegrees(Integer latitudeDegrees) {
+ this.latitudeDegrees = latitudeDegrees;
+ }
- /**
- * latitudeMinutes getter
- * @return latitudeMinutes
- */
- public BigDecimal getLatitudeMinutes() {
- return latitudeMinutes;
- }
+ /**
+ * latitudeMinutes getter
+ * @return latitudeMinutes
+ */
+ public BigDecimal getLatitudeMinutes() {
+ return latitudeMinutes;
+ }
- /**
- * latitudeMinutes setter
- * @param latitudeMinutes latitudeMinutes
- */
- public void setLatitudeMinutes(BigDecimal latitudeMinutes) {
- this.latitudeMinutes = latitudeMinutes;
- }
+ /**
+ * latitudeMinutes setter
+ * @param latitudeMinutes latitudeMinutes
+ */
+ public void setLatitudeMinutes(BigDecimal latitudeMinutes) {
+ this.latitudeMinutes = latitudeMinutes;
+ }
- /**
- * latitudeOrientation getter
- * @return latitudeOrientation
- */
- public Character getLatitudeOrientation() {
- return latitudeOrientation;
- }
+ /**
+ * latitudeOrientation getter
+ * @return latitudeOrientation
+ */
+ public Character getLatitudeOrientation() {
+ return latitudeOrientation;
+ }
- /**
- * latitudeOrientation setter
- * @param latitudeOrientation latitudeOrientation
- */
- public void setLatitudeOrientation(Character latitudeOrientation) {
- this.latitudeOrientation = latitudeOrientation;
- }
+ /**
+ * latitudeOrientation setter
+ * @param latitudeOrientation latitudeOrientation
+ */
+ public void setLatitudeOrientation(Character latitudeOrientation) {
+ this.latitudeOrientation = latitudeOrientation;
+ }
- /**
- * longitudeDegrees getter
- * @return longitudeDegrees
- */
- public Integer getLongitudeDegrees() {
- return longitudeDegrees;
- }
+ /**
+ * longitudeDegrees getter
+ * @return longitudeDegrees
+ */
+ public Integer getLongitudeDegrees() {
+ return longitudeDegrees;
+ }
- /**
- * longitudeDegrees setter
- * @param longitudeDegrees longitudeDegrees
- */
- public void setLongitudeDegrees(Integer longitudeDegrees) {
- this.longitudeDegrees = longitudeDegrees;
- }
+ /**
+ * longitudeDegrees setter
+ * @param longitudeDegrees longitudeDegrees
+ */
+ public void setLongitudeDegrees(Integer longitudeDegrees) {
+ this.longitudeDegrees = longitudeDegrees;
+ }
- /**
- * longitudeMinutes getter
- * @return longitudeMinutes
- */
- public BigDecimal getLongitudeMinutes() {
- return longitudeMinutes;
- }
+ /**
+ * longitudeMinutes getter
+ * @return longitudeMinutes
+ */
+ public BigDecimal getLongitudeMinutes() {
+ return longitudeMinutes;
+ }
- /**
- * longitudeMinutes setter
- * @param longitudeMinutes longitudeMinutes
- */
- public void setLongitudeMinutes(BigDecimal longitudeMinutes) {
- this.longitudeMinutes = longitudeMinutes;
- }
+ /**
+ * longitudeMinutes setter
+ * @param longitudeMinutes longitudeMinutes
+ */
+ public void setLongitudeMinutes(BigDecimal longitudeMinutes) {
+ this.longitudeMinutes = longitudeMinutes;
+ }
- /**
- * longitudeOrientation getter
- * @return longitudeOrientation
- */
- public Character getLongitudeOrientation() {
- return longitudeOrientation;
- }
+ /**
+ * longitudeOrientation getter
+ * @return longitudeOrientation
+ */
+ public Character getLongitudeOrientation() {
+ return longitudeOrientation;
+ }
- /**
- * longitudeOrientation setter
- * @param longitudeOrientation longitudeOrientation
- */
- public void setLongitudeOrientation(Character longitudeOrientation) {
- this.longitudeOrientation = longitudeOrientation;
- }
+ /**
+ * longitudeOrientation setter
+ * @param longitudeOrientation longitudeOrientation
+ */
+ public void setLongitudeOrientation(Character longitudeOrientation) {
+ this.longitudeOrientation = longitudeOrientation;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageUtilisateurModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageUtilisateurModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/ManageUtilisateurModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -38,64 +38,64 @@
*/
public final class ManageUtilisateurModel implements Serializable {
- /** Campagnes pour lesquelles l'utilisateur a des droits */
- private final List<Campagne> campagnes = new ArrayList<Campagne>();
+ /** Campagnes pour lesquelles l'utilisateur a des droits */
+ private final List<Campagne> campagnes = new ArrayList<Campagne>();
- /** Droits sur les campagnes pour l'utilisateur */
- private Map<Campagne, CampagnePersonneDroits> campagnesDroits;
+ /** Droits sur les campagnes pour l'utilisateur */
+ private Map<Campagne, CampagnePersonneDroits> campagnesDroits;
- /** Lots pour lesquels l'utilisateur a des droits */
- private final List<Lot> lots = new ArrayList<Lot>();
+ /** Lots pour lesquels l'utilisateur a des droits */
+ private final List<Lot> lots = new ArrayList<Lot>();
- /** Droits sur les lots pour l'utilisateur */
- private Map<Lot, LotPersonneDroits> lotsDroits;
+ /** Droits sur les lots pour l'utilisateur */
+ private Map<Lot, LotPersonneDroits> lotsDroits;
- /**
- * campagnesDroits getter
- * @return campagnesDroits
- */
- public Map<Campagne, CampagnePersonneDroits> getCampagnesDroits() {
- return campagnesDroits;
- }
+ /**
+ * campagnesDroits getter
+ * @return campagnesDroits
+ */
+ public Map<Campagne, CampagnePersonneDroits> getCampagnesDroits() {
+ return campagnesDroits;
+ }
- /**
- * campagnesDroits setter
- * @param campagnesDroits campagnesDroits
- */
- public void setCampagnesDroits(Map<Campagne, CampagnePersonneDroits> campagnesDroits) {
- this.campagnesDroits = campagnesDroits;
- }
+ /**
+ * campagnesDroits setter
+ * @param campagnesDroits campagnesDroits
+ */
+ public void setCampagnesDroits(Map<Campagne, CampagnePersonneDroits> campagnesDroits) {
+ this.campagnesDroits = campagnesDroits;
+ }
- /**
- * lotsDroits getter
- * @return lotsDroits
- */
- public Map<Lot, LotPersonneDroits> getLotsDroits() {
- return lotsDroits;
- }
+ /**
+ * lotsDroits getter
+ * @return lotsDroits
+ */
+ public Map<Lot, LotPersonneDroits> getLotsDroits() {
+ return lotsDroits;
+ }
- /**
- * lotsDroits setter
- * @param lotsDroits lotsDroits
- */
- public void setLotsDroits(Map<Lot, LotPersonneDroits> lotsDroits) {
- this.lotsDroits = lotsDroits;
- }
+ /**
+ * lotsDroits setter
+ * @param lotsDroits lotsDroits
+ */
+ public void setLotsDroits(Map<Lot, LotPersonneDroits> lotsDroits) {
+ this.lotsDroits = lotsDroits;
+ }
- /**
- * campagnes getter
- * @return campagnes
- */
- public List<Campagne> getCampagnes() {
- return campagnes;
- }
+ /**
+ * campagnes getter
+ * @return campagnes
+ */
+ public List<Campagne> getCampagnes() {
+ return campagnes;
+ }
- /**
- * lots getter
- * @return lots
- */
- public List<Lot> getLots() {
- return lots;
- }
+ /**
+ * lots getter
+ * @return lots
+ */
+ public List<Lot> getLots() {
+ return lots;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/RegisterModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/RegisterModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/RegisterModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,52 +35,52 @@
* @author Mickael Tricot
*/
public final class RegisterModel implements Serializable {
- /** Mot de passe */
- @Length(min = PasswordTools.PASSWORD_LENGTH_MIN, max = PasswordTools.PASSWORD_LENGTH_MAX)
- @NotNull
- private String password;
+ /** Mot de passe */
+ @Length(min = PasswordTools.PASSWORD_LENGTH_MIN, max = PasswordTools.PASSWORD_LENGTH_MAX)
+ @NotNull
+ private String password;
- /** Confirmation supplémentaire */
- private String passwordConfirmation;
+ /** Confirmation supplémentaire */
+ private String passwordConfirmation;
- /**
- * Validate the model
- * @return TRUE if it is valid
- */
- public boolean validate() {
- return password.equals(passwordConfirmation);
- }
+ /**
+ * Validate the model
+ * @return TRUE if it is valid
+ */
+ public boolean validate() {
+ return password.equals(passwordConfirmation);
+ }
- /**
- * password getter
- * @return password
- */
- public String getPassword() {
- return password;
- }
+ /**
+ * password getter
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
- /**
- * password setter
- * @param password password
- */
- public void setPassword(String password) {
- this.password = password;
- }
+ /**
+ * password setter
+ * @param password password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
- /**
- * passwordConfirmation getter
- * @return passwordConfirmation
- */
- public String getPasswordConfirmation() {
- return passwordConfirmation;
- }
+ /**
+ * passwordConfirmation getter
+ * @return passwordConfirmation
+ */
+ public String getPasswordConfirmation() {
+ return passwordConfirmation;
+ }
- /**
- * passwordConfirmation setter
- * @param passwordConfirmation passwordConfirmation
- */
- public void setPasswordConfirmation(String passwordConfirmation) {
- this.passwordConfirmation = passwordConfirmation;
- }
+ /**
+ * passwordConfirmation setter
+ * @param passwordConfirmation passwordConfirmation
+ */
+ public void setPasswordConfirmation(String passwordConfirmation) {
+ this.passwordConfirmation = passwordConfirmation;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/UpdateUtilisateurModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/UpdateUtilisateurModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/model/UpdateUtilisateurModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,92 +37,92 @@
*/
public final class UpdateUtilisateurModel implements Serializable {
- /** Mot de passe courant */
- @NotEmpty
- private String currentPassword;
+ /** Mot de passe courant */
+ @NotEmpty
+ private String currentPassword;
- /** Nouveau mot de passe */
- @Length(min = PasswordTools.PASSWORD_LENGTH_MIN, max = PasswordTools.PASSWORD_LENGTH_MAX)
- @NotNull
- private String newPassword;
+ /** Nouveau mot de passe */
+ @Length(min = PasswordTools.PASSWORD_LENGTH_MIN, max = PasswordTools.PASSWORD_LENGTH_MAX)
+ @NotNull
+ private String newPassword;
- /** Confirmation du nouveau mot de passe */
- private String newPasswordConfirmation;
+ /** Confirmation du nouveau mot de passe */
+ private String newPasswordConfirmation;
- /** Mot de passe */
- @NotEmpty
- private String password;
+ /** Mot de passe */
+ @NotEmpty
+ private String password;
- /**
- * Validate the model
- * @return TRUE if it is valid
- */
- public boolean validate() {
- return newPassword.equals(newPasswordConfirmation);
- }
+ /**
+ * Validate the model
+ * @return TRUE if it is valid
+ */
+ public boolean validate() {
+ return newPassword.equals(newPasswordConfirmation);
+ }
- /**
- * currentPassword getter
- * @return currentPassword
- */
- public String getCurrentPassword() {
- return currentPassword;
- }
+ /**
+ * currentPassword getter
+ * @return currentPassword
+ */
+ public String getCurrentPassword() {
+ return currentPassword;
+ }
- /**
- * currentPassword setter
- * @param currentPassword currentPassword
- */
- public void setCurrentPassword(String currentPassword) {
- this.currentPassword = currentPassword;
- }
+ /**
+ * currentPassword setter
+ * @param currentPassword currentPassword
+ */
+ public void setCurrentPassword(String currentPassword) {
+ this.currentPassword = currentPassword;
+ }
- /**
- * newPassword getter
- * @return newPassword
- */
- public String getNewPassword() {
- return newPassword;
- }
+ /**
+ * newPassword getter
+ * @return newPassword
+ */
+ public String getNewPassword() {
+ return newPassword;
+ }
- /**
- * newPassword setter
- * @param newPassword newPassword
- */
- public void setNewPassword(String newPassword) {
- this.newPassword = newPassword;
- }
+ /**
+ * newPassword setter
+ * @param newPassword newPassword
+ */
+ public void setNewPassword(String newPassword) {
+ this.newPassword = newPassword;
+ }
- /**
- * newPasswordConfirmation getter
- * @return newPasswordConfirmation
- */
- public String getNewPasswordConfirmation() {
- return newPasswordConfirmation;
- }
+ /**
+ * newPasswordConfirmation getter
+ * @return newPasswordConfirmation
+ */
+ public String getNewPasswordConfirmation() {
+ return newPasswordConfirmation;
+ }
- /**
- * newPasswordConfirmation setter
- * @param newPasswordConfirmation newPasswordConfirmation
- */
- public void setNewPasswordConfirmation(String newPasswordConfirmation) {
- this.newPasswordConfirmation = newPasswordConfirmation;
- }
+ /**
+ * newPasswordConfirmation setter
+ * @param newPasswordConfirmation newPasswordConfirmation
+ */
+ public void setNewPasswordConfirmation(String newPasswordConfirmation) {
+ this.newPasswordConfirmation = newPasswordConfirmation;
+ }
- /**
- * password getter
- * @return password
- */
- public String getPassword() {
- return password;
- }
+ /**
+ * password getter
+ * @return password
+ */
+ public String getPassword() {
+ return password;
+ }
- /**
- * password setter
- * @param password password
- */
- public void setPassword(String password) {
- this.password = password;
- }
+ /**
+ * password setter
+ * @param password password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/PersonneRenderer.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/PersonneRenderer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/PersonneRenderer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,9 +32,9 @@
*/
public class PersonneRenderer extends ChoiceRenderer<Personne> {
- /** {@inheritDoc} */
- @Override
- public Object getDisplayValue(final Personne personne) {
- return personne.getNom() + " " + personne.getPrenom();
- }
+ /** {@inheritDoc} */
+ @Override
+ public Object getDisplayValue(final Personne personne) {
+ return personne.getNom() + " " + personne.getPrenom();
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/ProduitRenderer.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/ProduitRenderer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/renderers/ProduitRenderer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,9 +32,9 @@
*/
public class ProduitRenderer extends ChoiceRenderer<Produit> {
- /** {@inheritDoc} */
- @Override
- public Object getDisplayValue(final Produit produit) {
- return produit.getRef();
- }
+ /** {@inheritDoc} */
+ @Override
+ public Object getDisplayValue(final Produit produit) {
+ return produit.getRef();
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/CallerPage.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/CallerPage.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/CallerPage.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,52 +34,52 @@
*/
public final class CallerPage implements Serializable {
- /** Page class */
- private final Class<? extends TemplatePage> classPage;
+ /** Page class */
+ private final Class<? extends TemplatePage> classPage;
- /** Page instance */
- private final TemplatePage instancePage;
+ /** Page instance */
+ private final TemplatePage instancePage;
- /**
- * Constructor
- * @param page Page class
- */
- public CallerPage(Class<? extends TemplatePage> page) {
- AssertTools.assertNotNull(page);
- classPage = page;
- instancePage = null;
- }
+ /**
+ * Constructor
+ * @param page Page class
+ */
+ public CallerPage(Class<? extends TemplatePage> page) {
+ AssertTools.assertNotNull(page);
+ classPage = page;
+ instancePage = null;
+ }
- /**
- * Constructor
- * @param page Page instance
- */
- public CallerPage(TemplatePage page) {
- AssertTools.assertNotNull(page);
- classPage = null;
- instancePage = page;
- }
+ /**
+ * Constructor
+ * @param page Page instance
+ */
+ public CallerPage(TemplatePage page) {
+ AssertTools.assertNotNull(page);
+ classPage = null;
+ instancePage = page;
+ }
- /**
- * Add a page parameter (only for instance pages)
- * @param key Key
- * @param value Value
- */
- public void addPageParameter(String key, Object value) {
- if (instancePage != null) {
- instancePage.getPageParameters().add(key, value);
- }
- }
+ /**
+ * Add a page parameter (only for instance pages)
+ * @param key Key
+ * @param value Value
+ */
+ public void addPageParameter(String key, Object value) {
+ if (instancePage != null) {
+ instancePage.getPageParameters().add(key, value);
+ }
+ }
- /**
- * Set the response page for the current page
- * @param currentPage Current page
- */
- public void responsePage(TemplatePage currentPage) {
- if (classPage != null) {
- currentPage.setResponsePage(classPage);
- } else {
- currentPage.setResponsePage(instancePage);
- }
- }
+ /**
+ * Set the response page for the current page
+ * @param currentPage Current page
+ */
+ public void responsePage(TemplatePage currentPage) {
+ if (classPage != null) {
+ currentPage.setResponsePage(classPage);
+ } else {
+ currentPage.setResponsePage(instancePage);
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/JSConfirmationBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/JSConfirmationBehavior.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/JSConfirmationBehavior.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,30 +37,30 @@
*/
public final class JSConfirmationBehavior extends Behavior {
- /** JS event */
- private static final String JS_EVENT = "onclick";
+ /** JS event */
+ private static final String JS_EVENT = "onclick";
- /** JS script template */
- private static final String JS_SCRIPT_TEMPLATE = "return confirm(\"%s\");";
+ /** JS script template */
+ private static final String JS_SCRIPT_TEMPLATE = "return confirm(\"%s\");";
- /** JS script */
- private final String jsScript;
+ /** JS script */
+ private final String jsScript;
- /**
- * Constructor
- * @param message Confirmation message
- */
- public JSConfirmationBehavior(String message) {
- AssertTools.assertNotEmpty(message);
- jsScript = String.format(JS_SCRIPT_TEMPLATE, message);
- }
+ /**
+ * Constructor
+ * @param message Confirmation message
+ */
+ public JSConfirmationBehavior(String message) {
+ AssertTools.assertNotEmpty(message);
+ jsScript = String.format(JS_SCRIPT_TEMPLATE, message);
+ }
- /** {@inheritDoc} */
- @Override
- public void onComponentTag(Component component, ComponentTag tag) {
- if (component instanceof Button || component instanceof Link<?>) {
- tag.getAttributes().remove(JS_EVENT);
- tag.getAttributes().put(JS_EVENT, jsScript);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void onComponentTag(Component component, ComponentTag tag) {
+ if (component instanceof Button || component instanceof Link<?>) {
+ tag.getAttributes().remove(JS_EVENT);
+ tag.getAttributes().put(JS_EVENT, jsScript);
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/ReplaceEmptyLabelBehavior.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/ReplaceEmptyLabelBehavior.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/ReplaceEmptyLabelBehavior.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -31,16 +31,16 @@
*/
public class ReplaceEmptyLabelBehavior extends Behavior {
- /** Regular expression to display */
- public static final String NULL_PROPERTY = " - ";
+ /** Regular expression to display */
+ public static final String NULL_PROPERTY = " - ";
- /** {@inheritDoc} */
- @Override
- public void beforeRender(Component component) {
- super.bind(component);
- if (component.getDefaultModelObject() == null) {
- component.getResponse().write(NULL_PROPERTY);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public void beforeRender(Component component) {
+ super.bind(component);
+ if (component.getDefaultModelObject() == null) {
+ component.getResponse().write(NULL_PROPERTY);
+ }
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/BooleanPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,34 +39,34 @@
*/
public class BooleanPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** page used to get messages */
- private final TemplatePage page;
+ /** page used to get messages */
+ private final TemplatePage page;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param page Page used to get True, False message
- */
- public BooleanPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- TemplatePage page) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param page Page used to get True, False message
+ */
+ public BooleanPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ TemplatePage page) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.page = page;
+ }
- /** {@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)));
- }
+ /** {@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)));
+ }
- @Override
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/DecimalPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,39 +41,39 @@
*/
public class DecimalPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** locale property */
- private final Locale locale;
+ /** locale property */
+ private final Locale locale;
- /** format to display **/
- private DecimalDisplFormat format;
+ /** format to display **/
+ private DecimalDisplFormat format;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param format format to display
- * @param locale Locale used to format decimal
- */
- public DecimalPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- DecimalDisplFormat format, Locale locale) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.format = format;
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param format format to display
+ * @param locale Locale used to format decimal
+ */
+ public DecimalPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ DecimalDisplFormat format, Locale locale) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.format = format;
+ this.locale = locale;
+ }
- /** {@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)));
- }
-
- @Override
+ /** {@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)));
+ }
+
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/EnumPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,34 +39,34 @@
*/
public class EnumPropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** locale property */
- private final TemplatePage page;
+ /** locale property */
+ private final TemplatePage page;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param page Page used to get enum messages
- */
- public EnumPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- TemplatePage page) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param page Page used to get enum messages
+ */
+ public EnumPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ TemplatePage page) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.page = page;
+ }
- /** {@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)));
- }
+ /** {@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)));
+ }
- @Override
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,138 +41,138 @@
*/
abstract public class LinkPropertyColumn<T> extends PropertyColumn<T> implements ExportableColumn<T>{
- /** Popup settings */
- private PopupSettings popupSettings;
+ /** Popup settings */
+ private PopupSettings popupSettings;
- /** Label model */
- private IModel<String> labelModel;
+ /** Label model */
+ private IModel<String> labelModel;
- /** Title displayed for the link */
- protected String linkTitle;
+ /** Title displayed for the link */
+ protected String linkTitle;
- /**
- * Constructor
- * @param displayModel Display model
- * @param sortProperty Sort property
- * @param propertyExpression Property expression
- * @param popupSettings Popup setting
- */
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- PopupSettings popupSettings) {
- this(displayModel, sortProperty, propertyExpression);
- this.popupSettings = popupSettings;
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param sortProperty Sort property
+ * @param propertyExpression Property expression
+ * @param popupSettings Popup setting
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ PopupSettings popupSettings) {
+ this(displayModel, sortProperty, propertyExpression);
+ this.popupSettings = popupSettings;
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param sortProperty Sort property
- * @param propertyExpression Property expression
- * @param linkTitle Title displayed for the link
- */
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- String linkTitle) {
- this(displayModel, sortProperty, propertyExpression);
- this.linkTitle = linkTitle;
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param sortProperty Sort property
+ * @param propertyExpression Property expression
+ * @param linkTitle Title displayed for the link
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ String linkTitle) {
+ this(displayModel, sortProperty, propertyExpression);
+ this.linkTitle = linkTitle;
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param sortProperty Sort property
- * @param propertyExpression Property expression
- * @param linkTitle Title displayed for the link
- * @param popupSettings Popup setting
- */
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- String linkTitle, PopupSettings popupSettings) {
- this(displayModel, sortProperty, propertyExpression);
- this.linkTitle = linkTitle;
- this.popupSettings = popupSettings;
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param sortProperty Sort property
+ * @param propertyExpression Property expression
+ * @param linkTitle Title displayed for the link
+ * @param popupSettings Popup setting
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ String linkTitle, PopupSettings popupSettings) {
+ this(displayModel, sortProperty, propertyExpression);
+ this.linkTitle = linkTitle;
+ this.popupSettings = popupSettings;
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param labelModel Label model
- */
- public LinkPropertyColumn(IModel<String> displayModel, IModel<String> labelModel) {
- super(displayModel, null);
- this.labelModel = labelModel;
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param labelModel Label model
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, IModel<String> labelModel) {
+ super(displayModel, null);
+ this.labelModel = labelModel;
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param sortProperty Sort property
- * @param propertyExpression Property expression
- */
- public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
- super(displayModel, sortProperty, propertyExpression);
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param sortProperty Sort property
+ * @param propertyExpression Property expression
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression) {
+ super(displayModel, sortProperty, propertyExpression);
+ }
- /**
- * Constructor
- * @param displayModel Display model
- * @param propertyExpression Property expression
- */
- public LinkPropertyColumn(IModel<String> displayModel, String propertyExpression) {
- super(displayModel, propertyExpression);
- }
+ /**
+ * Constructor
+ * @param displayModel Display model
+ * @param propertyExpression Property expression
+ */
+ public LinkPropertyColumn(IModel<String> displayModel, String propertyExpression) {
+ super(displayModel, propertyExpression);
+ }
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
- item.add(new LinkPanel(item, componentId, model));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
+ item.add(new LinkPanel(item, componentId, model));
+ }
- /**
- * 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 onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model);
+ /**
+ * 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 onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model);
- /**
- * Panel which include a link. Used with the LinkPropertyColumn$LinkPanel.html file
- */
- public class LinkPanel extends Panel {
+ /**
+ * Panel which include a link. Used with the LinkPropertyColumn$LinkPanel.html file
+ */
+ public class LinkPanel extends Panel {
- /**
- * Constructor
- * @param item Item
- * @param componentId Component id
- * @param model Model
- */
- public LinkPanel(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> model) {
- super(componentId);
+ /**
+ * Constructor
+ * @param item Item
+ * @param componentId Component id
+ * @param model Model
+ */
+ public LinkPanel(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> model) {
+ super(componentId);
- Link<T> link = new Link<T>("link") {
+ Link<T> link = new Link<T>("link") {
- @Override
- public void onClick() {
- LinkPropertyColumn.this.onClick(item, componentId, model);
- }
- };
- link.setPopupSettings(popupSettings);
- if (linkTitle != null) {
- link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
- }
+ @Override
+ public void onClick() {
+ LinkPropertyColumn.this.onClick(item, componentId, model);
+ }
+ };
+ link.setPopupSettings(popupSettings);
+ if (linkTitle != null) {
+ link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
+ }
- add(link);
+ add(link);
- IModel<?> tmpLabelModel = labelModel;
+ IModel<?> tmpLabelModel = labelModel;
- if (labelModel == null) {
- tmpLabelModel = createLabelModel(model);
- }
+ if (labelModel == null) {
+ tmpLabelModel = createLabelModel(model);
+ }
- link.add(new Label("label", tmpLabelModel));
- }
- }
-
- @Override
+ link.add(new Label("label", tmpLabelModel));
+ }
+ }
+
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/LinkableImagePropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,73 +39,73 @@
*/
abstract public class LinkableImagePropertyColumn<T> extends AbstractColumn<T> {
- /** Relative url for the image */
- private String imageSrc;
+ /** Relative url for the image */
+ private String imageSrc;
- /** Title displayed for the link */
- private String linkTitle;
+ /** Title displayed for the link */
+ private String linkTitle;
- /** Alternative message displayed when image can't be rendered */
- private String altMessage;
+ /** Alternative message displayed when image can't be rendered */
+ private String altMessage;
- /**
- * 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 LinkableImagePropertyColumn(String imageSrc, String linkTitle, String altMessage) {
- super(new Model<String>());
- this.imageSrc = imageSrc;
- this.linkTitle = linkTitle;
- this.altMessage = altMessage;
- }
+ /**
+ * 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 LinkableImagePropertyColumn(String imageSrc, String linkTitle, String altMessage) {
+ super(new Model<String>());
+ this.imageSrc = imageSrc;
+ this.linkTitle = linkTitle;
+ this.altMessage = altMessage;
+ }
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
- item.add(new LinkableImagePanel(item, componentId, model));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
+ item.add(new LinkableImagePanel(item, componentId, model));
+ }
- /**
- * 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 onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model);
+ /**
+ * 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 onClick(Item<ICellPopulator<T>> item, String componentId, IModel<T> model);
- /**
- * Panel which include a linkable image. Used with the LinkableImagePropertyColumn$LinkablePanel.html file
- */
- public class LinkableImagePanel extends Panel {
+ /**
+ * Panel which include a linkable image. Used with the LinkableImagePropertyColumn$LinkablePanel.html file
+ */
+ public class LinkableImagePanel extends Panel {
- /**
- * Constructor
- * @param item Item
- * @param componentId Component id
- * @param model Model
- */
- public LinkableImagePanel(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> model) {
- super(componentId);
+ /**
+ * Constructor
+ * @param item Item
+ * @param componentId Component id
+ * @param model Model
+ */
+ public LinkableImagePanel(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> model) {
+ super(componentId);
- Link<T> link = new Link<T>("link") {
+ Link<T> link = new Link<T>("link") {
- @Override
- public void onClick() {
- LinkableImagePropertyColumn.this.onClick(item, componentId, model);
- }
- };
- if (linkTitle != null) {
- link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
- }
- ContextImage image = new ContextImage("image", new Model<String>(imageSrc));
- if (altMessage != null) {
- image.add(new AttributeModifier("alt", new Model<String>(altMessage)));
- }
- link.add(image);
+ @Override
+ public void onClick() {
+ LinkableImagePropertyColumn.this.onClick(item, componentId, model);
+ }
+ };
+ if (linkTitle != null) {
+ link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
+ }
+ ContextImage image = new ContextImage("image", new Model<String>(imageSrc));
+ if (altMessage != null) {
+ image.add(new AttributeModifier("alt", new Model<String>(altMessage)));
+ }
+ link.add(image);
- add(link);
- }
- }
+ add(link);
+ }
+ }
}
\ 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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/MapValuePropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,32 +41,32 @@
*/
public class MapValuePropertyColumn<T, U> extends AbstractColumn<T> implements ExportableColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** map */
- private final Map<U, String> map;
+ /** map */
+ private final Map<U, String> map;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param map Applying map
- */
- public MapValuePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- Map<U, String> map) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.map = map;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param map Applying map
+ */
+ public MapValuePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ Map<U, String> map) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.map = map;
+ }
- /** {@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)));
- }
+ /** {@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)));
+ }
@Override
public String getHeaderName() {
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/PercentPropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,31 +39,31 @@
*/
public class PercentPropertyColumn<T> extends AbstractColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** locale property */
- private final Locale locale;
+ /** locale property */
+ private final Locale locale;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param locale Locale used to format decimal
- */
- public PercentPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- Locale locale) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param locale Locale used to format decimal
+ */
+ public PercentPropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ Locale locale) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.locale = locale;
+ }
- /** {@inheritDoc} */
- @Override
- public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
- cellItem.add(new Label(componentId, new DisplayPercentPropertyModel(rowModel.getObject(), propertyExpression,
- locale)));
- }
+ /** {@inheritDoc} */
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) {
+ cellItem.add(new Label(componentId, new DisplayPercentPropertyModel(rowModel.getObject(), propertyExpression,
+ locale)));
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/columns/ShortDatePropertyColumn.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -40,34 +40,34 @@
*/
public class ShortDatePropertyColumn<T> extends AbstractColumn<T> implements ExportableColumn<T> {
- /** wicket property expression */
- private final String propertyExpression;
+ /** wicket property expression */
+ private final String propertyExpression;
- /** locale property */
- private final Locale locale;
+ /** locale property */
+ private final Locale locale;
- /**
- * Constructor
- * @param displayModel DisplayModel
- * @param sortProperty SortProperty
- * @param propertyExpression Wicket property expression
- * @param locale Locale used to format decimal
- */
- public ShortDatePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
- Locale locale) {
- super(displayModel, sortProperty);
- this.propertyExpression = propertyExpression;
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param displayModel DisplayModel
+ * @param sortProperty SortProperty
+ * @param propertyExpression Wicket property expression
+ * @param locale Locale used to format decimal
+ */
+ public ShortDatePropertyColumn(IModel<String> displayModel, String sortProperty, String propertyExpression,
+ Locale locale) {
+ super(displayModel, sortProperty);
+ this.propertyExpression = propertyExpression;
+ this.locale = locale;
+ }
- /** {@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)));
- }
-
- @Override
+ /** {@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)));
+ }
+
+ @Override
public String getHeaderName() {
return getDisplayModel().getObject().toString();
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/BigDecimalConverterImpl.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/BigDecimalConverterImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/BigDecimalConverterImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,48 +41,48 @@
*/
public final class BigDecimalConverterImpl extends AbstractDecimalConverter<BigDecimal> {
- /** The minimum number of digits printed for the fraction portion of decimals **/
- public static final int DECIMAL_MIN_FRACTION_DIGIT = 0;
+ /** The minimum number of digits printed for the fraction portion of decimals **/
+ public static final int DECIMAL_MIN_FRACTION_DIGIT = 0;
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** The singleton instance for a big integer converter */
- public static final IConverter<BigDecimal> INSTANCE = new BigDecimalConverterImpl();
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** The singleton instance for a big integer converter */
+ public static final IConverter<BigDecimal> INSTANCE = new BigDecimalConverterImpl();
- /** {@inheritDoc} */
- @Override
- public BigDecimal convertToObject(String value, Locale locale) {
- if (value == null || value.trim().equals("")) {
- return null;
- }
+ /** {@inheritDoc} */
+ @Override
+ public BigDecimal convertToObject(String value, Locale locale) {
+ if (value == null || value.trim().equals("")) {
+ return null;
+ }
- if (locale == null) {
- locale = Locale.getDefault();
- }
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
- try {
- return NumberTools.parseBigDecimal(value, locale, DataContext.DECIMAL_SCALE, DataContext.DECIMAL_PRECISION
- - DataContext.DECIMAL_SCALE);
- } catch (RuntimeException e) {
- throw new ConversionException(e);
- }
- }
+ try {
+ return NumberTools.parseBigDecimal(value, locale, DataContext.DECIMAL_SCALE, DataContext.DECIMAL_PRECISION
+ - DataContext.DECIMAL_SCALE);
+ } catch (RuntimeException e) {
+ throw new ConversionException(e);
+ }
+ }
- /** {@inheritDoc} */
- public String convertToString(final BigDecimal value, Locale locale) {
- try {
- return NumberTools.bigDecimalToString(value, locale, DECIMAL_MIN_FRACTION_DIGIT, DataContext.DECIMAL_SCALE,
- DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
- } catch (RuntimeException e) {
- throw new ConversionException(e);
- }
- }
+ /** {@inheritDoc} */
+ public String convertToString(final BigDecimal value, Locale locale) {
+ try {
+ return NumberTools.bigDecimalToString(value, locale, DECIMAL_MIN_FRACTION_DIGIT, DataContext.DECIMAL_SCALE,
+ DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
+ } catch (RuntimeException e) {
+ throw new ConversionException(e);
+ }
+ }
- /**
- * @see org.apache.wicket.util.convert.converter.AbstractConverter#getTargetType()
- */
- @Override
- protected Class<BigDecimal> getTargetType() {
- return BigDecimal.class;
- }
+ /**
+ * @see org.apache.wicket.util.convert.converter.AbstractConverter#getTargetType()
+ */
+ @Override
+ protected Class<BigDecimal> getTargetType() {
+ return BigDecimal.class;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/DoubleConverterImpl.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/DoubleConverterImpl.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/converters/DoubleConverterImpl.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,49 +37,49 @@
*/
public final class DoubleConverterImpl extends AbstractDecimalConverter<Double> {
- /** The minimum number of digits printed for the fraction portion of decimals **/
- public static final int DECIMAL_MIN_FRACTION_DIGIT = 0;
+ /** The minimum number of digits printed for the fraction portion of decimals **/
+ public static final int DECIMAL_MIN_FRACTION_DIGIT = 0;
- /** Logger */
- // private static final Log LOG = LogTools.getLog();
- /** The singleton instance for a float converter */
- public static final IConverter<Double> INSTANCE = new DoubleConverterImpl();
+ /** Logger */
+ // private static final Log LOG = LogTools.getLog();
+ /** The singleton instance for a float converter */
+ public static final IConverter<Double> INSTANCE = new DoubleConverterImpl();
- /** {@inheritDoc} */
- @Override
- public Double convertToObject(String value, Locale locale) {
- if (value == null || value.trim().equals("")) {
- return null;
- }
+ /** {@inheritDoc} */
+ @Override
+ public Double convertToObject(String value, Locale locale) {
+ if (value == null || value.trim().equals("")) {
+ return null;
+ }
- if (locale == null) {
- locale = Locale.getDefault();
- }
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
- try {
- return NumberTools.parseDouble(value, locale, WebContext.DOUBLE_MAX_FRACTION_DIGIT);
- } catch (Exception e) {
- throw new ConversionException(e);
- }
- }
+ try {
+ return NumberTools.parseDouble(value, locale, WebContext.DOUBLE_MAX_FRACTION_DIGIT);
+ } catch (Exception e) {
+ throw new ConversionException(e);
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public String convertToString(final Double value, Locale locale) {
- try {
- return NumberTools.doubleToString(value, locale, DECIMAL_MIN_FRACTION_DIGIT,
- WebContext.DOUBLE_MAX_FRACTION_DIGIT);
- } catch (Exception e) {
- throw new ConversionException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public String convertToString(final Double value, Locale locale) {
+ try {
+ return NumberTools.doubleToString(value, locale, DECIMAL_MIN_FRACTION_DIGIT,
+ WebContext.DOUBLE_MAX_FRACTION_DIGIT);
+ } catch (Exception e) {
+ throw new ConversionException(e);
+ }
+ }
- /**
- * @see org.apache.wicket.util.convert.converter.AbstractConverter#getTargetType()
- */
- @Override
- protected Class<Double> getTargetType() {
- return Double.class;
- }
+ /**
+ * @see org.apache.wicket.util.convert.converter.AbstractConverter#getTargetType()
+ */
+ @Override
+ protected Class<Double> getTargetType() {
+ return Double.class;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/AutoCompleteTextFieldString.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/AutoCompleteTextFieldString.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/AutoCompleteTextFieldString.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -47,110 +47,110 @@
*/
public class AutoCompleteTextFieldString extends AutoCompleteTextField<String> {
- /**
- * Comparison mode
- */
- public enum ComparisonMode {
- /** choice.contains(input) */
- CONTAINS,
- /** choice.endsWith(input) */
- ENDS_WITH,
- /** choice.equals(input) */
- EQUALS,
- /** choice.startsWith(input) */
- STARTS_WITH;
- }
+ /**
+ * Comparison mode
+ */
+ public enum ComparisonMode {
+ /** choice.contains(input) */
+ CONTAINS,
+ /** choice.endsWith(input) */
+ ENDS_WITH,
+ /** choice.equals(input) */
+ EQUALS,
+ /** choice.startsWith(input) */
+ STARTS_WITH;
+ }
- /**
- * String purge for comparison
- * @param string String
- * @return Purged string (trim, lower case, no accent)
- */
- private static String purgeString(String string) {
- return new StringTransformer(string).trimToNull().replaceAccents().toLowerCase().toString();
- }
+ /**
+ * String purge for comparison
+ * @param string String
+ * @return Purged string (trim, lower case, no accent)
+ */
+ private static String purgeString(String string) {
+ return new StringTransformer(string).trimToNull().replaceAccents().toLowerCase().toString();
+ }
- /** Choices (pairs of purge choice & choice) */
- private final List<Pair<String, String>> choices;
+ /** Choices (pairs of purge choice & choice) */
+ private final List<Pair<String, String>> choices;
- /** Max number of choices */
- private final int maxChoices;
+ /** Max number of choices */
+ private final int maxChoices;
- /** Min processing length */
- private final int minLength;
+ /** Min processing length */
+ private final int minLength;
- /** Comparison mode */
- private final ComparisonMode mode;
+ /** Comparison mode */
+ private final ComparisonMode mode;
- /**
- * Constructor
- * @param id ID
- * @param model Model
- * @param choices Choices
- * @param mode Comparison mode
- */
- public AutoCompleteTextFieldString(String id, IModel<String> model, List<String> choices, ComparisonMode mode) {
- this(id, model, choices, mode, 0, Integer.MAX_VALUE);
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param model Model
+ * @param choices Choices
+ * @param mode Comparison mode
+ */
+ public AutoCompleteTextFieldString(String id, IModel<String> model, List<String> choices, ComparisonMode mode) {
+ this(id, model, choices, mode, 0, Integer.MAX_VALUE);
+ }
- /**
- * Constructor
- * @param id ID
- * @param model Model
- * @param choices Choices
- * @param mode Comparison mode
- * @param minLength Min processing length (default 0)
- * @param maxChoices Max choices (default Integer.MAX_VALUE)
- */
- @SuppressWarnings("unchecked")
- public AutoCompleteTextFieldString(String id, IModel<String> model, List<String> choices, ComparisonMode mode,
- int minLength, int maxChoices) {
- super(id, model, StringAutoCompleteRenderer.INSTANCE);
- AssertTools.assertNotNull(choices);
- AssertTools.assertNotNull(mode);
- AssertTools.assertNotNegative(minLength);
- AssertTools.assertPositive(maxChoices);
- this.choices = new ArrayList<Pair<String, String>>();
- for (String choice : choices) {
- String purgeChoice = purgeString(choice);
- if (purgeChoice != null && purgeChoice.length() >= minLength) {
- this.choices.add(new Pair<String, String>(purgeChoice, choice));
- }
- }
- this.mode = mode;
- this.minLength = minLength;
- this.maxChoices = maxChoices;
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param model Model
+ * @param choices Choices
+ * @param mode Comparison mode
+ * @param minLength Min processing length (default 0)
+ * @param maxChoices Max choices (default Integer.MAX_VALUE)
+ */
+ @SuppressWarnings("unchecked")
+ public AutoCompleteTextFieldString(String id, IModel<String> model, List<String> choices, ComparisonMode mode,
+ int minLength, int maxChoices) {
+ super(id, model, StringAutoCompleteRenderer.INSTANCE);
+ AssertTools.assertNotNull(choices);
+ AssertTools.assertNotNull(mode);
+ AssertTools.assertNotNegative(minLength);
+ AssertTools.assertPositive(maxChoices);
+ this.choices = new ArrayList<Pair<String, String>>();
+ for (String choice : choices) {
+ String purgeChoice = purgeString(choice);
+ if (purgeChoice != null && purgeChoice.length() >= minLength) {
+ this.choices.add(new Pair<String, String>(purgeChoice, choice));
+ }
+ }
+ this.mode = mode;
+ this.minLength = minLength;
+ this.maxChoices = maxChoices;
+ }
- /** {@inheritDoc} */
- @Override
- protected Iterator<String> getChoices(String input) {
- TreeSet<String> choicesList = new TreeSet<String>();
- String purgeInput = purgeString(input);
- if (StringTools.length(purgeInput) >= minLength) {
- Iterator<Pair<String, String>> i = choices.iterator();
- while (i.hasNext() && choicesList.size() < maxChoices) {
- Pair<String, String> choice = i.next();
- if (mode == ComparisonMode.STARTS_WITH && choice.getKey().startsWith(purgeInput)
- || mode == ComparisonMode.CONTAINS && choice.getKey().contains(purgeInput)
- || mode == ComparisonMode.ENDS_WITH && choice.getKey().endsWith(purgeInput)
- || mode == ComparisonMode.EQUALS && choice.getKey().equals(purgeInput)) {
- choicesList.add(choice.getValue());
- }
- }
- }
- return choicesList.iterator();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected Iterator<String> getChoices(String input) {
+ TreeSet<String> choicesList = new TreeSet<String>();
+ String purgeInput = purgeString(input);
+ if (StringTools.length(purgeInput) >= minLength) {
+ Iterator<Pair<String, String>> i = choices.iterator();
+ while (i.hasNext() && choicesList.size() < maxChoices) {
+ Pair<String, String> choice = i.next();
+ if (mode == ComparisonMode.STARTS_WITH && choice.getKey().startsWith(purgeInput)
+ || mode == ComparisonMode.CONTAINS && choice.getKey().contains(purgeInput)
+ || mode == ComparisonMode.ENDS_WITH && choice.getKey().endsWith(purgeInput)
+ || mode == ComparisonMode.EQUALS && choice.getKey().equals(purgeInput)) {
+ choicesList.add(choice.getValue());
+ }
+ }
+ }
+ return choicesList.iterator();
+ }
- /**
- * Add a choice at the suggestion list
- * @param choice The choice to add
- */
- public void addChoice(String choice) {
- String purgeChoice = purgeString(choice);
- if (purgeChoice != null && purgeChoice.length() >= minLength) {
- this.choices.add(new Pair<String, String>(purgeChoice, choice));
- }
- }
+ /**
+ * Add a choice at the suggestion list
+ * @param choice The choice to add
+ */
+ public void addChoice(String choice) {
+ String purgeChoice = purgeString(choice);
+ if (purgeChoice != null && purgeChoice.length() >= minLength) {
+ this.choices.add(new Pair<String, String>(purgeChoice, choice));
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButton.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButton.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButton.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,74 +36,74 @@
*/
public final class SubmittableButton extends Button {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Submittable */
- private final SubmittableButtonEvents submittable;
+ /** Submittable */
+ private final SubmittableButtonEvents submittable;
- /** Specific page which provide error messages, null if none */
- private Class<? extends TemplatePage> specificMsgPage = null;
+ /** Specific page which provide error messages, null if none */
+ private Class<? extends TemplatePage> specificMsgPage = null;
- /**
- * Constructor
- * @param id ID
- * @param submittable Submittable
- * @param specificMsgPage Page wich provide error messages
- */
- public SubmittableButton(String id, Class<? extends TemplatePage> specificMsgPage,
- SubmittableButtonEvents submittable) {
- super(id);
- this.submittable = submittable;
- this.specificMsgPage = specificMsgPage;
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param submittable Submittable
+ * @param specificMsgPage Page wich provide error messages
+ */
+ public SubmittableButton(String id, Class<? extends TemplatePage> specificMsgPage,
+ SubmittableButtonEvents submittable) {
+ super(id);
+ this.submittable = submittable;
+ this.specificMsgPage = specificMsgPage;
+ }
- /**
- * Constructor
- * @param id ID
- * @param model Model
- * @param submittable Submittable
- */
- public SubmittableButton(String id, IModel<String> model, SubmittableButtonEvents submittable) {
- super(id, model);
- this.submittable = submittable;
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param model Model
+ * @param submittable Submittable
+ */
+ public SubmittableButton(String id, IModel<String> model, SubmittableButtonEvents submittable) {
+ super(id, model);
+ this.submittable = submittable;
+ }
- /**
- * Constructor
- * @param id ID
- * @param submittable Submittable
- */
- public SubmittableButton(String id, SubmittableButtonEvents submittable) {
- super(id);
- this.submittable = submittable;
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param submittable Submittable
+ */
+ public SubmittableButton(String id, SubmittableButtonEvents submittable) {
+ super(id);
+ this.submittable = submittable;
+ }
- /** {@inheritDoc} */
- @Override
- public void onSubmit() {
- submittable.onValidate();
+ /** {@inheritDoc} */
+ @Override
+ public void onSubmit() {
+ submittable.onValidate();
- if (!getPage().hasErrorMessage()) {
- try {
- submittable.onProcess();
- } catch (UnexpectedException e) {
- throw e;
- } catch (RuntimeException e) {
- LOG.error(e.getMessage(), e);
- throw e;
- } catch (Exception e) {
- if (specificMsgPage == null) {
- ((TemplatePage) getPage()).errorCurrentPage(getId(), e);
- } else {
- ((TemplatePage) getPage()).errorCurrentPage(specificMsgPage, getId(), e);
- }
- }
- }
- if (getPage().hasErrorMessage()) {
- submittable.onError();
- } else {
- submittable.onSuccess();
- }
- }
+ if (!getPage().hasErrorMessage()) {
+ try {
+ submittable.onProcess();
+ } catch (UnexpectedException e) {
+ throw e;
+ } catch (RuntimeException e) {
+ LOG.error(e.getMessage(), e);
+ throw e;
+ } catch (Exception e) {
+ if (specificMsgPage == null) {
+ ((TemplatePage) getPage()).errorCurrentPage(getId(), e);
+ } else {
+ ((TemplatePage) getPage()).errorCurrentPage(specificMsgPage, getId(), e);
+ }
+ }
+ }
+ if (getPage().hasErrorMessage()) {
+ submittable.onError();
+ } else {
+ submittable.onSuccess();
+ }
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButtonEvents.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButtonEvents.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/forms/SubmittableButtonEvents.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,28 +32,28 @@
*/
public abstract class SubmittableButtonEvents implements Serializable {
- /**
- * (3) Action to perform on process error. For example, reset some form fields.
- */
- public void onError() {
- // Nothing to do (by default)
- }
+ /**
+ * (3) Action to perform on process error. For example, reset some form fields.
+ */
+ public void onError() {
+ // Nothing to do (by default)
+ }
- /**
- * (2) Process the form goal. For example, call the related service method.
- * @throws AbstractException if an error occured
- */
- public abstract void onProcess() throws AbstractException;
+ /**
+ * (2) Process the form goal. For example, call the related service method.
+ * @throws AbstractException if an error occured
+ */
+ public abstract void onProcess() throws AbstractException;
- /**
- * (3) Action to perform on process success. For example, redirect and display a success message.
- */
- public abstract void onSuccess();
+ /**
+ * (3) Action to perform on process success. For example, redirect and display a success message.
+ */
+ public abstract void onSuccess();
- /**
- * (1) Action to perform on validate. For example, validate the form model.
- */
- public void onValidate() {
- // Nothing to do (by default)
- }
+ /**
+ * (1) Action to perform on validate. For example, validate the form model.
+ */
+ public void onValidate() {
+ // Nothing to do (by default)
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayBooleanPropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayBooleanPropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayBooleanPropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,44 +32,44 @@
*/
public class DisplayBooleanPropertyModel extends PropertyModel<Object> {
- /** page */
- private final TemplatePage page;
+ /** page */
+ private final TemplatePage page;
- /** true string */
- private static final String TRUE_KEY = "Boolean.true";
- /** false string */
- private static final String FALSE_KEY = "Boolean.false";
+ /** true string */
+ private static final String TRUE_KEY = "Boolean.true";
+ /** false string */
+ private static final String FALSE_KEY = "Boolean.false";
- /**
- * Constructor
- * @param modelObject mo
- * @param expression e
- * @param page p
- */
- public DisplayBooleanPropertyModel(Object modelObject, String expression, TemplatePage page) {
- super(modelObject, expression);
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param modelObject mo
+ * @param expression e
+ * @param page p
+ */
+ public DisplayBooleanPropertyModel(Object modelObject, String expression, TemplatePage page) {
+ super(modelObject, expression);
+ this.page = page;
+ }
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- return booleanValueMessage((Boolean) super.getObject());
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ return booleanValueMessage((Boolean) super.getObject());
+ }
- /**
- * Retrieve a boolean value message. Null-safe methode
- * @param boolValue The boolean value
- * @return The associated message, null if the Boolean is null
- */
- private final String booleanValueMessage(Boolean boolValue) {
- if (boolValue == null) {
- return null;
- }
- if (boolValue) {
- return page.getString(TRUE_KEY);
- } else {
- return page.getString(FALSE_KEY);
- }
- }
+ /**
+ * Retrieve a boolean value message. Null-safe methode
+ * @param boolValue The boolean value
+ * @return The associated message, null if the Boolean is null
+ */
+ private final String booleanValueMessage(Boolean boolValue) {
+ if (boolValue == null) {
+ return null;
+ }
+ if (boolValue) {
+ return page.getString(TRUE_KEY);
+ } else {
+ return page.getString(FALSE_KEY);
+ }
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayDecimalPropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayDecimalPropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayDecimalPropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,72 +36,72 @@
*/
public class DisplayDecimalPropertyModel extends PropertyModel<Object> {
- /** Format to display decimal */
- public enum DecimalDisplFormat {
- /** Small format, use the NB_DECIMAL_SMALL_FORMAT defined in the class **/
- SMALL,
- /** Large format, use the max number of decimal configured in the application **/
- LARGE
- }
+ /** Format to display decimal */
+ public enum DecimalDisplFormat {
+ /** Small format, use the NB_DECIMAL_SMALL_FORMAT defined in the class **/
+ SMALL,
+ /** Large format, use the max number of decimal configured in the application **/
+ LARGE
+ }
- /** Number of decimal displayed for small number **/
- private int NB_DECIMAL_SMALL = 2;
+ /** Number of decimal displayed for small number **/
+ private int NB_DECIMAL_SMALL = 2;
- /** locale property */
- private Locale locale;
+ /** locale property */
+ private Locale locale;
- /** format to display **/
- private DecimalDisplFormat format;
+ /** format to display **/
+ private DecimalDisplFormat format;
- /**
- * Constructor
- * @param modelObject modelObject
- * @param expression expression
- * @param format format
- * @param locale locale
- */
- public DisplayDecimalPropertyModel(Object modelObject, String expression, DecimalDisplFormat format, Locale locale) {
- super(modelObject, expression);
- this.format = format;
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param modelObject modelObject
+ * @param expression expression
+ * @param format format
+ * @param locale locale
+ */
+ public DisplayDecimalPropertyModel(Object modelObject, String expression, DecimalDisplFormat format, Locale locale) {
+ super(modelObject, expression);
+ this.format = format;
+ this.locale = locale;
+ }
- /** {@inheritDoc} */
- @Override
- public Object getObject() {
- return formatDecimalValue((Number) super.getObject());
- }
+ /** {@inheritDoc} */
+ @Override
+ public Object getObject() {
+ return formatDecimalValue((Number) super.getObject());
+ }
- /**
- * Get the format for decimals
- * @return the format
- */
- private final NumberFormat getDecimalFormat() {
- int numberOfDec = format == DecimalDisplFormat.SMALL ? NB_DECIMAL_SMALL : DataContext.DECIMAL_SCALE;
+ /**
+ * Get the format for decimals
+ * @return the format
+ */
+ private final NumberFormat getDecimalFormat() {
+ int numberOfDec = format == DecimalDisplFormat.SMALL ? NB_DECIMAL_SMALL : DataContext.DECIMAL_SCALE;
- NumberFormat fmt = NumberFormat.getNumberInstance(locale);
+ NumberFormat fmt = NumberFormat.getNumberInstance(locale);
- fmt.setMaximumIntegerDigits(DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
+ fmt.setMaximumIntegerDigits(DataContext.DECIMAL_PRECISION - DataContext.DECIMAL_SCALE);
- fmt.setMaximumFractionDigits(numberOfDec);
- // affichage obligatoire des chiffres après la virgule
- fmt.setMinimumFractionDigits(numberOfDec);
+ fmt.setMaximumFractionDigits(numberOfDec);
+ // affichage obligatoire des chiffres après la virgule
+ fmt.setMinimumFractionDigits(numberOfDec);
- fmt.setRoundingMode(RoundingMode.HALF_UP);
+ fmt.setRoundingMode(RoundingMode.HALF_UP);
- return fmt;
- }
+ return fmt;
+ }
- /**
- * Retrieve a decimal in the appropriate format. Null-safe methode
- * @param decimalValue The decimal value
- * @return The string who represent the decimal value, null if the decimal value is null
- */
- private final String formatDecimalValue(Number decimalValue) {
- if (decimalValue == null) {
- return null;
- }
- return getDecimalFormat().format(decimalValue);
- }
+ /**
+ * Retrieve a decimal in the appropriate format. Null-safe methode
+ * @param decimalValue The decimal value
+ * @return The string who represent the decimal value, null if the decimal value is null
+ */
+ private final String formatDecimalValue(Number decimalValue) {
+ if (decimalValue == null) {
+ return null;
+ }
+ return getDecimalFormat().format(decimalValue);
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayEnumPropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayEnumPropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayEnumPropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -32,44 +32,44 @@
*/
public class DisplayEnumPropertyModel extends PropertyModel<Object> {
- /** pattern */
- final String pattern;
+ /** pattern */
+ final String pattern;
- /** page */
- final TemplatePage page;
+ /** page */
+ final TemplatePage page;
- /**
- * Constructor
- * @param modelObject mo
- * @param expression e
- * @param page p
- */
- public DisplayEnumPropertyModel(Object modelObject, String expression, TemplatePage page) {
- super(modelObject, expression);
- this.pattern = TemplatePage.PATTERN_ENUM_VALUE_LABEL;
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param modelObject mo
+ * @param expression e
+ * @param page p
+ */
+ public DisplayEnumPropertyModel(Object modelObject, String expression, TemplatePage page) {
+ super(modelObject, expression);
+ this.pattern = TemplatePage.PATTERN_ENUM_VALUE_LABEL;
+ this.page = page;
+ }
- /**
- * {@inheritDoc}
- * @return the enum value
- */
- @Override
- public String getObject() {
- return enumValueMessage(super.getObject());
- }
+ /**
+ * {@inheritDoc}
+ * @return the enum value
+ */
+ @Override
+ public String getObject() {
+ return enumValueMessage(super.getObject());
+ }
- /**
- * Retrieve an enum value message (class.value). Null-safe methode
- * @param <E> Enum type
- * @param enumValue Enum value, null is the enumValue is null
- * @return Enum value message
- */
- private final <E extends Enum<?>> String enumValueMessage(Object enumValue) {
- if (enumValue == null) {
- return null;
- }
- String enumValueMessage = String.format(pattern, enumValue.getClass().getSimpleName(), enumValue.toString());
- return page.getString(enumValueMessage);
- }
+ /**
+ * Retrieve an enum value message (class.value). Null-safe methode
+ * @param <E> Enum type
+ * @param enumValue Enum value, null is the enumValue is null
+ * @return Enum value message
+ */
+ private final <E extends Enum<?>> String enumValueMessage(Object enumValue) {
+ if (enumValue == null) {
+ return null;
+ }
+ String enumValueMessage = String.format(pattern, enumValue.getClass().getSimpleName(), enumValue.toString());
+ return page.getString(enumValueMessage);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayMapValuePropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayMapValuePropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayMapValuePropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,24 +34,24 @@
*/
public class DisplayMapValuePropertyModel<T> extends PropertyModel<Object> {
- /** map */
- private final Map<T, String> map;
+ /** map */
+ private final Map<T, String> map;
- /**
- * Constructor
- * @param modelObject Model object
- * @param expression Expression to reach property model
- * @param map Applying map
- */
- public DisplayMapValuePropertyModel(Object modelObject, String expression, Map<T, String> map) {
- super(modelObject, expression);
- this.map = map;
- }
+ /**
+ * Constructor
+ * @param modelObject Model object
+ * @param expression Expression to reach property model
+ * @param map Applying map
+ */
+ public DisplayMapValuePropertyModel(Object modelObject, String expression, Map<T, String> map) {
+ super(modelObject, expression);
+ this.map = map;
+ }
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- return map.get(super.getObject());
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ return map.get(super.getObject());
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayPercentPropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayPercentPropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayPercentPropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,47 +36,47 @@
*/
public class DisplayPercentPropertyModel extends PropertyModel<Object> {
- /** locale */
- private final Locale locale;
+ /** locale */
+ private final Locale locale;
- /**
- * Constructor
- * @param modelObject mo
- * @param expression e
- * @param locale locale
- */
- public DisplayPercentPropertyModel(Object modelObject, String expression, Locale locale) {
- super(modelObject, expression);
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param modelObject mo
+ * @param expression e
+ * @param locale locale
+ */
+ public DisplayPercentPropertyModel(Object modelObject, String expression, Locale locale) {
+ super(modelObject, expression);
+ this.locale = locale;
+ }
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- return formatPercentValue((Number) super.getObject());
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ return formatPercentValue((Number) super.getObject());
+ }
- /**
- * Retrieve a purcent in the appropriate format. Null-safe methode
- * @param percentValue The purcentValue
- * @return The string who represent the purcent, null if the purcent value is null
- */
- private final String formatPercentValue(Number percentValue) {
- if (percentValue == null) {
- return null;
- }
- return this.getPercentFormat().format(percentValue);
- }
+ /**
+ * Retrieve a purcent in the appropriate format. Null-safe methode
+ * @param percentValue The purcentValue
+ * @return The string who represent the purcent, null if the purcent value is null
+ */
+ private final String formatPercentValue(Number percentValue) {
+ if (percentValue == null) {
+ return null;
+ }
+ return this.getPercentFormat().format(percentValue);
+ }
- /**
- * Get the format for purcents
- * @return the format
- */
- private final NumberFormat getPercentFormat() {
- // pourcents with two digits after the point
- NumberFormat percentFormat = NumberFormat.getPercentInstance(locale);
- percentFormat.setMaximumFractionDigits(WebContext.PERCENT_PRECISION);
- return percentFormat;
- }
+ /**
+ * Get the format for purcents
+ * @return the format
+ */
+ private final NumberFormat getPercentFormat() {
+ // pourcents with two digits after the point
+ NumberFormat percentFormat = NumberFormat.getPercentInstance(locale);
+ percentFormat.setMaximumFractionDigits(WebContext.PERCENT_PRECISION);
+ return percentFormat;
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayShortDatePropertyModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayShortDatePropertyModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/DisplayShortDatePropertyModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,44 +34,44 @@
*/
public class DisplayShortDatePropertyModel extends PropertyModel<Object> {
- /** locale */
- private final Locale locale;
+ /** locale */
+ private final Locale locale;
- /**
- * Constructor
- * @param modelObject mo
- * @param expression e
- * @param locale l
- */
- public DisplayShortDatePropertyModel(Object modelObject, String expression, Locale locale) {
- super(modelObject, expression);
- this.locale = locale;
- }
+ /**
+ * Constructor
+ * @param modelObject mo
+ * @param expression e
+ * @param locale l
+ */
+ public DisplayShortDatePropertyModel(Object modelObject, String expression, Locale locale) {
+ super(modelObject, expression);
+ this.locale = locale;
+ }
- /** {@inheritDoc} */
- @Override
- public String getObject() {
- return formatShortDateValue((Date) super.getObject());
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getObject() {
+ return formatShortDateValue((Date) super.getObject());
+ }
- /**
- * Retrieve a date in the appropriate format. Null-safe methode
- * @param dateValue The date (year, month, day only)
- * @return The string who represent the date, null if the date is null
- */
- private final String formatShortDateValue(Date dateValue) {
- if (dateValue == null) {
- return null;
- }
- return getShortDateFormat().format(dateValue);
- }
+ /**
+ * Retrieve a date in the appropriate format. Null-safe methode
+ * @param dateValue The date (year, month, day only)
+ * @return The string who represent the date, null if the date is null
+ */
+ private final String formatShortDateValue(Date dateValue) {
+ if (dateValue == null) {
+ return null;
+ }
+ return getShortDateFormat().format(dateValue);
+ }
- /**
- * Get the format for short date
- * @return the format
- */
- private final DateFormat getShortDateFormat() {
- return DateFormat.getDateInstance(DateFormat.SHORT, locale);
- }
+ /**
+ * Get the format for short date
+ * @return the format
+ */
+ private final DateFormat getShortDateFormat() {
+ return DateFormat.getDateInstance(DateFormat.SHORT, locale);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/GenericLoadableDetachableModel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/GenericLoadableDetachableModel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/GenericLoadableDetachableModel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -44,52 +44,52 @@
*/
public final class GenericLoadableDetachableModel<M extends AbstractModel> extends LoadableDetachableModel<M> {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** DAO */
- @SpringBean
- private GenericDao dao;
+ /** DAO */
+ @SpringBean
+ private GenericDao dao;
- /** Model class */
- private final Class<M> modelClass;
+ /** Model class */
+ private final Class<M> modelClass;
- /** Model ID */
- private final Serializable modelID;
+ /** Model ID */
+ private final Serializable modelID;
- /**
- * Constructor
- * @param modelClass Model class
- * @param modelID Model ID
- */
- public GenericLoadableDetachableModel(Class<M> modelClass, Serializable modelID) {
- AssertTools.assertNotNull(modelClass);
- AssertTools.assertNotNull(modelID);
- this.modelClass = modelClass;
- this.modelID = modelID;
- WebApplicationImpl.injectSpringBeans(this);
- }
+ /**
+ * Constructor
+ * @param modelClass Model class
+ * @param modelID Model ID
+ */
+ public GenericLoadableDetachableModel(Class<M> modelClass, Serializable modelID) {
+ AssertTools.assertNotNull(modelClass);
+ AssertTools.assertNotNull(modelID);
+ this.modelClass = modelClass;
+ this.modelID = modelID;
+ WebApplicationImpl.injectSpringBeans(this);
+ }
- /**
- * Constructor
- * @param model Model
- */
- @SuppressWarnings("unchecked")
- public GenericLoadableDetachableModel(M model) {
- this((Class<M>) model.getClass(), model.getIdValue());
- setObject(model);
- }
+ /**
+ * Constructor
+ * @param model Model
+ */
+ @SuppressWarnings("unchecked")
+ public GenericLoadableDetachableModel(M model) {
+ this((Class<M>) model.getClass(), model.getIdValue());
+ setObject(model);
+ }
- /** {@inheritDoc} */
- @Override
- protected M load() {
- try {
- // LOG.debug("chargement LOAD, " + modelClass + "- id : " + modelID);
- return dao.read(modelClass, modelID);
- } catch (Exception e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ protected M load() {
+ try {
+ // LOG.debug("chargement LOAD, " + modelClass + "- id : " + modelID);
+ return dao.read(modelClass, modelID);
+ } catch (Exception e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/models/LoadableDetachableSortableListDataProvider.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -52,105 +52,105 @@
*/
public final class LoadableDetachableSortableListDataProvider<M extends AbstractModel> extends SortableDataProvider<M> {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Comparator */
- private final Comparator<Object> comparator;
+ /** Comparator */
+ private final Comparator<Object> comparator;
- /** Data list */
- // TODO penser à remettre "transient" à la liste
- private List<M> list;
+ /** Data list */
+ // TODO penser à remettre "transient" à la liste
+ private List<M> list;
- /** Locale */
- private final Locale locale;
+ /** Locale */
+ private final Locale locale;
- /** To recognize a special sort by codePays */
- final static String CODE_PAYS_PROPERTY = "codePays";
+ /** To recognize a special sort by codePays */
+ final static String CODE_PAYS_PROPERTY = "codePays";
- /** Current filter to select results */
- // private FilterMapHomeMade filter;
- /**
- * Constructor
- * @param list List
- * @param locale Locale
- */
- @SuppressWarnings("unchecked")
- public LoadableDetachableSortableListDataProvider(List<M> list, Locale locale) {
- AssertTools.assertNotNull(list);
- AssertTools.assertIn(locale, DataContext.LOCALES);
- this.list = list;
- this.locale = locale;
- comparator = new NullComparator(true);
- }
+ /** Current filter to select results */
+ // private FilterMapHomeMade filter;
+ /**
+ * Constructor
+ * @param list List
+ * @param locale Locale
+ */
+ @SuppressWarnings("unchecked")
+ public LoadableDetachableSortableListDataProvider(List<M> list, Locale locale) {
+ AssertTools.assertNotNull(list);
+ AssertTools.assertIn(locale, DataContext.LOCALES);
+ this.list = list;
+ this.locale = locale;
+ comparator = new NullComparator(true);
+ }
- /** {@inheritDoc} */
- @Override
- public Iterator<? extends M> iterator(int first, int count) {
+ /** {@inheritDoc} */
+ @Override
+ public Iterator<? extends M> iterator(int first, int count) {
- if (getSort() != null && !StringUtils.isEmpty(getSort().getProperty())) {
- Collections.sort(list, new Comparator<M>() {
- @Override
- public int compare(M o1, M o2) {
- try {
- Comparable<? extends Object> c1;
- Object c2;
- c1 = GenericsTools.cast(BeanTools.getValueFromPath(o1, AccessType.GETTER, getSort()
- .getProperty()));
+ if (getSort() != null && !StringUtils.isEmpty(getSort().getProperty())) {
+ Collections.sort(list, new Comparator<M>() {
+ @Override
+ public int compare(M o1, M o2) {
+ try {
+ Comparable<? extends Object> c1;
+ Object c2;
+ c1 = GenericsTools.cast(BeanTools.getValueFromPath(o1, AccessType.GETTER, getSort()
+ .getProperty()));
- c2 = GenericsTools.cast(BeanTools.getValueFromPath(o2, AccessType.GETTER, getSort()
- .getProperty()));
+ c2 = GenericsTools.cast(BeanTools.getValueFromPath(o2, AccessType.GETTER, getSort()
+ .getProperty()));
- // Exceptions
- // Countries are sorted by country name, not by country code
- if (getSort().getProperty().endsWith(CODE_PAYS_PROPERTY)) {
- if (c1 != null) {
- c1 = WebContext.COUNTRIES.get(locale).get(c1);
- }
- if (c2 != null) {
- c2 = WebContext.COUNTRIES.get(locale).get(c2);
- }
- }
+ // Exceptions
+ // Countries are sorted by country name, not by country code
+ if (getSort().getProperty().endsWith(CODE_PAYS_PROPERTY)) {
+ if (c1 != null) {
+ c1 = WebContext.COUNTRIES.get(locale).get(c1);
+ }
+ if (c2 != null) {
+ c2 = WebContext.COUNTRIES.get(locale).get(c2);
+ }
+ }
- return (getSort().isAscending() ? 1 : -1) * comparator.compare(c1, c2);
- } catch (Exception e) {
- LOG.error(e.getMessage(), e);
- throw new UnexpectedException(e);
- }
- }
- });
- }
+ return (getSort().isAscending() ? 1 : -1) * comparator.compare(c1, c2);
+ } catch (Exception e) {
+ LOG.error(e.getMessage(), e);
+ throw new UnexpectedException(e);
+ }
+ }
+ });
+ }
- return list.subList(first, Math.min(first + count, size())).iterator();
- }
+ return list.subList(first, Math.min(first + count, size())).iterator();
+ }
- /** {@inheritDoc} */
- @Override
- public GenericLoadableDetachableModel<M> model(M object) {
- // return new Model<M>(object);
- return new GenericLoadableDetachableModel<M>(object);
- }
+ /** {@inheritDoc} */
+ @Override
+ public GenericLoadableDetachableModel<M> model(M object) {
+ // return new Model<M>(object);
+ return new GenericLoadableDetachableModel<M>(object);
+ }
- /** {@inheritDoc} */
- @Override
- public int size() {
- return list.size();
- }
+ /** {@inheritDoc} */
+ @Override
+ public int size() {
+ return list.size();
+ }
- /**
- * list getter
- * @return list
- */
- public List<M> getList() {
- return list;
- }
+ /**
+ * list getter
+ * @return list
+ */
+ public List<M> getList() {
+ return list;
+ }
- /**
- * list setter
- * @param list list
- */
- public void setList(List<M> list) {
- this.list = list;
- }
+ /**
+ * list setter
+ * @param list list
+ */
+ public void setList(List<M> list) {
+ this.list = list;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/CollapsiblePanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/CollapsiblePanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/CollapsiblePanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -37,63 +37,63 @@
*/
public abstract class CollapsiblePanel extends Panel {
- /** Reference for the expand image */
- private PackageResourceReference closed = new PackageResourceReference(CollapsiblePanel.class, "expand.png");
+ /** Reference for the expand image */
+ private PackageResourceReference closed = new PackageResourceReference(CollapsiblePanel.class, "expand.png");
- /** Reference for the collapse image */
- private PackageResourceReference open = new PackageResourceReference(CollapsiblePanel.class, "collapse.png");
+ /** Reference for the collapse image */
+ private PackageResourceReference open = new PackageResourceReference(CollapsiblePanel.class, "collapse.png");
- /** Does the panel is visible ? */
- private boolean visible = false;
+ /** Does the panel is visible ? */
+ private boolean visible = false;
- /** The panel which is showed/hid */
- protected Panel innerPanel;
+ /** The panel which is showed/hid */
+ protected Panel innerPanel;
- /**
- * Construct the panel
- * @param id Panel ID
- * @param titleModel Model used to get the panel title
- * @param defaultOpen Is the default state open
- */
- public CollapsiblePanel(String id, IModel<String> titleModel, boolean defaultOpen) {
- super(id);
- this.visible = defaultOpen;
- innerPanel = getInnerPanel("innerPanel");
- innerPanel.setVisible(visible);
- innerPanel.setOutputMarkupId(true);
- innerPanel.setOutputMarkupPlaceholderTag(true);
- add(innerPanel);
+ /**
+ * Construct the panel
+ * @param id Panel ID
+ * @param titleModel Model used to get the panel title
+ * @param defaultOpen Is the default state open
+ */
+ public CollapsiblePanel(String id, IModel<String> titleModel, boolean defaultOpen) {
+ super(id);
+ this.visible = defaultOpen;
+ innerPanel = getInnerPanel("innerPanel");
+ innerPanel.setVisible(visible);
+ innerPanel.setOutputMarkupId(true);
+ innerPanel.setOutputMarkupPlaceholderTag(true);
+ add(innerPanel);
- final Image showHideImage = new Image("showHideIcon") {
- private static final long serialVersionUID = 8638737301579767296L;
+ final Image showHideImage = new Image("showHideIcon") {
+ private static final long serialVersionUID = 8638737301579767296L;
- @Override
- public ResourceReference getImageResourceReference() {
- return visible ? open : closed;
- }
- };
- showHideImage.setOutputMarkupId(true);
- IndicatingAjaxLink<Void> showHideLink = new IndicatingAjaxLink<Void>("showHideLink") {
- private static final long serialVersionUID = -1929927616508773911L;
+ @Override
+ public ResourceReference getImageResourceReference() {
+ return visible ? open : closed;
+ }
+ };
+ showHideImage.setOutputMarkupId(true);
+ IndicatingAjaxLink<Void> showHideLink = new IndicatingAjaxLink<Void>("showHideLink") {
+ private static final long serialVersionUID = -1929927616508773911L;
- @Override
- public void onClick(AjaxRequestTarget target) {
- visible = !visible;
- innerPanel.setVisible(visible);
- target.add(innerPanel);
- target.add(showHideImage);
- }
- };
- showHideLink.add(showHideImage);
- add(new Label("titlePanel", titleModel));
- add(showHideLink);
- }
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ visible = !visible;
+ innerPanel.setVisible(visible);
+ target.add(innerPanel);
+ target.add(showHideImage);
+ }
+ };
+ showHideLink.add(showHideImage);
+ add(new Label("titlePanel", titleModel));
+ add(showHideLink);
+ }
- /**
- * Construct the container contained within the collapsible panel
- * @param markupId ID that should be used for the inner panel
- * @return The inner container displayed when collapsible is open
- */
- protected abstract Panel getInnerPanel(String markupId);
+ /**
+ * Construct the container contained within the collapsible panel
+ * @param markupId ID that should be used for the inner panel
+ * @return The inner container displayed when collapsible is open
+ */
+ protected abstract Panel getInnerPanel(String markupId);
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,63 +36,63 @@
**/
abstract public class PropertyLabelLinkPanel<T> extends Panel {
- /** generated link */
- private Link<T> link;
+ /** generated link */
+ private Link<T> link;
- /**
- * Constructor
- * @param id panel id
- * @param linkModel model used to generate the link
- */
- public PropertyLabelLinkPanel(String id, IModel<T> linkModel) {
- super(id, linkModel);
- link = new Link<T>("link") {
+ /**
+ * Constructor
+ * @param id panel id
+ * @param linkModel model used to generate the link
+ */
+ public PropertyLabelLinkPanel(String id, IModel<T> linkModel) {
+ super(id, linkModel);
+ link = new Link<T>("link") {
- @Override
- public void onClick() {
- PropertyLabelLinkPanel.this.onClick();
- }
- };
- add(link);
+ @Override
+ public void onClick() {
+ PropertyLabelLinkPanel.this.onClick();
+ }
+ };
+ add(link);
- link.add(new Label("label", linkModel));
- }
+ link.add(new Label("label", linkModel));
+ }
- /**
- * Constructor
- * @param id panel id
- * @param linkModel model used to generate the link
- * @param linkTitle title displayed for the link
- */
- public PropertyLabelLinkPanel(String id, IModel<T> linkModel, String linkTitle) {
- this(id, linkModel);
+ /**
+ * Constructor
+ * @param id panel id
+ * @param linkModel model used to generate the link
+ * @param linkTitle title displayed for the link
+ */
+ public PropertyLabelLinkPanel(String id, IModel<T> linkModel, String linkTitle) {
+ this(id, linkModel);
- if (linkTitle != null) {
- link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
- }
- }
+ if (linkTitle != null) {
+ link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
+ }
+ }
- /**
- * Get the model
- * @return model
- */
- @SuppressWarnings("unchecked")
- public IModel<T> getModel() {
- return (IModel<T>) getDefaultModel();
- }
+ /**
+ * Get the model
+ * @return model
+ */
+ @SuppressWarnings("unchecked")
+ public IModel<T> getModel() {
+ return (IModel<T>) getDefaultModel();
+ }
- /**
- * Get the model object
- * @return model object
- */
- @SuppressWarnings("unchecked")
- public T getModelObject() {
- return (T) getDefaultModelObject();
- }
+ /**
+ * Get the model object
+ * @return model object
+ */
+ @SuppressWarnings("unchecked")
+ public T getModelObject() {
+ return (T) getDefaultModelObject();
+ }
- /**
- * Override this method to react to link clicks.
- */
- public abstract void onClick();
+ /**
+ * Override this method to react to link clicks.
+ */
+ public abstract void onClick();
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkProduitPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkProduitPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/PropertyLabelLinkProduitPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -42,82 +42,82 @@
*/
public abstract class PropertyLabelLinkProduitPanel extends Panel {
- /** generated link */
- private Link<Produit> link;
+ /** generated link */
+ private Link<Produit> link;
- /**
- * Constructor
- * @param id panel id
- * @param produitModel model used to generate the link
- */
- public PropertyLabelLinkProduitPanel(String id, final IModel<Produit> produitModel) {
- super(id, produitModel);
- link = new Link<Produit>("link") {
+ /**
+ * Constructor
+ * @param id panel id
+ * @param produitModel model used to generate the link
+ */
+ public PropertyLabelLinkProduitPanel(String id, final IModel<Produit> produitModel) {
+ super(id, produitModel);
+ link = new Link<Produit>("link") {
- @Override
- public void onClick() {
- if (produitModel.getObject().isExtrait()) {
- Extrait extrait = (Extrait) produitModel.getObject();
- onClickIfExtrait(extrait);
- } else {
- // le produit est une fraction
- Fraction fraction = (Fraction) produitModel.getObject();
- onClickIfFraction(fraction);
- }
- }
- };
- add(link);
+ @Override
+ public void onClick() {
+ if (produitModel.getObject().isExtrait()) {
+ Extrait extrait = (Extrait) produitModel.getObject();
+ onClickIfExtrait(extrait);
+ } else {
+ // le produit est une fraction
+ Fraction fraction = (Fraction) produitModel.getObject();
+ onClickIfFraction(fraction);
+ }
+ }
+ };
+ add(link);
- link.add(new Label("label", produitModel));
- }
+ link.add(new Label("label", produitModel));
+ }
- /**
- * Constructor
- * @param id panel id
- * @param produitModel model used to generate the link
- * @param page page used to get messages
- */
- public PropertyLabelLinkProduitPanel(String id, IModel<Produit> produitModel, TemplatePage page) {
- this(id, produitModel);
- if (produitModel.getObject() != null) {
- String linkTitle;
- // title différent suivant si le produit provient d'une extraction ou d'une purification
- if (produitModel.getObject().isExtrait()) {
- linkTitle = page.getString("ReadExtraction");
- } else {
- linkTitle = page.getString("ReadPurification");
- }
- link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
- }
- }
+ /**
+ * Constructor
+ * @param id panel id
+ * @param produitModel model used to generate the link
+ * @param page page used to get messages
+ */
+ public PropertyLabelLinkProduitPanel(String id, IModel<Produit> produitModel, TemplatePage page) {
+ this(id, produitModel);
+ if (produitModel.getObject() != null) {
+ String linkTitle;
+ // title différent suivant si le produit provient d'une extraction ou d'une purification
+ if (produitModel.getObject().isExtrait()) {
+ linkTitle = page.getString("ReadExtraction");
+ } else {
+ linkTitle = page.getString("ReadPurification");
+ }
+ link.add(new AttributeModifier("title", new Model<String>(linkTitle)));
+ }
+ }
- /**
- * Get the model
- * @return model
- */
- @SuppressWarnings("unchecked")
- public final IModel<Produit> getModel() {
- return (IModel<Produit>) getDefaultModel();
- }
+ /**
+ * Get the model
+ * @return model
+ */
+ @SuppressWarnings("unchecked")
+ public final IModel<Produit> getModel() {
+ return (IModel<Produit>) getDefaultModel();
+ }
- /**
- * Get the model object
- * @return model object
- */
- public final Produit getModelObject() {
- return (Produit) getDefaultModelObject();
- }
+ /**
+ * Get the model object
+ * @return model object
+ */
+ public final Produit getModelObject() {
+ return (Produit) getDefaultModelObject();
+ }
- /**
- * Executed on click evenement when the produis is an extrait
- * @param extrait extrait
- */
- public abstract void onClickIfExtrait(Extrait extrait);
+ /**
+ * Executed on click evenement when the produis is an extrait
+ * @param extrait extrait
+ */
+ public abstract void onClickIfExtrait(Extrait extrait);
- /**
- * Executed on click evenement when the produis is a fraction
- * @param fraction fraction
- */
- public abstract void onClickIfFraction(Fraction fraction);
+ /**
+ * Executed on click evenement when the produis is a fraction
+ * @param fraction fraction
+ */
+ public abstract void onClickIfFraction(Fraction fraction);
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/SimpleTooltipPanel.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/SimpleTooltipPanel.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/panels/SimpleTooltipPanel.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,15 +36,15 @@
*/
public class SimpleTooltipPanel extends Panel {
- /**
- * Constructor
- * @param id Component id
- * @param messageModel Message Model displayed over the image
- */
- public SimpleTooltipPanel(String id, IModel<?> messageModel) {
- super(id);
- WebComponent img = new Image("tooltip", new PackageResourceReference(SimpleTooltipPanel.class, "tooltip.png"));
- img.add(new AttributeModifier("title", messageModel));
- add(img);
- }
+ /**
+ * Constructor
+ * @param id Component id
+ * @param messageModel Message Model displayed over the image
+ */
+ public SimpleTooltipPanel(String id, IModel<?> messageModel) {
+ super(id);
+ WebComponent img = new Image("tooltip", new PackageResourceReference(SimpleTooltipPanel.class, "tooltip.png"));
+ img.add(new AttributeModifier("title", messageModel));
+ add(img);
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/EnumChoiceRenderer.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/EnumChoiceRenderer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/EnumChoiceRenderer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,26 +35,26 @@
*/
public final class EnumChoiceRenderer<E extends Enum<?>> implements IChoiceRenderer<E>, Serializable {
- /** Page */
- private final TemplatePage page;
+ /** Page */
+ private final TemplatePage page;
- /**
- * Constructor
- * @param page Page
- */
- public EnumChoiceRenderer(TemplatePage page) {
- this.page = page;
- }
+ /**
+ * Constructor
+ * @param page Page
+ */
+ public EnumChoiceRenderer(TemplatePage page) {
+ this.page = page;
+ }
- /** {@inheritDoc} */
- @Override
- public String getDisplayValue(E enumValue) {
- return page.enumValueMessage(enumValue);
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getDisplayValue(E enumValue) {
+ return page.enumValueMessage(enumValue);
+ }
- /** {@inheritDoc} */
- @Override
- public String getIdValue(E enumValue, int index) {
- return enumValue.toString();
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getIdValue(E enumValue, int index) {
+ return enumValue.toString();
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/MapChoiceRenderer.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/MapChoiceRenderer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/renderers/MapChoiceRenderer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -35,26 +35,26 @@
*/
public final class MapChoiceRenderer<K, V> implements IChoiceRenderer<K>, Serializable {
- /** Map */
- private final Map<K, V> map;
+ /** Map */
+ private final Map<K, V> map;
- /**
- * Constructor
- * @param map Map
- */
- public MapChoiceRenderer(Map<K, V> map) {
- this.map = map;
- }
+ /**
+ * Constructor
+ * @param map Map
+ */
+ public MapChoiceRenderer(Map<K, V> map) {
+ this.map = map;
+ }
- /** {@inheritDoc} */
- @Override
- public V getDisplayValue(K object) {
- return map.get(object);
- }
+ /** {@inheritDoc} */
+ @Override
+ public V getDisplayValue(K object) {
+ return map.get(object);
+ }
- /** {@inheritDoc} */
- @Override
- public String getIdValue(K object, int index) {
- return object != null ? object.toString() : null;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String getIdValue(K object, int index) {
+ return object != null ? object.toString() : null;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/resources/WebMessages.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/resources/WebMessages.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/resources/WebMessages.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -39,32 +39,32 @@
@Service
public final class WebMessages implements IStringResourceLoader {
- /** Message source */
- private final MessageSourceAccessor source;
+ /** Message source */
+ private final MessageSourceAccessor source;
- /**
- * Constructor
- * @param source Message source
- */
- public WebMessages(MessageSourceAccessor source) {
- AssertTools.assertNotNull(source);
- this.source = source;
- }
+ /**
+ * Constructor
+ * @param source Message source
+ */
+ public WebMessages(MessageSourceAccessor source) {
+ AssertTools.assertNotNull(source);
+ this.source = source;
+ }
- /** {@inheritDoc} */
- @Override
- public String loadStringResource(Class<?> clazz, String key, Locale locale, String style, String variation) {
- try {
- return source.getMessage(key, locale);
- } catch (NoSuchMessageException e) {
- return null;
- }
- }
+ /** {@inheritDoc} */
+ @Override
+ public String loadStringResource(Class<?> clazz, String key, Locale locale, String style, String variation) {
+ try {
+ return source.getMessage(key, locale);
+ } catch (NoSuchMessageException e) {
+ return null;
+ }
+ }
- /** {@inheritDoc} */
- @Override
- public String loadStringResource(Component component, String key, Locale locale, String style, String variation) {
- return component != null ? loadStringResource(component.getClass(), key, locale, null, null) : null;
- }
+ /** {@inheritDoc} */
+ @Override
+ public String loadStringResource(Component component, String key, Locale locale, String style, String variation) {
+ return component != null ? loadStringResource(component.getClass(), key, locale, null, null) : null;
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthContainer.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthContainer.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthContainer.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -30,31 +30,31 @@
*/
public final class AuthContainer extends WebMarkupContainer {
- /** Authorization? */
- private final boolean authorized;
+ /** Authorization? */
+ private final boolean authorized;
- /**
- * Constructor
- * @param id ID
- * @param roles Authorized roles
- */
- public AuthContainer(String id, AuthRole... roles) {
- super(id);
- authorized = AuthStrategy.isAuthorized(roles);
- }
+ /**
+ * Constructor
+ * @param id ID
+ * @param roles Authorized roles
+ */
+ public AuthContainer(String id, AuthRole... roles) {
+ super(id);
+ authorized = AuthStrategy.isAuthorized(roles);
+ }
- /**
- * authorized getter
- * @return authorized
- */
- public boolean isAuthorized() {
- return authorized;
- }
+ /**
+ * authorized getter
+ * @return authorized
+ */
+ public boolean isAuthorized() {
+ return authorized;
+ }
- /** {@inheritDoc} */
- @Override
- protected void onBeforeRender() {
- setVisibilityAllowed(isAuthorized());
- super.onBeforeRender();
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void onBeforeRender() {
+ setVisibilityAllowed(isAuthorized());
+ super.onBeforeRender();
+ }
}
\ No newline at end of file
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRole.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRole.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRole.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -27,10 +27,10 @@
* @author Mickael Tricot
*/
public enum AuthRole {
- /** Administrator */
- ADMIN,
- /** User */
- USER,
- /** Visitor */
- VISITOR;
+ /** Administrator */
+ ADMIN,
+ /** User */
+ USER,
+ /** Visitor */
+ VISITOR;
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRoles.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRoles.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthRoles.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -34,9 +34,9 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AuthRoles {
- /**
- * Authorized roles (all roles if null or empty)
- * @return Authorized roles
- */
- AuthRole[] value();
+ /**
+ * Authorized roles (all roles if null or empty)
+ * @return Authorized roles
+ */
+ AuthRole[] value();
}
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-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthSession.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -48,161 +48,161 @@
*/
public final class AuthSession extends WebSession implements Serializable {
- /** Logger */
- private static final Log LOG = LogTools.getLog();
+ /** Logger */
+ private static final Log LOG = LogTools.getLog();
- /** Attribute: rememberMe */
- private static final String ATTRIBUTE_REMEMBER_ME = "rememberMe";
+ /** Attribute: rememberMe */
+ private static final String ATTRIBUTE_REMEMBER_ME = "rememberMe";
- /** Attribute: roles */
- private static final String ATTRIBUTE_ROLE = "role";
+ /** Attribute: roles */
+ private static final String ATTRIBUTE_ROLE = "role";
- /** Attribute: utilisateur */
- private static final String ATTRIBUTE_UTILISATEUR = "utilisateur";
+ /** Attribute: utilisateur */
+ private static final String ATTRIBUTE_UTILISATEUR = "utilisateur";
- /** Personne service */
- @SpringBean
- private PersonneService personneService;
+ /** Personne service */
+ @SpringBean
+ private PersonneService personneService;
- /**
- * Constructor
- * @param request Request
- */
- public AuthSession(Request request) {
- super(request);
- WebApplicationImpl.injectSpringBeans(this);
- if (!DataContext.LOCALES.contains(getLocale())) {
- setLocale(Locale.getDefault());
- }
- setAttribute(ATTRIBUTE_ROLE, new HashSet<TypeDroit>());
- setUtilisateur(null);
+ /**
+ * Constructor
+ * @param request Request
+ */
+ public AuthSession(Request request) {
+ super(request);
+ WebApplicationImpl.injectSpringBeans(this);
+ if (!DataContext.LOCALES.contains(getLocale())) {
+ setLocale(Locale.getDefault());
+ }
+ setAttribute(ATTRIBUTE_ROLE, new HashSet<TypeDroit>());
+ setUtilisateur(null);
- if (!autologin()) {
- logout();
- }
- bind();
- }
+ if (!autologin()) {
+ logout();
+ }
+ bind();
+ }
- /**
- * Autologin
- * @return Success
- */
- private boolean autologin() {
+ /**
+ * Autologin
+ * @return Success
+ */
+ private boolean autologin() {
- String[] cookie = WebApplication.get().getSecuritySettings().getAuthenticationStrategy().load();
- // cookie[0] = courriel, cookie[1] = passwordHash
- if (cookie != null && cookie.length == 2 && !StringUtils.isEmpty(cookie[0]) && !StringUtils.isEmpty(cookie[1])
- && authenticate(cookie[0], cookie[1])) {
- try {
- // connexion without cookie persistance because already exists
- connectUser(personneService.loadUtilisateur(cookie[0]), false);
- } catch (DataNotFoundException e) {
- // just in cas the user is deleted by another user between authenticate and plainLogin
- return false;
- }
- return true;
- }
- return false;
- }
+ String[] cookie = WebApplication.get().getSecuritySettings().getAuthenticationStrategy().load();
+ // cookie[0] = courriel, cookie[1] = passwordHash
+ if (cookie != null && cookie.length == 2 && !StringUtils.isEmpty(cookie[0]) && !StringUtils.isEmpty(cookie[1])
+ && authenticate(cookie[0], cookie[1])) {
+ try {
+ // connexion without cookie persistance because already exists
+ connectUser(personneService.loadUtilisateur(cookie[0]), false);
+ } catch (DataNotFoundException e) {
+ // just in cas the user is deleted by another user between authenticate and plainLogin
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
- /** {@inheritDoc} */
- @Override
- public boolean authenticate(String username, String password) {
- LOG.debug(personneService.authenticateUtilisateur(username, password));
- return personneService.authenticateUtilisateur(username, password);
- }
+ /** {@inheritDoc} */
+ @Override
+ public boolean authenticate(String username, String password) {
+ LOG.debug(personneService.authenticateUtilisateur(username, password));
+ return personneService.authenticateUtilisateur(username, password);
+ }
- /**
- * rememberMe getter
- * @return rememberMe
- */
- public Boolean getRememberMe() {
- return (Boolean) getAttribute(ATTRIBUTE_REMEMBER_ME);
- }
+ /**
+ * rememberMe getter
+ * @return rememberMe
+ */
+ public Boolean getRememberMe() {
+ return (Boolean) getAttribute(ATTRIBUTE_REMEMBER_ME);
+ }
- /**
- * role getter
- * @return role
- */
- public AuthRole getRole() {
- return (AuthRole) getAttribute(ATTRIBUTE_ROLE);
- }
+ /**
+ * role getter
+ * @return role
+ */
+ public AuthRole getRole() {
+ return (AuthRole) getAttribute(ATTRIBUTE_ROLE);
+ }
- /**
- * utilisateur getter
- * @return utilisateur
- */
- public Utilisateur getUtilisateur() {
- Integer idPersonne = (Integer) getAttribute(ATTRIBUTE_UTILISATEUR);
- Utilisateur utilisateur = null;
- if (idPersonne != null) {
- try {
- utilisateur = personneService.loadUtilisateur(idPersonne);
- } catch (DataNotFoundException e) {
- logout();
- } catch (Exception e) {
- LOG.debug(e.getClass() + e.getMessage());
- return null;
- }
- }
- return utilisateur;
- }
+ /**
+ * utilisateur getter
+ * @return utilisateur
+ */
+ public Utilisateur getUtilisateur() {
+ Integer idPersonne = (Integer) getAttribute(ATTRIBUTE_UTILISATEUR);
+ Utilisateur utilisateur = null;
+ if (idPersonne != null) {
+ try {
+ utilisateur = personneService.loadUtilisateur(idPersonne);
+ } catch (DataNotFoundException e) {
+ logout();
+ } catch (Exception e) {
+ LOG.debug(e.getClass() + e.getMessage());
+ return null;
+ }
+ }
+ return utilisateur;
+ }
- /**
- * Connect the user (to do after authenticating)
- * @param utilisateur Utilisateur
- * @param rememberMe True if the authentication is saved in a cookie
- */
- public void connectUser(Utilisateur utilisateur, boolean rememberMe) {
- setUtilisateur(utilisateur);
- setRole(utilisateur.getTypeDroit() == TypeDroit.UTILISATEUR ? AuthRole.USER : AuthRole.ADMIN);
+ /**
+ * Connect the user (to do after authenticating)
+ * @param utilisateur Utilisateur
+ * @param rememberMe True if the authentication is saved in a cookie
+ */
+ public void connectUser(Utilisateur utilisateur, boolean rememberMe) {
+ setUtilisateur(utilisateur);
+ setRole(utilisateur.getTypeDroit() == TypeDroit.UTILISATEUR ? AuthRole.USER : AuthRole.ADMIN);
- setRememberMe(rememberMe);
- if (rememberMe) {
- WebApplication.get().getSecuritySettings().getAuthenticationStrategy()
- .save(utilisateur.getCourriel(), utilisateur.getPasswordHash());
- }
- }
+ setRememberMe(rememberMe);
+ if (rememberMe) {
+ WebApplication.get().getSecuritySettings().getAuthenticationStrategy()
+ .save(utilisateur.getCourriel(), utilisateur.getPasswordHash());
+ }
+ }
- /**
- * Logout action
- */
- public void logout() {
- setUtilisateur(null);
- setRememberMe(false);
- setRole(AuthRole.VISITOR);
- WebApplication.get().getSecuritySettings().getAuthenticationStrategy().remove();
- }
+ /**
+ * Logout action
+ */
+ public void logout() {
+ setUtilisateur(null);
+ setRememberMe(false);
+ setRole(AuthRole.VISITOR);
+ WebApplication.get().getSecuritySettings().getAuthenticationStrategy().remove();
+ }
- /**
- * rememberMe setter
- * @param rememberMe RememberMe
- */
- private void setRememberMe(Boolean rememberMe) {
- setAttribute(ATTRIBUTE_REMEMBER_ME, rememberMe);
- }
+ /**
+ * rememberMe setter
+ * @param rememberMe RememberMe
+ */
+ private void setRememberMe(Boolean rememberMe) {
+ setAttribute(ATTRIBUTE_REMEMBER_ME, rememberMe);
+ }
- /**
- * role setter
- * @param role Role
- */
- private void setRole(AuthRole role) {
- setAttribute(ATTRIBUTE_ROLE, role);
- }
+ /**
+ * role setter
+ * @param role Role
+ */
+ private void setRole(AuthRole role) {
+ setAttribute(ATTRIBUTE_ROLE, role);
+ }
- /**
- * utilisateur setter
- * @param utilisateur Utilisateur
- */
- private void setUtilisateur(Utilisateur utilisateur) {
- setAttribute(ATTRIBUTE_UTILISATEUR, utilisateur != null ? utilisateur.getIdPersonne() : null);
- }
+ /**
+ * utilisateur setter
+ * @param utilisateur Utilisateur
+ */
+ private void setUtilisateur(Utilisateur utilisateur) {
+ setAttribute(ATTRIBUTE_UTILISATEUR, utilisateur != null ? utilisateur.getIdPersonne() : null);
+ }
- /**
- * Login action
- * @param utilisateur Utilisateur
- */
- public void update(Utilisateur utilisateur) {
- connectUser(utilisateur, getRememberMe());
- }
+ /**
+ * Login action
+ * @param utilisateur Utilisateur
+ */
+ public void update(Utilisateur utilisateur) {
+ connectUser(utilisateur, getRememberMe());
+ }
}
Modified: trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthStrategy.java
===================================================================
--- trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthStrategy.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/security/AuthStrategy.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -36,22 +36,22 @@
*/
public final class AuthStrategy extends AbstractPageAuthorizationStrategy {
- /**
- * Check security
- * @param authorizedRoles Authorized roles
- * @return TRUE if the personne is authorized or if authorizedRoles is null or empty
- */
- public static boolean isAuthorized(AuthRole[] authorizedRoles) {
- return authorizedRoles == null
- || authorizedRoles.length == 0
- || new HashSet<AuthRole>(Arrays.asList(authorizedRoles)).contains(((AuthSession) Session.get())
- .getRole());
- }
+ /**
+ * Check security
+ * @param authorizedRoles Authorized roles
+ * @return TRUE if the personne is authorized or if authorizedRoles is null or empty
+ */
+ public static boolean isAuthorized(AuthRole[] authorizedRoles) {
+ return authorizedRoles == null
+ || authorizedRoles.length == 0
+ || new HashSet<AuthRole>(Arrays.asList(authorizedRoles)).contains(((AuthSession) Session.get())
+ .getRole());
+ }
- /** {@inheritDoc} */
- @Override
- protected <P extends Page> boolean isPageAuthorized(Class<P> pageClass) {
- AuthRoles roles = pageClass.getAnnotation(AuthRoles.class);
- return roles == null || isAuthorized(roles.value());
- }
+ /** {@inheritDoc} */
+ @Override
+ protected <P extends Page> boolean isPageAuthorized(Class<P> pageClass) {
+ AuthRoles roles = pageClass.getAnnotation(AuthRoles.class);
+ return roles == null || isAuthorized(roles.value());
+ }
}
Modified: trunk/cantharella.web/src/test/java/nc/ird/cantharella/web/AbstractWebTest.java
===================================================================
--- trunk/cantharella.web/src/test/java/nc/ird/cantharella/web/AbstractWebTest.java 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/cantharella.web/src/test/java/nc/ird/cantharella/web/AbstractWebTest.java 2013-01-29 09:48:04 UTC (rev 65)
@@ -41,11 +41,11 @@
@ContextConfiguration(loader = AnnotationConfigContextLoader.class, classes = WebContext.class)
public abstract class AbstractWebTest extends AbstractJUnit4SpringContextTests {
- /**
- * Initialization
- */
- @Before
- public void setUp() {
- applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
- }
+ /**
+ * Initialization
+ */
+ @Before
+ public void setUp() {
+ applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
+ }
}
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-28 17:34:37 UTC (rev 64)
+++ trunk/pom.xml 2013-01-29 09:48:04 UTC (rev 65)
@@ -1,5 +1,6 @@
<?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">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -97,7 +98,8 @@
<!-- license header configuration -->
<license.organizationName>
- IRD (Institut de Recherche pour le Developpement) and by respective authors (see below)
+ IRD (Institut de Recherche pour le
+ Developpement) and by respective authors (see below)
</license.organizationName>
<license.licenseName>agpl_v3</license.licenseName>
@@ -110,7 +112,7 @@
<log4jVersion>1.2.17</log4jVersion>
<junitVersion>4.11</junitVersion>
<version.slf4j>1.7.2</version.slf4j>
-
+
<version.postgresql>9.1-901-1.jdbc4</version.postgresql>
<version.h2>1.3.170</version.h2>
@@ -135,9 +137,10 @@
<version.servlet-api>2.5</version.servlet-api>
<version.wicket>1.5.6</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 -->
+
+ <!-- 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>
@@ -152,7 +155,7 @@
<pluginManagement>
<plugins>
-
+
<!-- plugin site -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
@@ -165,7 +168,7 @@
</dependencies>
</plugin>
-
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
@@ -215,12 +218,8 @@
<version>${version.opencsv}</version>
</dependency>
- <!-- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- <scope>runtime</scope>
- </dependency> -->
+ <!-- <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version> <scope>runtime</scope> </dependency> -->
<dependency>
<groupId>org.aspectj</groupId>
@@ -293,11 +292,8 @@
<version>${version.jpa}</version>
</dependency>
- <!--<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-c3p0</artifactId>
- <version>${version.hibernate}</version>
- </dependency>-->
+ <!--<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-c3p0</artifactId>
+ <version>${version.hibernate}</version> </dependency> -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
@@ -429,7 +425,7 @@
<version>${version.h2}</version>
</dependency>
- <!-- for JUnit Spring Test with @Configuration -->
+ <!-- for JUnit Spring Test with @Configuration -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
@@ -445,93 +441,37 @@
</dependencyManagement>
- <!--dependencies-->
+ <!--dependencies -->
- <!-- Dependencies for all layers -->
+ <!-- Dependencies for all layers -->
- <!--dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${version.commons-codec}</version>
- </dependency>
+ <!--dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId>
+ <version>${version.commons-codec}</version> </dependency> <dependency> <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId> <version>${version.javassist}</version>
+ <scope>runtime</scope> </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>jcl-over-slf4j</artifactId> <version>${version.slf4j}</version>
+ <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</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.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-test</artifactId>
+ <version>${version.spring}</version> <scope>test</scope> </dependency> <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>com.ibm.icu</groupId> <artifactId>icu4j</artifactId>
+ <version>${version.icu4j}</version> </dependency -->
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- <scope>runtime</scope>
- </dependency>
+ <!--/dependencies -->
- <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>jcl-over-slf4j</artifactId>
- <version>${version.slf4j}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</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.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-test</artifactId>
- <version>${version.spring}</version>
- <scope>test</scope>
- </dependency>
- <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>com.ibm.icu</groupId>
- <artifactId>icu4j</artifactId>
- <version>${version.icu4j}</version>
- </dependency-->
-
- <!--/dependencies-->
-
-
- <!--repositories>
- <repository>
- <id>repository.springframework.milestone</id>
- <name>Spring Framework Maven Milestone Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- </repository>
- </repositories-->
+ <!--repositories> <repository> <id>repository.springframework.milestone</id>
+ <name>Spring Framework Maven Milestone Repository</name> <url>http://maven.springframework.org/milestone</url>
+ </repository> </repositories -->
</project>
1
0
r64 - trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors
by echatellier@users.forge.codelutin.com 28 Jan '13
by echatellier@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: echatellier
Date: 2013-01-28 18:34:37 +0100 (Mon, 28 Jan 2013)
New Revision: 64
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/64
Log:
URL must be context relative
Modified:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java
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-01-28 17:18:32 UTC (rev 63)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-01-28 17:34:37 UTC (rev 64)
@@ -56,11 +56,11 @@
@Override
public void renderHead(Component component, IHeaderResponse response) {
- response.renderCSSReference("/ChemDoodleWeb/css/ChemDoodleWeb.css");
- response.renderJavaScriptReference("/js/jquery-1.9.0.min.js");
- response.renderJavaScriptReference("/ChemDoodleWeb/js/ChemDoodleWeb-libs.js");
- response.renderJavaScriptReference("/ChemDoodleWeb/js/ChemDoodleWeb.js");
- response.renderJavaScriptReference("/js/molviewer.js");
+ response.renderCSSReference("ChemDoodleWeb/css/ChemDoodleWeb.css");
+ response.renderJavaScriptReference("js/jquery-1.9.0.min.js");
+ response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb-libs.js");
+ response.renderJavaScriptReference("ChemDoodleWeb/js/ChemDoodleWeb.js");
+ response.renderJavaScriptReference("js/molviewer.js");
}
@Override
1
0
28 Jan '13
Author: echatellier
Date: 2013-01-28 18:18:32 +0100 (Mon, 28 Jan 2013)
New Revision: 63
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/63
Log:
Use autocompletefield to manage identifieePar input
Added:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java
Modified:
trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java
trunk/cantharella.data/src/main/resources/commons/sql/dev_update.sql
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/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/pages/domain/search/SearchPage.java
Added: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java
===================================================================
--- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java (rev 0)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -0,0 +1,51 @@
+/*
+ * #%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%
+ */
+package nc.ird.cantharella.data.dao.impl;
+
+import nc.ird.cantharella.data.dao.AbstractModelDao;
+import nc.ird.cantharella.data.model.Molecule;
+
+import org.hibernate.criterion.DetachedCriteria;
+import org.hibernate.criterion.Order;
+import org.hibernate.criterion.Projections;
+
+/**
+ * DAO molecules.
+ *
+ * @author Mickael Tricot
+ * @author Adrien Cheype
+ */
+public final class MoleculeDao extends AbstractModelDao {
+
+ /** Criteria : différents programmes des campagnes déjà saisis */
+ public static final DetachedCriteria CRITERIA_DISTINCT_MOLECULE_ORGANISMES = DetachedCriteria
+ .forClass(Molecule.class).setProjection(Projections.distinct(Projections.property("identifieePar")))
+ .addOrder(Order.asc("identifieePar"));
+
+ /**
+ * Constructor (prevents from instantiation)
+ */
+ private MoleculeDao() {
+ //
+ }
+}
Property changes on: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/dao/impl/MoleculeDao.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/model/Molecule.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -114,8 +114,9 @@
private Campagne campagne;
/** Identifiee par. */
- @Enumerated(EnumType.ORDINAL)
- private TypeOrganisme identifieePar;
+ @Length(max = LENGTH_MEDIUM_TEXT)
+ @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES)
+ private String identifieePar;
/** Publication d'origine */
@Lob
@@ -267,14 +268,14 @@
/**
* @return the identifieePar
*/
- public TypeOrganisme getIdentifieePar() {
+ public String getIdentifieePar() {
return identifieePar;
}
/**
* @param identifieePar the identifieePar to set
*/
- public void setIdentifieePar(TypeOrganisme identifieePar) {
+ public void setIdentifieePar(String identifieePar) {
this.identifieePar = identifieePar;
}
Modified: trunk/cantharella.data/src/main/resources/commons/sql/dev_update.sql
===================================================================
--- trunk/cantharella.data/src/main/resources/commons/sql/dev_update.sql 2013-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.data/src/main/resources/commons/sql/dev_update.sql 2013-01-28 17:18:32 UTC (rev 63)
@@ -48,7 +48,7 @@
publiOrigine text,
campagne_idCampagne int4,
createur_idPersonne int4 not null,
- identifieePar int4,
+ identifieePar varchar(60),
primary key (idMolecule)
)
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/MoleculeService.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -90,4 +90,10 @@
* @return TRUE s'il a le droit
*/
boolean updateOrdeleteMoleculeEnabled(Molecule molecule, Utilisateur utilisateur);
+
+ /**
+ * Liste les programmes des organismes déjà saisis
+ * @return Organisme des molécules
+ */
+ public List<String> listMoleculeOrganisme();
}
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/MoleculeServiceImpl.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -25,6 +25,8 @@
import java.util.List;
import nc.ird.cantharella.data.dao.GenericDao;
+import nc.ird.cantharella.data.dao.impl.CampagneDao;
+import nc.ird.cantharella.data.dao.impl.MoleculeDao;
import nc.ird.cantharella.data.exceptions.DataConstraintException;
import nc.ird.cantharella.data.exceptions.DataNotFoundException;
import nc.ird.cantharella.data.exceptions.UnexpectedException;
@@ -108,4 +110,11 @@
return utilisateur.getTypeDroit() == TypeDroit.ADMINISTRATEUR
|| utilisateur.getIdPersonne() == molecule.getCreateur().getIdPersonne();
}
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> listMoleculeOrganisme() {
+ return (List<String>) dao.list(MoleculeDao.CRITERIA_DISTINCT_MOLECULE_ORGANISMES);
+ }
}
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -133,8 +133,8 @@
setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), currentPage));
}
});
- columns.add(new EnumPropertyColumn<Molecule>(new Model<String>(getString("Molecule.identifieePar")), "identifieePar",
- "identifieePar", this));
+ columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.identifieePar")), "identifieePar",
+ "identifieePar"));
columns.add(new LinkableImagePropertyColumn<Molecule>("images/edit.png", getString("Update"), getString("Update")) {
// pas de lien d'édition si l'utilisateur n'a pas les droits
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html 2013-01-28 17:18:32 UTC (rev 63)
@@ -76,7 +76,7 @@
<div class="property">
<label for="Molecule.identifieePar"><wicket:message key="Molecule.identifieePar" /></label>
- <select id="Molecule.identifieePar" wicket:id="Molecule.identifieePar" />
+ <input type="text" id="Molecule.identifieePar" wicket:id="Molecule.identifieePar" />
</div>
<div class="property">
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -34,40 +34,34 @@
import nc.ird.cantharella.data.model.Fraction;
import nc.ird.cantharella.data.model.Molecule;
import nc.ird.cantharella.data.model.MoleculeProvenance;
-import nc.ird.cantharella.data.model.Personne;
import nc.ird.cantharella.data.model.Produit;
-import nc.ird.cantharella.data.model.ResultatTestBio;
import nc.ird.cantharella.data.model.Utilisateur;
-import nc.ird.cantharella.data.model.ResultatTestBio.TypeResultat;
import nc.ird.cantharella.data.model.Specimen.TypeOrganisme;
import nc.ird.cantharella.data.validation.utils.ModelValidator;
import nc.ird.cantharella.service.services.CampagneService;
import nc.ird.cantharella.service.services.MoleculeService;
import nc.ird.cantharella.service.services.PersonneService;
import nc.ird.cantharella.service.services.ProduitService;
-import nc.ird.cantharella.service.utils.normalizers.UniqueFieldNormalizer;
-import nc.ird.cantharella.service.utils.normalizers.utils.Normalizer;
import nc.ird.cantharella.web.pages.TemplatePage;
import nc.ird.cantharella.web.pages.domain.campagne.ManageCampagnePage;
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.PersonneRenderer;
import nc.ird.cantharella.web.pages.renderers.ProduitRenderer;
import nc.ird.cantharella.web.utils.CallerPage;
import nc.ird.cantharella.web.utils.behaviors.JSConfirmationBehavior;
import nc.ird.cantharella.web.utils.behaviors.MoleculeEditorBehavior;
import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
+import nc.ird.cantharella.web.utils.forms.AutoCompleteTextFieldString;
import nc.ird.cantharella.web.utils.forms.SubmittableButton;
import nc.ird.cantharella.web.utils.forms.SubmittableButtonEvents;
+import nc.ird.cantharella.web.utils.forms.AutoCompleteTextFieldString.ComparisonMode;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.panels.PropertyLabelLinkProduitPanel;
-import nc.ird.cantharella.web.utils.renderers.EnumChoiceRenderer;
import nc.ird.cantharella.web.utils.security.AuthRole;
import nc.ird.cantharella.web.utils.security.AuthRoles;
import nc.ird.module.utils.LogTools;
-import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.MarkupContainer;
@@ -185,6 +179,7 @@
}
// Initialisation des listes
+ List<String> organismes = moleculeService.listMoleculeOrganisme();
campagnes = campagneService.listCampagnes(getSession().getUtilisateur());
final Form<Void> formView = new Form<Void>("Form");
@@ -220,10 +215,8 @@
}
});
- DropDownChoice<TypeOrganisme> identifieeParInput = new DropDownChoice<TypeOrganisme>("Molecule.identifieePar",
- new PropertyModel<TypeOrganisme>(moleculeModel, "identifieePar"),
- Arrays.asList(TypeOrganisme.values()), new EnumChoiceRenderer<TypeOrganisme>(this));
- //identifieeParInput.setNullValid(false);
+ AutoCompleteTextFieldString identifieeParInput = new AutoCompleteTextFieldString("Molecule.identifieePar",
+ new PropertyModel<String>(moleculeModel, "identifieePar"), organismes, ComparisonMode.CONTAINS);
nouvMoleculRefresh.add(identifieeParInput);
DropDownChoice<Campagne> campagnesInput = new DropDownChoice<Campagne>("Molecule.campagne",
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -22,7 +22,6 @@
*/
package nc.ird.cantharella.web.pages.domain.molecule;
-import java.math.BigDecimal;
import java.util.List;
import nc.ird.cantharella.data.exceptions.DataConstraintException;
@@ -33,17 +32,12 @@
import nc.ird.cantharella.data.model.MoleculeProvenance;
import nc.ird.cantharella.data.model.Personne;
import nc.ird.cantharella.data.model.Produit;
-import nc.ird.cantharella.data.model.Station;
-import nc.ird.cantharella.data.model.Utilisateur;
import nc.ird.cantharella.service.services.MoleculeService;
-import nc.ird.cantharella.web.config.WebContext;
import nc.ird.cantharella.web.pages.TemplatePage;
import nc.ird.cantharella.web.pages.domain.extraction.ReadExtractionPage;
import nc.ird.cantharella.web.pages.domain.lot.ManageLotPage;
import nc.ird.cantharella.web.pages.domain.personne.ReadPersonnePage;
import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage;
-import nc.ird.cantharella.web.pages.domain.station.ReadStationPage;
-import nc.ird.cantharella.web.pages.renderers.ProduitRenderer;
import nc.ird.cantharella.web.utils.CallerPage;
import nc.ird.cantharella.web.utils.behaviors.JSConfirmationBehavior;
import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
@@ -52,7 +46,6 @@
import nc.ird.cantharella.web.utils.forms.SubmittableButtonEvents;
import nc.ird.cantharella.web.utils.models.DisplayBooleanPropertyModel;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel;
-import nc.ird.cantharella.web.utils.models.DisplayMapValuePropertyModel;
import nc.ird.cantharella.web.utils.models.DisplayDecimalPropertyModel.DecimalDisplFormat;
import nc.ird.cantharella.web.utils.models.GenericLoadableDetachableModel;
import nc.ird.cantharella.web.utils.panels.PropertyLabelLinkPanel;
@@ -62,14 +55,10 @@
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
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-01-28 17:17:45 UTC (rev 62)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-01-28 17:18:32 UTC (rev 63)
@@ -613,8 +613,8 @@
setResponsePage(new ReadCampagnePage(model.getObject().getCampagne().getIdCampagne(), currentPage));
}
});
- columns.add(new EnumPropertyColumn<Molecule>(new Model<String>(getString("Molecule.identifieePar")), "identifieePar",
- "identifieePar", this));
+ columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.identifieePar")), "identifieePar",
+ "identifieePar"));
final DataTable<Molecule> moleculesDataTable = new AjaxFallbackDefaultDataTable<Molecule>(
getResource() + ".Molecules.Results", columns,
1
0
r62 - trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors
by echatellier@users.forge.codelutin.com 28 Jan '13
by echatellier@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: echatellier
Date: 2013-01-28 18:17:45 +0100 (Mon, 28 Jan 2013)
New Revision: 62
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/62
Log:
URL must be context relative
Modified:
trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java
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-01-28 16:02:08 UTC (rev 61)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-01-28 17:17:45 UTC (rev 62)
@@ -56,14 +56,14 @@
@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.0.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.renderCSSReference("ChemDoodleWeb/css/ChemDoodleWeb.css");
+ response.renderCSSReference("ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css");
+ response.renderJavaScriptReference("js/jquery-1.9.0.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");
}
@Override
1
0
r61 - in trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain: molecule search
by echatellier@users.forge.codelutin.com 28 Jan '13
by echatellier@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: echatellier
Date: 2013-01-28 17:02:08 +0100 (Mon, 28 Jan 2013)
New Revision: 61
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/61
Log:
Add molecule behaviour in search page
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/search/SearchPage.java
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-01-28 15:56:22 UTC (rev 60)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-01-28 16:02:08 UTC (rev 61)
@@ -25,13 +25,11 @@
import java.util.ArrayList;
import java.util.List;
-import nc.ird.cantharella.data.model.Lot;
import nc.ird.cantharella.data.model.Molecule;
import nc.ird.cantharella.service.services.MoleculeService;
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.ManageLotPage;
import nc.ird.cantharella.web.utils.CallerPage;
import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn;
@@ -39,7 +37,6 @@
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.columns.LinkableImagePropertyColumn.LinkableImagePanel;
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;
@@ -112,8 +109,6 @@
setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
}
});
-// columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol",
-// "formuleDevMol"));
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, "-")
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-01-28 15:56:22 UTC (rev 60)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/search/SearchPage.java 2013-01-28 16:02:08 UTC (rev 61)
@@ -45,7 +45,6 @@
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.ManageMoleculePage;
import nc.ird.cantharella.web.pages.domain.molecule.ReadMoleculePage;
import nc.ird.cantharella.web.pages.domain.purification.ReadPurificationPage;
import nc.ird.cantharella.web.pages.domain.specimen.ListSpecimensPage;
@@ -53,6 +52,7 @@
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;
@@ -63,7 +63,6 @@
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.columns.LinkableImagePropertyColumn.LinkableImagePanel;
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;
@@ -591,8 +590,12 @@
setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
}
});
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol",
- "formuleDevMol"));
+ 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",
1
0
28 Jan '13
Author: echatellier
Date: 2013-01-28 16:56:22 +0100 (Mon, 28 Jan 2013)
New Revision: 60
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/60
Log:
Update spring to 3.2.1
Modified:
trunk/cantharella.service/pom.xml
trunk/pom.xml
Modified: trunk/cantharella.service/pom.xml
===================================================================
--- trunk/cantharella.service/pom.xml 2013-01-24 16:53:20 UTC (rev 59)
+++ trunk/cantharella.service/pom.xml 2013-01-28 15:56:22 UTC (rev 60)
@@ -118,6 +118,11 @@
<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>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-24 16:53:20 UTC (rev 59)
+++ trunk/pom.xml 2013-01-28 15:56:22 UTC (rev 60)
@@ -126,7 +126,7 @@
<version.aspectj>1.6.8</version.aspectj>
<version.opencsv>2.3</version.opencsv>
<version.javassist>3.8.0.GA</version.javassist>
- <version.spring>3.2.0.RELEASE</version.spring>
+ <version.spring>3.2.1.RELEASE</version.spring>
<version.mail>1.4.5</version.mail>
<version.cglib>2.2.2</version.cglib>
@@ -267,6 +267,11 @@
</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>
1
0
r59 - in trunk/cantharella.web/src: . site site/rst site/rst/devel
by bpoussin@users.forge.codelutin.com 24 Jan '13
by bpoussin@users.forge.codelutin.com 24 Jan '13
24 Jan '13
Author: bpoussin
Date: 2013-01-24 17:53:20 +0100 (Thu, 24 Jan 2013)
New Revision: 59
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/59
Log:
add pseudo document on ChemDoodle integration (in french :()
Added:
trunk/cantharella.web/src/site/
trunk/cantharella.web/src/site/rst/
trunk/cantharella.web/src/site/rst/devel/
trunk/cantharella.web/src/site/rst/devel/integration-chemdoodle.rst
Added: trunk/cantharella.web/src/site/rst/devel/integration-chemdoodle.rst
===================================================================
--- trunk/cantharella.web/src/site/rst/devel/integration-chemdoodle.rst (rev 0)
+++ trunk/cantharella.web/src/site/rst/devel/integration-chemdoodle.rst 2013-01-24 16:53:20 UTC (rev 59)
@@ -0,0 +1,46 @@
+Principe
+========
+
+Création de deux scripts qui ajout le rendu ou l'editeur de molecule via les
+methodes: addViewerMolecule et addEditorMolecule.
+
+Création de deux behaviors, un pour la visualisation et un pour l'édition.
+
+Les behaviors ajoutent toutes les CSS et Script necessaire dans le Header
+
+Les behaviors force le positionnement de l'attribut id sur les elements qui
+portent la formule et ajout d'un attribut formula sur l'élement qui contient
+la formule.
+
+Ajout d'un script qui appelle soit addViewerMolecule et addEditorMolecule
+avec l'id de l'element.
+
+Visulisation
+============
+
+Le canvas de rendu prend la place de l'element precedent en gardant le meme
+id
+
+Edition
+=======
+
+Le canvas d'edition ce position apres l'element de la formule. Cet element
+peut-etre un input de type hidden.
+
+Le script apres avoir mis en place l'editeur, ce met listener du submit de
+la form pour pouvoir pousser dans le champs Hidden la valeur de la formule
+edite sous le format Mol.
+
+Dans Wicket
+===========
+
+Très peu de modification, seulement l'ajout du behavior sur les champs qui
+represente la formule brut. Et utilisation d'un champs Hidden dans la page
+web d'edition.
+
+ChemDoodle
+==========
+
+Tous les fichiers specifiques a ChemDoodle ont ete mis dans un seul
+repertoire pour facilement faire un changement de librairie si le besoin
+arrivait.
1
0
24 Jan '13
Author: bpoussin
Date: 2013-01-24 17:31:30 +0100 (Thu, 24 Jan 2013)
New Revision: 58
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/58
Log:
fix bug in editor when id contains dot '.'
Modified:
trunk/cantharella.web/src/main/webapp/js/moleditor.js
Modified: trunk/cantharella.web/src/main/webapp/js/moleditor.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/js/moleditor.js 2013-01-24 11:34:39 UTC (rev 57)
+++ trunk/cantharella.web/src/main/webapp/js/moleditor.js 2013-01-24 16:31:30 UTC (rev 58)
@@ -9,7 +9,7 @@
// il faut faire un substring de 1 car on a ajoute un caractere pour
// forcer l'existance du tag'
var formulaString = $(formulaTag).attr('formula').substring(1);
- var id = $(formulaTag).attr('id');
+ var id = $(formulaTag).attr('id').replace(/\./g, '_') + '_editor';
$(formulaTag).after("<div><canvas id='"+id+"'/><div>");
// changes the default JMol color of hydrogen to black so it appears on white backgrounds
1
0
r57 - in trunk/cantharella.web/src/main: java/nc/ird/cantharella/web/pages/domain/molecule java/nc/ird/cantharella/web/utils/behaviors webapp webapp/ChemDoodleWeb webapp/ChemDoodleWeb/css webapp/ChemDoodleWeb/css/images webapp/ChemDoodleWeb/js webapp/js
by bpoussin@users.forge.codelutin.com 24 Jan '13
by bpoussin@users.forge.codelutin.com 24 Jan '13
24 Jan '13
Author: bpoussin
Date: 2013-01-24 12:34:39 +0100 (Thu, 24 Jan 2013)
New Revision: 57
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/57
Log:
fixes #1647: Integrate ChemDoodleWeb for the molecule drawing
Added:
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/ChemDoodleWeb/
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/ChemDoodleWeb.css
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_aaaaaa_40x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_eeeeee_40x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_c0402a_40x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_eeeeee_40x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_100_f8f8f8_1x400.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_35_dddddd_1x400.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_60_eeeeee_1x400.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-hard_75_999999_1x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-soft_50_c9c9c9_1x100.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_3383bb_256x240.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_454545_256x240.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_70b2e1_256x240.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_999999_256x240.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_fbc856_256x240.png
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-libs.js
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb.js
trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js
trunk/cantharella.web/src/main/webapp/js/jquery-1.9.0.min.js
trunk/cantharella.web/src/main/webapp/js/moleditor.js
trunk/cantharella.web/src/main/webapp/js/molviewer.js
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/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
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-01-18 17:07:45 UTC (rev 56)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ListMoleculesPage.java 2013-01-24 11:34:39 UTC (rev 57)
@@ -33,6 +33,7 @@
import nc.ird.cantharella.web.pages.domain.campagne.ReadCampagnePage;
import nc.ird.cantharella.web.pages.domain.lot.ManageLotPage;
import nc.ird.cantharella.web.utils.CallerPage;
+import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
import nc.ird.cantharella.web.utils.columns.BooleanPropertyColumn;
import nc.ird.cantharella.web.utils.columns.DecimalPropertyColumn;
import nc.ird.cantharella.web.utils.columns.EnumPropertyColumn;
@@ -47,6 +48,7 @@
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;
@@ -56,6 +58,7 @@
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;
/**
@@ -109,8 +112,15 @@
setResponsePage(new ReadMoleculePage(model.getObject().getIdMolecule(), currentPage));
}
});
- columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol",
- "formuleDevMol"));
+// columns.add(new PropertyColumn<Molecule>(new Model<String>(getString("Molecule.formuleDevMol")), "formuleDevMol",
+// "formuleDevMol"));
+ 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",
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-01-18 17:07:45 UTC (rev 56)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.html 2013-01-24 11:34:39 UTC (rev 57)
@@ -40,7 +40,7 @@
<div class="property">
<label for="Molecule.formuleDevMol"><wicket:message key="Molecule.formuleDevMol" /></label>
- <input type="text" id="Molecule.formuleDevMol" wicket:id="Molecule.formuleDevMol" />
+ <input type="hidden" id="Molecule.formuleDevMol" wicket:id="Molecule.formuleDevMol" />
</div>
<div class="property">
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-01-18 17:07:45 UTC (rev 56)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ManageMoleculePage.java 2013-01-24 11:34:39 UTC (rev 57)
@@ -55,6 +55,7 @@
import nc.ird.cantharella.web.pages.renderers.ProduitRenderer;
import nc.ird.cantharella.web.utils.CallerPage;
import nc.ird.cantharella.web.utils.behaviors.JSConfirmationBehavior;
+import nc.ird.cantharella.web.utils.behaviors.MoleculeEditorBehavior;
import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
import nc.ird.cantharella.web.utils.forms.SubmittableButton;
import nc.ird.cantharella.web.utils.forms.SubmittableButtonEvents;
@@ -79,6 +80,7 @@
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.HiddenField;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.Link;
@@ -190,7 +192,8 @@
formView.add(new TextField<String>("Molecule.nomCommun", new PropertyModel<String>(moleculeModel, "nomCommun")));
formView.add(new TextField<String>("Molecule.familleChimique", new PropertyModel<String>(moleculeModel, "familleChimique")));
- formView.add(new TextField<String>("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol")));
+ formView.add(new HiddenField<String>("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol"))
+ .add(new MoleculeEditorBehavior(new PropertyModel<String>(moleculeModel, "formuleDevMol")))); //moleculeModel.getObject().getFormuleDevMol())));
formView.add(new TextField<String>("Molecule.nomIupca", new PropertyModel<String>(moleculeModel, "nomIupca")));
formView.add(new TextField<String>("Molecule.formuleBrute", new PropertyModel<String>(moleculeModel, "formuleBrute")));
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-01-18 17:07:45 UTC (rev 56)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/pages/domain/molecule/ReadMoleculePage.java 2013-01-24 11:34:39 UTC (rev 57)
@@ -46,6 +46,7 @@
import nc.ird.cantharella.web.pages.renderers.ProduitRenderer;
import nc.ird.cantharella.web.utils.CallerPage;
import nc.ird.cantharella.web.utils.behaviors.JSConfirmationBehavior;
+import nc.ird.cantharella.web.utils.behaviors.MoleculeViewBehavior;
import nc.ird.cantharella.web.utils.behaviors.ReplaceEmptyLabelBehavior;
import nc.ird.cantharella.web.utils.forms.SubmittableButton;
import nc.ird.cantharella.web.utils.forms.SubmittableButtonEvents;
@@ -111,7 +112,8 @@
add(new Label("Molecule.idMolecule", new PropertyModel<String>(moleculeModel, "idMolecule")));
add(new Label("Molecule.nomCommun", new PropertyModel<String>(moleculeModel, "nomCommun")).add(new ReplaceEmptyLabelBehavior()));
add(new Label("Molecule.familleChimique", new PropertyModel<String>(moleculeModel, "familleChimique")).add(new ReplaceEmptyLabelBehavior()));
- add(new Label("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol")).add(new ReplaceEmptyLabelBehavior()));
+ add(new Label("Molecule.formuleDevMol", new PropertyModel<String>(moleculeModel, "formuleDevMol")).add(new ReplaceEmptyLabelBehavior())
+ .add(new MoleculeViewBehavior(new PropertyModel<String>(moleculeModel, "formuleDevMol"))));
add(new Label("Molecule.nomIupca", new PropertyModel<String>(moleculeModel, "nomIupca")).add(new ReplaceEmptyLabelBehavior()));
add(new Label("Molecule.formuleBrute", new PropertyModel<String>(moleculeModel, "formuleBrute")).add(new ReplaceEmptyLabelBehavior()));
add(new Label("Molecule.masseMolaire", new DisplayDecimalPropertyModel(moleculeModel, "masseMolaire", DecimalDisplFormat.SMALL, getLocale())).add(new ReplaceEmptyLabelBehavior()));
Added: 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 (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeEditorBehavior.java 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,86 @@
+/*
+ * #%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.behaviors;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.util.string.JavaScriptUtils;
+
+/**
+ * Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
+ * utilise en javascript pour ajouter la visualisation de la formule
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class MoleculeEditorBehavior extends AttributeModifier {
+
+ private static final long serialVersionUID = 1L;
+
+ public MoleculeEditorBehavior(IModel<?> replaceModel) {
+ super("formula", replaceModel);
+ }
+
+ @Override
+ 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;
+ }
+
+ @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.0.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");
+ }
+
+ @Override
+ public void beforeRender(Component component) {
+ // il faut que l'element HTML est forcement un identifiant pour pouvoir
+ // travailler avec
+ component.setOutputMarkupId(true);
+ }
+
+ @Override
+ public void afterRender(Component component) {
+ Response response = component.getResponse();
+ final String id = component.getMarkupId();
+
+ response.write(JavaScriptUtils.SCRIPT_OPEN_TAG);
+
+ response.write("addEditorMolecule('"+id+"');");
+ response.write(JavaScriptUtils.SCRIPT_CLOSE_TAG);
+ }
+}
Added: 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 (rev 0)
+++ trunk/cantharella.web/src/main/java/nc/ird/cantharella/web/utils/behaviors/MoleculeViewBehavior.java 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,84 @@
+/*
+ * #%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.behaviors;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.util.string.JavaScriptUtils;
+
+/**
+ * Permet d'ajouter la formule dans un attribut formula. L'attribut est ensuite
+ * utilise en javascript pour ajouter l'editeur de formule
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class MoleculeViewBehavior extends AttributeModifier {
+
+ private static final long serialVersionUID = 1L;
+
+ public MoleculeViewBehavior(IModel<?> replaceModel) {
+ super("formula", replaceModel);
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public void renderHead(Component component, IHeaderResponse response) {
+ response.renderCSSReference("/ChemDoodleWeb/css/ChemDoodleWeb.css");
+ response.renderJavaScriptReference("/js/jquery-1.9.0.min.js");
+ response.renderJavaScriptReference("/ChemDoodleWeb/js/ChemDoodleWeb-libs.js");
+ response.renderJavaScriptReference("/ChemDoodleWeb/js/ChemDoodleWeb.js");
+ response.renderJavaScriptReference("/js/molviewer.js");
+ }
+
+ @Override
+ public void beforeRender(Component component) {
+ // il faut que l'element HTML est forcement un identifiant pour pouvoir
+ // travailler avec
+ component.setOutputMarkupId(true);
+ }
+
+ @Override
+ public void afterRender(Component component) {
+ Response response = component.getResponse();
+ String id = component.getMarkupId();
+
+ response.write(JavaScriptUtils.SCRIPT_OPEN_TAG);
+
+ response.write("addViewerMolecule('"+id+"');");
+ response.write(JavaScriptUtils.SCRIPT_CLOSE_TAG);
+ }
+
+}
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/ChemDoodleWeb.css
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/ChemDoodleWeb.css (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/ChemDoodleWeb.css 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,3 @@
+canvas.ChemDoodleWebComponent {
+ border: 1px solid black;
+}
\ No newline at end of file
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_aaaaaa_40x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_aaaaaa_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_eeeeee_40x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_0_eeeeee_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_c0402a_40x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_c0402a_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_eeeeee_40x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_flat_55_eeeeee_40x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_100_f8f8f8_1x400.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_100_f8f8f8_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_35_dddddd_1x400.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_35_dddddd_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_60_eeeeee_1x400.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_glass_60_eeeeee_1x400.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-hard_75_999999_1x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-hard_75_999999_1x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-soft_50_c9c9c9_1x100.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-bg_inset-soft_50_c9c9c9_1x100.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_3383bb_256x240.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_3383bb_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_454545_256x240.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_454545_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_70b2e1_256x240.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_70b2e1_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_999999_256x240.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_999999_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_fbc856_256x240.png
===================================================================
(Binary files differ)
Property changes on: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/images/ui-icons_fbc856_256x240.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/css/jquery-ui-1.9.2.custom.css 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,386 @@
+/*! jQuery UI - v1.9.2 - 2012-11-29
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.button.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tooltip.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CHelvetica%2CAri…
+* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
+.ui-helper-clearfix:after { clear: both; }
+.ui-helper-clearfix { zoom: 1; }
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+/*iChemLabs - changed to "3px" from ".4em 1em;"*/
+.ui-button-text-only .ui-button-text { padding: 3px; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+/*iChemLabs - changed to "3px" from "7px"*/
+.ui-buttonset { margin-right: 3px; }
+/*iChemLabs - changed to "-1px" from "-.3em"*/
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -1px; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
+.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
+.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
+.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
+.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
+.ui-menu .ui-menu-item a.ui-state-focus,
+.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
+
+.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
+.ui-menu .ui-state-disabled a { cursor: default; }
+
+/* icon support */
+.ui-menu-icons { position: relative; }
+.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
+
+/* left-aligned */
+.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
+
+/* right-aligned */
+.ui-menu .ui-menu-icon { position: static; float: right; }
+.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
+.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
+.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
+.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
+.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
+.ui-spinner-up { top: 0; }
+.ui-spinner-down { bottom: 0; }
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+ /* need to fix icons sprite */
+ background-position:-65px -16px;
+}
+.ui-tooltip {
+ padding: 8px;
+ position: absolute;
+ z-index: 9999;
+ max-width: 300px;
+ -webkit-box-shadow: 0 0 5px #aaa;
+ box-shadow: 0 0 5px #aaa;
+}
+/* Fades and background-images don't work well together in IE6, drop the image */
+* html .ui-tooltip {
+ background-image: none;
+}
+body .ui-tooltip { border-width: 2px; }
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Trebuchet MS,Helvetica,Arial,sans-serif; font-size: 1.1em; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS,Helvetica,Arial,sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #aaaaaa; background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x; color: #333333; }
+.ui-widget-content a { color: #333333; }
+.ui-widget-header { border: 1px solid #bbbbbb; background: #dddddd url(images/ui-bg_glass_35_dddddd_1x400.png) 50% 50% repeat-x; color: #444444; font-weight: bold; }
+.ui-widget-header a { color: #444444; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #3383bb; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3383bb; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #bbbbbb; background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #599fcf; }
+.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #599fcf; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #999999; background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #ffffff; background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x; color: #444444; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #c0402a; background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x; color: #ffffff; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_999999_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_70b2e1_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbc856_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .8;filter:Alpha(Opacity=80); }
+.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .6;filter:Alpha(Opacity=60); -moz-border-radius: 0px; -khtml-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; }
\ No newline at end of file
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-libs.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-libs.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-libs.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,78 @@
+//
+// ChemDoodle Web Components uses the following open source software. None
+// of these libraries were modified in any way, and are included without
+// modification:
+//
+// - jQuery: Software URL: http://jquery.com/
+// License: MIT License
+// License URL: http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt
+// - jQuery: Software URL: http://plugins.jquery.com/project/mousewheel
+// _mousewheel License: MIT License
+// License URL: http://www.opensource.org/licenses/mit-license.php
+// - glMatrix: Software URL: http://code.google.com/p/glmatrix/
+// License: BSD License
+// License URL: http://www.opensource.org/licenses/bsd-license.php
+//
+//
+// =========================== glMatrix ===============================
+// gl-matrix 1.3.7 - https://github.com/toji/gl-matrix/blob/master/LICENSE.md
+(function(w,D){"object"===typeof exports?module.exports=D(global):"function"===typeof define&&define.amd?define([],function(){return D(w)}):D(w)})(this,function(w){function D(a){return o=a}function G(){return o="undefined"!==typeof Float32Array?Float32Array:Array}var E={};(function(){if("undefined"!=typeof Float32Array){var a=new Float32Array(1),b=new Int32Array(a.buffer);E.invsqrt=function(c){a[0]=c;b[0]=1597463007-(b[0]>>1);var d=a[0];return d*(1.5-0.5*c*d*d)}}else E.invsqrt=function(a){return 1/
+Math.sqrt(a)}})();var o=null;G();var r={create:function(a){var b=new o(3);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0;return b},createFrom:function(a,b,c){var d=new o(3);d[0]=a;d[1]=b;d[2]=c;return d},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])},add:function(a,b,c){if(!c||a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];
+return c},subtract:function(a,b,c){if(!c||a===c)return a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a;c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c},multiply:function(a,b,c){if(!c||a===c)return a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a;c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},scale:function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c},normalize:function(a,b){b||(b=a);var c=
+a[0],d=a[1],e=a[2],g=Math.sqrt(c*c+d*d+e*e);if(!g)return b[0]=0,b[1]=0,b[2]=0,b;if(1===g)return b[0]=c,b[1]=d,b[2]=e,b;g=1/g;b[0]=c*g;b[1]=d*g;b[2]=e*g;return b},cross:function(a,b,c){c||(c=a);var d=a[0],e=a[1],a=a[2],g=b[0],f=b[1],b=b[2];c[0]=e*b-a*f;c[1]=a*g-d*b;c[2]=d*f-e*g;return c},length:function(a){var b=a[0],c=a[1],a=a[2];return Math.sqrt(b*b+c*c+a*a)},squaredLength:function(a){var b=a[0],c=a[1],a=a[2];return b*b+c*c+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},direction:function(a,
+b,c){c||(c=a);var d=a[0]-b[0],e=a[1]-b[1],a=a[2]-b[2],b=Math.sqrt(d*d+e*e+a*a);if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/b;c[0]=d*b;c[1]=e*b;c[2]=a*b;return c},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);return d},dist:function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)}},H=null,y=new o(4);r.unproject=function(a,b,c,d,e){e||(e=a);H||(H=x.create());var g=H;y[0]=2*(a[0]-d[0])/d[2]-1;y[1]=2*(a[1]-d[1])/d[3]-1;y[2]=
+2*a[2]-1;y[3]=1;x.multiply(c,b,g);if(!x.inverse(g))return null;x.multiplyVec4(g,y);if(0===y[3])return null;e[0]=y[0]/y[3];e[1]=y[1]/y[3];e[2]=y[2]/y[3];return e};var L=r.createFrom(1,0,0),M=r.createFrom(0,1,0),N=r.createFrom(0,0,1),z=r.create();r.rotationTo=function(a,b,c){c||(c=k.create());var d=r.dot(a,b);if(1<=d)k.set(O,c);else if(-0.999999>d)r.cross(L,a,z),1.0E-6>r.length(z)&&r.cross(M,a,z),1.0E-6>r.length(z)&&r.cross(N,a,z),r.normalize(z),k.fromAngleAxis(Math.PI,z,c);else{var d=Math.sqrt(2*(1+
+d)),e=1/d;r.cross(a,b,z);c[0]=z[0]*e;c[1]=z[1]*e;c[2]=z[2]*e;c[3]=0.5*d;k.normalize(c)}1<c[3]?c[3]=1:-1>c[3]&&(c[3]=-1);return c};r.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var A={create:function(a){var b=new o(9);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0;return b},createFrom:function(a,b,c,d,e,g,f,h,j){var i=new o(9);i[0]=a;i[1]=b;i[2]=c;i[3]=d;i[4]=e;i[5]=g;i[6]=f;i[7]=h;i[8]=j;return i},
+determinant:function(a){var b=a[3],c=a[4],d=a[5],e=a[6],g=a[7],f=a[8];return a[0]*(f*c-d*g)+a[1]*(-f*b+d*e)+a[2]*(g*b-c*e)},inverse:function(a,b){var c=a[0],d=a[1],e=a[2],g=a[3],f=a[4],h=a[5],j=a[6],i=a[7],m=a[8],l=m*f-h*i,C=-m*g+h*j,q=i*g-f*j,n=c*l+d*C+e*q;if(!n)return null;n=1/n;b||(b=A.create());b[0]=l*n;b[1]=(-m*d+e*i)*n;b[2]=(h*d-e*f)*n;b[3]=C*n;b[4]=(m*c-e*j)*n;b[5]=(-h*c+e*g)*n;b[6]=q*n;b[7]=(-i*c+d*j)*n;b[8]=(f*c-d*g)*n;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2],
+f=a[3],h=a[4],j=a[5],i=a[6],m=a[7],a=a[8],l=b[0],C=b[1],q=b[2],n=b[3],k=b[4],p=b[5],o=b[6],s=b[7],b=b[8];c[0]=l*d+C*f+q*i;c[1]=l*e+C*h+q*m;c[2]=l*g+C*j+q*a;c[3]=n*d+k*f+p*i;c[4]=n*e+k*h+p*m;c[5]=n*g+k*j+p*a;c[6]=o*d+s*f+b*i;c[7]=o*e+s*h+b*m;c[8]=o*g+s*j+b*a;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0],b=b[1];c[0]=d*a[0]+b*a[3]+a[6];c[1]=d*a[1]+b*a[4]+a[7];return c},multiplyVec3:function(a,b,c){c||(c=b);var d=b[0],e=b[1],b=b[2];c[0]=d*a[0]+e*a[3]+b*a[6];c[1]=d*a[1]+e*a[4]+b*a[7];c[2]=
+d*a[2]+e*a[5]+b*a[8];return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])&&1.0E-6>Math.abs(a[3]-b[3])&&1.0E-6>Math.abs(a[4]-b[4])&&1.0E-6>Math.abs(a[5]-b[5])&&1.0E-6>Math.abs(a[6]-b[6])&&1.0E-6>Math.abs(a[7]-b[7])&&1.0E-6>Math.abs(a[8]-b[8])},identity:function(a){a||(a=A.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;
+a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[5];a[1]=a[3];a[2]=a[6];a[3]=c;a[5]=a[7];a[6]=d;a[7]=e;return a}b[0]=a[0];b[1]=a[3];b[2]=a[6];b[3]=a[1];b[4]=a[4];b[5]=a[7];b[6]=a[2];b[7]=a[5];b[8]=a[8];return b},toMat4:function(a,b){b||(b=x.create());b[15]=1;b[14]=0;b[13]=0;b[12]=0;b[11]=0;b[10]=a[8];b[9]=a[7];b[8]=a[6];b[7]=0;b[6]=a[5];b[5]=a[4];b[4]=a[3];b[3]=0;b[2]=a[2];b[1]=a[1];b[0]=a[0];return b},str:function(a){return"["+a[0]+", "+a[1]+
+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+"]"}},x={create:function(a){var b=new o(16);a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]);return b},createFrom:function(a,b,c,d,e,g,f,h,j,i,m,l,C,q,n,k){var p=new o(16);p[0]=a;p[1]=b;p[2]=c;p[3]=d;p[4]=e;p[5]=g;p[6]=f;p[7]=h;p[8]=j;p[9]=i;p[10]=m;p[11]=l;p[12]=C;p[13]=q;p[14]=n;p[15]=k;return p},set:function(a,
+b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])&&1.0E-6>Math.abs(a[3]-b[3])&&1.0E-6>Math.abs(a[4]-b[4])&&1.0E-6>Math.abs(a[5]-b[5])&&1.0E-6>Math.abs(a[6]-b[6])&&1.0E-6>Math.abs(a[7]-b[7])&&1.0E-6>Math.abs(a[8]-b[8])&&1.0E-6>Math.abs(a[9]-b[9])&&1.0E-6>
+Math.abs(a[10]-b[10])&&1.0E-6>Math.abs(a[11]-b[11])&&1.0E-6>Math.abs(a[12]-b[12])&&1.0E-6>Math.abs(a[13]-b[13])&&1.0E-6>Math.abs(a[14]-b[14])&&1.0E-6>Math.abs(a[15]-b[15])},identity:function(a){a||(a=x.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[3],g=a[6],f=a[7],h=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=c;a[6]=a[9];a[7]=a[13];a[8]=d;a[9]=g;a[11]=
+a[14];a[12]=e;a[13]=f;a[14]=h;return a}b[0]=a[0];b[1]=a[4];b[2]=a[8];b[3]=a[12];b[4]=a[1];b[5]=a[5];b[6]=a[9];b[7]=a[13];b[8]=a[2];b[9]=a[6];b[10]=a[10];b[11]=a[14];b[12]=a[3];b[13]=a[7];b[14]=a[11];b[15]=a[15];return b},determinant:function(a){var b=a[0],c=a[1],d=a[2],e=a[3],g=a[4],f=a[5],h=a[6],j=a[7],i=a[8],m=a[9],l=a[10],C=a[11],q=a[12],n=a[13],k=a[14],a=a[15];return q*m*h*e-i*n*h*e-q*f*l*e+g*n*l*e+i*f*k*e-g*m*k*e-q*m*d*j+i*n*d*j+q*c*l*j-b*n*l*j-i*c*k*j+b*m*k*j+q*f*d*C-g*n*d*C-q*c*h*C+b*n*h*C+
+g*c*k*C-b*f*k*C-i*f*d*a+g*m*d*a+i*c*h*a-b*m*h*a-g*c*l*a+b*f*l*a},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],g=a[3],f=a[4],h=a[5],j=a[6],i=a[7],m=a[8],l=a[9],k=a[10],q=a[11],n=a[12],o=a[13],p=a[14],r=a[15],s=c*h-d*f,v=c*j-e*f,t=c*i-g*f,u=d*j-e*h,w=d*i-g*h,x=e*i-g*j,y=m*o-l*n,z=m*p-k*n,F=m*r-q*n,A=l*p-k*o,D=l*r-q*o,E=k*r-q*p,B=s*E-v*D+t*A+u*F-w*z+x*y;if(!B)return null;B=1/B;b[0]=(h*E-j*D+i*A)*B;b[1]=(-d*E+e*D-g*A)*B;b[2]=(o*x-p*w+r*u)*B;b[3]=(-l*x+k*w-q*u)*B;b[4]=(-f*E+j*F-i*z)*B;b[5]=
+(c*E-e*F+g*z)*B;b[6]=(-n*x+p*t-r*v)*B;b[7]=(m*x-k*t+q*v)*B;b[8]=(f*D-h*F+i*y)*B;b[9]=(-c*D+d*F-g*y)*B;b[10]=(n*w-o*t+r*s)*B;b[11]=(-m*w+l*t-q*s)*B;b[12]=(-f*A+h*z-j*y)*B;b[13]=(c*A-d*z+e*y)*B;b[14]=(-n*u+o*v-p*s)*B;b[15]=(m*u-l*v+k*s)*B;return b},toRotationMat:function(a,b){b||(b=x.create());b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},toMat3:function(a,b){b||(b=A.create());b[0]=
+a[0];b[1]=a[1];b[2]=a[2];b[3]=a[4];b[4]=a[5];b[5]=a[6];b[6]=a[8];b[7]=a[9];b[8]=a[10];return b},toInverseMat3:function(a,b){var c=a[0],d=a[1],e=a[2],g=a[4],f=a[5],h=a[6],j=a[8],i=a[9],m=a[10],l=m*f-h*i,k=-m*g+h*j,q=i*g-f*j,n=c*l+d*k+e*q;if(!n)return null;n=1/n;b||(b=A.create());b[0]=l*n;b[1]=(-m*d+e*i)*n;b[2]=(h*d-e*f)*n;b[3]=k*n;b[4]=(m*c-e*j)*n;b[5]=(-h*c+e*g)*n;b[6]=q*n;b[7]=(-i*c+d*j)*n;b[8]=(f*c-d*g)*n;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2],f=a[3],h=a[4],j=a[5],
+i=a[6],m=a[7],l=a[8],k=a[9],q=a[10],n=a[11],o=a[12],p=a[13],r=a[14],a=a[15],s=b[0],v=b[1],t=b[2],u=b[3];c[0]=s*d+v*h+t*l+u*o;c[1]=s*e+v*j+t*k+u*p;c[2]=s*g+v*i+t*q+u*r;c[3]=s*f+v*m+t*n+u*a;s=b[4];v=b[5];t=b[6];u=b[7];c[4]=s*d+v*h+t*l+u*o;c[5]=s*e+v*j+t*k+u*p;c[6]=s*g+v*i+t*q+u*r;c[7]=s*f+v*m+t*n+u*a;s=b[8];v=b[9];t=b[10];u=b[11];c[8]=s*d+v*h+t*l+u*o;c[9]=s*e+v*j+t*k+u*p;c[10]=s*g+v*i+t*q+u*r;c[11]=s*f+v*m+t*n+u*a;s=b[12];v=b[13];t=b[14];u=b[15];c[12]=s*d+v*h+t*l+u*o;c[13]=s*e+v*j+t*k+u*p;c[14]=s*g+
+v*i+t*q+u*r;c[15]=s*f+v*m+t*n+u*a;return c},multiplyVec3:function(a,b,c){c||(c=b);var d=b[0],e=b[1],b=b[2];c[0]=a[0]*d+a[4]*e+a[8]*b+a[12];c[1]=a[1]*d+a[5]*e+a[9]*b+a[13];c[2]=a[2]*d+a[6]*e+a[10]*b+a[14];return c},multiplyVec4:function(a,b,c){c||(c=b);var d=b[0],e=b[1],g=b[2],b=b[3];c[0]=a[0]*d+a[4]*e+a[8]*g+a[12]*b;c[1]=a[1]*d+a[5]*e+a[9]*g+a[13]*b;c[2]=a[2]*d+a[6]*e+a[10]*g+a[14]*b;c[3]=a[3]*d+a[7]*e+a[11]*g+a[15]*b;return c},translate:function(a,b,c){var d=b[0],e=b[1],b=b[2],g,f,h,j,i,m,l,k,q,
+n,o,p;if(!c||a===c)return a[12]=a[0]*d+a[4]*e+a[8]*b+a[12],a[13]=a[1]*d+a[5]*e+a[9]*b+a[13],a[14]=a[2]*d+a[6]*e+a[10]*b+a[14],a[15]=a[3]*d+a[7]*e+a[11]*b+a[15],a;g=a[0];f=a[1];h=a[2];j=a[3];i=a[4];m=a[5];l=a[6];k=a[7];q=a[8];n=a[9];o=a[10];p=a[11];c[0]=g;c[1]=f;c[2]=h;c[3]=j;c[4]=i;c[5]=m;c[6]=l;c[7]=k;c[8]=q;c[9]=n;c[10]=o;c[11]=p;c[12]=g*d+i*e+q*b+a[12];c[13]=f*d+m*e+n*b+a[13];c[14]=h*d+l*e+o*b+a[14];c[15]=j*d+k*e+p*b+a[15];return c},scale:function(a,b,c){var d=b[0],e=b[1],b=b[2];if(!c||a===c)return a[0]*=
+d,a[1]*=d,a[2]*=d,a[3]*=d,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=b,a[9]*=b,a[10]*=b,a[11]*=b,a;c[0]=a[0]*d;c[1]=a[1]*d;c[2]=a[2]*d;c[3]=a[3]*d;c[4]=a[4]*e;c[5]=a[5]*e;c[6]=a[6]*e;c[7]=a[7]*e;c[8]=a[8]*b;c[9]=a[9]*b;c[10]=a[10]*b;c[11]=a[11]*b;c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return c},rotate:function(a,b,c,d){var e=c[0],g=c[1],c=c[2],f=Math.sqrt(e*e+g*g+c*c),h,j,i,m,l,k,q,n,o,p,r,s,v,t,u,w,x,y,z,A;if(!f)return null;1!==f&&(f=1/f,e*=f,g*=f,c*=f);h=Math.sin(b);j=Math.cos(b);i=1-j;b=a[0];
+f=a[1];m=a[2];l=a[3];k=a[4];q=a[5];n=a[6];o=a[7];p=a[8];r=a[9];s=a[10];v=a[11];t=e*e*i+j;u=g*e*i+c*h;w=c*e*i-g*h;x=e*g*i-c*h;y=g*g*i+j;z=c*g*i+e*h;A=e*c*i+g*h;e=g*c*i-e*h;g=c*c*i+j;d?a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]):d=a;d[0]=b*t+k*u+p*w;d[1]=f*t+q*u+r*w;d[2]=m*t+n*u+s*w;d[3]=l*t+o*u+v*w;d[4]=b*x+k*y+p*z;d[5]=f*x+q*y+r*z;d[6]=m*x+n*y+s*z;d[7]=l*x+o*y+v*z;d[8]=b*A+k*e+p*g;d[9]=f*A+q*e+r*g;d[10]=m*A+n*e+s*g;d[11]=l*A+o*e+v*g;return d},rotateX:function(a,b,c){var d=Math.sin(b),
+b=Math.cos(b),e=a[4],g=a[5],f=a[6],h=a[7],j=a[8],i=a[9],m=a[10],l=a[11];c?a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[4]=e*b+j*d;c[5]=g*b+i*d;c[6]=f*b+m*d;c[7]=h*b+l*d;c[8]=e*-d+j*b;c[9]=g*-d+i*b;c[10]=f*-d+m*b;c[11]=h*-d+l*b;return c},rotateY:function(a,b,c){var d=Math.sin(b),b=Math.cos(b),e=a[0],g=a[1],f=a[2],h=a[3],j=a[8],i=a[9],m=a[10],l=a[11];c?a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=
+a[15]):c=a;c[0]=e*b+j*-d;c[1]=g*b+i*-d;c[2]=f*b+m*-d;c[3]=h*b+l*-d;c[8]=e*d+j*b;c[9]=g*d+i*b;c[10]=f*d+m*b;c[11]=h*d+l*b;return c},rotateZ:function(a,b,c){var d=Math.sin(b),b=Math.cos(b),e=a[0],g=a[1],f=a[2],h=a[3],j=a[4],i=a[5],m=a[6],l=a[7];c?a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=e*b+j*d;c[1]=g*b+i*d;c[2]=f*b+m*d;c[3]=h*b+l*d;c[4]=e*-d+j*b;c[5]=g*-d+i*b;c[6]=f*-d+m*b;c[7]=h*-d+l*b;return c},frustum:function(a,b,c,d,e,g,f){f||
+(f=x.create());var h=b-a,j=d-c,i=g-e;f[0]=2*e/h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2*e/j;f[6]=0;f[7]=0;f[8]=(b+a)/h;f[9]=(d+c)/j;f[10]=-(g+e)/i;f[11]=-1;f[12]=0;f[13]=0;f[14]=-(2*g*e)/i;f[15]=0;return f},perspective:function(a,b,c,d,e){a=c*Math.tan(a*Math.PI/360);b*=a;return x.frustum(-b,b,-a,a,c,d,e)},ortho:function(a,b,c,d,e,g,f){f||(f=x.create());var h=b-a,j=d-c,i=g-e;f[0]=2/h;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2/j;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=-2/i;f[11]=0;f[12]=-(a+b)/h;f[13]=-(d+c)/j;f[14]=
+-(g+e)/i;f[15]=1;return f},lookAt:function(a,b,c,d){d||(d=x.create());var e,g,f,h,j,i,m,l,k=a[0],o=a[1],a=a[2];f=c[0];h=c[1];g=c[2];m=b[0];c=b[1];e=b[2];if(k===m&&o===c&&a===e)return x.identity(d);b=k-m;c=o-c;m=a-e;l=1/Math.sqrt(b*b+c*c+m*m);b*=l;c*=l;m*=l;e=h*m-g*c;g=g*b-f*m;f=f*c-h*b;(l=Math.sqrt(e*e+g*g+f*f))?(l=1/l,e*=l,g*=l,f*=l):f=g=e=0;h=c*f-m*g;j=m*e-b*f;i=b*g-c*e;(l=Math.sqrt(h*h+j*j+i*i))?(l=1/l,h*=l,j*=l,i*=l):i=j=h=0;d[0]=e;d[1]=h;d[2]=b;d[3]=0;d[4]=g;d[5]=j;d[6]=c;d[7]=0;d[8]=f;d[9]=
+i;d[10]=m;d[11]=0;d[12]=-(e*k+g*o+f*a);d[13]=-(h*k+j*o+i*a);d[14]=-(b*k+c*o+m*a);d[15]=1;return d},fromRotationTranslation:function(a,b,c){c||(c=x.create());var d=a[0],e=a[1],g=a[2],f=a[3],h=d+d,j=e+e,i=g+g,a=d*h,m=d*j,d=d*i,k=e*j,e=e*i,g=g*i,h=f*h,j=f*j,f=f*i;c[0]=1-(k+g);c[1]=m+f;c[2]=d-j;c[3]=0;c[4]=m-f;c[5]=1-(a+g);c[6]=e+h;c[7]=0;c[8]=d+j;c[9]=e-h;c[10]=1-(a+k);c[11]=0;c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+
+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},k={create:function(a){var b=new o(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,d){var e=new o(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])&&1.0E-6>
+Math.abs(a[3]-b[3])},identity:function(a){a||(a=k.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},O=k.identity();k.calculateW=function(a,b){var c=a[0],d=a[1],e=a[2];if(!b||a===b)return a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a;b[0]=c;b[1]=d;b[2]=e;b[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e));return b};k.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]};k.inverse=function(a,b){var c=a[0],d=a[1],e=a[2],g=a[3],c=(c=c*c+d*d+e*e+g*g)?1/c:0;if(!b||a===b)return a[0]*=-c,a[1]*=-c,a[2]*=-c,a[3]*=
+c,a;b[0]=-a[0]*c;b[1]=-a[1]*c;b[2]=-a[2]*c;b[3]=a[3]*c;return b};k.conjugate=function(a,b){if(!b||a===b)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b};k.length=function(a){var b=a[0],c=a[1],d=a[2],a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)};k.normalize=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],g=a[3],f=Math.sqrt(c*c+d*d+e*e+g*g);if(0===f)return b[0]=0,b[1]=0,b[2]=0,b[3]=0,b;f=1/f;b[0]=c*f;b[1]=d*f;b[2]=e*f;b[3]=g*f;return b};k.add=function(a,b,c){if(!c||
+a===c)return a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+=b[3],a;c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c};k.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2],a=a[3],f=b[0],h=b[1],j=b[2],b=b[3];c[0]=d*b+a*f+e*j-g*h;c[1]=e*b+a*h+g*f-d*j;c[2]=g*b+a*j+d*h-e*f;c[3]=a*b-d*f-e*h-g*j;return c};k.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],g=b[2],b=a[0],f=a[1],h=a[2],a=a[3],j=a*d+f*g-h*e,i=a*e+h*d-b*g,k=a*g+b*e-f*d,d=-b*d-f*e-h*g;c[0]=j*a+d*-b+i*-h-k*-f;c[1]=i*a+
+d*-f+k*-b-j*-h;c[2]=k*a+d*-h+j*-f-i*-b;return c};k.scale=function(a,b,c){if(!c||a===c)return a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a;c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c};k.toMat3=function(a,b){b||(b=A.create());var c=a[0],d=a[1],e=a[2],g=a[3],f=c+c,h=d+d,j=e+e,i=c*f,k=c*h,c=c*j,l=d*h,d=d*j,e=e*j,f=g*f,h=g*h,g=g*j;b[0]=1-(l+e);b[1]=k+g;b[2]=c-h;b[3]=k-g;b[4]=1-(i+e);b[5]=d+f;b[6]=c+h;b[7]=d-f;b[8]=1-(i+l);return b};k.toMat4=function(a,b){b||(b=x.create());var c=a[0],d=a[1],e=a[2],g=
+a[3],f=c+c,h=d+d,j=e+e,i=c*f,k=c*h,c=c*j,l=d*h,d=d*j,e=e*j,f=g*f,h=g*h,g=g*j;b[0]=1-(l+e);b[1]=k+g;b[2]=c-h;b[3]=0;b[4]=k-g;b[5]=1-(i+e);b[6]=d+f;b[7]=0;b[8]=c+h;b[9]=d-f;b[10]=1-(i+l);b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};k.slerp=function(a,b,c,d){d||(d=a);var e=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],g,f;if(1<=Math.abs(e))return d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d;g=Math.acos(e);f=Math.sqrt(1-e*e);if(0.001>Math.abs(f))return d[0]=0.5*a[0]+0.5*b[0],d[1]=0.5*a[1]+0.5*b[1],
+d[2]=0.5*a[2]+0.5*b[2],d[3]=0.5*a[3]+0.5*b[3],d;e=Math.sin((1-c)*g)/f;c=Math.sin(c*g)/f;d[0]=a[0]*e+b[0]*c;d[1]=a[1]*e+b[1]*c;d[2]=a[2]*e+b[2]*c;d[3]=a[3]*e+b[3]*c;return d};k.fromRotationMatrix=function(a,b){b||(b=k.create());var c=a[0]+a[4]+a[8],d;if(0<c)d=Math.sqrt(c+1),b[3]=0.5*d,d=0.5/d,b[0]=(a[7]-a[5])*d,b[1]=(a[2]-a[6])*d,b[2]=(a[3]-a[1])*d;else{d=k.fromRotationMatrix.s_iNext=k.fromRotationMatrix.s_iNext||[1,2,0];c=0;a[4]>a[0]&&(c=1);a[8]>a[3*c+c]&&(c=2);var e=d[c],g=d[e];d=Math.sqrt(a[3*c+
+c]-a[3*e+e]-a[3*g+g]+1);b[c]=0.5*d;d=0.5/d;b[3]=(a[3*g+e]-a[3*e+g])*d;b[e]=(a[3*e+c]+a[3*c+e])*d;b[g]=(a[3*g+c]+a[3*c+g])*d}return b};A.toQuat4=k.fromRotationMatrix;(function(){var a=A.create();k.fromAxes=function(b,c,d,e){a[0]=c[0];a[3]=c[1];a[6]=c[2];a[1]=d[0];a[4]=d[1];a[7]=d[2];a[2]=b[0];a[5]=b[1];a[8]=b[2];return k.fromRotationMatrix(a,e)}})();k.identity=function(a){a||(a=k.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};k.fromAngleAxis=function(a,b,c){c||(c=k.create());var a=0.5*a,d=Math.sin(a);
+c[3]=Math.cos(a);c[0]=d*b[0];c[1]=d*b[1];c[2]=d*b[2];return c};k.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0<c?(b[3]=2*Math.acos(a[3]),c=E.invsqrt(c),b[0]=a[0]*c,b[1]=a[1]*c,b[2]=a[2]*c):(b[3]=0,b[0]=1,b[1]=0,b[2]=0);return b};k.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var J={create:function(a){var b=new o(2);a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0);return b},createFrom:function(a,b){var c=new o(2);c[0]=a;c[1]=b;return c},add:function(a,b,c){c||
+(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},set:function(a,b){b[0]=a[0];b[1]=a[1];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-
+b[0])&&1.0E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0],a=a[1];return Math.sqrt(b*b+a*a)},squaredLength:function(a){var b=a[0],a=a[1];return b*b+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,
+b,c){c||(c=a);var d=a[0]-b[0],a=a[1]-b[1],b=d*d+a*a;if(!b)return c[0]=0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=d*b;c[1]=a*b;return c},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);return d},str:function(a){return"["+a[0]+", "+a[1]+"]"}},I={create:function(a){var b=new o(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,d){var e=new o(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},set:function(a,b){b[0]=a[0];b[1]=a[1];
+b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])&&1.0E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=I.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],g=a[3],f=c*g-e*
+d;if(!f)return null;f=1/f;b[0]=g*f;b[1]=-d*f;b[2]=-e*f;b[3]=c*f;return b},multiply:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2],a=a[3];c[0]=d*b[0]+e*b[2];c[1]=d*b[1]+e*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var d=a[0],e=a[1],g=a[2],a=a[3],f=Math.sin(b),b=Math.cos(b);c[0]=d*b+e*f;c[1]=d*-f+e*b;c[2]=g*b+a*f;c[3]=g*-f+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var d=b[0],b=b[1];c[0]=d*a[0]+b*a[1];c[1]=d*a[2]+b*a[3];return c},scale:function(a,
+b,c){c||(c=a);var d=a[1],e=a[2],g=a[3],f=b[0],b=b[1];c[0]=a[0]*f;c[1]=d*b;c[2]=e*f;c[3]=g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},K={create:function(a){var b=new o(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,d){var e=new o(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=
+b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1.0E-6>Math.abs(a[0]-b[0])&&1.0E-6>
+Math.abs(a[1]-b[1])&&1.0E-6>Math.abs(a[2]-b[2])&&1.0E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b||(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],d=a[2],a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)},squaredLength:function(a){var b=a[0],c=a[1],d=a[2],a=a[3];return b*b+c*c+d*d+a*a},lerp:function(a,b,c,d){d||(d=a);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},str:function(a){return"["+a[0]+", "+
+a[1]+", "+a[2]+", "+a[3]+"]"}};w&&(w.glMatrixArrayType=o,w.MatrixArray=o,w.setMatrixArrayType=D,w.determineMatrixArrayType=G,w.glMath=E,w.vec2=J,w.vec3=r,w.vec4=K,w.mat2=I,w.mat3=A,w.mat4=x,w.quat4=k);return{glMatrixArrayType:o,MatrixArray:o,setMatrixArrayType:D,determineMatrixArrayType:G,glMath:E,vec2:J,vec3:r,vec4:K,mat2:I,mat3:A,mat4:x,quat4:k}});//
+// =========================== jQuery ===============================
+/*! jQuery v1.8.3 jquery.com | jquery.org/license */
+(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (LICENSE.txt).
+ *
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
+ *
+ * Version: 3.0.6
+ *
+ * Requires: 1.2.2+
+ */
+(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb-sketcher.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,261 @@
+//
+// ChemDoodle Web Components 5.0.0
+//
+// http://web.chemdoodle.com
+//
+// Copyright 2009-2012 iChemLabs, LLC. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// As a special exception to the GPL, any HTML file in a public website
+// or any free web service which merely makes function calls to this
+// code, and for that purpose includes it by reference, shall be deemed
+// a separate work for copyright law purposes. If you modify this code,
+// you may extend this exception to your version of the code, but you
+// are not obligated to do so. If you do not wish to do so, delete this
+// exception statement from your version.
+//
+// As an additional exception to the GPL, you may distribute this
+// packed form of the code without the copy of the GPL license normally
+// required, provided you include this license notice and a URL through
+// which recipients can access the corresponding unpacked source code.
+//
+// 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.
+//
+// Please contact iChemLabs <http://www.ichemlabs.com/contact> for
+// alternate licensing options.
+//
+ChemDoodle.sketcher=function(){var a={actions:{},gui:{}};a.gui.desktop={};a.gui.mobile={};a.states={};a.tools={};return a}();(function(a){a._Action=function(){this.forward=function(a){this.innerForward();this.checks(a)};this.reverse=function(a){this.innerReverse();this.checks(a)};this.checks=function(a){for(var f=0,c=a.molecules.length;f<c;f++)a.molecules[f].check();a.lasso&&a.lasso.isActive()&&a.lasso.setBounds();a.repaint()};return!0}})(ChemDoodle.sketcher.actions);
+(function(a,d,f,c){f.AddAction=function(e,b,a,j){this.sketcher=e;this.a=b;this.as=a;this.bs=j;return!0};f.AddAction.prototype=new f._Action;f.AddAction.prototype.innerForward=function(){var e=this.sketcher.getMoleculeByAtom(this.a);e||(e=new d.Molecule,this.sketcher.molecules.push(e));if(this.as)for(var b=0,a=this.as.length;b<a;b++)e.atoms.push(this.as[b]);if(this.bs){for(var j=[],b=0,a=this.bs.length;b<a;b++){var m=this.bs[b];if(-1===c(m.a1,e.atoms)){var g=this.sketcher.getMoleculeByAtom(m.a1);-1===
+c(g,j)&&j.push(g)}-1===c(m.a2,e.atoms)&&(g=this.sketcher.getMoleculeByAtom(m.a2),-1===c(g,j)&&j.push(g));e.bonds.push(m)}b=0;for(a=j.length;b<a;b++)m=j[b],this.sketcher.removeMolecule(m),e.atoms=e.atoms.concat(m.atoms),e.bonds=e.bonds.concat(m.bonds)}};f.AddAction.prototype.innerReverse=function(){var e=this.sketcher.getMoleculeByAtom(this.a);if(this.as){for(var b=[],d=0,j=e.atoms.length;d<j;d++)-1===c(e.atoms[d],this.as)&&b.push(e.atoms[d]);e.atoms=b}if(this.bs){b=[];d=0;for(j=e.bonds.length;d<j;d++)-1===
+c(e.bonds[d],this.bs)&&b.push(e.bonds[d]);e.bonds=b}if(0===e.atoms.length)this.sketcher.removeMolecule(e);else if(b=(new a.Splitter).split(e),1<b.length){this.sketcher.removeMolecule(e);d=0;for(j=b.length;d<j;d++)this.sketcher.molecules.push(b[d])}}})(ChemDoodle.informatics,ChemDoodle.structures,ChemDoodle.sketcher.actions,jQuery.inArray);
+(function(a){a.AddShapeAction=function(a,f){this.sketcher=a;this.s=f;return!0};a.AddShapeAction.prototype=new a._Action;a.AddShapeAction.prototype.innerForward=function(){this.sketcher.shapes.push(this.s)};a.AddShapeAction.prototype.innerReverse=function(){this.sketcher.removeShape(this.s)}})(ChemDoodle.sketcher.actions);
+(function(a,d){a.ChangeBondAction=function(a,c,e){this.b=a;this.orderBefore=a.bondOrder;this.stereoBefore=a.stereo;c?(this.orderAfter=c,this.stereoAfter=e):(this.orderAfter=a.bondOrder+1,3<this.orderAfter&&(this.orderAfter=1),this.stereoAfter=d.STEREO_NONE);return!0};a.ChangeBondAction.prototype=new a._Action;a.ChangeBondAction.prototype.innerForward=function(){this.b.bondOrder=this.orderAfter;this.b.stereo=this.stereoAfter};a.ChangeBondAction.prototype.innerReverse=function(){this.b.bondOrder=this.orderBefore;
+this.b.stereo=this.stereoBefore}})(ChemDoodle.sketcher.actions,ChemDoodle.structures.Bond);(function(a){a.ChangeChargeAction=function(a,f){this.a=a;this.delta=f;return!0};a.ChangeChargeAction.prototype=new a._Action;a.ChangeChargeAction.prototype.innerForward=function(){this.a.charge+=this.delta};a.ChangeChargeAction.prototype.innerReverse=function(){this.a.charge-=this.delta}})(ChemDoodle.sketcher.actions);
+(function(a){a.ChangeCoordinatesAction=function(a,f){this.as=a;this.recs=[];for(var c=0,e=this.as.length;c<e;c++)this.recs[c]={xo:this.as[c].x,yo:this.as[c].y,xn:f[c].x,yn:f[c].y};return!0};a.ChangeCoordinatesAction.prototype=new a._Action;a.ChangeCoordinatesAction.prototype.innerForward=function(){for(var a=0,f=this.as.length;a<f;a++)this.as[a].x=this.recs[a].xn,this.as[a].y=this.recs[a].yn};a.ChangeCoordinatesAction.prototype.innerReverse=function(){for(var a=0,f=this.as.length;a<f;a++)this.as[a].x=
+this.recs[a].xo,this.as[a].y=this.recs[a].yo}})(ChemDoodle.sketcher.actions);(function(a){a.ChangeLabelAction=function(a,f){this.a=a;this.before=a.label;this.after=f;return!0};a.ChangeLabelAction.prototype=new a._Action;a.ChangeLabelAction.prototype.innerForward=function(){this.a.label=this.after};a.ChangeLabelAction.prototype.innerReverse=function(){this.a.label=this.before}})(ChemDoodle.sketcher.actions);
+(function(a){a.ChangeLonePairAction=function(a,f){this.a=a;this.delta=f;return!0};a.ChangeLonePairAction.prototype=new a._Action;a.ChangeLonePairAction.prototype.innerForward=function(){this.a.numLonePair+=this.delta};a.ChangeLonePairAction.prototype.innerReverse=function(){this.a.numLonePair-=this.delta}})(ChemDoodle.sketcher.actions);
+(function(a){a.ChangeRadicalAction=function(a,f){this.a=a;this.delta=f;return!0};a.ChangeRadicalAction.prototype=new a._Action;a.ChangeRadicalAction.prototype.innerForward=function(){this.a.numRadical+=this.delta};a.ChangeRadicalAction.prototype.innerReverse=function(){this.a.numRadical-=this.delta}})(ChemDoodle.sketcher.actions);
+(function(a){a.ChangeRgroupAction=function(a,f){this.a=a;this.rbefore=a.rgroup;this.rafter=f;return!0};a.ChangeRgroupAction.prototype=new a._Action;a.ChangeRgroupAction.prototype.innerForward=function(){this.a.rgroup=this.rafter};a.ChangeRgroupAction.prototype.innerReverse=function(){this.a.rgroup=this.rbefore}})(ChemDoodle.sketcher.actions);
+(function(a,d){d.ClearAction=function(d){this.sketcher=d;this.beforeMols=this.sketcher.molecules;this.beforeShapes=this.sketcher.shapes;this.sketcher.clear();this.sketcher.oneMolecule&&(this.afterMol=new a.Molecule,this.afterMol.atoms.push(new a.Atom),this.sketcher.molecules.push(this.afterMol),this.sketcher.center(),this.sketcher.repaint());return!0};d.ClearAction.prototype=new d._Action;d.ClearAction.prototype.innerForward=function(){this.sketcher.molecules=[];this.sketcher.shapes=[];this.sketcher.oneMolecule&&
+this.sketcher.molecules.push(this.afterMol)};d.ClearAction.prototype.innerReverse=function(){this.sketcher.molecules=this.beforeMols;this.sketcher.shapes=this.beforeShapes}})(ChemDoodle.structures,ChemDoodle.sketcher.actions);
+(function(a){a.DeleteAction=function(a,f,c,e){this.sketcher=a;this.a=f;this.as=c;this.bs=e;this.ss=[];return!0};a.DeleteAction.prototype=new a._Action;a.DeleteAction.prototype.innerForwardAReverse=a.AddAction.prototype.innerReverse;a.DeleteAction.prototype.innerReverseAForward=a.AddAction.prototype.innerForward;a.DeleteAction.prototype.innerForward=function(){this.innerForwardAReverse();for(var a=0,f=this.ss.length;a<f;a++)this.sketcher.removeShape(this.ss[a])};a.DeleteAction.prototype.innerReverse=
+function(){this.innerReverseAForward();0<this.ss.length&&(this.sketcher.shapes=this.sketcher.shapes.concat(this.ss))}})(ChemDoodle.sketcher.actions);
+(function(a,d,f){d.DeleteContentAction=function(a,e,b){this.sketcher=a;this.as=e;this.ss=b;this.bs=[];a=0;for(e=this.sketcher.molecules.length;a<e;a++)for(var b=this.sketcher.molecules[a],d=0,j=b.bonds.length;d<j;d++){var m=b.bonds[d];m.a1.isLassoed&&m.a2.isLassoed&&this.bs.push(m)}return!0};d.DeleteContentAction.prototype=new d._Action;d.DeleteContentAction.prototype.innerForward=function(){for(var c=0,e=this.ss.length;c<e;c++)this.sketcher.removeShape(this.ss[c]);for(var b=[],d=[],c=0,e=this.sketcher.molecules.length;c<
+e;c++){for(var j=this.sketcher.molecules[c],m=0,g=j.atoms.length;m<g;m++){var l=j.atoms[m];-1===f(l,this.as)&&b.push(l)}m=0;for(g=j.bonds.length;m<g;m++)l=j.bonds[m],-1===f(l,this.bs)&&d.push(l)}this.sketcher.molecules=(new a.Splitter).split({atoms:b,bonds:d})};d.DeleteContentAction.prototype.innerReverse=function(){this.sketcher.shapes=this.sketcher.shapes.concat(this.ss);for(var c=[],e=[],b=0,d=this.sketcher.molecules.length;b<d;b++)var j=this.sketcher.molecules[b],c=c.concat(j.atoms),e=e.concat(j.bonds);
+this.sketcher.molecules=(new a.Splitter).split({atoms:c.concat(this.as),bonds:e.concat(this.bs)})}})(ChemDoodle.informatics,ChemDoodle.sketcher.actions,jQuery.inArray);(function(a){a.DeleteShapeAction=function(a,f){this.sketcher=a;this.s=f;return!0};a.DeleteShapeAction.prototype=new a._Action;a.DeleteShapeAction.prototype.innerForward=a.AddShapeAction.prototype.innerReverse;a.DeleteShapeAction.prototype.innerReverse=a.AddShapeAction.prototype.innerForward})(ChemDoodle.sketcher.actions);
+(function(a){a.FlipBondAction=function(a){this.b=a;return!0};a.FlipBondAction.prototype=new a._Action;a.FlipBondAction.prototype.innerForward=function(){var a=this.b.a1;this.b.a1=this.b.a2;this.b.a2=a};a.FlipBondAction.prototype.innerReverse=function(){this.innerForward()}})(ChemDoodle.sketcher.actions);
+(function(a){a.MoveAction=function(a,f){this.ps=a;this.dif=f;return!0};a.MoveAction.prototype=new a._Action;a.MoveAction.prototype.innerForward=function(){for(var a=0,f=this.ps.length;a<f;a++)this.ps[a].add(this.dif)};a.MoveAction.prototype.innerReverse=function(){for(var a=0,f=this.ps.length;a<f;a++)this.ps[a].sub(this.dif)}})(ChemDoodle.sketcher.actions);
+(function(a,d){d.NewMoleculeAction=function(a,c,e){this.sketcher=a;this.as=c;this.bs=e;return!0};d.NewMoleculeAction.prototype=new d._Action;d.NewMoleculeAction.prototype.innerForward=function(){var d=new a.Molecule;d.atoms=d.atoms.concat(this.as);d.bonds=d.bonds.concat(this.bs);d.check();this.sketcher.addMolecule(d)};d.NewMoleculeAction.prototype.innerReverse=function(){this.sketcher.removeMolecule(this.sketcher.getMoleculeByAtom(this.as[0]))}})(ChemDoodle.structures,ChemDoodle.sketcher.actions);
+(function(a,d){a.RotateAction=function(a,c,e){this.ps=a;this.dif=c;this.center=e;return!0};a.RotateAction.prototype=new a._Action;a.RotateAction.prototype.innerForward=function(){for(var a=0,c=this.ps.length;a<c;a++){var e=this.ps[a],b=this.center.distance(e),h=this.center.angle(e)+this.dif;e.x=this.center.x+b*d.cos(h);e.y=this.center.y-b*d.sin(h)}};a.RotateAction.prototype.innerReverse=function(){for(var a=0,c=this.ps.length;a<c;a++){var e=this.ps[a],b=this.center.distance(e),h=this.center.angle(e)-
+this.dif;e.x=this.center.x+b*d.cos(h);e.y=this.center.y-b*d.sin(h)}}})(ChemDoodle.sketcher.actions,Math);
+(function(a){a.SwitchMoleculeAction=function(a,f){this.sketcher=a;this.beforeMols=this.sketcher.molecules;this.beforeShapes=this.sketcher.shapes;this.molA=f;return!0};a.SwitchMoleculeAction.prototype=new a._Action;a.SwitchMoleculeAction.prototype.innerForward=function(){this.sketcher.loadMolecule(this.molA)};a.SwitchMoleculeAction.prototype.innerReverse=function(){this.sketcher.molecules=this.beforeMols;this.sketcher.shapes=this.beforeShapes}})(ChemDoodle.sketcher.actions);
+(function(a){a.ToggleAnyAtomAction=function(a){this.a=a;return!0};a.ToggleAnyAtomAction.prototype=new a._Action;a.ToggleAnyAtomAction.prototype.innerForward=function(){this.a.any=!this.a.any};a.ToggleAnyAtomAction.prototype.innerReverse=a.ToggleAnyAtomAction.prototype.innerForward})(ChemDoodle.sketcher.actions);
+(function(a){a.HistoryManager=function(a){this.sketcher=a;this.undoStack=[];this.redoStack=[];return!0};a.HistoryManager.prototype.undo=function(){if(0!==this.undoStack.length){this.sketcher.lasso&&this.sketcher.lasso.isActive()&&this.sketcher.lasso.empty();var a=this.undoStack.pop();a.reverse(this.sketcher);this.redoStack.push(a);0===this.undoStack.length&&this.sketcher.toolbarManager.buttonUndo.disable();this.sketcher.toolbarManager.buttonRedo.enable()}};a.HistoryManager.prototype.redo=function(){if(0!==
+this.redoStack.length){this.sketcher.lasso&&this.sketcher.lasso.isActive()&&this.sketcher.lasso.empty();var a=this.redoStack.pop();a.forward(this.sketcher);this.undoStack.push(a);this.sketcher.toolbarManager.buttonUndo.enable();0===this.redoStack.length&&this.sketcher.toolbarManager.buttonRedo.disable()}};a.HistoryManager.prototype.pushUndo=function(a){a.forward(this.sketcher);this.undoStack.push(a);0!==this.redoStack.length&&(this.redoStack=[]);this.sketcher.toolbarManager.buttonUndo.enable();this.sketcher.toolbarManager.buttonRedo.disable()};
+a.HistoryManager.prototype.clear=function(){0!==this.undoStack.length&&(this.undoStack=[],this.sketcher.toolbarManager.buttonUndo.disable());0!==this.redoStack.length&&(this.redoStack=[],this.sketcher.toolbarManager.buttonRedo.disable())}})(ChemDoodle.sketcher.actions);
+(function(a,d,f,c,e,b,h,j){c._State=function(){return!0};c._State.prototype.setup=function(a){this.sketcher=a};c._State.prototype.clearHover=function(){this.sketcher.hovering&&(this.sketcher.hovering.isHover=!1,this.sketcher.hovering.isSelected=!1,this.sketcher.hovering=void 0)};c._State.prototype.findHoveredObject=function(a,g,e,b){this.clearHover();var i=Infinity,j,c=this.sketcher.specs.bondLength;this.sketcher.isMobile||(c/=this.sketcher.specs.scale);if(g)for(var g=0,d=this.sketcher.molecules.length;g<
+d;g++)for(var h=this.sketcher.molecules[g],f=0,r=h.atoms.length;f<r;f++){var v=h.atoms[f];v.isHover=!1;var t=a.p.distance(v);t<c&&t<i&&(i=t,j=v)}if(e){g=0;for(d=this.sketcher.molecules.length;g<d;g++){h=this.sketcher.molecules[g];f=0;for(r=h.bonds.length;f<r;f++)e=h.bonds[f],e.isHover=!1,t=a.p.distance(e.getCenter()),t<c&&t<i&&(i=t,j=e)}}if(b){g=0;for(d=this.sketcher.shapes.length;g<d;g++){b=this.sketcher.shapes[g];b.isHover=!1;b.hoverPoint=void 0;e=b.getPoints();f=0;for(r=e.length;f<r;f++)h=e[f],
+t=a.p.distance(h),t<c&&t<i&&(i=t,j=b,b.hoverPoint=h)}if(!j){g=0;for(d=this.sketcher.shapes.length;g<d;g++)b=this.sketcher.shapes[g],b.isOver(a.p,c)&&(j=b)}}j&&(j.isHover=!0,this.sketcher.hovering=j)};c._State.prototype.getOptimumAngle=function(e){var g=this.sketcher.getMoleculeByAtom(e),e=g.getAngles(e),b=0;if(0===e.length)b=j.PI/6;else if(1===e.length){for(var c,b=0,i=g.bonds.length;b<i;b++)g.bonds[b].contains(this.sketcher.hovering)&&(c=g.bonds[b]);3<=c.bondOrder?b=e[0]+j.PI:(g=2*(e[0]%j.PI),b=
+a.isBetween(g,0,j.PI/2)||a.isBetween(g,j.PI,3*j.PI/2)?e[0]+2*j.PI/3:e[0]-2*j.PI/3)}else b=a.angleBetweenLargest(e).angle;return b};c._State.prototype.removeStartAtom=function(){this.sketcher.startAtom&&(this.sketcher.startAtom.x=-10,this.sketcher.startAtom.y=-10,this.sketcher.repaint())};c._State.prototype.enter=function(){this.innerenter&&this.innerenter()};c._State.prototype.exit=function(){this.innerexit&&this.innerexit()};c._State.prototype.click=function(a){this.innerclick&&this.innerclick(a)};
+c._State.prototype.rightclick=function(a){this.innerrightclick&&this.innerrightclick(a)};c._State.prototype.dblclick=function(a){this.innerdblclick&&this.innerdblclick(a);if(!this.sketcher.hovering){var a=new e.Point(this.sketcher.width/2,this.sketcher.height/2),g=this.sketcher.getContentBounds();a.x-=(g.maxX+g.minX)/2;a.y-=(g.maxY+g.minY)/2;this.sketcher.historyManager.pushUndo(new f.MoveAction(this.sketcher.getAllPoints(),a))}};c._State.prototype.mousedown=function(a){this.sketcher.lastPoint=a.p;
+this.sketcher.isHelp||this.sketcher.isMobile&&10>a.op.distance(this.sketcher.helpPos)?(this.sketcher.isHelp=!1,this.sketcher.repaint(),window.open("http://web.chemdoodle.com/sketcher")):this.innermousedown&&this.innermousedown(a)};c._State.prototype.rightmousedown=function(a){this.innerrightmousedown&&this.innerrightmousedown(a)};c._State.prototype.mousemove=function(a){this.innermousemove&&this.innermousemove(a);this.sketcher.repaint()};c._State.prototype.mouseout=function(a){this.innermouseout&&
+this.innermouseout(a)};c._State.prototype.mouseover=function(a){this.innermouseover&&this.innermouseover(a)};c._State.prototype.mouseup=function(a){this.parentAction=void 0;this.innermouseup&&this.innermouseup(a)};c._State.prototype.rightmouseup=function(a){this.innerrightmouseup&&this.innerrightmouseup(a)};c._State.prototype.mousewheel=function(a,e){this.innermousewheel&&this.innermousewheel(a);this.sketcher.specs.scale+=e/10;this.sketcher.checkScale();this.sketcher.repaint()};c._State.prototype.drag=
+function(a){this.innerdrag&&this.innerdrag(a);if(!this.sketcher.hovering&&this!==this.sketcher.stateManager.STATE_LASSO&&this!==this.sketcher.stateManager.STATE_SHAPE&&this!==this.sketcher.stateManager.STATE_PUSHER){if(d.SHIFT)if(this.parentAction){var g=this.parentAction.center,b=g.angle(this.sketcher.lastPoint),c=g.angle(a.p),i=c-b;this.parentAction.dif+=i;b=0;for(c=this.parentAction.ps.length;b<c;b++){var h=this.parentAction.ps[b],k=g.distance(h),p=g.angle(h)+i;h.x=g.x+k*j.cos(p);h.y=g.y-k*j.sin(p)}b=
+0;for(c=this.sketcher.molecules.length;b<c;b++)this.sketcher.molecules[b].check()}else g=new e.Point(this.sketcher.width/2,this.sketcher.height/2),b=g.angle(this.sketcher.lastPoint),c=g.angle(a.p),this.parentAction=new f.RotateAction(this.sketcher.getAllPoints(),c-b,g),this.sketcher.historyManager.pushUndo(this.parentAction);else{if(!this.sketcher.lastPoint)return;g=new e.Point(a.p.x,a.p.y);g.sub(this.sketcher.lastPoint);if(this.parentAction){this.parentAction.dif.add(g);b=0;for(c=this.parentAction.ps.length;b<
+c;b++)this.parentAction.ps[b].add(g);this.sketcher.lasso&&this.sketcher.lasso.isActive()&&(this.sketcher.lasso.bounds.minX+=g.x,this.sketcher.lasso.bounds.maxX+=g.x,this.sketcher.lasso.bounds.minY+=g.y,this.sketcher.lasso.bounds.maxY+=g.y);b=0;for(c=this.sketcher.molecules.length;b<c;b++)this.sketcher.molecules[b].check()}else this.parentAction=new f.MoveAction(this.sketcher.getAllPoints(),g),this.sketcher.historyManager.pushUndo(this.parentAction)}this.sketcher.repaint()}this.sketcher.lastPoint=
+a.p};c._State.prototype.keydown=function(c){if(d.CANVAS_DRAGGING===this.sketcher)this.sketcher.lastPoint&&(c.p=this.sketcher.lastPoint,this.drag(c));else if(d.META)90===c.which?this.sketcher.historyManager.undo():89===c.which?this.sketcher.historyManager.redo():83===c.which?this.sketcher.toolbarManager.buttonSave.getElement().click():79===c.which?this.sketcher.toolbarManager.buttonOpen.getElement().click():78===c.which?this.sketcher.toolbarManager.buttonClear.getElement().click():187===c.which||61===
+c.which?this.sketcher.toolbarManager.buttonScalePlus.getElement().click():189===c.which||109===c.which?this.sketcher.toolbarManager.buttonScaleMinus.getElement().click():65===c.which&&!this.sketcher.oneMolecule&&(this.sketcher.toolbarManager.buttonLasso.getElement().click(),this.sketcher.lasso.select(this.sketcher.getAllAtoms(),this.sketcher.shapes));else if(9===c.which){if(!this.sketcher.oneMolecule)if(this.sketcher.lasso.block=!0,this.sketcher.toolbarManager.buttonLasso.getElement().click(),this.sketcher.lasso.block=
+!1,d.SHIFT){if(0<this.sketcher.shapes.length){var g=this.sketcher.shapes.length-1;0<this.sketcher.lasso.shapes.length&&(g=h(this.sketcher.lasso.shapes[0],this.sketcher.shapes)+1);g===this.sketcher.shapes.length&&(g=0);this.sketcher.lasso.empty();this.sketcher.lasso.select([],[this.sketcher.shapes[g]])}}else 0<this.sketcher.molecules.length&&(g=this.sketcher.molecules.length-1,0<this.sketcher.lasso.atoms.length&&(g=this.sketcher.getMoleculeByAtom(this.sketcher.lasso.atoms[0]),g=h(g,this.sketcher.molecules)+
+1),g===this.sketcher.molecules.length&&(g=0),this.sketcher.lasso.select(this.sketcher.molecules[g].atoms,[]))}else if(32===c.which)this.sketcher.lasso&&this.sketcher.lasso.empty(),this.sketcher.toolbarManager.buttonSingle.getElement().click();else if(37<=c.which&&40>=c.which){g=new e.Point;switch(c.which){case 37:g.x=-10;break;case 38:g.y=-10;break;case 39:g.x=10;break;case 40:g.y=10}this.sketcher.historyManager.pushUndo(new f.MoveAction(this.sketcher.lasso&&this.sketcher.lasso.isActive()?this.sketcher.lasso.getAllPoints():
+this.sketcher.getAllPoints(),g))}else if(187===c.which||189===c.which||61===c.which||109===c.which)this.sketcher.hovering&&this.sketcher.hovering instanceof e.Atom&&this.sketcher.historyManager.pushUndo(new f.ChangeChargeAction(this.sketcher.hovering,187===c.which||61===c.which?1:-1));else if(8===c.which||127===c.which)this.sketcher.stateManager.STATE_ERASE.handleDelete();else if(48<=c.which&&57>=c.which){if(this.sketcher.hovering){var l=c.which-48,n=[],i=[];if(this.sketcher.hovering instanceof e.Atom)if(g=
+this.sketcher.hovering,d.SHIFT){if(2<l&&9>l){var o=this.sketcher.getMoleculeByAtom(this.sketcher.hovering),k=o.getAngles(this.sketcher.hovering),p=3*j.PI/2;0!==k.length&&(p=a.angleBetweenLargest(k).angle);k=this.sketcher.stateManager.STATE_NEW_RING.getRing(this.sketcher.hovering,l,this.sketcher.specs.bondLength,p,!1);-1===h(k[0],o.atoms)&&n.push(k[0]);this.sketcher.bondExists(this.sketcher.hovering,k[0])||i.push(new e.Bond(this.sketcher.hovering,k[0]));for(var q=1,s=k.length;q<s;q++)-1===h(k[q],o.atoms)&&
+n.push(k[q]),this.sketcher.bondExists(k[q-1],k[q])||i.push(new e.Bond(k[q-1],k[q]));this.sketcher.bondExists(k[k.length-1],this.sketcher.hovering)||i.push(new e.Bond(k[k.length-1],this.sketcher.hovering))}}else{0===l&&(l=10);for(var r=new e.Point(this.sketcher.hovering.x,this.sketcher.hovering.y),v=this.getOptimumAngle(this.sketcher.hovering),t=this.sketcher.hovering,w=0;w<l;w++){o=v+(1===w%2?j.PI/3:0);r.x+=this.sketcher.specs.bondLength*j.cos(o);r.y-=this.sketcher.specs.bondLength*j.sin(o);for(var u=
+new e.Atom("C",r.x,r.y),x=Infinity,y,q=0,s=this.sketcher.molecules.length;q<s;q++){o=this.sketcher.molecules[q];k=0;for(p=o.atoms.length;k<p;k++){var z=o.atoms[k],A=z.distance(u);A<x&&(x=A,y=z)}}5>x?u=y:n.push(u);this.sketcher.bondExists(t,u)||i.push(new e.Bond(t,u));t=u}}else if(this.sketcher.hovering instanceof e.Bond)if(g=this.sketcher.hovering.a1,d.SHIFT){if(2<l&&9>l){k=this.sketcher.stateManager.STATE_NEW_RING.getOptimalRing(this.sketcher.hovering,l);l=this.sketcher.hovering.a2;p=this.sketcher.hovering.a1;
+o=this.sketcher.getMoleculeByAtom(l);k[0]===this.sketcher.hovering.a1&&(l=this.sketcher.hovering.a1,p=this.sketcher.hovering.a2);-1===h(k[1],o.atoms)&&n.push(k[1]);this.sketcher.bondExists(l,k[1])||i.push(new e.Bond(l,k[1]));q=2;for(s=k.length;q<s;q++)-1===h(k[q],o.atoms)&&n.push(k[q]),this.sketcher.bondExists(k[q-1],k[q])||i.push(new e.Bond(k[q-1],k[q]));this.sketcher.bondExists(k[k.length-1],p)||i.push(new e.Bond(k[k.length-1],p))}}else 0<l&&4>l&&this.sketcher.hovering.bondOrder!==l&&this.sketcher.historyManager.pushUndo(new f.ChangeBondAction(this.sketcher.hovering,
+l,e.Bond.STEREO_NONE));(0!==n.length||0!==i.length)&&this.sketcher.historyManager.pushUndo(new f.AddAction(this.sketcher,g,n,i))}}else if(65<=c.which&&90>=c.which&&this.sketcher.hovering)if(this.sketcher.hovering instanceof e.Atom){g=String.fromCharCode(c.which);o=!1;k=0;for(p=b.length;k<p;k++)if(this.sketcher.hovering.label.charAt(0)===g)b[k]===this.sketcher.hovering.label?o=!0:b[k].charAt(0)===g&&(o&&!i?i=b[k]:n||(n=b[k]));else if(b[k].charAt(0)===g){n=b[k];break}u="C";i?u=i:n&&(u=n);u!==this.sketcher.hovering.label&&
+this.sketcher.historyManager.pushUndo(new f.ChangeLabelAction(this.sketcher.hovering,u))}else this.sketcher.hovering instanceof e.Bond&&70===c.which&&this.sketcher.historyManager.pushUndo(new f.FlipBondAction(this.sketcher.hovering));this.innerkeydown&&this.innerkeydown(c)};c._State.prototype.keypress=function(a){this.innerkeypress&&this.innerkeypress(a)};c._State.prototype.keyup=function(a){d.CANVAS_DRAGGING===this.sketcher&&this.sketcher.lastPoint&&(a.p=this.sketcher.lastPoint,this.sketcher.drag(a));
+this.innerkeyup&&this.innerkeyup(a)}})(ChemDoodle.math,ChemDoodle.monitor,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.structures,ChemDoodle.SYMBOLS,jQuery.inArray,Math);
+(function(a,d,f,c){c.AtomQueryState=function(a){this.setup(a);this.mode=c.LabelState.MODE_ANY;return!0};c.AtomQueryState.prototype=new c._State;c.AtomQueryState.prototype.innermouseup=function(){if(this.mode===c.AtomQueryState.MODE_ANY)this.sketcher.historyManager.pushUndo(new d.ToggleAnyAtomAction(this.sketcher.hovering));else if(this.mode===c.AtomQueryState.MODE_RGROUP){var a=this,b=this.sketcher.hovering;this.sketcher.dialogManager.inputDialog.doneFunction=function(c){c.match(/[0-9]|\-/g)&&a.sketcher.historyManager.pushUndo(new d.ChangeRgroupAction(b,
+parseInt(c)))};this.sketcher.dialogManager.inputDialog.getElement().dialog("open")}};c.AtomQueryState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0)};c.AtomQueryState.MODE_ANY=1;c.AtomQueryState.MODE_RGROUP=2})(ChemDoodle.structures,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.gui.DialogManager,ChemDoodle.sketcher.states);
+(function(a,d){d.ChargeState=function(a){this.setup(a);this.delta=1;return!0};d.ChargeState.prototype=new d._State;d.ChargeState.prototype.innermouseup=function(){this.sketcher.hovering&&this.sketcher.historyManager.pushUndo(new a.ChangeChargeAction(this.sketcher.hovering,this.delta))};d.ChargeState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!1)}})(ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states);
+(function(a,d,f,c,e){d.EraseState=function(a){this.setup(a);return!0};d.EraseState.prototype=new d._State;d.EraseState.prototype.handleDelete=function(){if(this.sketcher.lasso&&this.sketcher.lasso.isActive())this.sketcher.historyManager.pushUndo(new a.DeleteContentAction(this.sketcher,this.sketcher.lasso.atoms,this.sketcher.lasso.shapes)),this.sketcher.lasso.empty();else if(this.sketcher.hovering){if(this.sketcher.hovering instanceof f.Atom)if(this.sketcher.oneMolecule){for(var b=this.sketcher.molecules[0],
+h=0,j=b.atoms.length;h<j;h++)b.atoms[h].visited=!1;var d=[],g=[];this.sketcher.hovering.visited=!0;h=0;for(j=b.bonds.length;h<j;h++){var l=b.bonds[h];if(l.contains(this.sketcher.hovering)){var n=[],i=[],o=new f.Queue;for(o.enqueue(l.getNeighbor(this.sketcher.hovering));!o.isEmpty();)if(l=o.dequeue(),!l.visited){l.visited=!0;n.push(l);for(var k=0,p=b.bonds.length;k<p;k++){var q=b.bonds[k];q.contains(l)&&!q.getNeighbor(l).visited&&(o.enqueue(q.getNeighbor(l)),i.push(q))}}d.push(n);g.push(i)}}k=l=-1;
+h=0;for(j=d.length;h<j;h++)d[h].length>l&&(k=h,l=d[h].length);if(-1<k){for(var h=[],j=[],s,n=0,i=b.atoms.length;n<i;n++)l=b.atoms[n],-1===e(l,d[k])?h.push(l):s||(s=l);n=0;for(i=b.bonds.length;n<i;n++)l=b.bonds[n],-1===e(l,g[k])&&j.push(l);this.sketcher.historyManager.pushUndo(new a.DeleteAction(this.sketcher,s,h,j))}else this.sketcher.historyManager.pushUndo(new a.ClearAction(this.sketcher))}else b=this.sketcher.getMoleculeByAtom(this.sketcher.hovering),this.sketcher.historyManager.pushUndo(new a.DeleteAction(this.sketcher,
+b.atoms[0],[this.sketcher.hovering],b.getBonds(this.sketcher.hovering)));else this.sketcher.hovering instanceof f.Bond?(!this.sketcher.oneMolecule||!this.sketcher.hovering.ring)&&this.sketcher.historyManager.pushUndo(new a.DeleteAction(this.sketcher,this.sketcher.hovering.a1,void 0,[this.sketcher.hovering])):this.sketcher.hovering instanceof c._Shape&&this.sketcher.historyManager.pushUndo(new a.DeleteShapeAction(this.sketcher,this.sketcher.hovering));this.sketcher.hovering=void 0;this.sketcher.repaint()}n=
+0;for(i=this.sketcher.shapes.length;n<i;n++)if(g=this.sketcher.shapes[n],g instanceof c.Pusher){d=s=!1;h=0;for(j=this.sketcher.molecules.length;h<j;h++){b=this.sketcher.molecules[h];k=0;for(p=b.atoms.length;k<p;k++)l=b.atoms[k],l===g.o1?s=!0:l===g.o2&&(d=!0);k=0;for(p=b.bonds.length;k<p;k++)l=b.bonds[k],l===g.o1?s=!0:l===g.o2&&(d=!0)}if(!s||!d)this.sketcher.historyManager.undoStack[this.sketcher.historyManager.undoStack.length-1].ss.push(g),this.sketcher.removeShape(g)}};d.EraseState.prototype.innermouseup=
+function(){this.handleDelete()};d.EraseState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!0)}})(ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.structures,ChemDoodle.structures.d2,jQuery.inArray);
+(function(a,d,f){f.LabelState=function(a){this.setup(a);this.label="C";return!0};f.LabelState.prototype=new f._State;f.LabelState.prototype.innermousedown=function(){this.newMolAllowed=!0};f.LabelState.prototype.innermouseup=function(c){this.sketcher.hovering?this.label!==this.sketcher.hovering.label&&this.sketcher.historyManager.pushUndo(new d.ChangeLabelAction(this.sketcher.hovering,this.label)):!this.sketcher.oneMolecule&&this.newMolAllowed&&(this.sketcher.historyManager.pushUndo(new d.NewMoleculeAction(this.sketcher,
+[new a.Atom(this.label,c.p.x,c.p.y)],[])),this.sketcher.isMobile||this.mousemove(c))};f.LabelState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!1)};f.LabelState.prototype.innerdrag=function(){this.newMolAllowed=!1}})(ChemDoodle.structures,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states);
+(function(a,d,f,c,e,b,h,j){b.LassoState=function(a){this.setup(a);return!0};b.LassoState.prototype=new b._State;var m,g=!1;b.LassoState.prototype.innerdrag=function(a){this.inDrag=!0;if(this.sketcher.lasso.isActive()&&m){if(this.sketcher.lastPoint)if(1===m){var b=new f.Point(a.p.x,a.p.y);b.sub(this.sketcher.lastPoint);if(this.parentAction){this.parentAction.dif.add(b);for(var a=0,i=this.parentAction.ps.length;a<i;a++)this.parentAction.ps[a].add(b);a=0;for(i=this.sketcher.molecules.length;a<i;a++)this.sketcher.molecules[a].check();
+this.sketcher.lasso.bounds.minX+=b.x;this.sketcher.lasso.bounds.maxX+=b.x;this.sketcher.lasso.bounds.minY+=b.y;this.sketcher.lasso.bounds.maxY+=b.y;this.sketcher.repaint()}else this.parentAction=new e.MoveAction(this.sketcher.lasso.getAllPoints(),b),this.sketcher.historyManager.pushUndo(this.parentAction)}else if(2===m)if(this.parentAction){var b=this.parentAction.center,i=b.angle(this.sketcher.lastPoint),a=b.angle(a.p),g=a-i;this.parentAction.dif+=g;a=0;for(i=this.parentAction.ps.length;a<i;a++){var h=
+this.parentAction.ps[a],p=b.distance(h),q=b.angle(h)+g;h.x=b.x+p*j.cos(q);h.y=b.y-p*j.sin(q)}a=0;for(i=this.sketcher.molecules.length;a<i;a++)this.sketcher.molecules[a].check();this.sketcher.lasso.setBounds();this.sketcher.repaint()}else b=new f.Point((this.sketcher.lasso.bounds.minX+this.sketcher.lasso.bounds.maxX)/2,(this.sketcher.lasso.bounds.minY+this.sketcher.lasso.bounds.maxY)/2),i=b.angle(this.sketcher.lastPoint),a=b.angle(a.p),this.parentAction=new e.RotateAction(this.sketcher.lasso.getAllPoints(),
+a-i,b),this.sketcher.historyManager.pushUndo(this.parentAction)}else if(this.sketcher.hovering){if(this.sketcher.lastPoint)if(b=new f.Point(a.p.x,a.p.y),b.sub(this.sketcher.lastPoint),this.parentAction){this.parentAction.dif.add(b);a=0;for(i=this.parentAction.ps.length;a<i;a++)this.parentAction.ps[a].add(b);a=0;for(i=this.sketcher.molecules.length;a<i;a++)this.sketcher.molecules[a].check();this.sketcher.repaint()}else this.sketcher.hovering instanceof f.Atom?i=d.SHIFT?[this.sketcher.hovering]:this.sketcher.getMoleculeByAtom(this.sketcher.hovering).atoms:
+this.sketcher.hovering instanceof f.Bond?i=[this.sketcher.hovering.a1,this.sketcher.hovering.a2]:this.sketcher.hovering instanceof c._Shape&&(i=this.sketcher.hovering.hoverPoint?[this.sketcher.hovering.hoverPoint]:this.sketcher.hovering.getPoints()),this.parentAction=new e.MoveAction(i,b),this.sketcher.historyManager.pushUndo(this.parentAction)}else this.sketcher.lasso.addPoint(a.p),this.sketcher.repaint()};b.LassoState.prototype.innermousedown=function(b){this.inDrag=!1;if(this.sketcher.lasso.isActive()&&
+!d.SHIFT){m=void 0;var g=25/this.sketcher.specs.scale;a.isBetween(b.p.x,this.sketcher.lasso.bounds.minX,this.sketcher.lasso.bounds.maxX)&&a.isBetween(b.p.y,this.sketcher.lasso.bounds.minY,this.sketcher.lasso.bounds.maxY)?m=1:a.isBetween(b.p.x,this.sketcher.lasso.bounds.minX-g,this.sketcher.lasso.bounds.maxX+g)&&a.isBetween(b.p.y,this.sketcher.lasso.bounds.minY-g,this.sketcher.lasso.bounds.maxY+g)&&(m=2)}else this.sketcher.hovering||(this.sketcher.lastPoint=void 0,this.sketcher.lasso.addPoint(b.p),
+this.sketcher.repaint())};b.LassoState.prototype.innermouseup=function(a){m||this.sketcher.hovering||this.sketcher.lasso.select();this.innermousemove(a)};b.LassoState.prototype.innerclick=function(){if(!m&&!this.inDrag)if(this.sketcher.hovering){var a=[],b=[];this.sketcher.hovering instanceof f.Atom?a.push(this.sketcher.hovering):this.sketcher.hovering instanceof f.Bond?(a.push(this.sketcher.hovering.a1),a.push(this.sketcher.hovering.a2)):this.sketcher.hovering instanceof c._Shape&&b.push(this.sketcher.hovering);
+this.sketcher.lasso.select(a,b)}else this.sketcher.lasso.isActive()&&this.sketcher.lasso.empty();m=void 0};b.LassoState.prototype.innermousemove=function(b){if(this.sketcher.lasso.isActive()){if(!d.SHIFT){var e=!1,i=25/this.sketcher.specs.scale;if((!a.isBetween(b.p.x,this.sketcher.lasso.bounds.minX,this.sketcher.lasso.bounds.maxX)||!a.isBetween(b.p.y,this.sketcher.lasso.bounds.minY,this.sketcher.lasso.bounds.maxY))&&a.isBetween(b.p.x,this.sketcher.lasso.bounds.minX-i,this.sketcher.lasso.bounds.maxX+
+i)&&a.isBetween(b.p.y,this.sketcher.lasso.bounds.minY-i,this.sketcher.lasso.bounds.maxY+i))e=!0;e!=g&&(g=e,this.sketcher.repaint())}}else e=this.sketcher.lasso.mode!==h.Lasso.MODE_LASSO_SHAPES,this.findHoveredObject(b,e,e,!0)};b.LassoState.prototype.innerdblclick=function(){this.sketcher.lasso.isActive()&&this.sketcher.lasso.empty()};b.LassoState.prototype.draw=function(a){if(g&&this.sketcher.lasso.bounds){a.fillStyle="rgba(0,0,255,.1)";var b=25/this.sketcher.specs.scale,i=this.sketcher.lasso.bounds;
+a.beginPath();a.rect(i.minX-b,i.minY-b,i.maxX-i.minX+2*b,b);a.rect(i.minX-b,i.maxY,i.maxX-i.minX+2*b,b);a.rect(i.minX-b,i.minY,b,i.maxY-i.minY);a.rect(i.maxX,i.minY,b,i.maxY-i.minY);a.fill()}}})(ChemDoodle.math,ChemDoodle.monitor,ChemDoodle.structures,ChemDoodle.structures.d2,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.sketcher.tools,Math);
+(function(a,d){d.LonePairState=function(a){this.setup(a);this.delta=1;return!0};d.LonePairState.prototype=new d._State;d.LonePairState.prototype.innermouseup=function(){0>this.delta&&1>this.sketcher.hovering.numLonePair||this.sketcher.hovering&&this.sketcher.historyManager.pushUndo(new a.ChangeLonePairAction(this.sketcher.hovering,this.delta))};d.LonePairState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!1)}})(ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states);
+(function(a,d,f){d.MoveState=function(a){this.setup(a);this.action=void 0;return!0};d.MoveState.prototype=new d._State;d.MoveState.prototype.innerdrag=function(c){if(this.sketcher.hovering)if(this.action){c=new f.Point(c.p.x,c.p.y);c.sub(this.sketcher.lastPoint);this.action.dif.add(c);for(var e=0,b=this.action.as.length;e<b;e++)this.action.as[e].add(c);e=0;for(b=this.sketcher.molecules.length;e<b;e++)this.sketcher.molecules[e].check();this.sketcher.repaint()}else e=[],c=new f.Point(c.p.x,c.p.y),this.sketcher.hovering instanceof
+f.Atom?(c.sub(this.sketcher.hovering),e[0]=this.sketcher.hovering):this.sketcher.hovering instanceof f.Bond&&(c.sub(this.sketcher.lastPoint),e[0]=this.sketcher.hovering.a1,e[1]=this.sketcher.hovering.a2),this.action=new a.MoveAction(e,c),this.sketcher.historyManager.pushUndo(this.action)};d.MoveState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!0)};d.MoveState.prototype.innermouseup=function(){this.action=void 0}})(ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.structures);
+(function(a,d,f,c,e){f.NewBondState=function(a){this.setup(a);this.bondOrder=1;this.stereo=c.Bond.STEREO_NONE;return!0};f.NewBondState.prototype=new f._State;f.NewBondState.prototype.incrementBondOrder=function(a){this.newMolAllowed=!1;1===this.bondOrder&&this.stereo===c.Bond.STEREO_NONE?this.sketcher.historyManager.pushUndo(new d.ChangeBondAction(a)):a.bondOrder===this.bondOrder&&a.stereo===this.stereo?(1===a.bondOrder&&a.stereo!==c.Bond.STEREO_NONE||2===a.bondOrder&&a.stereo===c.Bond.STEREO_NONE)&&
+this.sketcher.historyManager.pushUndo(new d.FlipBondAction(a)):this.sketcher.historyManager.pushUndo(new d.ChangeBondAction(a,this.bondOrder,this.stereo))};f.NewBondState.prototype.innerexit=function(){this.removeStartAtom()};f.NewBondState.prototype.innerdrag=function(b){this.newMolAllowed=!1;this.removeStartAtom();if(this.sketcher.hovering instanceof c.Atom){if(15>b.p.distance(this.sketcher.hovering)){var d=this.getOptimumAngle(this.sketcher.hovering),b=this.sketcher.hovering.x+this.sketcher.specs.bondLength*
+e.cos(d),d=this.sketcher.hovering.y-this.sketcher.specs.bondLength*e.sin(d);this.sketcher.tempAtom=new c.Atom("C",b,d,0)}else a.ALT&&a.SHIFT?this.sketcher.tempAtom=new c.Atom("C",b.p.x,b.p.y,0):(d=this.sketcher.hovering.angle(b.p),b=this.sketcher.hovering.distance(b.p),a.SHIFT||(b=this.sketcher.specs.bondLength),a.ALT||(d=e.floor((d+e.PI/12)/(e.PI/6))*e.PI/6),this.sketcher.tempAtom=new c.Atom("C",this.sketcher.hovering.x+b*e.cos(d),this.sketcher.hovering.y-b*e.sin(d),0));d=0;for(b=this.sketcher.molecules.length;d<
+b;d++)for(var j=this.sketcher.molecules[d],f=0,g=j.atoms.length;f<g;f++){var l=j.atoms[f];5>l.distance(this.sketcher.tempAtom)&&(this.sketcher.tempAtom.x=l.x,this.sketcher.tempAtom.y=l.y,this.sketcher.tempAtom.isOverlap=!0)}this.sketcher.repaint()}};f.NewBondState.prototype.innerclick=function(a){!this.sketcher.hovering&&!this.sketcher.oneMolecule&&this.newMolAllowed&&(this.sketcher.historyManager.pushUndo(new d.NewMoleculeAction(this.sketcher,[new c.Atom("C",a.p.x,a.p.y)],[])),this.sketcher.isMobile||
+this.mousemove(a))};f.NewBondState.prototype.innermousedown=function(a){this.newMolAllowed=!0;if(this.sketcher.hovering instanceof c.Atom)this.sketcher.hovering.isHover=!1,this.sketcher.hovering.isSelected=!0,this.drag(a);else if(this.sketcher.hovering instanceof c.Bond){this.sketcher.hovering.isHover=!1;this.incrementBondOrder(this.sketcher.hovering);for(var a=0,e=this.sketcher.molecules.length;a<e;a++)this.sketcher.molecules[a].check();this.sketcher.repaint()}};f.NewBondState.prototype.innermouseup=
+function(a){if(this.sketcher.tempAtom&&this.sketcher.hovering){var e=[],j=[],f=!0;if(this.sketcher.tempAtom.isOverlap){for(var g=0,l=this.sketcher.molecules.length;g<l;g++)for(var n=this.sketcher.molecules[g],i=0,o=n.atoms.length;i<o;i++){var k=n.atoms[i];5>k.distance(this.sketcher.tempAtom)&&(this.sketcher.tempAtom=k)}if(g=this.sketcher.getBond(this.sketcher.hovering,this.sketcher.tempAtom))this.incrementBondOrder(g),f=!1}else e.push(this.sketcher.tempAtom);f&&(j[0]=new c.Bond(this.sketcher.hovering,
+this.sketcher.tempAtom,this.bondOrder),j[0].stereo=this.stereo,this.sketcher.historyManager.pushUndo(new d.AddAction(this.sketcher,j[0].a1,e,j)))}this.sketcher.tempAtom=void 0;this.sketcher.isMobile||this.mousemove(a)};f.NewBondState.prototype.innermousemove=function(a){this.sketcher.tempAtom||(this.findHoveredObject(a,!0,!0),this.sketcher.startAtom&&(this.sketcher.hovering?(this.sketcher.startAtom.x=-10,this.sketcher.startAtom.y=-10):(this.sketcher.startAtom.x=a.p.x,this.sketcher.startAtom.y=a.p.y)))};
+f.NewBondState.prototype.innermouseout=function(){this.removeStartAtom()}})(ChemDoodle.monitor,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.structures,Math);
+(function(a,d,f,c,e,b,h){c.NewRingState=function(a){this.setup(a);this.numSides=6;this.unsaturated=!1;return!0};c.NewRingState.prototype=new c._State;c.NewRingState.prototype.getRing=function(a,b,g,c,d){for(var i=h.PI-2*h.PI/b,c=c+i/2,f=[],k=0;k<b-1;k++){var p=0===k?new e.Atom("C",a.x,a.y):new e.Atom("C",f[f.length-1].x,f[f.length-1].y);p.x+=g*h.cos(c);p.y-=g*h.sin(c);f.push(p);c+=h.PI+i}k=0;for(a=this.sketcher.molecules.length;k<a;k++){b=this.sketcher.molecules[k];g=0;for(c=b.atoms.length;g<c;g++)b.atoms[g].isOverlap=
+!1}k=0;for(a=f.length;k<a;k++){for(var i=Infinity,q,p=0,s=this.sketcher.molecules.length;p<s;p++){b=this.sketcher.molecules[p];g=0;for(c=b.atoms.length;g<c;g++){var r=b.atoms[g].distance(f[k]);r<i&&(i=r,q=b.atoms[g])}}5>i&&(f[k]=q,d&&(q.isOverlap=!0))}return f};c.NewRingState.prototype.getOptimalRing=function(a,b){for(var e=h.PI/2-h.PI/b,c=a.a1.distance(a.a2),d=this.getRing(a.a1,b,c,a.a1.angle(a.a2)-e,!1),e=this.getRing(a.a2,b,c,a.a2.angle(a.a1)-e,!1),i=c=0,f=1,k=d.length;f<k;f++)for(var p=0,q=this.sketcher.molecules.length;p<
+q;p++)for(var s=this.sketcher.molecules[p],r=0,v=s.atoms.length;r<v;r++)var t=s.atoms[r].distance(d[f]),w=s.atoms[r].distance(e[f]),c=c+h.min(1E8,1/(t*t)),i=i+h.min(1E8,1/(w*w));return c<i?d:e};c.NewRingState.prototype.innerexit=function(){this.removeStartAtom()};c.NewRingState.prototype.innerdrag=function(c){this.newMolAllowed=!1;this.removeStartAtom();if(this.sketcher.hovering instanceof e.Atom){var f=0,g=0;if(15>c.p.distance(this.sketcher.hovering))c=this.sketcher.getMoleculeByAtom(this.sketcher.hovering).getAngles(this.sketcher.hovering),
+f=0===c.length?3*h.PI/2:a.angleBetweenLargest(c).angle,g=this.sketcher.specs.bondLength;else if(f=this.sketcher.hovering.angle(c.p),g=this.sketcher.hovering.distance(c.p),!d.ALT||!d.SHIFT)d.SHIFT||(g=this.sketcher.specs.bondLength),d.ALT||(f=h.floor((f+h.PI/12)/(h.PI/6))*h.PI/6);this.sketcher.tempRing=this.getRing(this.sketcher.hovering,this.numSides,g,f,!0);this.sketcher.repaint()}else if(this.sketcher.hovering instanceof e.Bond){f=a.distanceFromPointToLineInclusive(c.p,this.sketcher.hovering.a1,
+this.sketcher.hovering.a2);if(-1!==f&&7>=f)c=this.getOptimalRing(this.sketcher.hovering,this.numSides);else{for(var g=h.PI/2-h.PI/this.numSides,l=this.sketcher.hovering.a1.distance(this.sketcher.hovering.a2),f=this.getRing(this.sketcher.hovering.a1,this.numSides,l,this.sketcher.hovering.a1.angle(this.sketcher.hovering.a2)-g,!1),g=this.getRing(this.sketcher.hovering.a2,this.numSides,l,this.sketcher.hovering.a2.angle(this.sketcher.hovering.a1)-g,!1),n=new e.Point,l=new e.Point,i=1,o=f.length;i<o;i++)n.add(f[i]),
+l.add(g[i]);n.x/=f.length-1;n.y/=f.length-1;l.x/=g.length-1;l.y/=g.length-1;n=n.distance(c.p);l=l.distance(c.p);c=g;n<l&&(c=f)}f=1;for(g=c.length;f<g;f++)-1!==b(c[f],this.sketcher.getAllAtoms())&&(c[f].isOverlap=!0);this.sketcher.tempRing=c;this.sketcher.repaint()}};c.NewRingState.prototype.innerclick=function(a){!this.sketcher.hovering&&!this.sketcher.oneMolecule&&this.newMolAllowed&&(this.sketcher.historyManager.pushUndo(new f.NewMoleculeAction(this.sketcher,[new e.Atom("C",a.p.x,a.p.y)],[])),this.sketcher.isMobile||
+this.mousemove(a))};c.NewRingState.prototype.innermousedown=function(a){this.newMolAllowed=!0;this.sketcher.hovering&&(this.sketcher.hovering.isHover=!1,this.sketcher.hovering.isSelected=!0,this.drag(a))};c.NewRingState.prototype.innermouseup=function(a){if(this.sketcher.tempRing&&this.sketcher.hovering){var c=[],g=[],d=this.sketcher.getAllAtoms();if(this.sketcher.hovering instanceof e.Atom){-1===b(this.sketcher.tempRing[0],d)&&c.push(this.sketcher.tempRing[0]);this.sketcher.bondExists(this.sketcher.hovering,
+this.sketcher.tempRing[0])||g.push(new e.Bond(this.sketcher.hovering,this.sketcher.tempRing[0]));for(var h=1,i=this.sketcher.tempRing.length;h<i;h++)-1===b(this.sketcher.tempRing[h],d)&&c.push(this.sketcher.tempRing[h]),this.sketcher.bondExists(this.sketcher.tempRing[h-1],this.sketcher.tempRing[h])||g.push(new e.Bond(this.sketcher.tempRing[h-1],this.sketcher.tempRing[h],1===h%2&&this.unsaturated?2:1));this.sketcher.bondExists(this.sketcher.tempRing[this.sketcher.tempRing.length-1],this.sketcher.hovering)||
+g.push(new e.Bond(this.sketcher.tempRing[this.sketcher.tempRing.length-1],this.sketcher.hovering,this.unsaturated?2:1))}else if(this.sketcher.hovering instanceof e.Bond){var h=this.sketcher.hovering.a2,o=this.sketcher.hovering.a1;this.sketcher.tempRing[0]===this.sketcher.hovering.a1&&(h=this.sketcher.hovering.a1,o=this.sketcher.hovering.a2);-1===b(this.sketcher.tempRing[1],d)&&c.push(this.sketcher.tempRing[1]);this.sketcher.bondExists(h,this.sketcher.tempRing[1])||g.push(new e.Bond(h,this.sketcher.tempRing[1]));
+h=2;for(i=this.sketcher.tempRing.length;h<i;h++)-1===b(this.sketcher.tempRing[h],d)&&c.push(this.sketcher.tempRing[h]),this.sketcher.bondExists(this.sketcher.tempRing[h-1],this.sketcher.tempRing[h])||g.push(new e.Bond(this.sketcher.tempRing[h-1],this.sketcher.tempRing[h],0===h%2&&this.unsaturated?2:1));this.sketcher.bondExists(this.sketcher.tempRing[this.sketcher.tempRing.length-1],o)||g.push(new e.Bond(this.sketcher.tempRing[this.sketcher.tempRing.length-1],o))}(0!==c.length||0!==g.length)&&this.sketcher.historyManager.pushUndo(new f.AddAction(this.sketcher,
+g[0].a1,c,g));c=0;for(g=d.length;c<g;c++)d[c].isOverlap=!1}this.sketcher.tempRing=void 0;this.sketcher.isMobile||this.mousemove(a)};c.NewRingState.prototype.innermousemove=function(a){this.sketcher.tempAtom||(this.findHoveredObject(a,!0,!0),this.sketcher.startAtom&&(this.sketcher.hovering?(this.sketcher.startAtom.x=-10,this.sketcher.startAtom.y=-10):(this.sketcher.startAtom.x=a.p.x,this.sketcher.startAtom.y=a.p.y)))};c.NewRingState.prototype.innermouseout=function(){this.removeStartAtom()}})(ChemDoodle.math,
+ChemDoodle.monitor,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,ChemDoodle.structures,jQuery.inArray,Math);
+(function(a,d,f,c,e){e.PusherState=function(a){this.setup(a);this.numElectron=1;return!0};e.PusherState.prototype=new e._State;e.PusherState.prototype.innermousedown=function(){this.sketcher.hovering&&(this.start=this.sketcher.hovering)};e.PusherState.prototype.innerdrag=function(a){this.start&&(this.end=new d.Point(a.p.x,a.p.y),this.findHoveredObject(a,!0,!0),this.sketcher.repaint())};e.PusherState.prototype.innermouseup=function(){if(this.start&&this.sketcher.hovering&&this.sketcher.hovering!==
+this.start){for(var a,e=!1,d=0,m=this.sketcher.shapes.length;d<m;d++){var g=this.sketcher.shapes[d];g instanceof f.Pusher&&(g.o1===this.start&&g.o2===this.sketcher.hovering?a=g:g.o2===this.start&&g.o1===this.sketcher.hovering&&(a=g,e=!0))}a?(e&&this.sketcher.historyManager.pushUndo(new c.DeleteShapeAction(this.sketcher,a)),this.end=this.start=void 0,this.sketcher.repaint()):(a=new f.Pusher(this.start,this.sketcher.hovering,this.numElectron),this.end=this.start=void 0,this.sketcher.historyManager.pushUndo(new c.AddShapeAction(this.sketcher,
+a)))}else this.end=this.start=void 0,this.sketcher.repaint()};e.PusherState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!0);this.sketcher.repaint()};e.PusherState.prototype.draw=function(b){if(this.start&&this.end){b.strokeStyle="#00FF00";b.fillStyle="#00FF00";b.lineWidth=1;var e=this.start instanceof d.Atom?this.start:this.start.getCenter(),c=this.end;this.sketcher.hovering&&this.sketcher.hovering!==this.start&&(c=this.sketcher.hovering instanceof d.Atom?this.sketcher.hovering:
+this.sketcher.hovering.getCenter());b.beginPath();b.moveTo(e.x,e.y);a.contextHashTo(b,e.x,e.y,c.x,c.y,2,2);b.stroke()}}})(ChemDoodle.extensions,ChemDoodle.structures,ChemDoodle.structures.d2,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states);
+(function(a,d){d.RadicalState=function(a){this.setup(a);this.delta=1;return!0};d.RadicalState.prototype=new d._State;d.RadicalState.prototype.innermouseup=function(){0>this.delta&&1>this.sketcher.hovering.numRadical||this.sketcher.hovering&&this.sketcher.historyManager.pushUndo(new a.ChangeRadicalAction(this.sketcher.hovering,this.delta))};d.RadicalState.prototype.innermousemove=function(a){this.findHoveredObject(a,!0,!1)}})(ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states);
+(function(a,d,f,c,e,b,h){b.ShapeState=function(a){this.setup(a);this.shapeType=b.ShapeState.LINE;return!0};b.ShapeState.prototype=new b._State;b.ShapeState.prototype.innermousedown=function(a){this.end=this.start=new f.Point(a.p.x,a.p.y)};b.ShapeState.prototype.innerdrag=function(a){this.end=new f.Point(a.p.x,a.p.y);if(!d.ALT){var a=this.start.angle(this.end),b=this.start.distance(this.end);d.ALT||(a=h.floor((a+h.PI/12)/(h.PI/6))*h.PI/6);this.end.x=this.start.x+b*h.cos(a);this.end.y=this.start.y-
+b*h.sin(a)}this.sketcher.repaint()};b.ShapeState.prototype.innermouseup=function(){if(this.start&&this.end){var a;this.shapeType>=b.ShapeState.LINE&&this.shapeType<=b.ShapeState.ARROW_RETROSYNTHETIC&&(a=new c.Line(this.start,this.end),this.shapeType===b.ShapeState.ARROW_SYNTHETIC?a.arrowType=c.Line.ARROW_SYNTHETIC:this.shapeType===b.ShapeState.ARROW_RETROSYNTHETIC&&(a.arrowType=c.Line.ARROW_RETROSYNTHETIC));this.end=this.start=void 0;a&&this.sketcher.historyManager.pushUndo(new e.AddShapeAction(this.sketcher,
+a))}};b.ShapeState.prototype.draw=function(b){this.start&&this.end&&(b.strokeStyle="#00FF00",b.fillStyle="#00FF00",b.lineWidth=1,b.beginPath(),b.moveTo(this.start.x,this.start.y),a.contextHashTo(b,this.start.x,this.start.y,this.end.x,this.end.y,2,2),b.stroke())};b.ShapeState.LINE=1;b.ShapeState.ARROW_SYNTHETIC=2;b.ShapeState.ARROW_RETROSYNTHETIC=3})(ChemDoodle.extensions,ChemDoodle.monitor,ChemDoodle.structures,ChemDoodle.structures.d2,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.states,Math);
+(function(a){a.StateManager=function(d){this.STATE_NEW_BOND=new a.NewBondState(d);this.STATE_NEW_RING=new a.NewRingState(d);this.STATE_CHARGE=new a.ChargeState(d);this.STATE_LONE_PAIR=new a.LonePairState(d);this.STATE_RADICAL=new a.RadicalState(d);this.STATE_MOVE=new a.MoveState(d);this.STATE_ERASE=new a.EraseState(d);this.STATE_LABEL=new a.LabelState(d);this.STATE_LASSO=new a.LassoState(d);this.STATE_SHAPE=new a.ShapeState(d);this.STATE_PUSHER=new a.PusherState(d);this.STATE_ATOM_QUERY=new a.AtomQueryState(d);
+var f=this.STATE_NEW_BOND;this.setState=function(a){a!==f&&(f.exit(),f=a,f.enter())};this.getCurrentState=function(){return f};return!0}})(ChemDoodle.sketcher.states);
+ChemDoodle.sketcher.gui.imageDepot=function(){return{getURI:function(a){return"data:image/png;base64,"+a},ADD_LONE_PAIR:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAANElEQVR42mNgGAWjYHACGyB+DMTPgdiFDHkMAFL8H4qfkyFPewNtoApB2IMM+VEwCgYcAADjvBhZpYZJbQAAAABJRU5ErkJggg==",ADD_RADICAL:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAL0lEQVR42mNgGAWjYGgAGyB+DMTPgdiFGgaCDPsPxc8HpYE2UINA2GM0BYyCoQAAdQgMLdlWmzIAAAAASUVORK5CYII=",ANY_ELEMENT:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABF0lEQVR42u3TsUtCURSA8ZePCJcgqCFwEomGNoWgpCFwaHHIv6CpJYqoxSWScAhqMopQKIjIpsYWoUkahCxahKaGqAjB9qK+C/fB4fBI6L3xHfiBHrgfvqs6TjQ+M4QEmvZ14FnDBYp4wnjQYBzr2MAsYmE88g0WsBvWPQ7859AMfpASuxG7y4rdCjZRx47YT6Alg4d4xZYKfuNO3J0XnEQPo3Z/hZx3cBDPWERHBR9wi2UVNHOKPczhWn66PM7h4g1pEWwjg3f7XgaT+MQ9pmTwEgX7EznCvgqaqaKigmZOcCZjw+jag8YjXuydyeAYPnCsgiWUZXAJB+obN/+IeRU0s4qvfsEGplVwGzWfoGuf4M9gNMHmF6UIOpc0VqXrAAAAAElFTkSuQmCC",
+ARROW_DOWN:"iVBORw0KGgoAAAANSUhEUgAAAAkAAAAUCAYAAABf2RdVAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAACFSURBVCgV1VExDoAgDLRoHEhM/IaLT3DyDU5O/n9xV/GuVAeiYabJ5Wh7hdJKCKHKmcsJmC9WJGi+/fgh58KcWmO8g0/gMq7BFJF7QG8awKxOMVpeKzycKRHN8L1uxNbCqztgMeFqvrwiE3L6fH8zdowTUYkoTUTYKI3xIx6j85x/udgF35c6Mkzf7cF3AAAAAElFTkSuQmCC",
+ARROW_RETROSYNTHETIC:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAYElEQVR42mNgGI5AhZqGKQDxbSA2oaahBrQ01ILahr4HYhtskv8pwF9xGUouAHn7MRA7UNNQG6hrPahtoA+1vPwc3XWURooPtZLNc2qFG8iw+9Q2zIFahQPV05zG0C59AY3IMME0CTYYAAAAAElFTkSuQmCC",ARROW_SYNTHETIC:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAUklEQVR42mNgGAWjgC5ABoh5qGmgAhD/B+I7QJwAxALUMPQg1NAHQPwdiPegG/6fipgssA+q+REQ/wDivUCcAsQi5EYKLAzJNgQ9UmRGE/tIBgDIaCG7b3KulAAAAABJRU5ErkJggg==",BENZENE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA5klEQVR42s2VPwrCMBSH06k0o1MX6R2c7A08hDfRRdDVgp5BR71GvUKdtHNvIMRf4FcoIdgkzeCDD0r+fLyQl1ch3GMmIkUOzuADDkBOEVWgA0ewABfQgjVIQkU5x/vMlqAGD1CGiFKwBS+QcSxhli2znpsyvVAZIh0r8AQ3UFiS0FnvuDczJ9XgW2++g4bSsVC/BiWPt+FxXSRqbEHmmZVyTvtvhTKmUMvesS+lYO0Fl01f2JWlsJvQws75UjpDnPL4Xk/PRdzLSjaGmo3Cq30Nxbp9XXlhXu3LJj6xwe6nNNigX8AXVupH9hGtsNcAAAAASUVORK5CYII=",
+BOND_DOUBLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAQUlEQVR42mNgoA7gZqAicADi+0DMRS3DXgGxPTVcim4YzKVUMwyZP2rYqGGjhg0Dw7ihpQRVDIMBLmoahsulZAEA2GgvCVlTJIIAAAAASUVORK5CYII=",BOND_DOUBLE_AMBIGUOUS:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAwElEQVR42q2UsQ2DQBAE38EnBDQAJUBGA6YM04UD3n1AYhdhMkqAHpw4owgkJNbSfuLw904aIZLV3t/tOWdTmTOsGnytRHPwATcLpxcwgYH/HZ0mVwALXY10WqWKtWADDVjBm+0nVUmxO79BadPT0UyxqzrVF4V+b1eoYg+wgyedymIH6FUhzzZ3C7GSA9jYplRxz2YOwCtxCn97VihBn+ioUfesZhYHZnNVEpDxSsQTNDKbJhe3o9PcGVR0WikiJ/j5KxJqecPNAAAAAElFTkSuQmCC",
+BOND_PROTRUDING:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAl0lEQVR42mNgoAwEAHEDA5WAChC/B+L/1DCUBYivQw37Tw1Dl6MZRpGhBTgM+w3EFaQaZgPEn7EY9hiIPUg1TAaI72Mx7DAQK5ATCbuxGNYPxDzkhFs3lvCKoCTxIht2G4g1qJF4QXg9uV5ET7xkJQlciZesJIEr8ZKVJHAl3n5Kwgs58d6mJEmgR8J0SpIENq/yMAx7AADDzz/MOB6JagAAAABJRU5ErkJggg==",BOND_RECESSED:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAQUlEQVR42mNgGGQghJqGBQDxbyBOoaahCYPSUGyaYYYOI28y4PDm4IxNBmp6k2JAE28OPvAdiBuoaaALwyggBQAA+tATdpIiCMcAAAAASUVORK5CYII=",BOND_SINGLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAMklEQVR42mNgGMSAm5qGOQDxfSDmopZhr4DYftSwUcNGDRs1jP6GcUPLM6oYBgNUKRwBiE8XjxDJvZUAAAAASUVORK5CYII=",
+BOND_TRIPLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAUUlEQVR42mNgoAxwM1AROADxfSDmopZhr4DYnhouRTeMIpdiM4xslxIyDOZSqhmGzB81bNSwATeMG5rCqWIYDHBR0zBiXUoW4KKmYbhcShIAAA2MPiFy45L3AAAAAElFTkSuQmCC",BROMINE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA3UlEQVR42mNgGAVUB8s0NDYu09T8D8LLNTVvA+lZKzQ1dSg18MRSTU2X5RoarUD2dyC+SKmBu+B8Tc0FQPx3prExK1UMXK6lNRPo2rNIFnQB1UwCikUs09K6DuQXEGXgQg0NYaCGGCD7xVItLX8kA5cD8R1QsADDOBZosCoxBv6F4v9AQxNR5CEGPl2kpydGkpdXqalJA+ksIH4AxLNRDASqITsMgV6yA7kUlnQoNhCYdBRABgINzqTEwINAA+SXq6ubANnrgfgfiE2Jgf+h+C0QrwSKBZMdhqNg4AEAUSSF6Clvq/4AAAAASUVORK5CYII=",
+CALCULATE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAMtSURBVDgRnVXNTxNREP+1W6gW2oUKWNs0fAQUqCGNGjDB3iSmNhFJuPMHYLx5lpB4IRylV1M9E+RgbBMPJBpDxA8kNhUUAaUpFWiXtFDK9sM3D3ezS/HiJG/fvDczv52ZN2+eoVwugygcDntFUZwRBKHFZDJBO0guyzKOjo5weHiIdDqN1dVVKRaLDQWDwTmSK2RSmL29vYctjASjEaViEVarFbU2GywWC1fJZDLY2dkBzTTMZnNdIpF4woStCgbNKuDW1lZdh8eLdMmGz0sSFr/8QokpGGqM6Lokotldi5exLPL7VhQOrLiYe0WethCIlozKIpfLodEuQigbcPO6A5Yzx/9qEM0Y6nfBUiXgVncjVy+xNIn288jn84q5OquAtCMXSnj9dRtL39K40l3PlXw9DYh8TGLmUwLXmuv4XpNYjY4LZ1EqUQx60gH+TO1z6fJ6Blc9ds53tdrw4Xua8wdyETVmAXd6m7ASP9bVwwE6wGLx+I+7Uh40Ht3vQeTdlmoTjv7Gg0AbD/9HIqPuaxn1UGjzXJUMp0VGub6MNwtxvF1MwlRbjU5XLQqmIjvdLIIvliBLaTRV7WhxVF4HKBiAy4159DQZYGcHVGe3w8ZKhyiVSiEej2NtLYGN7AZSKKogWkYHSILHU1NgNYnbfj96+/owNjbG9YeHh8EKH6FQiK/b2tr4fPKjy+FJ4f+sKzy8NzoKo4FCtvOQp6enOa4S8sjICDY2WMgsBadRBeD27212X3Psihg4YDQa5XYULhUyu1GQJAlFdj1PowrA0LOn3JBymGfNYGJigtsFAgE4HA5EIhG+/lcOKwDb29uRzWbhdDrR2NAAj8fDAdxuN+84p3ml3asAvDs4qMvh+Pg416eczc/Pa21P5VVApS8+n53lHt7o74fX68Xk5CQ39Pl8OgC6x4qNVqACUuOkRK+srPDQPN3d2Gb9TzkU1ip5DsmY9Kgnks1JUgFZKUgL7xfQ1dnJGywpb25uYmBggNuQR1QuLpeL35jl5WXs7u6unwQ0KG77/X5vMpmcYSXBnwD2FMDIujcNIvKKRqFQ4BGwWWK2Q6xrz3GFv58/Du1jSFDkv4UAAAAASUVORK5CYII=",
+CARBON:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA2klEQVR42mNgGAXYwMyZM1knTZqk1dvbK9vQ0MBEtkETJ06UmzBhwi4g/gXEn4D4L5R9jGTDQK4BanwPxNeArtP///8/4/z58zmAfFcg7iHZQKCmaUD8derUqRIUh9mqVauYgYb9ABlKlUiYPHmyItCw//39/QlUMRBokAPIQFB4UcXAvr4+XaiB4VQxsLu7mxtqYDPVEjM0/b0BJhk+qhgINMgQaOBvID4LS4fAXMIC5JsDw3gCuZFjBDTgPNT7n4H4O1DsApDuoMi1HR0d/MBsaAyiR0s22gMANJ6AxDvp00kAAAAASUVORK5CYII=",CHLORINE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA9klEQVR42mNgGAXIwPi/MavcZzkt5bfKsgz/GZiQ5RTeKyTIfZBLI8ogpXdKcgofFHbJf5D/BcSfgPgvlH0MpgbIXq7wUWEjQcNArgEqfg/E1xTfK+oDXcao8F+BA+gaV6BYD8kGAhVOA+KvCl8UJAioI8LA/wzMQIU/QIYSYTFhA4GKFIH4PyjAqWIg0CAHkIGg8KKKgTLvZHTBLvygEE4VA8VfiHODDATGcTNVDAR7G5L+3qi8VeGjioFA1xkCFf8G4rOwdAjELEDN5kA8gWQDoYqNgPg82Psf5D8D8XcgvgB0fQdZBiJlQX5gjBuD6NGSjX4AAER4jBfAQ3QdAAAAAElFTkSuQmCC",
+CLEAR:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAKZSURBVDgRlZTLTxNRFId/La2VkNCh0hQVZayatJGFxhAiqBnYyIaEjWt15QpS/gIhbBoXxrglaV36iAGf2+Kim66awIJUA0QXxr5mOtNpp9N26rmVaZgK03iTM/fc8/jmzJl7r6PVasFurK2t8bIsx0VRFPb29pBMJh/VarWXJ+Yw4EmyuLgYCYfDIiXvkzwk2SBJnBTP7MfClpaW+NnZ2QQlM9gKCdcO/qv/H3B+fj7icrkYKG6CzIoikcjKxMSELdBFSZ0xNDS0IUkSR4YbBDkwHdFoNE4V816vlw8Gg5wgCIl8Po9MJrOq6/qWGcdmC5BgqwRKHw1guqZpC/QyLpVKoVgsgn6SsLu7y9r1ntxbLMYcDjKa+rFzLBYTCoVCPDh2gee8g2hSeK1SxtNnL1AUxedut3s1nU5LZrItcH19XRj2+RLXQlcxejaAlrMPLYcT1bKMQi6L12/e4e2Hz1s7OzszJtBpKsfN1KcHl8dGcT7gh2EYlpCB/tOYuT0JzymXcNRh6eFRB9NzuRy/+fEL9a2AO9O3MDd3rxPCWiUrCup6vWNjii2wWq1CmJqE38fBHxixJLJFk6rurtwWyIK9I6MYvngJdTixrxhokE0tkyh0fOQ+1A2H5UW2QBaZ+ilCzdLW8XDQSSRVR4lEUh3IZtxQdCvQ9qcwoPTrB7Lft1Ep/mbLnqNnhfzNaZw7E0Re0dqV9SL2rLAXoNvfs8L0p1fIigq849MYHL/bnf/P2hao0D6buv8YocAVFOiT5crhnqM9aDR0NDUVRrNpgdoC6TaBJ/kVHv8+lIqGSq2JstaAWqV+iiVI37ahlTvHuA22PcuhUOg63SxPVFVdcPUPHF7GdClTaotV1qgdkLpZKpWW2zR6/AFFS6MWxt319AAAAABJRU5ErkJggg==",
+CYCLOBUTANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAiklEQVR42q3UwQ2AIAwF0E7hOv4bTCN7uwIXG0MTYgRa2iYNF3lB+ECkr4MCK3NX7hSBgfvmvtp4RmCCnB4Ug8lbKBaTTCiUH6tQGH9nimJzw3/R7IyEoEluQG0581RpzlvJuUL0KyRnaKd7b0VVB6lFTalYoVsRG6HwHOAXRcQTJmiJwPqcql7sB1sQMyMuYZLDAAAAAElFTkSuQmCC",CYCLOHEPTANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA+UlEQVR42mNgIB4IMFABMAOxJxCvAeK/QLwAiA3IMUgTiDuB+CkQnwDiDCBWAuIKIH4ExIeAOASIWfAZIgzEmUB8EmpQBxBr4HA1yLCDUMMrgVgcXREPEP8D4pVA7AHVRAzQB+J5UL08yBKKQPyQgrAGuVQBWcARiA9QYCDI+w7IAonQGCQXLATiBGSBRiBuoMBADP0YNpAIMHyIEQYkAow4wIglEgFKKuGFpiMTCgw0gZrBCxMIgdogQYZhElC9IegS1dB8y0GCYRzQrFqNS8FSKCYWLCOkngPqymoiDKsh1kewMAnCoyaY1DA3BOL/BLAhqbHHRY4cAH9nN15emqC1AAAAAElFTkSuQmCC",
+CYCLOHEXANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAoElEQVR42mNgIB4IMVAJSADxZCD+A8StQMxFiUH9QPwWiPuA2AiIlwLxYyCOAWJGcg2SQJO3AOITQHwSiC0pMQgZMEJd+Rjqall0BZxA/J8Ig9ABKDwboXo50SX/UxBx/4kWHDVw1EDcemEJu5+aCVsCmlPeEmEwwaxHisGW0ILhBLSgIKn4QjYYVHwtA+JHpBZf2AyeBC1gWygpYMmqAgB+TzRkG9cEtwAAAABJRU5ErkJggg==",CYCLOOCTANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABBElEQVR42q2UvQ6CMBSFSXS1g4PRzVUXeRGdHH0KWfQlINGB1VcgzJLokxB2B3dIPDWnSYO1QutJvkB/ONxL7yUIumsU/EFLEIECNCAHOyC6GozBBqSgJPJ+DaY0y8CTVzme2MxkFFewBwvLiwXNcj4zM23a0KyvLuBgWkgZWV+FoAKD9kL5I02b7mDbPs3Soxqk2U2fiJiyq4ZMe6UmCpaGj448oHcHNKwz3yao1UB1gI8ScFID1QGuktk99CwF20l4RBe3JzPHtD+i09POHQzPpugC/jUaHn3YMbIzT3b+bdOMjV5p7TQ0GCVMM7aZ6Rpo7VSxaJctI+e6XfEz1Kwzq9ELFZA4hr9lYwQAAAAASUVORK5CYII=",
+CYCLOPENTANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA0klEQVR42mNgIB6IMFAJMAFxKRD/BuI0Sg1TAeJDUOwOxFeBeAEQc5Hjqnwgfg3EeUDMCBUHGTQfarAWOa5SxqEmHohfAXECOa7CBbTwBYEWEa7CBpCDwAAmKAjEf6ExyUhm5KUD8R8gFoAJ7AHiIApSA0jvbmSBHKjTyQUgvdnIAvJA/BIaMeQksZdQM1DAJSC2IMNAS6heDNAKxaQCnPpw2kQA4PQZzrDAAwiGPUZsEQCg1DGPUHraQYKBOwmlXx4g/k8i5iFkKxsJLmRjoDUAAID6NQMa+if+AAAAAElFTkSuQmCC",CYCLOPROPANE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAjElEQVR42mNgGE5AgZqGiQDxfyCWoJaBk4H4ORBPp4ZhGkB8G4h5gPg6EBtQauB2IA6Asj2AeD8Qs5BrGDYDkC0gCbDg8CIsCDhINbAATySAIqmC1GRyH08yISRPlgsKiE1GxIYRC7HJiJRYJJiMyElnOB3AQmZOwBlEBRTkVYxIlICWJpRimcFfCgMA4CwtbAP2SjIAAAAASUVORK5CYII=",
+DECREASE_CHARGE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAs0lEQVR42mNgGAU4gAAQK0BpsgELEGcA8WUg/g3E/6H4NhCXQOVJMmw/EL8G4gYgdoC60AKIK4D4ORAfB2IeYg07DMT3gVgFhxoZID4PNZSDkIE5UJepEFAnA3VpCSEDL0O9SQyogIYp3tj8DQ0zUPhI4sE80DD9jy/2FaAKFKCu/I8H16Opp48LqR6GNIllWDq8jidsZKBqiEqHyIZSJacgG5oDdSly7N6HepNjwEubwQEAQdI454gPA8EAAAAASUVORK5CYII=",ERASE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAQfSURBVDgRhZNdTFtlGMf/pz30Y4W13WhhBZKlshgCSyryFTK1LJvRbFkgxuiFZq1xiXEX6oV6Obgx8YrEK++oVxpvNm+8Mo4sM2qA8dVS2FlXCqVftPS0pR30nJ7j8x5WhbHFN3n7nHOePr88///7vBz+Z3EcB5PJBLfbjaGhIfT09MD/+hWfockyWc0Wkbm36D/39Xt36hh9/eF5UafTwWq1ahCv16tF3xtXp8xO+zjf0GDSyapJSuXf3/x5OuZ889UFxuCeB2LfeJ6Hw+GAx+NBf38/Prv8rs3UbLtrPGnxoCpDWt+GnMpr5buZHWw/2vCf/+5m4BiQSTQYDGhra8PAwIAGvPHaVa/F5bjdYDbZlNITSA8TqOVKUBUFIBWcjkN+M41wKOTnD3fIYI2Njejs7NRgXV1d+Ojitc/Np22TPBUyiCQQrLSnlXEkUK0pUFWgxMuYzUQn/wXq9XrY7XbNJ9bZV1c+sJmc9skTTpuPkxTUEnnsRZKAVDswiiB1w0rlCv4KLuC+sGjTgMyv1tZW9Pb2oq+vDzdHxjzmNseUudnqwRMJUjQDKbkDTlGhkklMCYtaawQWVtfwe2gGMTET4I1GIzo6OjA4OHjg16WxUVOLfYrMt6kkTRaSkPNlcFSoEohotOmFgkJyI8FV3I0uILKdgKKoP/AulwvDw8Ma7OPLY+Pmdsct3miAShBmvlqpaow6TOuOaFWSKQTD+CMnIJTZxE6psL4mJqZ5Zjw7hBtvv3Pb4naNMiVKuoBadBuQ2SmyVmhr8cC3UjqH5ZUgFssJLG9GsBKLQJWVCcqCZ3I/vXDNZ7CcGK2VKtCJ+1AyBZZ7Ko9gJJN1xqDxYARLcQHhQhKLG4+wHBWg7suBh4VUgJXw7FrxZuMtPbksTge1U7SddR3AWFdPd7W8j8ezS5jPxSDkEpiLrmF9Kw5Fkv11mAb8cnjMa+lwnuXoNI0kTYyTVDLbyqA6kkydVXIFhP6cI4lxCOk4ZiJhZLM5kWZwhGDalWMwtnhjs/U6bzGhlipqY9XUcgoFmvrdRBZtgz3IClHMzc8hXE4hvBXDHMH2disLqqKOCMW0eID575crLkXzTR1OmzQbhVwsQ97fR7Wyh1JyG0WxiBVxC6simb8RQYjMV/akAIH8dYTKrsmhxSu1GlSxrI2BjplPN0ZPg85bzAhHQniQXceDx2vYTCdFVap9QbDAofpjj/y973+aMLafnmx3nkGL7RRMHE9ToiK2sYH78VX8HVlBQSysk19jBDvi1zEafaBjBL69dN3X/rJ7qru7GzaTBVupBH789Rf8JswziXdIlv95frHaZyVrQJb45uKHPvJySjJwmFlawGJkFVJVmiDQOMu/aD0LPPK/T/re8l146bz6yhn3/LmTLd4jyRe8MODh/Q+zf/gKTlsAkwAAAABJRU5ErkJggg==",
+FLUORINE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAUElEQVR42mNgGAU0AxPuB26c8CDgPxr+SqmBpyc+DDCG4UkP/AwpNXAvtb08+A38A8SfYbj/ob8LpQae6Hvoqw3DU1+F8oxGygAaOAoGDgAAN7dbSHln+I0AAAAASUVORK5CYII=",HYDROGEN:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAANElEQVR42mNgGAW0BBuBeC8W8SIg/jtqINEGngBiTTTcSYmB/4D4Jxr+Mxopw8jAUTBAAADIhCT11Q14ZwAAAABJRU5ErkJggg==",INCREASE_CHARGE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAyklEQVR42mNgGAU4gAAQK0BpsgELEGcA8WUg/g3E/6H4NhCXQOVJMmw/EL8G4gYgdoC60AKIK4D4ORAfB2IeYg07DMT3gVgFKsYDNRhmgAwQn4caykHIwByoy1SQxCSh3pVEEpOBurSEkIGXoa5hIGAgA9T7twnF5m9omPFADQBhA6iBBkhiPNAw/Y8v9hWgChSgrvyPB9ejqaePC6kehjSJZVg6vI4UNjzQMENOh4eJTYfIhlIlpyAbmgN1KXLs3od6k2PAS5vBAQCFSEECjKrjagAAAABJRU5ErkJggg==",
+IODINE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAI0lEQVR42mNgGAV0AVMYpmyeyjB196iBowaOGkhXA0cBfQEADcspQU08dAAAAAAASUVORK5CYII=",LASSO:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAPqSURBVDgRlZRdTNtWGIZf/wRwfnCyEH4CNTQEymgDpUyAGLBdbZpAorvYDZF2xU1zN2nSFol7UKVtN2vZ5W5gW1dV26Sq02CV1nSMsk6bUsZSyqo0AUpwk+DEJHHi2LMthNBUyvZJn8/xOT6P7fe85yNomgbLsvB6veju7obH40HPaZYlCGJMLhWHpEJuWCnlOFtVGaqqolQGxHwZkiSHi1L+QXYvOf/e5S9DOAjC7Xajt7fXyCFfI6uNzxTE1JiafcSWd5extRXHr4+KSKRlqNpkBUWgy1OB1joKdrcP2+JLeLqTDqUSmxNXbj0WiPHxcfT19aG/o9YvS+JMJnqH3QgvYv5ODomMEtYYdw9S0FojCICrpDHkYDD29oCZbW4+hcWlmJDPF84RU1NTGOys80PiZ0uRWXzweRLJfXVOWznNi2rsgPHcpt1FsLZKBC+cNgUGOhnM/Zido89zVcP5vc3Zx6Er+OTmvlBSMKGBDjV5LulgcJ1XBU3XDy/6KFYqKn5JgZ9M89vTtYUFfPaDARv9rzBt01BTU2Ogz57vn69vqAdTRYHM8LGuuyvrkBXjF3XNTgzdGU1NTRgZGTGe9fr6RplKAlupMmgrtQdJu3GziD1JA21tbdDfzvM8RFGELGu7q9lFHzOZTKiurgbHcejp6UFHRwduffGpH3I+sHBvE2lNe3ptIymM9nvY1sjfl956YyBcf8prXwgnw9FoFNls1gDqX8QwDJxOpwFraWlBXV0dWmvI4G48EjTtfI1rS3mhrGKarqhkrkYSlqDnzMvD9fU1qw1OEwaaIfgc7EQ41RxyuVywWq2wWCyw2WzwcVaWJCl/IZcNSFu/cSvf38BXGkyTbHQ3q8RoVwMHoZBDhbIDPvo7xGd2DJ4zswv3pfkhb+3VWrcDVWYbSIrioMq+XDreVUpFAP42Pv4mg41EWXdEUIMZ+hMfvf9OnCim2UZ6FdcWd9HZXKlvEGwWCmZNW4pxoZ0zQxJ5/LGxj4dPZSyvF5HJG9aa10C6Zw+DfvIwzL7iyeGXcFoTHrHVqMR5Wxhcv1fAZrIcJgjROCGKfu6ABwcZOs70xJtnyJtOBz18oZ2BxQQUZRU3lvNY25LntEWXDMwLLroDjgbxagvBZiUETBQCDjPB2q0U1rbLSO2rQztZ9URf/ht4CCdJEu8O2oOX/baMr5HKcA6CO5x8QUcHHk16cnLS8FaHS/HHIivB+PpPSAhKbPeEwnDcO+iLr53laFPFTHLzzzH1WQjXl3KCpsrEcQtOGqc3Vld+7rRH2O++/Qu3VyW9XOnV5kTtjgW/7iXjHicRd1mJoJZ6xf5fcVQ/vf8PYWXQgWN9ucIAAAAASUVORK5CYII=",
+LASSO_SHAPES:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAT2SURBVDgRbZRdTBRXFMf/d2YW9oOP2eVrWdllEAFFtixasEqQ3ZQmfTCISW2TNo3QNulDH4Sm6WO3pg8+NC340jZNrKs16YtG2tpUqSkQbbTVKIpfWTGspewuLC6zH8N+zez0zrYYHzg3Nzd3zpzfnHPm3j8hhMBkMqGurg5OpxNbt25FZWUlWmo4l5zLDmTTqfYygyzk5QzdZ5BKZ6HTsTMrohLIZlLTCfGp76Mvz4r434jZbEZbWxs6OzshCAK22fSDyMW9SD4W9MnrSD4N4MwVCWs5IJVVgbyK9oYivN5TgjlpG6Q8L973Lx/77OTlTzUm2bt3L7q7u9HrsrugpE+wq9ddyb8n8MW5OPxBeZwipul7M3QGIkk1UFVCeJbApdfBba9gDg31lQrG8k349XJw3HcleoAMDw+jb2e9i1VWJ22ij393LCg+WVGOUcAYBTwrhe43tJ11ZHj/S6bRVkcRvv1FPMLtaeF5ZJYnE/e+4fefEmekDA5omWwUzbIstJ7LsvzMfWMhP3bAyWJ7fdEowzGHuGQsOtpYfoN/+4dYgMI8G2WlQSwWCxwOBziOQygUwsrKCv05ugK4eXvHFNEnkJbjAiOtBt03Z+5DyqgjG8G0CC3Qbrejq6sLnR8eHLS838uXlZWhvb29ANzcusNlKeMgZRFg9OpTIZZUUFWCgOatrq5GbW0tjEYjGIYplKidhKamJtTt38XXlFpGacbDNpsNPT09OP/9KG8uN3hv3P0HwagyzgWD4UCvc5NwddY/wNq6ZrRzqJXj9/sRiUQK0Obm5kK5LGGGG6wyT3Q4bHvP49tdWskr2cSJlvxZ4ZOJpCjncYSLiPLJ5Uydd+eucm9fdUOvo74C/rlMoKOiZmR63iparVa0tLTA3Nsq5JE6LLJhKCVJXrfKnYuvPnEp4d/x5rmEGJVUz3IiL3LVtvrxh4vEazWmUcHNuxkpjVfaWZyJFglv9NpHYobmmd2tta5HnM7LmiL88YUFhPPzuLskuyrmFvDbtcRUOochCiu0jDOVmb0VBgnmzCIuTMexY8sDzN/Tw1ZkcG+uNt4qrpLAFomIZOIQTWH440uIpWNgslGcXjYFMtGYR+v9unFVuiCvz0tYimbplH0X/koKO1rhvj4Xg/JHEHbLBB51e+DqseB0pAzxnASVDlKaRM5uFkjfFrd6aW5qHcic/elqILQ4DylHsKfNOOjuMLn9IRl/+rO+n2/nyFeONk+0FLht0GMpm4ai5guxRE/A2sMAb/Cuw7SVEdPqyPGLcd+FmylE14DJO2ncfJRGKK4ONTY24mD3q6OHXn4Bt5Ta5+NA6EBJDkyp5CYHnYPrTmb6sSreCalDF2ez5MHjNc+ubXo4qriCf9/RDwb3bKlxPWQNSOep3DxnWtkcw9HSV6jE5J9lyfX396OhoQFdm438anhutCR+CWuptSlN0vQ6xltjTeDrFRFrCvMcDlBVlZavgOhploY1gbzmHFbPzI6RH32f88UG04AUDXqt4gnh4+NLUHJKR+it/oGBF2u8V80BzPp1yGRKoKaSIAnat9giXZcplX5D5aBKJuQTFSKKdQ3k1NF35pvNC8LE5DV8d0kS6Z32RNodAVSa5psMWV56EkcuSdWFZrShUeHQ2pnIEqSNxUfIPid7KxBV+aWYepIG/KeBnkYqabIL4QSohGzI2fAhrxf/Bf2+NQqd2ZPzAAAAAElFTkSuQmCC",
+MARQUEE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAALySURBVDgRrZTPaxNBFMe/u5mmSZNqtCnUkKISoRQsrlTBY7Z3QRGvgl56UaF4Ei/24EEsVA/+AYLgoYi9KYhslLYqtnRr6sFUmyZNsmnaJJvN5leTbJwZCRQq0ogD+2ve2897834Jt1+2PAOHIKUN4HMMWNWglh4JutfrxejoKIbH30guOzx1C9g2gY8bQHTSEQoEAjh/75vn5FFItQawlAAW41BJvQmJOBrKjy0LiU0VpXhZBhAqlUqIRqNIxa1p3VkLamULjfwWsL4G1GoCk9mTkLRKVnGSGhZTReSSkMkCtbiY0vHl+dQEinEV/ZJKgahUKohEIsDc/ASSHzwo/ASaNaDLxcRcrkY0FdWsjFZTgqFMo9CikvGd4LGrT1sIXAoyxU5Xq0UhF2eDuHCrhTM3gyLMhKrtQEb/We5Zp0Cu7+xX0X1KhsunCv8E2PMT93DPNxkZGcHu7i40TYNpmrAsms4DLkLIPk1y7u5Xj1GFVIhCNR/Y9H0af9no6uri0hsvwBnzlCESEVKfp6Gk0xmpE+8YSRRFDmSMUmOLM0g8DxAXPWZqjgs7ubXjxxgrWwXKWAVZzwKHDA0wop2wuG77RIyRTv9mkLWkAX9pgVbqdsfARoP2HF2MgcQqZxAYG2pCM2R0H+m4DttAxkCZcMb/r0O/3w9mSdd12vM1tAN9kPO3s7xXl4yNjfHCDofDSCaTYFOGGRAEAXa7nV82m40bYvusCdiTwXp7e/ey+DvxXn4WPOy2lIgqyq7H/hD7uVgsoqenB2zmDQ4OwuFwoF6vI5PJIB6PI5fLwe12Y2hoiEMevkNwKWEoM0tOmbDBePp4E2vbolS8EgMEUcUTUe/r64PP58OJa6+CIo10oQpkd4BiChvVKfsGkw1cVzx3ZiGxTpsJbwIRFeT9iobvi59o2sPTTtGJinNYpmZD+Xwey8vLmB+1FL2cgVVMA2aGEq1J6u79WCyGfARSxtxWEHtLB+9rOi/tEDpJwr6A/WHjFwGgfWHujh5LAAAAAElFTkSuQmCC",
+MOVE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAPeSURBVDgRhZRNbBtVEMf/a2/WH6ztrZNgEVK6raIcKiCWEAdO9ZlTQHAAcciZDwHqBQmpaVRUCZTSRBUgVS0pBSEkShqpiKo9YOdSEKkSJ6Rqm1TNmsRxEtvrtdex1/tl5gViqamjjvT0dnbe/Hbe/EeLZrOJJ63U5EX5l69ODD3pHIt7sI+lJi8krn93JsHC/kAwGRb4ifGPXh9i/q/ffp74+pO3Jfa819oCb/wwFg+LoSQcM3n98peyoeVln6GiWi7I1y6cHgrw3uRm5sHEXhjz+XYvC+sZSfLxEOolLK1mB7s7u3DA3YZpGKio+WO9MQlL2VLbCtsCtUIOpaCAMGejmPtnwONY6cOHYnH6+ADFJNNnolwz29XSvofvffFTqqSpiIQjJJgbr+gVzev1EqAp1fQytEoVfoH5QPLK+cFr5081h996eYj5bXvIAqVyReH5DhwQxbjrOuA8PHjBB4HAJCbCAYEdg2XUzvKFFcw9LMjM3xdomo20QwdCVInVMOK8z09qiwiLwbjHwyEq+rTLp99PmMWsfCV1G5ktPdUCshGZnrx48sfR46xPO+btEOb17RrCEQlUocZxHqo2KNuWJZmOje6uznnXcT7ktRzmH24o8yuFFEvcqVDdXBvu6YoO+zv4udF3Xx1igaAYSVdNC4cOyujp7papl7AtU3ZsEwG/H8GQNIB6efDG7BL0ujnOcpjtABdv3Ryf+X0KLzz3DJy6fvbc8TflSGdMafI+iKEwXnn+KJqOhXjfYQwckREJiQh43EFvw8DM8ho4jpv6D/c/8MT3t6Zuz6Uv5ddX8VJ/v0RXmXjjg8/STSFIwgK2UaNVh58DAiQMT/vRnhjuZDah6kbq3lpJeQTIHGr0yF9/L+DZ3oPoiUqJn899muSYnJTsWCZs00Bd1+iWRVolqOUqcmqFxad3YTucXWf0alrJbuUv5VUVL/YdQZ8USPSGOmASpCMowidG8FT0aQQiUQjBMAzLpurq8HJcepfxCJA5rouRPxYW0aDeBGGBSkLTtbGdX6fdbeXZJFC5bkGt1qh/2B94ZiqtrG3mx2bu3EO1bsC2bdD4QAhJaGzrLWDNMKFsFAloKAtKUWkF6OGxwbbd5sjs3SVlZX0LBo2NS30U6Mo06Dt5tuNiraBhdnmV4nZL3V3oY8BvflvU6g3ztZt/zmiZXAHVWgOW7cAvSjBpf5DJYnr2PpZzKhuA1vztAklIet3G3kn0D3ZFu67Gop3wsTmhHqplnX5nW0grGzAd52NlszK2N7Xt74sd8nBcqqg3RhZW7h+rbNfiruNKDkFppW3XVdrBWN6/e9gR0mNegcsAAAAASUVORK5CYII=",
+NITROGEN:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAoElEQVR42mNgGAU0AwaBPzYaBPx4Z+z7SQRZXN/vlyFQ/L9l6H9Ocgz8b+D/YxY1DfwJxH8N/X6ZUMdAoOuAml8ZBPw8wcDwn5EaLuw09P8eBzJA3/97IlUMBLMDfuwH4pfGof/5qWKgUeBPTWh4TqCKgRD+91Yg/zcsCCg2EGQAkH8PiJ9SxUAQMAz44QlOm9QyEBzLAT/WkGXgKBg4AABF1poQYk+4pAAAAABJRU5ErkJggg==",OPEN:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAL+SURBVDgRrVRLT1NREP7O7e2LlgDllUrKS9EFG5r4A0iIwbjRjRtd+NiQuHDtwo2u1I2BH6DoHxBNiBFNbJUFKo2owUIVgRQp5VErbent7b3nOOeWCmWhJDDpZM6ZM/PNN3PPKRNC4DBFOUwwicX6+voQDAZx5Wxnr8Ples31TZhGHpJ5YWsN8dnx9MDdeJ3f70dNTU1Ffc45wuFwhU/t7++Hz+cDY8Ylp1gEM6MwiykryM1y2LAlaoeu1597OX9yJBAIQFXVvwAScK+w6bdD83a7rb2QWUI1m4SWmgIv/rbiGFORN6qR0rpQ5++B09sMRdkBFIIjl15ELDI6dfH2UlAmqdm1T+1HGragaFFoWpLActRuqa4QJtyOAlq9P2FTdChFL3VSOXYHW8ZWNtFz5yqrvfFApNVs6gfyShJ6Zo5QSkhOpyAACSr3OYCT5pcg8uUIeSaFAabAsTagpxuXjQllSpW0OTfBt2nZVYGOE8fB6k5RgllSYlpaG4RIil0WHJ2kq+uZ+28+x2ANhIrA3J6v32fC1vWQHI9JEwSwSZoh1WkUsjinWLKUYJIapMsJHc/H0vgymQ4RQ+qICJiSBLXoaTkNKAuA9oG2aTr8VbISkIpauh1vkM1SremvwPt3wEoSgwo3ijDopEhdNDZwuAIDQOGpRP+vSDJpaiAaA5KrWAhFxIhS1HPQdR2aLtAc6AbzNBGr9f+CyQBJIr4MzH0j5gK3pE/JayJkcBsa6wFHyzViNyr9+5JMFpj5DiRWkPa4MSKTFNVRRd/Mg7ajHWANZ2iYFLEPkfOjmSE2QxwKGBwdlwOni63Y7Khyq6hqOQ/oL/YBVQrJ0dWcnaOW49SZHcPlROv6trd6oTRdoKFEyv5/WvmE1zboY0QBant4bEIslBNUl6CJOnsRCj+x3iUElRY0HMvKtU4q7wv95BUj1TQCo7TIRwvmURlMWjWrreDmvVeYmX9GWxqMzLKe3F4rw3dEhjGBEF2V0I5X+iyA3a6DrSv/Og6GZWX/ATefgUebaMzeAAAAAElFTkSuQmCC",
+OPTIMIZE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAANTSURBVDgRrVTJSiNRFL3RMmJitDRKq1G7oogJChYq7oQsxG1L+wPptQvxC6S/IPkD6a0LB3Bhg9DZuNHYJiKIQ0M5D3GI8xjtcx6pYLuxafrB5b5X79a5w7n3OV5eXuR/LsdrME3TpLCwUDwejxiGIe3t7dLU1CTFxcUhOP709PQUuru7M+/v7+X6+lpWV1fTs7OzX3Z3dydsnBygw+GQyspKaW5uloaGBiXV1dW60+kcPz8/D21ubsrKygpBBGcpLS2Vh4cH2dnZSQPMD4fUotnI+FFqa2ulo6NDGhsbw0VFRRYiiiwvL5ujo6OytbVlmyp9cnJin3VswpAoP+QACwoKpKSkRPLz85nSyNnZmSQSCRkbG6MdlwWZgExCYhAD8iOr26DVUoBMl3WjIB394uJCFhcXJR6P23ZD2KgI7A/QFuy/IouR29tb0/6uAJGeIqGurk6Qunl0dCRI1bYhUJQZ9PT0iM/nk7KyMhJF57G1tTWZmpoyEZSBOloKUNd1RUJ5ebn5/Pw8zB+XlpZs0Mne3l69u7vbzLJNRx/z8vIMdIRF59nVBx3VcKE8ulwusjZcX1+v39zcyPr6ujDylpaWEbSOAUdyfHys2oXsIk25urp6TdagAiS7DJ+9lUql+hCNhMNheXx8VIBg05ibmxPWmb1HIALyHvVT+2yEBmz6NNaGAm8hsgxQ2d/fF0bESNkuFJ7/YqoiGgvs9XpVNKihapVMJqOcEsDeZ6N4Txlaa2urmg4wbCaTSQX43l9v71nrQCAg29vbE1owGBQwGIaOfO7vl3E0st/vl3Q6rUhgCTBef2BwPAnidrvV7BODnTIzM6NrXV1dhreiIvKhqkp+Liwow87OTqmpqVGtRHCWhe1xcHCQk729PaHgYRA9e89x1PB6DAaCQZ1EsA3IHBdGUAlfILuWvIO9ehwyIMmH2feAyO/T03SYxt2QBppDTrB8CnR6YGuQUQJyEeDy8pL1kRT68BQzfo5zfH5efm1sCMbUgtk3SPTw8DDtGBgYOCtwOnWySZZdqIsbTU6N0FTUMFStwzGjY7SThT6cAMgk7mLQuaXeQ9QpBKMQompDc+qYHhOp6kwXK42IE4gygX0SEkN6FrRab3vT8faDbfiv+jczOcrONGX5dgAAAABJRU5ErkJggg==",
+OXYGEN:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABCklEQVR42mNgGAXYwH8pKa7/PDxa/xkY2CgzSFBQ7j8v7wEg/gPEn4H4JxBvAGJh0g3j4pICanwDxCf+8/MrgcW4uXWB/FtAfA/katIM5OGZCNT44b+AgACKOD+/MtTFxcQbxsDADNTwDWQoVnle3nVAfJt4A/n5FYEa/v/n44vF4fpqoPxfoiMJqMEBbCA3twsOFyaC5aFhS4yBOmANPDwhOAwsAssLCfERG4acQA3/gLgKqzwf33Sg3CvSYpmXdy0Q3wEazoQiLirKAxR/jyvC8BmoAY3pZTCvAcNUHCi2F5w+eXhESU/ckLC8CE13T8Axy8u7D5SDKMuCvLwiwBg1Bnl3tGSjPQAAoX15+BfxFYQAAAAASUVORK5CYII=",PERIODIC_TABLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAKnSURBVDgRzVTPTxNBGH37g6WlTdmCNKJQTA/EAzF6aIyNCXKzMcazN27Em0dvEv0DPJiY+A+IJ403jdHgyRiUqohtRaTSSotlW0rbbffnOLONJLsVqTdfMpt937x5M998MwPt2V1SS16ZFwQBoiiC53kcBNYfiUQwNTWFRCKB6elpEEKcduvht/mzD9aIyPkbsKu7E6nI+OlTxdz7g8xYPBgMOmbxeBwjIyOwLMslf7O5AxGqAt+sOZu9Z51AETMuhYdIkgRZlhG6eH1ejvhuqrqNO8sKBI7DuiyBzy5BJFoNre0CVndUz/BuytKrVCpYkXjsCjxU1UTdsGHaQKpuQ9jI0BVaBngOCFEBQzQaRSwW63ajkcHBQQwPD4NNvdm2kVc0VDXqRqF9TwOtPWpIi9AfPo7LchH3B4aQTCadjXdUno/P50MgEECZppcnHAqgK/FAZJzzh2GMBi48mUwQ/9gxCEG/R9ahHC+A0EwWV5awejIOwyZdOpHWHMTS4BNCOFIsgxTS4Pr6uoQswPawZZpITZ5DZvwMDLZ5HjiGMHXYe3VYP03Y2589EjfVKM0PxFChxRjoXiAOPsVun57Z/28oknoRlWIOH+pHEdLbILT9DewMKsoWtPQyuKq+L9VLORC1Cu7F1Rh59FHBpzwH2+JAjNa+6E8/rK4b4VGUI1Hw9Or9BtFbMDUTYvl5e8avCwi3m6jprIaHo1+TYDbkjpBQU5Nm5WQmgmNPEbtq7Aawc/avWFhYcA3h5ubmcOnaeTI2RCcxm67OXohla9iqreHG49eLX2+/nRFLpRLqrSy22hKautKLh0tj2G28+pHGeqruxMVsNouVAjXK6yhvHv6EudwoMXWC9BdayFyjY5jJZPDy6QRW36mwm4ZX3xN33gits/+/AMFdJZghFwS8AAAAAElFTkSuQmCC",
+PHOSPHORUS:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAeElEQVR42mNgGAU0A/8bGDYC8X8o/gLEV/43MqRSZmA9wwkgtgAalA/kXwSy//1vYtCnxIW74PxGBnewa+sZMqhjYD2DCtTAHOoY2MDQAjXQjBIDrwANKALS+4H4D5A9g9JY/gA1bC4Q+1Ej2eyidjocSQaOgoEDAIsaZcCSspZYAAAAAElFTkSuQmCC",PUSHER_DOUBLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA8klEQVR42mNgGACgA8QxQBwAxCKUGOQAxKeB+DwQzwfiw0D8HohzyDEM5JrXQBwBxCxI4hpQC7pJ9eJjIDbBIS8BxLeBOIFYA/cDcQUBNSZQS3mICbfbaN7EBZYDcQEhRYuJcB0MeEDDE6flPNBYVCDSQBYCYQ327mUSUwPI2ym4JEuAeDaRBskAsQpUz3SoK1WwhV8JkQaCguc/NOHfg7IxYhyUE1xI8O5zqEEwjAFuY3M2HpAJxP+ghu3FpgAUwwIkGAhS+xdqYC82Bf/JyPM3ofpiqGVgGVSfCbXKSgFsMXwfinHxCYF+dAFKDZRB5gAAj/I5E2fZy9MAAAAASUVORK5CYII=",
+PUSHER_SINGLE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA6ElEQVR42mNgGACgA8QxQBwAxCKUGOQAxKeB+DwQzwfiw0D8HohzyDEM5JrXQBwBxCxI4hpQC7pJ9eJjIDbBIS8BxLeBOIFYA/cDcQUBNSZQS3mICbfbaN7EBZYDcQEhRYuJcB0MeEDDE6flPNBYVCDSQBYCYQ327mUSUwPI2ym4JEuAeDaJBoL0TIeyZdB9txiqgBTgAU38O4H4P9RQOADlBBcSDVSAGvQPiO+gS4KSiwqJBgpADbyKLSzfQxWQCkAGfsFWcPwnsxAB6duOS4JcA1OoWV7+x1VO3odiUsFxXBLkGoiSdgEanzHP7ILArQAAAABJRU5ErkJggg==",REDO:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAPsSURBVDgRjVRNbBtFGH3rXf/kB7qR0yYNQsQqRHJQ1BVSk6CoyBEVAvVAIk6kBxLuqI2QkFAPBS4cSw4gWkFbDvSERHJBBKHGKEhJiqr6kKS0dVQnrsMmru31Ovb+zM4MsxFuHCoaZjX6dmfevHnfN29WkiQJqqqir68P/f39iMViiE8cGfcYPWszW7OpA8cjqBLLMJ3atOFUv0u+/3syl8uhWCzCNE00NqmtrQ2apmFoaAiJ871aAPKPVVrpzns6tokO062AeAD3FEi0CZTIyFfN5HbVGF0anTNKpVIjH5R4PI6BgQGcPN+jUXhzW15WXSPLyDoZGMSA5RJ4JACQJgTpswhTFbaLRMEy5zovHx8WbEYjY8BP9fRnJzRVaZ9DgKvbWMdd95ZQl4PDLHAw0TkId2F6ZWw5OsrEhG07mrvtXmwk898D0WgUFdu8uryRUq8vXEF6Vkfvyhs4XHoBjHCR694Sn5hyKjZydgcZlcZj35zq3kMAyosfNI3/OvOH9u3312GtWpCAZPxUB946/WZCORbGemitEb+rlnEGSVEQjIbQHjl69qPk5akwmkdm79yFcvOHzfdmbv+M2n1XFB4T3qZzLXVlA+GXf7r6Tte74yRIkeXZJ0h9d7Q2t6JNUcdF7c9tmHmk0vcQWDXXE6XcDpjLJ32y+sqlDx9OLBRvJE9ETiLIQvtSr2MII9iyiuri5gpmVhbAlh8gkCJZuAbL0Kz1RR3oR1+BFy9PWFHTeK3rdTHQOOvzi4NiHgpWGelHD+Fl8uCFMgI7QQVMkT+tw8Ph8K4vx8bG0Pn5cCZIWq4dbx1Ai9xahzyOPqn/wBNOcDxInCUVZgrXtgSn6yjf6D09PXj7q1e1qPzcBY+zEcezEZYjAmLXYfsip0z4lIoxCQpsOolfco/NSSlFoVBAiRUutivHEmv2LSwaSeE9/0b8K+86LRM6XSFM4ikFU6v7amcYBubn53FI11P3KrmESwl0WYe4eaJwwTrFvsj/SVlkX5b3zYgPxhh8lXe+zM9WuzfKlbQ32OXFI45swZGFtbgs5gOgnoh+F3eblCjcjAlWI1NPEDZusHWjthh6xZkt6I8GVfv5zrDSjKokLAYZjO4RugUP7oMymEMvPZXQJy8s1PSthdIlvFRTJSMyqModsCUH4kyFUmVXoZsnuwq5xycPJKwrLt6szMq99LedvDVyiLVHmPgB2aJofsqu7sDdMOEu3f9YDP//tv71X0mL7MTW/0xPE3FVm4oi7bIDtuMKL9KMz/QfPjh4k44z3eeCkWcuyKGwWkwbsLPVpHtnc/jglU9BtI3GtNb+o7ebeg/zUM+RTzjn+BvzRBz4gX8KbwAAAABJRU5ErkJggg==",
+REMOVE_LONE_PAIR:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAN0lEQVR42mNgGAWjYHACBSDeD8T/gfg4lE+KPAYAKTaBsg2gmkiRxwD/KeTT3oVUD8NRMAoIAAADoBa5tWLP/wAAAABJRU5ErkJggg==",REMOVE_RADICAL:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAM0lEQVR42mNgGAWjYGgABSDeD8T/gfg4lE8RABlmAmUbQA2lCPwnwB94F1I9DEfBKEADAAT6C11yCuPwAAAAAElFTkSuQmCC",RGROUP:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA3UlEQVR42u3SPwsBcRzH8YtYFGVELBYGu0dgskgWSgyKJyB2k+wWZTPxCDwBLJikDJKShQlFeF/9Tte5u25U7luv4X736fO7Pz9Jsuf/ZosjzpigqpPpoqRZq+isfQpzcCCDO8KaTAsHuMV1FjN4zArlCeGJhCYTFBsVkcQaAbNXlguj6GNpkBtghY3Ohl+FF7wwh9cglxaZmpWfUkYKV8R1Mj4ssMPQSqHyDXuYwqm678JYPFkeD0SsFvrFEaqr7subdFTle7StFspTwA0xNDASR0qZJk5GR8aeH5k3G/QvyONoufAAAAAASUVORK5CYII=",
+SAVE:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAKmSURBVDgRrZTPTxNBFMe/24VCgNYCVYhISLDBeCEejCRelBOJ4Wy8iYmevfoneDOKV0O8mXhVEk/ERGI4GFZj0gIxlKalWFe6v3/PrDPTEGiWYg+8ZGZn3sx83pu3854UxzG4vF6v3fVCipC25kJ5RheRGKodYkd1lNXHs9rRVokDX32prkxn00ueFcF1I2wZqli/d3UI05eykCSJ6V04jiOabdtQVRUVP4OvwWVFObAfbT+bU/ihHt6FQbQU2DFqVQemHmK1XuVqXB8YRb4fSKVSMAwDuq5jeXkZ5XIZhUIBEzcXMTZ25QbCeE16+mk+frmgCGDD8pF2JOwd2LD0CJuVQwFszPTCHR+CLMuwLAuapqFYLKJUKiGKCILxOQwNhpiJSe5vY2sNWBhuecjiwWNHu4wft8ZDRSiFz+LuGX+QamzluF4A+aBbmZychO/7yGQy4gjl4CgAcQ0xPxP4qxkgW7NEDE3DhW5EmF24j6k5DbX9OtyeQaQF5vhlnAp8ePEasxpD25OwdiBB6ksBfSOsjULKsnFewvAUEPmsBccwzmar5ysJD/O5Pty6PQrKfpQwJzMPeyRAZobFtzWmVMLPiokfu2abRwngyIU0Fu+Mt23qNIkC+n8gpQSe53ZiwDQt2I4t1k2TJPYlPKSEwradxEZCiHjY/MkcCcvEhCSA/KBtt8clDCOms8VjPkmI4+Q/TQDDKESz2WTnWPBxdva0ClU7VAD5a2clRRinLJ08LzrpSMcxIb1s7RSgxkrW/sZHrH94hwdPnqNeb79yJ6J+OIjN92/g6U3QfpHKrVz+rOxoBd3K5Sdm8H1jFc2d7oB1fwApOc0CE8NTy8KuuHK5qMzXK99epIzf2K1uo9Tb3ZUdIoM3XqTCOH7LiaJiC/Q5df8A94VafhNL/ZIAAAAASUVORK5CYII=",
+SEARCH:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAP+SURBVDgRbVTPTxtHFH67Xu/6t3exaysu2I6ExIGo2SgIpEgobumhUg+mN4655BgpHDnllDNST/0LkkOVtpGaU0JBIYdKCRFqmyoQUmNIDLbBBozxj7W9/d44dkzakcYz3nnvm++9970h+jDC4TDNzs7SvXs/3Vhe/r388OFv9q1bC+VQKHqDTaanp2lhYcFcXV3LPHq0Yt+9+70dj48u2rZNg1P+gEeSJNHp6SlVKlayWrX1TCZHL1/+oTcajSTb8Nn29rZuWWoyk3lPa2uvYHti9vx7q9LbdDodGFQol8tRq+Ugdjo7q+DYFiajo6Okqirl80V6+3aXDg72yLKaPff+qhiGQdFolOLxOMViMfJ4NAA2yOFwkM8XBIiLZmYmaHJyUjhJUkusiqLCps/nI+D4+DhNTU3RyMgIuVwucjq9dHxcJ2b8/PkSXbp09U4q9e2dcHgYrPbp/v0fKJG4Sn5/kNxuTx+ot5Hm5ubo5s352Vhs5OdicZ+y2QwtLT2mJ08eI7wdsL64MjHxVaperyENf6/n81nT59NB4mu6fHmCvF4X7HL07Nnyd0+f/vqLbFkWPhykmdXGRhbJ/pPevNmi/f1d5MjCBZtfxmJJOjoq0OvXa/NHR4dgmuOLKBiMYl+mra1/qFDIpZmlUq1WuRBJhyMIBjna2clRqVTuRSBWXefwfGKfSCSoWj2jZrOJ4mxgrdPJSYkLmGQDIZtEYgyFaIm8Ca+BH66sqsqYGimKAlZcKJXabQsgpyTLDnx3wqOrBlGmfP5dqtWSYNQZgOpuh4eHSdNkVNxHkUgEOfOKCNrtFsAUTElUu91up9hDZpWrqhvCrQCwLVh2jSXBKh4fTxWLh1Sr1RG2YbIOC4UC5BU8FxHj8FB8voDu8fhQgD3RQq1WU4TCh6zBzc2/lvf23sG5Taj0IotZkmTIyykIMA7/5wnd6gpazuT8IWwwCCGXFjUaNQaYh/N6pVIGUFWEZVkN4QiNmrIsL3K4PLAXE91rihwGAkPiNj7sUZckxzqAVxj806FpbtL1AEhkcRToA7KdAq2BoXUuH/xQ8K3/N1g2Fy58jhw6kabuZRwu26MGpux2e/VSqdAHZLDu/C8cV3hoaAiV5pbr9C9lMAbF0OWxsS8QZmcg1N5hNz+DsKxDTdPE7Amdzz9qUSIFj2T6xYtVtM8rGO7Q7u4WlctFhNN9Bz8F5Ooi00lmiN5Gl73Hs3csnrNarZpWKpWO+eDBjwgjQIGAgbY6ERJBJeF0fnBvHx4e0pUrM8lSqYE+z1IoFIFGz6AOfhttk65d+4afeRuAtmF8htVv451jld4+D4cKImQehhG5ff162kb+bV0P236/YTudGvuU/wXmtO4aLOKAZwAAAABJRU5ErkJggg==",
+SULFUR:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAwUlEQVR42mNgGAXo4P9/Y7n///Wl//9nYKTQIAP///8NzwIN+w5k/wHir0BsQK6ruICa3wHxEiCbH8I3jPv/X1eJTAP1jICG/Qe6zoxK4WYmDDTwNxDXUzEyDOZBXGkw+/9/cz4qGMjACHIhEP8D4gdkRwgWl1oD8UNoLFtTKy2KAA17DcTzqRimhjuABh4jU7O+IdCAiP//VdihhpkADfsJpJvJdY0z0ICP0KTzDBoxi2EWUJiPDUxBYThaqtEPAAAQY5TwZ4cDHAAAAABJRU5ErkJggg==",UNDO:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAO0SURBVDgRjZTPb1tFEMe/b98+u5Ydx4khCSJN3CQHcokeh4QDEnK4BImLcwdVvSButOLEyeWORDlx4FDBP9AcOFOjCKkkJXFFaWkJ6XNjEju2Ezu23+/3lllLttyQqoy08szs7OfNzM5awZDEYjHMzc1heXkZi4uLeH/6ckbj/LMYE1nmu3pgWzDPOs16tV6oVevffPvkUWFzc3OIACh9i3OO+fl5ZLNZXF15J5UYTebHI8p1rXuGxsEBTg+P4JpdhKFAeiwJqBz75Xqh9Pxw/frPPzUHHKkoioJ0Oo2lpSVkMhlEIpG7U7D1yv3fUdp9gLNKBXanDcfzIJgKFo9DS47i8lQ6m1S8Z18uvLWa3/uz2GNNTExIABYWFrCysoIPZzI3F0a1fGV7G/v3tmCenMILfAQU7csl0NMFY1AJHJBdb3QMV4i3vzoqN/na2hpk7yT4g+mZTAJePigbONjaht2oQ1CJfZGaHYZo+AFMIcAtF3HGoTBkTDe8Tdvr/NP3sjkIoSsqKygKy06GFvZ3igQ7Afn7LEjNJNgzx8VD08axFxijKs+MaSriqoIoeO7j1yazXDM7d2ZeH8FxpZ7vWA589wT1v0sQVOawuJRp2fGw07VQ9YIifWG1TcWPcX77kqLmHBGgG4RX+clv25ieHUe8dowxjeHgiQGv3R5mISSrGQR4ajsysx6s5Dq9m31smeufTE7tjrBQN3xP59WDf4q22tGfbt6HFouiTeUMVdoDh+SQ5XboBjjYtT3XGoyJDIgr/AZn4m4IV2cKRFP2R1FVWAS7SBiNa4r2ZyOxjT3H6o3HcNzXlXLBCUTPzxqBUpQwpmnDMS/ojD47Ho1AT1zKffHG9O7nU2/qLwSQ0QnC751QGJz0lk+lqDSLsKzzcQNbUMmMumkJTy85wR3auDLYJMUXYkMDS3GFseKpB8SScZit1nBMT5ftsIMQVd/HHzQFj2nZITbOB/5QrxrkuykzbPYugco+L/IVnNHt7tO4PLBsPHfoxQjcoBu+dT62b0ugcWq6SNG490Vm5dFXavQiHlJGO3RZbWo6ua4RrNf8fuz5X/ZdrWJQ/YjSyEiQXHJEZFabbRO/dCwJu0Uhq6+CSTiX/zTNVteYSamZgE41qF+PbBe/dm0ceUGTHojM6j89k4cvEu5Ts2kZoeNnDj0fW6aDewRzBArEXydY86KDL/PxWq2G0lnXcEaAH1td/EWN917R+JfBBv6P0hO5dxMJcSUa3Z2NRPXBxv9QBJUxvP4FOrr+Un8w7D4AAAAASUVORK5CYII=",
+ZOOM_IN:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAO6SURBVDgRlVTfT1tlGH7O6Sml7VpOtlK2Qt2RDNgPIaWDbAIXFalNTIxNNBpvTElMdBeGerMYL6x6xZVk6h8wbggmGllcUqcz1Hjhkm0OOxJgDjtma7rSwmlPe370xzl+p0othIX5Jm/O+33v8z3n+57vfT/K7XZjeHgYXq8XIyMjnMFgiGia5lMUhRNFEYIg8KVSaSGfz8/Ozc3FMpkMSAxZlkFwdUeT0TrR0NAQRkdHwxaLJWEymUKMsYVjj7RDd9BGNp3OhBSlvDgxMTFTqVRAfgqGYUBRVBPVPyHT19eHwcHBMAHMGAxGHO85CWOrGbWahqoG9HnOY1QScfXrL7GZzYb9fj87Pz8/SdP0voQ0OS6nqupMpaaCO+1BlTbhh+uLcFgNOHrIgB8XYyhTrfC/+ia6SZ6i6FAgEPCRNdB9r9FEi4gkyXD3DKAgqygqKqTqf0C5oqJUViGQ3Nnxl2G1t6FcLkf2Eu2MmWKxGDRZ28BLVdy9EYNKhF5Z/m0nj7vxJUiEkCiA/uExuE704/7aqq8B2BMwglBknZwdt3+9g3dee2FPGvjsk4uNudnbOeQVom21hoGBAV88Ho81kv8GTLFUgiAqyJMdHmSpPMEJJYhSqV42++GZfJ7nE+trLDsYwNQX35Cjafjz3jKufP5hHR+48DGc3Wegy5rJl7CZTqFQKKBWrS7tS5jLZhckUQ4ZTz2P9lPn6loVyMXsmM19Gm295wihhkwmic31OGRJWkomk/wOpvlLky6Y3drKIfnLt8gWRGyJNQhNhDp5jszpzt+6ClQkWK3WS80kzXG91MfHx2fMZnP48AkvKmdegqIxyD5cJcUNmDueJngNrb9/D+3BTbhcx5BKpSaj0ejljo4OpNPpZj4Y9FEikbhms9nYfHrjvDEdB1N8BCtVhaGYhrxCCvvmV5D+WoPDcQTT09Po6uwMdvQeZZ2R7UevdL69i3FXM5I29MmyMkV2FAT0lF4iVd1jRqPxp66urinS8+xb717Ap5koWixxPln4+bmFZ1caF7SLsHnvTqeTI2OWvC4NMGlTj93Rtrj8zD224j2LD8Ymsc4vIMFfn4yObVxuXv/EMeXvDtOv2zXmvVbNPOvXLqW+0y6uhrWxmCOkP2d1DZ+YTQf+sX0Dh90cFMWjFu/jmrCO/uMvor3FEnw/9sbG/yfUSR9uXdHsLo5Sah5KfIBbuQSsQi/kuBx8rIb6uoOM8nIfUbbtCCkLaLwdKJsaeh+09vH5k8dClMukUU/Rd6ieQ+zfB/SzBP1HjRkAAAAASUVORK5CYII=",
+ZOOM_OUT:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKQ2lDQ1BJQ0MgUHJvZmlsZQAAeAGdlndUU1kTwO97L73QEkKREnoNTUoAkRJ6kV5FJSQBQgkYErBXRAVXFBVpiiKLIi64uhRZK6JYWBQUsC/IIqCsi6uIimVf9Bxl/9j9vrPzx5zfmztz79yZuec8ACi+gUJRJqwAQIZIIg7z8WDGxMYx8d0ABkSAA9YAcHnZWUHh3hEAFT8vDjMbdZKxTKDP+nX/F7jF8g1hMj+b/n+lyMsSS9CdQtCQuXxBNg/lPJTTcyVZMvskyvTENBnDGBmL0QRRVpVx8hc2/+zzhd1kzM8Q8VEfWc5Z/Ay+jDtQ3pIjFaCMBKKcnyMU5KJ8G2X9dGmGEOU3KNMzBNxsADAUmV0i4KWgbIUyRRwRxkF5HgAESvIsTpzFEsEyNE8AOJlZy8XC5BQJ05hnwrR2dGQzfQW56QKJhBXC5aVxxXwmJzMjiytaDsCXO8uigJKstky0yPbWjvb2LBsLtPxf5V8Xv3r9O8h6+8XjZejnnkGMrm+2b7HfbJnVALCn0Nrs+GZLLAOgZRMAqve+2fQPACCfB0DzjVn3YcjmJUUiyXKytMzNzbUQCngWsoJ+lf/p8NXzn2HWeRay877WjukpSOJK0yVMWVF5memZUjEzO4vLEzBZfxtidOv/HDgrrVl5mIcJkgRigQg9KgqdMqEoGW23iC+UCDNFTKHonzr8H8Nm5SDDL3ONAq3mI6AvsQAKN+gA+b0LYGhkgMTvR1egr30LJEYB2cuL1h79Mvcoo+uf9d8UXIR+wtnCZKbMzAmLYPKk4hwZo29CprCABOQBHagBLaAHjAEL2AAH4AzcgBfwB8EgAsSCxYAHUkAGEINcsAqsB/mgEOwAe0A5qAI1oA40gBOgBZwGF8BlcB3cBH3gPhgEI+AZmASvwQwEQXiICtEgNUgbMoDMIBuIDc2HvKBAKAyKhRKgZEgESaFV0EaoECqGyqGDUB30I3QKugBdhXqgu9AQNA79Cb2DEZgC02FN2BC2hNmwOxwAR8CL4GR4KbwCzoO3w6VwNXwMboYvwNfhPngQfgZPIQAhIwxEB2EhbISDBCNxSBIiRtYgBUgJUo00IG1IJ3ILGUQmkLcYHIaGYWJYGGeMLyYSw8MsxazBbMOUY45gmjEdmFuYIcwk5iOWitXAmmGdsH7YGGwyNhebjy3B1mKbsJewfdgR7GscDsfAGeEccL64WFwqbiVuG24frhF3HteDG8ZN4fF4NbwZ3gUfjOfiJfh8fBn+GP4cvhc/gn9DIBO0CTYEb0IcQUTYQCghHCWcJfQSRgkzRAWiAdGJGEzkE5cTi4g1xDbiDeIIcYakSDIiuZAiSKmk9aRSUgPpEukB6SWZTNYlO5JDyULyOnIp+Tj5CnmI/JaiRDGlcCjxFCllO+Uw5TzlLuUllUo1pLpR46gS6nZqHfUi9RH1jRxNzkLOT44vt1auQq5ZrlfuuTxR3kDeXX6x/Ar5EvmT8jfkJxSICoYKHAWuwhqFCoVTCgMKU4o0RWvFYMUMxW2KRxWvKo4p4ZUMlbyU+Ep5SoeULioN0xCaHo1D49E20mpol2gjdBzdiO5HT6UX0n+gd9MnlZWUbZWjlJcpVyifUR5kIAxDhh8jnVHEOMHoZ7xT0VRxVxGobFVpUOlVmVado+qmKlAtUG1U7VN9p8ZU81JLU9up1qL2UB2jbqoeqp6rvl/9kvrEHPoc5zm8OQVzTsy5pwFrmGqEaazUOKTRpTGlqaXpo5mlWaZ5UXNCi6HlppWqtVvrrNa4Nk17vrZQe7f2Oe2nTGWmOzOdWcrsYE7qaOj46kh1Dup068zoGulG6m7QbdR9qEfSY+sl6e3Wa9eb1NfWD9JfpV+vf8+AaMA2SDHYa9BpMG1oZBhtuNmwxXDMSNXIz2iFUb3RA2OqsavxUuNq49smOBO2SZrJPpObprCpnWmKaYXpDTPYzN5MaLbPrMcca+5oLjKvNh9gUVjurBxWPWvIgmERaLHBosXiuaW+ZZzlTstOy49WdlbpVjVW962VrP2tN1i3Wf9pY2rDs6mwuT2XOtd77tq5rXNf2JrZCmz3296xo9kF2W22a7f7YO9gL7ZvsB930HdIcKh0GGDT2SHsbewrjlhHD8e1jqcd3zrZO0mcTjj94cxyTnM+6jw2z2ieYF7NvGEXXReuy0GXwfnM+QnzD8wfdNVx5bpWuz5203Pju9W6jbqbuKe6H3N/7mHlIfZo8pjmOHFWc857Ip4+ngWe3V5KXpFe5V6PvHW9k73rvSd97HxW+pz3xfoG+O70HfDT9OP51flN+jv4r/bvCKAEhAeUBzwONA0UB7YFwUH+QbuCHiwwWCBa0BIMgv2CdwU/DDEKWRrycyguNCS0IvRJmHXYqrDOcFr4kvCj4a8jPCKKIu5HGkdKI9uj5KPio+qipqM9o4ujB2MsY1bHXI9VjxXGtsbh46LiauOmFnot3LNwJN4uPj++f5HRomWLri5WX5y++MwS+SXcJScTsAnRCUcT3nODudXcqUS/xMrESR6Ht5f3jO/G380fF7gIigWjSS5JxUljyS7Ju5LHU1xTSlImhBxhufBFqm9qVep0WnDa4bRP6dHpjRmEjISMUyIlUZqoI1Mrc1lmT5ZZVn7W4FKnpXuWTooDxLXZUPai7FYJHf2Z6pIaSzdJh3Lm51TkvMmNyj25THGZaFnXctPlW5ePrvBe8f1KzEreyvZVOqvWrxpa7b764BpoTeKa9rV6a/PWjqzzWXdkPWl92vpfNlhtKN7wamP0xrY8zbx1ecObfDbV58vli/MHNjtvrtqC2SLc0r117tayrR8L+AXXCq0KSwrfb+Ntu/ad9Xel333anrS9u8i+aP8O3A7Rjv6drjuPFCsWryge3hW0q3k3c3fB7ld7luy5WmJbUrWXtFe6d7A0sLS1TL9sR9n78pTyvgqPisZKjcqtldP7+Pt697vtb6jSrCqsendAeODOQZ+DzdWG1SWHcIdyDj2piarp/J79fV2tem1h7YfDosODR8KOdNQ51NUd1ThaVA/XS+vHj8Ufu/mD5w+tDayGg42MxsLj4Lj0+NMfE37sPxFwov0k+2TDTwY/VTbRmgqaoeblzZMtKS2DrbGtPaf8T7W3Obc1/Wzx8+HTOqcrziifKTpLOpt39tO5Feemzmedn7iQfGG4fUn7/YsxF293hHZ0Xwq4dOWy9+WLne6d5664XDl91enqqWvsay3X7a83d9l1Nf1i90tTt3138w2HG603HW+29czrOdvr2nvhluety7f9bl/vW9DX0x/Zf2cgfmDwDv/O2N30uy/u5dybub/uAfZBwUOFhyWPNB5V/2rya+Og/eCZIc+hrsfhj+8P84af/Zb92/uRvCfUJyWj2qN1YzZjp8e9x28+Xfh05FnWs5mJ/N8Vf698bvz8pz/c/uiajJkceSF+8enPbS/VXh5+ZfuqfSpk6tHrjNcz0wVv1N4cect+2/ku+t3oTO57/PvSDyYf2j4GfHzwKePTp78AA5vz/OzO54oAAAAJcEhZcwAACxMAAAsTAQCanBgAAAOfSURBVDgRlZTfT1tlGMe/5/SUw1opJ1IKInVnCGMzQkpHswlcVKUj8cYmLhpvTHdhtt0IJiSaeFHviSEa/wC5IZhoBnFxLjFZEy/cBdu6arJKgK4bLLXQ0dPT86s97fF9SyAt6cJ8kzfP87zv83ze933O8xzG6/UiEAjA7/djbGxMtNlsUcuygoZhiKqqQpblvKIoy5IkLSwuLsay2SyIDl3XQfxqE3WDpaDR0VGMj4/POByOFM/zEc7eIgodnRA6PABrFzKZbMQwSrcnJyfny+UyyKHgOA4Mw9Sh9lVucHAQIyMjM8Rh3maz4+TAGdhbT6BSsWBawKDvPMY1FTd+/hE7u7szoVBIWFpausyybFMgS54rVqvV+XKlCvENH0yWh6xXUSxVoRj7ssS0InTpE/SRfYZhI1NTU0ESAzqPDpbkIqppOrwDwyhQEIEoBEblAZTa9JBz77wPp6sdpVIpehR0YHPFYjHMO9uR10z8dSeGKkl0lTy1Uks4lYBFFqgcCkygp38Ia8mHwQPAUcnJclHwiC7cvXcfVz+8eHS/wV64m4NkkANJeoaHh4OJRCLW4EAMrqgokFUDErnhcWNbIn6yAlVTamXTzJ+TpHw+tfGPIIxMYfr767WnkgvUSaKTJ5tkLSsp2Mlso1AooGKa8abA3O7usqbqEfvZd9F59nwtVzTYpBCSuPKBTuxsdgs7Gwnomhbf2trKNwWSLljQDSPC/vkLWgOXYNn4Wv3tw/ZvVqY1SYDK6g2grMHpdH7bDEbXbMlk8lF3d7eg5p5eQCGLgqMHitUCtWyRUqnUclZ4tgPErwNP7qG//3XaJSvr6+vxrq4uzM7ONrBt1EqlUrfa2toEKZO+YM8kwO49BnKPoKdWoT74DcbqT9CersHt7sDc3Bz6Tp0Kd/S5BU90798PXr2SqSc2NCNpw6CuG9Ok8sIA3SJPNU06l+12+4Pe3t5p0vPCp9PX8E3mJnhHIv+k8Mfby289PPxADcD6kzwej0hsgfxdDp1Jm/pc7vbbf7+5JpT95/DVRAQb+RVs5n+/fHMi/UN9/AvrTKhvhv3IZXGft1onFkLWd9u/Wl8kP7MmYu4I/Z3VcvjCNOq4uXcHL3tFGIavWlzHLXkTQyffQ2eLI/xl7OP0/wdS6ONnK5arR2QM08eoaazm0nDKpyHFpfBzc0jjjhuMX/yaaduLkgaGJbkAgz/M93Gxz98/80qE6eEt5jX2PjPwkvAfo5HaQHXdt9YAAAAASUVORK5CYII="}}();
+(function(a,d,f){a.Button=function(a,e,b,d){this.id=a;this.icon=e;this.toggle=!1;this.tooltip=b?b:"";this.func=d?d:void 0;return!0};a.Button.prototype.getElement=function(){return f("#"+this.id)};a.Button.prototype.getSource=function(a){var e=[];this.toggle?(e.push('<input type="radio" name="'),e.push(a),e.push('" id="'),e.push(this.id),e.push('" title="'),e.push(this.tooltip),e.push('" /><label for="'),e.push(this.id),e.push('"><img id="'),e.push(this.id),e.push('_icon" title="'),e.push(this.tooltip),
+e.push('" width="20" height="20" src="'),e.push(d.getURI(this.icon)),e.push('"></label>')):(e.push('<button id="'),e.push(this.id),e.push('" onclick="return false;" title="'),e.push(this.tooltip),e.push('"><img title="'),e.push(this.tooltip),e.push('" width="20" height="20" src="'),e.push(d.getURI(this.icon)),e.push('"></button>'));return e.join("")};a.Button.prototype.setup=function(a){var e=this.getElement();(!this.toggle||a)&&e.button();e.click(this.func)};a.Button.prototype.disable=function(){var a=
+this.getElement();a.mouseout();a.button("disable")};a.Button.prototype.enable=function(){this.getElement().button("enable")};a.Button.prototype.select=function(){var a=this.getElement();a.attr("checked",!0);a.button("refresh")}})(ChemDoodle.sketcher.gui.desktop,ChemDoodle.sketcher.gui.imageDepot,jQuery);
+(function(a,d){a.ButtonSet=function(a){this.id=a;this.buttons=[];return this.toggle=!0};a.ButtonSet.prototype.getElement=function(){return d("#"+this.id)};a.ButtonSet.prototype.getSource=function(a){var c=[];c.push('<span id="');c.push(this.id);c.push('">');for(var e=0,b=this.buttons.length;e<b;e++)this.toggle&&(this.buttons[e].toggle=!0),c.push(this.buttons[e].getSource(a));this.dropDown&&c.push(this.dropDown.getButtonSource());c.push("</span>");this.dropDown&&c.push(this.dropDown.getHiddenSource());
+return c.join("")};a.ButtonSet.prototype.setup=function(){this.getElement().buttonset();for(var a=0,c=this.buttons.length;a<c;a++)this.buttons[a].setup(!1);this.dropDown&&this.dropDown.setup()};a.ButtonSet.prototype.addDropDown=function(d){this.dropDown=new a.DropDown(this.id+"_dd",d,this.buttons[this.buttons.length-1])}})(ChemDoodle.sketcher.gui.desktop,jQuery);
+(function(a,d,f){a.Dialog=function(a,e,b){this.sketcherid=a;this.id=a+e;this.title=b?b:"Information";this.afterMessage=this.message=this.buttons=void 0;this.includeTextField=this.includeTextArea=!1;return!0};a.Dialog.prototype.getElement=function(){return d("#"+this.id)};a.Dialog.prototype.getTextArea=function(){return d("#"+this.id+"_ta")};a.Dialog.prototype.getTextField=function(){return d("#"+this.id+"_tf")};a.Dialog.prototype.setup=function(){var a=[];a.push('<div style="font-size:12px;" id="');
+a.push(this.id);a.push('" title="');a.push(this.title);a.push('">');this.message&&(a.push("<p>"),a.push(this.message),a.push("</p>"));this.includeTextField&&(a.push('<input type="text" style="font-family:\'Courier New\';" id="'),a.push(this.id),a.push('_tf"></input>'));this.includeTextArea&&(a.push('<textarea style="font-family:\'Courier New\';" id="'),a.push(this.id),a.push('_ta" cols="55" rows="10"></textarea>'));this.afterMessage&&(a.push("<p>"),a.push(this.afterMessage),a.push("</p>"));a.push("</div>");
+f.getElementById(this.sketcherid)?d("#"+this.sketcherid).before(a.join("")):f.writeln(a.join(""));this.getElement().dialog({autoOpen:!1,width:435,buttons:this.buttons})}})(ChemDoodle.sketcher.gui.desktop,jQuery,document);
+(function(a,d,f,c){d.MolGrabberDialog=function(a,b){this.sketcherid=a;this.id=a+b;this.title="MolGrabber";return!0};d.MolGrabberDialog.prototype=new d.Dialog;d.MolGrabberDialog.prototype.setup=function(){var a=[];a.push('<div style="font-size:12px;text-align:center;" id="');a.push(this.id);a.push('" title="');a.push(this.title);a.push('">');this.message&&(a.push("<p>"),a.push(this.message),a.push("</p>"));a.push('<canvas class="ChemDoodleWebComponent" id="');a.push(this.id);a.push('_mg"></canvas>');
+this.afterMessage&&(a.push("<p>"),a.push(this.afterMessage),a.push("</p>"));a.push("</div>");c.getElementById(this.sketcherid)?f("#"+this.sketcherid).before(a.join("")):c.writeln(a.join(""));this.canvas=new ChemDoodle.MolGrabberCanvas(this.id+"_mg",200,200);this.getElement().dialog({autoOpen:!1,width:250,buttons:this.buttons})}})(ChemDoodle,ChemDoodle.sketcher.gui.desktop,jQuery,document);
+(function(a,d,f,c){d.PeriodicTableDialog=function(a,b){this.sketcherid=a;this.id=a+b;this.title="Periodic Table";return!0};d.PeriodicTableDialog.prototype=new d.Dialog;d.PeriodicTableDialog.prototype.setup=function(){var a=[];a.push('<div style="text-align:center;" id="');a.push(this.id);a.push('" title="');a.push(this.title);a.push('">');a.push('<canvas class="ChemDoodleWebComponents" id="');a.push(this.id);a.push('_pt"></canvas></div>');c.getElementById(this.sketcherid)?f("#"+this.sketcherid).before(a.join("")):
+c.writeln(a.join(""));this.canvas=new ChemDoodle.PeriodicTableCanvas(this.id+"_pt",20);this.getElement().dialog({autoOpen:!1,width:400,buttons:this.buttons})}})(ChemDoodle,ChemDoodle.sketcher.gui.desktop,jQuery,document);
+(function(a,d,f,c){d.SaveFileDialog=function(a,b){this.id=a;this.sketcher=b;this.title="Save File";return!0};d.SaveFileDialog.prototype=new d.Dialog;d.SaveFileDialog.prototype.clear=function(){f("#"+this.id+"_link").html("The file link will appear here.")};d.SaveFileDialog.prototype.setup=function(){var a=[];a.push('<div style="font-size:12px;" id="');a.push(this.id);a.push('" title="');a.push(this.title);a.push('">');a.push("<p>Select the file format to save your structure to and click on the <strong>Generate File</strong> button.</p>");
+a.push('<select id="');a.push(this.id);a.push('_select">');a.push('<option value="sk2">ACD/ChemSketch Document {sk2}');a.push('<option value="ros">Beilstein ROSDAL {ros}');a.push('<option value="cdx">Cambridgesoft ChemDraw Exchange {cdx}');a.push('<option value="cdxml">Cambridgesoft ChemDraw XML {cdxml}');a.push('<option value="mrv">ChemAxon Marvin Document {mrv}');a.push('<option value="cml">Chemical Markup Language {cml}');a.push('<option value="smiles">Daylight SMILES {smiles}');a.push('<option value="icl" selected>iChemLabs ChemDoodle Document {icl}');
+a.push('<option value="inchi">IUPAC InChI {inchi}');a.push('<option value="jdx">IUPAC JCAMP-DX {jdx}');a.push('<option value="skc">MDL ISIS Sketch {skc}');a.push('<option value="tgf">MDL ISIS Sketch Transportable Graphics File {tgf}');a.push('<option value="mol">MDL MOLFile {mol}');a.push('<option value="sdf">MDL SDFile {sdf}');a.push('<option value="jme">Molinspiration JME String {jme}');a.push('<option value="pdb">RCSB Protein Data Bank {pdb}');a.push('<option value="mmd">Schrödinger Macromodel {mmd}');
+a.push('<option value="mae">Schrödinger Maestro {mae}');a.push('<option value="smd">Standard Molecular Data {smd}');a.push('<option value="mol2">Tripos Mol2 {mol2}');a.push('<option value="sln">Tripos SYBYL SLN {sln}');a.push('<option value="xyz">XYZ {xyz}');a.push("</select>");a.push('<button id="');a.push(this.id);a.push('_button">');a.push("Generate File</button>");a.push("<p>When the file is written, a link will appear in the red-bordered box below, right-click on the link and choose the browser's <strong>Save As...</strong> function to save the file to your computer.</p>");
+a.push('<div style="width:100%;height:30px;border:1px solid #c10000;text-align:center;" id="');a.push(this.id);a.push('_link">The file link will appear here.</div>');a.push('<p><a href="http://www.chemdoodle.com" target="_blank">How do I use these files?</a></p>');a.push("</div>");c.getElementById(this.sketcher.id)?f("#"+this.sketcher.id).before(a.join("")):c.writeln(a.join(""));var b=this;f("#"+this.id+"_button").click(function(){f("#"+b.id+"_link").html("Generating file, please wait...");ChemDoodle.iChemLabs.saveFile(b.sketcher.oneMolecule?
+b.sketcher.molecules[0]:b.sketcher.lasso.getFirstMolecule(),{ext:f("#"+b.id+"_select").val()},function(a){f("#"+b.id+"_link").html('<a href="'+a+'"><span style="text-decoration:underline;">File is generated. Right-click on this link and Save As...</span></a>')})});this.getElement().dialog({autoOpen:!1,width:435,buttons:b.buttons})}})(ChemDoodle,ChemDoodle.sketcher.gui.desktop,jQuery,document);
+(function(a,d,f,c,e){f.DialogManager=function(b){b.useServices?this.saveDialog=new c.SaveFileDialog(b.id+"_save_dialog",b):(this.saveDialog=new c.Dialog(b.id,"_save_dialog","Save Molecule"),this.saveDialog.message="Copy and paste the content of the textarea into a file and save it with the extension <strong>.mol</strong>.",this.saveDialog.includeTextArea=!0,this.saveDialog.afterMessage='<a href="http://www.chemdoodle.com" target="_blank">How do I use MOLFiles?</a>');this.saveDialog.setup();this.loadDialog=
+new c.Dialog(b.id,"_load_dialog","Load Molecule");this.loadDialog.message="Copy and paste the contents of a MOLFile (extension <strong>.mol</strong>) in the textarea below and then press the <strong>Load</strong> button.";this.loadDialog.includeTextArea=!0;this.loadDialog.afterMessage='<a href="http://www.chemdoodle.com" target="_blank">Where do I get MOLFiles?</a>';var f=this;this.loadDialog.buttons={Load:function(){e(this).dialog("close");var c=a.readMOL(f.loadDialog.getTextArea().val());if(c.atoms.length>
+0)if(b.oneMolecule)b.historyManager.pushUndo(new d.SwitchMoleculeAction(b,c));else{b.historyManager.pushUndo(new d.NewMoleculeAction(b,c.atoms,c.bonds));b.toolbarManager.buttonLasso.getElement().click();b.lasso.select(c.atoms,[])}else alert("No chemical content was recognized.")}};this.loadDialog.setup();this.searchDialog=new c.MolGrabberDialog(b.id,"_search_dialog");this.searchDialog.buttons={Load:function(){e(this).dialog("close");var a=f.searchDialog.canvas.molecules[0];if(a&&a.atoms.length>0)if(b.oneMolecule)a!==
+b.molecule&&b.historyManager.pushUndo(new d.SwitchMoleculeAction(b,a));else{b.historyManager.pushUndo(new d.NewMoleculeAction(b,a.atoms,a.bonds));b.toolbarManager.buttonLasso.getElement().click();b.lasso.select(a.atoms,[])}}};this.searchDialog.setup();this.periodicTableDialog=new c.PeriodicTableDialog(b.id,"_periodicTable_dialog");this.periodicTableDialog.buttons={Close:function(){e(this).dialog("close")}};this.periodicTableDialog.setup();this.periodicTableDialog.canvas.click=function(){if(this.hovered){this.selected=
+this.hovered;var a=this.getHoveredElement();b.stateManager.setState(b.stateManager.STATE_LABEL);b.stateManager.STATE_LABEL.label=a.symbol;b.toolbarManager.buttonLabel.select();this.repaint()}};this.calculateDialog=new c.Dialog(b.id,"_calculate_dialog","Calculations");this.calculateDialog.includeTextArea=!0;this.calculateDialog.afterMessage='<a href="http://www.chemdoodle.com" target="_blank">Want more calculations?</a>';this.calculateDialog.setup();this.inputDialog=new c.Dialog(b.id,"_input_dialog",
+"Input");this.inputDialog.message='Please input the rgroup number (must be a positive integer). Input "-1" to remove the rgroup.';this.inputDialog.includeTextField=!0;this.inputDialog.buttons={Done:function(){e(this).dialog("close");f.inputDialog.doneFunction&&f.inputDialog.doneFunction(f.inputDialog.getTextField().val())}};this.inputDialog.setup();return!0}})(ChemDoodle,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.gui,ChemDoodle.sketcher.gui.desktop,jQuery);
+(function(a,d,f,c){a.DropDown=function(c,b,d){this.id=c;this.tooltip=b;this.dummy=d;this.buttonSet=new a.ButtonSet(c+"_set");this.buttonSet.buttonGroup=b;this.defaultButton=void 0;return!0};a.DropDown.prototype.getButtonSource=function(){var a=[];a.push('<button id="');a.push(this.id);a.push('" onclick="return false;" title="');a.push(this.tooltip);a.push('"><img title="');a.push(this.tooltip);a.push('" src="');a.push(d.getURI(d.ARROW_DOWN));a.push('"></button>');return a.join("")};a.DropDown.prototype.getHiddenSource=
+function(){var a=[];a.push('<div style="display:none;position:absolute;z-index:10;border:1px #C1C1C1 solid;background:#F5F5F5;padding:5px;border-bottom-left-radius:5px;-moz-border-radius-bottomleft:5px;border-bottom-right-radius:5px;-moz-border-radius-bottomright:5px;" id="');a.push(this.id);a.push('_hidden">');a.push(this.buttonSet.getSource(this.id+"_popup_set"));a.push("</div>");return a.join("")};a.DropDown.prototype.setup=function(){this.defaultButton||(this.defaultButton=this.buttonSet.buttons[0]);
+var a="#"+this.id;f(a).button();f(a+"_hidden").hide();f(a).click(function(){var b=f(a+"_hidden");b.show().position({my:"center top",at:"center bottom",of:this,collision:"fit"});f(c).one("click",function(){b.hide()});return false});this.buttonSet.setup();var b=this;f.each(this.buttonSet.buttons,function(a){b.buttonSet.buttons[a].getElement().click(function(){b.dummy.absorb(b.buttonSet.buttons[a]);b.dummy.select();b.dummy.func()})});b.dummy.absorb(this.defaultButton);this.defaultButton.select()}})(ChemDoodle.sketcher.gui.desktop,
+ChemDoodle.sketcher.gui.imageDepot,jQuery,document);
+(function(a,d,f){a.DummyButton=function(a,d,b){this.id=a;this.icon=d;this.toggle=!1;this.tooltip=b?b:"";this.func=void 0;return!0};a.DummyButton.prototype=new a.Button;a.DummyButton.prototype.setup=function(){var a=this;this.getElement().click(function(){a.func()})};a.DummyButton.prototype.absorb=function(a){f("#"+this.id+"_icon").attr("src",d.getURI(a.icon));this.func=a.func}})(ChemDoodle.sketcher.gui.desktop,ChemDoodle.sketcher.gui.imageDepot,jQuery);
+(function(a,d,f,c,e,b,h,j,m,g,l,n){b.ToolbarManager=function(i){this.sketcher=i;this.buttonOpen=new j.Button(i.id+"_button_open",h.OPEN,"Open",function(){i.dialogManager.loadDialog.getTextArea().val("");i.dialogManager.loadDialog.getElement().dialog("open")});this.buttonSave=new j.Button(i.id+"_button_save",h.SAVE,"Save",function(){i.useServices?i.dialogManager.saveDialog.clear():i.oneMolecule?i.dialogManager.saveDialog.getTextArea().val(a.writeMOL(i.molecules[0])):i.lasso.isActive()&&i.dialogManager.saveDialog.getTextArea().val(a.writeMOL(i.lasso.getFirstMolecule()));
+i.dialogManager.saveDialog.getElement().dialog("open")});this.buttonSearch=new j.Button(i.id+"_button_search",h.SEARCH,"Search",function(){i.dialogManager.searchDialog.getElement().dialog("open")});this.buttonCalculate=new j.Button(i.id+"_button_calculate",h.CALCULATE,"Calculate",function(){var a=i.oneMolecule?i.molecules[0]:i.lasso.getFirstMolecule();a&&d.calculate(a,{descriptors:"mf,mw,miw,deg_unsat,hba,hbd,pol_miller,cmr,tpsa,xlogp2".split(",")},function(a){function b(a,i,c){g.push(a);g.push(": ");
+for(a=a.length+2;30>a;a++)g.push(" ");g.push(i);g.push(" ");g.push(c);g.push("\n")}var g=[];b("Molecular Formula",a.mf,"");b("Molecular Mass",a.mw,"amu");b("Monoisotopic Mass",a.miw,"amu");b("Degree of Unsaturation",a.deg_unsat,"");b("Hydrogen Bond Acceptors",a.hba,"");b("Hydrogen Bond Donors",a.hbd,"");b("Molecular Polarizability",a.pol_miller,"\u00c5\u00b3");b("Molar Refractivity",a.cmr,"cm\u00b3/mol");b("Polar Surface Area",a.tpsa,"\u00c5\u00b2");b("logP",a.xlogp2,"");i.dialogManager.calculateDialog.getTextArea().val(g.join(""));
+i.dialogManager.calculateDialog.getElement().dialog("open")})});this.buttonMove=new j.Button(i.id+"_button_move",h.MOVE,"Move",function(){i.stateManager.setState(i.stateManager.STATE_MOVE)});this.buttonMove.toggle=!0;this.buttonErase=new j.Button(i.id+"_button_erase",h.ERASE,"Erase",function(){i.stateManager.setState(i.stateManager.STATE_ERASE)});this.buttonErase.toggle=!0;this.buttonClear=new j.Button(i.id+"_button_clear",h.CLEAR,"Clear",function(){var a=!0;if(i.oneMolecule){if(1===i.molecules[0].atoms.length){var b=
+i.molecules[0].atoms[0];"C"===b.label&&0===b.charge&&-1===b.mass&&(a=!1)}}else 0===i.molecules.length&&0===i.shapes.length&&(a=!1);a&&(i.stateManager.getCurrentState().clearHover(),i.lasso&&i.lasso.isActive()&&i.lasso.empty(),i.historyManager.pushUndo(new e.ClearAction(i)))});this.buttonClean=new j.Button(i.id+"_button_clean",h.OPTIMIZE,"Clean",function(){var a=i.oneMolecule?i.molecules[0]:i.lasso.getFirstMolecule();if(a){var b=new f.JSONInterpreter;d._contactServer("optimize",{mol:b.molTo(a)},{dimension:2},
+function(g){var g=b.molFrom(g.mol),d=g.getCenter(),f=new c.Point(i.width/2,i.height/2);f.sub(d);for(var d=0,h=g.atoms.length;d<h;d++)g.atoms[d].add(f);i.historyManager.pushUndo(new e.ChangeCoordinatesAction(a.atoms,g.atoms))})}});this.makeLassoSet(this);this.makeScaleSet(this);this.makeHistorySet(this);this.makeLabelSet(this);this.makeBondSet(this);this.makeRingSet(this);this.makeAttributeSet(this);this.makeShapeSet(this);return!0};b.ToolbarManager.prototype.write=function(){var a=[],b=this.sketcher.id+
+"_main_group";this.sketcher.oneMolecule?a.push(this.buttonMove.getSource(b)):a.push(this.lassoSet.getSource(b));a.push(this.buttonClear.getSource());a.push(this.buttonErase.getSource(b));this.sketcher.useServices&&a.push(this.buttonClean.getSource());a.push(this.historySet.getSource());a.push(this.scaleSet.getSource());a.push(this.buttonOpen.getSource());a.push(this.buttonSave.getSource());this.sketcher.useServices&&(a.push(this.buttonSearch.getSource()),a.push(this.buttonCalculate.getSource()));
+a.push("<br>");a.push(this.labelSet.getSource(b));a.push(this.attributeSet.getSource(b));a.push(this.bondSet.getSource(b));a.push(this.ringSet.getSource(b));this.sketcher.oneMolecule||a.push(this.shapeSet.getSource(b));a.push("<br>");n.getElementById(this.sketcher.id)?l("#"+this.sketcher.id).before(a.join("")):n.write(a.join(""))};b.ToolbarManager.prototype.setup=function(){this.sketcher.oneMolecule?this.buttonMove.setup(!0):this.lassoSet.setup();this.buttonClear.setup();this.buttonErase.setup(!0);
+this.sketcher.useServices&&this.buttonClean.setup();this.historySet.setup();this.scaleSet.setup();this.buttonOpen.setup();this.buttonSave.setup();this.sketcher.useServices&&(this.buttonSearch.setup(),this.buttonCalculate.setup());this.labelSet.setup();this.attributeSet.setup();this.bondSet.setup();this.ringSet.setup();this.sketcher.oneMolecule||this.shapeSet.setup();this.buttonSingle.select();this.buttonUndo.disable();this.buttonRedo.disable();!this.sketcher.oneMolecule&&this.sketcher.useServices&&
+(this.buttonClean.disable(),this.buttonCalculate.disable(),this.buttonSave.disable())};b.ToolbarManager.prototype.makeScaleSet=function(a){this.scaleSet=new j.ButtonSet(a.sketcher.id+"_buttons_scale");this.scaleSet.toggle=!1;this.buttonScalePlus=new j.Button(a.sketcher.id+"_button_scale_plus",h.ZOOM_IN,"Increase Scale",function(){a.sketcher.specs.scale*=1.5;a.sketcher.checkScale();a.sketcher.repaint()});this.scaleSet.buttons.push(this.buttonScalePlus);this.buttonScaleMinus=new j.Button(a.sketcher.id+
+"_button_scale_minus",h.ZOOM_OUT,"Decrease Scale",function(){a.sketcher.specs.scale/=1.5;a.sketcher.checkScale();a.sketcher.repaint()});this.scaleSet.buttons.push(this.buttonScaleMinus)};b.ToolbarManager.prototype.makeLassoSet=function(a){this.lassoSet=new j.ButtonSet(a.sketcher.id+"_buttons_lasso");this.buttonLasso=new j.DummyButton(a.sketcher.id+"_button_lasso",h.LASSO,"Selection Tool");this.lassoSet.buttons.push(this.buttonLasso);this.lassoSet.addDropDown("More Selection Tools");this.lassoSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+
+"_button_lasso_lasso",h.LASSO,"Lasso Tool",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LASSO);a.sketcher.lasso.mode=m.Lasso.MODE_LASSO;0<a.sketcher.molecules.length&&!a.sketcher.lasso.isActive()&&a.sketcher.lasso.select(a.sketcher.molecules[a.sketcher.molecules.length-1].atoms,[])}));this.lassoSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_shapes",h.LASSO_SHAPES,"Lasso Tool (shapes only)",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LASSO);
+a.sketcher.lasso.mode=m.Lasso.MODE_LASSO_SHAPES;0<a.sketcher.shapes.length&&!a.sketcher.lasso.isActive()&&a.sketcher.lasso.select([],[a.sketcher.shapes[a.sketcher.shapes.length-1]])}));this.lassoSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_marquee",h.MARQUEE,"Marquee Tool",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LASSO);a.sketcher.lasso.mode=m.Lasso.MODE_RECTANGLE_MARQUEE;0<a.sketcher.molecules.length&&!a.sketcher.lasso.isActive()&&
+a.sketcher.lasso.select(a.sketcher.molecules[a.sketcher.molecules.length-1].atoms,[])}))};b.ToolbarManager.prototype.makeHistorySet=function(a){this.historySet=new j.ButtonSet(a.sketcher.id+"_buttons_history");this.historySet.toggle=!1;this.buttonUndo=new j.Button(a.sketcher.id+"_button_undo",h.UNDO,"Undo",function(){a.sketcher.historyManager.undo()});this.historySet.buttons.push(this.buttonUndo);this.buttonRedo=new j.Button(a.sketcher.id+"_button_redo",h.REDO,"Redo",function(){a.sketcher.historyManager.redo()});
+this.historySet.buttons.push(this.buttonRedo)};b.ToolbarManager.prototype.makeLabelSet=function(a){this.labelSet=new j.ButtonSet(a.sketcher.id+"_buttons_label");this.buttonLabel=new j.DummyButton(a.sketcher.id+"_button_label",h.CARBON,"Set Label");this.labelSet.buttons.push(this.buttonLabel);this.labelSet.addDropDown("More Labels");this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_h",h.HYDROGEN,"Hydrogen",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);
+a.sketcher.stateManager.STATE_LABEL.label="H"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_c",h.CARBON,"Carbon",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="C"}));this.labelSet.dropDown.defaultButton=this.labelSet.dropDown.buttonSet.buttons[this.labelSet.dropDown.buttonSet.buttons.length-1];this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_n",
+h.NITROGEN,"Nitrogen",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="N"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_o",h.OXYGEN,"Oxygen",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="O"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_f",h.FLUORINE,"Fluorine",
+function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="F"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_cl",h.CHLORINE,"Chlorine",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="Cl"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_br",h.BROMINE,"Bromine",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);
+a.sketcher.stateManager.STATE_LABEL.label="Br"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_i",h.IODINE,"Iodine",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="I"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_p",h.PHOSPHORUS,"Phosphorus",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label=
+"P"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_s",h.SULFUR,"Sulfur",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LABEL);a.sketcher.stateManager.STATE_LABEL.label="S"}));this.labelSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_pt",h.PERIODIC_TABLE,"Choose Symbol",function(){for(var b=0,g=a.sketcher.dialogManager.periodicTableDialog.canvas.cells.length;b<g;b++){var c=a.sketcher.dialogManager.periodicTableDialog.canvas.cells[b];
+if(c.element.symbol===a.sketcher.stateManager.STATE_LABEL.label){a.sketcher.dialogManager.periodicTableDialog.canvas.selected=c;a.sketcher.dialogManager.periodicTableDialog.canvas.repaint();break}}a.sketcher.dialogManager.periodicTableDialog.getElement().dialog("open")}))};b.ToolbarManager.prototype.makeBondSet=function(a){this.bondSet=new j.ButtonSet(a.sketcher.id+"_buttons_bond");this.buttonSingle=new j.Button(a.sketcher.id+"_button_bond_single",h.BOND_SINGLE,"Single Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);
+a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=1;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_NONE});this.bondSet.buttons.push(this.buttonSingle);this.buttonRecessed=new j.Button(a.sketcher.id+"_button_bond_recessed",h.BOND_RECESSED,"Recessed Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=1;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_RECESSED});this.bondSet.buttons.push(this.buttonRecessed);
+this.buttonProtruding=new j.Button(a.sketcher.id+"_button_bond_protruding",h.BOND_PROTRUDING,"Protruding Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=1;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_PROTRUDING});this.bondSet.buttons.push(this.buttonProtruding);this.buttonDouble=new j.Button(a.sketcher.id+"_button_bond_double",h.BOND_DOUBLE,"Double Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);
+a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=2;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_NONE});this.bondSet.buttons.push(this.buttonDouble);this.buttonBond=new j.DummyButton(a.sketcher.id+"_button_bond",h.BOND_TRIPLE,"Other Bond");this.bondSet.buttons.push(this.buttonBond);this.bondSet.addDropDown("More Bonds");this.bondSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_bond_triple",h.BOND_TRIPLE,"Triple Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);
+a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=3;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_NONE}));this.bondSet.dropDown.defaultButton=this.bondSet.dropDown.buttonSet.buttons[this.bondSet.dropDown.buttonSet.buttons.length-1];this.bondSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_bond_ambiguous_double",h.BOND_DOUBLE_AMBIGUOUS,"Ambiguous Double Bond",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_BOND);a.sketcher.stateManager.STATE_NEW_BOND.bondOrder=
+2;a.sketcher.stateManager.STATE_NEW_BOND.stereo=c.Bond.STEREO_AMBIGUOUS}))};b.ToolbarManager.prototype.makeRingSet=function(a){this.ringSet=new j.ButtonSet(a.sketcher.id+"_buttons_ring");this.buttonCyclohexane=new j.Button(a.sketcher.id+"_button_ring_cyclohexane",h.CYCLOHEXANE,"Cyclohexane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);a.sketcher.stateManager.STATE_NEW_RING.numSides=6;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1});this.ringSet.buttons.push(this.buttonCyclohexane);
+this.buttonBenzene=new j.Button(a.sketcher.id+"_button_ring_benzene",h.BENZENE,"Benzene Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);a.sketcher.stateManager.STATE_NEW_RING.numSides=6;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!0});this.ringSet.buttons.push(this.buttonBenzene);this.buttonRing=new j.DummyButton(a.sketcher.id+"_button_ring",h.CYCLOPENTANE,"Other Ring");this.ringSet.buttons.push(this.buttonRing);this.ringSet.addDropDown("More Rings");
+this.ringSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_ring_cyclopropane",h.CYCLOPROPANE,"Cyclopropane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);a.sketcher.stateManager.STATE_NEW_RING.numSides=3;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1}));this.ringSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_ring_cyclobutane",h.CYCLOBUTANE,"Cyclobutane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);
+a.sketcher.stateManager.STATE_NEW_RING.numSides=4;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1}));this.ringSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_ring_cyclopentane",h.CYCLOPENTANE,"Cyclopentane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);a.sketcher.stateManager.STATE_NEW_RING.numSides=5;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1}));this.ringSet.dropDown.defaultButton=this.ringSet.dropDown.buttonSet.buttons[this.ringSet.dropDown.buttonSet.buttons.length-
+1];this.ringSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_ring_cycloheptane",h.CYCLOHEPTANE,"Cycloheptane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);a.sketcher.stateManager.STATE_NEW_RING.numSides=7;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1}));this.ringSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_ring_cyclooctane",h.CYCLOOCTANE,"Cyclooctane Ring",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_NEW_RING);
+a.sketcher.stateManager.STATE_NEW_RING.numSides=8;a.sketcher.stateManager.STATE_NEW_RING.unsaturated=!1}))};b.ToolbarManager.prototype.makeAttributeSet=function(a){this.attributeSet=new j.ButtonSet(a.sketcher.id+"_buttons_attribute");this.buttonAttribute=new j.DummyButton(a.sketcher.id+"_button_attribute",h.INCREASE_CHARGE,"Attributes");this.attributeSet.buttons.push(this.buttonAttribute);this.attributeSet.addDropDown("More Attributes");this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+
+"_button_attribute_charge_increment",h.INCREASE_CHARGE,"Increase Charge",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_CHARGE);a.sketcher.stateManager.STATE_CHARGE.delta=1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_attribute_charge_decrement",h.DECREASE_CHARGE,"Decrease Charge",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_CHARGE);a.sketcher.stateManager.STATE_CHARGE.delta=-1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+
+"_button_attribute_lonePair_increment",h.ADD_LONE_PAIR,"Add Lone Pair",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LONE_PAIR);a.sketcher.stateManager.STATE_LONE_PAIR.delta=1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_attribute_lonePair_decrement",h.REMOVE_LONE_PAIR,"Remove Lone Pair",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_LONE_PAIR);a.sketcher.stateManager.STATE_LONE_PAIR.delta=-1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+
+"_button_attribute_radical_increment",h.ADD_RADICAL,"Add Radical",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_RADICAL);a.sketcher.stateManager.STATE_RADICAL.delta=1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_attribute_radical_decrement",h.REMOVE_RADICAL,"Remove Radical",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_RADICAL);a.sketcher.stateManager.STATE_RADICAL.delta=-1}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+
+"_button_label_any",h.ANY_ELEMENT,"Any Element",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_ATOM_QUERY);a.sketcher.stateManager.STATE_ATOM_QUERY.mode=g.AtomQueryState.MODE_ANY}));this.attributeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_label_rgroup",h.RGROUP,"Rgroup",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_ATOM_QUERY);a.sketcher.stateManager.STATE_ATOM_QUERY.mode=g.AtomQueryState.MODE_RGROUP}))};b.ToolbarManager.prototype.makeShapeSet=
+function(a){this.shapeSet=new j.ButtonSet(a.sketcher.id+"_buttons_shape");this.buttonShape=new j.DummyButton(a.sketcher.id+"_button_shape",h.ARROW_SYNTHETIC,"Add Shape");this.shapeSet.buttons.push(this.buttonShape);this.shapeSet.addDropDown("More Shapes");this.shapeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_arrow_synthetic",h.ARROW_SYNTHETIC,"Synthetic Arrow",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_SHAPE);a.sketcher.stateManager.STATE_SHAPE.shapeType=
+g.ShapeState.ARROW_SYNTHETIC}));this.shapeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_arrow_retrosynthetic",h.ARROW_RETROSYNTHETIC,"Retrosynthetic Arrow",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_SHAPE);a.sketcher.stateManager.STATE_SHAPE.shapeType=g.ShapeState.ARROW_RETROSYNTHETIC}));this.shapeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_pusher_1",h.PUSHER_SINGLE,"Single Electron Pusher",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_PUSHER);
+a.sketcher.stateManager.STATE_PUSHER.numElectron=1}));this.shapeSet.dropDown.buttonSet.buttons.push(new j.Button(a.sketcher.id+"_button_lasso_pusher_2",h.PUSHER_DOUBLE,"Electron Pair Pusher",function(){a.sketcher.stateManager.setState(a.sketcher.stateManager.STATE_PUSHER);a.sketcher.stateManager.STATE_PUSHER.numElectron=2}))}})(ChemDoodle,ChemDoodle.iChemLabs,ChemDoodle.io,ChemDoodle.structures,ChemDoodle.sketcher.actions,ChemDoodle.sketcher.gui,ChemDoodle.sketcher.gui.imageDepot,ChemDoodle.sketcher.gui.desktop,
+ChemDoodle.sketcher.tools,ChemDoodle.sketcher.states,jQuery,document);
+(function(a,d,f,c){f.Lasso=function(e){this.sketcher=e;this.atoms=[];this.shapes=[];this.bounds=void 0;this.mode=f.Lasso.MODE_LASSO;this.points=[];this.select=function(b,e){if(!this.block){d.SHIFT||this.empty();if(b)this.atoms=b.slice(0),this.shapes=e.slice(0);else{if(this.mode!==f.Lasso.MODE_LASSO_SHAPES){for(var j=[],m=0,g=this.sketcher.molecules.length;m<g;m++)for(var l=this.sketcher.molecules[m],n=0,i=l.atoms.length;n<i;n++){var o=l.atoms[n];this.mode===f.Lasso.MODE_RECTANGLE_MARQUEE?2===this.points.length&&
+a.isBetween(o.x,this.points[0].x,this.points[1].x)&&a.isBetween(o.y,this.points[0].y,this.points[1].y)&&j.push(o):1<this.points.length&&a.isPointInPoly(this.points,o)&&j.push(o)}if(0===this.atoms.length)this.atoms=j;else{for(var k=[],m=0,g=this.atoms.length;m<g;m++)o=this.atoms[m],-1===c(o,j)?k.push(o):o.isLassoed=!1;m=0;for(g=j.length;m<g;m++)-1===c(j[m],this.atoms)&&k.push(j[m]);this.atoms=k}}j=[];m=0;for(g=this.sketcher.shapes.length;m<g;m++){for(var l=this.sketcher.shapes[m],o=l.getPoints(),p=
+0<o.length,n=0,i=o.length;n<i;n++){var q=o[n];if(this.mode===f.Lasso.MODE_RECTANGLE_MARQUEE)if(2===this.points.length){if(!a.isBetween(q.x,this.points[0].x,this.points[1].x)||!a.isBetween(q.y,this.points[0].y,this.points[1].y)){p=!1;break}}else{p=!1;break}else if(1<this.points.length){if(!a.isPointInPoly(this.points,q)){p=!1;break}}else{p=!1;break}}p&&j.push(l)}if(0===this.shapes.length)this.shapes=j;else{n=[];m=0;for(g=this.shapes.length;m<g;m++)l=this.shapes[m],-1===c(l,j)?k.push(l):l.isLassoed=
+!1;m=0;for(g=j.length;m<g;m++)-1===c(j[m],this.shapes)&&n.push(j[m]);this.shapes=n}}m=0;for(g=this.atoms.length;m<g;m++)this.atoms[m].isLassoed=!0;m=0;for(g=this.shapes.length;m<g;m++)this.shapes[m].isLassoed=!0;this.setBounds();this.bounds&&Infinity===this.bounds.minX&&this.empty();this.points=[];this.sketcher.stateManager.getCurrentState().clearHover();this.enableButtons();this.sketcher.repaint()}};this.enableButtons=function(){this.sketcher.useServices&&(0<this.atoms.length?(this.sketcher.toolbarManager.buttonClean.enable(),
+this.sketcher.toolbarManager.buttonCalculate.enable(),this.sketcher.toolbarManager.buttonSave.enable()):(this.sketcher.toolbarManager.buttonClean.disable(),this.sketcher.toolbarManager.buttonCalculate.disable(),this.sketcher.toolbarManager.buttonSave.disable()))};this.setBounds=function(){if(this.isActive()){this.sketcher.repaint();this.bounds=new a.Bounds;for(var b=0,c=this.atoms.length;b<c;b++)this.bounds.expand(this.atoms[b].getBounds());b=0;for(c=this.shapes.length;b<c;b++)this.bounds.expand(this.shapes[b].getBounds());
+this.bounds.minX-=5;this.bounds.minY-=5;this.bounds.maxX+=5;this.bounds.maxY+=5}else this.bounds=void 0};this.empty=function(){for(var a=0,c=this.atoms.length;a<c;a++)this.atoms[a].isLassoed=!1;a=0;for(c=this.shapes.length;a<c;a++)this.shapes[a].isLassoed=!1;this.atoms=[];this.shapes=[];this.bounds=void 0;this.enableButtons();this.sketcher.repaint()};this.draw=function(a,c){a.strokeStyle="blue";a.lineWidth=0.5/c.scale;if(0<this.points.length)if(this.mode===f.Lasso.MODE_RECTANGLE_MARQUEE){if(2===this.points.length){var d=
+this.points[0],e=this.points[1];a.beginPath();a.rect(d.x,d.y,e.x-d.x,e.y-d.y);a.stroke()}}else if(1<this.points.length){a.beginPath();a.moveTo(this.points[0].x,this.points[0].y);d=1;for(e=this.points.length;d<e;d++)a.lineTo(this.points[d].x,this.points[d].y);a.closePath();a.stroke()}this.bounds&&(a.beginPath(),a.rect(this.bounds.minX,this.bounds.minY,this.bounds.maxX-this.bounds.minX,this.bounds.maxY-this.bounds.minY),a.stroke())};this.isActive=function(){return 0<this.atoms.length||0<this.shapes.length};
+this.getFirstMolecule=function(){if(0<this.atoms.length)return this.sketcher.getMoleculeByAtom(this.atoms[0])};this.getAllPoints=function(){for(var a=this.atoms,c=0,d=this.shapes.length;c<d;c++)a=a.concat(this.shapes[c].getPoints());return a};this.addPoint=function(a){if(this.mode===f.Lasso.MODE_RECTANGLE_MARQUEE)if(2>this.points.length)this.points.push(a);else{var c=this.points[1];c.x=a.x;c.y=a.y}else this.points.push(a)};return!0};f.Lasso.MODE_LASSO="lasso";f.Lasso.MODE_LASSO_SHAPES="shapes";f.Lasso.MODE_RECTANGLE_MARQUEE=
+"rectangle"})(ChemDoodle.math,ChemDoodle.monitor,ChemDoodle.sketcher.tools,jQuery.inArray);
+(function(a,d,f,c,e,b,h,j,m){a.SketcherCanvas=function(a,d,j,i){this.isMobile=void 0===i.isMobile?f.supports_touch():i.isMobile;this.useServices=void 0===i.useServices?!1:i.useServices;this.oneMolecule=void 0===i.oneMolecule?!1:i.oneMolecule;this.includeToolbar=void 0===i.includeToolbar?!0:i.includeToolbar;this.id=a;this.toolbarManager=new c.gui.ToolbarManager(this);if(this.includeToolbar){this.toolbarManager.write();var o=this;document.getElementById(this.id)?h("#"+a+"_button_attribute_lonePair_decrement_icon").load(function(){o.toolbarManager.setup()}):
+h(m).load(function(){o.toolbarManager.setup()});this.dialogManager=new c.gui.DialogManager(this)}this.stateManager=new c.states.StateManager(this);this.historyManager=new c.actions.HistoryManager(this);a&&this.create(a,d,j);this.specs.atoms_circleDiameter_2D=7;this.specs.atoms_circleBorderWidth_2D=0;this.isHelp=!1;this.helpPos=new e.Point(this.width-20,20);this.lastPinchScale=1;this.lastGestureRotate=0;this.inGesture=!1;this.oneMolecule?(a=new e.Molecule,a.atoms.push(new e.Atom),this.loadMolecule(a)):
+(this.startAtom=new e.Atom("C",-10,-10),this.startAtom.isLone=!0,this.lasso=new b.Lasso(this));return!0};a.SketcherCanvas.prototype=new a._Canvas;a.SketcherCanvas.prototype.drawSketcherDecorations=function(a){a.save();a.translate(this.width/2,this.height/2);a.rotate(this.specs.rotateAngle);a.scale(this.specs.scale,this.specs.scale);a.translate(-this.width/2,-this.height/2);this.hovering&&this.hovering.drawDecorations(a,this.specs);this.startAtom&&-10!=this.startAtom.x&&!this.isMobile&&this.startAtom.draw(a,
+this.specs);this.tempAtom&&(a.strokeStyle="#00FF00",a.fillStyle="#00FF00",a.lineWidth=1,a.beginPath(),a.moveTo(this.hovering.x,this.hovering.y),d.contextHashTo(a,this.hovering.x,this.hovering.y,this.tempAtom.x,this.tempAtom.y,2,2),a.stroke(),a.beginPath(),a.arc(this.tempAtom.x,this.tempAtom.y,3,0,2*j.PI,!1),a.fill(),this.tempAtom.isOverlap&&(a.strokeStyle="#C10000",a.lineWidth=1.2,a.beginPath(),a.arc(this.tempAtom.x,this.tempAtom.y,7,0,2*j.PI,!1),a.stroke()));if(this.tempRing){a.strokeStyle="#00FF00";
+a.fillStyle="#00FF00";a.lineWidth=1;a.beginPath();if(this.hovering instanceof e.Atom){a.moveTo(this.hovering.x,this.hovering.y);d.contextHashTo(a,this.hovering.x,this.hovering.y,this.tempRing[0].x,this.tempRing[0].y,2,2);for(var b=1,c=this.tempRing.length;b<c;b++)d.contextHashTo(a,this.tempRing[b-1].x,this.tempRing[b-1].y,this.tempRing[b].x,this.tempRing[b].y,2,2);d.contextHashTo(a,this.tempRing[this.tempRing.length-1].x,this.tempRing[this.tempRing.length-1].y,this.hovering.x,this.hovering.y,2,2)}else if(this.hovering instanceof
+e.Bond){var b=this.hovering.a2,f=this.hovering.a1;this.tempRing[0]===this.hovering.a1&&(b=this.hovering.a1,f=this.hovering.a2);a.moveTo(b.x,b.y);d.contextHashTo(a,b.x,b.y,this.tempRing[1].x,this.tempRing[1].y,2,2);b=2;for(c=this.tempRing.length;b<c;b++)d.contextHashTo(a,this.tempRing[b-1].x,this.tempRing[b-1].y,this.tempRing[b].x,this.tempRing[b].y,2,2);d.contextHashTo(a,this.tempRing[this.tempRing.length-1].x,this.tempRing[this.tempRing.length-1].y,f.x,f.y,2,2)}a.stroke()}this.lasso&&this.lasso.draw(a,
+this.specs);this.stateManager.getCurrentState().draw&&this.stateManager.getCurrentState().draw(a);a.restore()};a.SketcherCanvas.prototype.drawChildExtras=function(a){this.drawSketcherDecorations(a);if(!this.hideHelp){var b=a.createRadialGradient(this.width-20,20,10,this.width-20,20,2);b.addColorStop(0,"#00680F");b.addColorStop(1,"#FFFFFF");a.fillStyle=b;a.beginPath();a.arc(this.helpPos.x,this.helpPos.y,10,0,2*j.PI,!1);a.fill();this.isHelp&&(a.lineWidth=2,a.strokeStyle="black",a.stroke());a.fillStyle=
+this.isHelp?"red":"black";a.textAlign="center";a.textBaseline="middle";a.font="14px sans-serif";a.fillText("?",this.helpPos.x,this.helpPos.y)}this.paidToHideTrademark||(b=a.measureText("ChemDoodle").width,a.textAlign="left",a.textBaseline="bottom",a.font="14px sans-serif",a.fillStyle="rgba(0, 60, 0, 0.5)",a.fillText("ChemDoodle",this.width-b-13,this.height-4),a.font="8px sans-serif",a.fillText("\u00ae",this.width-13,this.height-12))};a.SketcherCanvas.prototype.scaleEvent=function(a){a.op=new e.Point(a.p.x,
+a.p.y);1!==this.specs.scale&&(a.p.x=this.width/2+(a.p.x-this.width/2)/this.specs.scale,a.p.y=this.height/2+(a.p.y-this.height/2)/this.specs.scale)};a.SketcherCanvas.prototype.checkScale=function(){0.5>this.specs.scale?this.specs.scale=0.5:10<this.specs.scale&&(this.specs.scale=10)};a.SketcherCanvas.prototype.click=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().click(a)};a.SketcherCanvas.prototype.rightclick=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().rightclick(a)};
+a.SketcherCanvas.prototype.dblclick=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().dblclick(a)};a.SketcherCanvas.prototype.mousedown=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().mousedown(a)};a.SketcherCanvas.prototype.rightmousedown=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().rightmousedown(a)};a.SketcherCanvas.prototype.mousemove=function(a){this.isHelp=!1;10>a.p.distance(this.helpPos)&&(this.isHelp=!0);this.scaleEvent(a);this.stateManager.getCurrentState().mousemove(a)};
+a.SketcherCanvas.prototype.mouseout=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().mouseout(a)};a.SketcherCanvas.prototype.mouseover=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().mouseover(a)};a.SketcherCanvas.prototype.mouseup=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().mouseup(a)};a.SketcherCanvas.prototype.rightmouseup=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().rightmouseup(a)};a.SketcherCanvas.prototype.mousewheel=
+function(a,b){this.scaleEvent(a);this.stateManager.getCurrentState().mousewheel(a,b)};a.SketcherCanvas.prototype.drag=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().drag(a)};a.SketcherCanvas.prototype.keydown=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().keydown(a)};a.SketcherCanvas.prototype.keypress=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().keypress(a)};a.SketcherCanvas.prototype.keyup=function(a){this.scaleEvent(a);this.stateManager.getCurrentState().keyup(a)};
+a.SketcherCanvas.prototype.touchstart=function(a){if(a.originalEvent.touches&&1<a.originalEvent.touches.length){if(this.tempAtom||this.tempRing)this.hovering=this.tempRing=this.tempAtom=void 0,this.repaint();this.lastPoint=void 0}else this.scaleEvent(a),this.stateManager.getCurrentState().mousemove(a),this.stateManager.getCurrentState().mousedown(a)};a.SketcherCanvas.prototype.touchmove=function(a){this.scaleEvent(a);this.inGesture||this.stateManager.getCurrentState().drag(a)};a.SketcherCanvas.prototype.touchend=
+function(a){this.scaleEvent(a);this.stateManager.getCurrentState().mouseup(a);this.hovering&&(this.stateManager.getCurrentState().clearHover(),this.repaint())};a.SketcherCanvas.prototype.gesturechange=function(a){this.inGesture=!0;if(1!==a.originalEvent.scale-this.lastPinchScale){if(!this.lasso||!this.lasso.isActive())this.specs.scale*=a.originalEvent.scale/this.lastPinchScale,this.checkScale();this.lastPinchScale=a.originalEvent.scale}if(0!==this.lastGestureRotate-a.originalEvent.rotation){var b=
+(this.lastGestureRotate-a.originalEvent.rotation)/180*j.PI;if(this.parentAction){this.parentAction.dif+=b;for(var d=0,f=this.parentAction.ps.length;d<f;d++){var h=this.parentAction.ps[d],k=this.parentAction.center.distance(h),m=this.parentAction.center.angle(h)+b;h.x=this.parentAction.center.x+k*j.cos(m);h.y=this.parentAction.center.y-k*j.sin(m)}d=0;for(f=this.molecules.length;d<f;d++)this.molecules[d].check();this.lasso&&this.lasso.isActive()&&this.lasso.setBounds()}else d=this.lasso&&this.lasso.isActive()?
+this.lasso.getAllPoints():this.getAllPoints(),f=this.lasso&&this.lasso.isActive()?new e.Point((this.lasso.bounds.minX+this.lasso.bounds.maxX)/2,(this.lasso.bounds.minY+this.lasso.bounds.maxY)/2):new e.Point(this.width/2,this.height/2),this.parentAction=new c.actions.RotateAction(d,b,f),this.historyManager.pushUndo(this.parentAction);this.lastGestureRotate=a.originalEvent.rotation}this.repaint()};a.SketcherCanvas.prototype.gestureend=function(){this.inGesture=!1;this.lastPinchScale=1;this.lastGestureRotate=
+0;this.parentAction=void 0}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.featureDetection,ChemDoodle.sketcher,ChemDoodle.structures,ChemDoodle.sketcher.tools,jQuery,Math,window);
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/ChemDoodleWeb.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,425 @@
+//
+// ChemDoodle Web Components 5.0.0
+//
+// http://web.chemdoodle.com
+//
+// Copyright 2009-2012 iChemLabs, LLC. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// As a special exception to the GPL, any HTML file in a public website
+// or any free web service which merely makes function calls to this
+// code, and for that purpose includes it by reference, shall be deemed
+// a separate work for copyright law purposes. If you modify this code,
+// you may extend this exception to your version of the code, but you
+// are not obligated to do so. If you do not wish to do so, delete this
+// exception statement from your version.
+//
+// As an additional exception to the GPL, you may distribute this
+// packed form of the code without the copy of the GPL license normally
+// required, provided you include this license notice and a URL through
+// which recipients can access the corresponding unpacked source code.
+//
+// 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.
+//
+// Please contact iChemLabs <http://www.ichemlabs.com/contact> for
+// alternate licensing options.
+//
+var ChemDoodle=function(){var b={structures:{}};b.structures.d2={};b.structures.d3={};b.iChemLabs={};b.informatics={};b.io={};b.getVersion=function(){return"5.0.0"};return b}();
+ChemDoodle.extensions=function(b,e,a){return{stringStartsWith:function(a,c){return a.slice(0,c.length)===c},vec3AngleFrom:function(b,c){var d=e.length(b),f=e.length(c),d=e.dot(b,c)/d/f;return a.acos(d)},contextHashTo:function(a,c,d,f,q,g,e){for(var m=0,j=(new b.Point(c,d)).distance(new b.Point(f,q)),l=!1,n=c,r=d,c=f-c,d=q-d;m<j;){if(l)if(m+e>j){a.moveTo(f,q);break}else{var k=e/j,n=n+k*c,r=r+k*d;a.moveTo(n,r);m+=e}else if(m+g>j){a.lineTo(f,q);break}else k=g/j,n+=k*c,r+=k*d,a.lineTo(n,r),m+=g;l=!l}},
+contextRoundRect:function(a,c,d,f,q,g){a.beginPath();a.moveTo(c+g,d);a.lineTo(c+f-g,d);a.quadraticCurveTo(c+f,d,c+f,d+g);a.lineTo(c+f,d+q-g);a.quadraticCurveTo(c+f,d+q,c+f-g,d+q);a.lineTo(c+g,d+q);a.quadraticCurveTo(c,d+q,c,d+q-g);a.lineTo(c,d+g);a.quadraticCurveTo(c,d,c+g,d);a.closePath()},contextEllipse:function(a,c,d,f,q){var g=0.5522848*(f/2),b=0.5522848*(q/2),m=c+f,j=d+q,f=c+f/2,q=d+q/2;a.beginPath();a.moveTo(c,q);a.bezierCurveTo(c,q-b,f-g,d,f,d);a.bezierCurveTo(f+g,d,m,q-b,m,q);a.bezierCurveTo(m,
+q+b,f+g,j,f,j);a.bezierCurveTo(f-g,j,c,q+b,c,q);a.closePath()}}}(ChemDoodle.structures,vec3,Math);
+ChemDoodle.math=function(b,e,a){var h={},c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",
+darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",
+gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",
+lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",
+oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",
+skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};h.angleBetweenLargest=function(d){if(0===d.length)return{angle:0,largest:2*a.PI};if(1===d.length)return{angle:d[0]+a.PI,largest:2*a.PI};for(var f=0,c=0,g=0,b=d.length-1;g<b;g++){var m=d[g+1]-d[g];
+m>f&&(f=m,c=(d[g+1]+d[g])/2)}g=d[0]+2*a.PI-d[d.length-1];g>f&&(c=d[0]-g/2,f=g,0>c&&(c+=2*a.PI));return{angle:c,largest:f}};h.isBetween=function(a,f,c){if(f>c)var g=f,f=c,c=g;return a>=f&&a<=c};h.getRGB=function(a,f){var q=[0,0,0];c[a.toLowerCase()]&&(a=c[a.toLowerCase()]);if("#"===a.charAt(0))return 4===a.length&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)),[parseInt(a.substring(1,3),16)/255*f,parseInt(a.substring(3,5),16)/255*f,parseInt(a.substring(5,7),16)/255*
+f];if(b.stringStartsWith(a,"rgb")){var g=a.replace(/rgb\(|\)/g,"").split(",");return 3!==g.length?q:[parseInt(g[0])/255*f,parseInt(g[1])/255*f,parseInt(g[2])/255*f]}return q};h.distanceFromPointToLineInclusive=function(d,f,c){var g=f.distance(c),c=f.angle(c),c=a.PI/2-c,c=f.angle(d)+c,d=f.distance(d),d=new e.Point(d*a.cos(c),-d*a.sin(c));return h.isBetween(-d.y,0,g)?a.abs(d.x):-1};h.calculateDistanceInterior=function(d,f,c){if(this.isBetween(f.x,c.x,c.x+c.w)&&this.isBetween(f.y,c.y,c.y+c.w))return d.distance(f);
+var g=[];g.push({x1:c.x,y1:c.y,x2:c.x+c.w,y2:c.y});g.push({x1:c.x,y1:c.y+c.h,x2:c.x+c.w,y2:c.y+c.h});g.push({x1:c.x,y1:c.y,x2:c.x,y2:c.y+c.h});g.push({x1:c.x+c.w,y1:c.y,x2:c.x+c.w,y2:c.y+c.h});for(var c=[],b=0;4>b;b++){var m=g[b];(m=this.intersectLines(f.x,f.y,d.x,d.y,m.x1,m.y1,m.x2,m.y2))&&c.push(m)}if(0===c.length)return 0;b=f=0;for(g=c.length;b<g;b++)var m=c[b],j=d.x-m.x,m=d.y-m.y,f=a.max(f,a.sqrt(j*j+m*m));return f};h.intersectLines=function(a,f,c,g,b,m,j,e){var c=c-a,g=g-f,j=j-b,e=e-m,h=g*j-
+c*e;if(0===h)return!1;j=(e*(a-b)-j*(f-m))/h;b=(g*(a-b)-c*(f-m))/h;return 0<=b&&1>=b&&0<=j&&1>=j?{x:a+j*c,y:f+j*g}:!1};h.hsl2rgb=function(a,f,c){var g=function(a,d,c){0>c?c+=1:1<c&&(c-=1);return c<1/6?a+6*(d-a)*c:0.5>c?d:c<2/3?a+6*(d-a)*(2/3-c):a};if(0===f)c=f=a=c;else var b=0.5>c?c*(1+f):c+f-c*f,m=2*c-b,c=g(m,b,a+1/3),f=g(m,b,a),a=g(m,b,a-1/3);return[255*c,255*f,255*a]};h.isPointInPoly=function(a,c){for(var b=!1,g=-1,e=a.length,m=e-1;++g<e;m=g)(a[g].y<=c.y&&c.y<a[m].y||a[m].y<=c.y&&c.y<a[g].y)&&c.x<
+(a[m].x-a[g].x)*(c.y-a[g].y)/(a[m].y-a[g].y)+a[g].x&&(b=!b);return b};return h}(ChemDoodle.extensions,ChemDoodle.structures,Math);
+(function(b,e){b.Bounds=function(){this.minX=this.minY=Infinity;this.maxX=this.maxY=-Infinity;this.expand=function(a,h,c,d){a instanceof b.Bounds?(this.minX=e.min(this.minX,a.minX),this.minY=e.min(this.minY,a.minY),this.maxX=e.max(this.maxX,a.maxX),this.maxY=e.max(this.maxY,a.maxY)):(this.minX=e.min(this.minX,a),this.maxX=e.max(this.maxX,a),this.minY=e.min(this.minY,h),this.maxY=e.max(this.maxY,h),void 0!==c&&void 0!==d&&(this.minX=e.min(this.minX,c),this.maxX=e.max(this.maxX,c),this.minY=e.min(this.minY,
+d),this.maxY=e.max(this.maxY,d)))};return!0}})(ChemDoodle.math,Math);
+ChemDoodle.featureDetection=function(b,e,a,h){var c={supports_canvas:function(){return!!a.createElement("canvas").getContext},supports_canvas_text:function(){return!c.supports_canvas()?!1:"function"===typeof a.createElement("canvas").getContext("2d").fillText},supports_webgl:function(){var c=a.createElement("canvas");try{if(c.getContext("webgl")||c.getContext("experimental-webgl"))return!0}catch(f){}return!1},supports_xhr2:function(){return e.support.cors},supports_touch:function(){return"ontouchstart"in
+h},supports_gesture:function(){return"ongesturestart"in h}};return c}(ChemDoodle.iChemLabs,jQuery,document,window);ChemDoodle.SYMBOLS="H,He,Li,Be,B,C,N,O,F,Ne,Na,Mg,Al,Si,P,S,Cl,Ar,K,Ca,Sc,Ti,V,Cr,Mn,Fe,Co,Ni,Cu,Zn,Ga,Ge,As,Se,Br,Kr,Rb,Sr,Y,Zr,Nb,Mo,Tc,Ru,Rh,Pd,Ag,Cd,In,Sn,Sb,Te,I,Xe,Cs,Ba,La,Ce,Pr,Nd,Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu,Hf,Ta,W,Re,Os,Ir,Pt,Au,Hg,Tl,Pb,Bi,Po,At,Rn,Fr,Ra,Ac,Th,Pa,U,Np,Pu,Am,Cm,Bk,Cf,Es,Fm,Md,No,Lr,Rf,Db,Sg,Bh,Hs,Mt,Ds,Rg,Cn,Uut,Uuq,Uup,Uuh,Uus,Uuo".split(",");
+ChemDoodle.ELEMENT=function(b){function e(a,c,b){this.symbol=a;this.name=c;this.atomicNumber=b;return!0}var a=[];a.H=new e("H","Hydrogen",1);a.He=new e("He","Helium",2);a.Li=new e("Li","Lithium",3);a.Be=new e("Be","Beryllium",4);a.B=new e("B","Boron",5);a.C=new e("C","Carbon",6);a.N=new e("N","Nitrogen",7);a.O=new e("O","Oxygen",8);a.F=new e("F","Fluorine",9);a.Ne=new e("Ne","Neon",10);a.Na=new e("Na","Sodium",11);a.Mg=new e("Mg","Magnesium",12);a.Al=new e("Al","Aluminum",13);a.Si=new e("Si","Silicon",
+14);a.P=new e("P","Phosphorus",15);a.S=new e("S","Sulfur",16);a.Cl=new e("Cl","Chlorine",17);a.Ar=new e("Ar","Argon",18);a.K=new e("K","Potassium",19);a.Ca=new e("Ca","Calcium",20);a.Sc=new e("Sc","Scandium",21);a.Ti=new e("Ti","Titanium",22);a.V=new e("V","Vanadium",23);a.Cr=new e("Cr","Chromium",24);a.Mn=new e("Mn","Manganese",25);a.Fe=new e("Fe","Iron",26);a.Co=new e("Co","Cobalt",27);a.Ni=new e("Ni","Nickel",28);a.Cu=new e("Cu","Copper",29);a.Zn=new e("Zn","Zinc",30);a.Ga=new e("Ga","Gallium",
+31);a.Ge=new e("Ge","Germanium",32);a.As=new e("As","Arsenic",33);a.Se=new e("Se","Selenium",34);a.Br=new e("Br","Bromine",35);a.Kr=new e("Kr","Krypton",36);a.Rb=new e("Rb","Rubidium",37);a.Sr=new e("Sr","Strontium",38);a.Y=new e("Y","Yttrium",39);a.Zr=new e("Zr","Zirconium",40);a.Nb=new e("Nb","Niobium",41);a.Mo=new e("Mo","Molybdenum",42);a.Tc=new e("Tc","Technetium",43);a.Ru=new e("Ru","Ruthenium",44);a.Rh=new e("Rh","Rhodium",45);a.Pd=new e("Pd","Palladium",46);a.Ag=new e("Ag","Silver",47);a.Cd=
+new e("Cd","Cadmium",48);a.In=new e("In","Indium",49);a.Sn=new e("Sn","Tin",50);a.Sb=new e("Sb","Antimony",51);a.Te=new e("Te","Tellurium",52);a.I=new e("I","Iodine",53);a.Xe=new e("Xe","Xenon",54);a.Cs=new e("Cs","Cesium",55);a.Ba=new e("Ba","Barium",56);a.La=new e("La","Lanthanum",57);a.Ce=new e("Ce","Cerium",58);a.Pr=new e("Pr","Praseodymium",59);a.Nd=new e("Nd","Neodymium",60);a.Pm=new e("Pm","Promethium",61);a.Sm=new e("Sm","Samarium",62);a.Eu=new e("Eu","Europium",63);a.Gd=new e("Gd","Gadolinium",
+64);a.Tb=new e("Tb","Terbium",65);a.Dy=new e("Dy","Dysprosium",66);a.Ho=new e("Ho","Holmium",67);a.Er=new e("Er","Erbium",68);a.Tm=new e("Tm","Thulium",69);a.Yb=new e("Yb","Ytterbium",70);a.Lu=new e("Lu","Lutetium",71);a.Hf=new e("Hf","Hafnium",72);a.Ta=new e("Ta","Tantalum",73);a.W=new e("W","Tungsten",74);a.Re=new e("Re","Rhenium",75);a.Os=new e("Os","Osmium",76);a.Ir=new e("Ir","Iridium",77);a.Pt=new e("Pt","Platinum",78);a.Au=new e("Au","Gold",79);a.Hg=new e("Hg","Mercury",80);a.Tl=new e("Tl",
+"Thallium",81);a.Pb=new e("Pb","Lead",82);a.Bi=new e("Bi","Bismuth",83);a.Po=new e("Po","Polonium",84);a.At=new e("At","Astatine",85);a.Rn=new e("Rn","Radon",86);a.Fr=new e("Fr","Francium",87);a.Ra=new e("Ra","Radium",88);a.Ac=new e("Ac","Actinium",89);a.Th=new e("Th","Thorium",90);a.Pa=new e("Pa","Protactinium",91);a.U=new e("U","Uranium",92);a.Np=new e("Np","Neptunium",93);a.Pu=new e("Pu","Plutonium",94);a.Am=new e("Am","Americium",95);a.Cm=new e("Cm","Curium",96);a.Bk=new e("Bk","Berkelium",97);
+a.Cf=new e("Cf","Californium",98);a.Es=new e("Es","Einsteinium",99);a.Fm=new e("Fm","Fermium",100);a.Md=new e("Md","Mendelevium",101);a.No=new e("No","Nobelium",102);a.Lr=new e("Lr","Lawrencium",103);a.Rf=new e("Rf","Rutherfordium",104);a.Db=new e("Db","Dubnium",105);a.Sg=new e("Sg","Seaborgium",106);a.Bh=new e("Bh","Bohrium",107);a.Hs=new e("Hs","Hassium",108);a.Mt=new e("Mt","Meitnerium",109);a.Ds=new e("Ds","Darmstadtium",110);a.Rg=new e("Rg","Roentgenium",111);a.Cn=new e("Cn","Copernicium",112);
+a.Uut=new e("Uut","Ununtrium",113);a.Uuq=new e("Uuq","Ununquadium",114);a.Uup=new e("Uup","Ununpentium",115);a.Uuh=new e("Uuh","Ununhexium",116);a.Uus=new e("Uus","Ununseptium",117);a.Uuo=new e("Uuo","Ununoctium",118);a.H.jmolColor="#FFFFFF";a.He.jmolColor="#D9FFFF";a.Li.jmolColor="#CC80FF";a.Be.jmolColor="#C2FF00";a.B.jmolColor="#FFB5B5";a.C.jmolColor="#909090";a.N.jmolColor="#3050F8";a.O.jmolColor="#FF0D0D";a.F.jmolColor="#90E050";a.Ne.jmolColor="#B3E3F5";a.Na.jmolColor="#AB5CF2";a.Mg.jmolColor=
+"#8AFF00";a.Al.jmolColor="#BFA6A6";a.Si.jmolColor="#F0C8A0";a.P.jmolColor="#FF8000";a.S.jmolColor="#FFFF30";a.Cl.jmolColor="#1FF01F";a.Ar.jmolColor="#80D1E3";a.K.jmolColor="#8F40D4";a.Ca.jmolColor="#3DFF00";a.Sc.jmolColor="#E6E6E6";a.Ti.jmolColor="#BFC2C7";a.V.jmolColor="#A6A6AB";a.Cr.jmolColor="#8A99C7";a.Mn.jmolColor="#9C7AC7";a.Fe.jmolColor="#E06633";a.Co.jmolColor="#F090A0";a.Ni.jmolColor="#50D050";a.Cu.jmolColor="#C88033";a.Zn.jmolColor="#7D80B0";a.Ga.jmolColor="#C28F8F";a.Ge.jmolColor="#668F8F";
+a.As.jmolColor="#BD80E3";a.Se.jmolColor="#FFA100";a.Br.jmolColor="#A62929";a.Kr.jmolColor="#5CB8D1";a.Rb.jmolColor="#702EB0";a.Sr.jmolColor="#00FF00";a.Y.jmolColor="#94FFFF";a.Zr.jmolColor="#94E0E0";a.Nb.jmolColor="#73C2C9";a.Mo.jmolColor="#54B5B5";a.Tc.jmolColor="#3B9E9E";a.Ru.jmolColor="#248F8F";a.Rh.jmolColor="#0A7D8C";a.Pd.jmolColor="#006985";a.Ag.jmolColor="#C0C0C0";a.Cd.jmolColor="#FFD98F";a.In.jmolColor="#A67573";a.Sn.jmolColor="#668080";a.Sb.jmolColor="#9E63B5";a.Te.jmolColor="#D47A00";a.I.jmolColor=
+"#940094";a.Xe.jmolColor="#429EB0";a.Cs.jmolColor="#57178F";a.Ba.jmolColor="#00C900";a.La.jmolColor="#70D4FF";a.Ce.jmolColor="#FFFFC7";a.Pr.jmolColor="#D9FFC7";a.Nd.jmolColor="#C7FFC7";a.Pm.jmolColor="#A3FFC7";a.Sm.jmolColor="#8FFFC7";a.Eu.jmolColor="#61FFC7";a.Gd.jmolColor="#45FFC7";a.Tb.jmolColor="#30FFC7";a.Dy.jmolColor="#1FFFC7";a.Ho.jmolColor="#00FF9C";a.Er.jmolColor="#00E675";a.Tm.jmolColor="#00D452";a.Yb.jmolColor="#00BF38";a.Lu.jmolColor="#00AB24";a.Hf.jmolColor="#4DC2FF";a.Ta.jmolColor="#4DA6FF";
+a.W.jmolColor="#2194D6";a.Re.jmolColor="#267DAB";a.Os.jmolColor="#266696";a.Ir.jmolColor="#175487";a.Pt.jmolColor="#D0D0E0";a.Au.jmolColor="#FFD123";a.Hg.jmolColor="#B8B8D0";a.Tl.jmolColor="#A6544D";a.Pb.jmolColor="#575961";a.Bi.jmolColor="#9E4FB5";a.Po.jmolColor="#AB5C00";a.At.jmolColor="#754F45";a.Rn.jmolColor="#428296";a.Fr.jmolColor="#420066";a.Ra.jmolColor="#007D00";a.Ac.jmolColor="#70ABFA";a.Th.jmolColor="#00BAFF";a.Pa.jmolColor="#00A1FF";a.U.jmolColor="#008FFF";a.Np.jmolColor="#0080FF";a.Pu.jmolColor=
+"#006BFF";a.Am.jmolColor="#545CF2";a.Cm.jmolColor="#785CE3";a.Bk.jmolColor="#8A4FE3";a.Cf.jmolColor="#A136D4";a.Es.jmolColor="#B31FD4";a.Fm.jmolColor="#B31FBA";a.Md.jmolColor="#B30DA6";a.No.jmolColor="#BD0D87";a.Lr.jmolColor="#C70066";a.Rf.jmolColor="#CC0059";a.Db.jmolColor="#D1004F";a.Sg.jmolColor="#D90045";a.Bh.jmolColor="#E00038";a.Hs.jmolColor="#E6002E";a.Mt.jmolColor="#EB0026";a.Ds.jmolColor="#000000";a.Rg.jmolColor="#000000";a.Cn.jmolColor="#000000";a.Uut.jmolColor="#000000";a.Uuq.jmolColor=
+"#000000";a.Uup.jmolColor="#000000";a.Uuh.jmolColor="#000000";a.Uus.jmolColor="#000000";a.Uuo.jmolColor="#000000";for(var h=0,c=b.length;h<c;h++)a[b[h]].pymolColor=a[b[h]].jmolColor;a.H.pymolColor="#E6E6E6";a.C.pymolColor="#33FF33";a.N.pymolColor="#3333FF";a.O.pymolColor="#FF4D4D";a.F.pymolColor="#B3FFFF";a.S.pymolColor="#E6C640";a.H.covalentRadius=0.31;a.He.covalentRadius=0.28;a.Li.covalentRadius=1.28;a.Be.covalentRadius=0.96;a.B.covalentRadius=0.84;a.C.covalentRadius=0.76;a.N.covalentRadius=0.71;
+a.O.covalentRadius=0.66;a.F.covalentRadius=0.57;a.Ne.covalentRadius=0.58;a.Na.covalentRadius=1.66;a.Mg.covalentRadius=1.41;a.Al.covalentRadius=1.21;a.Si.covalentRadius=1.11;a.P.covalentRadius=1.07;a.S.covalentRadius=1.05;a.Cl.covalentRadius=1.02;a.Ar.covalentRadius=1.06;a.K.covalentRadius=2.03;a.Ca.covalentRadius=1.76;a.Sc.covalentRadius=1.7;a.Ti.covalentRadius=1.6;a.V.covalentRadius=1.53;a.Cr.covalentRadius=1.39;a.Mn.covalentRadius=1.39;a.Fe.covalentRadius=1.32;a.Co.covalentRadius=1.26;a.Ni.covalentRadius=
+1.24;a.Cu.covalentRadius=1.32;a.Zn.covalentRadius=1.22;a.Ga.covalentRadius=1.22;a.Ge.covalentRadius=1.2;a.As.covalentRadius=1.19;a.Se.covalentRadius=1.2;a.Br.covalentRadius=1.2;a.Kr.covalentRadius=1.16;a.Rb.covalentRadius=2.2;a.Sr.covalentRadius=1.95;a.Y.covalentRadius=1.9;a.Zr.covalentRadius=1.75;a.Nb.covalentRadius=1.64;a.Mo.covalentRadius=1.54;a.Tc.covalentRadius=1.47;a.Ru.covalentRadius=1.46;a.Rh.covalentRadius=1.42;a.Pd.covalentRadius=1.39;a.Ag.covalentRadius=1.45;a.Cd.covalentRadius=1.44;a.In.covalentRadius=
+1.42;a.Sn.covalentRadius=1.39;a.Sb.covalentRadius=1.39;a.Te.covalentRadius=1.38;a.I.covalentRadius=1.39;a.Xe.covalentRadius=1.4;a.Cs.covalentRadius=2.44;a.Ba.covalentRadius=2.15;a.La.covalentRadius=2.07;a.Ce.covalentRadius=2.04;a.Pr.covalentRadius=2.03;a.Nd.covalentRadius=2.01;a.Pm.covalentRadius=1.99;a.Sm.covalentRadius=1.98;a.Eu.covalentRadius=1.98;a.Gd.covalentRadius=1.96;a.Tb.covalentRadius=1.94;a.Dy.covalentRadius=1.92;a.Ho.covalentRadius=1.92;a.Er.covalentRadius=1.89;a.Tm.covalentRadius=1.9;
+a.Yb.covalentRadius=1.87;a.Lu.covalentRadius=1.87;a.Hf.covalentRadius=1.75;a.Ta.covalentRadius=1.7;a.W.covalentRadius=1.62;a.Re.covalentRadius=1.51;a.Os.covalentRadius=1.44;a.Ir.covalentRadius=1.41;a.Pt.covalentRadius=1.36;a.Au.covalentRadius=1.36;a.Hg.covalentRadius=1.32;a.Tl.covalentRadius=1.45;a.Pb.covalentRadius=1.46;a.Bi.covalentRadius=1.48;a.Po.covalentRadius=1.4;a.At.covalentRadius=1.5;a.Rn.covalentRadius=1.5;a.Fr.covalentRadius=2.6;a.Ra.covalentRadius=2.21;a.Ac.covalentRadius=2.15;a.Th.covalentRadius=
+2.06;a.Pa.covalentRadius=2;a.U.covalentRadius=1.96;a.Np.covalentRadius=1.9;a.Pu.covalentRadius=1.87;a.Am.covalentRadius=1.8;a.Cm.covalentRadius=1.69;a.Bk.covalentRadius=0;a.Cf.covalentRadius=0;a.Es.covalentRadius=0;a.Fm.covalentRadius=0;a.Md.covalentRadius=0;a.No.covalentRadius=0;a.Lr.covalentRadius=0;a.Rf.covalentRadius=0;a.Db.covalentRadius=0;a.Sg.covalentRadius=0;a.Bh.covalentRadius=0;a.Hs.covalentRadius=0;a.Mt.covalentRadius=0;a.Ds.covalentRadius=0;a.Rg.covalentRadius=0;a.Cn.covalentRadius=0;
+a.Uut.covalentRadius=0;a.Uuq.covalentRadius=0;a.Uup.covalentRadius=0;a.Uuh.covalentRadius=0;a.Uus.covalentRadius=0;a.Uuo.covalentRadius=0;a.H.vdWRadius=1.2;a.He.vdWRadius=1.4;a.Li.vdWRadius=1.82;a.Be.vdWRadius=0;a.B.vdWRadius=0;a.C.vdWRadius=1.7;a.N.vdWRadius=1.55;a.O.vdWRadius=1.52;a.F.vdWRadius=1.47;a.Ne.vdWRadius=1.54;a.Na.vdWRadius=2.27;a.Mg.vdWRadius=1.73;a.Al.vdWRadius=0;a.Si.vdWRadius=2.1;a.P.vdWRadius=1.8;a.S.vdWRadius=1.8;a.Cl.vdWRadius=1.75;a.Ar.vdWRadius=1.88;a.K.vdWRadius=2.75;a.Ca.vdWRadius=
+0;a.Sc.vdWRadius=0;a.Ti.vdWRadius=0;a.V.vdWRadius=0;a.Cr.vdWRadius=0;a.Mn.vdWRadius=0;a.Fe.vdWRadius=0;a.Co.vdWRadius=0;a.Ni.vdWRadius=1.63;a.Cu.vdWRadius=1.4;a.Zn.vdWRadius=1.39;a.Ga.vdWRadius=1.87;a.Ge.vdWRadius=0;a.As.vdWRadius=1.85;a.Se.vdWRadius=1.9;a.Br.vdWRadius=1.85;a.Kr.vdWRadius=2.02;a.Rb.vdWRadius=0;a.Sr.vdWRadius=0;a.Y.vdWRadius=0;a.Zr.vdWRadius=0;a.Nb.vdWRadius=0;a.Mo.vdWRadius=0;a.Tc.vdWRadius=0;a.Ru.vdWRadius=0;a.Rh.vdWRadius=0;a.Pd.vdWRadius=1.63;a.Ag.vdWRadius=1.72;a.Cd.vdWRadius=
+1.58;a.In.vdWRadius=1.93;a.Sn.vdWRadius=2.17;a.Sb.vdWRadius=0;a.Te.vdWRadius=2.06;a.I.vdWRadius=1.98;a.Xe.vdWRadius=2.16;a.Cs.vdWRadius=0;a.Ba.vdWRadius=0;a.La.vdWRadius=0;a.Ce.vdWRadius=0;a.Pr.vdWRadius=0;a.Nd.vdWRadius=0;a.Pm.vdWRadius=0;a.Sm.vdWRadius=0;a.Eu.vdWRadius=0;a.Gd.vdWRadius=0;a.Tb.vdWRadius=0;a.Dy.vdWRadius=0;a.Ho.vdWRadius=0;a.Er.vdWRadius=0;a.Tm.vdWRadius=0;a.Yb.vdWRadius=0;a.Lu.vdWRadius=0;a.Hf.vdWRadius=0;a.Ta.vdWRadius=0;a.W.vdWRadius=0;a.Re.vdWRadius=0;a.Os.vdWRadius=0;a.Ir.vdWRadius=
+0;a.Pt.vdWRadius=1.75;a.Au.vdWRadius=1.66;a.Hg.vdWRadius=1.55;a.Tl.vdWRadius=1.96;a.Pb.vdWRadius=2.02;a.Bi.vdWRadius=0;a.Po.vdWRadius=0;a.At.vdWRadius=0;a.Rn.vdWRadius=0;a.Fr.vdWRadius=0;a.Ra.vdWRadius=0;a.Ac.vdWRadius=0;a.Th.vdWRadius=0;a.Pa.vdWRadius=0;a.U.vdWRadius=1.86;a.Np.vdWRadius=0;a.Pu.vdWRadius=0;a.Am.vdWRadius=0;a.Cm.vdWRadius=0;a.Bk.vdWRadius=0;a.Cf.vdWRadius=0;a.Es.vdWRadius=0;a.Fm.vdWRadius=0;a.Md.vdWRadius=0;a.No.vdWRadius=0;a.Lr.vdWRadius=0;a.Rf.vdWRadius=0;a.Db.vdWRadius=0;a.Sg.vdWRadius=
+0;a.Bh.vdWRadius=0;a.Hs.vdWRadius=0;a.Mt.vdWRadius=0;a.Ds.vdWRadius=0;a.Rg.vdWRadius=0;a.Cn.vdWRadius=0;a.Uut.vdWRadius=0;a.Uuq.vdWRadius=0;a.Uup.vdWRadius=0;a.Uuh.vdWRadius=0;a.Uus.vdWRadius=0;a.Uuo.vdWRadius=0;a.H.valency=1;a.He.valency=0;a.Li.valency=1;a.Be.valency=2;a.B.valency=3;a.C.valency=4;a.N.valency=3;a.O.valency=2;a.F.valency=1;a.Ne.valency=0;a.Na.valency=1;a.Mg.valency=0;a.Al.valency=0;a.Si.valency=4;a.P.valency=3;a.S.valency=2;a.Cl.valency=1;a.Ar.valency=0;a.K.valency=0;a.Ca.valency=
+0;a.Sc.valency=0;a.Ti.valency=1;a.V.valency=1;a.Cr.valency=2;a.Mn.valency=3;a.Fe.valency=2;a.Co.valency=1;a.Ni.valency=1;a.Cu.valency=0;a.Zn.valency=0;a.Ga.valency=0;a.Ge.valency=4;a.As.valency=3;a.Se.valency=2;a.Br.valency=1;a.Kr.valency=0;a.Rb.valency=0;a.Sr.valency=0;a.Y.valency=0;a.Zr.valency=0;a.Nb.valency=1;a.Mo.valency=2;a.Tc.valency=3;a.Ru.valency=2;a.Rh.valency=1;a.Pd.valency=0;a.Ag.valency=0;a.Cd.valency=0;a.In.valency=0;a.Sn.valency=4;a.Sb.valency=3;a.Te.valency=2;a.I.valency=1;a.Xe.valency=
+0;a.Cs.valency=0;a.Ba.valency=0;a.La.valency=0;a.Ce.valency=0;a.Pr.valency=0;a.Nd.valency=0;a.Pm.valency=0;a.Sm.valency=0;a.Eu.valency=0;a.Gd.valency=0;a.Tb.valency=0;a.Dy.valency=0;a.Ho.valency=0;a.Er.valency=0;a.Tm.valency=0;a.Yb.valency=0;a.Lu.valency=0;a.Hf.valency=0;a.Ta.valency=1;a.W.valency=2;a.Re.valency=3;a.Os.valency=2;a.Ir.valency=3;a.Pt.valency=0;a.Au.valency=1;a.Hg.valency=0;a.Tl.valency=0;a.Pb.valency=4;a.Bi.valency=3;a.Po.valency=2;a.At.valency=1;a.Rn.valency=0;a.Fr.valency=0;a.Ra.valency=
+0;a.Ac.valency=0;a.Th.valency=0;a.Pa.valency=0;a.U.valency=0;a.Np.valency=0;a.Pu.valency=0;a.Am.valency=0;a.Cm.valency=0;a.Bk.valency=0;a.Cf.valency=0;a.Es.valency=0;a.Fm.valency=0;a.Md.valency=0;a.No.valency=0;a.Lr.valency=0;a.Rf.valency=0;a.Db.valency=0;a.Sg.valency=0;a.Bh.valency=0;a.Hs.valency=0;a.Mt.valency=0;a.Ds.valency=0;a.Rg.valency=0;a.Cn.valency=0;a.Uut.valency=0;a.Uuq.valency=0;a.Uup.valency=0;a.Uuh.valency=0;a.Uus.valency=0;a.Uuo.valency=0;a.H.mass=1;a.He.mass=4;a.Li.mass=7;a.Be.mass=
+9;a.B.mass=11;a.C.mass=12;a.N.mass=14;a.O.mass=16;a.F.mass=19;a.Ne.mass=20;a.Na.mass=23;a.Mg.mass=24;a.Al.mass=27;a.Si.mass=28;a.P.mass=31;a.S.mass=32;a.Cl.mass=35;a.Ar.mass=40;a.K.mass=39;a.Ca.mass=40;a.Sc.mass=45;a.Ti.mass=48;a.V.mass=51;a.Cr.mass=52;a.Mn.mass=55;a.Fe.mass=56;a.Co.mass=59;a.Ni.mass=58;a.Cu.mass=63;a.Zn.mass=64;a.Ga.mass=69;a.Ge.mass=74;a.As.mass=75;a.Se.mass=80;a.Br.mass=79;a.Kr.mass=84;a.Rb.mass=85;a.Sr.mass=88;a.Y.mass=89;a.Zr.mass=90;a.Nb.mass=93;a.Mo.mass=98;a.Tc.mass=0;a.Ru.mass=
+102;a.Rh.mass=103;a.Pd.mass=106;a.Ag.mass=107;a.Cd.mass=114;a.In.mass=115;a.Sn.mass=120;a.Sb.mass=121;a.Te.mass=130;a.I.mass=127;a.Xe.mass=132;a.Cs.mass=133;a.Ba.mass=138;a.La.mass=139;a.Ce.mass=140;a.Pr.mass=141;a.Nd.mass=142;a.Pm.mass=0;a.Sm.mass=152;a.Eu.mass=153;a.Gd.mass=158;a.Tb.mass=159;a.Dy.mass=164;a.Ho.mass=165;a.Er.mass=166;a.Tm.mass=169;a.Yb.mass=174;a.Lu.mass=175;a.Hf.mass=180;a.Ta.mass=181;a.W.mass=184;a.Re.mass=187;a.Os.mass=192;a.Ir.mass=193;a.Pt.mass=195;a.Au.mass=197;a.Hg.mass=202;
+a.Tl.mass=205;a.Pb.mass=208;a.Bi.mass=209;a.Po.mass=0;a.At.mass=0;a.Rn.mass=0;a.Fr.mass=0;a.Ra.mass=0;a.Ac.mass=0;a.Th.mass=232;a.Pa.mass=231;a.U.mass=238;a.Np.mass=0;a.Pu.mass=0;a.Am.mass=0;a.Cm.mass=0;a.Bk.mass=0;a.Cf.mass=0;a.Es.mass=0;a.Fm.mass=0;a.Md.mass=0;a.No.mass=0;a.Lr.mass=0;a.Rf.mass=0;a.Db.mass=0;a.Sg.mass=0;a.Bh.mass=0;a.Hs.mass=0;a.Mt.mass=0;a.Ds.mass=0;a.Rg.mass=0;a.Cn.mass=0;a.Uut.mass=0;a.Uuq.mass=0;a.Uup.mass=0;a.Uuh.mass=0;a.Uus.mass=0;a.Uuo.mass=0;return a}(ChemDoodle.SYMBOLS);
+ChemDoodle.RESIDUE=function(){function b(a,b){this.symbol=a;this.name=b;return!0}var e=[];e.Ala=new b("Ala","Alanine");e.Arg=new b("Arg","Arginine");e.Asn=new b("Asn","Asparagine");e.Asp=new b("Asp","Aspartic Acid");e.Cys=new b("Cys","Cysteine");e.Gln=new b("Gln","Glutamine");e.Glu=new b("Glu","Glutamic Acid");e.Gly=new b("Gly","Glycine");e.His=new b("His","Histidine");e.Ile=new b("Ile","Isoleucine");e.Leu=new b("Leu","Leucine");e.Lys=new b("Lys","Lysine");e.Met=new b("Met","Methionine");e.Phe=new b("Phe",
+"Phenylalanine");e.Pro=new b("Pro","Proline");e.Ser=new b("Ser","Serine");e.Thr=new b("Thr","Threonine");e.Trp=new b("Trp","Tryptophan");e.Tyr=new b("Tyr","Tyrosine");e.Val=new b("Val","Valine");e.Asx=new b("Asx","Asparagine/Aspartic Acid");e.Glx=new b("Glx","Glutamine/Glutamic Acid");e["*"]=new b("*","Other");e.A=new b("A","Adenine");e.G=new b("G","Guanine");e.I=new b("I","");e.C=new b("C","Cytosine");e.T=new b("T","Thymine");e.U=new b("U","Uracil");e.Ala.polar=!1;e.Arg.polar=!0;e.Asn.polar=!0;e.Asp.polar=
+!0;e.Cys.polar=!0;e.Gln.polar=!0;e.Glu.polar=!0;e.Gly.polar=!1;e.His.polar=!0;e.Ile.polar=!1;e.Leu.polar=!1;e.Lys.polar=!0;e.Met.polar=!1;e.Phe.polar=!1;e.Pro.polar=!1;e.Ser.polar=!0;e.Thr.polar=!0;e.Trp.polar=!0;e.Tyr.polar=!0;e.Val.polar=!1;e.Asx.polar=!0;e.Glx.polar=!0;e.Ala.aminoColor="#C8C8C8";e.Arg.aminoColor="#145AFF";e.Asn.aminoColor="#00DCDC";e.Asp.aminoColor="#E60A0A";e.Cys.aminoColor="#E6E600";e.Gln.aminoColor="#00DCDC";e.Glu.aminoColor="#E60A0A";e.Gly.aminoColor="#EBEBEB";e.His.aminoColor=
+"#8282D2";e.Ile.aminoColor="#0F820F";e.Leu.aminoColor="#0F820F";e.Lys.aminoColor="#145AFF";e.Met.aminoColor="#E6E600";e.Phe.aminoColor="#3232AA";e.Pro.aminoColor="#DC9682";e.Ser.aminoColor="#FA9600";e.Thr.aminoColor="#FA9600";e.Trp.aminoColor="#B45AB4";e.Tyr.aminoColor="#3232AA";e.Val.aminoColor="#0F820F";e.Asx.aminoColor="#FF69B4";e.Glx.aminoColor="#FF69B4";e["*"].aminoColor="#BEA06E";e.A.aminoColor="#BEA06E";e.G.aminoColor="#BEA06E";e.I.aminoColor="#BEA06E";e.C.aminoColor="#BEA06E";e.T.aminoColor=
+"#BEA06E";e.U.aminoColor="#BEA06E";e.Ala.shapelyColor="#8CFF8C";e.Arg.shapelyColor="#00007C";e.Asn.shapelyColor="#FF7C70";e.Asp.shapelyColor="#A00042";e.Cys.shapelyColor="#FFFF70";e.Gln.shapelyColor="#FF4C4C";e.Glu.shapelyColor="#660000";e.Gly.shapelyColor="#FFFFFF";e.His.shapelyColor="#7070FF";e.Ile.shapelyColor="#004C00";e.Leu.shapelyColor="#455E45";e.Lys.shapelyColor="#4747B8";e.Met.shapelyColor="#B8A042";e.Phe.shapelyColor="#534C52";e.Pro.shapelyColor="#525252";e.Ser.shapelyColor="#FF7042";e.Thr.shapelyColor=
+"#B84C00";e.Trp.shapelyColor="#4F4600";e.Tyr.shapelyColor="#8C704C";e.Val.shapelyColor="#FF8CFF";e.Asx.shapelyColor="#FF00FF";e.Glx.shapelyColor="#FF00FF";e["*"].shapelyColor="#FF00FF";e.A.shapelyColor="#A0A0FF";e.G.shapelyColor="#FF7070";e.I.shapelyColor="#80FFFF";e.C.shapelyColor="#FF8C4B";e.T.shapelyColor="#A0FFA0";e.U.shapelyColor="#FF8080";return e}();
+(function(b){b.Queue=function(){var b=[],a=0;this.getSize=function(){return b.length-a};this.isEmpty=function(){return 0===b.length};this.enqueue=function(a){b.push(a)};this.dequeue=function(){var h;b.length&&(h=b[a],2*++a>=b.length&&(b=b.slice(a),a=0));return h};this.getOldestElement=function(){var h;b.length&&(h=b[a]);return h}}})(ChemDoodle.structures);
+(function(b,e){b.Point=function(a,b){this.x=a?a:0;this.y=b?b:0;this.sub=function(a){this.x-=a.x;this.y-=a.y};this.add=function(a){this.x+=a.x;this.y+=a.y};this.distance=function(a){var d=a.x-this.x,a=a.y-this.y;return e.sqrt(d*d+a*a)};this.angleForStupidCanvasArcs=function(a){for(var d=a.x-this.x,a=a.y-this.y,f=0,f=0===d?0===a?0:0<a?e.PI/2:3*e.PI/2:0===a?0<d?0:e.PI:0>d?e.atan(a/d)+e.PI:0>a?e.atan(a/d)+2*e.PI:e.atan(a/d);0>f;)f+=2*e.PI;return f%=2*e.PI};this.angle=function(a){for(var d=a.x-this.x,
+a=this.y-a.y,f=0,f=0===d?0===a?0:0<a?e.PI/2:3*e.PI/2:0===a?0<d?0:e.PI:0>d?e.atan(a/d)+e.PI:0>a?e.atan(a/d)+2*e.PI:e.atan(a/d);0>f;)f+=2*e.PI;return f%=2*e.PI};return!0}})(ChemDoodle.structures,Math);
+(function(b,e,a,h,c,d){h.Atom=function(f,h,g,o){this.x=h?h:0;this.y=g?g:0;this.z=o?o:0;this.numRadical=this.numLonePair=this.charge=0;this.mass=-1;this.angleOfLeastInterference=this.bondNumber=this.coordinationNumber=0;this.isHidden=!1;this.label=f?f.replace(/\s/g,""):"C";b[this.label]||(this.label="C");this.altLabel=void 0;this.any=!1;this.rgroup=-1;this.isSelected=this.isHover=this.isLone=!1;this.add3D=function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z};this.sub3D=function(a){this.x=
+this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z};this.distance3D=function(a){var d=a.x-this.x,f=a.y-this.y,a=a.z-this.z;return c.sqrt(d*d+f*f+a*a)};this.draw=function(a,d){if(this.isLassoed){var f=a.createRadialGradient(this.x-1,this.y-1,0,this.x,this.y,7);f.addColorStop(0,"rgba(212, 99, 0, 0)");f.addColorStop(0.7,"rgba(212, 99, 0, 0.8)");a.fillStyle=f;a.beginPath();a.arc(this.x,this.y,5,0,c.PI*2,false);a.fill()}this.textBounds=[];if(this.specs)d=this.specs;f=d.getFontString(d.atoms_font_size_2D,d.atoms_font_families_2D,
+d.atoms_font_bold_2D,d.atoms_font_italic_2D);a.font=f;a.fillStyle=d.atoms_color;if(!this.any&&this.rgroup===-1)if(d.atoms_useJMOLColors)a.fillStyle=b[this.label].jmolColor;else if(d.atoms_usePYMOLColors)a.fillStyle=b[this.label].pymolColor;if(this.isLone&&!d.atoms_displayAllCarbonLabels_2D||d.atoms_circles_2D){a.beginPath();a.arc(this.x,this.y,d.atoms_circleDiameter_2D/2,0,c.PI*2,false);a.fill();if(d.atoms_circleBorderWidth_2D>0){a.lineWidth=d.atoms_circleBorderWidth_2D;a.strokeStyle="black";a.stroke(this.x,
+this.y,0,c.PI*2,d.atoms_circleDiameter_2D/2)}}else if(this.isLabelVisible(d)){a.textAlign="center";a.textBaseline="middle";if(this.altLabel!==void 0){a.fillText(this.altLabel,this.x,this.y);var g=a.measureText(this.altLabel).width;this.textBounds.push({x:this.x-g/2,y:this.y-d.atoms_font_size_2D/2+1,w:g,h:d.atoms_font_size_2D-2})}else if(this.any){a.font=d.getFontString(d.atoms_font_size_2D+5,d.atoms_font_families_2D,true);a.fillText("*",this.x+1,this.y+3);g=a.measureText("*").width;this.textBounds.push({x:this.x-
+g/2,y:this.y-d.atoms_font_size_2D/2+1,w:g,h:d.atoms_font_size_2D-2})}else if(this.rgroup!==-1){f="R"+this.rgroup;a.fillText(f,this.x,this.y);g=a.measureText(f).width;this.textBounds.push({x:this.x-g/2,y:this.y-d.atoms_font_size_2D/2+1,w:g,h:d.atoms_font_size_2D-2})}else{a.fillText(this.label,this.x,this.y);g=a.measureText(this.label).width;this.textBounds.push({x:this.x-g/2,y:this.y-d.atoms_font_size_2D/2+1,w:g,h:d.atoms_font_size_2D-2});if(this.mass!==-1){var h=d.getFontString(d.atoms_font_size_2D*
+0.7,d.atoms_font_families_2D,d.atoms_font_bold_2D,d.atoms_font_italic_2D),q=a.font;a.font=h;h=a.measureText(this.mass).width;a.fillText(this.mass,this.x-h-0.5,this.y-d.atoms_font_size_2D*0.3);a.font=q}q=this.getImplicitHydrogenCount();if(d.atoms_implicitHydrogens_2D&&q>0){var o=a.measureText("H").width;if(q>1){var x=g/2+o/2,t=0,h=d.getFontString(d.atoms_font_size_2D*0.8,d.atoms_font_families_2D,d.atoms_font_bold_2D,d.atoms_font_italic_2D);a.font=h;var y=a.measureText(q).width;if(this.bondNumber===
+1)this.angleOfLeastInterference>c.PI/2&&this.angleOfLeastInterference<3*c.PI/2&&(x=-g/2-y-o/2);else if(!(this.angleOfLeastInterference<=c.PI/4))if(this.angleOfLeastInterference<3*c.PI/4){x=0;t=-d.atoms_font_size_2D*0.9}else if(this.angleOfLeastInterference<=5*c.PI/4)x=-g/2-y-o/2;else if(this.angleOfLeastInterference<7*c.PI/4){x=0;t=d.atoms_font_size_2D*0.9}a.font=f;a.fillText("H",this.x+x,this.y+t);a.font=h;a.fillText(q,this.x+x+o/2+y/2,this.y+t+d.atoms_font_size_2D*0.3);this.textBounds.push({x:this.x+
+x-o/2,y:this.y+t-d.atoms_font_size_2D/2+1,w:o,h:d.atoms_font_size_2D-2});this.textBounds.push({x:this.x+x+o/2,y:this.y+t+d.atoms_font_size_2D*0.3-d.atoms_font_size_2D/2+1,w:y,h:d.atoms_font_size_2D*0.8-2})}else{x=g/2+o/2;t=0;if(this.bondNumber===1)this.angleOfLeastInterference>c.PI/2&&this.angleOfLeastInterference<3*c.PI/2&&(x=-g/2-o/2);else if(!(this.angleOfLeastInterference<=c.PI/4))if(this.angleOfLeastInterference<3*c.PI/4){x=0;t=-d.atoms_font_size_2D*0.9}else if(this.angleOfLeastInterference<=
+5*c.PI/4)x=-g/2-o/2;else if(this.angleOfLeastInterference<7*c.PI/4){x=0;t=d.atoms_font_size_2D*0.9}a.fillText("H",this.x+x,this.y+t);this.textBounds.push({x:this.x+x-o/2,y:this.y+t-d.atoms_font_size_2D/2+1,w:o,h:d.atoms_font_size_2D-2})}}}if(this.charge!==0){f=this.charge.toFixed(0);f=f==="1"?"+":f==="-1"?"\u2013":e.stringStartsWith(f,"-")?f.substring(1)+"\u2013":f+"+";g=this.angleOfLeastInterference;h=d.atoms_font_size_2D;this.isLabelVisible(d)&&q>0&&(g=g+c.PI/4);a.textAlign="center";a.textBaseline=
+"middle";a.fillText(f,this.x+h*c.cos(g),this.y-h*c.sin(g))}if(this.numLonePair>0||this.numRadical>0){a.fillStyle="black";if(this.bondNumber===2&&c.abs(this.largestAngle-c.PI)<c.PI/60)if(this.numRadical===0){this.drawElectrons(a,d,c.floor(this.numLonePair/2),0,this.angleOfLeastInterference,this.largestAngle);this.drawElectrons(a,d,c.floor(this.numLonePair/2)+this.numLonePair%2,0,this.angleOfLeastInterference+c.PI,this.largestAngle)}else if(this.numLonePair===0){this.drawElectrons(a,d,0,c.floor(this.numRadical/
+2),this.angleOfLeastInterference,this.largestAngle);this.drawElectrons(a,d,0,c.floor(this.numRadical/2)+this.numRadical%2,this.angleOfLeastInterference+c.PI,this.largestAngle)}else{this.drawElectrons(a,d,this.numLonePair,0,this.angleOfLeastInterference,this.largestAngle);this.drawElectrons(a,d,0,this.numRadical,this.angleOfLeastInterference+c.PI,this.largestAngle)}else this.drawElectrons(a,d,this.numLonePair,this.numRadical,this.angleOfLeastInterference,this.largestAngle)}}};this.drawElectrons=function(a,
+d,f,g,b,e){for(var h=e/(f+g+(this.bondNumber===0?0:1)),e=b-e/2+h,q=0;q<f;q++){var b=e+q*h,o=this.x+Math.cos(b)*d.atoms_lonePairDistance_2D,y=this.y-Math.sin(b)*d.atoms_lonePairDistance_2D,w=b+Math.PI/2,b=Math.cos(w)*d.atoms_lonePairSpread_2D/2,w=-Math.sin(w)*d.atoms_lonePairSpread_2D/2;a.beginPath();a.arc(o+b,y+w,d.atoms_lonePairDiameter_2D,0,c.PI*2,false);a.fill();a.beginPath();a.arc(o-b,y-w,d.atoms_lonePairDiameter_2D,0,c.PI*2,false);a.fill()}for(q=0;q<g;q++){b=e+(q+f)*h;o=this.x+Math.cos(b)*d.atoms_lonePairDistance_2D;
+y=this.y-Math.sin(b)*d.atoms_lonePairDistance_2D;a.beginPath();a.arc(o,y,d.atoms_lonePairDiameter_2D,0,c.PI*2,false);a.fill()}};this.drawDecorations=function(a){if(this.isHover||this.isSelected){a.strokeStyle=this.isHover?"#885110":"#0060B2";a.lineWidth=1.2;a.beginPath();a.arc(this.x,this.y,this.isHover?7:15,0,c.PI*2,false);a.stroke()}if(this.isOverlap){a.strokeStyle="#C10000";a.lineWidth=1.2;a.beginPath();a.arc(this.x,this.y,7,0,c.PI*2,false);a.stroke()}};this.render=function(a,f){if(this.specs)f=
+this.specs;var c=d.translate(a.modelViewMatrix,[this.x,this.y,this.z],[]),g=f.atoms_useVDWDiameters_3D?b[this.label].vdWRadius*f.atoms_vdwMultiplier_3D:f.atoms_sphereDiameter_3D/2;g===0&&(g=1);d.scale(c,[g,g,g]);g=f.atoms_color;if(f.atoms_useJMOLColors)g=b[this.label].jmolColor;else if(f.atoms_usePYMOLColors)g=b[this.label].pymolColor;a.material.setDiffuseColor(g);a.setMatrixUniforms(c);a.drawElements(a.TRIANGLES,(this.renderAsStar?a.starBuffer:a.sphereBuffer).vertexIndexBuffer.numItems,a.UNSIGNED_SHORT,
+0)};this.isLabelVisible=function(a){return a.atoms_displayAllCarbonLabels_2D||this.label!=="C"||this.altLabel||this.any||this.rgroup!==-1||this.mass!==-1||this.charge!==0||this.numLonePair!==0||this.isHidden&&a.atoms_showHiddenCarbons_2D||a.atoms_displayTerminalCarbonLabels_2D&&this.bondNumber===1};this.getImplicitHydrogenCount=function(){if(this.label==="H"||!b[this.label])return 0;var a=b[this.label].valency,d=a-this.coordinationNumber;if(this.charge>0){a=4-a;d=this.charge<=a?d+this.charge:4-this.coordinationNumber-
+this.charge+a}else d=d+this.charge;return d<0?0:d};this.getBounds=function(){var d=new a.Bounds;d.expand(this.x,this.y);if(this.textBounds)for(var f=0,g=this.textBounds.length;f<g;f++){var c=this.textBounds[f];d.expand(c.x,c.y,c.x+c.w,c.y+c.h)}return d};return!0};h.Atom.prototype=new h.Point(0,0)})(ChemDoodle.ELEMENT,ChemDoodle.extensions,ChemDoodle.math,ChemDoodle.structures,Math,mat4);
+(function(b,e,a,h,c,d,f){a.Bond=function(q,g,o){this.a1=q;this.a2=g;this.bondOrder=o?o:1;this.stereo=a.Bond.STEREO_NONE;this.isHover=!1;this.ring=void 0;this.getCenter=function(){return new a.Point((this.a1.x+this.a2.x)/2,(this.a1.y+this.a2.y)/2)};this.getLength=function(){return this.a1.distance(this.a2)};this.getLength3D=function(){return this.a1.distance3D(this.a2)};this.contains=function(a){return a===this.a1||a===this.a2};this.getNeighbor=function(a){if(a===this.a1)return this.a2;if(a===this.a2)return this.a1};
+this.draw=function(d,f){if(!(this.a1.x===this.a2.x&&this.a1.y===this.a2.y)){this.specs&&(f=this.specs);var g=this.a1.x,q=this.a2.x,o=this.a1.y,k=this.a2.y,v=this.a1.distance(this.a2),x=q-g,t=k-o;if(this.a1.isLassoed&&this.a2.isLassoed){var y=d.createLinearGradient(g,o,q,k);y.addColorStop(0,"rgba(212, 99, 0, 0)");y.addColorStop(0.5,"rgba(212, 99, 0, 0.8)");y.addColorStop(1,"rgba(212, 99, 0, 0)");var w=2.5,u=this.a1.angle(this.a2)+c.PI/2,p=c.cos(u),u=c.sin(u),A=g-p*w,B=o+u*w,D=g+p*w,G=o-u*w,F=q+p*w,
+C=k-u*w,p=q-p*w,u=k+u*w;d.fillStyle=y;d.beginPath();d.moveTo(A,B);d.lineTo(D,G);d.lineTo(F,C);d.lineTo(p,u);d.closePath();d.fill()}if(f.atoms_display&&!f.atoms_circles_2D&&this.a1.isLabelVisible(f)){w=p=0;for(A=this.a1.textBounds.length;w<A;w++)p=Math.max(p,h.calculateDistanceInterior(this.a1,this.a2,this.a1.textBounds[w]));p+=f.bonds_atomLabelBuffer_2D;p/=v;g+=x*p;o+=t*p}if(f.atoms_display&&!f.atoms_circles_2D&&this.a2.isLabelVisible(f)){w=p=0;for(A=this.a2.textBounds.length;w<A;w++)p=Math.max(p,
+h.calculateDistanceInterior(this.a2,this.a1,this.a2.textBounds[w]));p+=f.bonds_atomLabelBuffer_2D;p/=v;q-=x*p;k-=t*p}f.bonds_clearOverlaps_2D&&(p=g+0.15*x,u=o+0.15*t,w=q-0.15*x,v=k-0.15*t,d.strokeStyle=f.backgroundColor,d.lineWidth=f.bonds_width_2D+2*f.bonds_overlapClearWidth_2D,d.lineCap="round",d.beginPath(),d.moveTo(p,u),d.lineTo(w,v),d.closePath(),d.stroke());d.strokeStyle=f.bonds_color;d.fillStyle=f.bonds_color;d.lineWidth=f.bonds_width_2D;d.lineCap=f.bonds_ends_2D;if(f.bonds_useJMOLColors||
+f.bonds_usePYMOLColors)p=d.createLinearGradient(g,o,q,k),u=b[this.a1.label].jmolColor,w=b[this.a2.label].jmolColor,f.atoms_usePYMOLColors&&(u=b[this.a1.label].pymolColor,w=b[this.a2.label].pymolColor),p.addColorStop(0,u),f.bonds_colorGradient||(p.addColorStop(0.5,u),p.addColorStop(0.51,w)),p.addColorStop(1,w),d.strokeStyle=p,d.fillStyle=p;switch(this.bondOrder){case 0.5:d.beginPath();d.moveTo(g,o);e.contextHashTo(d,g,o,q,k,f.bonds_hashSpacing_2D,f.bonds_hashSpacing_2D);d.stroke();break;case 1:if(this.stereo===
+a.Bond.STEREO_PROTRUDING||this.stereo===a.Bond.STEREO_RECESSED)t=f.bonds_width_2D/2,w=this.a1.distance(this.a2)*f.bonds_wedgeThickness_2D/2,u=this.a1.angle(this.a2)+c.PI/2,p=c.cos(u),u=c.sin(u),A=g-p*t,B=o+u*t,D=g+p*t,G=o-u*t,F=q+p*w,C=k-u*w,p=q-p*w,u=k+u*w,d.beginPath(),d.moveTo(A,B),d.lineTo(D,G),d.lineTo(F,C),d.lineTo(p,u),d.closePath(),this.stereo===a.Bond.STEREO_PROTRUDING?d.fill():(d.save(),d.clip(),d.lineWidth=2*w,d.lineCap="butt",d.beginPath(),d.moveTo(g,o),e.contextHashTo(d,g,o,q,k,f.bonds_hashWidth_2D,
+f.bonds_hashSpacing_2D),d.stroke(),d.restore());else if(this.stereo===a.Bond.STEREO_AMBIGUOUS){d.beginPath();d.moveTo(g,o);q=c.floor(c.sqrt(x*x+t*t)/f.bonds_wavyLength_2D);k=g;u=this.a1.angle(this.a2)+c.PI/2;p=c.cos(u);u=c.sin(u);g=x/q;t/=q;w=0;for(A=q;w<A;w++)k+=g,o+=t,q=f.bonds_wavyLength_2D*p+k-0.5*g,v=f.bonds_wavyLength_2D*-u+o-0.5*t,x=f.bonds_wavyLength_2D*-p+k-0.5*g,B=f.bonds_wavyLength_2D*u+o-0.5*t,0===w%2?d.quadraticCurveTo(q,v,k,o):d.quadraticCurveTo(x,B,k,o);d.stroke();break}else d.beginPath(),
+d.moveTo(g,o),d.lineTo(q,k),d.stroke();break;case 1.5:d.beginPath();d.moveTo(g,o);d.lineTo(q,k);d.stroke();break;case 2:this.stereo===a.Bond.STEREO_AMBIGUOUS?(w=this.a1.distance(this.a2)*f.bonds_saturationWidth_2D/2,u=this.a1.angle(this.a2)+c.PI/2,p=c.cos(u),u=c.sin(u),A=g-p*w,B=o+u*w,D=g+p*w,G=o-u*w,F=q+p*w,C=k-u*w,p=q-p*w,u=k+u*w,d.beginPath(),d.moveTo(A,B),d.lineTo(F,C),d.moveTo(D,G),d.lineTo(p,u),d.stroke()):!f.bonds_symmetrical_2D&&(this.ring||"C"===this.a1.label&&"C"===this.a2.label)?(d.beginPath(),
+d.moveTo(g,o),d.lineTo(q,k),x=0,v=this.a1.distance(this.a2),p=this.a1.angle(this.a2),u=p+c.PI/2,w=v*f.bonds_saturationWidth_2D,t=f.bonds_saturationAngle_2D,t<c.PI/2&&(x=-(w/c.tan(t))),c.abs(x)<v/2&&(t=g-c.cos(p)*x,g=q+c.cos(p)*x,q=o+c.sin(p)*x,o=k-c.sin(p)*x,p=c.cos(u),u=c.sin(u),A=t-p*w,B=q+u*w,D=t+p*w,G=q-u*w,F=g-p*w,C=o+u*w,p=g+p*w,u=o-u*w,!this.ring||this.ring.center.angle(this.a1)>this.ring.center.angle(this.a2)&&!(this.ring.center.angle(this.a1)-this.ring.center.angle(this.a2)>c.PI)||this.ring.center.angle(this.a1)-
+this.ring.center.angle(this.a2)<-c.PI?(d.moveTo(A,B),d.lineTo(F,C)):(d.moveTo(D,G),d.lineTo(p,u)),d.stroke())):(w=this.a1.distance(this.a2)*f.bonds_saturationWidth_2D/2,u=this.a1.angle(this.a2)+c.PI/2,p=c.cos(u),u=c.sin(u),A=g-p*w,B=o+u*w,D=g+p*w,G=o-u*w,F=q+p*w,C=k-u*w,p=q-p*w,u=k+u*w,d.beginPath(),d.moveTo(A,B),d.lineTo(p,u),d.moveTo(D,G),d.lineTo(F,C),d.stroke());break;case 3:w=this.a1.distance(this.a2)*f.bonds_saturationWidth_2D,u=this.a1.angle(this.a2)+c.PI/2,p=c.cos(u),u=c.sin(u),A=g-p*w,B=
+o+u*w,D=g+p*w,G=o-u*w,F=q+p*w,C=k-u*w,p=q-p*w,u=k+u*w,d.beginPath(),d.moveTo(A,B),d.lineTo(p,u),d.moveTo(D,G),d.lineTo(F,C),d.moveTo(g,o),d.lineTo(q,k),d.stroke()}}};this.drawDecorations=function(a){if(this.isHover||this.isSelected){var d=2*c.PI,f=(this.a1.angleForStupidCanvasArcs(this.a2)+c.PI/2)%d;a.strokeStyle=this.isHover?"#885110":"#0060B2";a.lineWidth=1.2;a.beginPath();var g=(f+c.PI)%d,g=g%(2*c.PI);a.arc(this.a1.x,this.a1.y,7,f,g,!1);a.stroke();a.beginPath();f+=c.PI;g=(f+c.PI)%d;a.arc(this.a2.x,
+this.a2.y,7,f,g,!1);a.stroke()}};this.render=function(a,g){this.specs&&(g=this.specs);var q=(g.bonds_renderAsLines_3D?1.1:1.001)*this.a1.distance3D(this.a2)/(g.bonds_useJMOLColors||g.bonds_usePYMOLColors?2:1);if(0===q)return!1;var q=[g.bonds_cylinderDiameter_3D/2,q,g.bonds_cylinderDiameter_3D/2],h=d.translate(a.modelViewMatrix,[this.a1.x,this.a1.y,this.a1.z],[]),o,k=[this.a2.x-this.a1.x,this.a2.y-this.a1.y,this.a2.z-this.a1.z];if(g.bonds_useJMOLColors||g.bonds_usePYMOLColors)f.scale(k,0.5),o=d.translate(a.modelViewMatrix,
+[this.a2.x,this.a2.y,this.a2.z],[]);var v=[0],x;if(g.bonds_showBondOrders_3D){switch(this.bondOrder){case 2:v=[-g.bonds_cylinderDiameter_3D,g.bonds_cylinderDiameter_3D];break;case 3:v=[-1.2*g.bonds_cylinderDiameter_3D,0,1.2*g.bonds_cylinderDiameter_3D]}if(1<v.length){x=[0,0,1];var t=d.inverse(a.rotationMatrix,[]);d.multiplyVec3(t,x);x=f.cross(k,x,[]);f.normalize(x)}}var y=[0,1,0],t=0;this.a1.x===this.a2.x&&this.a1.z===this.a2.z?(k=[0,0,1],this.a2.y<this.a1.y&&(t=c.PI)):(t=e.vec3AngleFrom(y,k),k=f.cross(y,
+k,[]));for(var y=0,w=v.length;y<w;y++){var u=d.set(h,[]);0!==v[y]&&d.translate(u,f.scale(x,v[y],[]));0!==t&&d.rotate(u,t,k);d.scale(u,q);var p=g.bonds_color;g.bonds_useJMOLColors?p=b[this.a1.label].jmolColor:g.bonds_usePYMOLColors&&(p=b[this.a1.label].pymolColor);a.material.setDiffuseColor(p);a.setMatrixUniforms(u);g.bonds_renderAsLines_3D?a.drawArrays(a.LINES,0,a.lineBuffer.vertexPositionBuffer.numItems):a.drawArrays(a.TRIANGLE_STRIP,0,a.cylinderBuffer.vertexPositionBuffer.numItems);if(g.bonds_useJMOLColors||
+g.bonds_usePYMOLColors)d.set(o,u),0!==v[y]&&d.translate(u,f.scale(x,v[y],[])),d.rotate(u,t+c.PI,k),d.scale(u,q),a.material.setDiffuseColor(g.bonds_usePYMOLColors?b[this.a2.label].pymolColor:b[this.a2.label].jmolColor),a.setMatrixUniforms(u),g.bonds_renderAsLines_3D?a.drawArrays(a.LINES,0,a.lineBuffer.vertexPositionBuffer.numItems):a.drawArrays(a.TRIANGLE_STRIP,0,a.cylinderBuffer.vertexPositionBuffer.numItems)}};return!0};a.Bond.STEREO_NONE="none";a.Bond.STEREO_PROTRUDING="protruding";a.Bond.STEREO_RECESSED=
+"recessed";a.Bond.STEREO_AMBIGUOUS="ambiguous"})(ChemDoodle.ELEMENT,ChemDoodle.extensions,ChemDoodle.structures,ChemDoodle.math,Math,mat4,vec3);
+(function(b,e){b.Ring=function(){this.atoms=[];this.bonds=[];this.center=void 0;this.setupBonds=function(){for(var a=0,b=this.bonds.length;a<b;a++)this.bonds[a].ring=this;this.center=this.getCenter()};this.getCenter=function(){for(var a=Infinity,h=Infinity,c=-Infinity,d=-Infinity,f=0,q=this.atoms.length;f<q;f++)a=e.min(this.atoms[f].x,a),h=e.min(this.atoms[f].y,h),c=e.max(this.atoms[f].x,c),d=e.max(this.atoms[f].y,d);return new b.Point((c+a)/2,(d+h)/2)};return!0}})(ChemDoodle.structures,Math);
+(function(b,e,a,h,c){a.Molecule=function(){this.atoms=[];this.bonds=[];this.rings=[];this.findRings=!0;this.draw=function(a,f){this.specs&&(f=this.specs);if(f.atoms_display&&!f.atoms_circles_2D)for(var c=0,g=this.atoms.length;c<g;c++)this.atoms[c].draw(a,f);if(f.bonds_display){c=0;for(g=this.bonds.length;c<g;c++)this.bonds[c].draw(a,f)}if(f.atoms_display&&f.atoms_circles_2D){c=0;for(g=this.atoms.length;c<g;c++)this.atoms[c].draw(a,f)}};this.render=function(d,f){this.specs&&(f=this.specs);var c=0<
+this.atoms.length&&void 0!==this.atoms[0].hetatm;if(c){if(f.macro_displayBonds){0<this.bonds.length&&(f.bonds_renderAsLines_3D&&!this.residueSpecs||this.residueSpecs&&this.residueSpecs.bonds_renderAsLines_3D?(d.lineWidth(this.residueSpecs?this.residueSpecs.bonds_width_2D:f.bonds_width_2D),d.lineBuffer.bindBuffers(d)):d.cylinderBuffer.bindBuffers(d),d.material.setTempColors(f.bonds_materialAmbientColor_3D,void 0,f.bonds_materialSpecularColor_3D,f.bonds_materialShininess_3D));for(var g=0,b=this.bonds.length;g<
+b;g++){var e=this.bonds[g];if(!e.a1.hetatm&&(-1===f.macro_atomToLigandDistance||void 0!==e.a1.closestDistance&&f.macro_atomToLigandDistance>=e.a1.closestDistance&&f.macro_atomToLigandDistance>=e.a2.closestDistance))e.render(d,this.residueSpecs?this.residueSpecs:f)}}if(f.macro_displayAtoms){0<this.atoms.length&&(d.sphereBuffer.bindBuffers(d),d.material.setTempColors(f.atoms_materialAmbientColor_3D,void 0,f.atoms_materialSpecularColor_3D,f.atoms_materialShininess_3D));g=0;for(b=this.atoms.length;g<
+b;g++){var j=this.atoms[g];if(!j.hetatm&&(-1===f.macro_atomToLigandDistance||void 0!==j.closestDistance&&f.macro_atomToLigandDistance>=j.closestDistance))j.render(d,this.residueSpecs?this.residueSpecs:f)}}}if(f.bonds_display){0<this.bonds.length&&(f.bonds_renderAsLines_3D?(d.lineWidth(f.bonds_width_2D),d.lineBuffer.bindBuffers(d)):d.cylinderBuffer.bindBuffers(d),d.material.setTempColors(f.bonds_materialAmbientColor_3D,void 0,f.bonds_materialSpecularColor_3D,f.bonds_materialShininess_3D));g=0;for(b=
+this.bonds.length;g<b;g++)e=this.bonds[g],(!c||e.a1.hetatm)&&e.render(d,f)}if(f.atoms_display){g=0;for(b=this.atoms.length;g<b;g++)j=this.atoms[g],j.bondNumber=0,j.renderAsStar=!1;g=0;for(b=this.bonds.length;g<b;g++)e=this.bonds[g],e.a1.bondNumber++,e.a2.bondNumber++;0<this.atoms.length&&(d.sphereBuffer.bindBuffers(d),d.material.setTempColors(f.atoms_materialAmbientColor_3D,void 0,f.atoms_materialSpecularColor_3D,f.atoms_materialShininess_3D));e=[];g=0;for(b=this.atoms.length;g<b;g++)if(j=this.atoms[g],
+!c||j.hetatm&&(f.macro_showWater||!j.isWater))f.atoms_nonBondedAsStars_3D&&0===j.bondNumber?(j.renderAsStar=!0,e.push(j)):j.render(d,f);if(0<e.length){d.starBuffer.bindBuffers(d);g=0;for(b=e.length;g<b;g++)e[g].render(d,f)}}if(this.chains){d.setMatrixUniforms(d.modelViewMatrix);if(f.proteins_displayRibbon){d.material.setTempColors(f.proteins_materialAmbientColor_3D,void 0,f.proteins_materialSpecularColor_3D,f.proteins_materialShininess_3D);c=0;for(j=this.ribbons.length;c<j;c++)if(f.proteins_useShapelyColors||
+f.proteins_useAminoColors||f.proteins_usePolarityColors){e=f.proteins_ribbonCartoonize?this.cartoons[c]:this.ribbons[c];e.front.bindBuffers(d);g=0;for(b=e.front.segments.length;g<b;g++)e.front.segments[g].render(d,f);e.back.bindBuffers(d);g=0;for(b=e.back.segments.length;g<b;g++)e.back.segments[g].render(d,f)}else if(f.proteins_ribbonCartoonize){e=this.cartoons[c];e.front.bindBuffers(d);g=0;for(b=e.front.cartoonSegments.length;g<b;g++)e.front.cartoonSegments[g].render(d,f);e.back.bindBuffers(d);g=
+0;for(b=e.back.cartoonSegments.length;g<b;g++)e.back.cartoonSegments[g].render(d,f)}else e=this.ribbons[c],e.front.render(d,f),e.back.render(d,f)}if(f.proteins_displayBackbone){if(!this.alphaCarbonTrace){this.alphaCarbonTrace={nodes:[],edges:[]};c=0;for(j=this.chains.length;c<j;c++){var l=this.chains[c];if(!(2<l.length&&h[l[2].name]&&"#BEA06E"===h[l[2].name].aminoColor)&&0<l.length){g=1;for(b=l.length-2;g<b;g++)e=l[g].cp1,e.chainColor=l.chainColor,this.alphaCarbonTrace.nodes.push(e),e=new a.Bond(l[g].cp1,
+l[g+1].cp1),e.residueName=l[g].name,e.chainColor=l.chainColor,this.alphaCarbonTrace.edges.push(e),g===l.length-3&&(e=l[g+1].cp1,e.chainColor=l.chainColor,this.alphaCarbonTrace.nodes.push(e))}}}if(0<this.alphaCarbonTrace.nodes.length){c=new a.VisualSpecifications;c.atoms_display=!0;c.bonds_display=!0;c.atoms_sphereDiameter_3D=f.proteins_backboneThickness;c.bonds_cylinderDiameter_3D=f.proteins_backboneThickness;c.bonds_useJMOLColors=!1;c.atoms_color=f.proteins_backboneColor;c.bonds_color=f.proteins_backboneColor;
+c.atoms_useVDWDiameters_3D=!1;d.material.setTempColors(f.proteins_materialAmbientColor_3D,void 0,f.proteins_materialSpecularColor_3D,f.proteins_materialShininess_3D);d.material.setDiffuseColor(f.proteins_backboneColor);g=0;for(b=this.alphaCarbonTrace.nodes.length;g<b;g++)e=this.alphaCarbonTrace.nodes[g],f.macro_colorByChain&&(c.atoms_color=e.chainColor),d.sphereBuffer.bindBuffers(d),e.render(d,c);g=0;for(b=this.alphaCarbonTrace.edges.length;g<b;g++){var j=this.alphaCarbonTrace.edges[g],n,e=h[j.residueName]?
+h[j.residueName]:h["*"];f.macro_colorByChain?n=j.chainColor:f.proteins_useShapelyColors?n=e.shapelyColor:f.proteins_useAminoColors?n=e.aminoColor:f.proteins_usePolarityColors&&(n=e.polar?"#C10000":"#FFFFFF");n&&(c.bonds_color=n);d.cylinderBuffer.bindBuffers(d);j.render(d,c)}}}if(f.nucleics_display){d.material.setTempColors(f.nucleics_materialAmbientColor_3D,void 0,f.nucleics_materialSpecularColor_3D,f.nucleics_materialShininess_3D);c=0;for(j=this.tubes.length;c<j;c++)d.setMatrixUniforms(d.modelViewMatrix),
+e=this.tubes[c],e.render(d,f)}}f.crystals_displayUnitCell&&this.unitCell&&(d.setMatrixUniforms(d.modelViewMatrix),this.unitCell.bindBuffers(d),d.material.setDiffuseColor(f.crystals_unitCellColor),d.lineWidth(f.crystals_unitCellLineWidth),d.drawElements(d.LINES,this.unitCell.vertexIndexBuffer.numItems,d.UNSIGNED_SHORT,0));this.surface&&f.surfaces_display&&(d.setMatrixUniforms(d.modelViewMatrix),this.surface.bindBuffers(d),d.material.setTempColors(f.surfaces_materialAmbientColor_3D,f.surfaces_color,
+f.surfaces_materialSpecularColor_3D,f.surfaces_materialShininess_3D),"Dot"===f.surfaces_style?d.drawArrays(d.POINTS,0,this.surface.vertexPositionBuffer.numItems):d.drawElements(d.TRIANGLES,this.surface.vertexIndexBuffer.numItems,d.UNSIGNED_SHORT,0))};this.getCenter3D=function(){if(1===this.atoms.length)return new a.Atom("C",this.atoms[0].x,this.atoms[0].y,this.atoms[0].z);var d=Infinity,f=Infinity,b=Infinity,g=-Infinity,e=-Infinity,h=-Infinity;if(this.chains)for(var j=0,l=this.chains.length;j<l;j++)for(var n=
+this.chains[j],r=0,k=n.length;r<k;r++)var v=n[r],d=c.min(v.cp1.x,d),f=c.min(v.cp1.y,f),b=c.min(v.cp1.z,b),g=c.max(v.cp1.x,g),e=c.max(v.cp1.y,e),h=c.max(v.cp1.z,h),d=c.min(v.cp2.x,d),f=c.min(v.cp2.y,f),b=c.min(v.cp2.z,b),g=c.max(v.cp2.x,g),e=c.max(v.cp2.y,e),h=c.max(v.cp2.z,h);j=0;for(l=this.atoms.length;j<l;j++)d=c.min(this.atoms[j].x,d),f=c.min(this.atoms[j].y,f),b=c.min(this.atoms[j].z,b),g=c.max(this.atoms[j].x,g),e=c.max(this.atoms[j].y,e),h=c.max(this.atoms[j].z,h);return new a.Atom("C",(g+d)/
+2,(e+f)/2,(h+b)/2)};this.getCenter=function(){if(1===this.atoms.length)return new a.Point(this.atoms[0].x,this.atoms[0].y);for(var d=Infinity,f=Infinity,b=-Infinity,g=-Infinity,e=0,h=this.atoms.length;e<h;e++)d=c.min(this.atoms[e].x,d),f=c.min(this.atoms[e].y,f),b=c.max(this.atoms[e].x,b),g=c.max(this.atoms[e].y,g);return new a.Point((b+d)/2,(g+f)/2)};this.getDimension=function(){if(1===this.atoms.length)return new a.Point(0,0);var d=Infinity,f=Infinity,b=-Infinity,g=-Infinity;if(this.chains){for(var e=
+0,h=this.chains.length;e<h;e++)for(var j=this.chains[e],l=0,n=j.length;l<n;l++)var r=j[l],d=c.min(r.cp1.x,d),f=c.min(r.cp1.y,f),b=c.max(r.cp1.x,b),g=c.max(r.cp1.y,g),d=c.min(r.cp2.x,d),f=c.min(r.cp2.y,f),b=c.max(r.cp2.x,b),g=c.max(r.cp2.y,g);d-=30;f-=30;b+=30;g+=30}e=0;for(h=this.atoms.length;e<h;e++)d=c.min(this.atoms[e].x,d),f=c.min(this.atoms[e].y,f),b=c.max(this.atoms[e].x,b),g=c.max(this.atoms[e].y,g);return new a.Point(b-d,g-f)};this.check=function(a){if(a&&this.doChecks){if(this.findRings)if(this.bonds.length-
+this.atoms.length!==this.fjNumCache){this.rings=(new b.informatics.SSSRFinder(this)).rings;for(var f=0,c=this.bonds.length;f<c;f++)this.bonds[f].ring=void 0;f=0;for(c=this.rings.length;f<c;f++)this.rings[f].setupBonds()}else{f=0;for(c=this.rings.length;f<c;f++){var g=this.rings[f];g.center=g.getCenter()}}if(this.atoms.length!==this.atomNumCache&&this.bonds.length!==this.bondNumCache){f=0;for(c=this.atoms.length;f<c;f++)if(this.atoms[f].isLone=!1,"C"===this.atoms[f].label){for(var e=g=0,h=this.bonds.length;e<
+h;e++)(this.bonds[e].a1===this.atoms[f]||this.bonds[e].a2===this.atoms[f])&&g++;0===g&&(this.atoms[f].isLone=!0)}}g=!1;f=0;for(c=this.atoms.length;f<c;f++)0!==this.atoms[f].z&&(g=!0);g&&(this.sortAtomsByZ(),this.sortBondsByZ());this.setupMetaData();this.atomNumCache=this.atoms.length;this.bondNumCache=this.bonds.length;this.fjNumCache=this.bonds.length-this.atoms.length}this.doChecks=!a};this.getAngles=function(a){for(var f=[],c=0,g=this.bonds.length;c<g;c++)this.bonds[c].contains(a)&&f.push(a.angle(this.bonds[c].getNeighbor(a)));
+f.sort();return f};this.getCoordinationNumber=function(a){for(var f=0,c=0,g=a.length;c<g;c++)f+=a[c].bondOrder;return f};this.getBonds=function(a){for(var f=[],c=0,g=this.bonds.length;c<g;c++)this.bonds[c].contains(a)&&f.push(this.bonds[c]);return f};this.sortAtomsByZ=function(){for(var a=1,f=this.atoms.length;a<f;a++)for(var c=a;0<c&&this.atoms[c].z<this.atoms[c-1].z;){var g=this.atoms[c];this.atoms[c]=this.atoms[c-1];this.atoms[c-1]=g;c--}};this.sortBondsByZ=function(){for(var a=1,c=this.bonds.length;a<
+c;a++)for(var b=a;0<b&&this.bonds[b].a1.z+this.bonds[b].a2.z<this.bonds[b-1].a1.z+this.bonds[b-1].a2.z;){var g=this.bonds[b];this.bonds[b]=this.bonds[b-1];this.bonds[b-1]=g;b--}};this.setupMetaData=function(){for(var a=this.getCenter(),f=0,e=this.atoms.length;f<e;f++){var g=this.atoms[f],h=this.getBonds(g),m=this.getAngles(g);g.isHidden=2===h.length&&c.abs(c.abs(m[1]-m[0])-c.PI)<c.PI/30&&h[0].bondOrder===h[1].bondOrder;m=b.math.angleBetweenLargest(m);g.angleOfLeastInterference=m.angle%(2*c.PI);g.largestAngle=
+m.largest;g.coordinationNumber=this.getCoordinationNumber(h);g.bondNumber=h.length;g.molCenter=a}f=0;for(e=this.bonds.length;f<e;f++)this.bonds[f].molCenter=a};this.scaleToAverageBondLength=function(a){var c=this.getAverageBondLength();if(0!==c)for(var a=a/c,c=0,b=this.atoms.length;c<b;c++)this.atoms[c].x*=a,this.atoms[c].y*=a};this.getAverageBondLength=function(){if(0===this.bonds.length)return 0;for(var a=0,c=0,b=this.bonds.length;c<b;c++)a+=this.bonds[c].getLength();return a/=this.bonds.length};
+this.getBounds=function(){for(var a=new e.Bounds,c=0,b=this.atoms.length;c<b;c++)a.expand(this.atoms[c].getBounds());if(this.chains){c=0;for(b=this.chains.length;c<b;c++)for(var g=this.chains[c],h=0,m=g.length;h<m;h++){var j=g[h];a.expand(j.cp1.x,j.cp1.y);a.expand(j.cp2.x,j.cp2.y)}a.minX-=30;a.minY-=30;a.maxX+=30;a.maxY+=30}return a};return!0}})(ChemDoodle,ChemDoodle.math,ChemDoodle.structures,ChemDoodle.RESIDUE,Math);
+(function(b,e,a,h){var c,d=-1;b.Residue=function(f){this.resSeq=f;this.setup=function(a,d){this.horizontalResolution=d;var c=[a.x-this.cp1.x,a.y-this.cp1.y,a.z-this.cp1.z],f=h.cross(c,[this.cp2.x-this.cp1.x,this.cp2.y-this.cp1.y,this.cp2.z-this.cp1.z],[]);this.D=h.cross(f,c,[]);h.normalize(f);h.normalize(this.D);this.guidePointsSmall=[];this.guidePointsLarge=[];c=[(a.x+this.cp1.x)/2,(a.y+this.cp1.y)/2,(a.z+this.cp1.z)/2];this.helix&&(h.scale(f,1.5),h.add(c,f));this.guidePointsSmall[0]=new b.Atom("",
+c[0]-this.D[0]/2,c[1]-this.D[1]/2,c[2]-this.D[2]/2);for(f=1;f<d;f++)this.guidePointsSmall[f]=new b.Atom("",this.guidePointsSmall[0].x+this.D[0]*f/d,this.guidePointsSmall[0].y+this.D[1]*f/d,this.guidePointsSmall[0].z+this.D[2]*f/d);h.scale(this.D,4);this.guidePointsLarge[0]=new b.Atom("",c[0]-this.D[0]/2,c[1]-this.D[1]/2,c[2]-this.D[2]/2);for(f=1;f<d;f++)this.guidePointsLarge[f]=new b.Atom("",this.guidePointsLarge[0].x+this.D[0]*f/d,this.guidePointsLarge[0].y+this.D[1]*f/d,this.guidePointsLarge[0].z+
+this.D[2]*f/d)};this.getGuidePointSet=function(a){if(0===a)return this.helix||this.sheet?this.guidePointsLarge:this.guidePointsSmall;if(1===a)return this.guidePointsSmall;if(2===a)return this.guidePointsLarge};this.computeLineSegments=function(f,g,b,e,h){if(h!==d){var l=h*h,n=h*h*h;c=a.multiply([-1/6,0.5,-0.5,1/6,0.5,-1,0.5,0,-0.5,0,0.5,0,1/6,2/3,1/6,0],[6/n,0,0,0,6/n,2/l,0,0,1/n,1/l,1/h,0,0,0,0,1],[]);d=h}this.split=g.helix!==this.helix||g.sheet!==this.sheet;this.lineSegments=this.innerCompute(0,
+f,g,b,!1,h);e&&(this.lineSegmentsCartoon=this.innerCompute(g.helix||g.sheet?2:1,f,g,b,!0,h))};this.innerCompute=function(d,f,o,m,j,l){for(var n=[],r=this.getGuidePointSet(d),f=f.getGuidePointSet(d),o=o.getGuidePointSet(d),k=m.getGuidePointSet(d),v=0,x=this.guidePointsLarge.length;v<x;v++){for(var t=a.multiply([f[v].x,f[v].y,f[v].z,1,r[v].x,r[v].y,r[v].z,1,o[v].x,o[v].y,o[v].z,1,k[v].x,k[v].y,k[v].z,1],c,[]),y=[],w=0;w<l;w++){for(d=3;0<d;d--)for(m=0;4>m;m++)t[4*d+m]+=t[4*(d-1)+m];y[w]=new b.Atom("",
+t[12]/t[15],t[13]/t[15],t[14]/t[15])}n[v]=y}if(j&&this.arrow)for(d=0;d<l;d++){j=1.5-1.3*d/l;r=e.floor(this.horizontalResolution/2);f=n[r];m=0;for(o=n.length;m<o;m++)m!==r&&(k=f[d],v=n[m][d],x=[v.x-k.x,v.y-k.y,v.z-k.z],h.scale(x,j),v.x=k.x+x[0],v.y=k.y+x[1],v.z=k.z+x[2])}return n}}})(ChemDoodle.structures,Math,mat4,vec3);
+(function(b,e,a,h,c){e.Spectrum=function(){this.data=[];this.metadata=[];this.dataDisplay=[];this.yUnit=this.xUnit=this.title=void 0;this.continuous=!0;this.integrationSensitivity=0.01;this.memory={offsetTop:0,offsetLeft:0,offsetBottom:0,flipXAxis:!1,scale:1,width:0,height:0};this.draw=function(a,f,e,g){this.specs&&(f=this.specs);var o=5,m=0,j=0;a.fillStyle=f.text_color;a.textAlign="center";a.textBaseline="alphabetic";a.font=f.getFontString(f.text_font_size,f.text_font_families);this.xUnit&&(j+=f.text_font_size,
+a.fillText(this.xUnit,e/2,g-2));this.yUnit&&f.plots_showYAxis&&(m+=f.text_font_size,a.save(),a.translate(f.text_font_size,g/2),a.rotate(-c.PI/2),a.fillText(this.yUnit,0,0),a.restore());this.title&&(o+=f.text_font_size,a.fillText(this.title,e/2,f.text_font_size));j+=5+f.text_font_size;f.plots_showYAxis&&(m+=5+a.measureText("1000").width);f.plots_showGrid&&(a.strokeStyle=f.plots_gridColor,a.lineWidth=f.plots_gridLineWidth,a.strokeRect(m,o,e-m,g-j-o));a.textAlign="center";a.textBaseline="top";for(var l=
+this.maxX-this.minX,n=l/100,r=0.001;r<n||25<l/r;)r*=10;for(var k=0,v=f.plots_flipXAxis?e:0,l=c.round(this.minX/r)*r;l<=this.maxX;l+=r/2){var x=this.getTransformedX(l,f,e,m);if(x>m)if(a.strokeStyle="black",a.lineWidth=1,0===k%2){a.beginPath();a.moveTo(x,g-j);a.lineTo(x,g-j+2);a.stroke();for(n=l.toFixed(5);"0"===n.charAt(n.length-1);)n=n.substring(0,n.length-1);"."===n.charAt(n.length-1)&&(n=n.substring(0,n.length-1));var t=a.measureText(n).width;f.plots_flipXAxis&&(t*=-1);var y=x-t/2;if(f.plots_flipXAxis?
+y<v:y>v)a.fillText(n,x,g-j+2),v=x+t/2;f.plots_showGrid&&(a.strokeStyle=f.plots_gridColor,a.lineWidth=f.plots_gridLineWidth,a.beginPath(),a.moveTo(x,g-j),a.lineTo(x,o),a.stroke())}else a.beginPath(),a.moveTo(x,g-j),a.lineTo(x,g-j+2),a.stroke();k++}if(f.plots_showYAxis||f.plots_showGrid){r=1/f.scale;a.textAlign="right";a.textBaseline="middle";for(l=0;10>=l;l++)if(n=r/10*l,k=o+(g-j-o)*(1-n*f.scale),f.plots_showGrid&&(a.strokeStyle=f.plots_gridColor,a.lineWidth=f.plots_gridLineWidth,a.beginPath(),a.moveTo(m,
+k),a.lineTo(e,k),a.stroke()),f.plots_showYAxis){a.strokeStyle="black";a.lineWidth=1;a.beginPath();a.moveTo(m,k);a.lineTo(m-3,k);a.stroke();n*=100;v=c.max(0,3-c.floor(n).toString().length);n=n.toFixed(v);if(0<v)for(;"0"===n.charAt(n.length-1);)n=n.substring(0,n.length-1);"."===n.charAt(n.length-1)&&(n=n.substring(0,n.length-1));a.fillText(n,m-3,k)}}a.strokeStyle="black";a.lineWidth=1;a.beginPath();a.moveTo(e,g-j);a.lineTo(m,g-j);f.plots_showYAxis&&a.lineTo(m,o);a.stroke();if(0<this.dataDisplay.length){a.textAlign=
+"left";a.textBaseline="top";l=n=0;for(r=this.dataDisplay.length;l<r;l++)if(this.dataDisplay[l].value)a.fillText([this.dataDisplay[l].display,": ",this.dataDisplay[l].value].join(""),m+10,o+10+n*(f.text_font_size+5)),n++;else if(this.dataDisplay[l].tag){k=0;for(v=this.metadata.length;k<v;k++)if(b.stringStartsWith(this.metadata[k],this.dataDisplay[l].tag)){v=this.metadata[k];this.dataDisplay[l].display&&(v=h.inArray("=",this.metadata[k]),v=[this.dataDisplay[l].display,": ",-1<v?this.metadata[k].substring(v+
+2):this.metadata[k]].join(""));a.fillText(v,m+10,o+10+n*(f.text_font_size+5));n++;break}}}this.drawPlot(a,f,e,g,o,m,j);this.memory.offsetTop=o;this.memory.offsetLeft=m;this.memory.offsetBottom=j;this.memory.flipXAxis=f.plots_flipXAxis;this.memory.scale=f.scale;this.memory.width=e;this.memory.height=g};this.drawPlot=function(a,f,b,g,h,m,j){this.specs&&(f=this.specs);a.strokeStyle=f.plots_color;a.lineWidth=f.plots_width;var l=[];a.beginPath();if(this.continuous)for(var n=!1,r=0,k=0,v=this.data.length;k<
+v;k++){var x=this.getTransformedX(this.data[k].x,f,b,m);if(x>=m&&x<b){var t=this.getTransformedY(this.data[k].y,f,g,j,h);f.plots_showIntegration&&c.abs(this.data[k].y)>this.integrationSensitivity&&l.push(new e.Point(this.data[k].x,this.data[k].y));n||(a.moveTo(x,t),n=!0);a.lineTo(x,t);r++;0===r%1E3&&(a.stroke(),a.beginPath(),a.moveTo(x,t))}else if(n)break}else{k=0;for(v=this.data.length;k<v;k++)x=this.getTransformedX(this.data[k].x,f,b,m),x>=m&&x<b&&(a.moveTo(x,g-j),a.lineTo(x,this.getTransformedY(this.data[k].y,
+f,g,j,h)))}a.stroke();if(f.plots_showIntegration&&1<l.length){a.strokeStyle=f.plots_integrationColor;a.lineWidth=f.plots_integrationLineWidth;a.beginPath();k=l[1].x>l[0].x;if(this.flipXAxis&&!k||!this.flipXAxis&&k){for(k=l.length-2;0<=k;k--)l[k].y+=l[k+1].y;n=l[0].y}else{k=1;for(v=l.length;k<v;k++)l[k].y+=l[k-1].y;n=l[l.length-1].y}k=0;for(v=l.length;k<v;k++)x=this.getTransformedX(l[k].x,f,b,m),t=this.getTransformedY(l[k].y/f.scale/n,f,g,j,h),0===k?a.moveTo(x,t):a.lineTo(x,t);a.stroke()}};this.getTransformedY=
+function(a,c,b,g,e){return e+(b-g-e)*(1-a*c.scale)};this.getInverseTransformedY=function(a){return 100*((1-(a-this.memory.offsetTop)/(this.memory.height-this.memory.offsetBottom-this.memory.offsetTop))/this.memory.scale)};this.getTransformedX=function(a,c,b,g){a=g+(a-this.minX)/(this.maxX-this.minX)*(b-g);c.plots_flipXAxis&&(a=b+g-a);return a};this.getInverseTransformedX=function(a){this.memory.flipXAxis&&(a=this.memory.width+this.memory.offsetLeft-a);return(a-this.memory.offsetLeft)*(this.maxX-this.minX)/
+(this.memory.width-this.memory.offsetLeft)+this.minX};this.setup=function(){for(var a=Number.MAX_VALUE,f=Number.MIN_VALUE,b=Number.MIN_VALUE,g=0,e=this.data.length;g<e;g++)a=c.min(a,this.data[g].x),f=c.max(f,this.data[g].x),b=c.max(b,this.data[g].y);this.continuous?(this.minX=a,this.maxX=f):(this.minX=a-1,this.maxX=f+1);g=0;for(e=this.data.length;g<e;g++)this.data[g].y/=b};this.zoom=function(d,f,b,g){d=this.getInverseTransformedX(d);f=this.getInverseTransformedX(f);this.minX=c.min(d,f);this.maxX=
+c.max(d,f);if(g){g=Number.MIN_VALUE;f=0;for(d=this.data.length;f<d;f++)a.isBetween(this.data[f].x,this.minX,this.maxX)&&(g=c.max(g,this.data[f].y));return 1/g}};this.translate=function(a,c){var b=a/(c-this.memory.offsetLeft)*(this.maxX-this.minX)*(this.memory.flipXAxis?1:-1);this.minX+=b;this.maxX+=b};this.alertMetadata=function(){alert(this.metadata.join("\n"))};this.getInternalCoordinates=function(a,c){return new ChemDoodle.structures.Point(this.getInverseTransformedX(a),this.getInverseTransformedY(c))};
+this.getClosestPlotInternalCoordinates=function(c){var f=this.getInverseTransformedX(c-1),c=this.getInverseTransformedX(c+1);if(f>c)var b=f,f=c,c=b;for(var b=-1,g=-Infinity,e=!1,h=0,j=this.data.length;h<j;h++){var l=this.data[h];if(a.isBetween(l.x,f,c))l.y>g&&(e=!0,g=l.y,b=h);else if(e)break}if(-1!==b)return l=this.data[b],new ChemDoodle.structures.Point(l.x,100*l.y)};this.getClosestPeakInternalCoordinates=function(a){for(var f=this.getInverseTransformedX(a),a=0,b=Infinity,g=0,e=this.data.length;g<
+e;g++){var h=c.abs(this.data[g].x-f);if(h<=b)b=h,a=g;else break}f=highestRight=a;b=maxRight=this.data[a].y;g=a+1;for(e=this.data.length;g<e;g++)if(this.data[g].y+0.05>maxRight)maxRight=this.data[g].y,highestRight=g;else break;for(g=a-1;0<=g;g--)if(this.data[g].y+0.05>b)b=this.data[g].y,f=g;else break;a=this.data[f-a>highestRight-a?highestRight:f];return new ChemDoodle.structures.Point(a.x,100*a.y)};return!0}})(ChemDoodle.extensions,ChemDoodle.structures,ChemDoodle.math,jQuery,Math);
+(function(b,e,a){e._Shape=function(){return!0};e._Shape.prototype.drawDecorations=function(a,c){if(this.isHover)for(var b=this.getPoints(),f=0,e=b.length;f<e;f++){var g=b[f];this.drawAnchor(a,c,g,g===this.hoverPoint)}};e._Shape.prototype.getBounds=function(){for(var a=new b.Bounds,c=this.getPoints(),d=0,f=c.length;d<f;d++){var e=c[d];a.expand(e.x,e.y)}return a};e._Shape.prototype.drawAnchor=function(b,c,d,f){b.save();b.translate(d.x,d.y);b.rotate(a.PI/4);b.scale(1/c.scale,1/c.scale);b.beginPath();
+b.moveTo(-4,-4);b.lineTo(4,-4);b.lineTo(4,4);b.lineTo(-4,4);b.closePath();b.fillStyle=f?"#885110":"white";b.fill();b.beginPath();b.moveTo(-4,-2);b.lineTo(-4,-4);b.lineTo(-2,-4);b.moveTo(2,-4);b.lineTo(4,-4);b.lineTo(4,-2);b.moveTo(4,2);b.lineTo(4,4);b.lineTo(2,4);b.moveTo(-2,4);b.lineTo(-4,4);b.lineTo(-4,2);b.moveTo(-4,-2);b.strokeStyle="rgba(0,0,0,.2)";b.lineWidth=5;b.stroke();b.strokeStyle="blue";b.lineWidth=1;b.stroke();b.restore()}})(ChemDoodle.math,ChemDoodle.structures.d2,Math);
+(function(b,e,a,h){a.Line=function(c,d){this.p1=c?c:new e.Point;this.p2=d?d:new e.Point;this.arrowType=void 0;this.draw=function(c,b){if(this.isLassoed){var g=c.createLinearGradient(this.p1.x,this.p1.y,this.p2.x,this.p2.y);g.addColorStop(0,"rgba(212, 99, 0, 0)");g.addColorStop(0.5,"rgba(212, 99, 0, 0.8)");g.addColorStop(1,"rgba(212, 99, 0, 0)");var d=2.5,e=this.p1.angle(this.p2)+h.PI/2,j=h.cos(e),e=h.sin(e),l=this.p1.x-j*d,n=this.p1.y+e*d,r=this.p1.x+j*d,k=this.p1.y-e*d,v=this.p2.x+j*d,x=this.p2.y-
+e*d,t=this.p2.x-j*d,y=this.p2.y+e*d;c.fillStyle=g;c.beginPath();c.moveTo(l,n);c.lineTo(r,k);c.lineTo(v,x);c.lineTo(t,y);c.closePath();c.fill()}c.strokeStyle=b.shapes_color;c.fillStyle=b.shapes_color;c.lineWidth=b.shapes_lineWidth_2D;c.lineJoin="miter";if(this.arrowType===a.Line.ARROW_RETROSYNTHETIC){var g=2*h.sqrt(2),d=b.shapes_arrowLength_2D/g,j=this.p1.angle(this.p2),e=j+h.PI/2,g=b.shapes_arrowLength_2D/g,w=h.cos(j),u=h.sin(j),j=h.cos(e),e=h.sin(e),l=this.p1.x-j*d,n=this.p1.y+e*d,r=this.p1.x+j*
+d,k=this.p1.y-e*d,v=this.p2.x+j*d-w*g,x=this.p2.y-e*d+u*g,t=this.p2.x-j*d-w*g,y=this.p2.y+e*d+u*g,p=this.p2.x+2*j*d-2*w*g,A=this.p2.y-2*e*d+2*u*g,j=this.p2.x-2*j*d-2*w*g,d=this.p2.y+2*e*d+2*u*g;c.beginPath();c.moveTo(r,k);c.lineTo(v,x);c.moveTo(p,A);c.lineTo(this.p2.x,this.p2.y);c.lineTo(j,d);c.moveTo(t,y);c.lineTo(l,n);c.stroke()}else if(this.p1.x!==this.p2.x||this.p1.y!==this.p2.y)this.arrowType===a.Line.ARROW_SYNTHETIC?(j=this.p1.angle(this.p2),e=j+h.PI/2,g=2*b.shapes_arrowLength_2D/h.sqrt(3),
+w=h.cos(j),u=h.sin(j),j=h.cos(e),e=h.sin(e),c.beginPath(),c.moveTo(this.p1.x,this.p1.y),c.lineTo(this.p2.x-w*g/2,this.p2.y+u*g/2),c.stroke(),l=this.p2.x-0.8*w*g,n=this.p2.y+0.8*u*g,p=this.p2.x+j*b.shapes_arrowLength_2D/3-w*g,A=this.p2.y-e*b.shapes_arrowLength_2D/3+u*g,j=this.p2.x-j*b.shapes_arrowLength_2D/3-w*g,d=this.p2.y+e*b.shapes_arrowLength_2D/3+u*g,c.beginPath(),c.moveTo(this.p2.x,this.p2.y),c.lineTo(j,d),c.lineTo(l,n),c.lineTo(p,A),c.closePath(),c.fill()):(c.beginPath(),c.moveTo(this.p1.x,
+this.p1.y),c.lineTo(this.p2.x,this.p2.y)),c.stroke()};this.getPoints=function(){return[this.p1,this.p2]};this.isOver=function(a,c){var g=b.distanceFromPointToLineInclusive(a,this.p1,this.p2);return-1!==g&&g<c};return!0};a.Line.prototype=new a._Shape;a.Line.ARROW_SYNTHETIC="synthetic";a.Line.ARROW_RETROSYNTHETIC="retrosynthetic"})(ChemDoodle.math,ChemDoodle.structures,ChemDoodle.structures.d2,Math);
+(function(b,e,a,h){a.Pusher=function(a,b,f){this.o1=a;this.o2=b;this.numElectron=f?f:1;this.draw=function(a,c){if(this.o1&&this.o2){a.strokeStyle=c.shapes_color;a.fillStyle=c.shapes_color;a.lineWidth=c.shapes_lineWidth_2D;a.lineJoin="miter";var b=this.o1 instanceof e.Atom?new e.Point(this.o1.x,this.o1.y):this.o1.getCenter(),d=this.o2 instanceof e.Atom?new e.Point(this.o2.x,this.o2.y):this.o2.getCenter(),f=h.max(50,b.distance(d)),l;if(this.o1.molCenter)if(this.o1 instanceof e.Atom){var n=this.o1.molCenter.angle(b);
+l=new e.Point(b.x+f*h.cos(n),b.y-f*h.sin(n))}else{var n=this.o1.a1.angle(this.o1.a2),r=n+h.PI/2,n=r+h.PI,r=new e.Point(b.x+f*h.cos(r),b.y-f*h.sin(r)),n=new e.Point(b.x+f*h.cos(n),b.y-f*h.sin(n));l=r.distance(this.o1.molCenter)>n.distance(this.o1.molCenter)?r:n}else l=b;this.o2.molCenter?this.o2 instanceof e.Atom?(n=this.o2.molCenter.angle(d),n=new e.Point(d.x+f*h.cos(n),d.y-f*h.sin(n))):(n=this.o2.a1.angle(this.o2.a2),r=n+h.PI/2,n=r+h.PI,r=new e.Point(d.x+f*h.cos(r),d.y-f*h.sin(r)),n=new e.Point(d.x+
+f*h.cos(n),d.y-f*h.sin(n)),n=r.distance(this.o2.molCenter)>n.distance(this.o2.molCenter)?r:n):n=d;for(var r=l.angle(b),k=n.angle(d),v=h.max(r,k)-h.min(r,k);v+0.001>=h.PI;)v-=h.PI;0.001>v&&(r+=h.PI/6,k+=h.PI/6,l.x=b.x+f*h.cos(r+h.PI),l.y=b.y-f*h.sin(r+h.PI),n.x=d.x+f*h.cos(k+h.PI),n.y=d.y-f*h.sin(k+h.PI));v=r+h.PI/2;f=h.cos(r);r=h.sin(r);if(c.pusher_showElectron_2D){var x=5;if(this.o1 instanceof e.Atom&&this.o1.isLabelVisible(c)||1<this.o1.bondOrder)x=8;b.x-=f*x;b.y+=r*x;2===this.numElectron?(x=Math.cos(v)*
+c.atoms_lonePairSpread_2D/2,v=-Math.sin(v)*c.atoms_lonePairSpread_2D/2,a.beginPath(),a.arc(b.x+x,b.y+v,c.atoms_lonePairDiameter_2D,0,2*h.PI,!1),a.fill(),a.beginPath(),a.arc(b.x-x,b.y-v,c.atoms_lonePairDiameter_2D,0,2*h.PI,!1)):(a.beginPath(),a.arc(b.x,b.y,c.atoms_lonePairDiameter_2D,0,2*h.PI,!1));a.fill()}b.x-=5*f;b.y+=5*r;var v=k+h.PI/2,t=2*c.shapes_arrowLength_2D/h.sqrt(3),f=h.cos(k),r=h.sin(k),y=h.cos(v),w=h.sin(v);d.x-=5*f;d.y+=5*r;k=new e.Point(d.x,d.y);d.x-=0.8*f*t;d.y+=0.8*r*t;var v=k.x-0.8*
+f*t,x=k.y+0.8*r*t,u=new e.Point(k.x+y*c.shapes_arrowLength_2D/3-f*t,k.y-w*c.shapes_arrowLength_2D/3+r*t),f=new e.Point(k.x-y*c.shapes_arrowLength_2D/3-f*t,k.y+w*c.shapes_arrowLength_2D/3+r*t),t=r=!0;1===this.numElectron&&(u.distance(l)>f.distance(l)?t=!1:r=!1);a.beginPath();a.moveTo(k.x,k.y);t&&a.lineTo(f.x,f.y);a.lineTo(v,x);r&&a.lineTo(u.x,u.y);a.closePath();a.fill();a.stroke();a.beginPath();a.moveTo(b.x,b.y);a.bezierCurveTo(l.x,l.y,n.x,n.y,d.x,d.y);a.stroke()}};this.getPoints=function(){return[]};
+this.isOver=function(){return!1};return!0};a.Pusher.prototype=new a._Shape})(ChemDoodle.math,ChemDoodle.structures,ChemDoodle.structures.d2,Math);
+(function(b){b._Mesh=function(){return!0};b._Mesh.prototype.storeData=function(b,a,h){this.positionData=b;this.normalData=a;this.indexData=h};b._Mesh.prototype.setupBuffers=function(b){this.vertexPositionBuffer=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,this.vertexPositionBuffer);b.bufferData(b.ARRAY_BUFFER,new Float32Array(this.positionData),b.STATIC_DRAW);this.vertexPositionBuffer.itemSize=3;this.vertexPositionBuffer.numItems=this.positionData.length/3;this.vertexNormalBuffer=b.createBuffer();
+b.bindBuffer(b.ARRAY_BUFFER,this.vertexNormalBuffer);b.bufferData(b.ARRAY_BUFFER,new Float32Array(this.normalData),b.STATIC_DRAW);this.vertexNormalBuffer.itemSize=3;this.vertexNormalBuffer.numItems=this.normalData.length/3;this.indexData&&(this.vertexIndexBuffer=b.createBuffer(),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.vertexIndexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.indexData),b.STATIC_DRAW),this.vertexIndexBuffer.itemSize=1,this.vertexIndexBuffer.numItems=this.indexData.length);
+if(this.partitions)for(var a=0,h=this.partitions.length;a<h;a++){var c=this.partitions[a],d=this.generateBuffers(b,c.positionData,c.normalData,c.indexData);c.vertexPositionBuffer=d[0];c.vertexNormalBuffer=d[1];c.vertexIndexBuffer=d[2]}};b._Mesh.prototype.generateBuffers=function(b,a,h,c){var d=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,d);b.bufferData(b.ARRAY_BUFFER,new Float32Array(a),b.STATIC_DRAW);d.itemSize=3;d.numItems=a.length/3;a=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,a);b.bufferData(b.ARRAY_BUFFER,
+new Float32Array(h),b.STATIC_DRAW);a.itemSize=3;a.numItems=h.length/3;var f;c&&(f=b.createBuffer(),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f),b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(c),b.STATIC_DRAW),f.itemSize=1,f.numItems=c.length);return[d,a,f]};b._Mesh.prototype.bindBuffers=function(b){this.vertexPositionBuffer||this.setupBuffers(b);b.bindBuffer(b.ARRAY_BUFFER,this.vertexPositionBuffer);b.vertexAttribPointer(b.shader.vertexPositionAttribute,this.vertexPositionBuffer.itemSize,b.FLOAT,!1,
+0,0);b.bindBuffer(b.ARRAY_BUFFER,this.vertexNormalBuffer);b.vertexAttribPointer(b.shader.vertexNormalAttribute,this.vertexNormalBuffer.itemSize,b.FLOAT,!1,0,0);this.vertexIndexBuffer&&b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.vertexIndexBuffer)}})(ChemDoodle.structures.d3,Math);
+(function(b,e){b.Cylinder=function(a,b,c){for(var d=[],f=[],q=0;q<c;q++){var g=2*q*e.PI/c,o=e.cos(g),g=e.sin(g);f.push(o,0,g);d.push(a*o,0,a*g);f.push(o,0,g);d.push(a*o,b,a*g)}f.push(1,0,0);d.push(a,0,0);f.push(1,0,0);d.push(a,b,0);this.storeData(d,f);return!0};b.Cylinder.prototype=new b._Mesh})(ChemDoodle.structures.d3,Math);
+(function(b,e){b.Sphere=function(a,b,c){for(var d=[],f=[],q=0;q<=b;q++)for(var g=q*e.PI/b,o=e.sin(g),m=e.cos(g),g=0;g<=c;g++){var j=2*g*e.PI/c,l=e.sin(j),j=e.cos(j)*o,n=m,l=l*o;f.push(j,n,l);d.push(a*j,a*n,a*l)}a=[];c+=1;for(q=0;q<b;q++)for(g=0;g<c;g++)o=q*c+g%c,m=o+c,a.push(o),a.push(m),a.push(o+1),g<c-1&&(a.push(m),a.push(m+1),a.push(o+1));this.storeData(d,f,a);return!0};b.Sphere.prototype=new b._Mesh})(ChemDoodle.structures.d3,Math);
+(function(b,e,a,h){function c(a,c,g,e){this.name=c;this.entire=a;this.pi=e;this.getColor=function(c){return c.macro_colorByChain?this.chainColor:this.name?this.getResidueColor(b[this.name]?this.name:"*",c):this.helix?a.front?c.proteins_ribbonCartoonHelixPrimaryColor:c.proteins_ribbonCartoonHelixSecondaryColor:this.sheet?c.proteins_ribbonCartoonSheetColor:a.front?c.proteins_primaryColor:c.proteins_secondaryColor};this.getResidueColor=function(a,c){var d=b[a];return c.proteins_useShapelyColors?d.shapelyColor:
+c.proteins_useAminoColors?d.aminoColor:c.proteins_usePolarityColors&&d.polar?"#C10000":"#FFFFFF"};this.render=function(a,c){this.entire.partitions&&this.pi!==this.entire.partitions.lastRender&&(d(a,this.entire.partitions[this.pi]),this.entire.partitions.lastRender=this.pi);this.vertexIndexBuffer||(this.vertexIndexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.vertexIndexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array(g),a.STATIC_DRAW),this.vertexIndexBuffer.itemSize=
+1,this.vertexIndexBuffer.numItems=g.length);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.vertexIndexBuffer);a.material.setDiffuseColor(this.getColor(c));a.drawElements(a.TRIANGLES,this.vertexIndexBuffer.numItems,a.UNSIGNED_SHORT,0)}}var d=function(a,c){a.bindBuffer(a.ARRAY_BUFFER,c.vertexPositionBuffer);a.vertexAttribPointer(a.shader.vertexPositionAttribute,c.vertexPositionBuffer.itemSize,a.FLOAT,!1,0,0);a.bindBuffer(a.ARRAY_BUFFER,c.vertexNormalBuffer);a.vertexAttribPointer(a.shader.vertexNormalAttribute,
+c.vertexNormalBuffer.itemSize,a.FLOAT,!1,0,0);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c.vertexIndexBuffer)};e.Ribbon=function(b,e,g){var o=b[0].lineSegments.length,m=b[0].lineSegments[0].length;this.partitions=[];this.partitions.lastRender=0;var j;this.front=0<e;for(var l=0,n=b.length-1;l<n;l++){if(!j||65E3<j.positionData.length)0<this.partitions.length&&l--,j={count:0,positionData:[],normalData:[],indexData:[]},this.partitions.push(j);var r=b[l];j.count++;for(var k=0;k<o;k++)for(var v=g?r.lineSegmentsCartoon[k]:
+r.lineSegments[k],x=0===k,t=!1,y=0;y<m;y++){var w=v[y],u=l,p=y+1;l===b.length-2&&y===m-1?p--:y===m-1&&(u++,p=0);var p=g?b[u].lineSegmentsCartoon[k][p]:b[u].lineSegments[k][p],u=!1,A=k+1;k===o-1&&(A-=2,u=!0);var A=g?r.lineSegmentsCartoon[A][y]:r.lineSegments[A][y],p=[p.x-w.x,p.y-w.y,p.z-w.z],A=[A.x-w.x,A.y-w.y,A.z-w.z],B=h.cross(p,A,[]);0===y&&(h.normalize(p),h.scale(p,-1),j.normalData.push(p[0],p[1],p[2]),j.positionData.push(w.x,w.y,w.z));x||t?(h.normalize(A),h.scale(A,-1),j.normalData.push(A[0],
+A[1],A[2]),j.positionData.push(w.x,w.y,w.z),x&&y===m-1&&(x=!1,y=-1)):(h.normalize(B),(u&&!this.front||!u&&this.front)&&h.scale(B,-1),j.normalData.push(B[0],B[1],B[2]),h.scale(B,a.abs(e)),j.positionData.push(w.x+B[0],w.y+B[1],w.z+B[2]),k===o-1&&y===m-1&&(t=!0,y=-1));if(-1===y||y===m-1)h.normalize(p),j.normalData.push(p[0],p[1],p[2]),j.positionData.push(w.x,w.y,w.z)}}o+=2;m+=2;g&&(this.cartoonSegments=[]);this.segments=[];e=0;for(r=this.partitions.length;e<r;e++){j=this.partitions[e];var D;g&&(D=[]);
+l=0;for(n=j.count-1;l<n;l++){v=l;for(k=0;k<e;k++)v+=this.partitions[k].count-1;k=b[v];0<l&&g&&k.split&&(y=new c(this,void 0,D,e),k.helix&&(y.helix=!0),k.sheet&&(y.sheet=!0),this.cartoonSegments.push(y),D=[]);x=l*o*m;t=[];k=0;for(w=o-1;k<w;k++){u=x+k*m;for(y=0;y<m;y++){p=1;l===j.count-1?p=0:y===m-1&&(p=o*m-y);p=[u+y,u+m+y,u+m+y+p,u+y,u+y+p,u+m+y+p];if(y!==m-1)for(A=0;6>A;A++)t.push(p[A]);y===m-2&&l<j.count-1&&(A=o*m-y,p[2]+=A,p[4]+=A,p[5]+=A);for(A=0;6>A;A++)j.indexData.push(p[A]);if(g)for(A=0;6>A;A++)D.push(p[A])}}this.segments.push(new c(this,
+b[v+1].name,t,e))}if(g){y=new c(this,void 0,D,e);v=j.count-1;for(k=0;k<e;k++)v+=this.partitions[k].count-1;k=b[v];k.helix&&(y.helix=!0);k.sheet&&(y.sheet=!0);this.cartoonSegments.push(y)}}this.storeData(this.partitions[0].positionData,this.partitions[0].normalData,this.partitions[0].indexData);1===this.partitions.length&&(this.partitions=void 0);this.render=function(a,c){this.bindBuffers(a);var b=c.macro_colorByChain?this.chainColor:void 0;b||(b=this.front?c.proteins_primaryColor:c.proteins_secondaryColor);
+a.material.setDiffuseColor(b);a.drawElements(a.TRIANGLES,this.vertexIndexBuffer.numItems,a.UNSIGNED_SHORT,0);if(this.partitions)for(var b=1,f=this.partitions.length;b<f;b++){var g=this.partitions[b];d(a,g);a.drawElements(a.TRIANGLES,g.vertexIndexBuffer.numItems,a.UNSIGNED_SHORT,0)}};return!0};e.Ribbon.prototype=new e._Mesh})(ChemDoodle.RESIDUE,ChemDoodle.structures.d3,Math,vec3);
+(function(b,e,a){e.Light=function(e,c,d){this.diffuseRGB=b.getRGB(e,1);this.specularRGB=b.getRGB(c,1);this.direction=d;this.lightScene=function(c){c.uniform3f(c.getUniformLocation(c.program,"u_light.diffuse_color"),this.diffuseRGB[0],this.diffuseRGB[1],this.diffuseRGB[2]);c.uniform3f(c.getUniformLocation(c.program,"u_light.specular_color"),this.specularRGB[0],this.specularRGB[1],this.specularRGB[2]);var b=a.create(this.direction);a.normalize(b);a.negate(b);c.uniform3f(c.getUniformLocation(c.program,
+"u_light.direction"),b[0],b[1],b[2]);var d=[0,0,0],b=[d[0]+b[0],d[1]+b[1],d[2]+b[2]],d=a.length(b);0===d?b=[0,0,1]:a.scale(1/d);c.uniform3f(c.getUniformLocation(c.program,"u_light.half_vector"),b[0],b[1],b[2])};return!0}})(ChemDoodle.math,ChemDoodle.structures.d3,vec3);(function(b){b.Line=function(){this.storeData([0,0,0,0,1,0],[0,0,0,0,0,0]);return!0};b.Line.prototype=new b._Mesh})(ChemDoodle.structures.d3);
+(function(b,e){e.Material=function(a){var e=a.getUniformLocation(a.program,"u_material.ambient_color"),c=a.getUniformLocation(a.program,"u_material.diffuse_color"),d=a.getUniformLocation(a.program,"u_material.specular_color"),f=a.getUniformLocation(a.program,"u_material.shininess"),q=a.getUniformLocation(a.program,"u_material.alpha");this.setTempColors=function(g,o,m,j){if(!this.aCache||this.aCache!==g)this.aCache=g,g=b.getRGB(g,1),a.uniform3f(e,g[0],g[1],g[2]);if(o&&(!this.dCache||this.dCache!==
+o))this.dCache=o,g=b.getRGB(o,1),a.uniform3f(c,g[0],g[1],g[2]);if(!this.sCache||this.sCache!==m)this.sCache=m,g=b.getRGB(m,1),a.uniform3f(d,g[0],g[1],g[2]);if(!this.snCache||this.snCache!==j)this.snCache=j,a.uniform1f(f,j);this.alCache=1;a.uniform1f(q,1)};this.setDiffuseColor=function(d){if(!this.dCache||this.dCache!==d)this.dCache=d,d=b.getRGB(d,1),a.uniform3f(c,d[0],d[1],d[2])};this.setAlpha=function(c){if(!this.alCache||this.alCache!==c)this.alCache=c,a.uniform1f(q,c)};return!0}})(ChemDoodle.math,
+ChemDoodle.structures.d3);
+(function(b,e,a,h){e.MolecularSurface=function(c,d,f,e,g){function o(a,c,b,d){var f=a.index;if(a.contained)for(var f=-1,g=Infinity,e=0,h=c.length;e<h;e++)for(var j=c[e],l=0,q=j.length;l<q;l++){var o=j[l];if(!o.contained&&o.index!==b&&o.index!==d){var m=o.distance3D(a);m<g&&(f=o.index,g=m)}}return f}for(var m=[],j=[],l=[],n=[],r=0;r<=d;r++)for(var k=r*h.PI/d,v=h.sin(k),x=h.cos(k),k=0;k<=f;k++){var t=2*k*h.PI/f;n.push(h.cos(t)*v,x,h.sin(t)*v)}v=[];r=0;for(k=c.atoms.length;r<k;r++){for(var x=[],y=c.atoms[r],
+w=a[y.label][g]+e,u=[],t=0,p=c.atoms.length;t<p;t++)if(t!==r){var A=c.atoms[t];A.index=t;y.distance3D(A)<w+a[A.label][g]+e&&u.push(A)}t=0;for(p=n.length;t<p;t+=3){for(var B=new b.Atom("C",y.x+w*n[t],y.y+w*n[t+1],y.z+w*n[t+2]),D=0,G=u.length;D<G;D++)if(A=u[D],B.distance3D(A)<a[A.label][g]+e){B.contained=!0;break}x.push(B)}v.push(x)}c=[];f++;for(r=0;r<d;r++)for(k=0;k<f;k++)g=r*f+k%f,e=g+f,c.push(g),c.push(e),c.push(g+1),k<f-1&&(c.push(e),c.push(e+1),c.push(g+1));r=D=0;for(k=v.length;r<k;r++){x=v[r];
+t=0;for(p=x.length;t<p;t++)B=x[t],B.contained||(B.index=D,D++,m.push(B.x,B.y,B.z),j.push(n[3*t],n[3*t+1],n[3*t+2]));t=0;for(p=c.length;t<p;t+=3)g=x[c[t]],e=x[c[t+1]],B=x[c[t+2]],!g.contained&&!e.contained&&!B.contained&&l.push(g.index,e.index,B.index)}n=[];r=0;for(k=v.length;r<k;r++){x=v[r];t=0;for(p=c.length;t<p;t+=3){g=x[c[t]];e=x[c[t+1]];B=x[c[t+2]];u=[];D=0;for(G=v.length;D<G;D++)D!==r&&u.push(v[D]);if((!g.contained||!e.contained||!B.contained)&&(g.contained||e.contained||B.contained))if(d=o(g,
+u,-1,-1),f=o(e,u,d,-1),u=o(B,u,d,f),-1!==d&&-1!==f&&-1!==u){e=!1;D=0;for(G=n.length;D<G;D+=3)if(g=n[D],B=n[D+1],y=n[D+2],w=f===g||f===B||f===y,A=u===g||u===B||u===y,(d===g||d===B||d===y)&&w&&A){e=!0;break}e||n.push(d,f,u)}}}l=l.concat(n);this.storeData(m,j,l);return!0};e.MolecularSurface.prototype=new e._Mesh})(ChemDoodle.structures,ChemDoodle.structures.d3,ChemDoodle.ELEMENT,Math);
+(function(b,e){b.Shader=function(){this.init=function(a){var b=this.getShader(a,"vertex-shader");b||(b=this.loadDefaultVertexShader(a));var c=this.getShader(a,"fragment-shader");c||(c=this.loadDefaultFragmentShader(a));a.attachShader(a.program,b);a.attachShader(a.program,c);a.linkProgram(a.program);a.getProgramParameter(a.program,a.LINK_STATUS)||alert("Could not initialize shaders: "+a.getProgramInfoLog(program));a.useProgram(a.program);this.vertexPositionAttribute=a.getAttribLocation(a.program,"a_vertex_position");
+a.enableVertexAttribArray(this.vertexPositionAttribute);this.vertexNormalAttribute=a.getAttribLocation(a.program,"a_vertex_normal");a.enableVertexAttribArray(this.vertexNormalAttribute)};this.getShader=function(a,b){var c=e.getElementById(b);if(c){for(var d=[],f=c.firstChild;f;)3===f.nodeType&&d.push(f.textContent),f=f.nextSibling;if("x-shader/x-fragment"===c.type)f=a.createShader(a.FRAGMENT_SHADER);else if("x-shader/x-vertex"===c.type)f=a.createShader(a.VERTEX_SHADER);else return;a.shaderSource(f,
+d.join(""));a.compileShader(f);if(a.getShaderParameter(f,a.COMPILE_STATUS))return f;alert(c.type+" "+a.getShaderInfoLog(f))}};this.loadDefaultVertexShader=function(a){var b=[];b.push("struct Light");b.push("{");b.push("vec3 diffuse_color;");b.push("vec3 specular_color;");b.push("vec3 direction;");b.push("vec3 half_vector;");b.push("};");b.push("struct Material");b.push("{");b.push("vec3 ambient_color;");b.push("vec3 diffuse_color;");b.push("vec3 specular_color;");b.push("float shininess;");b.push("float alpha;");
+b.push("};");b.push("attribute vec3 a_vertex_position;");b.push("attribute vec3 a_vertex_normal;");b.push("uniform Light u_light;");b.push("uniform Material u_material;");b.push("uniform mat4 u_model_view_matrix;");b.push("uniform mat4 u_projection_matrix;");b.push("uniform mat3 u_normal_matrix;");b.push("varying vec4 v_diffuse;");b.push("varying vec4 v_ambient;");b.push("varying vec3 v_normal;");b.push("varying vec3 v_light_direction;");b.push("void main(void)");b.push("{");b.push("if(length(a_vertex_normal)==0.0){");
+b.push("v_normal = a_vertex_normal;");b.push("}else{");b.push("v_normal = normalize(u_normal_matrix * a_vertex_normal);");b.push("}");b.push("vec4 diffuse = vec4(u_light.diffuse_color, 1.0);");b.push("v_light_direction = u_light.direction;");b.push("v_ambient = vec4(u_material.ambient_color, 1.0);");b.push("v_diffuse = vec4(u_material.diffuse_color, 1.0) * diffuse;");b.push("gl_Position = u_projection_matrix * u_model_view_matrix * vec4(a_vertex_position, 1.0);");b.push("}");var c=a.createShader(a.VERTEX_SHADER);
+a.shaderSource(c,b.join(""));a.compileShader(c);if(a.getShaderParameter(c,a.COMPILE_STATUS))return c;alert("Vertex shader failed to compile: "+a.getShaderInfoLog(c))};this.loadDefaultFragmentShader=function(a){var b=[];b.push("precision mediump float;\n");b.push("struct Light");b.push("{");b.push("vec3 diffuse_color;");b.push("vec3 specular_color;");b.push("vec3 direction;");b.push("vec3 half_vector;");b.push("};");b.push("struct Material");b.push("{");b.push("vec3 ambient_color;");b.push("vec3 diffuse_color;");
+b.push("vec3 specular_color;");b.push("float shininess;");b.push("float alpha;");b.push("};");b.push("uniform Light u_light;");b.push("uniform Material u_material;");b.push("varying vec4 v_diffuse;");b.push("varying vec4 v_ambient;");b.push("varying vec3 v_normal;");b.push("varying vec3 v_light_direction;");b.push("void main(void)");b.push("{");b.push("if(length(v_normal)==0.0){");b.push("gl_FragColor = vec4(v_diffuse.rgba);");b.push("}else{");b.push("float nDotL = max(dot(v_normal, v_light_direction), 0.0);");
+b.push("vec4 color = vec4(v_diffuse.rgb*nDotL, v_diffuse.a);");b.push("float nDotHV = max(dot(v_normal, u_light.half_vector), 0.0);");b.push("vec4 specular = vec4(u_material.specular_color * u_light.specular_color, 1.0);");b.push("color+=vec4(specular.rgb * pow(nDotHV, u_material.shininess), specular.a);");b.push("gl_FragColor = color+v_ambient;");b.push("gl_FragColor.a*=u_material.alpha;");b.push("}");b.push("}");var c=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(c,b.join(""));a.compileShader(c);
+if(a.getShaderParameter(c,a.COMPILE_STATUS))return c;alert("Fragment shader failed to compile: "+a.getShaderInfoLog(c))};return!0}})(ChemDoodle.structures.d3,document);
+(function(b,e,a){e.Shape=function(e,c){for(var d=e.length,f=[],q=[],g=new b.Point,o=0,m=d;o<m;o++){var j=o+1;o===m-1&&(j=0);for(var l=e[o],j=e[j],n=a.cross([0,0,1],[j.x-l.x,j.y-l.y,0]),r=0;2>r;r++)f.push(l.x,l.y,c/2),f.push(l.x,l.y,-c/2),f.push(j.x,j.y,c/2),f.push(j.x,j.y,-c/2);for(r=0;4>r;r++)q.push(n[0],n[1],n[2]);q.push(0,0,1);q.push(0,0,-1);q.push(0,0,1);q.push(0,0,-1);g.add(l)}g.x/=d;g.y/=d;q.push(0,0,1);f.push(g.x,g.y,c/2);q.push(0,0,-1);f.push(g.x,g.y,-c/2);g=[];l=8*d;o=0;for(m=d;o<m;o++)d=
+8*o,g.push(d),g.push(d+1),g.push(d+3),g.push(d),g.push(d+2),g.push(d+3),g.push(d+4),g.push(d+6),g.push(l),g.push(d+5),g.push(d+7),g.push(l+1);this.storeData(f,q,g);return!0};e.Shape.prototype=new e._Mesh})(ChemDoodle.structures,ChemDoodle.structures.d3,vec3);
+(function(b,e,a){b.Star=function(){for(var b=[0.8944,0.4472,0,0.2764,0.4472,0.8506,0.2764,0.4472,-0.8506,-0.7236,0.4472,0.5257,-0.7236,0.4472,-0.5257,-0.3416,0.4472,0,-0.1056,0.4472,0.3249,-0.1056,0.4472,-0.3249,0.2764,0.4472,0.2008,0.2764,0.4472,-0.2008,-0.8944,-0.4472,0,-0.2764,-0.4472,0.8506,-0.2764,-0.4472,-0.8506,0.7236,-0.4472,0.5257,0.7236,-0.4472,-0.5257,0.3416,-0.4472,0,0.1056,-0.4472,0.3249,0.1056,-0.4472,-0.3249,-0.2764,-0.4472,0.2008,-0.2764,-0.4472,-0.2008,-0.5527,0.1058,0,-0.1708,0.1058,
+0.5527,-0.1708,0.1058,-0.5527,0.4471,0.1058,0.3249,0.4471,0.1058,-0.3249,0.5527,-0.1058,0,0.1708,-0.1058,0.5527,0.1708,-0.1058,-0.5527,-0.4471,-0.1058,0.3249,-0.4471,-0.1058,-0.3249,0,1,0,0,-1,0],c=[0,9,8,2,7,9,4,5,7,3,6,5,1,8,6,0,8,23,30,6,8,3,21,6,11,26,21,13,23,26,2,9,24,30,8,9,1,23,8,13,25,23,14,24,25,4,7,22,30,9,7,0,24,9,14,27,24,12,22,27,3,5,20,30,7,5,2,22,7,12,29,22,10,20,29,1,6,21,30,5,6,4,20,5,10,28,20,11,21,28,10,19,18,12,17,19,14,15,17,13,16,15,11,18,16,31,19,17,14,17,27,2,27,22,4,22,29,
+10,29,19,31,18,19,12,19,29,4,29,20,3,20,28,11,28,18,31,16,18,10,18,28,3,28,21,1,21,26,13,26,16,31,15,16,11,16,26,1,26,23,0,23,25,14,25,15,31,17,15,13,15,25,0,25,24,2,24,27,12,27,17],d=[],f=[],e=[],g=0,o=c.length;g<o;g+=3){var m=3*c[g],j=3*c[g+1],l=3*c[g+2],m=[b[m],b[m+1],b[m+2]],j=[b[j],b[j+1],b[j+2]],l=[b[l],b[l+1],b[l+2]],n=a.cross([l[0]-j[0],l[1]-j[1],l[2]-j[2]],[m[0]-j[0],m[1]-j[1],m[2]-j[2]],[]);a.normalize(n);d.push(m[0],m[1],m[2],j[0],j[1],j[2],l[0],l[1],l[2]);f.push(n[0],n[1],n[2],n[0],n[1],
+n[2],n[0],n[1],n[2]);e.push(g,g+1,g+2)}this.storeData(d,f,e);return!0};b.Star.prototype=new b._Mesh})(ChemDoodle.structures.d3,Math,vec3);
+(function(b,e,a,h,c,d,f){var q=function(a,b,f){var e=c.sqrt(b[1]*b[1]+b[2]*b[2]),h=[1,0,0,0,0,b[2]/e,-b[1]/e,0,0,b[1]/e,b[2]/e,0,0,0,0,1],q=[1,0,0,0,0,b[2]/e,b[1]/e,0,0,-b[1]/e,b[2]/e,0,0,0,0,1],r=[e,0,-b[0],0,0,1,0,0,b[0],0,e,0,0,0,0,1],b=[e,0,b[0],0,0,1,0,0,-b[0],0,e,0,0,0,0,1],f=[c.cos(f),-c.sin(f),0,0,c.sin(f),c.cos(f),0,0,0,0,1,0,0,0,0,1],k=d.multiply(h,d.multiply(r,d.multiply(f,d.multiply(b,q,[]))));this.rotate=function(){return d.multiplyVec3(k,a)}};h.Tube=function(g,h,m){var j=g[0].lineSegments[0].length;
+this.partitions=[];var l;this.ends=[];this.ends.push(g[0].lineSegments[0][0]);this.ends.push(g[g.length-2].lineSegments[0][0]);for(var n=[1,0,0],r=0,k=g.length-1;r<k;r++){if(!l||65E3<l.positionData.length)0<this.partitions.length&&r--,l={count:0,positionData:[],normalData:[],indexData:[]},this.partitions.push(l);var v=g[r];l.count++;for(var x=Infinity,t=new a.Atom("",g[r+1].cp1.x,g[r+1].cp1.y,g[r+1].cp1.z),y=0;y<j;y++){var w=v.lineSegments[0][y],u;u=y===j-1?r===g.length-2?v.lineSegments[0][y-1]:g[r+
+1].lineSegments[0][0]:v.lineSegments[0][y+1];u=[u.x-w.x,u.y-w.y,u.z-w.z];f.normalize(u);r===g.length-2&&y===j-1&&f.scale(u,-1);var p=vec3.cross(u,n,[]);f.normalize(p);f.scale(p,h/2);p=new q(p,u,2*Math.PI/m);u=0;for(var A=m;u<A;u++){var B=p.rotate();u===c.floor(m/4)&&(n=[B[0],B[1],B[2]]);l.normalData.push(B[0],B[1],B[2]);l.positionData.push(w.x+B[0],w.y+B[1],w.z+B[2])}t&&(u=w.distance3D(t),u<x&&(x=u,g[r+1].pPoint=w))}}n=0;for(v=this.partitions.length;n<v;n++){l=this.partitions[n];r=0;for(k=l.count-
+1;r<k;r++){x=r*j*m;y=0;for(t=j;y<t;y++){w=x+y*m;for(u=0;u<m;u++)p=w+u,l.indexData.push(p),l.indexData.push(p+m),l.indexData.push(p+m+1),l.indexData.push(p),l.indexData.push(p+1),l.indexData.push(p+m+1)}}}this.storeData(this.partitions[0].positionData,this.partitions[0].normalData,this.partitions[0].indexData);m=[new a.Point(2,0)];for(r=0;60>r;r++)j=r/60*c.PI,m.push(new a.Point(2*c.cos(j),-2*c.sin(j)));m.push(new a.Point(-2,0),new a.Point(-2,4),new a.Point(2,4));var D=new a.d3.Shape(m,1);this.render=
+function(j,l){this.bindBuffers(j);j.material.setDiffuseColor(l.macro_colorByChain?this.chainColor:l.nucleics_tubeColor);j.drawElements(j.TRIANGLES,this.vertexIndexBuffer.numItems,j.UNSIGNED_SHORT,0);if(this.partitions)for(var q=1,m=this.partitions.length;q<m;q++){var k=this.partitions[q],n=j,v=k;n.bindBuffer(n.ARRAY_BUFFER,v.vertexPositionBuffer);n.vertexAttribPointer(n.shader.vertexPositionAttribute,v.vertexPositionBuffer.itemSize,n.FLOAT,!1,0,0);n.bindBuffer(n.ARRAY_BUFFER,v.vertexNormalBuffer);
+n.vertexAttribPointer(n.shader.vertexNormalAttribute,v.vertexNormalBuffer.itemSize,n.FLOAT,!1,0,0);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,v.vertexIndexBuffer);j.drawElements(j.TRIANGLES,k.vertexIndexBuffer.numItems,j.UNSIGNED_SHORT,0)}j.sphereBuffer.bindBuffers(j);for(q=0;2>q;q++)k=this.ends[q],k=d.translate(j.modelViewMatrix,[k.x,k.y,k.z],[]),m=h/2,d.scale(k,[m,m,m]),j.setMatrixUniforms(k),j.drawElements(j.TRIANGLES,j.sphereBuffer.vertexIndexBuffer.numItems,j.UNSIGNED_SHORT,0);j.cylinderBuffer.bindBuffers(j);
+q=1;for(m=g.length-1;q<m;q++){var v=g[q],r=v.pPoint,p=new a.Atom("",v.cp2.x,v.cp2.y,v.cp2.z),k=1.001*r.distance3D(p),v=[h/4,k,h/4],k=d.translate(j.modelViewMatrix,[r.x,r.y,r.z],[]),t=[0,1,0],u=0,n=[p.x-r.x,p.y-r.y,p.z-r.z];r.x===p.x&&r.z===p.z?(t=[0,0,1],r.y<r.y&&(u=c.PI)):(u=b.vec3AngleFrom(t,n),t=f.cross(t,n,[]));0!==u&&d.rotate(k,u,t);d.scale(k,v);j.setMatrixUniforms(k);j.drawArrays(j.TRIANGLE_STRIP,0,j.cylinderBuffer.vertexPositionBuffer.numItems)}D.bindBuffers(j);!l.nucleics_useShapelyColors&&
+!l.macro_colorByChain&&j.material.setDiffuseColor(l.nucleics_baseColor);q=1;for(m=g.length-1;q<m;q++)v=g[q],p=v.cp2,k=d.translate(j.modelViewMatrix,[p.x,p.y,p.z],[]),t=[0,1,0],u=0,r=v.cp3,n=[r.x-p.x,r.y-p.y,r.z-p.z],p.x===r.x&&p.z===r.z?(t=[0,0,1],p.y<p.y&&(u=c.PI)):(u=b.vec3AngleFrom(t,n),t=f.cross(t,n,[])),0!==u&&d.rotate(k,u,t),p=[1,0,0],u=d.rotate(d.identity([]),u,t),d.multiplyVec3(u,p),u=v.cp4,r=v.cp5,u.y===r.y&&u.z===r.z||(u=[r.x-u.x,r.y-u.y,r.z-u.z],r=b.vec3AngleFrom(p,u),0>f.dot(n,f.cross(p,
+u))&&(r*=-1),d.rotateY(k,r)),l.nucleics_useShapelyColors&&!l.macro_colorByChain&&(e[v.name]?j.material.setDiffuseColor(e[v.name].shapelyColor):j.material.setDiffuseColor(e["*"].shapelyColor)),j.setMatrixUniforms(k),j.drawElements(j.TRIANGLES,D.vertexIndexBuffer.numItems,j.UNSIGNED_SHORT,0)};return!0};h.Tube.prototype=new h._Mesh})(ChemDoodle.extensions,ChemDoodle.RESIDUE,ChemDoodle.structures,ChemDoodle.structures.d3,Math,mat4,vec3);
+(function(b){b.UnitCell=function(b){var a=[],h=[],c=function(b,c,d,e){a.push(b[0],b[1],b[2]);a.push(c[0],c[1],c[2]);a.push(d[0],d[1],d[2]);a.push(e[0],e[1],e[2]);for(b=0;4>b;b++)h.push(0,0,0)};c(b.o,b.x,b.xy,b.y);c(b.o,b.y,b.yz,b.z);c(b.o,b.z,b.xz,b.x);c(b.yz,b.y,b.xy,b.xyz);c(b.xyz,b.xz,b.z,b.yz);c(b.xy,b.x,b.xz,b.xyz);b=[];for(c=0;6>c;c++){var d=4*c;b.push(d,d+1,d+1,d+2,d+2,d+3,d+3,d)}this.storeData(a,h,b);return!0};b.UnitCell.prototype=new b._Mesh})(ChemDoodle.structures.d3,vec3);
+(function(b,e,a){b.Plate=function(b){this.lanes=Array(b);i=0;for(ii=b;i<ii;i++)this.lanes[i]=[];this.sort=function(){i=0;for(ii=this.lanes.length;i<ii;i++)this.lanes[i].sort(function(a,b){return a-b})};this.draw=function(b){var d=b.canvas.width,f=b.canvas.height;this.origin=9*f/10;this.front=f/10;this.laneLength=this.origin-this.front;b.strokeStyle="#000000";b.beginPath();b.moveTo(0,this.front);e.contextHashTo(b,0,this.front,d,this.front,3,3);b.closePath();b.stroke();b.beginPath();b.moveTo(0,this.origin);
+b.lineTo(d,this.origin);b.closePath();b.stroke();i=0;for(ii=this.lanes.length;i<ii;i++){f=(i+1)*d/(ii+1);b.beginPath();b.moveTo(f,this.origin);b.lineTo(f,this.origin+3);b.closePath();b.stroke();s=0;for(ss=this.lanes[i].length;s<ss;s++){var h=this.origin-this.laneLength*this.lanes[i][s].rf;switch(this.lanes[i][s].type){case "compact":b.beginPath();b.arc(f,h,3,0,2*a.PI,!1);b.closePath();break;case "expanded":b.beginPath();b.arc(f,h,7,0,2*a.PI,!1);b.closePath();break;case "widened":e.contextOval(b,f-
+18,h-10,36,10);break;case "cresent":b.beginPath(),b.arc(f,h,9,0,a.PI,!0),b.closePath()}switch(this.lanes[i][s].style){case "solid":b.fillStyle="#000000";b.fill();break;case "transparent":b.stroke()}}}};return!0};b.Plate.Spot=function(a,b,d){this.type=a;this.rf=b;this.style=d?d:"solid"}})(ChemDoodle.structures,ChemDoodle.extensions,Math);
+(function(b,e,a){b.default_backgroundColor="#FFFFFF";b.default_scale=1;b.default_rotateAngle=0;b.default_bondLength_2D=20;b.default_angstromsPerBondLength=1.25;b.default_lightDirection_3D=[-0.1,-0.1,-1];b.default_lightDiffuseColor_3D="#FFFFFF";b.default_lightSpecularColor_3D="#FFFFFF";b.default_projectionPerspective_3D=!0;b.default_projectionPerspectiveVerticalFieldOfView_3D=45;b.default_projectionOrthoWidth_3D=40;b.default_projectionWidthHeightRatio_3D=void 0;b.default_projectionFrontCulling_3D=
+0.1;b.default_projectionBackCulling_3D=1E4;b.default_atoms_display=!0;b.default_atoms_color="#000000";b.default_atoms_font_size_2D=12;b.default_atoms_font_families_2D=["Helvetica","Arial","Dialog"];b.default_atoms_font_bold_2D=!1;b.default_atoms_font_italic_2D=!1;b.default_atoms_circles_2D=!1;b.default_atoms_circleDiameter_2D=10;b.default_atoms_circleBorderWidth_2D=1;b.default_atoms_lonePairDistance_2D=8;b.default_atoms_lonePairSpread_2D=4;b.default_atoms_lonePairDiameter_2D=1;b.default_atoms_useJMOLColors=
+!1;b.default_atoms_usePYMOLColors=!1;b.default_atoms_resolution_3D=60;b.default_atoms_sphereDiameter_3D=0.8;b.default_atoms_useVDWDiameters_3D=!1;b.default_atoms_vdwMultiplier_3D=1;b.default_atoms_materialAmbientColor_3D="#000000";b.default_atoms_materialSpecularColor_3D="#555555";b.default_atoms_materialShininess_3D=32;b.default_atoms_implicitHydrogens_2D=!0;b.default_atoms_displayTerminalCarbonLabels_2D=!1;b.default_atoms_showHiddenCarbons_2D=!0;b.default_atoms_displayAllCarbonLabels_2D=!1;b.default_atoms_nonBondedAsStars_3D=
+!1;b.default_bonds_display=!0;b.default_bonds_color="#000000";b.default_bonds_width_2D=1;b.default_bonds_saturationWidth_2D=0.2;b.default_bonds_ends_2D="round";b.default_bonds_useJMOLColors=!1;b.default_bonds_usePYMOLColors=!1;b.default_bonds_colorGradient=!1;b.default_bonds_saturationAngle_2D=a.PI/3;b.default_bonds_symmetrical_2D=!1;b.default_bonds_clearOverlaps_2D=!1;b.default_bonds_overlapClearWidth_2D=0.5;b.default_bonds_atomLabelBuffer_2D=1;b.default_bonds_wedgeThickness_2D=0.22;b.default_bonds_hashWidth_2D=
+1;b.default_bonds_hashSpacing_2D=2.5;b.default_bonds_showBondOrders_3D=!1;b.default_bonds_resolution_3D=60;b.default_bonds_renderAsLines_3D=!1;b.default_bonds_cylinderDiameter_3D=0.3;b.default_bonds_materialAmbientColor_3D="#222222";b.default_bonds_materialSpecularColor_3D="#555555";b.default_bonds_materialShininess_3D=32;b.default_proteins_displayRibbon=!0;b.default_proteins_displayBackbone=!1;b.default_proteins_backboneThickness=1.5;b.default_proteins_backboneColor="#CCCCCC";b.default_proteins_ribbonCartoonize=
+!1;b.default_proteins_useShapelyColors=!1;b.default_proteins_useAminoColors=!1;b.default_proteins_usePolarityColors=!1;b.default_proteins_primaryColor="#FF0D0D";b.default_proteins_secondaryColor="#FFFF30";b.default_proteins_ribbonCartoonHelixPrimaryColor="#00E740";b.default_proteins_ribbonCartoonHelixSecondaryColor="#9905FF";b.default_proteins_ribbonCartoonSheetColor="#E8BB99";b.default_proteins_ribbonThickness=0.2;b.default_proteins_verticalResolution=10;b.default_proteins_horizontalResolution=9;
+b.default_proteins_materialAmbientColor_3D="#222222";b.default_proteins_materialSpecularColor_3D="#555555";b.default_proteins_materialShininess_3D=32;b.default_nucleics_display=!0;b.default_nucleics_tubeColor="#CCCCCC";b.default_nucleics_baseColor="#C10000";b.default_nucleics_useShapelyColors=!0;b.default_nucleics_tubeThickness=1.5;b.default_nucleics_tubeResolution_3D=60;b.default_nucleics_verticalResolution=10;b.default_nucleics_materialAmbientColor_3D="#222222";b.default_nucleics_materialSpecularColor_3D=
+"#555555";b.default_nucleics_materialShininess_3D=32;b.default_macro_displayAtoms=!1;b.default_macro_displayBonds=!1;b.default_macro_atomToLigandDistance=-1;b.default_macro_showWater=!1;b.default_macro_colorByChain=!1;b.default_surfaces_display=!0;b.default_surfaces_style="Dot";b.default_surfaces_color="#E9B862";b.default_surfaces_materialAmbientColor_3D="#000000";b.default_surfaces_materialSpecularColor_3D="#000000";b.default_surfaces_materialShininess_3D=32;b.default_crystals_displayUnitCell=!0;
+b.default_crystals_unitCellColor="green";b.default_crystals_unitCellLineWidth=1;b.default_plots_color="#000000";b.default_plots_width=1;b.default_plots_showIntegration=!1;b.default_plots_integrationColor="#c10000";b.default_plots_integrationLineWidth=1;b.default_plots_showGrid=!1;b.default_plots_gridColor="gray";b.default_plots_gridLineWidth=0.5;b.default_plots_showYAxis=!0;b.default_plots_flipXAxis=!1;b.default_text_font_size=12;b.default_text_font_families=["Helvetica","Arial","Dialog"];b.default_text_color=
+"#000000";b.default_shapes_color="#000000";b.default_shapes_lineWidth_2D=1;b.default_shapes_arrowLength_2D=8;b.default_pusher_showElectron_2D=!0;e.VisualSpecifications=function(){this.backgroundColor=b.default_backgroundColor;this.scale=b.default_scale;this.rotateAngle=b.default_rotateAngle;this.bondLength=b.default_bondLength_2D;this.angstromsPerBondLength=b.default_angstromsPerBondLength;this.lightDirection_3D=b.default_lightDirection_3D;this.lightDiffuseColor_3D=b.default_lightDiffuseColor_3D;
+this.lightSpecularColor_3D=b.default_lightSpecularColor_3D;this.projectionPerspective_3D=b.default_projectionPerspective_3D;this.projectionPerspectiveVerticalFieldOfView_3D=b.default_projectionPerspectiveVerticalFieldOfView_3D;this.projectionOrthoWidth_3D=b.default_projectionOrthoWidth_3D;this.projectionWidthHeightRatio_3D=b.default_projectionWidthHeightRatio_3D;this.projectionFrontCulling_3D=b.default_projectionFrontCulling_3D;this.projectionBackCulling_3D=b.default_projectionBackCulling_3D;this.atoms_display=
+b.default_atoms_display;this.atoms_color=b.default_atoms_color;this.atoms_font_size_2D=b.default_atoms_font_size_2D;this.atoms_font_families_2D=[];for(var a=0,c=b.default_atoms_font_families_2D.length;a<c;a++)this.atoms_font_families_2D[a]=b.default_atoms_font_families_2D[a];this.atoms_font_bold_2D=b.default_atoms_font_bold_2D;this.atoms_font_italic_2D=b.default_atoms_font_italic_2D;this.atoms_circles_2D=b.default_atoms_circles_2D;this.atoms_circleDiameter_2D=b.default_atoms_circleDiameter_2D;this.atoms_circleBorderWidth_2D=
+b.default_atoms_circleBorderWidth_2D;this.atoms_lonePairDistance_2D=b.default_atoms_lonePairDistance_2D;this.atoms_lonePairSpread_2D=b.default_atoms_lonePairSpread_2D;this.atoms_lonePairDiameter_2D=b.default_atoms_lonePairDiameter_2D;this.atoms_useJMOLColors=b.default_atoms_useJMOLColors;this.atoms_usePYMOLColors=b.default_atoms_usePYMOLColors;this.atoms_resolution_3D=b.default_atoms_resolution_3D;this.atoms_sphereDiameter_3D=b.default_atoms_sphereDiameter_3D;this.atoms_useVDWDiameters_3D=b.default_atoms_useVDWDiameters_3D;
+this.atoms_vdwMultiplier_3D=b.default_atoms_vdwMultiplier_3D;this.atoms_materialAmbientColor_3D=b.default_atoms_materialAmbientColor_3D;this.atoms_materialSpecularColor_3D=b.default_atoms_materialSpecularColor_3D;this.atoms_materialShininess_3D=b.default_atoms_materialShininess_3D;this.atoms_implicitHydrogens_2D=b.default_atoms_implicitHydrogens_2D;this.atoms_displayTerminalCarbonLabels_2D=b.default_atoms_displayTerminalCarbonLabels_2D;this.atoms_showHiddenCarbons_2D=b.default_atoms_showHiddenCarbons_2D;
+this.atoms_displayAllCarbonLabels_2D=b.default_atoms_displayAllCarbonLabels_2D;this.atoms_nonBondedAsStars_3D=b.default_atoms_nonBondedAsStars_3D;this.bonds_display=b.default_bonds_display;this.bonds_color=b.default_bonds_color;this.bonds_width_2D=b.default_bonds_width_2D;this.bonds_saturationWidth_2D=b.default_bonds_saturationWidth_2D;this.bonds_ends_2D=b.default_bonds_ends_2D;this.bonds_useJMOLColors=b.default_bonds_useJMOLColors;this.bonds_usePYMOLColors=b.default_bonds_usePYMOLColors;this.bonds_colorGradient=
+b.default_bonds_colorGradient;this.bonds_saturationAngle_2D=b.default_bonds_saturationAngle_2D;this.bonds_symmetrical_2D=b.default_bonds_symmetrical_2D;this.bonds_clearOverlaps_2D=b.default_bonds_clearOverlaps_2D;this.bonds_overlapClearWidth_2D=b.default_bonds_overlapClearWidth_2D;this.bonds_atomLabelBuffer_2D=b.default_bonds_atomLabelBuffer_2D;this.bonds_wedgeThickness_2D=b.default_bonds_wedgeThickness_2D;this.bonds_hashWidth_2D=b.default_bonds_hashWidth_2D;this.bonds_hashSpacing_2D=b.default_bonds_hashSpacing_2D;
+this.bonds_showBondOrders_3D=b.default_bonds_showBondOrders_3D;this.bonds_resolution_3D=b.default_bonds_resolution_3D;this.bonds_renderAsLines_3D=b.default_bonds_renderAsLines_3D;this.bonds_cylinderDiameter_3D=b.default_bonds_cylinderDiameter_3D;this.bonds_materialAmbientColor_3D=b.default_bonds_materialAmbientColor_3D;this.bonds_materialSpecularColor_3D=b.default_bonds_materialSpecularColor_3D;this.bonds_materialShininess_3D=b.default_bonds_materialShininess_3D;this.proteins_displayRibbon=b.default_proteins_displayRibbon;
+this.proteins_displayBackbone=b.default_proteins_displayBackbone;this.proteins_backboneThickness=b.default_proteins_backboneThickness;this.proteins_backboneColor=b.default_proteins_backboneColor;this.proteins_ribbonCartoonize=b.default_proteins_ribbonCartoonize;this.proteins_useShapelyColors=b.default_proteins_useShapelyColors;this.proteins_useAminoColors=b.default_proteins_useAminoColors;this.proteins_usePolarityColors=b.default_proteins_usePolarityColors;this.proteins_primaryColor=b.default_proteins_primaryColor;
+this.proteins_secondaryColor=b.default_proteins_secondaryColor;this.proteins_ribbonCartoonHelixPrimaryColor=b.default_proteins_ribbonCartoonHelixPrimaryColor;this.proteins_ribbonCartoonHelixSecondaryColor=b.default_proteins_ribbonCartoonHelixSecondaryColor;this.proteins_ribbonCartoonSheetColor=b.default_proteins_ribbonCartoonSheetColor;this.proteins_ribbonThickness=b.default_proteins_ribbonThickness;this.proteins_verticalResolution=b.default_proteins_verticalResolution;this.proteins_horizontalResolution=
+b.default_proteins_horizontalResolution;this.proteins_materialAmbientColor_3D=b.default_proteins_materialAmbientColor_3D;this.proteins_materialSpecularColor_3D=b.default_proteins_materialSpecularColor_3D;this.proteins_materialShininess_3D=b.default_proteins_materialShininess_3D;this.macro_displayAtoms=b.default_macro_displayAtoms;this.macro_displayBonds=b.default_macro_displayBonds;this.macro_atomToLigandDistance=b.default_macro_atomToLigandDistance;this.nucleics_display=b.default_nucleics_display;
+this.nucleics_tubeColor=b.default_nucleics_tubeColor;this.nucleics_baseColor=b.default_nucleics_baseColor;this.nucleics_useShapelyColors=b.default_nucleics_useShapelyColors;this.nucleics_tubeThickness=b.default_nucleics_tubeThickness;this.nucleics_tubeResolution_3D=b.default_nucleics_tubeResolution_3D;this.nucleics_verticalResolution=b.default_nucleics_verticalResolution;this.nucleics_materialAmbientColor_3D=b.default_nucleics_materialAmbientColor_3D;this.nucleics_materialSpecularColor_3D=b.default_nucleics_materialSpecularColor_3D;
+this.nucleics_materialShininess_3D=b.default_nucleics_materialShininess_3D;this.macro_showWater=b.default_macro_showWater;this.macro_colorByChain=b.default_macro_colorByChain;this.surfaces_display=b.default_surfaces_display;this.surfaces_style=b.default_surfaces_style;this.surfaces_color=b.default_surfaces_color;this.surfaces_materialAmbientColor_3D=b.default_surfaces_materialAmbientColor_3D;this.surfaces_materialSpecularColor_3D=b.default_surfaces_materialSpecularColor_3D;this.surfaces_materialShininess_3D=
+b.default_surfaces_materialShininess_3D;this.crystals_displayUnitCell=b.default_crystals_displayUnitCell;this.crystals_unitCellColor=b.default_crystals_unitCellColor;this.crystals_unitCellLineWidth=b.default_crystals_unitCellLineWidth;this.plots_color=b.default_plots_color;this.plots_width=b.default_plots_width;this.plots_showIntegration=b.default_plots_showIntegration;this.plots_integrationColor=b.default_plots_integrationColor;this.plots_integrationLineWidth=b.default_plots_integrationLineWidth;
+this.plots_showGrid=b.default_plots_showGrid;this.plots_gridColor=b.default_plots_gridColor;this.plots_gridLineWidth=b.default_plots_gridLineWidth;this.plots_showYAxis=b.default_plots_showYAxis;this.plots_flipXAxis=b.default_plots_flipXAxis;this.text_font_size=b.default_text_font_size;this.text_font_families=[];a=0;for(c=b.default_text_font_families.length;a<c;a++)this.text_font_families[a]=b.default_text_font_families[a];this.text_color=b.default_text_color;this.shapes_color=b.default_shapes_color;
+this.shapes_lineWidth_2D=b.default_shapes_lineWidth_2D;this.shapes_arrowLength_2D=b.default_shapes_arrowLength_2D;this.pusher_showElectron_2D=b.default_pusher_showElectron_2D;this.set3DRepresentation=function(a){this.bonds_display=this.atoms_display=!0;this.bonds_color="#777777";this.bonds_showBondOrders_3D=this.bonds_useJMOLColors=this.atoms_useJMOLColors=this.atoms_useVDWDiameters_3D=!0;this.bonds_renderAsLines_3D=!1;"Ball and Stick"===a?(this.atoms_vdwMultiplier_3D=0.3,this.bonds_useJMOLColors=
+!1,this.bonds_cylinderDiameter_3D=0.3,this.bonds_materialAmbientColor_3D=b.default_atoms_materialAmbientColor_3D):"van der Waals Spheres"===a?(this.bonds_display=!1,this.atoms_vdwMultiplier_3D=1):"Stick"===a?(this.bonds_showBondOrders_3D=this.atoms_useVDWDiameters_3D=!1,this.bonds_cylinderDiameter_3D=this.atoms_sphereDiameter_3D=0.8,this.bonds_materialAmbientColor_3D=this.atoms_materialAmbientColor_3D):"Wireframe"===a?(this.atoms_useVDWDiameters_3D=!1,this.bonds_cylinderDiameter_3D=0.05,this.atoms_sphereDiameter_3D=
+0.15,this.bonds_materialAmbientColor_3D=b.default_atoms_materialAmbientColor_3D):"Line"===a?(this.atoms_display=!1,this.bonds_renderAsLines_3D=!0,this.bonds_width_2D=1,this.bonds_cylinderDiameter_3D=0.05):alert('"'+a+'" is not recognized. Use one of the following strings:\n\n1. Ball and Stick\n2. van der Waals Spheres\n3. Stick\n4. Wireframe\n5. Line\n')};this.getFontString=function(a,b,c,g){var e=[];c&&e.push("bold ");g&&e.push("italic ");e.push(a+"px ");a=0;for(c=b.length;a<c;a++)g=b[a],-1!==g.indexOf(" ")&&
+(g='"'+g+'"'),e.push((0!==a?",":"")+g);return e.join("")}}})(ChemDoodle,ChemDoodle.structures,Math);
+(function(b,e,a,h){a.getPointsPerAngstrom=function(){return b.default_bondLength_2D/b.default_angstromsPerBondLength};a.BondDeducer=function(){this.margin=1.1;this.deduceCovalentBonds=function(b,d){var f=a.getPointsPerAngstrom();d&&(f=d);for(var q=0,g=b.atoms.length;q<g;q++)for(var o=q+1;o<g;o++){var m=b.atoms[q],j=b.atoms[o];m.distance3D(j)<(e[m.label].covalentRadius+e[j.label].covalentRadius)*f*this.margin&&b.bonds.push(new h.Bond(m,j,1))}};return!0}})(ChemDoodle,ChemDoodle.ELEMENT,ChemDoodle.informatics,
+ChemDoodle.structures);(function(b){b.HydrogenDeducer=function(){this.removeHydrogens=function(b){for(var a=[],h=[],c=0,d=b.bonds.length;c<d;c++)"H"!==b.bonds[c].a1.label&&"H"!==b.bonds[c].a2.label&&h.push(b.bonds[c]);c=0;for(d=b.atoms.length;c<d;c++)"H"!==b.atoms[c].label&&a.push(b.atoms[c]);b.atoms=a;b.bonds=h};return!0}})(ChemDoodle.informatics);
+(function(b,e,a){e.MolecularSurfaceGenerator=function(){this.generateSurface=function(b,c,d,f,e){return new a.MolecularSurface(b,c,d,f,e)};return!0}})(ChemDoodle,ChemDoodle.informatics,ChemDoodle.structures.d3);
+(function(b,e){b.Splitter=function(){this.split=function(a){for(var b=[],c=0,d=a.atoms.length;c<d;c++)a.atoms[c].visited=!1;c=0;for(d=a.bonds.length;c<d;c++)a.bonds[c].visited=!1;c=0;for(d=a.atoms.length;c<d;c++){var f=a.atoms[c];if(!f.visited){var q=new e.Molecule;q.atoms.push(f);f.visited=!0;var g=new e.Queue;for(g.enqueue(f);!g.isEmpty();)for(var f=g.dequeue(),o=0,m=a.bonds.length;o<m;o++){var j=a.bonds[o];j.contains(f)&&!j.visited&&(j.visited=!0,q.bonds.push(j),j=j.getNeighbor(f),j.visited||(j.visited=
+!0,q.atoms.push(j),g.enqueue(j)))}b.push(q)}}return b};return!0}})(ChemDoodle.informatics,ChemDoodle.structures);
+(function(b,e){b.StructureBuilder=function(){this.copy=function(a){for(var b=0,c=a.atoms.length;b<c;b++)a.atoms[b].metaID=b;for(var d=new e.Molecule,b=0,c=a.atoms.length;b<c;b++)d.atoms[b]=new e.Atom(a.atoms[b].label,a.atoms[b].x,a.atoms[b].y,a.atoms[b].z);b=0;for(c=a.bonds.length;b<c;b++)d.bonds[b]=new e.Bond(d.atoms[a.bonds[b].a1.metaID],d.atoms[a.bonds[b].a2.metaID],a.bonds[b].bondOrder);return d};return!0}})(ChemDoodle.informatics,ChemDoodle.structures);
+(function(b){b._Counter=function(){this.value=0;this.molecule=void 0;this.setMolecule=function(b){this.value=0;this.molecule=b;this.innerCalculate&&this.innerCalculate()};return!0}})(ChemDoodle.informatics);(function(b){b.FrerejacqueNumberCounter=function(b){this.setMolecule(b);return!0};b.FrerejacqueNumberCounter.prototype=new b._Counter;b.FrerejacqueNumberCounter.prototype.innerCalculate=function(){this.value=this.molecule.bonds.length-this.molecule.atoms.length+(new b.NumberOfMoleculesCounter(this.molecule)).value}})(ChemDoodle.informatics);
+(function(b,e){e.NumberOfMoleculesCounter=function(a){this.setMolecule(a);return!0};e.NumberOfMoleculesCounter.prototype=new e._Counter;e.NumberOfMoleculesCounter.prototype.innerCalculate=function(){for(var a=0,e=this.molecule.atoms.length;a<e;a++)this.molecule.atoms[a].visited=!1;a=0;for(e=this.molecule.atoms.length;a<e;a++)if(!this.molecule.atoms[a].visited){this.value++;var c=new b.Queue;this.molecule.atoms[a].visited=!0;for(c.enqueue(this.molecule.atoms[a]);!c.isEmpty();)for(var d=c.dequeue(),
+f=0,q=this.molecule.bonds.length;f<q;f++){var g=this.molecule.bonds[f];g.contains(d)&&(g=g.getNeighbor(d),g.visited||(g.visited=!0,c.enqueue(g)))}}}})(ChemDoodle.structures,ChemDoodle.informatics);
+(function(b,e){b._RingFinder=function(){this.rings=this.bonds=this.atoms=void 0;this.reduce=function(a){for(var b=0,c=a.atoms.length;b<c;b++)a.atoms[b].visited=!1;b=0;for(c=a.bonds.length;b<c;b++)a.bonds[b].visited=!1;for(var d=!0;d;){d=!1;b=0;for(c=a.atoms.length;b<c;b++){for(var f=0,e,g=0,o=a.bonds.length;g<o;g++)if(a.bonds[g].contains(a.atoms[b])&&!a.bonds[g].visited){f++;if(2===f)break;e=a.bonds[g]}1===f&&(d=!0,e.visited=!0,a.atoms[b].visited=!0)}}b=0;for(c=a.atoms.length;b<c;b++)a.atoms[b].visited||
+this.atoms.push(a.atoms[b]);b=0;for(c=a.bonds.length;b<c;b++)a.bonds[b].visited||this.bonds.push(a.bonds[b]);0===this.bonds.length&&0!==this.atoms.length&&(this.atoms=[])};this.setMolecule=function(a){this.atoms=[];this.bonds=[];this.rings=[];this.reduce(a);2<this.atoms.length&&this.innerGetRings&&this.innerGetRings()};this.fuse=function(){for(var a=0,b=this.rings.length;a<b;a++)for(var c=0,d=this.bonds.length;c<d;c++)-1!==e(this.bonds[c].a1,this.rings[a].atoms)&&-1!==e(this.bonds[c].a2,this.rings[a].atoms)&&
+this.rings[a].bonds.push(this.bonds[c])};return!0}})(ChemDoodle.informatics,jQuery.inArray);
+(function(b,e,a){function h(b,d){this.atoms=[];if(d)for(var f=0,q=d.atoms.length;f<q;f++)this.atoms[f]=d.atoms[f];this.atoms.push(b);this.grow=function(b,c){for(var d=this.atoms[this.atoms.length-1],f=[],e=0,q=b.length;e<q;e++)if(b[e].contains(d)){var r=b[e].getNeighbor(d);-1===a(r,c)&&f.push(r)}d=[];e=0;for(q=f.length;e<q;e++)d.push(new h(f[e],this));return d};this.check=function(b,c,d){for(var f=0,h=c.atoms.length-1;f<h;f++)if(-1!==a(c.atoms[f],this.atoms))return;var q;if(c.atoms[c.atoms.length-
+1]===this.atoms[this.atoms.length-1]){q=new e.Ring;q.atoms[0]=d;f=0;for(h=this.atoms.length;f<h;f++)q.atoms.push(this.atoms[f]);for(f=c.atoms.length-2;0<=f;f--)q.atoms.push(c.atoms[f])}else{for(var r=[],f=0,h=b.length;f<h;f++)b[f].contains(c.atoms[c.atoms.length-1])&&r.push(b[f]);f=0;for(h=r.length;f<h;f++)if((1===c.atoms.length||!r[f].contains(c.atoms[c.atoms.length-2]))&&r[f].contains(this.atoms[this.atoms.length-1])){q=new e.Ring;q.atoms[0]=d;b=0;for(d=this.atoms.length;b<d;b++)q.atoms.push(this.atoms[b]);
+for(b=c.atoms.length-1;0<=b;b--)q.atoms.push(c.atoms[b]);break}}return q};return!0}b.EulerFacetRingFinder=function(a){this.fingerBreak=5;this.setMolecule(a);return!0};b.EulerFacetRingFinder.prototype=new b._RingFinder;b.EulerFacetRingFinder.prototype.innerGetRings=function(){for(var b=0,d=this.atoms.length;b<d;b++){for(var f=[],e=0,g=this.bonds.length;e<g;e++)this.bonds[e].contains(this.atoms[b])&&f.push(this.bonds[e].getNeighbor(this.atoms[b]));e=0;for(g=f.length;e<g;e++)for(var o=e+1;o<f.length;o++){var m=
+[];m[0]=new h(f[e]);m[1]=new h(f[o]);var j=[];j[0]=this.atoms[b];for(var l=0,n=f.length;l<n;l++)l!==e&&l!==o&&j.push(f[l]);var r=[];for((l=m[0].check(this.bonds,m[1],this.atoms[b]))&&(r[0]=l);0===r.length&&0<m.length&&m[0].atoms.length<this.fingerBreak;){for(var k=[],l=0,n=m.length;l<n;l++)for(var v=m[l].grow(this.bonds,j),x=0,t=v.length;x<t;x++)k.push(v[x]);m=k;l=0;for(n=m.length;l<n;l++)for(x=l+1;x<n;x++)(t=m[l].check(this.bonds,m[x],this.atoms[b]))&&r.push(t);if(0===r.length){k=[];l=0;for(n=j.length;l<
+n;l++){x=0;for(t=this.bonds.length;x<t;x++)this.bonds[x].contains(j[l])&&(f=this.bonds[x].getNeighbor(j[l]),-1===a(f,j)&&-1===a(f,k)&&k.push(f))}l=0;for(n=k.length;l<n;l++)j.push(k[l])}}if(0<r.length){m=void 0;l=0;for(n=r.length;l<n;l++)if(!m||m.atoms.length>r[l].atoms.length)m=r[l];r=!1;l=0;for(n=this.rings.length;l<n;l++){j=!0;x=0;for(t=m.atoms.length;x<t;x++)if(-1===a(m.atoms[x],this.rings[l].atoms)){j=!1;break}if(j){r=!0;break}}r||this.rings.push(m)}}}this.fuse()}})(ChemDoodle.informatics,ChemDoodle.structures,
+jQuery.inArray);
+(function(b){b.SSSRFinder=function(e){this.rings=[];if(0<e.atoms.length){var a=(new b.FrerejacqueNumberCounter(e)).value,h=(new b.EulerFacetRingFinder(e)).rings;h.sort(function(a,b){return a.atoms.length-b.atoms.length});for(var c=0,d=e.bonds.length;c<d;c++)e.bonds[c].visited=!1;c=0;for(d=h.length;c<d;c++){for(var e=!1,f=0,q=h[c].bonds.length;f<q;f++)if(!h[c].bonds[f].visited){e=!0;break}if(e){f=0;for(q=h[c].bonds.length;f<q;f++)h[c].bonds[f].visited=!0;this.rings.push(h[c])}if(this.rings.length===a)break}}return!0}})(ChemDoodle.informatics);
+(function(b){b._Interpreter=function(){};b._Interpreter.prototype.fit=function(b,a,h){for(var c=b.length,d=[],f=0;f<a-c;f++)d.push(" ");return h?b+d.join(""):d.join("")+b}})(ChemDoodle.io);
+(function(b,e,a,h,c,d,f,q){var g=/\s+/g,o=/\(|\)|\s+/g,m=/\'|\s+/g,j=/,|\'|\s+/g,l=/^\s+/,n=/[0-9]/g,r=/[0-9]|\+|\-/g,k=function(a){return 0!==a.length},v={P:[],A:[[0,0.5,0.5]],B:[[0.5,0,0.5]],C:[[0.5,0.5,0]],I:[[0.5,0.5,0.5]],R:[[2/3,1/3,1/3],[1/3,2/3,2/3]],S:[[1/3,1/3,2/3],[2/3,2/3,1/3]],T:[[1/3,2/3,1/3],[2/3,1/3,2/3]],F:[[0,0.5,0.5],[0.5,0,0.5],[0.5,0.5,0]]},x=function(a){var b=0,c=0,d=0,f=0,e=a.indexOf("x"),g=a.indexOf("y"),j=a.indexOf("z");-1!==e&&(c++,0<e&&"+"!==a.charAt(e-1)&&(c*=-1));-1!==
+g&&(d++,0<g&&"+"!==a.charAt(g-1)&&(d*=-1));-1!==j&&(f++,0<j&&"+"!==a.charAt(j-1)&&(f*=-1));if(2<a.length){e="+";g=0;for(j=a.length;g<j;g++){var h=a.charAt(g);if(("-"===h||"/"===h)&&(g===a.length-1||a.charAt(g+1).match(n)))e=h;h.match(n)&&("+"===e?b+=parseInt(h):"-"===e?b-=parseInt(h):"/"===e&&(b/=parseInt(h)))}}return[b,c,d,f]};a.CIFInterpreter=function(){this.read=function(a,f,n,p){var f=f?f:1,n=n?n:1,p=p?p:1,t=new h.Molecule;if(!a)return t;for(var B=a.split("\n"),D=0,G=0,F=0,C=a=0,E=0,I="P",L,H,
+K,z,N=!0;0<B.length;)if(N?z=B.shift():N=!0,0<z.length)if(e.stringStartsWith(z,"_cell_length_a"))D=parseFloat(z.split(o)[1]);else if(e.stringStartsWith(z,"_cell_length_b"))G=parseFloat(z.split(o)[1]);else if(e.stringStartsWith(z,"_cell_length_c"))F=parseFloat(z.split(o)[1]);else if(e.stringStartsWith(z,"_cell_angle_alpha"))a=c.PI*parseFloat(z.split(o)[1])/180;else if(e.stringStartsWith(z,"_cell_angle_beta"))C=c.PI*parseFloat(z.split(o)[1])/180;else if(e.stringStartsWith(z,"_cell_angle_gamma"))E=c.PI*
+parseFloat(z.split(o)[1])/180;else if(e.stringStartsWith(z,"_symmetry_space_group_name_H-M"))I=z.split(m)[1];else if(e.stringStartsWith(z,"loop_")){for(var J={fields:[],lines:[]},P=!1;void 0!==(z=B.shift())&&!e.stringStartsWith(z=z.replace(l,""),"loop_")&&0<z.length;)if(e.stringStartsWith(z,"_")){if(P)break;J.fields=J.fields.concat(z.split(g).filter(k))}else P=!0,J.lines.push(z);if(0!==B.length&&(e.stringStartsWith(z,"loop_")||e.stringStartsWith(z,"_")))N=!1;-1!==q("_symmetry_equiv_pos_as_xyz",J.fields)||
+-1!==q("_space_group_symop_operation_xyz",J.fields)?L=J:-1!==q("_atom_site_label",J.fields)?H=J:-1!==q("_geom_bond_atom_site_label_1",J.fields)&&(K=J)}z=D;a=(c.cos(a)-c.cos(E)*c.cos(C))/c.sin(E);a=[z,0,0,0,G*c.cos(E),G*c.sin(E),0,0,F*c.cos(C),F*a,F*c.sqrt(1-c.pow(c.cos(C),2)-a*a),0,0,0,0,1];if(H){J=N=D=B=F=-1;E=0;for(C=H.fields.length;E<C;E++)z=H.fields[E],"_atom_site_type_symbol"===z?F=E:"_atom_site_label"===z?B=E:"_atom_site_fract_x"===z?D=E:"_atom_site_fract_y"===z?N=E:"_atom_site_fract_z"===z&&
+(J=E);E=0;for(C=H.lines.length;E<C;E++)z=H.lines[E],G=z.split(g).filter(k),z=new h.Atom(G[-1===F?B:F].split(r)[0],parseFloat(G[D]),parseFloat(G[N]),parseFloat(G[J])),t.atoms.push(z),-1!==B&&(z.cifId=G[B],z.cifPart=0)}if(L&&!K){E=G=0;for(C=L.fields.length;E<C;E++)if(z=L.fields[E],"_symmetry_equiv_pos_as_xyz"===z||"_space_group_symop_operation_xyz"===z)G=E;N=v[I];B=[];E=0;for(C=L.lines.length;E<C;E++){z=L.lines[E].split(j).filter(k);for(var J=x(z[G]),P=x(z[G+1]),M=x(z[G+2]),I=0,D=t.atoms.length;I<D;I++){z=
+t.atoms[I];var Q=z.x*J[1]+z.y*J[2]+z.z*J[3]+J[0],S=z.x*P[1]+z.y*P[2]+z.z*P[3]+P[0],R=z.x*M[1]+z.y*M[2]+z.z*M[3]+M[0];H=new h.Atom(z.label,Q,S,R);B.push(H);void 0!==z.cifId&&(H.cifId=z.cifId,H.cifPart=E+1);if(N){H=0;for(F=N.length;H<F;H++){var O=N[H],O=new h.Atom(z.label,Q+O[0],S+O[1],R+O[2]);B.push(O);void 0!==z.cifId&&(O.cifId=z.cifId,O.cifPart=E+1)}}}}E=0;for(C=B.length;E<C;E++){for(z=B[E];1<=z.x;)z.x--;for(;0>z.x;)z.x++;for(;1<=z.y;)z.y--;for(;0>z.y;)z.y++;for(;1<=z.z;)z.z--;for(;0>z.z;)z.z++}H=
+[];E=0;for(C=B.length;E<C;E++){F=!1;z=B[E];I=0;for(D=t.atoms.length;I<D;I++)if(1.0E-4>t.atoms[I].distance3D(z)){F=!0;break}if(!F){I=0;for(D=H.length;I<D;I++)if(1.0E-4>H[I].distance3D(z)){F=!0;break}F||H.push(z)}}t.atoms=t.atoms.concat(H)}C=[];for(E=0;E<f;E++)for(I=0;I<n;I++)for(H=0;H<p;H++)if(!(0===E&&0===I&&0===H)){F=0;for(G=t.atoms.length;F<G;F++)z=t.atoms[F],B=new h.Atom(z.label,z.x+E,z.y+I,z.z+H),C.push(B),void 0!==z.cifId&&(B.cifId=z.cifId,B.cifPart=z.cifPart+(L?L.lines.length:0)+E+10*I+100*
+H)}t.atoms=t.atoms.concat(C);E=0;for(C=t.atoms.length;E<C;E++)z=t.atoms[E],L=d.multiplyVec3(a,[z.x,z.y,z.z]),z.x=L[0],z.y=L[1],z.z=L[2];if(K){B=L=-1;E=0;for(C=K.fields.length;E<C;E++)z=K.fields[E],"_geom_bond_atom_site_label_1"===z?L=E:"_geom_bond_atom_site_label_2"===z&&(B=E);H=0;for(F=K.lines.length;H<F;H++){G=K.lines[H].split(g).filter(k);z=G[L];G=G[B];E=0;for(C=t.atoms.length;E<C;E++)for(I=E+1;I<C;I++){D=t.atoms[E];N=t.atoms[I];if(D.cifPart!==N.cifPart)break;(D.cifId===z&&N.cifId===G||D.cifId===
+G&&N.cifId===z)&&t.bonds.push(new h.Bond(D,N))}}}else(new b.informatics.BondDeducer).deduceCovalentBonds(t,1);f=[-f/2,-n/2,-p/2];t.unitCellVectors={o:d.multiplyVec3(a,f,[]),x:d.multiplyVec3(a,[f[0]+1,f[1],f[2]]),y:d.multiplyVec3(a,[f[0],f[1]+1,f[2]]),z:d.multiplyVec3(a,[f[0],f[1],f[2]+1]),xy:d.multiplyVec3(a,[f[0]+1,f[1]+1,f[2]]),xz:d.multiplyVec3(a,[f[0]+1,f[1],f[2]+1]),yz:d.multiplyVec3(a,[f[0],f[1]+1,f[2]+1]),xyz:d.multiplyVec3(a,[f[0]+1,f[1]+1,f[2]+1])};return t}};a.CIFInterpreter.prototype=new a._Interpreter;
+var t=new a.CIFInterpreter;b.readCIF=function(a,b,c,d){return t.read(a,b,c,d)}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.io,ChemDoodle.structures,Math,mat4,vec3,jQuery.inArray);
+(function(b,e,a,h,c){a.MOLInterpreter=function(){this.read=function(a,c){c||(c=b.default_bondLength_2D);var d=new h.Molecule;if(!a)return d;for(var o=a.split("\n"),m=o[3],j=parseInt(m.substring(0,3)),m=parseInt(m.substring(3,6)),l=0;l<j;l++){var n=o[4+l];d.atoms[l]=new h.Atom(n.substring(31,34),parseFloat(n.substring(0,10))*c,(1===c?1:-1)*parseFloat(n.substring(10,20))*c,parseFloat(n.substring(20,30))*c);var r=parseInt(n.substring(34,36));0!==r&&e[d.atoms[l].label]&&(d.atoms[l].mass=e[d.atoms[l].label].mass+
+r);switch(parseInt(n.substring(36,39))){case 1:d.atoms[l].charge=3;break;case 2:d.atoms[l].charge=2;break;case 3:d.atoms[l].charge=1;break;case 5:d.atoms[l].charge=-1;break;case 6:d.atoms[l].charge=-2;break;case 7:d.atoms[l].charge=-3}}for(l=0;l<m;l++){var n=o[4+j+l],k=parseInt(n.substring(6,9)),r=parseInt(n.substring(9,12));if(3<k)switch(k){case 4:k=1.5;break;default:k=1}n=new h.Bond(d.atoms[parseInt(n.substring(0,3))-1],d.atoms[parseInt(n.substring(3,6))-1],k);switch(r){case 3:n.stereo=h.Bond.STEREO_AMBIGUOUS;
+break;case 1:n.stereo=h.Bond.STEREO_PROTRUDING;break;case 6:n.stereo=h.Bond.STEREO_RECESSED}d.bonds[l]=n}return d};this.write=function(a){var d=[];d.push("Molecule from ChemDoodle Web Components\n\nhttp://www.ichemlabs.com\n");d.push(this.fit(a.atoms.length.toString(),3));d.push(this.fit(a.bonds.length.toString(),3));d.push(" 0 0 0 0 999 v2000\n");for(var g=a.getCenter(),o=0,m=a.atoms.length;o<m;o++){var j=a.atoms[o],l=" 0";if(-1!==j.mass&&e[j.label]){var n=j.mass-e[j.label].mass;5>
+n&&-4<n&&(l=(-1<n?" ":"")+n)}n=" 0";if(0!==j.charge)switch(j.charge){case 3:n=" 1";break;case 2:n=" 2";break;case 1:n=" 3";break;case -1:n=" 5";break;case -2:n=" 6";break;case -3:n=" 7"}d.push(this.fit(((j.x-g.x)/b.default_bondLength_2D).toFixed(4),10));d.push(this.fit((-(j.y-g.y)/b.default_bondLength_2D).toFixed(4),10));d.push(this.fit((j.z/b.default_bondLength_2D).toFixed(4),10));d.push(" ");d.push(this.fit(j.label,3,!0));d.push(l);d.push(n);d.push(" 0 0 0 0\n")}o=0;for(m=a.bonds.length;o<
+m;o++)g=a.bonds[o],j=0,g.stereo===h.Bond.STEREO_AMBIGUOUS?j=3:g.stereo===h.Bond.STEREO_PROTRUDING?j=1:g.stereo===h.Bond.STEREO_RECESSED&&(j=6),d.push(this.fit((c(g.a1,a.atoms)+1).toString(),3)),d.push(this.fit((c(g.a2,a.atoms)+1).toString(),3)),d.push(this.fit(g.bondOrder.toString(),3)),d.push(" "),d.push(j),d.push(" 0 0\n");d.push("M END");return d.join("")}};a.MOLInterpreter.prototype=new a._Interpreter;var d=new a.MOLInterpreter;b.readMOL=function(a,b){return d.read(a,b)};b.writeMOL=function(a){return d.write(a)}})(ChemDoodle,
+ChemDoodle.ELEMENT,ChemDoodle.io,ChemDoodle.structures,jQuery.inArray);
+(function(b,e,a,h,c,d,f){a.PDBInterpreter=function(){function a(b,c,d,f,e){for(var g=0,h=c.length;g<h;g++){var q=c[g];if(q.id===d&&f>=q.start&&f<=q.end){e?b.helix=!0:b.sheet=!0;f+1===q.end&&(b.arrow=!0);break}}}this.deduceResidueBonds=this.calculateRibbonDistances=!1;this.read=function(q,m){var j=new h.Molecule;j.chains=[];if(!q)return j;var l=q.split("\n");m||(m=1);for(var n=[],r=[],k,v=[],x=[],t=[],y=0,w=l.length;y<w;y++){var u=l[y];if(e.stringStartsWith(u,"HELIX"))n.push({id:u.substring(19,20),
+start:parseInt(u.substring(21,25)),end:parseInt(u.substring(33,37))});else if(e.stringStartsWith(u,"SHEET"))r.push({id:u.substring(21,22),start:parseInt(u.substring(22,26)),end:parseInt(u.substring(33,37))});else if(e.stringStartsWith(u,"ATOM")){var p=u.substring(16,17);if(" "===p||"A"===p){p=d(u.substring(76,78));if(0===p.length){var A=d(u.substring(12,14));"HD"===A?p="H":0<A.length&&(p=1<A.length?A.charAt(0)+A.substring(1).toLowerCase():A)}A=new h.Atom(p,parseFloat(u.substring(30,38))*m,parseFloat(u.substring(38,
+46))*m,parseFloat(u.substring(46,54))*m);A.hetatm=!1;x.push(A);var B=parseInt(u.substring(22,26));if(0===v.length)for(p=0;2>p;p++){var D=new h.Residue(-1);D.cp1=A;D.cp2=A;v.push(D)}B!==Number.NaN&&v[v.length-1].resSeq!==B&&(p=new h.Residue(B),p.name=d(u.substring(17,20)),3===p.name.length?p.name=p.name.substring(0,1)+p.name.substring(1).toLowerCase():2===p.name.length&&"D"===p.name.charAt(0)&&(p.name=p.name.substring(1)),v.push(p),D=u.substring(21,22),a(p,n,D,B,!0),a(p,r,D,B,!1));u=d(u.substring(12,
+16));p=v[v.length-1];if("CA"===u||"P"===u||"O5'"===u)p.cp1||(p.cp1=A);else if("N3"===u&&("C"===p.name||"U"===p.name||"T"===p.name)||"N1"===u&&("A"===p.name||"G"===p.name))p.cp3=A;else if("C2"===u)p.cp4=A;else if("C4"===u&&("C"===p.name||"U"===p.name||"T"===p.name)||"C6"===u&&("A"===p.name||"G"===p.name))p.cp5=A;else if("O"===u||"C6"===u&&("C"===p.name||"U"===p.name||"T"===p.name)||"N9"===u){if(!v[v.length-1].cp2){if("C6"===u||"N9"===u)k=A;p.cp2=A}}else"C"===u&&(k=A)}}else if(e.stringStartsWith(u,
+"HETATM"))p=d(u.substring(76,78)),0===p.length&&(p=d(u.substring(12,16))),1<p.length&&(p=p.substring(0,1)+p.substring(1).toLowerCase()),p=new h.Atom(p,parseFloat(u.substring(30,38))*m,parseFloat(u.substring(38,46))*m,parseFloat(u.substring(46,54))*m),p.hetatm=!0,"HOH"===d(u.substring(17,20))&&(p.isWater=!0),j.atoms.push(p),t[parseInt(d(u.substring(6,11)))]=p;else if(e.stringStartsWith(u,"CONECT")){if(p=parseInt(d(u.substring(6,11))),t[p]){A=t[p];for(B=0;4>B;B++)if(p=d(u.substring(11+5*B,16+5*B)),
+0!==p.length&&(p=parseInt(p),t[p])){for(var D=t[p],G=!1,p=0,F=j.bonds.length;p<F;p++){var C=j.bonds[p];if(C.a1===A&&C.a2===D||C.a1===D&&C.a2===A){G=!0;break}}G||j.bonds.push(new h.Bond(A,D))}}}else if(e.stringStartsWith(u,"TER"))this.endChain(j,v,k,x),v=[];else if(e.stringStartsWith(u,"ENDMDL"))break}this.endChain(j,v,k,x);0===j.bonds.size&&(new b.informatics.BondDeducer).deduceCovalentBonds(j,m);if(this.deduceResidueBonds){y=0;for(w=x.length;y<w;y++){l=f.min(w,y+20);for(p=y+1;p<l;p++)n=x[y],r=x[p],
+n.distance3D(r)<1.1*(c[n.label].covalentRadius+c[r.label].covalentRadius)&&j.bonds.push(new h.Bond(n,r,1))}}j.atoms=j.atoms.concat(x);this.calculateRibbonDistances&&this.calculateDistances(j,x);return j};this.endChain=function(a,b,c,d){if(0<b.length){var f=b[b.length-1];f.cp1||(f.cp1=d[d.length-2]);f.cp2||(f.cp2=d[d.length-1]);for(d=0;4>d;d++)f=new h.Residue(-1),f.cp1=c,f.cp2=b[b.length-1].cp2,b.push(f);a.chains.push(b)}};this.calculateDistances=function(a,b){for(var c=[],d=0,f=a.atoms.length;d<f;d++){var e=
+a.atoms[d];e.hetatm&&(e.isWater||c.push(e))}d=0;for(f=b.length;d<f;d++)if(e=b[d],e.closestDistance=Number.POSITIVE_INFINITY,0===c.length)e.closestDistance=0;else for(var g=0,h=c.length;g<h;g++)e.closestDistance=Math.min(e.closestDistance,e.distance3D(c[g]))}};a.PDBInterpreter.prototype=new a._Interpreter;var q=new a.PDBInterpreter;b.readPDB=function(a,b){return q.read(a,b)}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.io,ChemDoodle.structures,ChemDoodle.ELEMENT,jQuery.trim,Math);
+(function(b,e,a,h,c,d){var f={"@":0,A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,I:9,a:-1,b:-2,c:-3,d:-4,e:-5,f:-6,g:-7,h:-8,i:-9},q={"%":0,J:1,K:2,L:3,M:4,N:5,O:6,P:7,Q:8,R:9,j:-1,k:-2,l:-3,m:-4,n:-5,o:-6,p:-7,q:-8,r:-9},g={S:1,T:2,U:3,V:4,W:5,X:6,Y:7,Z:8,s:9};a.JCAMPInterpreter=function(){this.convertHZ2PPM=!1;this.read=function(a){this.isBreak=function(a){return void 0!==f[a]||void 0!==q[a]||void 0!==g[a]||" "===a||"-"===a||"+"===a};this.getValue=function(a,b){var c=a.charAt(0),d=a.substring(1);return void 0!==
+f[c]?parseFloat(f[c]+d):void 0!==q[c]?parseFloat(q[c]+d)+b:parseFloat(d)};var b=new h.Spectrum;if(void 0===a||0===a.length)return b;for(var a=a.split("\n"),l=[],n,o,k,v,x=1,t=1,y=1,w=-1,u=-1,p=-1,A=!0,B=!1,D=0,G=a.length;D<G;D++){var F=d(a[D]),C=c.inArray("$$",F);-1!==C&&(F=F.substring(0,C));if(0===l.length||!e.stringStartsWith(a[D],"##"))0!==l.length&&l.push("\n"),l.push(d(F));else if(C=l.join(""),A&&100>C.length&&b.metadata.push(C),l=[F],e.stringStartsWith(C,"##TITLE="))b.title=d(C.substring(8));
+else if(e.stringStartsWith(C,"##XUNITS="))b.xUnit=d(C.substring(9)),this.convertHZ2PPM&&"HZ"===b.xUnit.toUpperCase()&&(b.xUnit="PPM",B=!0);else if(e.stringStartsWith(C,"##YUNITS="))b.yUnit=d(C.substring(9));else if(!e.stringStartsWith(C,"##XYPAIRS="))if(e.stringStartsWith(C,"##FIRSTX="))o=parseFloat(d(C.substring(9)));else if(e.stringStartsWith(C,"##LASTX="))n=parseFloat(d(C.substring(8)));else if(e.stringStartsWith(C,"##FIRSTY="))k=parseFloat(d(C.substring(9)));else if(e.stringStartsWith(C,"##NPOINTS="))v=
+parseFloat(d(C.substring(10)));else if(e.stringStartsWith(C,"##XFACTOR="))x=parseFloat(d(C.substring(10)));else if(e.stringStartsWith(C,"##YFACTOR="))t=parseFloat(d(C.substring(10)));else if(e.stringStartsWith(C,"##DELTAX="))w=parseFloat(d(C.substring(9)));else if(e.stringStartsWith(C,"##.OBSERVE FREQUENCY="))this.convertHZ2PPM&&(y=parseFloat(d(C.substring(21))));else if(e.stringStartsWith(C,"##.SHIFT REFERENCE="))this.convertHZ2PPM&&(p=C.substring(19).split(","),u=parseInt(d(p[2])),p=parseFloat(d(p[3])));
+else if(e.stringStartsWith(C,"##XYDATA=")){B||(y=1);var F=A=!1,C=C.split("\n"),E=(n-o)/(v-1);if(-1!==w)for(var I=1,L=C.length;I<L;I++)if("|"===C[I].charAt(0)){E=w;break}for(var H=o-E,K=k,z=0,N,I=1,L=C.length;I<L;I++){for(var J=[],H=d(C[I]),l=[],P=!1,M=0,Q=H.length;M<Q;M++)this.isBreak(H.charAt(M))?(0<l.length&&!(1===l.length&&" "===l[0])&&J.push(l.join("")),l=[H.charAt(M)]):"|"===H.charAt(M)?P=!0:l.push(H.charAt(M));J.push(l.join(""));H=parseFloat(J[0])*x-E;M=1;for(Q=J.length;M<Q;M++)if(K=J[M],void 0!==
+g[K.charAt(0)])for(var S=parseInt(g[K.charAt(0)]+K.substring(1))-1,R=0;R<S;R++)H+=E,z=this.getValue(N,z),K=z*t,O++,b.data[b.data.length-1]=new h.Point(H/y,K);else void 0!==f[K.charAt(0)]&&F?(K=this.getValue(K,z)*t,P&&(H+=E,b.data.push(new h.Point(H/y,K)))):(F=void 0!==q[K.charAt(0)],N=K,H+=E,z=this.getValue(K,z),K=z*t,O++,b.data.push(new h.Point(H/y,K)))}if(-1!==u){F=p-b.data[u-1].x;D=0;for(G=b.data.length;D<G;D++)b.data[D].x+=F}}else if(e.stringStartsWith(C,"##PEAK TABLE=")){A=!1;b.continuous=!1;
+for(var C=C.split("\n"),O=0,I=1,L=C.length;I<L;I++){F=C[I].split(/[\s,]+/);O+=F.length/2;M=0;for(Q=F.length;M+1<Q;M+=2)b.data.push(new h.Point(parseFloat(d(F[M])),parseFloat(d(F[M+1]))))}}}b.setup();return b}};a.JCAMPInterpreter.prototype=new a._Interpreter;var o=new a.JCAMPInterpreter;o.convertHZ2PPM=!0;b.readJCAMP=function(a){return o.read(a)}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.io,ChemDoodle.structures,jQuery,jQuery.trim);
+(function(b,e,a,h){b.JSONInterpreter=function(){this.contentTo=function(a,b){for(var f=0,e=0,g=0,h=a.length;g<h;g++){for(var m=a[g],j=0,l=m.atoms.length;j<l;j++)m.atoms[j].tmpid="a"+f++;j=0;for(l=m.bonds.length;j<l;j++)m.bonds[j].tmpid="b"+e++}g=f=0;for(h=b.length;g<h;g++)b[g].tmpid="s"+f++;f={};if(a&&0<a.length){f.m=[];g=0;for(h=a.length;g<h;g++)f.m.push(this.molTo(a[g]))}if(b&&0<b.length){f.s=[];g=0;for(h=b.length;g<h;g++)f.s.push(this.shapeTo(b[g]))}g=0;for(h=a.length;g<h;g++){m=a[g];j=0;for(l=
+m.atoms.length;j<l;j++)m.atoms[j].tmpid=void 0;j=0;for(l=m.bonds.length;j<l;j++)m.bonds[j].tmpid=void 0}g=0;for(h=b.length;g<h;g++)b[g].tmpid=void 0;return f};this.contentFrom=function(a){var b={molecules:[],shapes:[]};if(a.m)for(var f=0,e=a.m.length;f<e;f++)b.molecules.push(this.molFrom(a.m[f]));if(a.s){f=0;for(e=a.s.length;f<e;f++)b.shapes.push(this.shapeFrom(a.s[f],b.molecules))}f=0;for(e=b.molecules.length;f<e;f++){for(var a=b.molecules[f],g=0,h=a.atoms.length;g<h;g++)a.atoms[g].tmpid=void 0;
+g=0;for(h=a.bonds.length;g<h;g++)a.bonds[g].tmpid=void 0}f=0;for(e=b.shapes.length;f<e;f++)b.shapes[f].tmpid=void 0;return b};this.molTo=function(a){for(var b={a:[],b:[]},f=0,q=a.atoms.length;f<q;f++){var g=a.atoms[f],o={x:g.x,y:g.y};g.tmpid&&(o.i=g.tmpid);"C"!==g.label&&(o.l=g.label);0!==g.z&&(o.z=g.z);0!==g.charge&&(o.c=g.charge);-1!==g.mass&&(o.m=g.mass);0!==g.numRadical&&(o.r=g.numRadical);0!==g.numLonePair&&(o.p=g.numLonePair);g.any&&(o.q=!0);-1!==g.rgroup&&(o.rg=g.rgroup);b.a.push(o)}f=0;for(q=
+a.bonds.length;f<q;f++)g=a.bonds[f],o={b:h(g.a1,a.atoms),e:h(g.a2,a.atoms)},g.tmpid&&(o.i=g.tmpid),1!==g.bondOrder&&(o.o=g.bondOrder),g.stereo!==e.Bond.STEREO_NONE&&(o.s=g.stereo),b.b.push(o);return b};this.molFrom=function(a){for(var b=new e.Molecule,f=0,h=a.a.length;f<h;f++){var g=a.a[f],o=new e.Atom(g.l?g.l:"C",g.x,g.y);g.i&&(o.tmpid=g.i);g.z&&(o.z=g.z);g.c&&(o.charge=g.c);g.m&&(o.mass=g.m);g.r&&(o.numRadical=g.r);g.p&&(o.numLonePair=g.p);g.q&&(o.any=!0);g.rg&&(o.rgroup=g.rg);void 0!==g.p_h&&(o.hetatm=
+g.p_h);void 0!==g.p_w&&(o.isWater=g.p_w);void 0!==g.p_d&&(o.closestDistance=g.p_d);b.atoms.push(o)}f=0;for(h=a.b.length;f<h;f++)g=a.b[f],o=new e.Bond(b.atoms[g.b],b.atoms[g.e],g.o?g.o:1),g.i&&(o.tmpid=g.i),g.s&&(o.stereo=g.s),b.bonds.push(o);return b};this.shapeTo=function(b){var d={};b.tmpid&&(d.i=b.tmpid);b instanceof a.Line?(d.t="Line",d.x1=b.p1.x,d.y1=b.p1.y,d.x2=b.p2.x,d.y2=b.p2.y,d.a=b.arrowType):b instanceof a.Pusher&&(d.t="Pusher",d.o1=b.o1.tmpid,d.o2=b.o2.tmpid,1!==b.numElectron&&(d.e=b.numElectron));
+return d};this.shapeFrom=function(b,d){var f;if("Line"===b.t)f=new a.Line(new e.Point(b.x1,b.y1),new e.Point(b.x2,b.y2)),f.arrowType=b.a;else if("Pusher"===b.t){var h,g;f=0;for(var o=d.length;f<o;f++){for(var m=d[f],j=0,l=m.atoms.length;j<l;j++){var n=m.atoms[j];n.tmpid===b.o1?h=n:n.tmpid===b.o2&&(g=n)}j=0;for(l=m.bonds.length;j<l;j++)n=m.bonds[j],n.tmpid===b.o1?h=n:n.tmpid===b.o2&&(g=n)}f=new a.Pusher(h,g);b.e&&(f.numElectron=b.e)}return f};this.pdbFrom=function(a){var b=this.molFrom(a.mol);b.findRings=
+!1;b.fromJSON=!0;b.chains=this.chainsFrom(a.ribbons);return b};this.chainsFrom=function(a){for(var b=[],f=0,h=a.cs.length;f<h;f++){for(var g=a.cs[f],o=[],m=0,j=g.length;m<j;m++){var l=g[m],n=new e.Residue;n.name=l.n;n.cp1=new e.Atom("",l.x1,l.y1,l.z1);n.cp2=new e.Atom("",l.x2,l.y2,l.z2);l.x3&&(n.cp3=new e.Atom("",l.x3,l.y3,l.z3),n.cp4=new e.Atom("",l.x4,l.y4,l.z4),n.cp5=new e.Atom("",l.x5,l.y5,l.z5));n.helix=l.h;n.sheet=l.s;n.arrow=l.a;o.push(n)}b.push(o)}return b}}})(ChemDoodle.io,ChemDoodle.structures,
+ChemDoodle.structures.d2,jQuery.inArray);
+(function(b,e,a){e.RXNInterpreter=function(){this.read=function(c,d){d||(d=b.default_bondLength_2D);var f=[],e;if(c){e=c.split("$MOL\n");for(var g=e[0].split("\n")[4],h=parseInt(g.substring(0,3)),g=parseInt(g.substring(3,6)),m=1,j=0,l=0,n=h+g;l<n;l++){f[l]=b.readMOL(e[m],d);var r=f[l].getBounds(),r=r.maxX-r.minX,j=j-(r+40);m++}l=0;for(n=h;l<n;l++){var r=f[l].getBounds(),r=r.maxX-r.minX,m=f[l].getCenter(),k=0;for(e=f[l].atoms.length;k<e;k++){var v=f[l].atoms[k];v.x+=j+r/2-m.x;v.y-=m.y}j+=r+40}e=new a.d2.Line(new a.Point(j,
+0),new a.Point(j+40,0));j+=80;l=h;for(n=h+g;l<n;l++){r=f[l].getBounds();r=r.maxX-r.minX;m=f[l].getCenter();for(k=0;k<f[l].atoms.length;k++)v=f[l].atoms[k],v.x+=j+r/2-m.x,v.y-=m.y;j+=r+40}}else f.push(new a.Molecule),e=new a.d2.Line(new a.Point(-20,0),new a.Point(20,0));e.arrowType=a.d2.Line.ARROW_SYNTHETIC;return{molecules:f,shapes:[e]}};this.write=function(c,d){var f=[[],[]],e=void 0;if(c&&d){g=0;for(h=d.length;g<h;g++)if(d[g]instanceof a.d2.Line){e=d[g].getPoints();break}if(!e)return"";for(var g=
+0,h=c.length;g<h;g++)c[g].getCenter().x<e[0].x?f[0].push(c[g]):f[1].push(c[g]);e=[];e.push("$RXN\nReaction from ChemDoodle Web Components\n\nhttp://www.ichemlabs.com\n");e.push(this.fit(f[0].length.toString(),3));e.push(this.fit(f[1].length.toString(),3));e.push("\n");for(g=0;2>g;g++)for(var h=0,m=f[g].length;h<m;h++)e.push("$MOL\n"),e.push(b.writeMOL(f[g][h])),e.push("\n");return e.join("")}}};e.RXNInterpreter.prototype=new e._Interpreter;var h=new e.RXNInterpreter;b.readRXN=function(a,b){return h.read(a,
+b)};b.writeRXN=function(a,b){return h.write(a,b)}})(ChemDoodle,ChemDoodle.io,ChemDoodle.structures);
+(function(b,e,a,h,c,d){h.XYZInterpreter=function(){this.deduceCovalentBonds=!0;this.read=function(f){var e=new c.Molecule;if(!f)return e;for(var f=f.split("\n"),h=parseInt(d(f[0])),m=0;m<h;m++){var j=f[m+2].split(/\s+/g);e.atoms[m]=new c.Atom(isNaN(j[0])?j[0]:a[parseInt(j[0])-1],parseFloat(j[1]),parseFloat(j[2]),parseFloat(j[3]))}this.deduceCovalentBonds&&(new b.informatics.BondDeducer).deduceCovalentBonds(e,1);return e}};h.XYZInterpreter.prototype=new h._Interpreter;var f=new h.XYZInterpreter;b.readXYZ=
+function(a){return f.read(a)}})(ChemDoodle,ChemDoodle.ELEMENT,ChemDoodle.SYMBOLS,ChemDoodle.io,ChemDoodle.structures,jQuery.trim);
+ChemDoodle.monitor=function(b,e,a){var h={CANVAS_DRAGGING:void 0,CANVAS_OVER:void 0,ALT:!1,SHIFT:!1,META:!1};b.supports_touch()||e(a).ready(function(){e(a).mousemove(function(a){h.CANVAS_DRAGGING&&h.CANVAS_DRAGGING.drag&&(h.CANVAS_DRAGGING.prehandleEvent(a),h.CANVAS_DRAGGING.drag(a))});e(a).mouseup(function(a){h.CANVAS_DRAGGING&&h.CANVAS_DRAGGING!==h.CANVAS_OVER&&h.CANVAS_DRAGGING.mouseup&&(h.CANVAS_DRAGGING.prehandleEvent(a),h.CANVAS_DRAGGING.mouseup(a));h.CANVAS_DRAGGING=void 0});e(a).keydown(function(a){h.SHIFT=
+a.shiftKey;h.ALT=a.altKey;h.META=a.metaKey;var b=h.CANVAS_OVER;h.CANVAS_DRAGGING&&(b=h.CANVAS_DRAGGING);b&&b.keydown&&(b.prehandleEvent(a),b.keydown(a))});e(a).keypress(function(a){var b=h.CANVAS_OVER;h.CANVAS_DRAGGING&&(b=h.CANVAS_DRAGGING);b&&b.keypress&&(b.prehandleEvent(a),b.keypress(a))});e(a).keyup(function(a){h.SHIFT=a.shiftKey;h.ALT=a.altKey;h.META=a.metaKey;var b=h.CANVAS_OVER;h.CANVAS_DRAGGING&&(b=h.CANVAS_DRAGGING);b&&b.keyup&&(b.prehandleEvent(a),b.keyup(a))})});return h}(ChemDoodle.featureDetection,
+jQuery,document);
+(function(b,e,a,h,c,d,f,q,g,o,m){b._Canvas=function(){this.image=this.emptyMessage=this.shapes=this.molecules=void 0;return!0};b._Canvas.prototype.repaint=function(){if(!this.test){var a=o.getElementById(this.id);if(a.getContext){var b=a.getContext("2d");1!==this.pixelRatio&&a.width===this.width&&(a.width=this.width*this.pixelRatio,a.height=this.height*this.pixelRatio,b.scale(this.pixelRatio,this.pixelRatio));this.image?b.drawImage(this.image,0,0):(this.specs.backgroundColor&&this.bgCache!==a.style.backgroundColor&&
+(a.style.backgroundColor=this.specs.backgroundColor,this.bgCache=a.style.backgroundColor),b.fillStyle=this.specs.backgroundColor,b.fillRect(0,0,this.width,this.height));if(this.innerRepaint)this.innerRepaint(b);else if(0!==this.molecules.length||0!==this.shapes.length){b.save();b.translate(this.width/2,this.height/2);b.rotate(this.specs.rotateAngle);b.scale(this.specs.scale,this.specs.scale);b.translate(-this.width/2,-this.height/2);for(var a=0,c=this.molecules.length;a<c;a++)this.molecules[a].check(!0),
+this.molecules[a].draw(b,this.specs);a=0;for(c=this.shapes.length;a<c;a++)this.shapes[a].draw(b,this.specs);b.restore()}else this.emptyMessage&&(b.fillStyle="#737683",b.textAlign="center",b.textBaseline="middle",b.font="18px Helvetica, Verdana, Arial, Sans-serif",b.fillText(this.emptyMessage,this.width/2,this.height/2));this.drawChildExtras&&this.drawChildExtras(b)}}};b._Canvas.prototype.resize=function(a,b){var c=d("#"+this.id);c.attr({width:a,height:b});c.css("width",a);c.css("height",b);this.width=
+a;this.height=b;if(this instanceof ChemDoodle._Canvas3D)this.gl.viewport(0,0,a,b),this.setupScene();else if(0<this.molecules.length){this.center();for(var c=0,f=this.molecules.length;c<f;c++)this.molecules[c].check()}this.repaint()};b._Canvas.prototype.setBackgroundImage=function(a){this.image=new Image;var b=this;this.image.onload=function(){b.repaint()};this.image.src=a};b._Canvas.prototype.loadMolecule=function(a){this.clear();this.molecules.push(a);this.center();this instanceof ChemDoodle._Canvas3D||
+a.check();this.afterLoadContent&&this.afterLoadContent();this.repaint()};b._Canvas.prototype.loadContent=function(a,b){this.molecules=a;this.shapes=b;this.center();if(!(this instanceof ChemDoodle._Canvas3D))for(var c=0,d=this.molecules.length;c<d;c++)this.molecules[c].check();this.afterLoadContent&&this.afterLoadContent();this.repaint()};b._Canvas.prototype.addMolecule=function(a){this.molecules.push(a);this instanceof ChemDoodle._Canvas3D||a.check();this.repaint()};b._Canvas.prototype.removeMolecule=
+function(a){this.molecules=d.grep(this.molecules,function(b){return b!==a});this.repaint()};b._Canvas.prototype.getMolecule=function(){return 0<this.molecules.length?this.molecules[0]:void 0};b._Canvas.prototype.getMolecules=function(){return this.molecules};b._Canvas.prototype.addShape=function(a){this.shapes.push(a);this.repaint()};b._Canvas.prototype.removeShape=function(a){this.shapes=d.grep(this.shapes,function(b){return b!==a});this.repaint()};b._Canvas.prototype.getShapes=function(){return this.shapes};
+b._Canvas.prototype.clear=function(){this.molecules=[];this.shapes=[];this.specs.scale=1;this.repaint()};b._Canvas.prototype.center=function(){for(var a=this.getContentBounds(),b=new c.Point((this.width-a.minX-a.maxX)/2,(this.height-a.minY-a.maxY)/2),d=0,f=this.molecules.length;d<f;d++)for(var e=this.molecules[d],h=0,m=e.atoms.length;h<m;h++)e.atoms[h].add(b);d=0;for(f=this.shapes.length;d<f;d++){e=this.shapes[d].getPoints();h=0;for(m=e.length;h<m;h++)e[h].add(b)}this.specs.scale=1;b=a.maxX-a.minX;
+a=a.maxY-a.minY;if(b>this.width||a>this.height)this.specs.scale=0.85*g.min(this.width/b,this.height/a)};b._Canvas.prototype.bondExists=function(a,b){for(var c=0,d=this.molecules.length;c<d;c++)for(var f=this.molecules[c],e=0,g=f.bonds.length;e<g;e++){var h=f.bonds[e];if(h.contains(a)&&h.contains(b))return!0}return!1};b._Canvas.prototype.getBond=function(a,b){for(var c=0,d=this.molecules.length;c<d;c++)for(var f=this.molecules[c],e=0,g=f.bonds.length;e<g;e++){var h=f.bonds[e];if(h.contains(a)&&h.contains(b))return h}};
+b._Canvas.prototype.getMoleculeByAtom=function(a){for(var b=0,c=this.molecules.length;b<c;b++){var d=this.molecules[b];if(-1!==q(a,d.atoms))return d}};b._Canvas.prototype.getAllAtoms=function(){for(var a=[],b=0,c=this.molecules.length;b<c;b++)a=a.concat(this.molecules[b].atoms);return a};b._Canvas.prototype.getAllPoints=function(){for(var a=[],b=0,c=this.molecules.length;b<c;b++)a=a.concat(this.molecules[b].atoms);b=0;for(c=this.shapes.length;b<c;b++)a=a.concat(this.shapes[b].getPoints());return a};
+b._Canvas.prototype.getContentBounds=function(){for(var b=new a.Bounds,c=0,d=this.molecules.length;c<d;c++)b.expand(this.molecules[c].getBounds());c=0;for(d=this.shapes.length;c<d;c++)b.expand(this.shapes[c].getBounds());return b};b._Canvas.prototype.create=function(a,l,q){this.id=a;this.width=l;this.height=q;this.molecules=[];this.shapes=[];if(o.getElementById(a)){var r=d("#"+a);l?r.attr("width",l):this.width=r.attr("width");q?r.attr("height",q):this.height=r.attr("height");r.attr("class","ChemDoodleWebComponent")}else{if(!b.featureDetection.supports_canvas_text()&&
+f.msie&&"6"<=f.version){o.writeln('<div style="border: 1px solid black;" width="'+l+'" height="'+q+'">Please install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a>, then restart Internet Explorer.</div>');return}o.writeln('<canvas class="ChemDoodleWebComponent" id="'+a+'" width="'+l+'" height="'+q+'" alt="ChemDoodle Web Component">This browser does not support HTML5/Canvas.</canvas>')}a=d("#"+a);a.css("width",this.width);a.css("height",this.height);this.pixelRatio=m.devicePixelRatio?
+m.devicePixelRatio:1;this.specs=new c.VisualSpecifications;var k=this;e.supports_touch()?(a.bind("touchstart",function(a){var b=(new Date).getTime();if(!e.supports_gesture()&&2===a.originalEvent.touches.length){var d=a.originalEvent.touches,f=new c.Point(d[0].pageX,d[0].pageY),d=new c.Point(d[1].pageX,d[1].pageY);k.implementedGestureDist=f.distance(d);k.implementedGestureAngle=f.angle(d);k.gesturestart&&(k.prehandleEvent(a),k.gesturestart(a))}k.lastTouch&&1===a.originalEvent.touches.length&&500>b-
+k.lastTouch?k.dbltap?(k.prehandleEvent(a),k.dbltap(a)):k.dblclick?(k.prehandleEvent(a),k.dblclick(a)):k.touchstart?(k.prehandleEvent(a),k.touchstart(a)):k.mousedown&&(k.prehandleEvent(a),k.mousedown(a)):k.touchstart?(k.prehandleEvent(a),k.touchstart(a),this.hold&&clearTimeout(this.hold),this.touchhold&&(this.hold=setTimeout(function(){k.touchhold(a)},1E3))):k.mousedown&&(k.prehandleEvent(a),k.mousedown(a));k.lastTouch=b}),a.bind("touchmove",function(a){this.hold&&(clearTimeout(this.hold),this.hold=
+void 0);if(!e.supports_gesture()&&2===a.originalEvent.touches.length&&k.gesturechange){var b=a.originalEvent.touches,d=new c.Point(b[0].pageX,b[0].pageY),f=new c.Point(b[1].pageX,b[1].pageY),b=d.distance(f),d=d.angle(f);a.originalEvent.scale=b/k.implementedGestureDist;a.originalEvent.rotation=180*(k.implementedGestureAngle-d)/g.PI;k.prehandleEvent(a);k.gesturechange(a)}if(1<a.originalEvent.touches.length&&k.multitouchmove){d=a.originalEvent.touches.length;k.prehandleEvent(a);b=new c.Point(-a.offset.left*
+d,-a.offset.top*d);for(f=0;f<d;f++)b.x+=a.originalEvent.changedTouches[f].pageX,b.y+=a.originalEvent.changedTouches[f].pageY;b.x/=d;b.y/=d;a.p=b;k.multitouchmove(a,d)}else k.touchmove?(k.prehandleEvent(a),k.touchmove(a)):k.drag&&(k.prehandleEvent(a),k.drag(a))}),a.bind("touchend",function(a){this.hold&&(clearTimeout(this.hold),this.hold=void 0);!e.supports_gesture()&&k.implementedGestureDist&&(k.implementedGestureDist=void 0,k.implementedGestureAngle=void 0,k.gestureend&&(k.prehandleEvent(a),k.gestureend(a)));
+k.touchend?(k.prehandleEvent(a),k.touchend(a)):k.mouseup&&(k.prehandleEvent(a),k.mouseup(a));250>(new Date).getTime()-k.lastTouch&&(k.tap?(k.prehandleEvent(a),k.tap(a)):k.click&&(k.prehandleEvent(a),k.click(a)))}),a.bind("gesturestart",function(a){k.gesturestart&&(k.prehandleEvent(a),k.gesturestart(a))}),a.bind("gesturechange",function(a){k.gesturechange&&(k.prehandleEvent(a),k.gesturechange(a))}),a.bind("gestureend",function(a){k.gestureend&&(k.prehandleEvent(a),k.gestureend(a))})):(a.click(function(a){switch(a.which){case 1:k.click&&
+(k.prehandleEvent(a),k.click(a));break;case 2:k.middleclick&&(k.prehandleEvent(a),k.middleclick(a));break;case 3:k.rightclick&&(k.prehandleEvent(a),k.rightclick(a))}}),a.dblclick(function(a){k.dblclick&&(k.prehandleEvent(a),k.dblclick(a))}),a.mousedown(function(a){switch(a.which){case 1:h.CANVAS_DRAGGING=k;k.mousedown&&(k.prehandleEvent(a),k.mousedown(a));break;case 2:k.middlemousedown&&(k.prehandleEvent(a),k.middlemousedown(a));break;case 3:k.rightmousedown&&(k.prehandleEvent(a),k.rightmousedown(a))}}),
+a.mousemove(function(a){!h.CANVAS_DRAGGING&&k.mousemove&&(k.prehandleEvent(a),k.mousemove(a))}),a.mouseout(function(a){h.CANVAS_OVER=void 0;k.mouseout&&(k.prehandleEvent(a),k.mouseout(a))}),a.mouseover(function(a){h.CANVAS_OVER=k;k.mouseover&&(k.prehandleEvent(a),k.mouseover(a))}),a.mouseup(function(a){switch(a.which){case 1:k.mouseup&&(k.prehandleEvent(a),k.mouseup(a));break;case 2:k.middlemouseup&&(k.prehandleEvent(a),k.middlemouseup(a));break;case 3:k.rightmouseup&&(k.prehandleEvent(a),k.rightmouseup(a))}}),
+a.mousewheel(function(a,b){k.mousewheel&&(k.prehandleEvent(a),k.mousewheel(a,b))}));this.subCreate&&this.subCreate()};b._Canvas.prototype.prehandleEvent=function(a){a.originalEvent.changedTouches&&(a.pageX=a.originalEvent.changedTouches[0].pageX,a.pageY=a.originalEvent.changedTouches[0].pageY);a.preventDefault();a.offset=d("#"+this.id).offset();a.p=new c.Point(a.pageX-a.offset.left,a.pageY-a.offset.top)}})(ChemDoodle,ChemDoodle.featureDetection,ChemDoodle.math,ChemDoodle.monitor,ChemDoodle.structures,
+jQuery,jQuery.browser,jQuery.inArray,Math,document,window);
+(function(b){b._AnimatorCanvas=function(b,a,h){b&&this.create(b,a,h);this.timeout=33;return!0};b._AnimatorCanvas.prototype=new b._Canvas;b._AnimatorCanvas.prototype.startAnimation=function(){this.stopAnimation();this.lastTime=(new Date).getTime();var b=this;this.nextFrame&&(this.handle=setInterval(function(){var a=(new Date).getTime();b.nextFrame(a-b.lastTime);b.repaint();b.lastTime=a},this.timeout))};b._AnimatorCanvas.prototype.stopAnimation=function(){this.handle&&(clearInterval(this.handle),this.handle=
+void 0)};b._AnimatorCanvas.prototype.isRunning=function(){return void 0!==this.handle}})(ChemDoodle);
+(function(b,e){b.FileCanvas=function(a,b,c,d){a&&this.create(a,b,c);e.writeln('<br><form name="FileForm" enctype="multipart/form-data" method="POST" action="'+d+'" target="HiddenFileFrame"><input type="file" name="f" /><input type="submit" name="submitbutton" value="Show File" /></form><iframe id="HFF-'+a+'" name="HiddenFileFrame" height="0" width="0" style="display:none;" onLoad="GetMolFromFrame(\'HFF-'+a+"', "+a+')"></iframe>');this.emptyMessage="Click below to load file";this.repaint();return!0};
+b.FileCanvas.prototype=new b._Canvas})(ChemDoodle,document);
+(function(b){b.HyperlinkCanvas=function(b,a,h,c,d,f){b&&this.create(b,a,h);this.urlOrFunction=c;this.color=d?d:"blue";this.size=f?f:2;this.openInNewWindow=!0;this.e=this.hoverImage=void 0;return!0};b.HyperlinkCanvas.prototype=new b._Canvas;b.HyperlinkCanvas.prototype.drawChildExtras=function(b){this.e&&(this.hoverImage?b.drawImage(this.hoverImage,0,0):(b.strokeStyle=this.color,b.lineWidth=2*this.size,b.strokeRect(0,0,this.width,this.height)))};b.HyperlinkCanvas.prototype.setHoverImage=function(b){this.hoverImage=
+new Image;this.hoverImage.src=b};b.HyperlinkCanvas.prototype.click=function(){this.e=void 0;this.repaint();this.urlOrFunction instanceof Function?this.urlOrFunction():this.openInNewWindow?window.open(this.urlOrFunction):location.href=this.urlOrFunction};b.HyperlinkCanvas.prototype.mouseout=function(){this.e=void 0;this.repaint()};b.HyperlinkCanvas.prototype.mouseover=function(b){this.e=b;this.repaint()}})(ChemDoodle);
+(function(b,e,a,h){b.MolGrabberCanvas=function(b,d,f){b&&this.create(b,d,f);d=[];d.push('<br><input type="text" id="');d.push(b);d.push('_query" size="32" value="" />');d.push("<br><nobr>");d.push('<select id="');d.push(b);d.push('_select">');d.push('<option value="chemexper">ChemExper');d.push('<option value="chemspider">ChemSpider');d.push('<option value="pubchem" selected>PubChem');d.push("</select>");d.push('<button id="');d.push(b);d.push('_submit">Show Molecule</button>');d.push("</nobr>");
+h.getElementById(b);a("#"+b).after(d.join(""));var e=this;a("#"+b+"_submit").click(function(){e.search()});a("#"+b+"_query").keypress(function(a){13===a.which&&e.search()});this.emptyMessage="Enter search term below";this.repaint();return!0};b.MolGrabberCanvas.prototype=new b._Canvas;b.MolGrabberCanvas.prototype.setSearchTerm=function(b){a("#"+this.id+"_query").val(b);this.search()};b.MolGrabberCanvas.prototype.search=function(){this.emptyMessage="Searching...";this.clear();var b=this;e.getMoleculeFromDatabase(a("#"+
+this.id+"_query").val(),{database:a("#"+this.id+"_select").val()},function(a){b.loadMolecule(a)})}})(ChemDoodle,ChemDoodle.iChemLabs,jQuery,document);
+(function(b,e,a){var h=[],c=[1,0,0],d=[0,1,0],f=[0,0,1];b.RotatorCanvas=function(a,b,c,d){a&&this.create(a,b,c);this.rotate3D=d;this.zIncrement=this.yIncrement=this.xIncrement=a=e.PI/15;return!0};b.RotatorCanvas.prototype=new b._AnimatorCanvas;b.RotatorCanvas.prototype.nextFrame=function(b){if(0===this.molecules.length&&0===this.shapes.length)this.stopAnimation();else if(b/=1E3,this.rotate3D){a.identity(h);a.rotate(h,this.xIncrement*b,c);a.rotate(h,this.yIncrement*b,d);a.rotate(h,this.zIncrement*
+b,f);for(var b=0,e=this.molecules.length;b<e;b++){for(var o=this.molecules[b],m=0,j=o.atoms.length;m<j;m++){var l=o.atoms[m],n=[l.x-this.width/2,l.y-this.height/2,l.z];a.multiplyVec3(h,n);l.x=n[0]+this.width/2;l.y=n[1]+this.height/2;l.z=n[2]}m=0;for(j=o.rings.length;m<j;m++)o.rings[m].center=o.rings[m].getCenter();this.specs.atoms_display&&this.specs.atoms_circles_2D&&o.sortAtomsByZ();this.specs.bonds_display&&this.specs.bonds_clearOverlaps_2D&&o.sortBondsByZ()}b=0;for(e=this.shapes.length;b<e;b++){o=
+this.shapes[b].getPoints();m=0;for(j=o.length;m<j;m++)l=o[m],n=[l.x-this.width/2,l.y-this.height/2,0],a.multiplyVec3(h,n),l.x=n[0]+this.width/2,l.y=n[1]+this.height/2}}else this.specs.rotateAngle+=this.zIncrement*b};b.RotatorCanvas.prototype.dblclick=function(){this.isRunning()?this.stopAnimation():this.startAnimation()}})(ChemDoodle,Math,mat4);
+(function(b,e){b.SlideshowCanvas=function(a,b,c){a&&this.create(a,b,c);this.frames=[];this.curIndex=0;this.timeout=5E3;this.alpha=0;this.innerHandle=void 0;this.phase=0;return!0};b.SlideshowCanvas.prototype=new b._AnimatorCanvas;b.SlideshowCanvas.prototype.drawChildExtras=function(a){var b=e.getRGB(this.specs.backgroundColor,255);a.fillStyle="rgba("+b[0]+", "+b[1]+", "+b[2]+", "+this.alpha+")";a.fillRect(0,0,this.width,this.height)};b.SlideshowCanvas.prototype.nextFrame=function(){if(0===this.frames.length)this.stopAnimation();
+else{this.phase=0;var a=this,b=1;this.innerHandle=setInterval(function(){a.alpha=b/15;a.repaint();15===b&&a.breakInnerHandle();b++},33)}};b.SlideshowCanvas.prototype.breakInnerHandle=function(){this.innerHandle&&(clearInterval(this.innerHandle),this.innerHandle=void 0);if(0===this.phase){this.curIndex++;this.curIndex>this.frames.length-1&&(this.curIndex=0);this.alpha=1;var a=this.frames[this.curIndex];this.loadContent(a.mols,a.shapes);this.phase=1;var b=this,c=1;this.innerHandle=setInterval(function(){b.alpha=
+(15-c)/15;b.repaint();c===15&&b.breakInnerHandle();c++},33)}else 1===this.phase&&(this.alpha=0,this.repaint())};b.SlideshowCanvas.prototype.addFrame=function(a,b){0===this.frames.length&&this.loadContent(a,b);this.frames.push({mols:a,shapes:b})}})(ChemDoodle,ChemDoodle.math);
+(function(b,e,a,h,c){b.TransformCanvas=function(a,b,c,e){a&&this.create(a,b,c);this.lastPoint=void 0;this.rotate3D=e;this.rotationMultMod=1.3;this.lastPinchScale=1;this.lastGestureRotate=0;return!0};b.TransformCanvas.prototype=new b._Canvas;b.TransformCanvas.prototype.mousedown=function(a){this.lastPoint=a.p};b.TransformCanvas.prototype.dblclick=function(){this.center();this.repaint()};b.TransformCanvas.prototype.drag=function(b){if(!this.lastPoint.multi){if(e.ALT){var f=new a.Point(b.p.x,b.p.y);
+f.sub(this.lastPoint);for(var q=0,g=this.molecules.length;q<g;q++){for(var o=this.molecules[q],m=0,j=o.atoms.length;m<j;m++)o.atoms[m].add(f);o.check()}q=0;for(g=this.shapes.length;q<g;q++){o=this.shapes[q].getPoints();m=0;for(j=o.length;m<j;m++)o[m].add(f)}this.lastPoint=b.p}else if(!0===this.rotate3D){j=h.max(this.width/4,this.height/4);m=(b.p.x-this.lastPoint.x)/j*this.rotationMultMod;j=-(b.p.y-this.lastPoint.y)/j*this.rotationMultMod;f=[];c.identity(f);c.rotate(f,j,[1,0,0]);c.rotate(f,m,[0,1,
+0]);q=0;for(g=this.molecules.length;q<g;q++){o=this.molecules[q];m=0;for(j=o.atoms.length;m<j;m++)q=o.atoms[m],g=[q.x-this.width/2,q.y-this.height/2,q.z],c.multiplyVec3(f,g),q.x=g[0]+this.width/2,q.y=g[1]+this.height/2,q.z=g[2];q=0;for(g=o.rings.length;q<g;q++)o.rings[q].center=o.rings[q].getCenter();this.lastPoint=b.p;this.specs.atoms_display&&this.specs.atoms_circles_2D&&o.sortAtomsByZ();this.specs.bonds_display&&this.specs.bonds_clearOverlaps_2D&&o.sortBondsByZ()}}else m=new a.Point(this.width/
+2,this.height/2),j=m.angle(this.lastPoint),this.specs.rotateAngle-=m.angle(b.p)-j,this.lastPoint=b.p;this.repaint()}};b.TransformCanvas.prototype.mousewheel=function(a,b){this.specs.scale+=b/10;0.01>this.specs.scale&&(this.specs.scale=0.01);this.repaint()};b.TransformCanvas.prototype.multitouchmove=function(b,c){if(2===c)if(this.lastPoint.multi){var e=new a.Point(b.p.x,b.p.y);e.sub(this.lastPoint);for(var g=0,h=this.molecules.length;g<h;g++){for(var m=this.molecules[g],j=0,l=m.atoms.length;j<l;j++)m.atoms[j].add(e);
+m.check()}g=0;for(h=this.shapes.length;g<h;g++){m=this.shapes[g].getPoints();j=0;for(l=m.length;j<l;j++)m[j].add(e)}this.lastPoint=b.p;this.lastPoint.multi=!0;this.repaint()}else this.lastPoint=b.p,this.lastPoint.multi=!0};b.TransformCanvas.prototype.gesturechange=function(b){0!==b.originalEvent.scale-this.lastPinchScale&&(this.specs.scale*=b.originalEvent.scale/this.lastPinchScale,0.01>this.specs.scale&&(this.specs.scale=0.01),this.lastPinchScale=b.originalEvent.scale);if(0!==this.lastGestureRotate-
+b.originalEvent.rotation){for(var c=(this.lastGestureRotate-b.originalEvent.rotation)/180*m.PI,e=new a.Point(this.width/2,this.height/2),g=0,h=this.molecules.length;g<h;g++){for(var m=this.molecules[g],j=0,l=m.atoms.length;j<l;j++){var n=m.atoms[j],r=e.distance(n),k=e.angle(n)+c;n.x=e.x+r*m.cos(k);n.y=e.y-r*m.sin(k)}m.check()}this.lastGestureRotate=b.originalEvent.rotation}this.repaint()};b.TransformCanvas.prototype.gestureend=function(){this.lastPinchScale=1;this.lastGestureRotate=0}})(ChemDoodle,
+ChemDoodle.monitor,ChemDoodle.structures,Math,mat4);(function(b){b.ViewerCanvas=function(b,a,h){b&&this.create(b,a,h);return!0};b.ViewerCanvas.prototype=new b._Canvas})(ChemDoodle);
+(function(b){b._SpectrumCanvas=function(b,a,h){b&&this.create(b,a,h);this.spectrum=void 0;this.emptyMessage="No Spectrum Loaded or Recognized";this.getMolecule=this.loadMolecule=void 0;return!0};b._SpectrumCanvas.prototype=new b._Canvas;b._SpectrumCanvas.prototype.innerRepaint=function(b){this.spectrum&&0<this.spectrum.data.length?this.spectrum.draw(b,this.specs,this.width,this.height):this.emptyMessage&&(b.fillStyle="#737683",b.textAlign="center",b.textBaseline="middle",b.font="18px Helvetica, Verdana, Arial, Sans-serif",
+b.fillText(this.emptyMessage,this.width/2,this.height/2))};b._SpectrumCanvas.prototype.loadSpectrum=function(b){this.spectrum=b;this.repaint()};b._SpectrumCanvas.prototype.getSpectrum=function(){return this.spectrum};b._SpectrumCanvas.prototype.getSpectrumCoordinates=function(b,a){return spectrum.getInternalCoordinates(b,a,this.width,this.height)}})(ChemDoodle,document);(function(b){b.ObserverCanvas=function(b,a,h){b&&this.create(b,a,h);return!0};b.ObserverCanvas.prototype=new b._SpectrumCanvas})(ChemDoodle);
+(function(b){b.OverlayCanvas=function(b,a,h){b&&this.create(b,a,h);this.overlaySpectra=[];return!0};b.OverlayCanvas.prototype=new b._SpectrumCanvas;b.OverlayCanvas.prototype.superRepaint=b.OverlayCanvas.prototype.innerRepaint;b.OverlayCanvas.prototype.innerRepaint=function(b){this.superRepaint(b);if(this.spectrum&&0<this.spectrum.data.length)for(var a=0,h=this.overlaySpectra.length;a<h;a++){var c=this.overlaySpectra[a];c&&0<c.data.length&&(c.minX=this.spectrum.minX,c.maxX=this.spectrum.maxX,c.drawPlot(b,
+this.specs,this.width,this.height,this.spectrum.memory.offsetTop,this.spectrum.memory.offsetLeft,this.spectrum.memory.offsetBottom))}};b.OverlayCanvas.prototype.addSpectrum=function(b){this.spectrum?this.overlaySpectra.push(b):this.spectrum=b}})(ChemDoodle);
+(function(b,e,a){b.PerspectiveCanvas=function(a,b,d){a&&this.create(a,b,d);this.dragRange=void 0;this.rescaleYAxisOnZoom=!0;this.lastPinchScale=1;return!0};b.PerspectiveCanvas.prototype=new b._SpectrumCanvas;b.PerspectiveCanvas.prototype.mousedown=function(a){this.dragRange=new b.structures.Point(a.p.x,a.p.x)};b.PerspectiveCanvas.prototype.mouseup=function(a){this.dragRange&&this.dragRange.x!==this.dragRange.y&&(this.dragRange.multi||(a=this.spectrum.zoom(this.dragRange.x,a.p.x,this.width,this.rescaleYAxisOnZoom),
+this.rescaleYAxisOnZoom&&(this.specs.scale=a)),this.dragRange=void 0,this.repaint())};b.PerspectiveCanvas.prototype.drag=function(a){this.dragRange&&(this.dragRange.multi?this.dragRange=void 0:(e.SHIFT&&(this.spectrum.translate(a.p.x-this.dragRange.x,this.width),this.dragRange.x=a.p.x),this.dragRange.y=a.p.x),this.repaint())};b.PerspectiveCanvas.prototype.drawChildExtras=function(b){if(this.dragRange){var c=a.min(this.dragRange.x,this.dragRange.y),d=a.max(this.dragRange.x,this.dragRange.y);b.strokeStyle=
+"gray";b.lineStyle=1;b.beginPath();for(b.moveTo(c,this.height/2);c<=d;c++)5>c%10?b.lineTo(c,a.round(this.height/2)):b.moveTo(c,a.round(this.height/2));b.stroke()}};b.PerspectiveCanvas.prototype.mousewheel=function(a,b){this.specs.scale+=b/10;0.01>this.specs.scale&&(this.specs.scale=0.01);this.repaint()};b.PerspectiveCanvas.prototype.dblclick=function(){this.spectrum.setup();this.specs.scale=1;this.repaint()};b.PerspectiveCanvas.prototype.multitouchmove=function(a,c){2===c&&(!this.dragRange||!this.dragRange.multi?
+(this.dragRange=new b.structures.Point(a.p.x,a.p.x),this.dragRange.multi=!0):(this.spectrum.translate(a.p.x-this.dragRange.x,this.width),this.dragRange.x=a.p.x,this.dragRange.y=a.p.x,this.repaint()))};b.PerspectiveCanvas.prototype.gesturechange=function(a){this.specs.scale*=a.originalEvent.scale/this.lastPinchScale;0.01>this.specs.scale&&(this.specs.scale=0.01);this.lastPinchScale=a.originalEvent.scale;this.repaint()};b.PerspectiveCanvas.prototype.gestureend=function(){this.lastPinchScale=1}})(ChemDoodle,
+ChemDoodle.monitor,Math);
+(function(b,e){b.SeekerCanvas=function(a,b,c,d){a&&this.create(a,b,c);this.seekType=d;this.p=void 0;return!0};b.SeekerCanvas.prototype=new b._SpectrumCanvas;b.SeekerCanvas.prototype.superRepaint=b.SeekerCanvas.prototype.innerRepaint;b.SeekerCanvas.prototype.innerRepaint=function(a){this.superRepaint(a);if(this.spectrum&&0<this.spectrum.data.length&&this.p){var h,c;if(this.seekType===b.SeekerCanvas.SEEK_POINTER)h=this.p,c=this.spectrum.getInternalCoordinates(h.x,h.y);else if(this.seekType===b.SeekerCanvas.SEEK_PLOT||
+this.seekType===b.SeekerCanvas.SEEK_PEAK){c=this.seekType===b.SeekerCanvas.SEEK_PLOT?this.spectrum.getClosestPlotInternalCoordinates(this.p.x):this.spectrum.getClosestPeakInternalCoordinates(this.p.x);if(!c)return;h={x:this.spectrum.getTransformedX(c.x,this.specs,this.width,this.spectrum.memory.offsetLeft),y:this.spectrum.getTransformedY(c.y/100,this.specs,this.height,this.spectrum.memory.offsetBottom,this.spectrum.memory.offsetTop)}}a.fillStyle="white";a.strokeStyle=this.specs.plots_color;a.lineWidth=
+this.specs.plots_width;a.beginPath();a.arc(h.x,h.y,3,0,2*e.PI,!1);a.fill();a.stroke();a.font=this.specs.getFontString(this.specs.text_font_size,this.specs.text_font_families);a.textAlign="left";a.textBaseline="bottom";c="x:"+c.x.toFixed(3)+", y:"+c.y.toFixed(3);var d=h.x+3,f=a.measureText(c).width;d+f>this.width-2&&(d-=6+f);h=h.y;0>h-this.specs.text_font_size-2&&(h+=this.specs.text_font_size);a.fillRect(d,h-this.specs.text_font_size,f,this.specs.text_font_size);a.fillStyle="black";a.fillText(c,d,
+h)}};b.SeekerCanvas.prototype.mouseout=function(){this.p=void 0;this.repaint()};b.SeekerCanvas.prototype.mousemove=function(a){this.p={x:a.p.x-2,y:a.p.y-3};this.repaint()};b.SeekerCanvas.prototype.touchstart=function(a){this.mousemove(a)};b.SeekerCanvas.prototype.touchmove=function(a){this.mousemove(a)};b.SeekerCanvas.prototype.touchend=function(a){this.mouseout(a)};b.SeekerCanvas.SEEK_POINTER="pointer";b.SeekerCanvas.SEEK_PLOT="plot";b.SeekerCanvas.SEEK_PEAK="peak"})(ChemDoodle,Math);
+(function(b,e,a,h,c,d,f,q,g,o,m){b._Canvas3D=function(a,b,c){a&&this.create(a,b,c);this.rotationMatrix=g.identity([]);this.translationMatrix=g.identity([]);this.lastPoint=void 0;this.emptyMessage="WebGL is Unavailable!";return!0};b._Canvas3D.prototype=new b._Canvas;b._Canvas3D.prototype.afterLoadContent=function(){for(var b=new a.Bounds,c=0,d=this.molecules.length;c<d;c++)b.expand(this.molecules[c].getBounds());this.maxDimension=f.max(b.maxX-b.minX,b.maxY-b.minY);this.translationMatrix=g.translate(g.identity([]),
+[0,0,-this.maxDimension-10]);this.setupScene()};b._Canvas3D.prototype.setViewDistance=function(a){this.translationMatrix=g.translate(g.identity([]),[0,0,-a])};b._Canvas3D.prototype.repaint=function(){if(this.gl){this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT);this.gl.modelViewMatrix=g.multiply(this.translationMatrix,this.rotationMatrix,[]);this.gl.rotationMatrix=this.rotationMatrix;for(var a=0,b=this.molecules.length;a<b;a++)this.molecules[a].render(this.gl,this.specs);a=0;for(b=
+this.shapes.length;a<b;a++)this.shapes[a].render(this.gl,this.specs);this.gl.flush()}};b._Canvas3D.prototype.center=function(){q.getElementById(this.id);for(var a=new h.Atom,b=0,c=this.molecules.length;b<c;b++){var d=this.molecules[b];a.add3D(d.getCenter3D())}a.x/=this.molecules.length;a.y/=this.molecules.length;b=0;for(c=this.molecules.length;b<c;b++){for(var d=this.molecules[b],f=0,e=d.atoms.length;f<e;f++)d.atoms[f].sub3D(a);if(d.chains&&d.fromJSON){f=0;for(e=d.chains.length;f<e;f++)for(var g=
+d.chains[f],m=0,o=g.length;m<o;m++){var w=g[m];w.cp1.sub3D(a);w.cp2.sub3D(a);w.cp3&&(w.cp3.sub3D(a),w.cp4.sub3D(a),w.cp5.sub3D(a))}}}};b._Canvas3D.prototype.subCreate=function(){try{var a=q.getElementById(this.id);this.gl=a.getContext("webgl");this.gl||(this.gl=a.getContext("experimental-webgl"))}catch(b){}this.gl?(this.gl.viewport(0,0,this.width,this.height),this.gl.program=this.gl.createProgram(),this.gl.shader=new c.Shader,this.gl.shader.init(this.gl),this.setupScene()):this.displayMessage()};
+b._Canvas.prototype.displayMessage=function(){var a=q.getElementById(this.id);if(a.getContext&&(a=a.getContext("2d"),this.specs.backgroundColor&&(a.fillStyle=this.specs.backgroundColor,a.fillRect(0,0,this.width,this.height)),this.emptyMessage))a.fillStyle="#737683",a.textAlign="center",a.textBaseline="middle",a.font="18px Helvetica, Verdana, Arial, Sans-serif",a.fillText(this.emptyMessage,this.width/2,this.height/2)};b._Canvas3D.prototype.setupScene=function(){if(this.gl){var b=a.getRGB(this.specs.backgroundColor,
+1);this.gl.clearColor(b[0],b[1],b[2],1);this.gl.clearDepth(1);this.gl.enable(this.gl.DEPTH_TEST);this.gl.depthFunc(this.gl.LEQUAL);this.gl.sphereBuffer=new c.Sphere(1,this.specs.atoms_resolution_3D,this.specs.atoms_resolution_3D);this.gl.starBuffer=new c.Star;this.gl.cylinderBuffer=new c.Cylinder(1,1,this.specs.bonds_resolution_3D);this.gl.lineBuffer=new c.Line;for(var b=0,h=this.molecules.length;b<h;b++){var q=this.molecules[b];q.unitCellVectors&&(q.unitCell=new c.UnitCell(q.unitCellVectors));if(q.chains){q.ribbons=
+[];q.cartoons=[];q.tubes=[];for(var r=0,k=q.chains.length;r<k;r++){var v=q.chains[r],x=2<v.length&&d[v[2].name]&&"#BEA06E"===d[v[2].name].aminoColor;if(0<v.length&&!v[0].lineSegments){for(var t=0,y=v.length-1;t<y;t++)v[t].setup(v[t+1].cp1,x?1:this.specs.proteins_horizontalResolution);if(!x){t=1;for(y=v.length-1;t<y;t++)e.vec3AngleFrom(v[t-1].D,v[t].D)>f.PI/2&&(v[t].guidePointsSmall.reverse(),v[t].guidePointsLarge.reverse(),m.scale(v[t].D,-1))}t=1;for(y=v.length-3;t<y;t++)v[t].computeLineSegments(v[t-
+1],v[t+1],v[t+2],!x,x?this.specs.nucleics_verticalResolution:this.specs.proteins_verticalResolution);v.pop();v.pop();v.pop();v.shift()}var w=a.hsl2rgb(1===k?0.5:r/k,1,0.5),w="rgb("+w[0]+","+w[1]+","+w[2]+")";v.chainColor=w;if(x)v=new c.Tube(v,this.specs.nucleics_tubeThickness,this.specs.nucleics_tubeResolution_3D),v.chainColor=w,q.tubes.push(v);else{x={front:new c.Ribbon(v,this.specs.proteins_ribbonThickness,!1),back:new c.Ribbon(v,-this.specs.proteins_ribbonThickness,!1)};x.front.chainColor=w;x.back.chainColor=
+w;t=0;for(y=x.front.segments.length;t<y;t++)x.front.segments[t].chainColor=w;t=0;for(y=x.back.segments.length;t<y;t++)x.back.segments[t].chainColor=w;q.ribbons.push(x);v={front:new c.Ribbon(v,this.specs.proteins_ribbonThickness,!0),back:new c.Ribbon(v,-this.specs.proteins_ribbonThickness,!0)};v.front.chainColor=w;v.back.chainColor=w;t=0;for(y=v.front.segments.length;t<y;t++)v.front.segments[t].chainColor=w;t=0;for(y=v.back.segments.length;t<y;t++)v.back.segments[t].chainColor=w;t=0;for(y=v.front.cartoonSegments.length;t<
+y;t++)v.front.cartoonSegments[t].chainColor=w;t=0;for(y=v.back.cartoonSegments.length;t<y;t++)v.back.cartoonSegments[t].chainColor=w;q.cartoons.push(v)}}}}this.gl.lighting=new c.Light(this.specs.lightDiffuseColor_3D,this.specs.lightSpecularColor_3D,this.specs.lightDirection_3D);this.gl.lighting.lightScene(this.gl);this.gl.material=new c.Material(this.gl);b=this.width/this.height;this.specs.projectionWidthHeightRatio_3D&&(b=this.specs.projectionWidthHeightRatio_3D);this.gl.projectionMatrix=this.specs.projectionPerspective_3D?
+g.perspective(this.specs.projectionPerspectiveVerticalFieldOfView_3D,b,this.specs.projectionFrontCulling_3D,this.specs.projectionBackCulling_3D):g.ortho(-this.specs.projectionOrthoWidth_3D/2,this.specs.projectionOrthoWidth_3D/2,-this.specs.projectionOrthoWidth_3D/2/b,this.specs.projectionOrthoWidth_3D/2/b,this.specs.projectionFrontCulling_3D,this.specs.projectionBackCulling_3D);this.gl.uniformMatrix4fv(this.gl.getUniformLocation(this.gl.program,"u_projection_matrix"),!1,this.gl.projectionMatrix);
+var u=this.gl.getUniformLocation(this.gl.program,"u_model_view_matrix"),p=this.gl.getUniformLocation(this.gl.program,"u_normal_matrix");this.gl.setMatrixUniforms=function(a){this.uniformMatrix4fv(u,false,a);a=o.transpose(g.toInverseMat3(a,[]));this.uniformMatrix3fv(p,false,a)}}};b._Canvas3D.prototype.mousedown=function(a){this.lastPoint=a.p};b._Canvas3D.prototype.rightmousedown=function(a){this.lastPoint=a.p};b._Canvas3D.prototype.drag=function(a){if(b.monitor.ALT){var c=new h.Point(a.p.x,a.p.y);
+c.sub(this.lastPoint);g.translate(this.translationMatrix,[c.x/20,-c.y/20,0])}else{var d=a.p.x-this.lastPoint.x,c=a.p.y-this.lastPoint.y,d=g.rotate(g.identity([]),d*f.PI/180,[0,1,0]);g.rotate(d,c*f.PI/180,[1,0,0]);this.rotationMatrix=g.multiply(d,this.rotationMatrix)}this.lastPoint=a.p;this.repaint()};b._Canvas3D.prototype.mousewheel=function(a,b){var c=b*this.maxDimension/8;this.specs.projectionPerspective_3D?g.translate(this.translationMatrix,[0,0,c]):(this.specs.projectionOrthoWidth_3D-=c,this.setupScene());
+this.repaint()}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.math,ChemDoodle.structures,ChemDoodle.structures.d3,ChemDoodle.RESIDUE,Math,document,mat4,mat3,vec3,window);
+(function(b,e,a,h){b.MolGrabberCanvas3D=function(b,d,f){b&&this.create(b,d,f);d=[];d.push('<br><input type="text" id="');d.push(b);d.push('_query" size="32" value="" />');d.push("<br><nobr>");d.push('<select id="');d.push(b);d.push('_select">');d.push('<option value="pubchem" selected>PubChem');d.push("</select>");d.push('<button id="');d.push(b);d.push('_submit">Show Molecule</button>');d.push("</nobr>");h.writeln(d.join(""));var e=this;a("#"+b+"_submit").click(function(){e.search()});a("#"+b+"_query").keypress(function(a){13===
+a.which&&e.search()});return!0};b.MolGrabberCanvas3D.prototype=new b._Canvas3D;b.MolGrabberCanvas3D.prototype.setSearchTerm=function(b){a("#"+this.id+"_query").val(b);this.search()};b.MolGrabberCanvas3D.prototype.search=function(){var b=this;e.getMoleculeFromDatabase(a("#"+this.id+"_query").val(),{database:a("#"+this.id+"_select").val(),dimension:3},function(a){b.loadMolecule(a)})}})(ChemDoodle,ChemDoodle.iChemLabs,jQuery,document);
+(function(b,e){b.MovieCanvas3D=function(a,b,c){a&&this.create(a,b,c);this.timeout=50;this.frames=[];this.frameNumber=0;this.playMode=2;this.reverse=!1;return!0};b.MovieCanvas3D.PLAY_ONCE=0;b.MovieCanvas3D.PLAY_LOOP=1;b.MovieCanvas3D.PLAY_SPRING=2;b.MovieCanvas3D.prototype=new b._Canvas3D;b.MovieCanvas3D.prototype.startAnimation=b._AnimatorCanvas.prototype.startAnimation;b.MovieCanvas3D.prototype.stopAnimation=b._AnimatorCanvas.prototype.stopAnimation;b.MovieCanvas3D.prototype.isRunning=b._AnimatorCanvas.prototype.isRunning;
+b.MovieCanvas3D.prototype.dblclick=b.RotatorCanvas.prototype.dblclick;b.MovieCanvas3D.prototype.nextFrame=function(){var a=this.frames[this.frameNumber];this.molecules=a.mols;this.shapes=a.shapes;2===this.playMode&&this.reverse?(this.frameNumber--,0>this.frameNumber&&(this.frameNumber=1,this.reverse=!1)):(this.frameNumber++,this.frameNumber>=this.frames.length&&(2===this.playMode?(this.frameNumber-=2,this.reverse=!0):(this.frameNumber=0,0===this.playMode&&this.stopAnimation())))};b.MovieCanvas3D.prototype.center=
+function(){for(var a=new e.Atom,b=this.frames[0],c=0,d=b.mols.length;c<d;c++)a.add3D(b.mols[c].getCenter3D());a.x/=b.mols.length;a.y/=b.mols.length;b=new e.Atom;b.sub3D(a);for(var a=0,f=this.frames.length;a<f;a++)for(var q=this.frames[a],c=0,d=q.mols.length;c<d;c++)for(var g=q.mols[c],o=0,m=g.atoms.length;o<m;o++)g.atoms[o].add3D(b)};b.MovieCanvas3D.prototype.addFrame=function(a,b){this.frames.push({mols:a,shapes:b})}})(ChemDoodle,ChemDoodle.structures);
+(function(b,e,a){var h=[],c=[1,0,0],d=[0,1,0],f=[0,0,1];b.RotatorCanvas3D=function(a,b,c){a&&this.create(a,b,c);this.timeout=33;this.zIncrement=this.yIncrement=this.xIncrement=a=e.PI/15;return!0};b.RotatorCanvas3D.prototype=new b._Canvas3D;b.RotatorCanvas3D.prototype.startAnimation=b._AnimatorCanvas.prototype.startAnimation;b.RotatorCanvas3D.prototype.stopAnimation=b._AnimatorCanvas.prototype.stopAnimation;b.RotatorCanvas3D.prototype.isRunning=b._AnimatorCanvas.prototype.isRunning;b.RotatorCanvas3D.prototype.dblclick=
+b.RotatorCanvas.prototype.dblclick;b.RotatorCanvas3D.prototype.mousedown=void 0;b.RotatorCanvas3D.prototype.rightmousedown=void 0;b.RotatorCanvas3D.prototype.drag=void 0;b.RotatorCanvas3D.prototype.mousewheel=void 0;b.RotatorCanvas3D.prototype.nextFrame=function(b){0===this.molecules.length&&0===this.shapes.length?this.stopAnimation():(a.identity(h),b/=1E3,a.rotate(h,this.xIncrement*b,c),a.rotate(h,this.yIncrement*b,d),a.rotate(h,this.zIncrement*b,f),a.multiply(this.rotationMatrix,h))}})(ChemDoodle,
+Math,mat4);(function(b){b.TransformCanvas3D=function(b,a,h){b&&this.create(b,a,h);return!0};b.TransformCanvas3D.prototype=new b._Canvas3D})(ChemDoodle);(function(b){b.ViewerCanvas3D=function(b,a,h){b&&this.create(b,a,h);return!0};b.ViewerCanvas3D.prototype=new b._Canvas3D;b.ViewerCanvas3D.prototype.mousedown=void 0;b.ViewerCanvas3D.prototype.rightmousedown=void 0;b.ViewerCanvas3D.prototype.drag=void 0;b.ViewerCanvas3D.prototype.mousewheel=void 0})(ChemDoodle);
+(function(b,e,a){function h(a,b,f,e){this.element=a;this.x=b;this.y=f;this.dimension=e}b.PeriodicTableCanvas=function(a,b){this.padding=5;a&&this.create(a,18*b+2*this.padding,10*b+2*this.padding);this.getMolecule=this.loadMolecule=void 0;this.cellDimension=b?b:20;this.setupTable();this.repaint();return!0};b.PeriodicTableCanvas.prototype=new b._Canvas;b.PeriodicTableCanvas.prototype.getHoveredElement=function(){if(this.hovered)return this.hovered.element};b.PeriodicTableCanvas.prototype.innerRepaint=
+function(a){for(var b=0,f=this.cells.length;b<f;b++)this.drawCell(a,this.specs,this.cells[b]);this.hovered&&this.drawCell(a,this.specs,this.hovered);this.selected&&this.drawCell(a,this.specs,this.selected)};b.PeriodicTableCanvas.prototype.setupTable=function(){this.cells=[];for(var a=this.padding,d=this.padding,f=0,e=0,g=b.SYMBOLS.length;e<g;e++){18===f&&(f=0,d+=this.cellDimension,a=this.padding);var o=b.ELEMENT[b.SYMBOLS[e]];if(2===o.atomicNumber)a+=16*this.cellDimension,f+=16;else if(5===o.atomicNumber||
+13===o.atomicNumber)a+=10*this.cellDimension,f+=10;if((58>o.atomicNumber||71<o.atomicNumber&&90>o.atomicNumber||103<o.atomicNumber)&&113>o.atomicNumber)this.cells.push(new h(o,a,d,this.cellDimension)),a+=this.cellDimension,f++}d+=2*this.cellDimension;a=3*this.cellDimension+this.padding;for(e=57;104>e;e++)if(o=b.ELEMENT[b.SYMBOLS[e]],90===o.atomicNumber&&(d+=this.cellDimension,a=3*this.cellDimension+this.padding),58<=o.atomicNumber&&71>=o.atomicNumber||90<=o.atomicNumber&&103>=o.atomicNumber)this.cells.push(new h(o,
+a,d,this.cellDimension)),a+=this.cellDimension};b.PeriodicTableCanvas.prototype.drawCell=function(a,b,f){var h=a.createRadialGradient(f.x+f.dimension/3,f.y+f.dimension/3,1.5*f.dimension,f.x+f.dimension/3,f.y+f.dimension/3,f.dimension/10);h.addColorStop(0,"#000000");h.addColorStop(0.7,f.element.jmolColor);h.addColorStop(1,"#FFFFFF");a.fillStyle=h;e.contextRoundRect(a,f.x,f.y,f.dimension,f.dimension,f.dimension/8);if(f===this.hovered||f===this.selected)a.lineWidth=2,a.strokeStyle="#c10000",a.stroke(),
+a.fillStyle="white";a.fill();a.font=b.getFontString(b.text_font_size,b.text_font_families);a.fillStyle=b.text_color;a.textAlign="center";a.textBaseline="middle";a.fillText(f.element.symbol,f.x+f.dimension/2,f.y+f.dimension/2)};b.PeriodicTableCanvas.prototype.click=function(){this.hovered&&(this.selected=this.hovered,this.repaint())};b.PeriodicTableCanvas.prototype.mousemove=function(b){var d=b.p.x,b=b.p.y;this.hovered=void 0;for(var f=0,e=this.cells.length;f<e;f++){var g=this.cells[f];if(a.isBetween(d,
+g.x,g.x+g.dimension)&&a.isBetween(b,g.y,g.y+g.dimension)){this.hovered=g;break}}this.repaint()};b.PeriodicTableCanvas.prototype.mouseout=function(){this.hovered=void 0;this.repaint()}})(ChemDoodle,ChemDoodle.extensions,ChemDoodle.math,document);(function(b,e){b._Layout=function(){return!0};b._Layout.prototype.layout=function(){this.innerLayout&&this.innerLayout()};b._Layout.prototype.create=function(a){this.name=a;this.specs=new e.VisualSpecifications}})(ChemDoodle,ChemDoodle.structures);
+(function(b,e,a){b.SimpleReactionLayout=function(a){this.reactants=[];this.products=[];this.textBelow=this.textAbove=void 0;this.arrow="→";this.plus="+";this.create(a);return!0};b.SimpleReactionLayout.prototype=new b._Layout;b.SimpleReactionLayout.prototype.addReactant=function(a){this.reactants.push(a)};b.SimpleReactionLayout.prototype.addProduct=function(a){this.products.push(a)};b.SimpleReactionLayout.prototype.innerLayout=function(){var b=[];b.push("<table><tr>");for(var c=0,d=this.reactants.length;c<
+d;c++){0<c&&(b.push("<td>"),b.push('<span style="font-size:25px;">'),b.push(this.plus),b.push("</span></td>"));b.push("<td>");var f=this.reactants[c].getDimension();b.push('<canvas class="ChemDoodleWebComponent" id="');b.push(this.name);b.push("_reactant");b.push(c);b.push('" width="');b.push(f.x+60);b.push('" height="');b.push(f.y+60);b.push('"></canvas>');b.push("</td>")}b.push("<td>");b.push("<table>");b.push("<tr><td>");this.textAbove?(b.push("<center>"),b.push(this.textAbove),b.push("</center>")):
+b.push(" ");b.push("</td></tr>");b.push("<tr><td><center>");b.push('<span style="font-size:25px;">');b.push(this.arrow);b.push("</span></center></td></tr>");b.push("<tr><td>");this.textBelow?(b.push("<center>"),b.push(this.textBelow),b.push("</center>")):b.push(" ");b.push("</td></tr>");b.push("</table>");b.push("</td>");c=0;for(d=this.products.length;c<d;c++)0<c&&(b.push("<td>"),b.push('<span style="font-size:25px;">'),b.push(this.plus),b.push("</td>")),b.push("<td>"),f=this.products[c].getDimension(),
+b.push('<canvas class="ChemDoodleWebComponent" id="'),b.push(this.name),b.push("_product"),b.push(c),b.push('" width="'),b.push(f.x+60),b.push('" height="'),b.push(f.y+60),b.push('"></canvas>'),b.push("</td>");b.push("</tr></table>");a.getElementById(this.name)?e("#"+this.name).append(b.join("")):a.writeln(b.join(""));c=0;for(d=this.reactants.length;c<d;c++)b=new ChemDoodle.ViewerCanvas(this.name+"_reactant"+c),this.specs.backgroundColor||e("#"+this.name+"_reactant"+c).css("border","0px"),b.specs=
+this.specs,b.loadMolecule(this.reactants[c]);c=0;for(d=this.products.length;c<d;c++)b=new ChemDoodle.ViewerCanvas(this.name+"_product"+c),this.specs.backgroundColor||e("#"+this.name+"_product"+c).css("border","0px"),b.specs=this.specs,b.loadMolecule(this.products[c])}})(ChemDoodle,jQuery,document);(function(b,e,a){b.png={};b.png.create=function(b){a.open(e.getElementById(b.id).toDataURL("image/png"))}})(ChemDoodle.io,document,window);
+(function(b,e){b.file={};b.file.content=function(a,b){e.get(a,"",b)}})(ChemDoodle.io,jQuery);
+(function(b,e,a,h,c){e.SERVER_URL="http://ichemlabs.cloud.chemdoodle.com/icl_cdc_v050000/WebHQ";e.inRelay=!1;e.asynchronous=!0;e.INFO={userAgent:navigator.userAgent,v_cwc:b.getVersion(),v_jQuery:c.version,v_jQuery_ui:c.ui?c.ui.version:"N/A"};var d=new a.JSONInterpreter;e._contactServer=function(a,b,d,h,m){this.inRelay?alert("Already connecting to the server, please wait for the first request to finish."):(e.inRelay=!0,c.ajax({dataType:"text",type:"POST",data:JSON.stringify({call:a,content:b,options:d,
+info:e.INFO}),url:this.SERVER_URL,success:function(a){e.inRelay=!1;a=JSON.parse(a);a.message&&alert(a.message);h&&a.content&&!a.stop&&h(a.content);a.stop&&m&&m()},error:function(){e.inRelay=!1;alert("Call failed. Please try again. If you continue to see this message, please contact iChemLabs customer support.");m&&m()},xhrFields:{withCredentials:!0},async:e.asynchronous}))};e.authenticate=function(a,b,c,d){this._contactServer("authenticate",{credential:a},b,function(a){c(a)},d)};e.calculate=function(a,
+b,c,e){this._contactServer("calculate",{mol:d.molTo(a)},b,function(a){c(a)},e)};e.generateImage=function(a,b,c,e){this._contactServer("generateImage",{mol:d.molTo(a)},b,function(a){c(a.link)},e)};e.getAd=function(a,b){this._contactServer("getAd",{},{},function(b){a(b.image_url,b.target_url)},b)};e.getMoleculeFromContent=function(a,b,c,e){this._contactServer("getMoleculeFromContent",{content:a},b,function(a){for(var b=!1,f=0,e=a.mol.a.length;f<e;f++)if(0!==a.mol.a[f].z){b=!0;break}if(b){f=0;for(e=
+a.mol.a.length;f<e;f++)a.mol.a[f].x/=20,a.mol.a[f].y/=20,a.mol.a[f].z/=20}c(d.molFrom(a.mol))},e)};e.getMoleculeFromDatabase=function(a,b,c,e){this._contactServer("getMoleculeFromDatabase",{query:a},b,function(a){if(3===b.dimension)for(var f=0,e=a.mol.a.length;f<e;f++)a.mol.a[f].x/=20,a.mol.a[f].y/=-20,a.mol.a[f].z/=20;c(d.molFrom(a.mol))},e)};e.getOptimizedPDBStructure=function(a,b,c,e){this._contactServer("getOptimizedPDBStructure",{id:a},b,function(a){var b;b=a.mol?d.molFrom(a.mol):new h.Molecule;
+b.chains=d.chainsFrom(a.ribbons);b.fromJSON=!0;c(b)},e)};e.getZeoliteFromIZA=function(a,b,c,d){this._contactServer("getZeoliteFromIZA",{query:a},b,function(a){c(ChemDoodle.readCIF(a.cif,b.xSuper,b.ySuper,b.zSuper))},d)};e.isGraphIsomorphism=function(a,b,c,e,h){this._contactServer("isGraphIsomorphism",{arrow:d.molTo(a),target:d.molTo(b)},c,function(a){e(a.value)},h)};e.isSubgraphIsomorphism=function(a,b,c,e,h){this._contactServer("isSubgraphIsomorphism",{arrow:d.molTo(a),target:d.molTo(b)},c,function(a){e(a.value)},
+h)};e.kekulize=function(a,b,c,e){this._contactServer("kekulize",{mol:d.molTo(a)},b,function(a){c(d.molFrom(a.mol))},e)};e.optimize=function(a,b,c,e){this._contactServer("optimize",{mol:d.molTo(a)},b,function(e){e=d.molFrom(e.mol);if(2===b.dimension){for(var h=0,l=e.atoms.length;h<l;h++)a.atoms[h].x=e.atoms[h].x,a.atoms[h].y=e.atoms[h].y;c()}else if(3===b.dimension){h=0;for(l=e.atoms.length;h<l;h++)e.atoms[h].x/=20,e.atoms[h].y/=-20,e.atoms[h].z/=20;c(e)}},e)};e.readIUPACName=function(a,b,c,e){this._contactServer("readIUPACName",
+{iupac:a},b,function(a){c(d.molFrom(a.mol))},e)};e.readSMILES=function(a,b,c,e){this._contactServer("readSMILES",{smiles:a},b,function(a){c(d.molFrom(a.mol))},e)};e.saveFile=function(a,b,c,e){this._contactServer("saveFile",{mol:d.molTo(a)},b,function(a){c(a.link)},e)};e.simulate13CNMR=function(a,c,e,h){c.nucleus="C";c.isotope=13;this._contactServer("simulateNMR",{mol:d.molTo(a)},c,function(a){e(b.readJCAMP(a.jcamp))},h)};e.simulate1HNMR=function(a,c,e,h){c.nucleus="H";c.isotope=1;this._contactServer("simulateNMR",
+{mol:d.molTo(a)},c,function(a){e(b.readJCAMP(a.jcamp))},h)};e.simulateMassParentPeak=function(a,c,e,h){this._contactServer("simulateMassParentPeak",{mol:d.molTo(a)},c,function(a){e(b.readJCAMP(a.jcamp))},h)};e.writeSMILES=function(a,b,c,e){this._contactServer("writeSMILES",{mol:d.molTo(a)},b,function(a){c(a.smiles)},e)}})(ChemDoodle,ChemDoodle.iChemLabs,ChemDoodle.io,ChemDoodle.structures,jQuery);
Added: trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/ChemDoodleWeb/js/jquery-ui-1.9.2.custom.min.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,6 @@
+/*! jQuery UI - v1.9.2 - 2012-11-29
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.button.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tooltip.js
+* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
+
+(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);(function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);
\ No newline at end of file
Added: trunk/cantharella.web/src/main/webapp/js/jquery-1.9.0.min.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/js/jquery-1.9.0.min.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/js/jquery-1.9.0.min.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,4 @@
+/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
+},set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
+},nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
+//@ sourceMappingURL=jquery.min.map
\ No newline at end of file
Added: trunk/cantharella.web/src/main/webapp/js/moleditor.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/js/moleditor.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/js/moleditor.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,38 @@
+function addEditorMolecule(tagId) {
+ if (tagId) {
+ tagId = '#' + tagId.replace( /(:|\.)/g, "\\$1" );
+ } else {
+ tagId = '[formula]';
+ }
+
+ $(tagId).each(function(i, formulaTag) {
+ // il faut faire un substring de 1 car on a ajoute un caractere pour
+ // forcer l'existance du tag'
+ var formulaString = $(formulaTag).attr('formula').substring(1);
+ var id = $(formulaTag).attr('id');
+ $(formulaTag).after("<div><canvas id='"+id+"'/><div>");
+
+ // changes the default JMol color of hydrogen to black so it appears on white backgrounds
+ ChemDoodle.ELEMENT['H'].jmolColor = 'black';
+ // darkens the default JMol color of sulfur so it appears on white backgrounds
+ ChemDoodle.ELEMENT['S'].jmolColor = '#B9A130';
+ var sketcher = new ChemDoodle.SketcherCanvas(id, 500, 300,{oneMolecule:true});
+ sketcher.specs.atoms_displayTerminalCarbonLabels_2D = true;
+ sketcher.specs.atoms_useJMOLColors = true;
+ sketcher.specs.bonds_clearOverlaps_2D = true;
+ sketcher.repaint();
+
+ // on se met listener du submit de la form pour pousser la molecule
+ // editer dans le champs de sauvegarde
+ $(formulaTag).parents('form').submit(function() {
+ var mol = sketcher.getMolecule();
+ var molString = ChemDoodle.writeMOL(mol);
+ $(formulaTag).val(molString);
+ return true;
+ });
+
+ var formula = ChemDoodle.readMOL(formulaString);
+ sketcher.loadMolecule(formula);
+ });
+
+}
Added: trunk/cantharella.web/src/main/webapp/js/molviewer.js
===================================================================
--- trunk/cantharella.web/src/main/webapp/js/molviewer.js (rev 0)
+++ trunk/cantharella.web/src/main/webapp/js/molviewer.js 2013-01-24 11:34:39 UTC (rev 57)
@@ -0,0 +1,28 @@
+function addViewerMolecule(tagId) {
+ if (tagId) {
+ tagId = '#' + tagId.replace( /(:|\.)/g, "\\$1" );
+ } else {
+ tagId = '[formula]';
+ }
+
+ $(tagId).each(function(i, formulaTag) {
+ // il faut faire un substring de 1 car on a ajoute un caractere pour
+ // forcer l'existance du tag'
+ var formulaString = $(formulaTag).attr('formula').substring(1);
+ var id = $(formulaTag).attr('id');
+ $(formulaTag).replaceWith("<canvas id='"+id+"'/>");
+
+ //initialize component and set visual specifications
+ var viewerCanvas = new ChemDoodle.ViewerCanvas(id, 100, 100);
+ viewerCanvas.specs.bonds_width_2D = .6;
+ viewerCanvas.specs.bonds_saturationWidth_2D = .18;
+ viewerCanvas.specs.bonds_hashSpacing_2D = 2.5;
+ viewerCanvas.specs.atoms_font_size_2D = 10;
+ viewerCanvas.specs.atoms_font_families_2D = ["Helvetica", "Arial", "sans-serif"];
+ viewerCanvas.specs.atoms_displayTerminalCarbonLabels_2D = true;
+
+ var formula = ChemDoodle.readMOL(formulaString);
+ viewerCanvas.loadMolecule(formula);
+ });
+
+}
1
0
Author: echatellier
Date: 2013-01-18 18:07:45 +0100 (Fri, 18 Jan 2013)
New Revision: 56
Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/56
Log:
Remove solr extra from assembly (reduce size by 30%)
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-18 16:36:05 UTC (rev 55)
+++ trunk/pom.xml 2013-01-18 17:07:45 UTC (rev 56)
@@ -318,6 +318,13 @@
<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>
1
0