Commit 4bcbd19fd9746073f40abac439f3d503e064c272

Authored by Nathanael Jourdane
1 parent d11a0a1d
Exists in master

Fix imports

src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java
... ... @@ -24,9 +24,9 @@ import java.util.logging.Level;
24 24 import java.util.logging.Logger;
25 25  
26 26 import eu.omp.irap.vespa.epntapclient.lib.EpnTapController;
27   -import eu.omp.irap.vespa.epntapclient.lib.Queries;
28   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;
29   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
  27 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  28 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  29 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
30 30  
31 31 /**
32 32 * @author N. Jourdane
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java
... ... @@ -44,7 +44,7 @@ import com.google.gson.JsonArray;
44 44 import com.google.gson.JsonObject;
45 45 import com.google.gson.JsonParser;
46 46  
47   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
  47 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
48 48 import eu.omp.irap.vespa.epntapclient.votable.utils.Network;
49 49  
50 50 /**
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java
... ... @@ -20,10 +20,11 @@ import java.util.HashMap;
20 20 import java.util.Map;
21 21 import java.util.logging.Logger;
22 22  
  23 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  24 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  25 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  26 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
23 27 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
24   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;
25   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
26   -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;
27 28  
28 29 /**
29 30 * The main controller which manage views and controllers.
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java
... ... @@ -22,6 +22,7 @@ import java.util.logging.Logger;
22 22  
23 23 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceCtrl;
24 24 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException;
  25 +import eu.omp.irap.vespa.epntapclient.service.Service;
25 26 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
26 27  
27 28 /**
... ... @@ -35,8 +36,9 @@ public class EpnTapFacade implements EpnTapInterface {
35 36  
36 37 /* @see eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources() */
37 38 @Override
38   - public List<Resource> getEPNVOResources() throws VOResourceException {
39   - return VOResourceCtrl.getVOResources();
  39 + public List<Resource> getEPNVOResources(Service.ServiceType serviceType)
  40 + throws VOResourceException {
  41 + return VOResourceCtrl.getVOResources(serviceType);
40 42 }
41 43  
42 44 /*
... ... @@ -44,9 +46,10 @@ public class EpnTapFacade implements EpnTapInterface {
44 46 * eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources(java.util.List)
45 47 */
46 48 @Override
47   - public List<Resource> getEPNVOResources(Map<String, String> keywords)
  49 + public List<Resource> getEPNVOResources(Service.ServiceType serviceType,
  50 + Map<String, String> keywords)
48 51 throws VOResourceException {
49   - return VOResourceCtrl.getVOResources(keywords);
  52 + return VOResourceCtrl.getVOResources(serviceType, keywords);
50 53 }
51 54  
52 55 /*
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java
... ... @@ -20,6 +20,7 @@ import java.util.List;
20 20 import java.util.Map;
21 21  
22 22 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException;
  23 +import eu.omp.irap.vespa.epntapclient.service.Service;
23 24 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
24 25  
25 26 /**
... ... @@ -28,13 +29,15 @@ import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
28 29 public interface EpnTapInterface {
29 30  
30 31 /** returns a set of VOResource elements (one per EPN-TAP service) */
31   - List<Resource> getEPNVOResources() throws VOResourceException;
  32 + List<Resource> getEPNVOResources(Service.ServiceType serviceType)
  33 + throws VOResourceException;
32 34  
33 35 /**
34 36 * Returns a set of VOREsource elements (one per EPN-TAP service corresponding to the keywords).
35 37 * The way keywords are defined is still to be defined.
36 38 */
37   - List<Resource> getEPNVOResources(Map<String, String> keywords) throws VOResourceException;
  39 + List<Resource> getEPNVOResources(Service.ServiceType serviceType,
  40 + Map<String, String> keywords) throws VOResourceException;
38 41  
39 42 /** returns the VOResource element of the service identified by the ivoID. */
40 43 Resource getEPNVOresource(String ivoid) throws VOResourceException;
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java
... ... @@ -18,8 +18,9 @@ package eu.omp.irap.vespa.epntapclient.lib;
18 18  
19 19 import java.util.logging.Logger;
20 20  
  21 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  22 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
21 23 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
22   -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;
23 24  
24 25 /**
25 26 * @author N. Jourdane
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java
... ... @@ -19,7 +19,7 @@ package eu.omp.irap.vespa.epntapclient.service;
19 19 /**
20 20 * @author N. Jourdane
21 21 */
22   -public class ServiceModel {
  22 +public class Service {
23 23  
24 24 private String ivoid;
25 25  
... ... @@ -60,10 +60,10 @@ public class ServiceModel {
60 60 }
61 61  
62 62  
63   - private ServiceModel() {
  63 + private Service() {
64 64 }
65 65  
66   - ServiceModel(String ivoid) {
  66 + Service(String ivoid) {
67 67 this.ivoid = ivoid;
68 68 }
69 69  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java
... ... @@ -41,9 +41,9 @@ public class ServiceCtrl {
41 41 public static final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss";
42 42  
43 43  
44   - public final ServiceModel getServiceFromResource(ServiceModel.ServiceType serviceType,
  44 + public final Service getServiceFromResource(Service.ServiceType serviceType,
45 45 Resource resource) {
46   - ServiceModel service = new ServiceModel(resource.getIdentifier());
  46 + Service service = new Service(resource.getIdentifier());
47 47 service.setTitle(resource.getTitle());
48 48 service.setShortName(resource.getShortName());
49 49 StringJoiner types = new StringJoiner(", ");
... ... @@ -74,11 +74,11 @@ public class ServiceCtrl {
74 74 return sdf.format(date.toGregorianCalendar().getTime());
75 75 }
76 76  
77   - public final List<ServiceModel> getServiceFromVOTableData(ServiceModel.ServiceType serviceType,
  77 + public final List<Service> getServiceFromVOTableData(Service.ServiceType serviceType,
78 78 VOTableData data) {
79   - List<ServiceModel> services = new ArrayList<>();
  79 + List<Service> services = new ArrayList<>();
80 80 for (int i = 0; i < data.getNbRows(); i++) {
81   - ServiceModel service = new ServiceModel((String) data.getCell(i, "ivoid"));
  81 + Service service = new Service((String) data.getCell(i, "ivoid"));
82 82 service.setTitle((String) data.getCell(i, "res_title"));
83 83 service.setShortName((String) data.getCell(i, "short_name"));
84 84 service.setType((String) data.getCell(i, "content_type"));
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java
... ... @@ -14,7 +14,7 @@
14 14 * <http://www.gnu.org/licenses/>.
15 15 */
16 16  
17   -package eu.omp.irap.vespa.epntapclient.votable.utils;
  17 +package eu.omp.irap.vespa.epntapclient.votable;
18 18  
19 19 /**
20 20 * This class defines widely-used constants.
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java
... ... @@ -25,7 +25,6 @@ import javax.swing.SwingUtilities;
25 25 import com.google.gson.Gson;
26 26  
27 27 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
28   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException;
29 28 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView;
30 29  
31 30 /**
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java
... ... @@ -14,7 +14,7 @@
14 14 * <http://www.gnu.org/licenses/>.
15 15 */
16 16  
17   -package eu.omp.irap.vespa.epntapclient.votable.controller;
  17 +package eu.omp.irap.vespa.epntapclient.votable;
18 18  
19 19 import java.io.IOException;
20 20  
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java
... ... @@ -22,15 +22,16 @@ import java.util.SortedMap;
22 22 import java.util.TreeMap;
23 23 import java.util.logging.Logger;
24 24  
25   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;
26   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
27   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException;
28   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralResourcesException;
29   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralTablesException;
30   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
  25 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  26 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  27 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
  28 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
  29 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException;
  30 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralResourcesException;
  31 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralTablesException;
  32 +import eu.omp.irap.vespa.epntapclient.votable.data.VOTableDataCtrl;
31 33 import eu.omp.irap.vespa.epntapclient.votable.model.Table;
32 34 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
33   -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;
34 35 import eu.omp.irap.vespa.epntapclient.votable.utils.Network;
35 36 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableViewListener;
36 37  
... ... @@ -113,11 +114,11 @@ public class VOTableController implements VOTableViewListener {
113 114  
114 115 Table table = (Table) voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0);
115 116  
116   - VOTableDataParser dataParser;
  117 + VOTableDataCtrl dataParser;
117 118 try {
118   - dataParser = new VOTableDataParser(table);
119   - voTableColumns = dataParser.getColumnsName();
120   - voTableData = dataParser.getDataArray();
  119 + dataParser = new VOTableDataCtrl(table);
  120 + voTableColumns = dataParser.getData().getColumnsName();
  121 + voTableData = dataParser.getData().getData();
121 122 } catch (IOException e) {
122 123 throw new CantModifyVOTableException(voTablePath, e);
123 124 }
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java
... ... @@ -36,9 +36,9 @@ import org.w3c.dom.Document;
36 36 import org.w3c.dom.NamedNodeMap;
37 37 import org.xml.sax.SAXException;
38 38  
39   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;
40   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
41   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException;
  39 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  40 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
  41 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException;
42 42 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
43 43  
44 44 /**
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java
... ... @@ -23,6 +23,8 @@ import java.util.logging.Logger;
23 23 import com.google.gson.Gson;
24 24 import com.google.gson.GsonBuilder;
25 25  
  26 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  27 +
26 28 /**
27 29 * @author N. Jourdane
28 30 */
... ...
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java
... ... @@ -31,14 +31,14 @@ import java.util.Map;
31 31 import java.util.logging.Level;
32 32 import java.util.logging.Logger;
33 33  
34   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;
35   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.BadResponseCodeException;
36   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetErrorStream;
37   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetResponseCode;
38   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantOpenConnectionException;
39   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantWriteQueryResultException;
40   -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.UnsupportedParamEncodingException;
41   -import eu.omp.irap.vespa.epntapclient.votable.utils.Strings.StringJoiner;
  34 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  35 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
  36 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.BadResponseCodeException;
  37 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetErrorStream;
  38 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetResponseCode;
  39 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantOpenConnectionException;
  40 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantWriteQueryResultException;
  41 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.UnsupportedParamEncodingException;
42 42  
43 43 /**
44 44 * @author N. Jourdane
... ...