Project

General

Profile

« Previous | Next » 

Revision a05f423c

Added by Katja Luther over 6 years ago

adapt export wizards to the use of filters

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CdmLightExportWizard.java
49 49
        	configurator = new CdmLightExportConfigurator(null);
50 50
    		if (selection instanceof TreeSelection && !selection.isEmpty()){
51 51
    			TaxonNode node = (TaxonNode)selection.getFirstElement();
52
    			configurator.setTaxonNodeFilter(TaxonNodeFilter.NewTaxonNodeInstance(node.getUuid()));
52
    			if (node.getParent() == null){
53
    				configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(node.getClassification().getUuid()));
54
    			}else{
55
    				configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(node.getUuid()));
56
    			}
53 57
    			
54 58
    		}
55 59
        	
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/DarwinCoreArchiveExportWizard.java
13 13

  
14 14
import org.eclipse.core.runtime.jobs.Job;
15 15
import org.eclipse.jface.viewers.IStructuredSelection;
16
import org.eclipse.jface.viewers.TreeSelection;
16 17
import org.eclipse.ui.IWorkbench;
17 18
import org.eclipse.ui.progress.IProgressConstants;
18 19

  
20
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
19 21
import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
22
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
20 23
import eu.etaxonomy.taxeditor.store.CdmStore;
21 24

  
22 25
/**
......
39 42
	@Override
40 43
	public void init(IWorkbench workbench, IStructuredSelection selection) {
41 44
		configurator = DwcaTaxExportConfigurator.NewInstance(null, null, null);
45
		if (selection instanceof TreeSelection && !selection.isEmpty()){
46
			TaxonNode node = (TaxonNode)selection.getFirstElement();
47
			if (node.getParent() == null){
48
				configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(node.getClassification().getUuid()));
49
			}else{
50
				configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(node.getUuid()));
51
			}
52
			
53
		}
42 54
	}
43 55

  
44 56
	/*
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java
99 99
	private boolean csvPrintExport = false;
100 100

  
101 101
	private boolean outputModelExport = false;
102
	private boolean dwcaExport = false;
102 103

  
103 104
	private DirectoryDialog folderDialog;
104 105
	private Text text_exportFileName;
......
141 142
		   case CSV_PRINT_EXPORT:
142 143
			   csvPrintExport = true;
143 144
			   break;
145
		   case DWCA_EXPORT:
146
			   dwcaExport = true;
147
			   break;
144 148
			  
145 149
		}
146 150
		this.extension = extension;
......
308 312
		}
309 313

  
310 314

  
311
		if(csvExport || csvPrintExport || outputModelExport|| csvNameExport){
315
		if(csvExport || csvPrintExport || outputModelExport|| csvNameExport || dwcaExport){
312 316
//		    Label comboBoxLabel = new Label(composite, SWT.NONE);
313 317
//		    comboBoxLabel.setText("Classification");
314 318
			
315
			if (outputModelExport && !((CdmLightExportConfigurator)configurator).getTaxonNodeFilter().getTaxonNodesFilter().isEmpty()){
319
			if ((outputModelExport || dwcaExport)&& !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()){
316 320
				  checkUseSelectedtaxonNode= new Button(composite, SWT.CHECK);
317 321
				  String taxonStr = "";
318
				  TaxonNode node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(((CdmLightExportConfigurator)configurator).getTaxonNodeFilter().getTaxonNodesFilter().get(0).getUuid());
322
				  TaxonNode node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(configurator.getTaxonNodeFilter().getSubtreeFilter().get(0).getUuid());
319 323
				  if (node.hasTaxon()){
320 324
					  taxonStr = node.getTaxon().getName().getTitleCache();
321 325
				  }

Also available in: Unified diff