当前位置: 首页>>代码示例>>Java>>正文


Java UserLocalServiceUtil.getGroupUsers方法代码示例

本文整理汇总了Java中com.liferay.portal.service.UserLocalServiceUtil.getGroupUsers方法的典型用法代码示例。如果您正苦于以下问题:Java UserLocalServiceUtil.getGroupUsers方法的具体用法?Java UserLocalServiceUtil.getGroupUsers怎么用?Java UserLocalServiceUtil.getGroupUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.service.UserLocalServiceUtil的用法示例。


在下文中一共展示了UserLocalServiceUtil.getGroupUsers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluate

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的package包/类
private void evaluate(long actId)
		throws Exception {
	
	LearningActivity learningActivity = LearningActivityLocalServiceUtil.getLearningActivity(actId);

	try{

		Map<Long, Long> activities = getLearningActivities(learningActivity);
	
		if(activities.size()!=0){
			for(User user:UserLocalServiceUtil.getGroupUsers(learningActivity.getGroupId())) {
				if(!PermissionCheckerFactoryUtil.create(user).hasPermission(learningActivity.getGroupId(), "com.liferay.lms.model",learningActivity.getGroupId(), "VIEW_RESULTS")){
					evaluateUser(actId, user.getUserId(), activities);	
				}
			}
		}

	}catch(DocumentException e){
		e.printStackTrace();
	}	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:22,代码来源:EvaluationActivity.java

示例2: updateCourse

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的package包/类
@Override
public boolean updateCourse(Course course) throws SystemException {
	try {
		for(User userOfCourse:UserLocalServiceUtil.getGroupUsers(course.getGroupCreatedId())){
			if(!PermissionCheckerFactoryUtil.create(userOfCourse).hasPermission(course.getGroupCreatedId(), "com.liferay.lms.model",course.getGroupCreatedId(), "VIEW_RESULTS")){
				updateCourse(course,  userOfCourse.getUserId());	
			}				
		}

		return true;
	} catch (Exception e) {
		throw new SystemException(e);
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:15,代码来源:MandatoryAvgCourseEval.java

示例3: updateCourse

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的package包/类
@Override
public boolean updateCourse(Course course) throws SystemException {
	try {
		if((course.getCourseExtraData()==null)&&(course.getCourseExtraData().trim().length()==0)) {
			return false;
		}
		
		Document document=SAXReaderUtil.read(course.getCourseExtraData());
		Element rootElement =document.getRootElement();
		
		long passPuntuation = GetterUtil.getLong(rootElement.elementText("passPuntuation"),-1);
		if(passPuntuation<0){
			return false;
		}
		
		Map<Long,Long> evaluations=getEvaluations(course,rootElement);
		if(evaluations.size()==0){
			return false;
		}
		
		for(User userOfCourse:UserLocalServiceUtil.getGroupUsers(course.getGroupCreatedId())){
			if(!PermissionCheckerFactoryUtil.create(userOfCourse).hasPermission(course.getGroupCreatedId(), "com.liferay.lms.model",course.getGroupCreatedId(), "VIEW_RESULTS")){
				updateCourseResult(course, passPuntuation, evaluations, userOfCourse.getUserId());	
			}				
		}

		return true;
	} catch (Exception e) {
		throw new SystemException(e);
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:32,代码来源:EvaluationAvgCourseEval.java

示例4: getCourseStudents

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的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;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:35,代码来源:CourseServiceImpl.java

示例5: fetchUsers

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的package包/类
/**
 * Recupera os usuários do grupo atual
 */
private synchronized void fetchUsers() {
	currentGroupId = LiferayFacesContext.getInstance().getScopeGroupId();
	if (this.filter != null && this.filter.length() >= 1) {
		List<User> users;
		try {
			users = UserLocalServiceUtil.getGroupUsers(currentGroupId);

			int total = 0;
			ArrayList<String> result = new ArrayList<String>();
			for (User user : users) {
				if (user.getFullName().startsWith(filter)) {
					result.add(user.getFullName());
					total++;
					if (total >= 10)
						break;
				}
			}

			selectedUsers = Collections.unmodifiableList(result);
			// Se o usuário selecionado for o que tem o nome digitado, então
			// esconde a lista
			if (selectedUsers.size() == 1 && selectedUsers.get(0).equals(this.filter))
				selectedUsers = Collections.emptyList();

		} catch (SystemException e) {
			selectedUsers = Collections.emptyList();
		}
	} else {
		selectedUsers = Collections.emptyList();
	}
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:35,代码来源:AutocompleteUserBean.java

示例6: updateCourse

import com.liferay.portal.service.UserLocalServiceUtil; //导入方法依赖的package包/类
@Override
public boolean updateCourse(Course course) throws SystemException {
	
	List<Module> modules=ModuleLocalServiceUtil.findAllInGroup(course.getGroupCreatedId());
	try {
	
		for(User userOfCourse:UserLocalServiceUtil.getGroupUsers(course.getGroupCreatedId())){
			if(!PermissionCheckerFactoryUtil.create(userOfCourse).hasPermission(course.getGroupCreatedId(), "com.liferay.lms.model",course.getGroupCreatedId(), "VIEW_RESULTS")){
		
			CourseResult courseResult=CourseResultLocalServiceUtil.getByUserAndCourse(course.getCourseId(), userOfCourse.getUserId());
			if(courseResult==null)
			{
				courseResult=CourseResultLocalServiceUtil.create(course.getCourseId(), userOfCourse.getUserId());
				courseResult.setStartDate(new Date());
			}
			

			
			boolean passed=true;
			long cuantospasados=0;
			for(Module thmodule:modules)
			{
				if(!ModuleLocalServiceUtil.isUserPassed(thmodule.getModuleId(), userOfCourse.getUserId()))
				{
					passed=false;
					
				}
				else
				{
					cuantospasados++;
				}
			}
			long result=0;
			if(modules.size()>0)
			{
				result=100*cuantospasados/modules.size();
			}
		
			courseResult.setResult(result);

			if(courseResult.getPassed()!=passed) {
				courseResult.setPassedDate(new Date());
			}
			courseResult.setPassed(passed);

			CourseResultLocalServiceUtil.update(courseResult);
			
			}				
		}
	} catch (Exception e) {
		throw new SystemException(e);
	}
	return true;	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:55,代码来源:CompleteModulesCourseEval.java


注:本文中的com.liferay.portal.service.UserLocalServiceUtil.getGroupUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。