- if ((outputModelExport || dwcaExport)&& !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()){
- checkUseSelectedtaxonNode= new Button(selectNodeOrClassification, SWT.RADIO);
- String taxonStr = "";
- int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size();
- for (LogicFilter<TaxonNode> filter: configurator.getTaxonNodeFilter().getSubtreeFilter()){
- node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(filter.getUuid());
- count--;
- if (node.hasTaxon()){
- taxonStr += node.getTaxon().getName().getTitleCache();
- if (count>0){
- taxonStr += ", ";
- }
- }
- }
-
- checkUseSelectedtaxonNode.setText("Export selected subtree(s) ("+ taxonStr+")");
- checkUseSelectedtaxonNode.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event e) {
- Button b = (Button) e.widget;
- GridData data = (GridData) classificationSelectionCombo.getLayoutData();
- data.exclude = b.getSelection();
- classificationSelectionCombo.setEnabled(!data.exclude);
-
- }
- });
- checkUseSelectedtaxonNode.setSelection(true);
- }
- if(outputModelExport || dwcaExport){
- if (dwcaExport){
- checkUseAllClassification= new Button(selectNodeOrClassification, SWT.RADIO);
- checkUseAllClassification.setText("Export all classifications");
- checkUseAllClassification.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event e) {
- Button b = (Button) e.widget;
- GridData data = (GridData) classificationSelectionCombo.getLayoutData();
- data.exclude = b.getSelection();
- classificationSelectionCombo.setEnabled(!data.exclude);
-
- }
- });
- }
- checkUseSelectedClassification= new Button(selectNodeOrClassification, SWT.RADIO);
- checkUseSelectedClassification.setText("Export selected classification");
- checkUseSelectedClassification.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event e) {
- Button b = (Button) e.widget;
- GridData data = (GridData) classificationSelectionCombo.getLayoutData();
- data.exclude = b.getSelection();
- classificationSelectionCombo.setEnabled(data.exclude);
-
- }
- });
- }
-
- if (node!= null){
- selectedClassification = node.getClassification();
- }
- createClassificationSelectionCombo(selectNodeOrClassification);
- if (outputModelExport){
- Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
- GridData gridDataSep = new GridData();
- gridDataSep = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
- gridDataSep.horizontalSpan = 2;
+ if ((cdmLightExport || dwcaExport || colDPExport || wfoBackboneExport) && !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()) {
+ if (!wfoBackboneExport) {
+ checkUseSelectedTaxonNode = new Button(selectNodeOrClassification, SWT.RADIO);
+ }
+ String taxonStr = "";
+ int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size();
+ List<TaxonNode> selectedNodes = new ArrayList<>();
+ for (LogicFilter<TaxonNode> filter : configurator.getTaxonNodeFilter().getSubtreeFilter()) {
+ node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(filter.getUuid());
+ selectedNodes.add(node);
+ count--;
+ if (node.hasTaxon()) {
+ taxonStr += node.getTaxon().getName().getTitleCache();
+ if (count > 0) {
+ taxonStr += ", ";
+ }
+ }
+ }
+ if (!wfoBackboneExport) {
+ checkUseSelectedTaxonNode.setText("Export all selected subtree(s) (" + taxonStr + ")");
+ checkUseSelectedTaxonNode.addListener(SWT.Selection, e -> {
+ Button b = (Button) e.widget;
+ GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+ data.exclude = b.getSelection();
+ if (classificationSelectionCombo != null) {
+ classificationSelectionCombo.setEnabled(!data.exclude);
+ }
+ });
+ checkUseSelectedTaxonNode.setSelection(true);
+ }else {
+ Composite wfoComp = new Composite(selectNodeOrClassification, SWT.NONE);
+ grid = new GridLayout();
+ grid.numColumns = 2;
+ wfoComp.setLayout(grid);
+
+ Label label = new Label(wfoComp, SWT.NONE);
+ label.setText("Export all selected subtree(s) (" + taxonStr + ")");
+ GridData gridData = new GridData();
+ gridData.horizontalSpan = 2;
+ gridData.grabExcessHorizontalSpace = true;
+ label.setLayoutData(gridData);
+
+ Label familyString = new Label(wfoComp, SWT.NONE);
+ familyString.setText("Family");
+ text_familyString = new Text(wfoComp, SWT.BORDER);
+ text_familyString.setText(generateFamilyName(selectedNodes));
+ text_familyString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ Label baseUrlString = new Label(wfoComp, SWT.NONE);
+ baseUrlString.setText("Base url");
+ text_baseUrl = new Text(wfoComp, SWT.BORDER);
+ text_baseUrl.setText("");
+ text_baseUrl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ text_baseUrl.setToolTipText("The base url without /cdm_dataportal/taxon/{uuid} e.g. https://portal.cybertaxonomy.org/salvador");
+
+
+
+ }
+ }else if (wfoBackboneExport) {
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText("WFO Backbone export is only available for subtrees, not for classifications");
+ GridData gridData = new GridData();
+ gridData.horizontalSpan = 2;
+ gridData.grabExcessHorizontalSpace = true;
+ label.setLayoutData(gridData);
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if (cdmLightExport || dwcaExport || colDPExport ) {
+ if (dwcaExport) {
+ checkUseAllClassification = new Button(selectNodeOrClassification, SWT.RADIO);
+ checkUseAllClassification.setText("Export all classifications");
+ checkUseAllClassification.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(Event e) {
+ Button b = (Button) e.widget;
+ GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+ data.exclude = b.getSelection();
+ classificationSelectionCombo.setEnabled(!data.exclude);
+
+ }
+ });
+ }
+ checkUseSelectedClassification = new Button(selectNodeOrClassification, SWT.RADIO);
+ checkUseSelectedClassification.setText("Export selected classification");
+ checkUseSelectedClassification.addListener(SWT.Selection, e -> {
+ Button b = (Button) e.widget;
+ GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+ data.exclude = b.getSelection();
+ classificationSelectionCombo.setEnabled(data.exclude);
+ });
+ }
+
+ if (node != null && !wfoBackboneExport) {
+ selectedClassification = node.getClassification();
+ }
+ if (!wfoBackboneExport) {
+ createClassificationSelectionCombo(selectNodeOrClassification);
+ }
+ if (cdmLightExport) {
+ Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
+ GridData gridDataSep = new GridData();
+ gridDataSep = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
+ gridDataSep.horizontalSpan = 2;