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


Java User.getFullName方法代码示例

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


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

示例1: doGetDocument

import com.liferay.portal.model.User; //导入方法依赖的package包/类
@Override
protected Document doGetDocument(Object obj) throws Exception {
	Course entry = (Course)obj;
	AssetEntry asset=AssetEntryLocalServiceUtil.getEntry(Course.class.getName(), entry.getCourseId());
	long companyId = entry.getCompanyId();
	long groupId = getParentGroupId(entry.getGroupId());
	long scopeGroupId = entry.getGroupId();
	long userId = entry.getUserId();
	User user=UserLocalServiceUtil.getUser(userId);
	String userName = user.getFullName();
	long entryId = entry.getCourseId();
	String title = entry.getTitle();
	String content = HtmlUtil.extractText(entry.getDescription());
	Date displayDate = asset.getPublishDate();

	long[] assetCategoryIds =AssetCategoryLocalServiceUtil.getCategoryIds(Course.class.getName(), entryId);
	String[] assetTagNames =AssetTagLocalServiceUtil.getTagNames(Course.class.getName(), entryId);

	ExpandoBridge expandoBridge = entry.getExpandoBridge();

	Document document = new DocumentImpl();

	document.addUID(PORTLET_ID, entryId);

	document.addModifiedDate(displayDate);

	document.addKeyword(Field.COMPANY_ID, companyId);
	document.addKeyword(Field.PORTLET_ID, PORTLET_ID);
	document.addKeyword(Field.GROUP_ID, groupId);
	document.addKeyword(Field.SCOPE_GROUP_ID, scopeGroupId);
	document.addKeyword(Field.USER_ID, userId);
	document.addText(Field.USER_NAME, userName);

	document.addText(Field.TITLE, title);
	document.addText(Field.CONTENT, content);
	document.addKeyword(Field.ASSET_CATEGORY_IDS, assetCategoryIds);
	document.addKeyword(Field.ASSET_TAG_NAMES, assetTagNames);

	document.addKeyword(Field.ENTRY_CLASS_NAME, LearningActivity.class.getName());
	document.addKeyword(Field.ENTRY_CLASS_PK, entryId);

	ExpandoBridgeIndexerUtil.addAttributes(document, expandoBridge);

	return document;
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:46,代码来源:CourseIndexer.java

示例2: sendMailP2pDone

import com.liferay.portal.model.User; //导入方法依赖的package包/类
private static void sendMailP2pDone(User user, long actId, ThemeDisplay themeDisplay){
		try
		{
			LearningActivity activity = LearningActivityLocalServiceUtil.getLearningActivity(actId);
			
			Group group = GroupLocalServiceUtil.getGroup(activity.getGroupId());
			
			Course course= CourseLocalServiceUtil.getCourseByGroupCreatedId(activity.getGroupId());
			
			Module module = ModuleLocalServiceUtil.getModule(activity.getModuleId());
			String courseFriendlyUrl = "";
			String courseTitle = "";
			String activityTitle = activity.getTitle(user.getLocale());
			String moduleTitle =  module.getTitle(user.getLocale());
			String portalUrl = PortalUtil.getPortalURL(themeDisplay);
			String pathPublic = PortalUtil.getPathFriendlyURLPublic();
			
			//QUITANDO PUERTOS
			String[] urls = portalUrl.split(":");
			portalUrl = urls[0] + ":" +urls[1];				
//			if(urls.length > 2){ // http:prueba.es:8080
//				portalUrl += urls[1];
//			}
			_log.debug("***portalUrl:"+portalUrl);
			
					
			if(course != null){
				courseTitle = course.getTitle(user.getLocale());
				courseFriendlyUrl = portalUrl + pathPublic + course.getFriendlyURL();
				courseFriendlyUrl += "/reto?p_p_id=p2ptaskactivity_WAR_liferaylmsportlet";
				courseFriendlyUrl += "&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_r_p_564233524_actId="+actId;
				courseFriendlyUrl += "&p_r_p_564233524_moduleId="+activity.getModuleId();
				_log.debug("URL "+ courseFriendlyUrl);
			}
			
			String messageArgs[]= {activityTitle, moduleTitle, courseTitle, courseFriendlyUrl};
			String titleArgs[]= {String.valueOf(user.getFullName())};
			
			//Nuevos campos del email
			//Subject
			
			String subject = LanguageUtil.get(user.getLocale(), "p2ptaskactivity.mail.sendactivity.mail.subject"); 
			String title = LanguageUtil.format(user.getLocale(), "p2ptaskactivity.mail.sendactivity.mail.title", titleArgs);
			String body = title +"<br /><br />"+ LanguageUtil.format(user.getLocale(), "p2ptaskactivity.mail.sendactivity.mail.message", messageArgs);
			
			String firmaPortal  = PrefsPropsUtil.getString(themeDisplay.getCompanyId(),"firma.email.admin");
			// JOD
			firmaPortal = (firmaPortal!=null?firmaPortal:"");

			
			if(_log.isDebugEnabled()){_log.debug("P2PActivityPortlet::sendMailNoCorrection::subject:"+subject);}
			if(_log.isDebugEnabled()){_log.debug("P2PActivityPortlet::sendMailNoCorrection::body:"+body);}
			
			//String fromUser=PrefsPropsUtil.getString(user.getCompanyId(),PropsKeys.ADMIN_EMAIL_FROM_ADDRESS);
			String fromName=PrefsPropsUtil.getString(user.getCompanyId(),PropsKeys.ADMIN_EMAIL_FROM_NAME,"");
			String fromAddress=PrefsPropsUtil.getString(user.getCompanyId(),PropsKeys.ADMIN_EMAIL_FROM_ADDRESS,"");
			InternetAddress from = new InternetAddress(fromAddress, fromName);
			InternetAddress to = new InternetAddress(user.getEmailAddress(), user.getFullName());
			MailMessage mailMessage = new MailMessage(from, to, subject, body, true);
			
			MailServiceUtil.sendEmail(mailMessage);		
			//MailEngine.send(from, new InternetAddress[]{to}, new InternetAddress[]{}, subject, body, true);
			if(_log.isDebugEnabled()){_log.debug("P2PActivityPortlet::sendMailNoCorrection::Mail Enviado");}
		}
		/*catch(MailEngineException ex) {
			if(_log.isErrorEnabled()){_log.error(ex);}

		}*/ catch (Exception e) {
			if(_log.isErrorEnabled()){_log.error(e);}
		}
	}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:72,代码来源:P2PActivityPortlet.java


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