我在 Sharepoint 2010 中有一个列表,已启用评级并且工作正常。当我将鼠标悬停在评级星星上时,它会向我提供有关我是否已投票以及我的评级的信息。因此,我假设 Sharepoint 将用户信息与评级数据存储在一起。
我想创建一个 ListView ,仅包含当前用户尚未评分的项目。因此,他将能够确保对列表中的每个项目进行投票,而不必突出显示长列表中的每个条目。你能帮我吗?
最佳答案
个人评分信息存储在社交数据库中,并且不与列表项一起存储。列表项仅包含平均评分值和评分数量。您可以创建自定义Web部件并通过类显示当前用户的评分信息型号..
使用以下代码:
using Microsoft.Office.Server.SocialData;
using Microsoft.Office.Server.UserProfiles;
SPSite oSite = SPContext.Current.Site;
SPServiceContext context = SPServiceContext.GetContext(oSite);
UserProfileManager profileManager = new UserProfileManager(context);
UserProfile profile = profileManager.GetUserProfile(user.LoginName.ToString());
SocialRatingManager socialRatingManager = new SocialRatingManager(context);
socialRatingManager.GetRatings(profile)
关于sharepoint - 如何在 Sharepoint 2010 中过滤未评级的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12912805/