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


Java ThemeDisplay.getCompanyId方法代码示例

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


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

示例1: deleteExportedCourse

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
public void deleteExportedCourse(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException {
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	long groupId  = ParamUtil.getLong(actionRequest, "groupId", 0);
	String fileName = ParamUtil.getString(actionRequest, "fileName", StringPool.BLANK);
	String redirect = ParamUtil.getString(actionRequest, "redirect", StringPool.BLANK);
	File f = new File(PropsUtil.get("liferay.home")+"/data/lms_exports/courses/"+themeDisplay.getCompanyId()+"/"+groupId+"/"+fileName);
	if (themeDisplay.getPermissionChecker().hasPermission(groupId, Course.class.getName(), groupId, ActionKeys.DELETE) && f != null && f.isFile()) {
		FileUtil.delete(f);
		SessionMessages.add(actionRequest, "courseadmin.delete.exported.confirmation.success");
	} else {
		SessionMessages.add(actionRequest, "courseadmin.delete.exported.confirmation.error");
	}
	if (Validator.isNotNull(redirect)) {
		actionResponse.sendRedirect(redirect);
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:CourseAdmin.java

示例2: 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;
	}
	
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:66,代码来源:EmpLoyeePortlet.java

示例3: getCompanyId

import com.liferay.portal.theme.ThemeDisplay; //导入方法依赖的package包/类
/**
 * Gets the company id.
 *
 * @param request the request
 * @return the company id
 */
protected Long getCompanyId(final PortletRequest request) {
	final ThemeDisplay themeDisplay = (ThemeDisplay) request
	        .getAttribute(WebKeys.THEME_DISPLAY);
	return themeDisplay.getCompanyId();
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:12,代码来源:BaseController.java


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