• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UserLocalServiceUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



UserLocalServiceUtil类属于com.liferay.portal.kernel.service包,在下文中一共展示了UserLocalServiceUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: uploadPhoto

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public File uploadPhoto(long userId, long companyId, long groupId, long id, InputStream inputStream,
		String fileName, String fileType, long fileSize, String destination, String desc,
		ServiceContext serviceContext) throws Exception {
	File file = null;

	FileEntry fileEntry = FileUploadUtils.uploadFile(userId, companyId, groupId, inputStream, fileName, fileType,
			fileSize, destination, desc, serviceContext);

	User user = UserLocalServiceUtil.fetchUser(id);

	file = DLFileEntryLocalServiceUtil.getFile(fileEntry.getFileEntryId(), fileEntry.getVersion(), false);

	UserLocalServiceUtil.updatePortrait(user.getUserId(), FileUtil.getBytes(file));

	return file;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:18,代码来源:UserActions.java


示例2: updateFile

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
public static FileEntry updateFile(long userId, long companyId, long groupId, long fileEntryId,
		InputStream inputStream, String fileName, String fileType, long fileSize, String destination, String desc,
		ServiceContext serviceContext) throws Exception {
	FileEntry fileEntry = null;

	if (inputStream != null && fileSize > 0 && Validator.isNotNull(fileName)) {

		serviceContext.setAddGroupPermissions(true);
		serviceContext.setAddGuestPermissions(true);

		User user = UserLocalServiceUtil.getUser(serviceContext.getUserId());

		PermissionChecker checker = PermissionCheckerFactoryUtil.create(user);
		PermissionThreadLocal.setPermissionChecker(checker);

		DLAppLocalServiceUtil.updateFileEntry(userId, fileEntryId, fileName, fileType,
				System.currentTimeMillis() + StringPool.DASH + fileName, desc, StringPool.BLANK, true, inputStream,
				fileSize, serviceContext);
	}

	return fileEntry;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:23,代码来源:FileUploadUtils.java


示例3: onFailureByEmailAddress

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByEmailAddress(
		long companyId, String emailAddress,
		Map<String, String[]> headerMap, Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserByEmailAddress(
			companyId, emailAddress);

		boolean lockout = user.isLockout();

		if (_log.isInfoEnabled()) {
			_log.info(
				"onFailureByEmailAddress: " + emailAddress + " is " +
					(lockout ? "" : "not") + " locked out.");
		}
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:23,代码来源:LogMaxFailures.java


示例4: onFailureByScreenName

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByScreenName(
		long companyId, String screenName, Map<String, String[]> headerMap,
		Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserByScreenName(
			companyId, screenName);

		boolean lockout = user.isLockout();

		_log.info(
			"onFailureByScreenName: " + screenName + " is " +
				(lockout ? "" : "not") + " locked out.");
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:21,代码来源:LogMaxFailures.java


示例5: onFailureByUserId

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByUserId(
		long companyId, long userId, Map<String, String[]> headerMap,
		Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserById(userId);

		boolean lockout = user.isLockout();

		_log.info(
			"onFailureById: userId " + userId + " is " +
				(lockout ? "" : "not") + " locked out.");
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:20,代码来源:LogMaxFailures.java


示例6: onFailureByEmailAddress

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByEmailAddress(
		long companyId, String emailAddress,
		Map<String, String[]> headerMap, Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserByEmailAddress(
			companyId, emailAddress);

		int failures = user.getFailedLoginAttempts();

		if (_log.isInfoEnabled()) {
			_log.info(
				"onFailureByEmailAddress: " + emailAddress +
					" has failed to login " + failures + " times");
		}
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:23,代码来源:LogAuthFailure.java


示例7: onFailureByScreenName

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByScreenName(
		long companyId, String screenName, Map<String, String[]> headerMap,
		Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserByScreenName(
			companyId, screenName);

		int failures = user.getFailedLoginAttempts();

		if (_log.isInfoEnabled()) {
			_log.info(
				"onFailureByScreenName: " + screenName +
					" has failed to login " + failures + " times");
		}
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:23,代码来源:LogAuthFailure.java


示例8: onFailureByUserId

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void onFailureByUserId(
		long companyId, long userId, Map<String, String[]> headerMap,
		Map<String, String[]> parameterMap)
	throws AuthException {

	try {
		User user = UserLocalServiceUtil.getUserById(userId);

		int failures = user.getFailedLoginAttempts();

		if (_log.isInfoEnabled()) {
			_log.info(
				"onFailureByUserId: userId " + userId +
					" has failed to login " + failures + " times");
		}
	}
	catch (PortalException pe) {
		_log.error(pe);
	}
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:22,代码来源:LogAuthFailure.java


示例9: addUserMultiSelect

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
public void addUserMultiSelect(String name) throws SystemException {
	List<User> users = UserLocalServiceUtil.getUsers(
		QueryUtil.ALL_POS, QueryUtil.ALL_POS);

	List<KeyValuePair> values = new ArrayList<KeyValuePair>(users.size());

	for (User user : users) {
		long userId = user.getUserId();
		String userName = user.getFullName();

		if (Validator.isNull(userId) || Validator.isNull(userName)) {
			continue;
		}

		values.add(new KeyValuePair(userName, String.valueOf(userId)));
	}

	addMultiSelectList(name, values);
}
 
开发者ID:sorin-pop,项目名称:data-manipulator,代码行数:20,代码来源:DisplayFields.java


示例10: getAdminUser

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
/**
 * Returns Liferay user, that has Administrator role assigned.
 *
 * @param companyId company ID
 * @return Liferay {@link com.mimacom.liferay.portal.setup.domain.User}
 * instance, if no user is found, returns null
 * @throws Exception if cannot obtain permission checker
 */
private static User getAdminUser(final long companyId) throws Exception {

    try {
        Role adminRole = RoleLocalServiceUtil.getRole(companyId, ADMIN_ROLE_NAME);
        List<User> adminUsers = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId());

        if (adminUsers == null || adminUsers.isEmpty()) {
            return null;
        }
        return adminUsers.get(0);

    } catch (PortalException | SystemException e) {
        throw new Exception("Cannot obtain Liferay role for role name: " + ADMIN_ROLE_NAME, e);
    }
}
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:24,代码来源:LiferaySetup.java


示例11: addRole

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
private static void addRole(final com.mimacom.liferay.portal.setup.domain.Role role) {

        Map<Locale, String> localeTitleMap = new HashMap<>();
        localeTitleMap.put(Locale.ENGLISH, role.getName());

        try {
            int roleType = RoleConstants.TYPE_REGULAR;
            if (role.getType() != null) {
                if (role.getType().equals("site")) {
                    roleType = RoleConstants.TYPE_SITE;
                } else if (role.getType().equals("organization")) {
                    roleType = RoleConstants.TYPE_ORGANIZATION;
                }
            }

            long defaultUserId = UserLocalServiceUtil.getDefaultUserId(COMPANY_ID);
            RoleLocalServiceUtil.addRole(defaultUserId, null, 0, role.getName(), localeTitleMap,
                    null, roleType, null, null);

            LOG.info("Setup: Role " + role.getName() + " does not exist, adding...");

        } catch (PortalException | SystemException e) {
            LOG.error("error while adding up roles", e);
        }

    }
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:27,代码来源:SetupRoles.java


示例12: assignMemberUsers

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
private static void assignMemberUsers(List<UserAsMember> memberUsers, long companyId, long groupId) {
    if (Objects.isNull(memberUsers) || memberUsers.isEmpty()) {
        return;
    }

    for (UserAsMember memberUser : memberUsers) {
        User user = UserLocalServiceUtil.fetchUserByScreenName(companyId, memberUser.getScreenName());
        if (Objects.isNull(user)) {
            LOG.error("User with screenName " + memberUser.getScreenName() + " does not exists. Won't be assigned as site member.");
            continue;
        }

        try {
            Group liferayGroup = GroupLocalServiceUtil.getGroup(groupId);
            GroupLocalServiceUtil.addUserGroup(user.getUserId(), liferayGroup.getGroupId());
            LOG.info("User " + user.getScreenName() + " was assigned as member of site " + liferayGroup.getDescriptiveName());

            assignUserMemberRoles(memberUser.getRole(), companyId, liferayGroup, user);

        } catch (PortalException e) {
            e.printStackTrace();
        }


    }
}
 
开发者ID:mimacom,项目名称:liferay-db-setup-core,代码行数:27,代码来源:SetupSites.java


示例13: addFolder

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
public static DLFolder addFolder(
	long userId, long groupId, long repositoryId, boolean mountPoint,
	long parentFolderId, String name, String description, boolean hidden,
	ServiceContext serviceContext) {

	DLFolder dlFolder = null;
	try {
		if (hasFolder(groupId, parentFolderId, name)) {
			dlFolder = DLFolderLocalServiceUtil.getFolder(
				groupId, parentFolderId, name);
			setFolderPermissions(dlFolder);
		}
		else {
			User user =
				UserLocalServiceUtil.getUser(serviceContext.getUserId());
			PermissionChecker checker =
				PermissionCheckerFactoryUtil.create(user);
			PermissionThreadLocal.setPermissionChecker(checker);
			//serviceContext.setAddGroupPermissions(true);
			//serviceContext.setAddGuestPermissions(true);

			dlFolder = DLFolderLocalServiceUtil.addFolder(
				userId, groupId, repositoryId, mountPoint, parentFolderId,
				name, description, hidden, serviceContext);

			setFolderPermissions(dlFolder);
		}

	}
	catch (Exception e) {
		_log.info(e);
	}

	return dlFolder;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:36,代码来源:DLFolderUtil.java


示例14: cloneFile

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
public static FileEntry cloneFile(long userId, long groupId, long fileEntryId, 
		String destination, ServiceContext serviceContext) 
	throws Exception {
	
	FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId);

	serviceContext.setAddGroupPermissions(true);
	serviceContext.setAddGuestPermissions(true);

	Calendar calendar = Calendar.getInstance();

	calendar.setTime(new Date());
	
	if(Validator.isNull(destination)) {
		destination = StringPool.BLANK;
	} else if(destination.indexOf(StringPool.SLASH) < 0) {
	    destination += StringPool.SLASH;
	}

	destination += calendar.get(Calendar.YEAR) + StringPool.SLASH;
	destination += calendar.get(Calendar.MONTH) + StringPool.SLASH;
	destination += calendar.get(Calendar.DAY_OF_MONTH);

	DLFolder dlFolder = DLFolderUtil.getTargetFolder(userId, groupId, groupId, false, 0, destination,
			StringPool.BLANK, false, serviceContext);

	User user = UserLocalServiceUtil.getUser(serviceContext.getUserId());

	PermissionChecker checker = PermissionCheckerFactoryUtil.create(user);
	PermissionThreadLocal.setPermissionChecker(checker);
	
	String title = getFileName(fileEntry.getTitle());
	
	return DLAppLocalServiceUtil.addFileEntry(userId, groupId, dlFolder.getFolderId(), title,
			fileEntry.getMimeType(), System.currentTimeMillis() + StringPool.DASH + title, title,
			StringPool.BLANK, fileEntry.getContentStream(), fileEntry.getSize(), serviceContext);
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:38,代码来源:FileUploadUtils.java


示例15: initDossierActionUser

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public void initDossierActionUser(long dossierActionId, long userId, long groupId, long assignUserId)
		throws PortalException {
	// Get DossierAction
	DossierAction dossierAction = DossierActionLocalServiceUtil.getDossierAction(dossierActionId);
	String actionCode = dossierAction.getActionCode();
	long serviceProcessId = dossierAction.getServiceProcessId();

	// Get ProcessAction
	ProcessAction processAction = ProcessActionLocalServiceUtil.fetchBySPID_AC(serviceProcessId, actionCode);
	String stepCode = processAction.getPostStepCode();

	// Get ProcessStep
	ProcessStep processStep = ProcessStepLocalServiceUtil.fetchBySC_GID(stepCode, groupId, serviceProcessId);
	long processStepId = processStep.getProcessStepId();

	// Get List ProcessStepRole
	List<ProcessStepRole> listProcessStepRole = ProcessStepRoleLocalServiceUtil.findByP_S_ID(processStepId);
	for (ProcessStepRole processStepRole : listProcessStepRole) {
		long roleId = processStepRole.getRoleId();
		boolean moderator = processStepRole.getModerator();
		int mod = 0;
		if (moderator) {
			mod = 1;
		}
		// Get list user
		List<User> users = UserLocalServiceUtil.getRoleUsers(roleId);
		for (User user : users) {
			boolean assigned = user.getUserId() == assignUserId ? true : false;
			org.opencps.dossiermgt.model.DossierActionUser model = new org.opencps.dossiermgt.model.impl.DossierActionUserImpl();
			model.setUserId(user.getUserId());
			model.setDossierActionId(dossierActionId);
			model.setModerator(mod);
			model.setAssigned(assigned);
			model.setVisited(false);
			// Add User
			DossierActionUserLocalServiceUtil.addDossierActionUser(model);
		}
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:41,代码来源:DossierActionUserImpl.java


示例16: hasPermitDoAction

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
public void hasPermitDoAction(long groupId, long userId, Dossier dossier, long serviceProcessId,
		ProcessAction action) throws PortalException {
	boolean isOwnner = false;

	if (dossier.getUserId() == userId) {
		isOwnner = true;
	}

	if (!isOwnner) {
		boolean isAuthorityEmpoyee = false;

		ProcessStep step = ProcessStepLocalServiceUtil.fetchBySC_GID(action.getPreStepCode(), groupId,
				serviceProcessId);

		if (Validator.isNotNull(step)) {
			List<ProcessStepRole> roles = ProcessStepRoleLocalServiceUtil.findByP_S_ID(step.getPrimaryKey());

			ok: for (ProcessStepRole role : roles) {
				long[] userIds = UserLocalServiceUtil.getRoleUserIds(role.getRoleId());

				for (long spUid : userIds) {
					if (spUid == userId) {
						isAuthorityEmpoyee = true;
						break ok;
					}
				}
			}

		}

		if (!isAuthorityEmpoyee) {
			throw new DossierAccessException("DossierAccessException");
		}

	}

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:38,代码来源:DossierPermission.java


示例17: doGetDocument

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
protected Document doGetDocument(ResourceUser resourceUser) throws Exception {
	Document document = getBaseModelDocument(CLASS_NAME, resourceUser);

	document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(resourceUser.getCompanyId()));
	document.addDateSortable(Field.MODIFIED_DATE, resourceUser.getModifiedDate());
	document.addKeywordSortable(Field.USER_ID, String.valueOf(resourceUser.getUserId()));
	document.addKeywordSortable(Field.USER_NAME, String.valueOf(resourceUser.getUserName()));

	document.addNumberSortable(ResourceUserTerm.GROUP_ID, resourceUser.getGroupId());
	document.addNumberSortable(ResourceUserTerm.RESOURCEUSER_ID, resourceUser.getResourceUserId());
	document.addTextSortable(ResourceUserTerm.CLASS_NAME, resourceUser.getClassName());
	document.addTextSortable(ResourceUserTerm.CLASS_PK, resourceUser.getClassPK());
	document.addNumberSortable(ResourceUserTerm.TO_USERID, resourceUser.getToUserId());
	document.addTextSortable("selected", Boolean.TRUE.toString());
	
	User user = UserLocalServiceUtil.fetchUser(resourceUser.getToUserId());
	
	String userName = StringPool.BLANK;
	String email = StringPool.BLANK;
	
	if(Validator.isNotNull(user)){
		
		userName = user.getFullName();
		email = user.getEmailAddress();
		
	}
	
	document.addTextSortable(ResourceUserTerm.TO_USERNAME, userName);
	document.addTextSortable(ResourceUserTerm.EMAIL, email);
	document.addTextSortable(ResourceUserTerm.USERCLASS, Employee.class.getName());
	
	return document;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:35,代码来源:ResourceUserIndexer.java


示例18: doGetDocument

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
protected Document doGetDocument(OfficeSite officeSite) throws Exception {
	Document document = getBaseModelDocument(CLASS_NAME, officeSite);

	document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(officeSite.getCompanyId()));
	document.addDateSortable(Field.MODIFIED_DATE, officeSite.getModifiedDate());
	document.addKeywordSortable(Field.USER_ID, String.valueOf(officeSite.getUserId()));
	document.addKeywordSortable(Field.USER_NAME, String.valueOf(officeSite.getUserName()));

	document.addNumberSortable(OfficeSiteTerm.OFFICE_SITE_ID, officeSite.getOfficeSiteId());
	document.addNumberSortable(OfficeSiteTerm.GROUP_ID, officeSite.getGroupId());
	document.addTextSortable(OfficeSiteTerm.NAME, officeSite.getName());
	document.addTextSortable(OfficeSiteTerm.EN_NAME, officeSite.getEnName());
	document.addTextSortable(OfficeSiteTerm.GOV_AGENCY_CODE, officeSite.getGovAgencyCode());
	document.addTextSortable(OfficeSiteTerm.ADDRESS, officeSite.getAddress());
	document.addTextSortable(OfficeSiteTerm.TEL_NO, officeSite.getTelNo());
	document.addTextSortable(OfficeSiteTerm.FAX_NO, officeSite.getFaxNo());
	document.addTextSortable(OfficeSiteTerm.EMAIL, officeSite.getEmail());
	document.addTextSortable(OfficeSiteTerm.WEBSITE, officeSite.getWebsite());
	document.addNumberSortable(OfficeSiteTerm.LOGO_FILE_ENTRY_ID, officeSite.getLogoFileEntryId());
	document.addNumberSortable(OfficeSiteTerm.SITE_GROUP_ID, officeSite.getSiteGroupId());
	document.addNumberSortable(OfficeSiteTerm.ADMIN_USER_ID, officeSite.getAdminUserId());
	document.addTextSortable(OfficeSiteTerm.PREFERENCES, officeSite.getPreferences());
	
	User adminUser = UserLocalServiceUtil.fetchUser(officeSite.getAdminUserId());
	
	if(Validator.isNotNull(adminUser)){
		
		document.addTextSortable("adminUser_screenName", adminUser.getScreenName());
		document.addTextSortable("adminUser_email", adminUser.getEmailAddress());
		
	}

	return document;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:36,代码来源:OfficeSiteIndexer.java


示例19: doGetDocument

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
protected Document doGetDocument(Applicant object) throws Exception {

	Document document = getBaseModelDocument(CLASS_NAME, object);

	// Indexer of audit fields
	document.addNumberSortable(Field.COMPANY_ID, object.getCompanyId());
	document.addNumberSortable(Field.GROUP_ID, object.getGroupId());
	document.addDateSortable(Field.MODIFIED_DATE, object.getCreateDate());
	document.addDateSortable(Field.CREATE_DATE, object.getModifiedDate());
	document.addNumberSortable(Field.USER_ID, object.getUserId());
	document.addKeywordSortable(Field.USER_NAME, String.valueOf(object.getUserName()));
	document.addKeywordSortable(Field.ENTRY_CLASS_NAME, Applicant.class.getName());
	document.addNumberSortable(Field.ENTRY_CLASS_PK, object.getPrimaryKey());

	document.addKeywordSortable(ApplicantTerm.APPLICANTNAME, object.getApplicantName());
	document.addKeywordSortable(ApplicantTerm.APPLICANTIDNO, object.getApplicantIdNo());
	document.addTextSortable(ApplicantTerm.APPLICANTIDTYPE, object.getApplicantIdType());
	document.addDateSortable(ApplicantTerm.APPLICANTIDDATE, object.getApplicantIdDate());
	document.addTextSortable(ApplicantTerm.ADDRESS, object.getAddress());
	document.addTextSortable(ApplicantTerm.CONTACTNAME, object.getContactName());
	document.addTextSortable(ApplicantTerm.CONTACTTELNO, object.getContactTelNo());
	document.addTextSortable(ApplicantTerm.CONTACTEMAIL, object.getContactEmail());
	document.addNumberSortable(ApplicantTerm.MAPPINGUSERID, object.getMappingUserId());

	try {
		User user = UserLocalServiceUtil.getUser(object.getMappingUserId());
		document.addTextSortable(ApplicantTerm.LOCK, Boolean.toString(user.getLockout()));
	} catch (Exception e) {
		// TODO: handle exception
	}

	return document;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:35,代码来源:ApplicantIndexer.java


示例20: create

import com.liferay.portal.kernel.service.UserLocalServiceUtil; //导入依赖的package包/类
@Override
public OfficeSite create(long userId, long companyId, long groupId, String address, String adminEmail, String email,
		String enName, String faxNo, String govAgencyCode, String name, String preferences, String siteGroupId,
		String telNo, String website, ServiceContext serviceContext)
		throws NoSuchUserException, UnauthenticationException, UnauthorizationException, NumberFormatException {
	OfficeSite ett = null;

	User user = UserLocalServiceUtil.fetchUserByEmailAddress(companyId, adminEmail);

	ett = OfficeSiteLocalServiceUtil.addOfficeSite(userId, groupId, name, enName, govAgencyCode, address, telNo,
			faxNo, email, website, 0, GetterUtil.get(siteGroupId, 0), user.getUserId(), preferences,
			serviceContext);

	return ett;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:16,代码来源:OfficeSiteActions.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SpringProxy类代码示例发布时间:2022-05-23
下一篇:
Java Utils类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap