From b220d4d97bf42a392768d868797c1b05a2b42404 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 1 Oct 2019 08:42:58 +0000 Subject: [PATCH] ref 11711: SAI - Add a simple text viewer so that log files created by Data Miner algorithms can be directly viewed in the browser https://support.d4science.org/issues/11711 Added service info[ticket #12594] Added support to show log information [ticket #11711] Added support to show files html, json, pdf, txt [ticket #17106] Updated information show to the user when a computation is submitted [ticket #17030] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@181878 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/info/ServiceInfoPanel.java | 28 ++++++------------- .../TestInformationSystemRequests.java | 12 ++++---- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/dataminermanager/client/info/ServiceInfoPanel.java b/src/main/java/org/gcube/portlets/user/dataminermanager/client/info/ServiceInfoPanel.java index 1e16ee3..d9e0a30 100644 --- a/src/main/java/org/gcube/portlets/user/dataminermanager/client/info/ServiceInfoPanel.java +++ b/src/main/java/org/gcube/portlets/user/dataminermanager/client/info/ServiceInfoPanel.java @@ -130,13 +130,13 @@ public class ServiceInfoPanel extends FramedPanel { } } - private void showAddress(ServiceInfoData address) { - // address + private void showAddress(String address) { + // Service address SimpleContainer sectionServerAddress = new SimpleContainer(); HtmlLayoutContainer addressHtml = new HtmlLayoutContainer( - "

The base url of the service instance is: " + "" - + address.getValue() + "

"); + "

The base url of the service instance is: " + "" + + address + "

"); sectionServerAddress.add(addressHtml, new MarginData()); sectionServerAddress.getElement().getStyle().setMarginRight(20, Unit.PX); v.add(sectionServerAddress, new VerticalLayoutData(-1, -1, new Margins(10))); @@ -145,27 +145,18 @@ public class ServiceInfoPanel extends FramedPanel { private void showServiceInfo(ServiceInfo serviceInfo) { - if (serviceInfo != null && serviceInfo.getServiceProperties() != null - && !serviceInfo.getServiceProperties().isEmpty()) { + if (serviceInfo != null) { - ServiceInfoData address=null; - ArrayList properties=serviceInfo.getServiceProperties(); - for(ServiceInfoData serviceInfoData:properties) { - if(serviceInfoData.getKey().compareTo("Address")==0){ - address = serviceInfoData; - break; - } - } - - if(address!=null){ - properties.remove(address); + String address=serviceInfo.getServiceAddress(); + if(address!=null&&!address.isEmpty()){ showAddress(address); } FieldSet environmentFieldSet = environmentView(); v.add(environmentFieldSet, new VerticalLayoutData(-1, -1, new Margins(10))); - if (!properties.isEmpty()) { + ArrayList properties=serviceInfo.getServiceProperties(); + if (properties!=null&&!properties.isEmpty()) { Grid grid = createInfoGrid(properties); environmentVBox.add(grid, new VerticalLayoutData(1, -1, new Margins(0, 4, 0, 4))); } else { @@ -173,7 +164,6 @@ public class ServiceInfoPanel extends FramedPanel { "

No Info Available.

"); environmentVBox.add(emptyInfoContainer, new VerticalLayoutData(1, -1, new Margins(0, 4, 0, 4))); - } } else { FieldSet environmentFieldSet = environmentView(); diff --git a/src/test/java/org/gcube/portlets/user/dataminermanager/TestInformationSystemRequests.java b/src/test/java/org/gcube/portlets/user/dataminermanager/TestInformationSystemRequests.java index 583d67c..997991f 100644 --- a/src/test/java/org/gcube/portlets/user/dataminermanager/TestInformationSystemRequests.java +++ b/src/test/java/org/gcube/portlets/user/dataminermanager/TestInformationSystemRequests.java @@ -8,6 +8,7 @@ import java.util.List; import org.gcube.common.authorization.library.provider.UserInfo; import org.gcube.data.analysis.dataminermanagercl.server.is.InformationSystemUtils; import org.gcube.data.analysis.dataminermanagercl.server.util.ServiceCredentials; +import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfo; import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfoData; import org.gcube.portlets.user.dataminermanager.shared.Constants; import org.slf4j.Logger; @@ -64,15 +65,16 @@ public class TestInformationSystemRequests extends TestCase { } - ArrayList serviceProperties = InformationSystemUtils.retrieveServiceProperties( + ServiceInfo serviceInfo = InformationSystemUtils.retrieveServiceInfo( Constants.DATAMINER_SERVICE_CATEGORY, Constants.DATA_MINER_SERVICE_NAME, serviceCredentials.getScope()); - logger.debug("Service Properties retrieved:" + serviceProperties); - if (serviceProperties == null || serviceProperties.isEmpty()) { + logger.debug("Service Properties retrieved:" + serviceInfo); + if (serviceInfo == null) { logger.error("No DataMiner service properties available!"); throw new Exception("No DataMiner service properties available!"); } else { - logger.info("DataMiner service properties found: "); - for (ServiceInfoData serviceInfoData : serviceProperties) { + logger.info("DataMiner service properties found"); + logger.debug("Service Address: "+serviceInfo.getServiceAddress()); + for (ServiceInfoData serviceInfoData : serviceInfo.getServiceProperties()) { logger.debug("Property: " + serviceInfoData); }