本文整理汇总了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!");
}
}