Project

General

Profile

Revision 03b1edf8

ID03b1edf8659e77ff5c7239c459848bb77e0c46de
Parent cf7b2458
Child 2bd924ce

Added by Patrick Plitzner over 2 years ago

ref #7362 Implement view for Gfbio terminology service (experimental)

View differences:

eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
469 469
 org.joda.time.field;uses:="org.joda.time",
470 470
 org.joda.time.format;uses:="org.joda.time",
471 471
 org.joda.time.tz;uses:="org.joda.time",
472
 org.json,
472 473
 org.junit;uses:="org.hamcrest",
473 474
 org.junit.runner,
474 475
 org.slf4j,
eu.etaxonomy.taxeditor.store/fragment.e4xmi
72 72
      <tags>nonRestore</tags>
73 73
    </elements>
74 74
    <elements xsi:type="basic:PartDescriptor" xmi:id="_aT37QM3UEeeznb_sS6rfAQ" elementId="eu.etaxonomy.taxeditor.store.partdescriptor.SearchDialog" label="%view.name.9" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.ui.dialog.selection.SearchDialog"/>
75
    <elements xsi:type="basic:PartDescriptor" xmi:id="_XV6gkEbOEeiER_VRS0L7wA" elementId="eu.etaxonomy.taxeditor.view.webimport.termimport.GfBioTerminologyImportPart" label="Gfbio Term Import" tooltip="Gfbio Term Import" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.webimport.termimport.GfBioTerminologyImportPart"/>
75 76
  </fragments>
76 77
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_3rW8wCXaEeex9MwMOgUeWw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.afterConcept">
77 78
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_TlufMCaGEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.supplemental" label="%command.label.1" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/applications-office.png" tooltip="%command.label.1" command="_bnVKsCZxEeeQLpuomSmVoQ">
......
161 162
  </fragments>
162 163
  <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">
163 164
    <elements xsi:type="menu:Menu" xmi:id="_LT3P8IfcEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menu.termeditor" label="Term Editor">
164
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_Rk37AIfcEeecZ4F2Y9Z0Og" coreExpressionId="isCdmStoreConnected"/>
165
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_gVhOIEb1EeiER_VRS0L7wA" coreExpressionId="isCdmStoreConnected"/>
165 166
      <children xsi:type="menu:DynamicMenuContribution" xmi:id="_HIptYIfUEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.dynamicmenucontribution.0" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.editor.definedterm.e4.DefinedTermMenuE4"/>
166 167
      <children xsi:type="menu:MenuSeparator" xmi:id="_yRINcIfqEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menuseparator.3"/>
167 168
      <children xsi:type="menu:HandledMenuItem" xmi:id="_rwfDkIftEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.featureTreeEditor" label="Feature Tree Editor" tooltip="Feature Tree Editor" command="_bnVKsCZxEeeQLpuomSmVoQ">
168 169
        <parameters xmi:id="_3acJQIftEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.featureTreeEditor" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor"/>
169 170
      </children>
171
      <children xsi:type="menu:HandledMenuItem" xmi:id="_eU0zcEbOEeiER_VRS0L7wA" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.gfbioTermImport" label="Gfbio Term Import" tooltip="Gfbio Term Import" command="_bnVKsCZxEeeQLpuomSmVoQ">
172
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_h15bwEb1EeiER_VRS0L7wA" coreExpressionId="isCdmStoreConnectedAndShowExperimental"/>
173
        <parameters xmi:id="_eU0zcUbOEeiER_VRS0L7wA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.gfbioTermImport" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.webimport.termimport.GfBioTerminologyImportPart"/>
174
      </children>
170 175
    </elements>
171 176
  </fragments>
172 177
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_pVVyEJFJEeeDJpjGQES7gw" featurename="addons" parentElementId="xpath:/">
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/GfBioTerminologyImportComposite.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import org.eclipse.jface.viewers.ComboViewer;
12
import org.eclipse.jface.viewers.TreeViewer;
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.layout.GridData;
15
import org.eclipse.swt.layout.GridLayout;
16
import org.eclipse.swt.widgets.Combo;
17
import org.eclipse.swt.widgets.Composite;
18
import org.eclipse.swt.widgets.Tree;
19

  
20
/**
21
 * @author pplitzner
22
 * @since Apr 23, 2018
23
 *
24
 */
25
public class GfBioTerminologyImportComposite extends Composite{
26
    private TreeViewer treeTermHierarchy;
27
    private ComboViewer comboOntologies;
28

  
29
    public GfBioTerminologyImportComposite(Composite parent, int style) {
30
        super(parent, style);
31
        setLayout(new GridLayout(1, false));
32

  
33
        comboOntologies = new ComboViewer(this, SWT.NONE);
34
        Combo combo = comboOntologies.getCombo();
35
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
36

  
37
        treeTermHierarchy = new TreeViewer(this, SWT.BORDER);
38
        Tree tree = treeTermHierarchy.getTree();
39
        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
40
    }
41
    public TreeViewer getTreeTermHierarchy() {
42
        return treeTermHierarchy;
43
    }
44
    public ComboViewer getComboOntologies() {
45
        return comboOntologies;
46
    }
47
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/GfBioTerminologyImportPart.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import javax.annotation.PostConstruct;
12

  
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.widgets.Composite;
15

  
16
/**
17
 * @author pplitzner
18
 * @since Apr 23, 2018
19
 *
20
 */
21
public class GfBioTerminologyImportPart {
22

  
23
    @PostConstruct
24
    public void create(Composite parent){
25
        GfBioTerminologyImportComposite composite = new GfBioTerminologyImportComposite(parent, SWT.NONE);
26
        new GfBioTerminologyImportPresenter(composite);
27
    }
28
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/GfBioTerminologyImportPresenter.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import java.util.ArrayList;
12
import java.util.Collection;
13
import java.util.HashSet;
14
import java.util.List;
15

  
16
import org.eclipse.jface.viewers.ArrayContentProvider;
17
import org.eclipse.jface.viewers.ComboViewer;
18
import org.eclipse.jface.viewers.ISelectionChangedListener;
19
import org.eclipse.jface.viewers.SelectionChangedEvent;
20
import org.json.JSONArray;
21
import org.json.JSONException;
22
import org.json.JSONObject;
23

  
24
import eu.etaxonomy.taxeditor.model.MessagingUtils;
25
import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestTerminologies;
26
import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.TerminologyServiceConstants;
27
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
28
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.TerminologyWrapper;
29

  
30
/**
31
 * @author pplitzner
32
 * @since Apr 23, 2018
33
 *
34
 */
35
public class GfBioTerminologyImportPresenter implements ISelectionChangedListener {
36

  
37
    private GfBioTerminologyImportComposite composite;
38
    private OntologyTermContentProvider contentProvider;
39

  
40
    /**
41
     * @param composite
42
     */
43
    public GfBioTerminologyImportPresenter(GfBioTerminologyImportComposite composite) {
44
        super();
45
        this.composite = composite;
46
        String response = new RequestTerminologies().request();
47
        if(response==null){
48
            MessagingUtils.informationDialog("Web service unavailable", "Could not retrieve data from web service");
49
            return;
50
        }
51
        //fetch terminology list via web service
52
        List<TerminologyWrapper> wrapperList = new ArrayList<>();
53
        try {
54
            JSONObject jsonResponse = new JSONObject(response);
55
            JSONArray responseArray = jsonResponse.getJSONArray("results");
56
            for(int i=0;i<responseArray.length();i++){
57
                JSONObject terminology = responseArray.getJSONObject(i);
58
                String name = terminology.getString("name");
59
                String acronym = terminology.getString("acronym");
60
                String description = terminology.getString("description");
61
                String uriString = terminology.getString("uri");
62
                wrapperList.add(new TerminologyWrapper(name, acronym, description, uriString));
63
            }
64
        } catch (JSONException e) {
65
            e.printStackTrace();
66
        }
67
        //combo
68
        ComboViewer comboOntologies = composite.getComboOntologies();
69
        comboOntologies.setLabelProvider(new TerminologyLabelProvider());
70
        comboOntologies.setContentProvider(new ArrayContentProvider());
71
        comboOntologies.setInput(wrapperList);
72
        comboOntologies.addSelectionChangedListener(this);
73

  
74
        contentProvider = new OntologyTermContentProvider();
75
        composite.getTreeTermHierarchy().setContentProvider(contentProvider);
76
        composite.getTreeTermHierarchy().setLabelProvider(new OntologyTermLabelProvider());
77
    }
78

  
79
    /**
80
     * {@inheritDoc}
81
     */
82
    @Override
83
    public void selectionChanged(SelectionChangedEvent event) {
84
        //get root elements of selected ontology
85
        //FIXME: this service endpoint does not exist yet
86
        //so we use the root element of the PO for all selections
87
        String selectedOntology = "PO";
88
        contentProvider.setOntologyLabel(selectedOntology);
89
        Collection<OntologyTermWrapper> termWrappers = new HashSet<>();
90
        termWrappers.add(new OntologyTermWrapper(TerminologyServiceConstants.PO_ROOT_ELEMENT, "plant anatomical entity"));
91
        composite.getTreeTermHierarchy().setInput(termWrappers);
92
    }
93

  
94

  
95
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/OntologyTermContentProvider.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import java.util.ArrayList;
12
import java.util.Collection;
13

  
14
import org.eclipse.jface.viewers.ITreeContentProvider;
15
import org.json.JSONArray;
16
import org.json.JSONException;
17
import org.json.JSONObject;
18

  
19
import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestNarrower;
20
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
21

  
22
/**
23
 * @author pplitzner
24
 * @since Apr 23, 2018
25
 *
26
 */
27
public class OntologyTermContentProvider implements ITreeContentProvider {
28

  
29
    private String ontologyLabel;
30

  
31
    @Override
32
    public Object[] getElements(Object inputElement) {
33
        Collection<Object> elements = new ArrayList<>();
34
        if(inputElement instanceof Collection){
35
            elements = (Collection<Object>) inputElement;
36
        }
37
        return elements.toArray();
38
    }
39

  
40
    @Override
41
    public Object[] getChildren(Object parentElement) {
42
        Collection<OntologyTermWrapper> wrapperList = new ArrayList<>();
43
        if(parentElement instanceof OntologyTermWrapper){
44
            String parentUri = ((OntologyTermWrapper) parentElement).getUri();
45
            String response = new RequestNarrower(parentUri, ontologyLabel).request();
46
            try {
47
                JSONObject jsonResponse = new JSONObject(response);
48
                JSONArray responseArray = jsonResponse.getJSONArray("results");
49
                for(int i=0;i<responseArray.length();i++){
50
                    JSONObject terminology = responseArray.getJSONObject(i);
51
                    String label = terminology.getString("label");
52
                    String uriString = terminology.getString("uri");
53
                    wrapperList.add(new OntologyTermWrapper(uriString, label));
54
                }
55
            } catch (JSONException e) {
56
                e.printStackTrace();
57
            }
58
        }
59
        return wrapperList.toArray();
60
    }
61

  
62
    @Override
63
    public Object getParent(Object element) {
64
        return null;
65
    }
66

  
67
    @Override
68
    public boolean hasChildren(Object element) {
69
        return true;
70
    }
71

  
72
    public void setOntologyLabel(String ontologyLabel) {
73
        this.ontologyLabel = ontologyLabel;
74
    }
75

  
76
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/OntologyTermLabelProvider.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import org.eclipse.jface.viewers.LabelProvider;
12

  
13
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
14

  
15
/**
16
 * @author pplitzner
17
 * @since Apr 23, 2018
18
 *
19
 */
20
public class OntologyTermLabelProvider extends LabelProvider {
21

  
22
    @Override
23
    public String getText(Object element) {
24
        if(element instanceof OntologyTermWrapper){
25
            return ((OntologyTermWrapper) element).getLabel();
26
        }
27
        return super.getText(element);
28
    }
29
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/TerminologyLabelProvider.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport;
10

  
11
import org.eclipse.jface.viewers.LabelProvider;
12

  
13
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.TerminologyWrapper;
14

  
15
/**
16
 * @author pplitzner
17
 * @since Apr 23, 2018
18
 *
19
 */
20
public class TerminologyLabelProvider extends LabelProvider {
21

  
22
    @Override
23
    public String getText(Object element) {
24
        if(element instanceof TerminologyWrapper){
25
            return ((TerminologyWrapper) element).getName();
26
        }
27
        return super.getText(element);
28
    }
29
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/requests/AbstractTerminologyServiceRequest.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.requests;
10

  
11
import java.io.BufferedReader;
12
import java.io.IOException;
13
import java.io.InputStreamReader;
14
import java.net.HttpURLConnection;
15
import java.net.URL;
16
import java.util.List;
17

  
18
/**
19
 * @author pplitzner
20
 * @since Apr 23, 2018
21
 *
22
 */
23
public abstract class AbstractTerminologyServiceRequest {
24
    public String request() {
25

  
26
        try {
27
            String uriString = TerminologyServiceConstants.SERVICE_URL
28
                    + (getTerminologyId()!=null?getTerminologyId()+"/":"")
29
                    + (getServiceUri()!=null?getServiceUri()+"/":"");
30

  
31
            List<RequestParameter> serviceParameters = getServiceParameters();
32
            if(serviceParameters!=null){
33
                uriString += "?";
34
                StringBuilder params = new StringBuilder();
35
                serviceParameters.forEach(param->params.append(param.key+"="+param.value+"&"));
36
                uriString += params.toString();
37
            }
38
            URL url = new URL(uriString);
39
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
40
            conn.setRequestProperty("format", "json");
41
            conn.setRequestMethod("GET");
42
            conn.setRequestProperty("Accept", "application/json");
43

  
44
            if (conn.getResponseCode() != 200) {
45
                throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
46
            }
47
            BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
48

  
49
            StringBuilder  builder = new StringBuilder();
50
            String line;
51
            while ((line = br.readLine()) != null) {
52
                builder.append(line);
53
            }
54
            conn.disconnect();
55
            return builder.toString();
56

  
57
        } catch (IOException e) {
58
            e.printStackTrace();
59
        }
60
        return null;
61
    }
62

  
63
    protected abstract String getServiceUri();
64
    protected abstract String getTerminologyId();
65
    protected abstract List<RequestParameter> getServiceParameters();
66

  
67
    protected class RequestParameter{
68
        String key;
69
        String value;
70
        public RequestParameter(String key, String value) {
71
            super();
72
            this.key = key;
73
            this.value = value;
74
        }
75
        public String getKey() {
76
            return key;
77
        }
78
        public String getValue() {
79
            return value;
80
        }
81

  
82
    }
83
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/requests/RequestNarrower.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.requests;
10

  
11
import java.util.ArrayList;
12
import java.util.List;
13

  
14
/**
15
 * @author pplitzner
16
 * @since Apr 23, 2018
17
 *
18
 */
19
public class RequestNarrower extends AbstractTerminologyServiceRequest{
20

  
21
    private String termUri;
22
    private String ontologyLabel;
23

  
24
    public RequestNarrower(String termUri, String ontologyLabel) {
25
        super();
26
        this.termUri = termUri;
27
        this.ontologyLabel = ontologyLabel;
28
    }
29

  
30
    @Override
31
    protected String getServiceUri() {
32
        return TerminologyServiceConstants.NARROWER_SERVICE_URL;
33
    }
34

  
35
    /**
36
     * {@inheritDoc}
37
     */
38
    @Override
39
    protected String getTerminologyId() {
40
        return ontologyLabel;
41
    }
42

  
43
    /**
44
     * {@inheritDoc}
45
     */
46
    @Override
47
    protected List<RequestParameter> getServiceParameters() {
48
        List<RequestParameter> params = new ArrayList<>();
49
        params.add(new RequestParameter(TerminologyServiceConstants.ATR_URI, termUri));
50
        return params;
51
    }
52

  
53
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/requests/RequestTerminologies.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.requests;
10

  
11
import java.util.List;
12

  
13
/**
14
 * @author pplitzner
15
 * @since Apr 23, 2018
16
 *
17
 */
18
public class RequestTerminologies extends AbstractTerminologyServiceRequest{
19

  
20
    @Override
21
    protected String getServiceUri() {
22
        return null;
23
    }
24

  
25
    @Override
26
    protected String getTerminologyId() {
27
        return null;
28
    }
29

  
30
    @Override
31
    protected List<RequestParameter> getServiceParameters() {
32
        return null;
33
    }
34

  
35
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/requests/TerminologyServiceConstants.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.requests;
10

  
11
/**
12
 * @author pplitzner
13
 * @since Apr 23, 2018
14
 *
15
 */
16
public interface TerminologyServiceConstants {
17

  
18
    public static final String SERVICE_URL = "https://dev-gfbio.bgbm.org/api/terminologies/";
19
    public static final String NARROWER_SERVICE_URL = "narrower";
20
    public static final String TERM_SERVICE_URL = "term";
21
    public static final String ATR_URI = "uri";
22

  
23
    public static final String PO_ROOT_ELEMENT = "http://purl.obolibrary.org/obo/PO_0025131";
24
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/wrapper/OntologyTermWrapper.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper;
10

  
11
/**
12
 * @author pplitzner
13
 * @since Apr 23, 2018
14
 *
15
 */
16
public class OntologyTermWrapper {
17

  
18
    private String uri;
19
    private String label;
20
    public OntologyTermWrapper(String uri, String label) {
21
        this.uri = uri;
22
        this.label = label;
23
    }
24
    public String getUri() {
25
        return uri;
26
    }
27
    public String getLabel() {
28
        return label;
29
    }
30

  
31
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/wrapper/TerminologyWrapper.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper;
10

  
11
/**
12
 * @author pplitzner
13
 * @since Apr 23, 2018
14
 *
15
 */
16
public class TerminologyWrapper {
17

  
18
    private String name;
19
    private String acronym;
20
    private String description;
21
    private String uri;
22
    public TerminologyWrapper(String name, String acronym, String description, String uri) {
23
        this.name = name;
24
        this.acronym = acronym;
25
        this.description = description;
26
        this.uri = uri;
27
    }
28
    public String getName() {
29
        return name;
30
    }
31
    public String getAcronym() {
32
        return acronym;
33
    }
34
    public String getDescription() {
35
        return description;
36
    }
37
    public String getUri() {
38
        return uri;
39
    }
40

  
41
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)