From 1b96d6355b850987babe96825ad2d4b6003236ea Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Wed, 28 Sep 2016 12:38:56 +0000 Subject: [PATCH] Added efficient method to retireve VRE logo URLs git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@131971 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../portlet/user/my_vres/server/MyVREsServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java b/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java index 1e9f698..5757c02 100644 --- a/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java +++ b/src/main/java/org/gcube/portlet/user/my_vres/server/MyVREsServiceImpl.java @@ -2,7 +2,6 @@ package org.gcube.portlet.user.my_vres.server; import java.util.ArrayList; import java.util.Collections; -import java.util.Date; import java.util.LinkedHashMap; import java.util.List; @@ -32,6 +31,7 @@ import org.slf4j.LoggerFactory; import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.model.Group; import com.liferay.portal.model.VirtualHost; import com.liferay.portal.security.auth.PrincipalThreadLocal; @@ -42,6 +42,8 @@ import com.liferay.portal.service.GroupLocalServiceUtil; import com.liferay.portal.service.LayoutSetLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.VirtualHostLocalServiceUtil; +import com.liferay.portal.util.PortalUtil; +import com.liferay.portal.webserver.WebServerServletTokenUtil; /** * The server side implementation of the RPC service. @@ -126,7 +128,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer _log.error("Cannot find root organziation, please check gcube-data.properties file in $CATALINA_HOME/conf folder, unless your installing the Bundle"); return toReturn; } - long nowInMillis = new Date().getTime(); + //for each root sub organizations (VO) for (GCubeGroup vOrg : rootGroupVO.getChildren()) { for (GCubeGroup vre : vOrg.getChildren()) { @@ -134,7 +136,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer vreToAdd.setName(vre.getGroupName()); vreToAdd.setGroupName(gm.getInfrastructureScope(vre.getGroupId())); long logoId = vre.getLogoId(); - String logoURL = "/image/layout_set_logo?img_id="+ logoId+"&t="+nowInMillis; + String logoURL = gm.getGroupLogoURL(logoId); vreToAdd.setImageURL(logoURL); String vreUrl = GCubePortalConstants.PREFIX_GROUP_URL+vre.getFriendlyURL(); vreToAdd.setFriendlyURL(vreUrl); @@ -168,7 +170,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer return null; } } - + /** *