本文整理汇总了Java中com.liferay.portal.theme.ThemeDisplay.getUserId方法的典型用法代码示例。如果您正苦于以下问题:Java ThemeDisplay.getUserId方法的具体用法?Java ThemeDisplay.getUserId怎么用?Java ThemeDisplay.getUserId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.theme.ThemeDisplay
的用法示例。
在下文中一共展示了ThemeDisplay.getUserId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: upmodule
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void upmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long userIdAction = themeDisplay.getUserId();
if(moduleId>0)
{
if(permissionChecker.hasPermission(
themeDisplay.getScopeGroupId(),
Module.class.getName(), moduleId,
ActionKeys.UPDATE))
{
ModuleLocalServiceUtil.goUpModule(moduleId, userIdAction);
}
}
}
示例2: downmodule
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void downmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long moduleId = ParamUtil.getLong(actionRequest, "resId",0);
long userIdAction = themeDisplay.getUserId();
if(moduleId>0)
{
if(permissionChecker.hasPermission(
themeDisplay.getScopeGroupId(),
Module.class.getName(), moduleId,
ActionKeys.UPDATE))
{
ModuleLocalServiceUtil.goDownModule(moduleId,userIdAction);
}
}
}
示例3: moveModule
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void moveModule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker=themeDisplay.getPermissionChecker();
long userIdAction = themeDisplay.getUserId();
long moduleId = ParamUtil.getLong(actionRequest, "pageId"),
prevModId = ParamUtil.getLong(actionRequest, "prevPageId"),
nextModId = ParamUtil.getLong(actionRequest, "nextPageId");
if(moduleId>0){
if(permissionChecker.hasPermission(themeDisplay.getScopeGroupId(), Module.class.getName(), moduleId, ActionKeys.UPDATE)){
ModuleLocalServiceUtil.moveModule(moduleId, prevModId, nextModId,userIdAction);
}
}
actionResponse.setRenderParameter("jsp", "/html/lmsactivitieslist/view.jsp");
}
示例4: upmodule
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void upmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long userIdAction = themeDisplay.getUserId();
String portletId = PortalUtil.getPortletId(actionRequest);
long moduleId = ParamUtil.getLong(actionRequest, "resourcePrimKey",0);
if(moduleId>0)
{
com.liferay.lms.service.ModuleLocalServiceUtil.goUpModule(moduleId,userIdAction);
}
}
示例5: downmodule
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void downmodule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
String portletId = PortalUtil.getPortletId(actionRequest);
long userIdAction = themeDisplay.getUserId();
long moduleId = ParamUtil.getLong(actionRequest, "resourcePrimKey",0);
if(moduleId>0)
{
com.liferay.lms.service.ModuleLocalServiceUtil.goDownModule(moduleId,userIdAction);
}
}
示例6: inscribir
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
@ProcessAction(name = "inscribir")
public void inscribir(ActionRequest request, ActionResponse response) throws Exception{
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
if (!themeDisplay.isSignedIn()) {return;}
long teamId = ParamUtil.getLong(request, "teamId",0);
long groupId = themeDisplay.getScopeGroupId();
Course course = CourseLocalServiceUtil.getCourseByGroupCreatedId(groupId);
log.debug("COURSE GROUP ID "+course.getGroupCreatedId());
log.debug("THEME DISPLAY GROUP "+groupId);
long userId = themeDisplay.getUserId();
ServiceContext serviceContext=ServiceContextFactory.getInstance(request);
String result = CourseLocalServiceUtil.addStudentToCourseByUserId(course.getCourseId(), userId, teamId, serviceContext);
if(!result.equalsIgnoreCase("ok")){
if(result.equalsIgnoreCase("error-complete-course")){
SessionErrors.add(request, "inscription-error-max-users");
}else if(result.equalsIgnoreCase("error-private-course")){
SessionErrors.add(request, "inscription-error-syte-restricted");
}else if(result.equalsIgnoreCase("error-user-suscribed")){
SessionErrors.add(request, "inscription-error-already-enrolled");
}else{
SessionErrors.add(request, "inscription-error");
}
}
}
示例7: addUser
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
private User addUser(final ActionRequest request, String screenName,
String password, String repassword, Date birthdate,
String fullName, String email, int gender) throws PortalException,
SystemException {
ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
long creatorUserId = themeDisplay.getUserId(); // default liferay user
long companyId = themeDisplay.getCompanyId(); // default company
boolean autoPassword = true;
String password1 = "";
String password2 = "";
boolean autoScreenName = true;
String emailAddress = email;
long facebookId = 0;
String openId = "";
Locale locale = themeDisplay.getLocale();
String[] tg = fullName.split(" ");
String firstName = tg[0];
String middleName = "";
String lastName = "";
if (tg.length > 1) {
firstName = tg[tg.length - 1];
lastName = tg[0];
}
if (tg.length > 2) {
middleName = tg[1];
for (int i = 2; i < tg.length - 1; i++) {
middleName += " " + tg[i];
}
}
int prefixId = 0;
int suffixId = 0;
boolean male = gender == 1;
Calendar birthday = CalendarFactoryUtil.getCalendar();
birthday.setTime(birthdate);
int birthdayMonth = birthday.get(Calendar.MONTH);
int birthdayDay = birthday.get(Calendar.DAY_OF_MONTH);
int birthdayYear = birthday.get(Calendar.YEAR);
String jobTitle = "";
long[] groupIds = null;
long[] organizationIds = null;
long[] roleIds = null;
long[] userGroupIds = null;
boolean sendEmail = false;
ServiceContext serviceContext = ServiceContextFactory
.getInstance(request);
try {
User user = UserLocalServiceUtil.addUser(creatorUserId, companyId,
autoPassword, password1, password2, autoScreenName, screenName,
emailAddress, facebookId, openId, locale, firstName,
middleName, lastName, prefixId, suffixId, male, birthdayMonth,
birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
roleIds, userGroupIds, sendEmail, serviceContext);
return user;
} catch(Exception e){
System.out.println(e.getMessage());
return null;
}
}
示例8: getUserId
import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
/**
* Gets the user id.
*
* @param request the request
* @return the user id
*/
protected Long getUserId(final PortletRequest request) {
final ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
return themeDisplay.getUserId();
}