Removed unused code
This commit is contained in:
parent
f6a73ea2b5
commit
d02b994eaa
|
@ -25,11 +25,8 @@ 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;
|
||||
|
||||
|
@ -207,13 +204,6 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
// Create
|
||||
ArrayList<DefinitionItem> itemsList;
|
||||
|
||||
/*
|
||||
* for (int i = 0; i < 10; i++) { DefinitionItem definitionItem = new
|
||||
* DefinitionItem("client_id_" + i, "description_" + i, "client_id_" + i,
|
||||
* "xxxx_" + i); itemsList.add(definitionItem);
|
||||
*
|
||||
* }
|
||||
*/
|
||||
try {
|
||||
itemsList = InformationSystemUtils.retrieveSD(Constants.SYSTEM_WORKSPACE_CLIENT_CATEGORY,
|
||||
userCredentials.getCurrentScope());
|
||||
|
@ -555,47 +545,5 @@ public class SystemWorkspaceClientDefinition extends MVCPortlet {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* private void createDefinition(ResourceRequest resourceRequest,
|
||||
* ResourceResponse resourceResponse, UserCredentials userCredentials) throws
|
||||
* IOException, PortletException {
|
||||
*
|
||||
* HttpServletRequest httpReq = PortalUtil
|
||||
* .getOriginalServletRequest(PortalUtil.getHttpServletRequest(resourceRequest))
|
||||
* ; JWTToken umaToken = null; try { umaToken = OIDCUmaUtil.getUMAToken(httpReq,
|
||||
* userCredentials.getUsername(), userCredentials.getCurrentScope()); } catch
|
||||
* (Exception e) { logger.error(e.getLocalizedMessage(), e); JSONObject
|
||||
* jsonObject = JSONFactoryUtil.createJSONObject(); jsonObject.put("success",
|
||||
* false); jsonObject.put("comment", e.getLocalizedMessage());
|
||||
* resourceResponse.getWriter().println(jsonObject);
|
||||
* super.serveResource(resourceRequest, resourceResponse); } String toReturn =
|
||||
* umaToken.getAccessTokenString();
|
||||
* resourceResponse.setContentType("application/json"); JSONObject jsonObject =
|
||||
* JSONFactoryUtil.createJSONObject(); jsonObject.put("success", true);
|
||||
* jsonObject.put("comment", toReturn);
|
||||
* resourceResponse.getWriter().println(jsonObject);
|
||||
* super.serveResource(resourceRequest, resourceResponse);
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
/*
|
||||
* if (isValidForm(firstName, lastName)) { String portletName =
|
||||
* (String)actionRequest.getAttribute(WebKeys.PORTLET_ID); ThemeDisplay
|
||||
* themeDisplay =
|
||||
* (ThemeDisplay)actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
|
||||
*
|
||||
* PortletURL redirectURL =
|
||||
* PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(actionRequest),
|
||||
* portletName,themeDisplay.getLayout().getPlid(), PortletRequest.RENDER_PHASE);
|
||||
* redirectURL.setParameter("jspPage", "/registration.jsp");
|
||||
* SessionErrors.add(actionRequest, "WRONG_FIRST_NAME_ERROR");
|
||||
* actionResponse.sendRedirect(redirectURL.toString());
|
||||
*
|
||||
* }else{ actionRequest.setAttribute("firstNameAtr", firstName);
|
||||
* actionRequest.setAttribute("lastNameAtr", lastName);
|
||||
*
|
||||
* actionResponse.setRenderParameter("jspPage", "/registration.jsp"); }
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package org.gcube.portlets.admin.systemworkspaceclientdefinition.event;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.AbstractLR62EventPublisher;
|
||||
|
|
|
@ -9,7 +9,6 @@ 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;
|
||||
|
@ -35,14 +34,7 @@ public class InformationSystemUtils {
|
|||
if (scope == null || scope.isEmpty())
|
||||
throw new Exception("Invalid scope: " + scope);
|
||||
|
||||
/*
|
||||
* if (token == null || token.isEmpty()) throw new Exception("Invalid token: " +
|
||||
* scope);
|
||||
*/
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
|
||||
SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq '" + Constants.IAM_SERVICE_CATEGORY + "'")
|
||||
|
@ -82,8 +74,6 @@ public class InformationSystemUtils {
|
|||
throw new Exception("Invalid scope: " + scope);
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
|
||||
SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq '" + category + "'")
|
||||
|
@ -124,14 +114,7 @@ public class InformationSystemUtils {
|
|||
if (scope == null || scope.isEmpty())
|
||||
throw new Exception("Invalid scope: " + scope);
|
||||
|
||||
/*
|
||||
* if (token == null || token.isEmpty()) throw new Exception("Invalid token: " +
|
||||
* scope);
|
||||
*/
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
|
||||
SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq '" + category + "'");
|
||||
|
@ -177,25 +160,16 @@ public class InformationSystemUtils {
|
|||
if (rootScope == null || rootScope.isEmpty())
|
||||
throw new Exception("Invalid scope: " + rootScope);
|
||||
|
||||
if (definitionItem == null || definitionItem.getContextList()==null||definitionItem.getContextList().isEmpty())
|
||||
if (definitionItem == null || definitionItem.getContextList() == null
|
||||
|| definitionItem.getContextList().isEmpty())
|
||||
throw new Exception("Invalid list of scope: " + definitionItem);
|
||||
|
||||
/*
|
||||
* if (token == null || token.isEmpty()) throw new Exception("Invalid token: " +
|
||||
* token);
|
||||
*/
|
||||
|
||||
checkSDPresent(definitionItem, category, rootScope);
|
||||
|
||||
IAMService iamService = retrieveIAMService(rootScope);
|
||||
|
||||
ServiceEndpoint toPublish = new ServiceEndpoint();
|
||||
logger.debug("Resource Type: {}", toPublish.type());
|
||||
/*
|
||||
* List<String> scopes = new ArrayList<String>(); scopes.add(scope);
|
||||
* Collection<String> col = toPublish.scopes().asCollection();
|
||||
* col.addAll(scopes);
|
||||
*/
|
||||
|
||||
toPublish.newProfile();
|
||||
toPublish.profile().name(definitionItem.getClientId());
|
||||
|
@ -228,17 +202,11 @@ public class InformationSystemUtils {
|
|||
|
||||
try {
|
||||
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
ScopeProvider.instance.set(rootScope);
|
||||
|
||||
RegistryPublisher publisher = RegistryPublisherFactory.create();
|
||||
//String id = publisher.create(toPublish).id();
|
||||
// logger.debug("Created new RR sent, Got from publisher: id=" + id);
|
||||
toPublish=publisher.vosCreate(toPublish, definitionItem.getContextList());
|
||||
|
||||
//ScopedPublisher sp = RegistryPublisherFactory.scopedPublisher();
|
||||
//toPublish = sp.create(toPublish, definitionItem.getContextList());
|
||||
toPublish = publisher.vosCreate(toPublish, definitionItem.getContextList());
|
||||
|
||||
logger.debug("Created new RR sent, Got from publisher: id=" + toPublish);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -261,8 +229,6 @@ public class InformationSystemUtils {
|
|||
throw new Exception("Invalid scope: " + scope);
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
// AccessTokenProvider.instance.set(token);
|
||||
// SecurityTokenProvider.instance.set(token);
|
||||
|
||||
SimpleQuery query = ICFactory.queryFor(ServiceEndpoint.class);
|
||||
query.addCondition("$resource/Profile/Category/text() eq '" + category + "'")
|
||||
|
|
Loading…
Reference in New Issue