Added support to publish the resource on VOs
This commit is contained in:
parent
9882d08967
commit
a33f85e84b
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.portlet.ActionRequest;
|
||||
|
@ -24,6 +25,11 @@ import org.gcube.portlets.admin.systemworkspaceclientdefinition.event.DeleteSDEv
|
|||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.is.InformationSystemUtils;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.shared.Constants;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.util.UserCredentials;
|
||||
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
|
||||
import org.gcube.vomanagement.usermanagement.model.GroupMembershipType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -94,7 +100,7 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
* String mvcPath = renderRequest.getParameter("mvcPath");
|
||||
*
|
||||
* if (mvcPath == null || mvcPath.isEmpty()) { mvcPath =
|
||||
* "/html/systemservicedefinition/view.jsp"; } PortletRequestDispatcher
|
||||
* "/html/systemworkspaceclientdefinition/view.jsp"; } PortletRequestDispatcher
|
||||
* dispatcher = getPortletContext().getRequestDispatcher(mvcPath);
|
||||
* dispatcher.include(renderRequest, renderResponse);
|
||||
*/
|
||||
|
@ -213,7 +219,8 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
userCredentials.getCurrentScope());
|
||||
} catch (Exception e) {
|
||||
logger.error("Error retrieving System Workspace Client from IS. {}", e.getLocalizedMessage(), e);
|
||||
throw new PortletException("Error retrieving System Workspace Client from IS. " + e.getLocalizedMessage(), e);
|
||||
throw new PortletException("Error retrieving System Workspace Client from IS. " + e.getLocalizedMessage(),
|
||||
e);
|
||||
}
|
||||
|
||||
int count = itemsList.size();
|
||||
|
@ -315,7 +322,6 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
}
|
||||
|
||||
public void createDefinition(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
|
||||
@SuppressWarnings("unused")
|
||||
UserCredentials userCredentials;
|
||||
|
||||
try {
|
||||
|
@ -326,7 +332,7 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
SessionErrors.add(actionRequest, "error-session");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -350,16 +356,16 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/ssd_create.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/sd_create.jsp");
|
||||
break;
|
||||
} else {
|
||||
if (clientId.contains(" ")) {
|
||||
logger.error("Invalid client id: " + clientId);
|
||||
SessionErrors.add(actionRequest, "error-invalid-clientId-space");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest)
|
||||
+ SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/ssd_create.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/sd_create.jsp");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -370,45 +376,72 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/ssd_create.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/sd_create.jsp");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
logger.debug("Requested: [clientId={}, description={}]", clientId, description);
|
||||
try {
|
||||
String username = clientId;
|
||||
String secret = UUID.randomUUID().toString();
|
||||
DefinitionItem definitionItem = new DefinitionItem(clientId, description, username, secret);
|
||||
List<String> scopes=retrieveScopes(userCredentials);
|
||||
InformationSystemUtils.publishSD(definitionItem, Constants.SYSTEM_WORKSPACE_CLIENT_CATEGORY,
|
||||
userCredentials.getCurrentScope());
|
||||
userCredentials.getCurrentScope(),scopes);
|
||||
publishCreateSDEvent(definitionItem);
|
||||
SessionMessages.add(actionRequest, "success-definition-created");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
SessionErrors.add(actionRequest, "error-create-definition");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
|
||||
}
|
||||
break;
|
||||
case "cancel":
|
||||
logger.debug("Cancel Request");
|
||||
SessionMessages.clear(actionRequest);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
break;
|
||||
default:
|
||||
logger.debug("Default");
|
||||
SessionErrors.add(actionRequest, "error-create-definition");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private List<String> retrieveScopes(UserCredentials userCredentials) throws Exception {
|
||||
List<String> scopes=new ArrayList<>();
|
||||
scopes.add(userCredentials.getCurrentScope());
|
||||
|
||||
LiferayGroupManager groupManagement = new LiferayGroupManager();
|
||||
long idScope=groupManagement.getGroupIdFromInfrastructureScope(userCredentials.getCurrentScope());
|
||||
|
||||
Boolean isRoot = groupManagement
|
||||
.isRootVO(idScope);
|
||||
if(isRoot) {
|
||||
GCubeGroup gCubeG=groupManagement.getGroup(idScope);
|
||||
List<GCubeGroup> vos=gCubeG.getChildren();
|
||||
for(GCubeGroup vo: vos) {
|
||||
String voScope=groupManagement.getInfrastructureScope(vo.getGroupId());
|
||||
scopes.add(voScope);
|
||||
}
|
||||
} else {
|
||||
String error="Error this portlet works only on Root Scope!";
|
||||
logger.error(error);
|
||||
throw new Exception(error);
|
||||
}
|
||||
|
||||
logger.debug("Retrieved Scopes: {}", scopes);
|
||||
return scopes;
|
||||
}
|
||||
|
||||
public void editDefinition(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
|
||||
@SuppressWarnings("unused")
|
||||
UserCredentials userCredentials;
|
||||
|
@ -420,7 +453,7 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
SessionErrors.add(actionRequest, "error-session");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -431,75 +464,71 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
SessionErrors.add(actionRequest, "error-edit-definition");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
return;
|
||||
}
|
||||
switch (act) {
|
||||
case "submit":
|
||||
SessionMessages.add(actionRequest, "success-definition-updated");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
break;
|
||||
case "cancel":
|
||||
SessionMessages.clear(actionRequest);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
break;
|
||||
default:
|
||||
SessionErrors.add(actionRequest, "error-create-definition");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
public void deleteDefinition(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
|
||||
@SuppressWarnings("unused")
|
||||
UserCredentials userCredentials;
|
||||
|
||||
try {
|
||||
userCredentials = SessionUtil.getUserCredentials(actionRequest);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
SessionErrors.add(actionRequest, "error-session");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
return;
|
||||
}
|
||||
|
||||
paramsInfo(actionRequest);
|
||||
|
||||
logger.debug("Delete Request");
|
||||
String clientId = ParamUtil.getString(actionRequest, "clientId");
|
||||
if (clientId == null || clientId.isEmpty()) {
|
||||
logger.error("Invalid client id: " + clientId);
|
||||
SessionErrors.add(actionRequest, "error-invalid-clientId");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
DefinitionItem definitionItem = new DefinitionItem(clientId);
|
||||
InformationSystemUtils.deleteSD(definitionItem, Constants.SYSTEM_WORKSPACE_CLIENT_CATEGORY,
|
||||
userCredentials.getCurrentScope());
|
||||
publishDeleteSSDEvent(definitionItem);
|
||||
SessionMessages.add(actionRequest, "success-definition-deleted");
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
SessionErrors.add(actionRequest, "error-delete-definition");
|
||||
SessionMessages.add(actionRequest,
|
||||
PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
actionResponse.setRenderParameter("jspPage", "/html/systemservicedefinition/view.jsp");
|
||||
}
|
||||
|
||||
}*/
|
||||
/*
|
||||
* public void deleteDefinition(ActionRequest actionRequest, ActionResponse
|
||||
* actionResponse) throws Exception {
|
||||
*
|
||||
* @SuppressWarnings("unused") UserCredentials userCredentials;
|
||||
*
|
||||
* try { userCredentials = SessionUtil.getUserCredentials(actionRequest); }
|
||||
* catch (Exception e) { logger.error(e.getLocalizedMessage(), e);
|
||||
* SessionErrors.add(actionRequest, "error-session");
|
||||
* SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) +
|
||||
* SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
* actionResponse.setRenderParameter("jspPage",
|
||||
* "/html/systemworkspaceclientdefinition/view.jsp"); return; }
|
||||
*
|
||||
* paramsInfo(actionRequest);
|
||||
*
|
||||
* logger.debug("Delete Request"); String clientId =
|
||||
* ParamUtil.getString(actionRequest, "clientId"); if (clientId == null ||
|
||||
* clientId.isEmpty()) { logger.error("Invalid client id: " + clientId);
|
||||
* SessionErrors.add(actionRequest, "error-invalid-clientId");
|
||||
* SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) +
|
||||
* SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
* PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
* actionResponse.setRenderParameter("jspPage",
|
||||
* "/html/systemworkspaceclientdefinition/view.jsp"); return; }
|
||||
*
|
||||
* try { DefinitionItem definitionItem = new DefinitionItem(clientId);
|
||||
* InformationSystemUtils.deleteSD(definitionItem,
|
||||
* Constants.SYSTEM_WORKSPACE_CLIENT_CATEGORY,
|
||||
* userCredentials.getCurrentScope()); publishDeleteSDEvent(definitionItem);
|
||||
* SessionMessages.add(actionRequest, "success-definition-deleted");
|
||||
* actionResponse.setRenderParameter("jspPage",
|
||||
* "/html/systemworkspaceclientdefinition/view.jsp");
|
||||
*
|
||||
* } catch (Exception e) { logger.error(e.getLocalizedMessage(), e);
|
||||
* SessionErrors.add(actionRequest, "error-delete-definition");
|
||||
* SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) +
|
||||
* SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
|
||||
* actionResponse.setRenderParameter("jspPage",
|
||||
* "/html/systemworkspaceclientdefinition/view.jsp"); }
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
private void publishCreateSDEvent(DefinitionItem definitionItem) {
|
||||
logger.debug("Trying to send the event to create System Definition");
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
|||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.informationsystem.publisher.RegistryPublisher;
|
||||
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
|
||||
import org.gcube.informationsystem.publisher.ScopedPublisher;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.definition.DefinitionItem;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.shared.Constants;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
|
@ -68,8 +69,7 @@ public class InformationSystemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void checkSDPresent(DefinitionItem definitionItem, String category, String scope)
|
||||
throws Exception {
|
||||
public static void checkSDPresent(DefinitionItem definitionItem, String category, String scope) throws Exception {
|
||||
try {
|
||||
if (definitionItem == null || definitionItem.getClientId() == null
|
||||
|| definitionItem.getClientId().isEmpty())
|
||||
|
@ -93,9 +93,9 @@ public class InformationSystemUtils {
|
|||
|
||||
List<ServiceEndpoint> resources = client.submit(query);
|
||||
|
||||
for(ServiceEndpoint ssd: resources) {
|
||||
for (ServiceEndpoint ssd : resources) {
|
||||
if (definitionItem.getClientId().compareTo(ssd.profile().name()) == 0) {
|
||||
StringBuilder error=new StringBuilder();
|
||||
StringBuilder error = new StringBuilder();
|
||||
error.append("Definition ");
|
||||
error.append(definitionItem.getClientId());
|
||||
error.append(" already present in the scope: ");
|
||||
|
@ -105,8 +105,8 @@ public class InformationSystemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
logger.debug("Definition not already present on IS in scope: "+scope);
|
||||
return ;
|
||||
logger.debug("Definition not already present on IS in scope: " + scope);
|
||||
return;
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
|
@ -167,24 +167,24 @@ public class InformationSystemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void publishSD(DefinitionItem definitionItem, String category, String scope) throws Exception {
|
||||
public static void publishSD(DefinitionItem definitionItem, String category, String rootScope, List<String> scopes) throws Exception {
|
||||
if (definitionItem == null)
|
||||
throw new Exception("Invalid definition: " + definitionItem);
|
||||
|
||||
if (category == null || category.isEmpty())
|
||||
throw new Exception("Invalid category: " + category);
|
||||
|
||||
if (scope == null || scope.isEmpty())
|
||||
throw new Exception("Invalid scope: " + scope);
|
||||
if (rootScope == null || rootScope.isEmpty())
|
||||
throw new Exception("Invalid scope: " + rootScope);
|
||||
|
||||
/*
|
||||
* if (token == null || token.isEmpty()) throw new Exception("Invalid token: " +
|
||||
* token);
|
||||
*/
|
||||
|
||||
checkSDPresent(definitionItem, category, scope);
|
||||
|
||||
IAMService iamService = retrieveIAMService(scope);
|
||||
checkSDPresent(definitionItem, category, rootScope);
|
||||
|
||||
IAMService iamService = retrieveIAMService(rootScope);
|
||||
|
||||
ServiceEndpoint toPublish = new ServiceEndpoint();
|
||||
logger.debug("Resource Type: {}", toPublish.type());
|
||||
|
@ -227,19 +227,21 @@ public class InformationSystemUtils {
|
|||
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
ScopeProvider.instance.set(scope);
|
||||
ScopeProvider.instance.set(rootScope);
|
||||
|
||||
RegistryPublisher publisher = RegistryPublisherFactory.create();
|
||||
// RegistryPublisher publisher = RegistryPublisherFactory.create();
|
||||
// String id = publisher.create(toPublish).id();
|
||||
// logger.debug("Created new RR sent, Got from publisher: id=" + id);
|
||||
|
||||
String id = publisher.create(toPublish).id();
|
||||
logger.debug("Created new RR sent, Got from publisher: id=" + id);
|
||||
ScopedPublisher sp = RegistryPublisherFactory.scopedPublisher();
|
||||
toPublish = sp.create(toPublish, scopes);
|
||||
logger.debug("Created new RR sent, Got from publisher: id=" + toPublish.id());
|
||||
|
||||
// ScopedPublisher sp=RegistryPublisherFactory.scopedPublisher();
|
||||
// toPublish = sp.create(toPublish,scopes);
|
||||
} catch (Exception e) {
|
||||
logger.error("Error publishing the definition on IS: {}", e.getLocalizedMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
logger.debug("Published on IS");
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
|
||||
.system-service-definition-portlet table thead {
|
||||
.system-workspace-client-definition-portlet table thead {
|
||||
background: #f8f8f8;
|
||||
color: #0a0a0a;
|
||||
padding: 10px 18px;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable thead th, table.dataTable thead td
|
||||
.system-workspace-client-definition-portlet table.dataTable thead th, table.dataTable thead td
|
||||
{
|
||||
padding: 5px 10px;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable {
|
||||
.system-workspace-client-definition-portlet table.dataTable {
|
||||
clear: both;
|
||||
margin: 0.5em 0 !important;
|
||||
max-width: none !important;
|
||||
|
@ -20,92 +20,92 @@
|
|||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table tbody, table tfoot, table thead
|
||||
.system-workspace-client-definition-portlet table tbody, table tfoot, table thead
|
||||
{
|
||||
border: 1px solid #f1f1f1;
|
||||
background-color: #fefefe;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable td, table.dataTable th
|
||||
.system-workspace-client-definition-portlet table.dataTable td, table.dataTable th
|
||||
{
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable thead th, table.dataTable tfoot th
|
||||
.system-workspace-client-definition-portlet table.dataTable thead th, table.dataTable tfoot th
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable thead th {
|
||||
.system-workspace-client-definition-portlet table.dataTable thead th {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table tfoot td, table tfoot th, table thead td,
|
||||
.system-workspace-client-definition-portlet table tfoot td, table tfoot th, table thead td,
|
||||
table thead th {
|
||||
padding: .5rem .625rem .625rem;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet select, input[type="file"] {
|
||||
.system-workspace-client-definition-portlet select, input[type="file"] {
|
||||
line-height: 15px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable tbody>tr.selected,
|
||||
.system-workspace-client-definition-portlet table.dataTable tbody>tr.selected,
|
||||
table.dataTable tbody>tr>.selected {
|
||||
background-color: #50a2f5 !important;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable tbody>tr.selected:hover,
|
||||
.system-workspace-client-definition-portlet table.dataTable tbody>tr.selected:hover,
|
||||
table.dataTable tbody>tr>.selected:hover {
|
||||
background-color: #50a2f5 !important;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table.dataTable tbody>tr:hover, table.dataTable tbody>tr:hover
|
||||
.system-workspace-client-definition-portlet table.dataTable tbody>tr:hover, table.dataTable tbody>tr:hover
|
||||
{
|
||||
background-color: #41C7FF !important;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .strip1 {
|
||||
.system-workspace-client-definition-portlet .strip1 {
|
||||
background-color: white;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
border-width: 1px 1px 1px 6px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .strip2 {
|
||||
.system-workspace-client-definition-portlet .strip2 {
|
||||
background-color: #F0F0F0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
border-width: 1px 1px 1px 6px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet table tfoot td, table tfoot th, table thead td,
|
||||
.system-workspace-client-definition-portlet table tfoot td, table tfoot th, table thead td,
|
||||
table thead th {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet div#userTable_paginate .pagination {
|
||||
.system-workspace-client-definition-portlet div#userTable_paginate .pagination {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_info
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_info
|
||||
{
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
{
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet div.messages-container>ul.messages {
|
||||
.system-workspace-client-definition-portlet div.messages-container>ul.messages {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current,
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current,
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover
|
||||
{
|
||||
background: #50a2f5;
|
||||
color: #fefefe !important;
|
||||
|
@ -113,7 +113,7 @@
|
|||
border: none;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button:hover
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button:hover
|
||||
{
|
||||
background: #ccc;
|
||||
color: #50a2f5;
|
||||
|
@ -121,27 +121,27 @@
|
|||
border: none;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current a
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_paginate .paginate_button.current a
|
||||
{
|
||||
color: #fefefe;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper {
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper {
|
||||
margin-left: -5px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
select option {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
select option:hover {
|
||||
background: #41C7FF;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
.system-workspace-client-definition-portlet .dataTables_wrapper .dataTables_length
|
||||
select option:checked {
|
||||
background: #50a2f5;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@
|
|||
color: white;
|
||||
}
|
||||
|
||||
.system-service-definition-portlet .circle_button {
|
||||
.system-workspace-client-definition-portlet .circle_button {
|
||||
padding: 1px 3px 1px 1px;
|
||||
line-height: 1px;
|
||||
border-radius: 12px !important;
|
||||
|
@ -169,7 +169,7 @@
|
|||
}
|
||||
|
||||
|
||||
.system-service-definition-portlet .circle_button_text {
|
||||
.system-workspace-client-definition-portlet .circle_button_text {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: 15px;
|
||||
|
|
|
@ -97,7 +97,7 @@ function editSD(){
|
|||
}
|
||||
|
||||
<%--
|
||||
function deleteSSD(){
|
||||
function deleteSD(){
|
||||
var table = $('#definitionsTable').DataTable();
|
||||
var rowSelected=table.rows('.selected').data();
|
||||
if(!("0" in rowSelected)){// true if "0" doesn't exist in object
|
||||
|
@ -180,7 +180,7 @@ function mainTable() {
|
|||
style: 'single'
|
||||
},
|
||||
buttons: [
|
||||
'createSSD','deleteSSD','refreshSSD'
|
||||
'createSD','refreshSD'
|
||||
],
|
||||
processing: true,
|
||||
oLanguage: {sProcessing: "<div></div>"},
|
||||
|
@ -246,7 +246,7 @@ function mainTable() {
|
|||
table.$('tr.selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
$('#sdEdit').disabled=false;
|
||||
//$('#ssdDelete').disabled=false;
|
||||
//$('#sdDelete').disabled=false;
|
||||
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -2,6 +2,9 @@ package org.gcube.portlets.admin.systemworkspaceclientdefinition;
|
|||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.definition.DefinitionItem;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.is.InformationSystemUtils;
|
||||
import org.gcube.portlets.admin.systemworkspaceclientdefinition.shared.Constants;
|
||||
|
@ -21,6 +24,7 @@ public class ISTest {
|
|||
private static Logger logger = LoggerFactory.getLogger(ISTest.class);
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void findSD() {
|
||||
|
||||
try {
|
||||
|
@ -40,8 +44,11 @@ public class ISTest {
|
|||
try {
|
||||
DefinitionItem definitionItem = new DefinitionItem("sample-client-name", "sample-client-description",
|
||||
"sample-client-description", "xxxxx-xxxx-xxx-xxxx");
|
||||
List<String> scopes=new ArrayList<>();
|
||||
scopes.add(Constants.DEFAULT_SCOPE);
|
||||
|
||||
InformationSystemUtils.publishSD(definitionItem, Constants.SYSTEM_WORKSPACE_CLIENT_CATEGORY,
|
||||
Constants.DEFAULT_SCOPE);
|
||||
Constants.DEFAULT_SCOPE,scopes);
|
||||
assertTrue(true);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue