当前位置: 首页>>代码示例>>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;未经允许,请勿转载。