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


Java ExpandoColumnConstants类代码示例

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


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

示例1: saveDeregister

import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的package包/类
public void saveDeregister(ActionRequest request,
		ActionResponse response) throws IOException,
		PortletException {
	
	try{
		ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
		User user = themeDisplay.getUser();
		boolean deregisterMail = ParamUtil.getBoolean(request, "deregister", false);
		
		if(user.getExpandoBridge().getAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO)==null){
			user.getExpandoBridge().addAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, ExpandoColumnConstants.BOOLEAN);
		}
		user.getExpandoBridge().setAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, deregisterMail);
		
		UserLocalServiceUtil.updateUser(user);
		log.debug("User updated!");
		SessionMessages.add(request, "saveDeregisterOK");
		
	}catch(Exception e){
		e.printStackTrace();
		SessionErrors.add(request, "saveDeregisterKO");
	}
		
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:25,代码来源:DeregisterAcademyMailPortlet.java

示例2: doRun

import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的package包/类
public void doRun(long companyId) throws Exception {
	LmsPrefs lmsPrefs=null;
	
	try{
		lmsPrefs=LmsPrefsLocalServiceUtil.getLmsPrefs(companyId);
	}
	catch(NoSuchPrefsException e){
		lmsPrefs=null;
	}
	if(lmsPrefs==null){
		createDefaultRoles(companyId);
		createDefaultSiteTemplate(companyId);
		createDefaultPreferences(companyId);
	}
	
	ExpandoTable table3 = getExpandoTable(companyId, User.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME);
	if (table3 != null) {
			createExpandoColumn(table3, "deregister-mail", ExpandoColumnConstants.BOOLEAN,
						ExpandoColumnConstants.INDEX_TYPE_TEXT, ExpandoColumnConstants.PROPERTY_DISPLAY_TYPE_CHECKBOX, false, true);
	}
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:23,代码来源:StartupAction.java

示例3: doRun

import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的package包/类
private void doRun(String[] ids) throws Exception{
	ExpandoTable table = null;

	long companyId = Long.parseLong(ids[0]);

	try {
	 	table = ExpandoTableLocalServiceUtil.addDefaultTable(
		 	companyId, LayoutSetPrototype.class.getName());
	}
	catch(DuplicateTableNameException dtne) {
	 	table = ExpandoTableLocalServiceUtil.getDefaultTable(
		 	companyId, LayoutSetPrototype.class.getName());
	}
	long tableId = table.getTableId();

	try {
		Role guestUserRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
		
		ExpandoColumn column = ExpandoColumnLocalServiceUtil.addColumn(
			tableId, COLUMN_NAME, ExpandoColumnConstants.BOOLEAN);
		
		ExpandoColumnLocalServiceUtil.updateExpandoColumn(column);
		ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, 
                  ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, 
                  String.valueOf(column.getColumnId()), guestUserRole.getRoleId(), new String[] { ActionKeys.VIEW});
	}
	catch(DuplicateColumnNameException dcne) {
		LOG.debug("Expando" +  COLUMN_NAME + " already exist!");

	}
}
 
开发者ID:rivetlogic,项目名称:liferay-microsite-manager,代码行数:32,代码来源:ExpandoStartupAction.java


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