本文整理汇总了Java中com.liferay.portlet.expando.model.ExpandoColumn类的典型用法代码示例。如果您正苦于以下问题:Java ExpandoColumn类的具体用法?Java ExpandoColumn怎么用?Java ExpandoColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExpandoColumn类属于com.liferay.portlet.expando.model包,在下文中一共展示了ExpandoColumn类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addExpandoAttributes
import com.liferay.portlet.expando.model.ExpandoColumn; //导入依赖的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.model.ExpandoColumn; //导入依赖的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!");
}
}
示例3: createExpandoColumn
import com.liferay.portlet.expando.model.ExpandoColumn; //导入依赖的package包/类
/**
* Leget eine ExpandoColumn an und gibt ihr das Leserecht für 'Guest' und
* das Schreibrecht für 'Power User' in Layouts
*
* @param expandoTable
* Die ExpandoTabelle, zu der die Spalte gehört
* @param name
* Der Name
* @param type
* der Typ
* @throws PortalException
* @throws SystemException
*/
private ExpandoColumn createExpandoColumn(ExpandoTable expandoTable,
String name, int type) throws PortalException, SystemException {
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(
expandoTable.getTableId(), name);
if (expandoColumn == null) {
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(
expandoTable.getTableId(), name, type);
expandoColumn.persist();
}
// stelle sicher, dass die Resource existiert. Durch eine Race-Condition
// in Liferay ist
// jedoch nicht sichergestellt, dass Guest auch lesen darf.
ResourceLocalServiceUtil.addResources(expandoTable.getCompanyId(), 0,
0, ExpandoColumn.class.getName(), expandoColumn.getColumnId(),
false, false, false);
// stelle sicher, dass Guest lesen darf
Role role = RoleLocalServiceUtil.getRole(expandoTable.getCompanyId(),
RoleConstants.GUEST);
ResourcePermissionLocalServiceUtil.setResourcePermissions(
expandoTable.getCompanyId(), ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()), role.getRoleId(),
new String[] { "VIEW" });
// stelle sicher, dass Power User in Layouts schreiben darf
// (siehe https://issues.liferay.com/browse/LPS-44592)
if (expandoTable.getClassName().equals(Layout.class.getName())) {
Role powerUserRole = RoleLocalServiceUtil.getRole(
expandoTable.getCompanyId(), RoleConstants.POWER_USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(
expandoTable.getCompanyId(), ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()),
powerUserRole.getRoleId(),
new String[] { "VIEW", "UPDATE" });
}
return expandoColumn;
}
开发者ID:frickeo,项目名称:liferay-junction-point-hook,代码行数:53,代码来源:JunctionPointApplicationStartupEvent.java
示例4: processAction
import com.liferay.portlet.expando.model.ExpandoColumn; //导入依赖的package包/类
public void processAction(
PortletConfig portletConfig, ActionRequest actionRequest,
ActionResponse actionResponse)
throws Exception {
if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) {
return;
}
PortletPreferences portletPreferences =
PortletPreferencesFactoryUtil.getPortletSetup(
actionRequest, ParamUtil.getString(actionRequest, "portletResource"));
portletPreferences.setValue("showInscriptionDate",Boolean.toString(ParamUtil.getBoolean(actionRequest, "inscriptionDate",true)));
portletPreferences.setValue("showExecutionDate",Boolean.toString(ParamUtil.getBoolean(actionRequest, "executionDate",true)));
portletPreferences.setValue("categories",Boolean.toString(ParamUtil.getBoolean(actionRequest, "categories",true)));
portletPreferences.setValue("showcatalog",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showcatalog",true)));
portletPreferences.setValue("courseTemplates", StringUtil.merge(actionRequest.getParameterMap().get( "courseTemplates")));
portletPreferences.setValue("showCourseCatalogForEditions",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showCourseCatalogForEditions", false)));
portletPreferences.setValue("showClose", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showClose", true)));
portletPreferences.setValue("showDelete", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showDelete", true)));
portletPreferences.setValue("showMembers", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showMembers", true)));
portletPreferences.setValue("showExport", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showExport", true)));
portletPreferences.setValue("showImport", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showImport", true)));
portletPreferences.setValue("showGroupFilter", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showGroupFilter", false)));
portletPreferences.setValue("showClone", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showClone", true)));
portletPreferences.setValue("showGo", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showGo", true)));
portletPreferences.setValue("showPermission",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showPermission", true)));
portletPreferences.setValue("showRegistrationType", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showRegistrationType", true)));
portletPreferences.setValue("showMaxUsers", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showMaxUsers", true)));
portletPreferences.setValue("showResume",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showResume", false)));
portletPreferences.setValue("showDescription",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showDescription", false)));
portletPreferences.setValue("showSearchTags",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showSearchTags", false)));
portletPreferences.setValue("showWelcomeMsg",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showWelcomeMsg", true)));
portletPreferences.setValue("showGoodbyeMsg",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showGoodbyeMsg", true)));
portletPreferences.setValue("showOnlyOrganizationUsers",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showOnlyOrganizationUsers", true)));
portletPreferences.setValue("showCalendar", Boolean.toString(ParamUtil.getBoolean(actionRequest, "showCalendar", false)));
portletPreferences.setValue("inscriptionDateColumn",Boolean.toString(ParamUtil.getBoolean(actionRequest, "inscriptionDateColumn", true)));
portletPreferences.setValue("executionDateColumn",Boolean.toString(ParamUtil.getBoolean(actionRequest, "executionDateColumn", true)));
portletPreferences.setValue("allowDuplicateName",Boolean.toString(ParamUtil.getBoolean(actionRequest, "allowDuplicateName", false)));
portletPreferences.setValue("showIconCourse",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showIconCourse", true)));
portletPreferences.setValue("showCoursePermission",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showCoursePermission", true)));
portletPreferences.setValue("showEditionsWithoutRestrictions",Boolean.toString(ParamUtil.getBoolean(actionRequest, "showEditionsWithoutRestrictions", false)));
portletPreferences.setValue("filterByTemplates", Boolean.toString(ParamUtil.getBoolean(actionRequest, "filterByTemplates", false)));
portletPreferences.setValue ("tipoImport", ParamUtil.getString(actionRequest, "tipoImport", ""));
//Campos personalizados a mostrar en la tabla
// Expandos dinamicos
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
List<ExpandoColumn> expandosColumnCourse = ExpandoColumnLocalServiceUtil.getDefaultTableColumns(themeDisplay.getCompanyId(), ClassNameLocalServiceUtil.getClassNameId(Course.class));
if(Validator.isNotNull(expandosColumnCourse) && expandosColumnCourse.size()>0) {
String expandoName="";
for (ExpandoColumn expandoCourse : expandosColumnCourse) {
expandoName = StringUtil.upperCaseFirstLetter(expandoCourse.getName());
log.debug("SAVE: show" + expandoName+ " VALUE: "+actionRequest.getParameter("show" + expandoName));
portletPreferences.setValue("show" + expandoName, actionRequest.getParameter("show" + expandoName));
}
}
portletPreferences.store();
SessionMessages.add(
actionRequest, portletConfig.getPortletName() + ".doConfigure");
}