<imports xsi:type="commands:Command" xmi:id="_n1FHEKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCdmLight"/>
<imports xsi:type="commands:Command" xmi:id="_aN3BsL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse"/>
<imports xsi:type="commands:Command" xmi:id="_Ih5dAEjAEe6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.command.exportColDP"/>
+ <imports xsi:type="commands:Command" xmi:id="_aGKEYLXhEe6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.store.command.exportWFO_Dwca"/>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar">
<elements xsi:type="menu:ToolControl" xmi:id="_7kZI4CTfEeeiN5lBIuqN3g" elementId="eu.etaxonomy.taxeditor.navigation.toolcontrol.search_bar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.search.SearchBar"/>
</fragments>
<children xsi:type="menu:Menu" xmi:id="_rbInwKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.menu.export" label="%menu.label.2">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_3qJaEMuuEeiGO4eKaXkw0w" coreExpressionId="isShowIOMenuEnabled"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_zDuJwKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportDwca" label="%wizard.name.9" command="_juMxQKqhEeeXcJGhyhlrKA"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_DKOIkLXrEe6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportWFO" label="WFO DwC-A" command="_aGKEYLXhEe6JFM-mIdEBFA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_kVpisEi-Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportColDP" label="%wizard.name.122" command="_Ih5dAEjAEe6gZ65AByRHxQ"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_44XB4KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_n1FHEKqhEeeXcJGhyhlrKA"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_8AZ3kEx-Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.navigation.menuseparator.9"/>
category.name.2 = CDM\r
wizard.name.16 = Taxon\r
wizard.name.17 = Classification\r
+wizard.name.123 = WFO DwC-A\r
themeElementCategory.label = Taxonomic Editor\r
themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor\r
colorDefinition.label = List Background\r
category.name.2 = CDM
wizard.name.16 = Taxon
wizard.name.17 = Klassifikation
+wizard.name.123 = WFO DwC-A
themeElementCategory.label = Taxonomischer Editor
themeElementCategory.description = Farb- und Schriftdefinitionen f\u00fcr den EDIT Taxonomischen Editor
colorDefinition.label = Liste Hintergrund
<elements xsi:type="commands:Command" xmi:id="_AJtnsCHXEeiP8eNo0PEm1g" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.createFeatureTree" commandName="%command.commandname.9"/>
<elements xsi:type="commands:Command" xmi:id="_FTpC0MVSEeiKErB3UVzQug" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler" commandName="%command.name.11"/>
<elements xsi:type="commands:Command" xmi:id="_Vs75kMVfEeiKErB3UVzQug" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardAdminHandler" commandName="%command.name.110"/>
- <elements xsi:type="commands:Command" xmi:id="_tPtdwMiIEeiKErB3UVzQug" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionStatusWizardAdminHandler" commandName="%command.name.111"/>
<elements xsi:type="commands:Command" xmi:id="_tRsg8MrcEeiKErB3UVzQug" elementId="eu.etaxonomy.taxeditor.handler.e4.OpenCommonNameAreaWizardHandler" commandName="%command.name.112"/>
<elements xsi:type="commands:Command" xmi:id="_nP0XMNhHEeijwMElCRdOhg" elementId="org.eclipse.ui.file.restartWorkbench" commandName="%command.commandname.10"/>
<elements xsi:type="commands:Command" xmi:id="_cMyQ4NjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.copyFeature" commandName="%command.commandname.11"/>
+ <elements xsi:type="commands:Command" xmi:id="_tPtdwMiIEeiKErB3UVzQug" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionStatusWizardAdminHandler" commandName="%command.name.111"/>
<elements xsi:type="commands:Command" xmi:id="_xDk5kNjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.pasteFeature" commandName="%command.commandname.12"/>
<elements xsi:type="commands:Command" xmi:id="_Za5DYO5vEeizn7bmbAeBkw" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionStatusWizardHandler" commandName="%command.commandname.13"/>
<elements xsi:type="commands:Command" xmi:id="_xyZ4oPhmEei8uPv-H2wqnw" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.exportTreeOntology" commandName="%command.commandname.14"/>
<elements xsi:type="commands:Command" xmi:id="_tEWW8NkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveUpRemoteServer" commandName="Move up"/>
<elements xsi:type="commands:Command" xmi:id="_-iLDQNkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveDownRemoteServer" commandName="Move down"/>
<elements xsi:type="commands:Command" xmi:id="_lbmBoEi_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.command.exportColDP" commandName="%wizard.name.122"/>
+ <elements xsi:type="commands:Command" xmi:id="_1BzvkLU-Ee6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.store.command.exportWFO_Dwca" commandName="%wizard.name.123"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_swGH0GhvEee3K4uKJljEYg" featurename="handlers" parentElementId="xpath:/">
<elements xsi:type="commands:Handler" xmi:id="_rVEdIGcjEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.termtree.e4.handler.RemoveTermHandler" command="_fNBtQGcjEee0qLTtA2ZpVQ"/>
<elements xsi:type="commands:Handler" xmi:id="_4kk8oDoqEeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.OpenDefinedTermHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.editor.definedterm.e4.handler.OpenDefinedTermEditorHandlerE4" command="_qEMrsIdPEeecZ4F2Y9Z0Og"/>
<elements xsi:type="commands:Handler" xmi:id="_4GeBAD4fEeuM4JU-Ch98ZA" elementId="eu.etaxonomy.taxeditor.store.OpenTermTreeHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.termtree.e4.handler.OpenTermTreeEditorHandler" command="_8aaicD4fEeuM4JU-Ch98ZA"/>
<elements xsi:type="commands:Handler" xmi:id="_oEReoEjAEe6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.io.e4.out.cdmlight.OpenColDPExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.col.OpenColExportWizard" command="_lbmBoEi_Ee6gZ65AByRHxQ"/>
+ <elements xsi:type="commands:Handler" xmi:id="_rng_YLU-Ee6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenWFOExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenWFODwcaExportWizard" command="_1BzvkLU-Ee6JFM-mIdEBFA"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_qT4hgIfTEeecZ4F2Y9Z0Og" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.window" positionInList="before:eu.etaxonomy.taxeditor.application.windowMenu.last">
<elements xsi:type="menu:Menu" xmi:id="_LT3P8IfcEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menu.termeditor" label="%menu.label.1">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_3eyLYKqXEeeXcJGhyhlrKA" coreExpressionId="isCdmStoreConnectedAndShowIOMenuEnabled"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_nf4z0KqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportDwca" label="%wizard.name.9" command="_y69I8KqZEeeXcJGhyhlrKA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_WVBa4Ex_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportColDP" label="%wizard.name.122" command="_lbmBoEi_Ee6gZ65AByRHxQ"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_kNlvALU_Ee6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportWFO_Dwca" label="WFO DwC-A" command="_1BzvkLU-Ee6JFM-mIdEBFA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_uruvcKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_zLKvMKqZEeeXcJGhyhlrKA"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_l9Oe0Ex_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.menuseparator.17"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_OL6sMH1LEem6uMX-L-maww" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportOwlTerm" label="%handledmenuitem.label.22" command="_WISF0H1LEem6uMX-L-maww"/>
--- /dev/null
+/**
+* Copyright (C) 2017 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.io.e4.out.dwca;
+
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
+
+/**
+ * @author pplitzner
+ * @since Oct 5, 2017
+ *
+ */
+public class OpenWFODwcaExportWizard extends AbstractOpenExportWizard {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Class<? extends AbstractExportWizard> getExportWizardClass() {
+ return WFODarwinCoreArchiveExportWizard.class;
+ }
+
+}
--- /dev/null
+/**
+ * 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.io.e4.out.dwca;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.UUID;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+
+import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
+import eu.etaxonomy.cdm.io.wfo.out.WfoExportConfigurator;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ *
+ * @author pplitzner
+ * @since Oct 6, 2017
+ *
+ */
+public class WFODarwinCoreArchiveExportWizard extends
+ AbstractExportWizard<WfoExportConfigurator> {
+
+ private WfoExportConfigurator configurator;
+ private ExportToFileDestinationWizardPage page;
+
+ @Inject
+ public WFODarwinCoreArchiveExportWizard(IEclipseContext context,
+ @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection) {
+ super(context, selection);
+ }
+
+ @Override
+ public void init() {
+ configurator = WfoExportConfigurator.NewInstance();
+ if (selection instanceof TreeSelection && !selection.isEmpty()){
+ Iterator it = selection.iterator();
+
+ while(it.hasNext()){
+ Object obj = it.next();
+ if (obj instanceof TaxonNodeDto){
+ TaxonNodeDto node = (TaxonNodeDto) obj;
+ if (node.getParentUUID() == null){
+ if (configurator.getTaxonNodeFilter() == null){
+ configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(node.getClassificationUUID()));
+ }else{
+ configurator.getTaxonNodeFilter().orClassification(node.getClassificationUUID());
+ }
+ }else{
+ if (configurator.getTaxonNodeFilter() == null){
+ configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(node.getUuid()));
+ }else{
+ configurator.getTaxonNodeFilter().orSubtree(node.getUuid());
+ }
+
+ }
+ }
+ }
+
+ }
+ }
+
+ @Override
+ public WfoExportConfigurator getConfigurator() {
+ return configurator;
+ }
+
+ @Override
+ public boolean performFinish() {
+ String urlString = page.getFolderText() + File.separator
+ + page.getExportFileName();
+
+ if (!page.getCheckUseSelectedTaxonNode()){
+ configurator.getTaxonNodeFilter().reset();
+ if (!page.getCheckUseAllClassifications()){
+ configurator.getTaxonNodeFilter().orClassification(page.getSelectedClassificationUUID());
+ }else{
+ for (UUID classificationUuid: page.getAllClassificationUuids()){
+ configurator.getTaxonNodeFilter().orClassification(classificationUuid);
+ }
+
+ }
+ }
+ CdmStore.getExportManager().runMoniteredOperation(configurator, urlString);
+ return true;
+ }
+
+ @Override
+ public void addPages() {
+ page = ExportToFileDestinationWizardPage.WFO(configurator);
+ addPage(page);
+ super.addPages();
+ }
+}
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
import eu.etaxonomy.cdm.io.tcsxml.out.TcsXmlExportConfigurator;
+import eu.etaxonomy.cdm.io.wfo.out.WfoExportConfigurator;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
public static final String SDD_EXPORT = "SDD_EXPORT";
public static final String DWCA_EXPORT = "DWCA_EXPORT";
+ public static final String WFO_EXPORT = "WFO_EXPORT";
public static final String CDM_LIGHT_EXPORT = "CDM_LIGHT(CSV)";
public static final String COL_DP_EXPORT = "COL DP";
public static final String CSV_EXPORT = "CSV_EXPORT";
private boolean csvPrintExport = false;
private boolean cdmLightExport = false;
-
+
private boolean colDPExport = false;
private boolean dwcaExport = false;
+ private boolean wfoExport = false;
private DirectoryDialog folderDialog;
private Text text_exportFileName;
case DWCA_EXPORT:
dwcaExport = true;
break;
+ case WFO_EXPORT:
+ wfoExport = true;
+ break;
default:
throw new RuntimeException("Export type not yet handeled: " + type);
}
return new ExportToFileDestinationWizardPage(DWCA_EXPORT, DWCA_EXPORT, "DwC-Archive Export",
"Export the content of the currently selected database into Darwin Core Archive format.", ZIP, config);
}
+ public static ExportToFileDestinationWizardPage WFO(WfoExportConfigurator config) {
+ return new ExportToFileDestinationWizardPage(WFO_EXPORT, WFO_EXPORT, "WFO DwC-Archive Classification Export",
+ "Export the content of the currently selected database into WFO "
+ + "Darwin Core Archive format.", ZIP, config);
+ }
public static ExportToFileDestinationWizardPage CdmLight(CdmLightExportConfigurator config) {
return new ExportToFileDestinationWizardPage(CDM_LIGHT_EXPORT, CDM_LIGHT_EXPORT, "CDM Light Export (csv)",
"Export the content of the currently selected database into the CDM light (csv) format.", CSV, config);
}
-
+
public static ExportToFileDestinationWizardPage ColDp(ColDpExportConfigurator config) {
return new ExportToFileDestinationWizardPage(COL_DP_EXPORT, COL_DP_EXPORT, "Col DP Export (zip)",
TaxonNode node = null;
composite.setLayout(gridLayout);
- if (cdmLightExport || dwcaExport || colDPExport) {
+ if (cdmLightExport || dwcaExport || colDPExport || wfoExport) {
checkExportUnpublished = new Button(composite, SWT.CHECK);
checkExportUnpublished.setText("Export unpublished taxa");
Label emptyLabel = new Label(composite, SWT.NONE);
}
}
- if (csvExport || csvPrintExport || cdmLightExport || csvNameExport || dwcaExport || colDPExport) {
+ if (csvExport || csvPrintExport || cdmLightExport || csvNameExport || dwcaExport || colDPExport || wfoExport) {
// Label comboBoxLabel = new Label(composite, SWT.NONE);
// comboBoxLabel.setText("Classification");
});
checkUseSelectedTaxonNode.setSelection(true);
}
- if (cdmLightExport || dwcaExport || colDPExport) {
+ if (cdmLightExport || dwcaExport || colDPExport || wfoExport) {
if (dwcaExport) {
checkUseAllClassification = new Button(selectNodeOrClassification, SWT.RADIO);
checkUseAllClassification.setText("Export all classifications");
if (value != null){
fillNameDetailsConfigurator(config, value);
}else {
- return null;
+ return new NameDetailsConfigurator();
}
return config;
}
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_CSV_OPENCSVEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.csv.OpenCsvExportWizard";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_CSV_PRINT_OPENCSVPRINTEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.csv.print.OpenCsvPrintExportWizard";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_DWCA_OPENDWCAEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenDwcaExportWizard";
+ public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_DWCA_OPENWFOEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenWFOExportWizard";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_JAXB_OPENJAXBEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.jaxb.OpenJaxbExportWizard";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_OWL_OPENOWLTERMEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.owl.OpenOwlTermExportWizard";
public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_SDD_OPENSDDEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.sdd.OpenSddExportWizard";