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