diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java index cf78e1f..8814508 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java @@ -24,9 +24,9 @@ import java.util.logging.Level; import java.util.logging.Logger; import eu.omp.irap.vespa.epntapclient.lib.EpnTapController; -import eu.omp.irap.vespa.epntapclient.lib.Queries; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; +import eu.omp.irap.vespa.epntapclient.service.Queries; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException; /** * @author N. Jourdane diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java index 381c045..7cf5eb1 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java @@ -44,7 +44,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException; import eu.omp.irap.vespa.epntapclient.votable.utils.Network; /** diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java index 475543c..d58733e 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java @@ -20,10 +20,11 @@ import java.util.HashMap; import java.util.Map; import java.util.logging.Logger; +import eu.omp.irap.vespa.epntapclient.service.Queries; +import eu.omp.irap.vespa.epntapclient.votable.Consts; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException; import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts; /** * The main controller which manage views and controllers. diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java index 8e5dc39..c684f04 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java @@ -22,6 +22,7 @@ import java.util.logging.Logger; import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceCtrl; import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException; +import eu.omp.irap.vespa.epntapclient.service.Service; import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; /** @@ -35,8 +36,9 @@ public class EpnTapFacade implements EpnTapInterface { /* @see eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources() */ @Override - public List getEPNVOResources() throws VOResourceException { - return VOResourceCtrl.getVOResources(); + public List getEPNVOResources(Service.ServiceType serviceType) + throws VOResourceException { + return VOResourceCtrl.getVOResources(serviceType); } /* @@ -44,9 +46,10 @@ public class EpnTapFacade implements EpnTapInterface { * eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources(java.util.List) */ @Override - public List getEPNVOResources(Map keywords) + public List getEPNVOResources(Service.ServiceType serviceType, + Map keywords) throws VOResourceException { - return VOResourceCtrl.getVOResources(keywords); + return VOResourceCtrl.getVOResources(serviceType, keywords); } /* diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java index 5867507..6eedb6a 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.Map; import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException; +import eu.omp.irap.vespa.epntapclient.service.Service; import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; /** @@ -28,13 +29,15 @@ import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; public interface EpnTapInterface { /** returns a set of VOResource elements (one per EPN-TAP service) */ - List getEPNVOResources() throws VOResourceException; + List getEPNVOResources(Service.ServiceType serviceType) + throws VOResourceException; /** * Returns a set of VOREsource elements (one per EPN-TAP service corresponding to the keywords). * The way keywords are defined is still to be defined. */ - List getEPNVOResources(Map keywords) throws VOResourceException; + List getEPNVOResources(Service.ServiceType serviceType, + Map keywords) throws VOResourceException; /** returns the VOResource element of the service identified by the ivoID. */ Resource getEPNVOresource(String ivoid) throws VOResourceException; diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java index eb7c595..19de5dc 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java @@ -18,8 +18,9 @@ package eu.omp.irap.vespa.epntapclient.lib; import java.util.logging.Logger; +import eu.omp.irap.vespa.epntapclient.service.Queries; +import eu.omp.irap.vespa.epntapclient.votable.Consts; import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts; /** * @author N. Jourdane diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java b/src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java index ee26c1b..e4dffd0 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java @@ -19,7 +19,7 @@ package eu.omp.irap.vespa.epntapclient.service; /** * @author N. Jourdane */ -public class ServiceModel { +public class Service { private String ivoid; @@ -60,10 +60,10 @@ public class ServiceModel { } - private ServiceModel() { + private Service() { } - ServiceModel(String ivoid) { + Service(String ivoid) { this.ivoid = ivoid; } diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java b/src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java index e8c2077..733eedc 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java @@ -41,9 +41,9 @@ public class ServiceCtrl { public static final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss"; - public final ServiceModel getServiceFromResource(ServiceModel.ServiceType serviceType, + public final Service getServiceFromResource(Service.ServiceType serviceType, Resource resource) { - ServiceModel service = new ServiceModel(resource.getIdentifier()); + Service service = new Service(resource.getIdentifier()); service.setTitle(resource.getTitle()); service.setShortName(resource.getShortName()); StringJoiner types = new StringJoiner(", "); @@ -74,11 +74,11 @@ public class ServiceCtrl { return sdf.format(date.toGregorianCalendar().getTime()); } - public final List getServiceFromVOTableData(ServiceModel.ServiceType serviceType, + public final List getServiceFromVOTableData(Service.ServiceType serviceType, VOTableData data) { - List services = new ArrayList<>(); + List services = new ArrayList<>(); for (int i = 0; i < data.getNbRows(); i++) { - ServiceModel service = new ServiceModel((String) data.getCell(i, "ivoid")); + Service service = new Service((String) data.getCell(i, "ivoid")); service.setTitle((String) data.getCell(i, "res_title")); service.setShortName((String) data.getCell(i, "short_name")); service.setType((String) data.getCell(i, "content_type")); diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java index 2bf2c1c..7ae36b6 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java @@ -14,7 +14,7 @@ * . */ -package eu.omp.irap.vespa.epntapclient.votable.utils; +package eu.omp.irap.vespa.epntapclient.votable; /** * This class defines widely-used constants. diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java index b6773e3..c3a8a86 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java @@ -25,7 +25,6 @@ import javax.swing.SwingUtilities; import com.google.gson.Gson; import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException; import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; /** diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java index c4a4f53..f77d8aa 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java @@ -14,7 +14,7 @@ * . */ -package eu.omp.irap.vespa.epntapclient.votable.controller; +package eu.omp.irap.vespa.epntapclient.votable; import java.io.IOException; diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java index 808d818..070869f 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java @@ -22,15 +22,16 @@ import java.util.SortedMap; import java.util.TreeMap; import java.util.logging.Logger; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralResourcesException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralTablesException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; +import eu.omp.irap.vespa.epntapclient.votable.Consts; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralResourcesException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralTablesException; +import eu.omp.irap.vespa.epntapclient.votable.data.VOTableDataCtrl; import eu.omp.irap.vespa.epntapclient.votable.model.Table; import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE; -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts; import eu.omp.irap.vespa.epntapclient.votable.utils.Network; import eu.omp.irap.vespa.epntapclient.votable.view.VOTableViewListener; @@ -113,11 +114,11 @@ public class VOTableController implements VOTableViewListener { Table table = (Table) voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0); - VOTableDataParser dataParser; + VOTableDataCtrl dataParser; try { - dataParser = new VOTableDataParser(table); - voTableColumns = dataParser.getColumnsName(); - voTableData = dataParser.getDataArray(); + dataParser = new VOTableDataCtrl(table); + voTableColumns = dataParser.getData().getColumnsName(); + voTableData = dataParser.getData().getData(); } catch (IOException e) { throw new CantModifyVOTableException(voTablePath, e); } diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java index 7e26214..1b40b66 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java @@ -36,9 +36,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.xml.sax.SAXException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException; import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE; /** diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java index 1d27941..55bb2ca 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java @@ -23,6 +23,8 @@ import java.util.logging.Logger; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import eu.omp.irap.vespa.epntapclient.votable.Consts; + /** * @author N. Jourdane */ diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java index 12e886c..949c17c 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java @@ -31,14 +31,14 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.BadResponseCodeException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetErrorStream; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetResponseCode; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantOpenConnectionException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantWriteQueryResultException; -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.UnsupportedParamEncodingException; -import eu.omp.irap.vespa.epntapclient.votable.utils.Strings.StringJoiner; +import eu.omp.irap.vespa.epntapclient.votable.Consts; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.BadResponseCodeException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetErrorStream; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetResponseCode; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantOpenConnectionException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantWriteQueryResultException; +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.UnsupportedParamEncodingException; /** * @author N. Jourdane -- libgit2 0.21.2