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:
parent
59ae27c064
commit
d5f385d9f5
|
@ -1,10 +1,12 @@
|
||||||
<ReleaseNotes>
|
<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>
|
<Change>Ported to Liferay 6.2</Change>
|
||||||
</Changeset>
|
</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">
|
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>
|
||||||
<Changeset component="org.gcube.portlet.user-statistics.1-0-0"
|
<Changeset component="org.gcube.portlet.user-statistics.1-0-0"
|
||||||
date="2015-12-9">
|
date="2015-12-9">
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>user-statistics</artifactId>
|
<artifactId>user-statistics</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>2.0.1-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<name>User statistics portlet</name>
|
<name>User statistics portlet</name>
|
||||||
<description>
|
<description>
|
||||||
User statistics portlet shows main user's statistics.
|
User statistics portlet shows main user's statistics.
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.gcube.vomanagement.usermanagement.util.ManagementUtils;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
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.Contact;
|
||||||
import com.liferay.portal.model.User;
|
import com.liferay.portal.model.User;
|
||||||
import com.liferay.portal.model.Website;
|
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
|
// the stastics to show will be of the userid
|
||||||
statisticsOfUsername = userid;
|
statisticsOfUsername = userid;
|
||||||
isProfileShowable = checkUserPrivacyOption(statisticsOfUsername);
|
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)
|
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
|
||||||
|
@ -348,6 +351,9 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
// set permission checker
|
// set permission checker
|
||||||
setPermissionChecker();
|
setPermissionChecker();
|
||||||
|
|
||||||
|
//needed to avoid cache use by liferay API
|
||||||
|
CacheRegistryUtil.clear();
|
||||||
|
|
||||||
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
|
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
|
||||||
|
|
||||||
// the user has not decided yet
|
// the user has not decided yet
|
||||||
|
@ -462,6 +468,9 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
// set permission checker
|
// set permission checker
|
||||||
setPermissionChecker();
|
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");
|
_log.debug("User " + username + (show ? " want to show " : " doesn't want to show ") + " his statistics");
|
||||||
|
|
||||||
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
|
User user = UserLocalServiceUtil.getUserByScreenName(ManagementUtils.getCompany().getCompanyId(), username);
|
||||||
|
|
Loading…
Reference in New Issue