|
|
|
@ -2,6 +2,7 @@ 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;
|
|
|
|
|
|
|
|
|
@ -125,7 +126,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()) {
|
|
|
|
@ -133,7 +134,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;
|
|
|
|
|
String logoURL = "/image/layout_set_logo?img_id="+ logoId+"&t="+nowInMillis;
|
|
|
|
|
vreToAdd.setImageURL(logoURL);
|
|
|
|
|
String vreUrl = GCubePortalConstants.PREFIX_GROUP_URL+vre.getFriendlyURL();
|
|
|
|
|
vreToAdd.setFriendlyURL(vreUrl);
|
|
|
|
@ -309,17 +310,17 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
|
|
|
|
|
*/
|
|
|
|
|
private Group getSiteFromServletRequest(final HttpServletRequest request) throws PortalException, SystemException {
|
|
|
|
|
String serverName = request.getServerName();
|
|
|
|
|
_log.debug("currentHost is " + serverName);
|
|
|
|
|
_log.trace("currentHost is " + serverName);
|
|
|
|
|
Group site = null;
|
|
|
|
|
List<VirtualHost> vHosts = VirtualHostLocalServiceUtil.getVirtualHosts(0, VirtualHostLocalServiceUtil.getVirtualHostsCount());
|
|
|
|
|
for (VirtualHost virtualHost : vHosts) {
|
|
|
|
|
_log.debug("Found " + virtualHost.getHostname());
|
|
|
|
|
_log.trace("Found " + virtualHost.getHostname());
|
|
|
|
|
if (virtualHost.getHostname().compareTo("localhost") != 0 &&
|
|
|
|
|
virtualHost.getLayoutSetId() != 0 &&
|
|
|
|
|
virtualHost.getHostname().compareTo(serverName) == 0) {
|
|
|
|
|
long layoutSetId = virtualHost.getLayoutSetId();
|
|
|
|
|
site = LayoutSetLocalServiceUtil.getLayoutSet(layoutSetId).getGroup();
|
|
|
|
|
_log.debug("Found match! Your site is " + site.getName());
|
|
|
|
|
_log.trace("Found match! Your site is " + site.getName());
|
|
|
|
|
return site;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|