本文整理汇总了Java中com.liferay.portal.model.User.setLastName方法的典型用法代码示例。如果您正苦于以下问题:Java User.setLastName方法的具体用法?Java User.setLastName怎么用?Java User.setLastName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.model.User
的用法示例。
在下文中一共展示了User.setLastName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUser
import com.liferay.portal.model.User; //导入方法依赖的package包/类
@JSONWebService
public void updateUser(String login, String firstName,String lastName,String email) throws PortalException, SystemException
{
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
User user = UserLocalServiceUtil.getUserByScreenName(
serviceContext.getCompanyId(), login);
user.setFirstName(firstName);
user.setLastName(lastName);
user.setEmailAddress(email);
List<UserGroup> userGroups = user.getUserGroups();
long[] userArray = new long[] { user.getUserId() };
if(PortalPermissionUtil.contains(
getPermissionChecker(), ActionKeys.ADD_USER))
{
UserLocalServiceUtil.updateUser(user);
}
}
示例2: updateUser
import com.liferay.portal.model.User; //导入方法依赖的package包/类
private void updateUser(User user, String firstName, String lastName) {
user.setFirstName(firstName);
user.setLastName(lastName);
try {
UserLocalServiceUtil.updateUser(user);
} catch (SystemException e) {
LOG.error("Could not update user with new name attributes", e);
}
}
示例3: profileActionUpdateDetails
import com.liferay.portal.model.User; //导入方法依赖的package包/类
/**
* This Action sets the "jspPage" parameter to "addApplicationPreambleJSP"
* so that processing is forwarded to add_application.jsp.
*
* @param request
* @param response
* @throws PortalException
* @throws java.lang.Exception
*/
@ProcessAction(name = "profileActionUpdateDetails")
public void profileActionUpdateDetails(ActionRequest request,
ActionResponse response) {
_applicationPortletLog.debug("profileActionUpdateDetails");
response.setRenderParameter("jspPage", profileJSP);
try {
String fname = ParamUtil.getString(request, "fname");
String lname = ParamUtil.getString(request, "lname");
String eaddr = ParamUtil.getString(request, "eaddr");
String tab = ParamUtil.getString(request, "tab");
request.setAttribute("fname", fname);
request.setAttribute("lname", lname);
request.setAttribute("eaddr", eaddr);
request.setAttribute("tab", tab);
if (!isString(fname)) {
request.setAttribute("errorMsg",
"Der Vorname muss angegeben werden!");
} else if (!isString(lname)) {
request.setAttribute("errorMsg",
"Der Nachname muss angegeben werden!");
} else if (!isEmail(eaddr)) {
request.setAttribute("errorMsg",
"Die eMail-Adresse muss angegeben werden!");
} else {
User user = PortalUtil.getUser(request);
user.setFirstName(fname);
user.setLastName(lname);
user.setEmailAddress(eaddr);
UserLocalServiceUtil.updateUser(user);
request.setAttribute("successMsg",
"Die Daten wurden erfolgreich geändert!");
}
} catch (Exception e) {
e.printStackTrace();
request.setAttribute("errorMsg",
"Internal Error: " + e.getMessage());
}
}