Logo VRE was not updated in the portlet due to liferay versioning of Document Library
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@131669 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5d4b49b43a
commit
f2404513da
|
@ -1,6 +1,7 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlet.user.my-vres.2-1-0" date="2016-09-12">
|
||||
<Change>Shows only the virtual groups available in the Site it is deployed on</Change>
|
||||
<Change>VRE was not updated in the portlet due to liferay versioning of Document Library</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlet.user.my-vres.2-0-1" date="2016-04-02">
|
||||
<Change>Ported to Liferay 6.2</Change>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue