本文整理汇总了Java中com.liferay.portal.model.User.getCompanyId方法的典型用法代码示例。如果您正苦于以下问题:Java User.getCompanyId方法的具体用法?Java User.getCompanyId怎么用?Java User.getCompanyId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.model.User
的用法示例。
在下文中一共展示了User.getCompanyId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCourseTeachers
import com.liferay.portal.model.User; //导入方法依赖的package包/类
@JSONWebService
public java.util.List<String> getCourseTeachers(long courseId) throws PortalException, SystemException
{
User user=getUser();
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
Course course=courseLocalService.getCourse(courseId);
long createdGroupId=course.getGroupCreatedId();
if(course.getCompanyId()==user.getCompanyId())
{
LmsPrefs prefs=LmsPrefsLocalServiceUtil.getLmsPrefs(course.getCompanyId());
List<UserGroupRole> ugrs=UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(createdGroupId, prefs.getTeacherRole());
List<String> users=new java.util.ArrayList<String>();
for(UserGroupRole ugr:ugrs)
{
users.add(ugr.getUser().getScreenName());
}
return users;
}
return null;
}
示例2: getCourseEditors
import com.liferay.portal.model.User; //导入方法依赖的package包/类
@JSONWebService
public java.util.List<String> getCourseEditors(long courseId) throws PortalException, SystemException
{
User user=getUser();
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
Course course=courseLocalService.getCourse(courseId);
long createdGroupId=course.getGroupCreatedId();
if(course.getCompanyId()==user.getCompanyId())
{
LmsPrefs prefs=LmsPrefsLocalServiceUtil.getLmsPrefs(course.getCompanyId());
List<UserGroupRole> ugrs=UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(createdGroupId, prefs.getEditorRole());
List<String> users=new java.util.ArrayList<String>();
for(UserGroupRole ugr:ugrs)
{
users.add(ugr.getUser().getScreenName());
}
return users;
}
return null;
}
示例3: getCourseStudents
import com.liferay.portal.model.User; //导入方法依赖的package包/类
@JSONWebService
public java.util.List<String> getCourseStudents(long courseId) throws PortalException, SystemException
{
User user=getUser();
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
Course course=courseLocalService.getCourse(courseId);
if(course.getCompanyId()==user.getCompanyId())
{
LmsPrefs prefs=LmsPrefsLocalServiceUtil.getLmsPrefs(course.getCompanyId());
Role commmanager=RoleLocalServiceUtil.getRole(course.getCompanyId(), RoleConstants.SITE_MEMBER) ;
java.util.List<String> users=new java.util.ArrayList<String>();
long createdGroupId=course.getGroupCreatedId();
java.util.List<User> userst=UserLocalServiceUtil.getGroupUsers(createdGroupId);
for(User usert:userst)
{
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRoles(usert.getUserId(),createdGroupId);
boolean remove =false;
for(UserGroupRole ugr:userGroupRoles){
if(ugr.getRoleId()==prefs.getEditorRole()||ugr.getRoleId()==prefs.getTeacherRole()){
remove = true;
break;
}
}
if(!remove){
users.add(usert.getScreenName());
}
}
return users;
}
return null;
}