當前位置: 首頁>>代碼示例>>Java>>正文


Java ExpandoTableLocalServiceUtil類代碼示例

本文整理匯總了Java中com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil的典型用法代碼示例。如果您正苦於以下問題:Java ExpandoTableLocalServiceUtil類的具體用法?Java ExpandoTableLocalServiceUtil怎麽用?Java ExpandoTableLocalServiceUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExpandoTableLocalServiceUtil類屬於com.liferay.portlet.expando.service包,在下文中一共展示了ExpandoTableLocalServiceUtil類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addExpandoAttributes

import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil; //導入依賴的package包/類
/**
 * Legt für die Company zwei neue Expando-Attribute an, falls es diese noch
 * nicht gibt.
 * 
 * @param companyId
 *            die CompanyId
 * @throws SystemException
 * @throws PortalException
 */
protected ExpandoColumn addExpandoAttributes(long companyId,
		String className, String columnName, int type)
		throws PortalException, SystemException {
	// lade die ExpandoTable für Groups oder lege sie an
	ExpandoTable expandoTable;
	try {
		expandoTable = ExpandoTableLocalServiceUtil.getDefaultTable(
				companyId, className);
	} catch (NoSuchTableException e) {
		expandoTable = ExpandoTableLocalServiceUtil.addDefaultTable(
				companyId, className);
	}

	// prüfe, ob das Attribute für cms-mapping existiert
	ExpandoColumn expandoColumn = createExpandoColumn(expandoTable,
			columnName, type);
	return expandoColumn;
}
 
開發者ID:frickeo,項目名稱:liferay-junction-point-hook,代碼行數:28,代碼來源:JunctionPointApplicationStartupEvent.java

示例2: doRun

import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil; //導入依賴的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.service.ExpandoTableLocalServiceUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。