added code to clear liferay cache before check/set the custom field that let show/hide statistics to other people. Back to version 2.0 since it needs to be released now

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@130246 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-11 14:02:37 +00:00
parent 59ae27c064
commit d5f385d9f5
3 changed files with 15 additions and 4 deletions

View File

@ -1,10 +1,12 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets-user.user-statistics.2-0-0" date="2016-04-02">
<Changeset component="org.gcube.portlets-user.user-statistics.2-0-0"
date="2016-04-02">
<Change>Ported to Liferay 6.2</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.user-statistics.1-0-1"
<Changeset component="org.gcube.portlets-user.user-statistics.1-0-1"
date="2016-01-22">
<Change>Minor bug fix: long vre's name managed properly(Bug #2042)</Change>
<Change>Minor bug fix: long vre's name managed properly(Bug #2042)
</Change>
</Changeset>
<Changeset component="org.gcube.portlet.user-statistics.1-0-0"
date="2015-12-9">

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>user-statistics</artifactId>
<packaging>war</packaging>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<name>User statistics portlet</name>
<description>
User statistics portlet shows main user's statistics.

View File

@ -29,6 +29,7 @@ import org.gcube.vomanagement.usermanagement.util.ManagementUtils;
import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.model.Contact;
import com.liferay.portal.model.User;
import com.liferay.portal.model.Website;
@ -288,6 +289,8 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
// the stastics to show will be of the userid
statisticsOfUsername = userid;
isProfileShowable = checkUserPrivacyOption(statisticsOfUsername);
_log.info("Is profile showable for user " + userid + " " + isProfileShowable);
}
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
@ -347,6 +350,9 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
// set permission checker
setPermissionChecker();
//needed to avoid cache use by liferay API
CacheRegistryUtil.clear();
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
@ -461,6 +467,9 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
// set permission checker
setPermissionChecker();
//needed to avoid cache use by liferay API
CacheRegistryUtil.clear();
_log.debug("User " + username + (show ? " want to show " : " doesn't want to show ") + " his statistics");