Improved PrintPublisher Wizard; Integrated SpecimenCdmExcel import
authorn.hoffmann <n.hoffmann@localhost>
Tue, 24 May 2011 15:31:21 +0000 (15:31 +0000)
committern.hoffmann <n.hoffmann@localhost>
Tue, 24 May 2011 15:31:21 +0000 (15:31 +0000)
35 files changed:
.gitattributes
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptRelationshipTypeOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicGroupOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicalGroupBasionymOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToConceptOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToMisapplicationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateConceptRelationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateDescriptionElementOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExisitingHomotypicalGroupOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInNewGroupOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteConceptRelationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteDescriptionElementOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteSynonymOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/MoveTaxonOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperationTest.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/PrintUtil.java [moved from eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PrintUtil.java with 89% similarity]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizard.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizardPage.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/DirectPublishingWizard.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/IHasPersistableSettings.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OptionsWizardPage.java [deleted file]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OverviewWizardPage.java [deleted file]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectDirectoryWizardPage.java [moved from eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectFolderWizardPage.java with 77% similarity]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectOptionsWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectStylesheetWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SpecimenCdmExcelImportWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/VersionElement.java

index b84a2833b547419fd36d4bc5a3a33136585dad7e..b63e89750564ab193edca13741e4572d38086951 100644 (file)
@@ -564,21 +564,22 @@ eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF -text
 eu.etaxonomy.taxeditor.printpublisher/build.properties -text
 eu.etaxonomy.taxeditor.printpublisher/plugin.xml -text
 eu.etaxonomy.taxeditor.printpublisher/pom.xml -text
+eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/PrintUtil.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/internal/PrintpublisherPlugin.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizard.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizardPage.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/DirectPublishingWizard.java -text
-eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OptionsWizardPage.java -text
-eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OverviewWizardPage.java -text
-eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PrintUtil.java -text
+eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/IHasPersistableSettings.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PublishWizardODF.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PublishWizardPDF.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PublishWizardTaxPub.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PublishWizardXML.java -text
+eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectDirectoryWizardPage.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectFeatureTreeWizardPage.java -text
-eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectFolderWizardPage.java -text
+eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectOptionsWizardPage.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java -text
+eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectStylesheetWizardPage.java -text
 eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectTaxaWizardPage.java -text
 eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF -text
 eu.etaxonomy.taxeditor.store/build.properties -text
@@ -767,6 +768,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/Jaxb
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/NomenclaturalCodeWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddExportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddImportWizard.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SpecimenCdmExcelImportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/TcsExportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/TcsImportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/labels/DefaultLabelStrategy.java -text
index 51a4b8d3f9b156d3be2e26107d21ba161fff6acd..1b1f33ec17255a568c72fece81a493271388c1a6 100644 (file)
@@ -12,7 +12,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTypeOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * Specification for changing the concept relation between two taxa
@@ -21,7 +21,7 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
  * @created 07.04.2009
  * @version 1.0
  */
-public class ChangeConceptRelationshipTypeOperationTest extends AbstractTaxeditorOperationTest {
+public class ChangeConceptRelationshipTypeOperationTest extends AbstractTaxeditorOperationTestBase {
        
        private static Taxon relatedTaxon;
 
index be3ca5264b61a88da3ae4c7eba4ac0b5fa45268e..13b8f075196c4a6ab8e3ad718178abcd2b793c42 100644 (file)
@@ -25,14 +25,14 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class ChangeConceptToSynonymOperationTest extends AbstractTaxeditorOperationTest {
+public class ChangeConceptToSynonymOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(ChangeConceptToSynonymOperationTest.class);
        
index 47f3d551bc27191aab82a84ef57db6c84d5f2090..06511cd508cfebcd1c3492fb019a9b9757ef97ca 100644 (file)
@@ -23,14 +23,14 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 02.04.2009
  * @version 1.0
  */
-public class ChangeHomotypicGroupOperationTest extends AbstractTaxeditorOperationTest {
+public class ChangeHomotypicGroupOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(ChangeHomotypicGroupOperationTest.class);
 
index 5270235ba1fde546a9ce73af6fba6965625059fc..5a799ca7c9341173df598125154f9403d2fe6f72 100644 (file)
@@ -20,14 +20,14 @@ import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicalGroupBasionymOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class ChangeHomotypicalGroupBasionymOperationTest extends AbstractTaxeditorOperationTest {
+public class ChangeHomotypicalGroupBasionymOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(ChangeHomotypicalGroupBasionymOperationTest.class);
 
index 0fbc234de95847acccba77b3a783b86bf0cff643..62ca21fe9c64aa9146b8a115bf9b7b4974e4003b 100644 (file)
@@ -25,14 +25,14 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToConceptOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class ChangeSynonymToConceptOperationTest extends AbstractTaxeditorOperationTest{
+public class ChangeSynonymToConceptOperationTest extends AbstractTaxeditorOperationTestBase{
        private static final Logger logger = Logger
                        .getLogger(ChangeSynonymToConceptOperationTest.class);
 
index a8ac9e91fe70d586826202558005b698eb00e0c7..b5ea54a75bd81be4162347d60f40928a1d60c956 100644 (file)
@@ -23,14 +23,14 @@ import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToMisapplicationOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class ChangeSynonymToMisapplicationOperationTest extends AbstractTaxeditorOperationTest {
+public class ChangeSynonymToMisapplicationOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(ChangeSynonymToMisapplicationOperationTest.class);
 
index 2a46ab9f0e3289e61d00c144b7831d35dd47b24c..5a6d9b455f40d58ddb3d707eb5409a8a1d88e8cb 100644 (file)
@@ -21,14 +21,14 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class CreateConceptRelationOperationTest extends AbstractTaxeditorOperationTest {
+public class CreateConceptRelationOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(CreateConceptRelationOperationTest.class);
 
index 9bf4f856ac646810ad36fe8a3d63c1bef9263dea..2436e7f0ca254181878aeaf55914269b22b9f51f 100644 (file)
@@ -13,9 +13,9 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
-public class CreateDescriptionElementOperationTest extends AbstractTaxeditorOperationTest {
+public class CreateDescriptionElementOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(CreateDescriptionElementOperationTest.class);
 
index 1f93dcc325163cb05333618b7dfd6b1470391d2d..39909f5cfc37f7d1a7f65024e98c61a99b3d6348 100644 (file)
@@ -22,14 +22,14 @@ import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends AbstractTaxeditorOperationTest {
+public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends AbstractTaxeditorOperationTestBase {
 
        private TaxonNameBase newSynonymName;
 
index f432e6a2b9deb32bf71dcf784d7dbd5e3ea9d52b..8dc9a435f03a5f916db5befff8e87c5d1475b56f 100644 (file)
@@ -19,14 +19,14 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInNewGroupOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 07.04.2009
  * @version 1.0
  */
-public class CreateSynonymInNewGroupOperationTest extends AbstractTaxeditorOperationTest {     
+public class CreateSynonymInNewGroupOperationTest extends AbstractTaxeditorOperationTestBase { 
        
        private static TaxonNameBase newSynonymName;
        
index b27f2850f7c12c525224d3aa51df7bb6948977e9..458dfd121f51ef62a0b5d307844512c14d7154e8 100644 (file)
@@ -19,14 +19,14 @@ import org.junit.Test;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class DeleteConceptRelationOperationTest extends AbstractTaxeditorOperationTest{
+public class DeleteConceptRelationOperationTest extends AbstractTaxeditorOperationTestBase{
        private static final Logger logger = Logger
                        .getLogger(DeleteConceptRelationOperationTest.class);
 
index 0ca333444130d6fe71872761e41dd22b23a78f38..1dc962c6cec7e27282f6eb41471cf9e948b6d969 100644 (file)
@@ -20,14 +20,14 @@ import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class DeleteDescriptionElementOperationTest extends AbstractTaxeditorOperationTest {
+public class DeleteDescriptionElementOperationTest extends AbstractTaxeditorOperationTestBase {
 
        private static DescriptionElementBase descriptionElement;
 
index 80ae0e752a03759a92b9af4b15f6603affa0110d..f52990bd3c7553766f2433d0ebf7d61a5bb882a9 100644 (file)
@@ -19,14 +19,14 @@ import org.junit.Test;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class DeleteMisapplicationOperationTest extends AbstractTaxeditorOperationTest{
+public class DeleteMisapplicationOperationTest extends AbstractTaxeditorOperationTestBase{
        private static final Logger logger = Logger
                        .getLogger(DeleteMisapplicationOperationTest.class);
 
index b4f4b41b6a628b7b8d1e69a950462973e5b30f2d..19e794c574a0edfaab218df647979047e8124737 100644 (file)
@@ -20,14 +20,14 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteSynonymOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class DeleteSynonymOperationTest extends AbstractTaxeditorOperationTest{
+public class DeleteSynonymOperationTest extends AbstractTaxeditorOperationTestBase{
        private static final Logger logger = Logger
                        .getLogger(DeleteSynonymOperationTest.class);
 
index c265e879e0e7ff3c4b3647c497764e4806839a96..f3dae1afbf4e3ea4c650d881cccbd12c5e3c4e7f 100644 (file)
@@ -18,14 +18,14 @@ import org.junit.Test;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 08.04.2009
  * @version 1.0
  */
-public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTest {
+public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTestBase {
 
        private static Taxon oldParentTaxon;
        private static Taxon newParentTaxon;
index c4d7a303451969ae495678cf9ad49969b190dc86..7f4d1d4859ed626314fb8b7a94bcd21dee04b8e5 100644 (file)
@@ -28,14 +28,14 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTest;
+import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
  * @author n.hoffmann
  * @created 02.04.2009
  * @version 1.0
  */
-public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperationTest {
+public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperationTestBase {
        private static final Logger logger = Logger
                        .getLogger(SwapSynonymAndAcceptedOperationTest.class);
        
similarity index 89%
rename from eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/PrintUtil.java
rename to eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/PrintUtil.java
index a66099f019f33be3d0cabd22c4c5183a266742da..40b583c9ea2384a5a073a12ebb2b8012227a2599 100644 (file)
@@ -8,7 +8,7 @@
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
-package eu.etaxonomy.taxeditor.printpublisher.wizard;
+package eu.etaxonomy.taxeditor.printpublisher;
 
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
index 75184c9f772468c8e2a7af66190523f756d89fc2..d91caa0d90d7af90749bd064b70f9384c5738b6a 100644 (file)
@@ -15,7 +15,6 @@ import java.util.UUID;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -27,6 +26,7 @@ import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
 import eu.etaxonomy.cdm.print.out.xml.XMLOutputModule;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
 import eu.etaxonomy.taxeditor.printpublisher.wizard.DirectPublishingWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -62,36 +62,15 @@ public class GeneratePdfHandler extends AbstractHandler {
                
                configurator.setDoPublishEntireBranches(false);
                
-               configurator.addOutputModule(new XMLOutputModule());
                configurator.addOutputModule(new PdfOutputModule());
-       
-       
-       
-       // while testing
-//             configurator.setFeatureTree(UUID.fromString("168df0c6-6429-484c-b26f-ded1f7e44bd9"));
-//             configurator.setExportFolder(new File("/Users/n.hoffmann/tmp/"));
-//             
-//             ConversationHolder conversation = CdmStore.createConversation();
-//             conversation.close();
-////           try{
-//                     Publisher.publish(configurator);
-////                   conversation.commit();
-////           }finally{
-////                   conversation.close();
-////           }
-       
-       
-               // enable this when not testing
+               configurator.addOutputModule(new XMLOutputModule());
+               
                DirectPublishingWizard wizard = new DirectPublishingWizard(configurator);
                WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
                
-               int result = dialog.open();
+               dialog.open();
                
-               if(result == Status.OK || result == Status.CANCEL){
-                       return null;
-               }else{
-                       throw new RuntimeException("An error occurred during print publishing.");
-               }
+               return null;
        }
        
        private Element getTaxonNodeElement(TaxonEditorInput input){
index 1b50191f3e3442bb6c95ef20fd2ebf37ddba2663..30d3e0cbc761e8532752f6850db69e976c397059 100644 (file)
@@ -7,8 +7,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 
@@ -17,6 +20,8 @@ import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.Publisher;
 import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+import eu.etaxonomy.taxeditor.printpublisher.internal.PrintpublisherPlugin;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -26,8 +31,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Apr 1, 2010
  * @version 1.0
  */
-public class AbstractPublishWizard extends Wizard implements IExportWizard{
-       
+public abstract class AbstractPublishWizard extends Wizard implements IExportWizard, IHasPersistableSettings{
+                       
        /** Constant <code>PAGE_SERVICE="PAGE_SERVICE"</code> */
        public static final String PAGE_SERVICE = "PAGE_SERVICE";
        /** Constant <code>PAGE_TAXA="PAGE_TAXA"</code> */
@@ -40,13 +45,15 @@ public class AbstractPublishWizard extends Wizard implements IExportWizard{
        public static final String PAGE_OVERVIEW = "PAGE_OVERVIEW";
        /** Constant <code>PAGE_FEATURETREE="PAGE_FEATURETREE"</code> */
        public static final String PAGE_FEATURETREE = "PAGE_FEATURETREE";
-       
+       /** Constant <code>PAGE_STYLESHEET="PAGE_STYLESHEET"</code> */
+       public static final String PAGE_STYLESHEET = "PAGE_STYLESHEET";
+               
        protected SelectServiceWizardPage pageService;
        protected SelectTaxaWizardPage pageTaxa;
-       protected OptionsWizardPage pageOptions;
+       protected SelectOptionsWizardPage pageOptions;
        protected SelectFeatureTreeWizardPage pageFeatureTree;
-       protected SelectFolderWizardPage pageFolder;
-       protected OverviewWizardPage pageOverview;
+       protected SelectDirectoryWizardPage pageFolder;
+       protected SelectStylesheetWizardPage pageStylesheet;
 
        private PublishConfigurator configurator;
 
@@ -57,6 +64,7 @@ public class AbstractPublishWizard extends Wizard implements IExportWizard{
         */
        public AbstractPublishWizard(){         
                setNeedsProgressMonitor(true);
+               setDialogSettings(PrintpublisherPlugin.getDefault().getDialogSettings());
        }
        
        /* (non-Javadoc)
@@ -84,6 +92,12 @@ public class AbstractPublishWizard extends Wizard implements IExportWizard{
                                }finally{
                                        monitor.done();
                                        if(conversation != null) conversation.close();
+                                       Display.getDefault().asyncExec(new Runnable() {
+                                               @Override
+                                               public void run() {
+                                                       MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Print Publisher", "Your document was created.");
+                                               }
+                                       });
                                }
                                return Status.OK_STATUS;
                        }
@@ -103,21 +117,28 @@ public class AbstractPublishWizard extends Wizard implements IExportWizard{
                
                pageService = new SelectServiceWizardPage(PAGE_SERVICE);
                addPage(pageService);
-               
-               pageTaxa = new SelectTaxaWizardPage(PAGE_TAXA);
-               addPage(pageTaxa);
-               
-               pageOptions = new OptionsWizardPage(PAGE_OPTIONS);
+                               
+               pageOptions = new SelectOptionsWizardPage(PAGE_OPTIONS);
                addPage(pageOptions);
                
                pageFeatureTree = new SelectFeatureTreeWizardPage(PAGE_FEATURETREE);
                addPage(pageFeatureTree);
                
-               pageFolder = new SelectFolderWizardPage(PAGE_FOLDER);
+               pageStylesheet = new SelectStylesheetWizardPage(PAGE_STYLESHEET);
+               addPage(pageStylesheet);
+
+               pageFolder = new SelectDirectoryWizardPage(PAGE_FOLDER);
                addPage(pageFolder);
                
-               pageOverview = new OverviewWizardPage(PAGE_OVERVIEW);
-               addPage(pageOverview);
+       }
+       
+       @Override
+       public void loadSettings() {
+               for(IWizardPage page : getPages()){
+                       if(page instanceof IHasPersistableSettings){
+                               ((IHasPersistableSettings) page).loadSettings();
+                       }
+               }               
        }
        
        /* (non-Javadoc)
@@ -133,10 +154,16 @@ public class AbstractPublishWizard extends Wizard implements IExportWizard{
        /** {@inheritDoc} */
        @Override
        public boolean canFinish() {
-               return pageService.isPageComplete() && 
-                               pageTaxa.isPageComplete() &&
-                               pageFeatureTree.isPageComplete() &&
-                               pageFolder.isPageComplete();
+               boolean canFinish = true;
+               
+               canFinish &= pageService.isPageComplete(); 
+               
+               // persistable settings pages
+               canFinish &= pageFeatureTree.isPageComplete();
+               canFinish &= pageFolder.isPageComplete();
+               canFinish &= pageStylesheet.isPageComplete();
+               
+               return canFinish;
        }
        
        /**
index 49c9a0a2db85344903497e3f5c184abf8a8ce80b..5d9359dcc3b8ed6fe99f87adb4f91776c2933be1 100644 (file)
 
 package eu.etaxonomy.taxeditor.printpublisher.wizard;
 
+import java.net.URL;
+import java.nio.channels.IllegalSelectorException;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
 import org.eclipse.jface.wizard.WizardPage;
 
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>Abstract AbstractPublishWizardPage class.</p>
@@ -62,4 +67,49 @@ public abstract class AbstractPublishWizardPage extends WizardPage {
                        throw new IllegalStateException("OutputModule may not be null at this moment");
                return outputModule;
        }
+       
+       public void putDialogSettingValue(String key, String value){
+               getDialogSettingSection().put(key, value);
+       }
+       
+       public String getDialogSettingValue(String key){
+               return getDialogSettingSection().get(key);
+       } 
+       
+       public boolean getDialogSettingBooleanValue(String key){
+               return getDialogSettingSection().getBoolean(key);
+       }
+       
+       private IDialogSettings getDialogSettingSection(){
+               IDialogSettings wizardDialogSetting = getWizard().getDialogSettings();
+               if(wizardDialogSetting == null){
+                       throw new IllegalStateException("Wizards dialog setting may not be null");
+               }
+               
+               IDialogSettings specificWizardDialogSection = getOrCreateSettingSection(wizardDialogSetting, getWizard().getClass().getName());
+               
+               String dataSource = null;
+               if(getConfigurator().isLocal()){
+                       dataSource = CdmStore.getDataSource().getName();
+               }else if(getConfigurator().isRemote()){
+                       URL serviceUrl = getConfigurator().getWebserviceUrl();
+                       dataSource = serviceUrl.toExternalForm();
+               }else{
+                       throw new IllegalStateException("Print publisher configurator should be either local or remote");
+               }               
+               
+               IDialogSettings specificDataSourceDialogSection = getOrCreateSettingSection(specificWizardDialogSection, dataSource);
+               
+               return specificDataSourceDialogSection;
+       }
+       
+       private IDialogSettings getOrCreateSettingSection(IDialogSettings setting, String sectionName){
+               IDialogSettings section = setting.getSection(sectionName);
+               
+               if(section == null){
+                       section = setting.addNewSection(sectionName);
+               }
+               
+               return section;
+       }
 }
index 992f0a89e39ec5b3f538ecc23e3f67bc00c57006..4fad919afdea477323f3071b7ba58703f34a6016 100644 (file)
 
 package eu.etaxonomy.taxeditor.printpublisher.wizard;
 
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbench;
+
 import eu.etaxonomy.cdm.print.PublishConfigurator;
+import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
 
 /**
  * <p>DirectPublishingWizard class.</p>
@@ -28,25 +32,27 @@ public class DirectPublishingWizard extends AbstractPublishWizard {
         */
        public DirectPublishingWizard(PublishConfigurator configurator) {
                setConfigurator(configurator);
-               setOutputModule(configurator.getOutputModules().iterator().next());
+               IPublishOutputModule module = configurator.getOutputModules().iterator().next();
+               setOutputModule(module);
        }
 
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               pageOptions = new OptionsWizardPage(PAGE_OPTIONS);
+               pageOptions = new SelectOptionsWizardPage(PAGE_OPTIONS);
                addPage(pageOptions);
                
                pageFeatureTree = new SelectFeatureTreeWizardPage(PAGE_FEATURETREE);
                addPage(pageFeatureTree);
                
-               pageFolder = new SelectFolderWizardPage(PAGE_FOLDER);
+               pageStylesheet = new SelectStylesheetWizardPage(PAGE_STYLESHEET);
+               addPage(pageStylesheet);
+               
+               pageFolder = new SelectDirectoryWizardPage(PAGE_FOLDER);
                addPage(pageFolder);
                
-               pageOverview = new OverviewWizardPage(PAGE_OVERVIEW);
-               addPage(pageOverview);
        }
-       
+               
        /** {@inheritDoc} */
        @Override
        public boolean performFinish() {
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/IHasPersistableSettings.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/IHasPersistableSettings.java
new file mode 100644 (file)
index 0000000..e642877
--- /dev/null
@@ -0,0 +1,21 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.printpublisher.wizard;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+
+/**
+ * Classes implementing this interface have their settings stored in some way.
+ * 
+ * @see {@link IDialogSettings} 
+ * @author n.hoffmann
+ *
+ */
+public interface IHasPersistableSettings {
+       
+       /**
+        * Loads the settings
+        */
+       public void loadSettings();
+}
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OptionsWizardPage.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OptionsWizardPage.java
deleted file mode 100644 (file)
index 75198e3..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.printpublisher.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * <p>OptionsWizardPage class.</p>
- *
- * @author n.hoffmann
- * @created Jul 26, 2010
- * @version 1.0
- */
-public class OptionsWizardPage extends AbstractPublishWizardPage implements SelectionListener{
-
-       private Button button_doSynonymy;
-       private Button button_doDescriptions;
-       private Button button_doImages;
-       private Button button_doPublishEntireBranches;
-       private Composite composite;
-
-       /**
-        * <p>Constructor for OptionsWizardPage.</p>
-        *
-        * @param pageName a {@link java.lang.String} object.
-        */
-       protected OptionsWizardPage(String pageName) {
-               super(pageName);
-               setTitle("Select options");
-       }
-       
-       /** {@inheritDoc} */
-       @Override
-       public void createControl(Composite parent) {
-               
-               composite = new Composite(parent, SWT.NULL);
-               composite.setLayout(new GridLayout());
-               
-               button_doPublishEntireBranches = new Button(composite, SWT.CHECK);
-               button_doPublishEntireBranches.setText("Publish the entire branch for selected taxa (i.e. all taxonomically included taxa)");
-               button_doPublishEntireBranches.addSelectionListener(this);
-               
-               button_doSynonymy = new Button(composite, SWT.CHECK);
-               button_doSynonymy.setText("Publish Synonymy");
-               button_doSynonymy.addSelectionListener(this);
-               
-               button_doDescriptions = new Button(composite, SWT.CHECK);
-               button_doDescriptions.setText("Publish Descriptions");
-               button_doDescriptions.addSelectionListener(this);
-               
-               button_doImages = new Button(composite, SWT.CHECK);
-               button_doImages.setText("Publish Images (not supported yet)");
-               button_doImages.addSelectionListener(this);
-               
-               initButtons();
-               
-               setControl(composite);
-       }
-
-       private void initButtons() {
-               button_doPublishEntireBranches.setSelection(getConfigurator().isDoPublishEntireBranches());
-               button_doSynonymy.setSelection(getConfigurator().isDoSynonymy());
-               button_doDescriptions.setSelection(getConfigurator().isDoDescriptions());
-               button_doImages.setSelection(getConfigurator().isDoImages());
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void widgetSelected(SelectionEvent e) {
-               getConfigurator().setDoPublishEntireBranches(button_doPublishEntireBranches.getSelection());
-               getConfigurator().setDoSynonymy(button_doSynonymy.getSelection());
-               getConfigurator().setDoDescriptions(button_doDescriptions.getSelection());
-               getConfigurator().setDoImages(button_doImages.getSelection());
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void widgetDefaultSelected(SelectionEvent e) {}
-}
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OverviewWizardPage.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/OverviewWizardPage.java
deleted file mode 100644 (file)
index 4288d57..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.printpublisher.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * <p>OverviewWizardPage class.</p>
- *
- * @author n.hoffmann
- * @created Apr 6, 2010
- * @version 1.0
- */
-public class OverviewWizardPage extends AbstractPublishWizardPage {
-
-       private Composite composite;
-
-       private Label serviceUrl;
-       
-       private Label exportFolder;
-       
-       /**
-        * <p>Constructor for OverviewWizardPage.</p>
-        *
-        * @param pageName a {@link java.lang.String} object.
-        */
-       public OverviewWizardPage(String pageName) {
-               super(pageName);
-               setTitle("Overview");
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-        */
-       /** {@inheritDoc} */
-       public void createControl(Composite parent) {
-               
-               composite = new Composite(parent, SWT.NULL);
-               composite.setLayout(new GridLayout());
-               
-//             serviceUrl = new Label(composite, SWT.NULL);
-               
-               exportFolder = new Label(composite, SWT.NULL);
-               
-               setControl(composite);
-       }
-
-       /**
-        * <p>refresh</p>
-        */
-       public void refresh() {
-//             serviceUrl.setText(getConfigurator().getWebserviceUrl().toString());
-               exportFolder.setText(getConfigurator().getExportFolder().toString());
-               composite.layout();
-       }
-}
@@ -30,7 +30,8 @@ import org.eclipse.swt.widgets.Text;
  * @created Apr 7, 2010
  * @version 1.0
  */
-public class SelectFolderWizardPage extends AbstractPublishWizardPage {
+public class SelectDirectoryWizardPage extends AbstractPublishWizardPage implements IHasPersistableSettings {
+       private static final String DIALOG_SETTING_OUTPUT_DIRECTORY = "dialogSettingOutputDirectory";
        private Composite composite;
        private DirectoryDialog folderDialog;
        private Text text_folder;
@@ -40,7 +41,7 @@ public class SelectFolderWizardPage extends AbstractPublishWizardPage {
         *
         * @param pageName a {@link java.lang.String} object.
         */
-       public SelectFolderWizardPage(String pageName) {
+       public SelectDirectoryWizardPage(String pageName) {
                super(pageName);
                setTitle("Select a folder");
        }
@@ -76,26 +77,32 @@ public class SelectFolderWizardPage extends AbstractPublishWizardPage {
                                super.widgetSelected(e);
                                String path = folderDialog.open();
                                if(path != null){ // a folder was selected
-                                       text_folder.setText(path);
-                                       getConfigurator().setExportFolder(new File(path));
-
-                                       setPageComplete(true);
+                                       setDirectory(path);
                                }
                        }
                });
                
+               loadSettings();
+               
                setControl(composite);
        }
        
-       /** {@inheritDoc} */
        @Override
-       public boolean canFlipToNextPage() {
-               if(isPageComplete()){
-                       OverviewWizardPage overviewPage = (OverviewWizardPage) getNextPage();
-                       overviewPage.refresh(); 
-                       return true;
+       public void loadSettings() {
+               String directory = getDialogSettingValue(DIALOG_SETTING_OUTPUT_DIRECTORY);
+               
+               if(directory != null){
+                       setDirectory(directory);
                }
-               return false;
+       }
+       
+       private void setDirectory(String directory){
+               text_folder.setText(directory);
+               getConfigurator().setExportFolder(new File(directory));
+
+               putDialogSettingValue(DIALOG_SETTING_OUTPUT_DIRECTORY, directory);
+               
+               setPageComplete(true);
        }
        
        /** {@inheritDoc} */
index a41472a1d8c11b20180839565170480a636a6615..7fa7f6c83a583ba0031084fabaea3d92f773c5fe 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.ListViewer;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
@@ -43,10 +44,11 @@ import eu.etaxonomy.taxeditor.featuretree.FeatureTreeEditorWizard;
  * @created Aug 6, 2010
  * @version 1.0
  */
-public class SelectFeatureTreeWizardPage extends AbstractPublishWizardPage implements ISelectionChangedListener{
+public class SelectFeatureTreeWizardPage extends AbstractPublishWizardPage 
+       implements ISelectionChangedListener, IHasPersistableSettings{
        
+       private static final String DIALOG_SETTING_FEATURE_TREE_UUID = "dialogSettingFeatureTreeUuid";
        private ListViewer viewer;
-       private IStructuredSelection selection;
 
        /**
         * <p>Constructor for SelectFeatureTreeWizardPage.</p>
@@ -93,38 +95,64 @@ public class SelectFeatureTreeWizardPage extends AbstractPublishWizardPage imple
                                }
                        });
                }
-               
+                               
                // when using a local factory we can set the input right here
                if(getConfigurator() != null && getConfigurator().isLocal()){
                        refresh();
                }
                
+               loadSettings();
+               
                setControl(composite);
        }
 
+       @Override
+       public void loadSettings() {
+               String featureTreeUuidString = getDialogSettingValue(DIALOG_SETTING_FEATURE_TREE_UUID); 
+               
+               if(featureTreeUuidString != null){
+                       setSelectedFeatureTree(featureTreeUuidString);
+                       
+               }
+       }
+       
        /** {@inheritDoc} */
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
-               selection = (IStructuredSelection) event.getSelection();
+               IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                
                setPageComplete(selection.size() == 1);
                
-               if(selection.size() == 1){
-                       Element featureTreeElement = (Element) selection.getFirstElement();
+               Element featureTreeElement = (Element) selection.getFirstElement();
                        
-                       UUID featureTreeUuid = XMLHelper.getUuid(featureTreeElement);
-                       
-                       getConfigurator().setFeatureTree(featureTreeUuid);
-                       setErrorMessage(null);
-               }else if(selection.size() > 1){
-                       setErrorMessage("Please select only one feature tree.");
+               UUID featureTreeUuid = XMLHelper.getUuid(featureTreeElement);
+               
+               setFeatureTree(featureTreeUuid.toString());
+       }
+       
+       private void setSelectedFeatureTree(String featureTreeUuid){
+               List<Element> input = (ArrayList<Element>) viewer.getInput();
+               
+               for(Element element : input){
+                       UUID uuid = XMLHelper.getUuid(element);
+                       if(uuid.toString().equals(featureTreeUuid)){
+                               viewer.setSelection(new StructuredSelection(element));
+                               break;
+                       }
                }
        }
        
+       public void setFeatureTree(String featureTreeUuidString){
+               putDialogSettingValue(DIALOG_SETTING_FEATURE_TREE_UUID, featureTreeUuidString);
+               UUID featureTreeUuid = UUID.fromString(featureTreeUuidString);
+               getConfigurator().setFeatureTree(featureTreeUuid);
+               setPageComplete(featureTreeUuid != null);
+       }
+       
        /** {@inheritDoc} */
        @Override
        public boolean canFlipToNextPage() {
-               return (isPageComplete() && selection.size() == 1);
+               return isPageComplete();
        }
 
        /**
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectOptionsWizardPage.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectOptionsWizardPage.java
new file mode 100644 (file)
index 0000000..a50c872
--- /dev/null
@@ -0,0 +1,136 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.printpublisher.wizard;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * <p>OptionsWizardPage class.</p>
+ *
+ * @author n.hoffmann
+ * @created Jul 26, 2010
+ * @version 1.0
+ */
+public class SelectOptionsWizardPage extends AbstractPublishWizardPage 
+       implements SelectionListener, IHasPersistableSettings{
+
+       private static final String DIALOG_SETTING_PUBLISH_ENTIRE_BRANCHES = "dialogSettingPublishEntireBranch";
+       private static final String DIALOG_SETTING_DO_SYNONYMS = "dialogSettingDoSynonyms";
+       private static final String DIALOG_SETTING_DO_DESCRIPTIONS = "dialogSettingDoDescriptions";
+       private static final String DIALOG_SETTING_DO_IMAGES = "dialogSettingDoImages";
+       
+       private Button button_doSynonymy;
+       private Button button_doDescriptions;
+       private Button button_doImages;
+       private Button button_doPublishEntireBranches;
+       private Composite composite;
+       private Boolean doImages;
+       private Boolean doDescriptions;
+       private Boolean doSynonymy;
+       private Boolean entireBranches;
+
+       /**
+        * <p>Constructor for OptionsWizardPage.</p>
+        *
+        * @param pageName a {@link java.lang.String} object.
+        */
+       protected SelectOptionsWizardPage(String pageName) {
+               super(pageName);
+               setTitle("Select options");
+       }
+       
+       /** {@inheritDoc} */
+       @Override
+       public void createControl(Composite parent) {
+               
+               composite = new Composite(parent, SWT.NULL);
+               composite.setLayout(new GridLayout());
+               
+               button_doPublishEntireBranches = new Button(composite, SWT.CHECK);
+               button_doPublishEntireBranches.setText("Publish the entire branch for selected taxa (i.e. all taxonomically included taxa)");
+               button_doPublishEntireBranches.addSelectionListener(this);
+               
+               button_doSynonymy = new Button(composite, SWT.CHECK);
+               button_doSynonymy.setText("Publish Synonymy");
+               button_doSynonymy.addSelectionListener(this);
+               
+               button_doDescriptions = new Button(composite, SWT.CHECK);
+               button_doDescriptions.setText("Publish Descriptions");
+               button_doDescriptions.addSelectionListener(this);
+               
+               button_doImages = new Button(composite, SWT.CHECK);
+               button_doImages.setText("Publish Images (not supported yet)");
+               button_doImages.addSelectionListener(this);
+                               
+               loadSettings();
+               
+               setControl(composite);
+       }
+       
+       @Override
+       public void loadSettings() {
+               if(getDialogSettingValue(DIALOG_SETTING_PUBLISH_ENTIRE_BRANCHES) != null){
+                       button_doPublishEntireBranches.setSelection(getDialogSettingBooleanValue(DIALOG_SETTING_PUBLISH_ENTIRE_BRANCHES));
+               }else{
+                       button_doPublishEntireBranches.setSelection(getConfigurator().isDoPublishEntireBranches());
+               }
+               
+               if(getDialogSettingValue(DIALOG_SETTING_DO_SYNONYMS) != null){
+                       button_doSynonymy.setSelection(getDialogSettingBooleanValue(DIALOG_SETTING_DO_SYNONYMS));
+               }else{
+                       button_doSynonymy.setSelection(getConfigurator().isDoSynonymy());
+               }
+               
+               if(getDialogSettingValue(DIALOG_SETTING_DO_DESCRIPTIONS) != null){
+                       button_doDescriptions.setSelection(getDialogSettingBooleanValue(DIALOG_SETTING_DO_DESCRIPTIONS));
+               }else{
+                       button_doDescriptions.setSelection(getConfigurator().isDoDescriptions());
+               }
+               
+               if(getDialogSettingValue(DIALOG_SETTING_DO_IMAGES) != null){
+                       button_doImages.setSelection(getDialogSettingBooleanValue(DIALOG_SETTING_DO_IMAGES));
+               }else{
+                       button_doImages.setSelection(getConfigurator().isDoImages());
+               }
+               
+               // trigger selection
+               widgetSelected(null);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void widgetSelected(SelectionEvent e) {
+               entireBranches = button_doPublishEntireBranches.getSelection();
+               getConfigurator().setDoPublishEntireBranches(entireBranches);
+               putDialogSettingValue(DIALOG_SETTING_PUBLISH_ENTIRE_BRANCHES, entireBranches.toString());
+               
+               doSynonymy = button_doSynonymy.getSelection();
+               getConfigurator().setDoSynonymy(doSynonymy);
+               putDialogSettingValue(DIALOG_SETTING_DO_SYNONYMS, doSynonymy.toString());
+               
+               doDescriptions = button_doDescriptions.getSelection();
+               getConfigurator().setDoDescriptions(doDescriptions);
+               putDialogSettingValue(DIALOG_SETTING_DO_DESCRIPTIONS, doDescriptions.toString());
+               
+               doImages = button_doImages.getSelection();
+               getConfigurator().setDoImages(doImages);
+               putDialogSettingValue(DIALOG_SETTING_DO_IMAGES, doImages.toString());
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void widgetDefaultSelected(SelectionEvent e) {}
+}
index 542d2e0878c05119486ebf609f051b436ca21b37..8876365de517268c838ad299f275240617bcf30a 100644 (file)
@@ -12,9 +12,19 @@ package eu.etaxonomy.taxeditor.printpublisher.wizard;
 
 import java.lang.reflect.InvocationTargetException;
 import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -24,11 +34,17 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Text;
+import org.jdom.Element;
 
+import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
+import eu.etaxonomy.cdm.print.XMLHelper;
+import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
@@ -44,8 +60,9 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
        private Composite composite;
        private Button button_local;
        private Button button_remote;
-       private Label label_serviceUrl;
        private Text text_serviceUrl;
+       
+       private TreeViewer treeViewer;
 
        /**
         * <p>Constructor for SelectServiceWizardPage.</p>
@@ -68,7 +85,11 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                
                RadioSelectionListener listener = new RadioSelectionListener();
                
-               button_local = new Button(composite, SWT.RADIO);
+               Group radioGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
+               radioGroup.setLayout(new GridLayout());
+               
+               button_local = new Button(radioGroup, SWT.RADIO);
+                               
                button_local.setText("Local (By selecting this option the database you are currently " +
                                "connected to will be used to gather data.)");
                
@@ -76,15 +97,11 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                
                
                                                
-               button_remote = new Button(composite, SWT.RADIO);
+               button_remote = new Button(radioGroup, SWT.RADIO);
                button_remote.setText("Remote");
                button_remote.addSelectionListener(listener);
                
-               
-               label_serviceUrl = new Label(composite, SWT.NULL);
-               label_serviceUrl.setText("Service URL");
-               
-               text_serviceUrl = new Text(composite, SWT.BORDER);
+               text_serviceUrl = new Text(radioGroup, SWT.BORDER);
                text_serviceUrl.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                text_serviceUrl.setText("http://");     
                text_serviceUrl.addModifyListener(new ModifyListener() {
@@ -92,22 +109,38 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                        public void modifyText(ModifyEvent e) {
                                String text = text_serviceUrl.getText();
                                
-                               try {
-                                       getConfigurator().setWebserviceUrl(text);
-                               } catch (MalformedURLException e1) {
-                                       StoreUtil.warn(this.getClass(), "Malformed Url");
+                               if(!text.endsWith("/")){
+                                       SelectServiceWizardPage.this.setErrorMessage("Webservice URL has to end with \"/\"");
+                                       setPageComplete(false);
+                                       return;
                                }
                                
-                               if(isPageComplete()){
-                                       SelectServiceWizardPage.this.setErrorMessage(null);
-                                       setPageComplete(true);
-                               }else{
-                                       SelectServiceWizardPage.this.setErrorMessage("Webservice URL has to end with \"/\"");
+                               URL url = null;
+                               try {
+                                       url = new URL(text);
+                               } catch (MalformedURLException e1) {
+                                       SelectServiceWizardPage.this.setErrorMessage("Webservice URL is malformed.");
                                        setPageComplete(false);
+                                       return;
                                }
+                               
+                               getConfigurator().setWebserviceUrl(url);
+                               
+                               SelectServiceWizardPage.this.setErrorMessage(null);
+                                       
                        }
                });
                
+               treeViewer = new TreeViewer(composite);
+               
+               treeViewer.setContentProvider(new ContentProvider());
+               treeViewer.setLabelProvider(new LabelProvider());
+               
+               treeViewer.addSelectionChangedListener(new SelectionChangedListener());
+               
+               treeViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               
+               
                if(CdmStore.isActive()){
                        enableLocal();
                }else{
@@ -122,9 +155,9 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
        private class RadioSelectionListener extends SelectionAdapter{
                @Override
                public void widgetSelected(SelectionEvent e) {
-                       if(e.widget == button_local){
+                       if(button_local.getSelection()){
                                enableLocal();
-                       }else{
+                       }else if(button_remote.getSelection()){
                                enableRemote();
                        }
                }
@@ -134,7 +167,6 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                button_local.setSelection(false);
                button_remote.setSelection(true);
                
-               label_serviceUrl.setEnabled(true);
                text_serviceUrl.setEnabled(true);
                
                setConfigurator(PublishConfigurator.NewRemoteInstance());
@@ -145,11 +177,11 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                button_remote.setSelection(false);
                button_local.setSelection(true);
                
-               label_serviceUrl.setEnabled(false);
                text_serviceUrl.setEnabled(false);
                
                setConfigurator(PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationConfiguration()));
                getConfigurator().addOutputModule(getOutputModule());
+               refresh();
        }
        
        /*
@@ -158,33 +190,45 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
         */
        /** {@inheritDoc} */
        @Override
-       public boolean canFlipToNextPage() {
-               if(isPageComplete()){
-                       try {
-                               getContainer().run(false, false, new IRunnableWithProgress() {
+       public boolean canFlipToNextPage() {    
+               return isPageComplete();
+       }
+       
+       /**
+        * <p>refresh</p>
+        */
+       public void refresh(){
+               
+               if(getConfigurator() != null){
+               
+                       IRunnableWithProgress runnable = new IRunnableWithProgress(){
+
+                               @Override
+                               public void run(IProgressMonitor monitor) {
+                                       monitor.beginTask("Loading classifications", IProgressMonitor.UNKNOWN);
+                                       IXMLEntityFactory factory = getConfigurator().getFactory();
+                                       final List<Element> classifications = factory.getClassifications();
                                        
-                                       @Override
-                                       public void run(IProgressMonitor monitor) throws InvocationTargetException,
-                                                       InterruptedException {
-                                               getConfigurator().setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
-                                               
-                                               SelectTaxaWizardPage selectTaxaPage = (SelectTaxaWizardPage) getWizard().getPage(AbstractPublishWizard.PAGE_TAXA);                      
-                                               selectTaxaPage.refresh();
-                                               
-                                               SelectFeatureTreeWizardPage selectFeatureTreePage = (SelectFeatureTreeWizardPage) getWizard().getPage(AbstractPublishWizard.PAGE_FEATURETREE);          
-                                               selectFeatureTreePage.refresh();
+                                       Display.getDefault().asyncExec(new Runnable(){
+
+                                               @Override
+                                               public void run() {
+                                                       treeViewer.setInput(classifications);
+                                               }
                                                
-                                       }
-                               });
+                                       });
+                                       monitor.done();
+                               }
+                               
+                       };
+                       try {
+                               getContainer().run(true, false, runnable);
                        } catch (InvocationTargetException e) {
-                               PrintUtil.error(getClass(), e);
+                               StoreUtil.error(this.getClass(), e);
                        } catch (InterruptedException e) {
-                               PrintUtil.error(getClass(), e);
+                               StoreUtil.error(this.getClass(), e);
                        }
-                       
-                       return true;
                }
-               return false;
        }
                
        /*
@@ -194,15 +238,94 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
        /** {@inheritDoc} */
        @Override
        public boolean isPageComplete() {
+               boolean complete = true;
                if(getConfigurator().isLocal()){
-                       return true;
+                       complete &= true;
                }else if(getConfigurator().isRemote() 
                                && getConfigurator().getWebserviceUrl() != null 
                                && getConfigurator().getWebserviceUrl().toString().endsWith("/")){
-                       return true;
+                       complete &= true;
                }else{
                        return false;
                }
+               
+               List<Element> selectedTaxonNodes = getConfigurator().getSelectedTaxonNodeElements();
+               
+               complete &= !selectedTaxonNodes.isEmpty();
+               
+               return complete;
+       }
+       
+       private class SelectionChangedListener implements ISelectionChangedListener {
+
+               public void selectionChanged(SelectionChangedEvent event) {
+                       StructuredSelection selection = (StructuredSelection) treeViewer.getSelection();
+                       
+                       List<Element> selectedElements = selection.toList();
+                       if(selectedElements.size() > 0){
+                               getConfigurator().setSelectedTaxonNodeElements(selectedElements);
+                               setPageComplete(true);
+                       }
+               }
+               
+       }
+       
+       private class ContentProvider implements ITreeContentProvider{
+
+               public Object[] getChildren(Object parentElement) {
+                       if(parentElement instanceof List){
+                               return ((List)parentElement).toArray();
+                       }
+                       else if(parentElement instanceof Element){
+                               Element element = (Element) parentElement;
+                               
+                               IXMLEntityFactory factory = getConfigurator().getFactory();
+                               
+                               return factory != null ? factory.getChildNodes(element).toArray() : new Object[]{};
+                               
+                       }
+                       
+                       return new Object[]{};
+               }
+
+               public Object getParent(Object element) {
+                       return null;
+               }
+
+               public boolean hasChildren(Object element) {
+                       return getChildren(element).length > 0;
+               }
+
+               public Object[] getElements(Object inputElement) {
+                       return getChildren(inputElement);
+               }
+
+               public void dispose() {
+                       
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                       
+               }
+               
+       }
+       
+       private class LabelProvider  extends ColumnLabelProvider
+               implements ILabelProvider{
+               
+               @Override
+               public String getText(Object element) {
+                       if(element instanceof Element){
+                               Element xmlElement = (Element) element;
+                               EntityType entityType = XMLHelper.getEntityType(xmlElement);
+                               if(EntityType.TAXON_NODE.equals(entityType)){
+                                       xmlElement = getConfigurator().getFactory().getTaxonForTaxonNode(xmlElement);
+                               }                               
+                               return XMLHelper.getTitleCache(xmlElement);
+                       }
+                       return "no title cache";
+               }
+               
        }
        
 }
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectStylesheetWizardPage.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectStylesheetWizardPage.java
new file mode 100644 (file)
index 0000000..0f0113e
--- /dev/null
@@ -0,0 +1,145 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.printpublisher.wizard;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+
+/**
+ * @author n.hoffmann
+ *
+ */
+public class SelectStylesheetWizardPage extends AbstractPublishWizardPage
+               implements ISelectionChangedListener, IHasPersistableSettings {
+
+       public static final String DIALOG_SETTING_STYLESHEET = "dialogSettingStylesheet";
+       
+       private ListViewer viewer;
+       private IStructuredSelection selection;
+       
+       protected SelectStylesheetWizardPage(String pageName) {
+               super(pageName);
+               setTitle("Select Stylesheet");
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+        */
+       @Override
+       public void createControl(Composite parent) {
+               setPageComplete(false);
+               
+               final Composite composite = new Composite(parent, SWT.NULL);
+               composite.setLayout(new GridLayout());
+               
+               viewer = new ListViewer(composite);
+               viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               viewer.setContentProvider(new StylesheetContentProvider());
+               viewer.setLabelProvider(new StylesheetLabelProvider());
+               
+               viewer.addSelectionChangedListener(this);
+               
+               refresh();
+                       
+               loadSettings();
+               
+               setControl(composite);
+       }
+       
+       @Override
+       public void loadSettings() {
+               String stylesheet = getDialogSettingValue(DIALOG_SETTING_STYLESHEET);
+               
+               if(stylesheet != null){
+                       File lastSelection = new File(stylesheet);
+                       viewer.setSelection(new StructuredSelection(lastSelection));
+               }
+       }
+       
+       /**
+        * Refreshes the input of the viewer
+        */
+       public void refresh() {
+               List<File> stylesheets;
+               try {
+                       stylesheets = getOutputModule().getStylesheets();
+                       viewer.setInput(stylesheets);
+               } catch (IOException e) {
+                       PrintUtil.errorDialog("Problems reading stylesheet", getClass(), e.getMessage(), e);
+               }               
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+        */
+       @Override
+       public void selectionChanged(SelectionChangedEvent event) {
+               selection = (IStructuredSelection) event.getSelection();
+               
+               
+               
+               File stylesheet = (File) selection.getFirstElement();
+               
+               setPageComplete(stylesheet != null);
+               
+               getOutputModule().setXslt(stylesheet);
+               if(stylesheet != null)  putDialogSettingValue(DIALOG_SETTING_STYLESHEET, stylesheet.getAbsolutePath());
+               
+               setErrorMessage(null);
+       
+       }
+       
+       private class StylesheetContentProvider implements IStructuredContentProvider {
+
+               @Override
+               public void dispose() {}
+
+               @Override
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+               @Override
+               public Object[] getElements(Object inputElement) {
+                       if(inputElement instanceof List){
+                               return ((List) inputElement).toArray();
+                       }
+                       return new Object[0];
+               }
+               
+       }
+       
+       private class StylesheetLabelProvider extends LabelProvider {
+               
+               /*
+                * (non-Javadoc)
+                * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+                */
+               @Override
+               public String getText(Object element) {
+                       if(element instanceof File){
+                               File file = (File) element;
+                               if(file.exists()){
+                                       return file.getAbsolutePath();
+                               }
+                       }
+                       return "no title cache";
+               }
+               
+       }
+}
index 621049e7ccb791184b17fcf5e8008d28d0e39db6..ab3b8a1f7f292b1dcde2c9342bb3a08ac7e214ce 100644 (file)
             id="eu.etaxonomy.taxeditor.io.import.sdd"
             name="SDD">
       </wizard>
+      <wizard
+            category="eu.etaxonomy.taxeditor.import.category.cdm"
+            class="eu.etaxonomy.taxeditor.io.wizard.SpecimenCdmExcelImportWizard"
+            id="eu.etaxonomy.taxeditor.io.import.specimenCdmExcel"
+            name="Specimen CDM Excel">
+      </wizard>
    </extension>
    <extension
          point="org.eclipse.ui.exportWizards">
index c28e5bd132ebc8355e9b7be79b3e7441e0303722..584332421babc535f26c0ebd192e83d9cb56c277 100644 (file)
@@ -30,7 +30,7 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
        protected ICdmApplicationConfiguration applicationConfiguration;
 
        public static enum TYPE {
-               BerlinModel, Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd
+               BerlinModel, Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel
        }
 
        /**
index 35b4e07313fd3fb2145fa02f724ccb4eb68143e3..698ea8ae01e08629ad17f05cc30e752d3b04ca2e 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.cdm.io.jaxb.JaxbImportConfigurator;
 import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -145,6 +146,8 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                        return Abcd206ImportConfigurator.NewInstance(null, null);
                case Sdd:
                        return SDDImportConfigurator.NewInstance(null, null);
+               case SpecimenCdmExcel:
+                       return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
                default:
                        StoreUtil.notImplementedMessage(this);
                        throw new IllegalArgumentException("Import not supported yet");
@@ -238,4 +241,8 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                return (Abcd206ImportConfigurator) getConfigurator(TYPE.Abcd);
        }
 
+       public SpecimenCdmExcelImportConfigurator SpecimenCdmExcelImportConfigurator() {
+               return (SpecimenCdmExcelImportConfigurator) getConfigurator(TYPE.SpecimenCdmExcel);
+       }
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SpecimenCdmExcelImportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SpecimenCdmExcelImportWizard.java
new file mode 100644 (file)
index 0000000..12b7d00
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.io.wizard;
+
+import java.net.URI;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbench;
+
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author n.hoffmann
+ *
+ */
+public class SpecimenCdmExcelImportWizard extends AbstractImportWizard<SpecimenCdmExcelImportConfigurator> {
+
+       private SpecimenCdmExcelImportConfigurator configurator;
+       
+       private ImportFromFileDataSourceWizardPage dataSourcePage;
+       
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
+        */
+       @Override
+       public SpecimenCdmExcelImportConfigurator getConfigurator() {
+               return configurator;
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+        */
+       /** {@inheritDoc} */
+       public void init(IWorkbench workbench, IStructuredSelection selection) {
+               super.init(workbench, selection);
+               configurator =  CdmStore.getImportManager().SpecimenCdmExcelImportConfigurator();
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.wizard.Wizard#performFinish()
+        */
+       @Override
+       public boolean performFinish() {
+               URI source = dataSourcePage.getUri();
+               configurator.setSource(source);
+               configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+               
+               CdmStore.getImportManager().run(configurator);
+               
+               return true;
+       }
+       
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#addPages()
+        */
+       /** {@inheritDoc} */
+       @Override
+       public void addPages() {
+               super.addPages();
+               
+               dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose Specimen CDM Excel", 
+                               "Please choose an xls file in the SpecimenCdmExcel format.", new String[]{"*.xls"});
+               addPage(dataSourcePage);
+       }
+
+}
index 7f408ea75f07e8b124d13adf1d22ababa5e34439..421f03311a4810fa41c77a7244e1de7442690276 100644 (file)
@@ -21,6 +21,7 @@ import eu.etaxonomy.taxeditor.ui.forms.AbstractCdmFormElement;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.forms.IEntityElement;
+import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
 
 /**
  * <p>VersionElement class.</p>
@@ -34,9 +35,10 @@ public class VersionElement extends AbstractCdmFormElement implements IEntityEle
        private Label label_created;
        private Label label_updated;
        
-       private Label label_uuid;
-       private Label label_objectId;
+       private TextWithLabelElement text_uuid;
+       private TextWithLabelElement text_objectId;
        private VersionableEntity entity;
+       private boolean showDebug;
        
        /**
         * <p>Constructor for VersionElement.</p>
@@ -49,19 +51,19 @@ public class VersionElement extends AbstractCdmFormElement implements IEntityEle
        public VersionElement(CdmFormFactory toolkit, ICdmFormElement parentElement, VersionableEntity entity, int style) {
                super(toolkit, parentElement);
                
-               getLayoutComposite().setLayout(CdmFormFactory.LAYOUT());
-               
+               showDebug = PreferencesUtil.getPreferenceStore().getBoolean(PreferencesUtil.SHOW_DEBUG_INFORMATION);
+                               
                label_created = toolkit.createLabel(getLayoutComposite(), null);
                label_created.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
 
                label_updated = toolkit.createLabel(getLayoutComposite(), null);
                label_updated.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
                
-               label_uuid = toolkit.createLabel(getLayoutComposite(), null);
-               label_uuid.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
-               
-               label_objectId = toolkit.createLabel(getLayoutComposite(), null);
-               label_objectId.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
+               if(showDebug){
+                       text_uuid = toolkit.createTextWithLabelElement(parentElement, "UUID", null, style);
+                       
+                       text_objectId = toolkit.createTextWithLabelElement(parentElement, "Object ID", null, style);
+               }
        }
        
        /**
@@ -83,19 +85,12 @@ public class VersionElement extends AbstractCdmFormElement implements IEntityEle
                                + " by " + userFormat(entity.getUpdatedBy());
                label_updated.setText(updatedString);
                
-               boolean showDebug = PreferencesUtil.getPreferenceStore().getBoolean(PreferencesUtil.SHOW_DEBUG_INFORMATION);
+               
                
                if(showDebug){
-                       String uuidString = "UUID: " + entity.getUuid();
-                       label_uuid.setText(uuidString);
-                       label_uuid.setVisible(true);
+                       text_uuid.setText(entity.getUuid().toString());
                        
-                       String objectIdString = "Object ID: " + entity.getId();
-                       label_objectId.setText(objectIdString);
-                       label_objectId.setVisible(true);
-               }else{
-                       label_uuid.setVisible(false);
-                       label_objectId.setVisible(false);
+                       text_objectId.setText(entity.getId()+"");
                }
                
        }