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
master
Massimiliano Assante 8 years ago
parent 04158ccd80
commit 1b96d6355b

@ -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;
}
}
/**
*

Loading…
Cancel
Save