project structure

This commit is contained in:
Alfredo Oliviero 2024-05-30 16:50:06 +02:00
parent 1f9e62cbbe
commit 37ec50f6d3
17 changed files with 73 additions and 135 deletions

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.portal.kernel.log.LogFactoryUtil;
public class CC_BootPlatformPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CC_BootPlatformPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {
super.render(renderRequest, renderResponse);
}
}

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.cloudcomputing.config;
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
import java.net.MalformedURLException;
@ -10,16 +10,15 @@ import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;
import org.gcube.common.portal.PortalContext;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.Group;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
public class CloudComputingConfigurationPortlet extends CloudComputingConfigPortlet {
public class CC_ConfigurationPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingConfigurationPortlet.class);
.getLog(CC_ConfigurationPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.cloudcomputing.methods.edit;
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
@ -6,14 +6,14 @@ import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import org.gcube.portlets.user.cloudcomputing.CC_Portlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
public class CloudComputingMethodEditorPortlet extends CloudComputingConfigPortlet {
public class CC_MethodEditorPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingMethodEditorPortlet.class);
.getLog(CC_MethodEditorPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.cloudcomputing.methods.exec;
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
@ -6,14 +6,14 @@ import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import org.gcube.portlets.user.cloudcomputing.CC_Portlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
public class CloudComputingMethodExecutorPortlet extends CloudComputingConfigPortlet {
public class CC_MethodExecutorPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingMethodExecutorPortlet.class);
.getLog(CC_MethodExecutorPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {

View File

@ -1,5 +1,5 @@
package org.gcube.portlets.user.cloudcomputing.methods.list;
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
@ -7,14 +7,14 @@ import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import org.gcube.portlets.user.cloudcomputing.CC_Portlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
public class CloudComputingMethodListPortlet extends CloudComputingConfigPortlet {
public class CC_MethodListPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingMethodListPortlet.class);
.getLog(CC_MethodListPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.cloudcomputing.methods.monitor;
package org.gcube.portlets.user.cloudcomputing;
import java.io.IOException;
@ -6,14 +6,14 @@ import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import org.gcube.portlets.user.cloudcomputing.CC_Portlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
public class CloudComputingMethodMonitorPortlet extends CloudComputingConfigPortlet {
public class CC_MethodMonitorPortlet extends CC_Portlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingMethodMonitorPortlet.class);
.getLog(CC_MethodMonitorPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {

View File

@ -11,17 +11,18 @@ import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;
import org.gcube.common.portal.PortalContext;
import org.gcube.portlets.user.cloudcomputing.is.InfrastrctureServiceClient;
import org.gcube.portlets.user.cloudcomputing.config.CC_Config;
import org.gcube.portlets.user.cloudcomputing.is.IsClient;
import org.gcube.portlets.user.cloudcomputing.is.IsServerConfig;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
public class CloudComputingConfigPortlet extends MVCPortlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil.getLog(CloudComputingConfigPortlet.class);
public class CC_Portlet extends MVCPortlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil.getLog(CC_Portlet.class);
private static CloudComputingConfig configuration = null;
private static CC_Config configuration = null;
public final static String IS_AUTH_RESOURCE_NAME = "IAM";
public final static String IS_AUTH_CATEGORY = "Service";
@ -32,11 +33,11 @@ public class CloudComputingConfigPortlet extends MVCPortlet {
public final static String IS_CDN_ENTRYPOINT = "cdn_url";
public final static String IS_CCP_ENTRYPOINT = "ccp_url";
public CloudComputingConfig getConfig(RenderRequest renderRequest)
public CC_Config getConfig(RenderRequest renderRequest)
throws MalformedURLException, ServerException {
if (configuration == null) {
try {
CloudComputingConfig config = new CloudComputingConfig();
CC_Config config = new CC_Config();
String currentContext = getCurrentContext(renderRequest);
String encodedContext = getEncodedContext(currentContext);
@ -58,15 +59,15 @@ public class CloudComputingConfigPortlet extends MVCPortlet {
String host = base_url.getHost();
config.gateway = host;
IsServerConfig auth_config = InfrastrctureServiceClient.serviceConfigFromIS(IS_AUTH_RESOURCE_NAME,
IsServerConfig auth_config = IsClient.serviceConfigFromIS(IS_AUTH_RESOURCE_NAME,
IS_AUTH_CATEGORY, IS_AUTH_ENTRYPOINT);
config.auth_url = auth_config.getServerUrl();
IsServerConfig ccp_config = InfrastrctureServiceClient.serviceConfigFromIS(IS_CCP_RESOURCE_NAME,
IsServerConfig ccp_config = IsClient.serviceConfigFromIS(IS_CCP_RESOURCE_NAME,
IS_CCP_CATEGORY, IS_CCP_ENTRYPOINT);
config.ccp_url = ccp_config.getServerUrl();
IsServerConfig cdn_config = InfrastrctureServiceClient.serviceConfigFromIS(IS_CCP_RESOURCE_NAME,
IsServerConfig cdn_config = IsClient.serviceConfigFromIS(IS_CCP_RESOURCE_NAME,
IS_CCP_CATEGORY, IS_CDN_ENTRYPOINT);
config.cdn_url = cdn_config.getServerUrl();
@ -119,7 +120,7 @@ public class CloudComputingConfigPortlet extends MVCPortlet {
// String redirect_url = "https://sobigdata.d4science.org/group/sobigdatalab";
// String url = "https://accounts.d4science.org/auth";
CloudComputingConfig config = getConfig(renderRequest);
CC_Config config = getConfig(renderRequest);
renderRequest.setAttribute("config", config);

View File

@ -1,82 +0,0 @@
package org.gcube.portlets.user.cloudcomputing.boot;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.ServerException;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;
import org.gcube.common.portal.PortalContext;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfig;
import org.gcube.portlets.user.cloudcomputing.CloudComputingConfigPortlet;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.Group;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
public class CloudComputingBootPlatformPortlet extends CloudComputingConfigPortlet {
private static com.liferay.portal.kernel.log.Log _log = LogFactoryUtil
.getLog(CloudComputingBootPlatformPortlet.class);
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws PortletException, IOException {
super.render(renderRequest, renderResponse);
}
public void addDebugParams(RenderRequest renderRequest) {
String current_url = PortalUtil.getCurrentURL(renderRequest);
renderRequest.setAttribute("current_url", current_url);
String infrastructure = PortalContext.getConfiguration().getInfrastructureName();
renderRequest.setAttribute("infrastructure", infrastructure);
HttpServletRequest httpReq = PortalUtil
.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest));
String absolute_current_url = PortalUtil.getAbsoluteURL(httpReq, current_url);
renderRequest.setAttribute("absolute_current_url", absolute_current_url);
String calculated_gateway = absolute_current_url
.replace("https://", "")
.replace("http://", "")
.replace(current_url, "");
renderRequest.setAttribute("calculated_gateway", calculated_gateway);
String base_url = PortalUtil.getAbsoluteURL(httpReq, "/");
renderRequest.setAttribute("base_url", base_url);
try {
URL burl = new URL(base_url);
renderRequest.setAttribute("host", burl.getHost());
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
renderRequest.setAttribute("host", e.getMessage());
}
try {
Group group = (Group) GroupLocalServiceUtil.getGroup(PortalUtil.getScopeGroupId(renderRequest));
String group_url = group.getFriendlyURL();
renderRequest.setAttribute("group_url", group_url);
renderRequest.setAttribute("group_name", group.getName());
} catch (Exception e) {
e.printStackTrace();
renderRequest.setAttribute("group_url", e.getMessage());
renderRequest.setAttribute("group_name", e.getMessage());
}
String completeURL = PortalUtil.getCurrentCompleteURL(httpReq);
renderRequest.setAttribute("completeURL", completeURL);
// User theUser = PortalUtil.getUser(renderRequest);
String currentContext = getCurrentContext(renderRequest);
renderRequest.setAttribute("current_context", currentContext);
}
}

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.user.cloudcomputing;
package org.gcube.portlets.user.cloudcomputing.config;
public class CloudComputingConfig {
public class CC_Config {
public String encoded_context = ""; // "%2Fgcube%2Fdevsec%2FdevVRE";
public String gateway = ""; // "next.dev.d4science.org";

View File

@ -26,8 +26,8 @@ import com.liferay.portal.kernel.log.LogFactoryUtil;
* @author Alfredo Oliviero (ISTI - CNR)
*/
public class InfrastrctureServiceClient {
private static com.liferay.portal.kernel.log.Log logger = LogFactoryUtil.getLog(InfrastrctureServiceClient.class);
public class IsClient {
private static com.liferay.portal.kernel.log.Log logger = LogFactoryUtil.getLog(IsClient.class);
/**
* obatins from IS the list of ServiceEndpoint matching the parameters
@ -180,7 +180,7 @@ public class InfrastrctureServiceClient {
throws ServerException {
logger.info("Starting creating service credentials");
ServiceEndpoint.AccessPoint accessPoint = InfrastrctureServiceClient.getFirstAccessPointFromIS(resourceName,
ServiceEndpoint.AccessPoint accessPoint = getFirstAccessPointFromIS(resourceName,
category, endPointName/* , is_root_service, secret */);
if (accessPoint == null) {
String error_log = "Unable to retrieve service endpoint " + endPointName;

View File

@ -8,11 +8,11 @@
<portlet-name>cloudcomputing-boot-platform-portlet</portlet-name>
<display-name>cloudcomputing-boot-platform-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.boot.CloudComputingBootPlatformPortlet
org.gcube.portlets.user.cloudcomputing.CC_BootPlatformPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/boot/boot.jsp</value>
<value>/html/boot.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
@ -41,11 +41,11 @@
<portlet-name>cloudcomputing-config-portlet</portlet-name>
<display-name>cloudcomputing-config-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.config.CloudComputingConfigurationPortlet
org.gcube.portlets.user.cloudcomputing.CC_ConfigurationPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/config/configuration.jsp</value>
<value>/html/configuration.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
@ -74,11 +74,11 @@
<portlet-name>cloudcomputing-methods-list-portlet</portlet-name>
<display-name>cloudcomputing-methods-list-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.methods.list.CloudComputingMethodListPortlet
org.gcube.portlets.user.cloudcomputing.CC_MethodListPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/methods/list/methodslist.jsp</value>
<value>/html/methods_list.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
@ -107,11 +107,11 @@
<portlet-name>cloudcomputing-method-edit-portlet</portlet-name>
<display-name>cloudcomputing-method-edit-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.methods.edit.CloudComputingMethodEditorPortlet
org.gcube.portlets.user.cloudcomputing.CC_MethodEditorPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/methods/edit/methodeditor.jsp</value>
<value>/html/method_editor.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
@ -140,11 +140,11 @@
<portlet-name>cloudcomputing-method-exec-portlet</portlet-name>
<display-name>cloudcomputing-method-exec-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.methods.exec.CloudComputingMethodExecutorPortlet
org.gcube.portlets.user.cloudcomputing.CC_MethodExecutorPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/methods/exec/methodexecutor.jsp</value>
<value>/html/method_executor.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
@ -173,11 +173,11 @@
<portlet-name>cloudcomputing-method-monitor-portlet</portlet-name>
<display-name>cloudcomputing-method-monitor-portlet</display-name>
<portlet-class>
org.gcube.portlets.user.cloudcomputing.methods.monitor.CloudComputingMethodMonitorPortlet
org.gcube.portlets.user.cloudcomputing.CC_MethodMonitorPortlet
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/methods/monitor/methodmonitor.jsp</value>
<value>/html/method_monitor.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>

View File

@ -1,5 +1,5 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../init.jsp"%>
<%@ include file="./init.jsp"%>
<script src="${cdn_url}/common/js/keycloak.js" type="text/javascript"></script>
<script src="${cdn_url}/common/js/bss-min-1.2.6.js"></script>

View File

@ -1,5 +1,5 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../init.jsp"%>
<%@ include file="./init.jsp"%>
<%
pageContext.setAttribute("current_context", request.getAttribute("current_context"));

View File

@ -1,6 +1,6 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../../init.jsp"%>
<%@ include file="./init.jsp"%>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<script src="${cdn_url}/ccp/js/inputwidgetcontroller.js"></script>

View File

@ -1,6 +1,6 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../../init.jsp"%>
<%@ include file="./init.jsp"%>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<div>

View File

@ -1,6 +1,6 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../../init.jsp"%>
<%@ include file="./init.jsp"%>
<div><d4s-ccp-executionhistory archive="true" serviceurl="${ccp_url}">
<script src="${cdn_url}/ccp/js/executionhistorycontroller.js"></script>

View File

@ -1,6 +1,6 @@
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ include file="../../init.jsp"%>
<%@ include file="./init.jsp"%>
<div>
<d4s-ccp-methodlist allow-execute="true" archive="true"