當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。