本文整理汇总了Java中com.liferay.portlet.expando.model.ExpandoColumnConstants类的典型用法代码示例。如果您正苦于以下问题:Java ExpandoColumnConstants类的具体用法?Java ExpandoColumnConstants怎么用?Java ExpandoColumnConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpandoColumnConstants类属于com.liferay.portlet.expando.model包,在下文中一共展示了ExpandoColumnConstants类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveDeregister
import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的package包/类
public void saveDeregister(ActionRequest request,
ActionResponse response) throws IOException,
PortletException {
try{
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
User user = themeDisplay.getUser();
boolean deregisterMail = ParamUtil.getBoolean(request, "deregister", false);
if(user.getExpandoBridge().getAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO)==null){
user.getExpandoBridge().addAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, ExpandoColumnConstants.BOOLEAN);
}
user.getExpandoBridge().setAttribute(LiferaylmsUtil.DEREGISTER_USER_EXPANDO, deregisterMail);
UserLocalServiceUtil.updateUser(user);
log.debug("User updated!");
SessionMessages.add(request, "saveDeregisterOK");
}catch(Exception e){
e.printStackTrace();
SessionErrors.add(request, "saveDeregisterKO");
}
}
示例2: doRun
import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的package包/类
public void doRun(long companyId) throws Exception {
LmsPrefs lmsPrefs=null;
try{
lmsPrefs=LmsPrefsLocalServiceUtil.getLmsPrefs(companyId);
}
catch(NoSuchPrefsException e){
lmsPrefs=null;
}
if(lmsPrefs==null){
createDefaultRoles(companyId);
createDefaultSiteTemplate(companyId);
createDefaultPreferences(companyId);
}
ExpandoTable table3 = getExpandoTable(companyId, User.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME);
if (table3 != null) {
createExpandoColumn(table3, "deregister-mail", ExpandoColumnConstants.BOOLEAN,
ExpandoColumnConstants.INDEX_TYPE_TEXT, ExpandoColumnConstants.PROPERTY_DISPLAY_TYPE_CHECKBOX, false, true);
}
}
示例3: doRun
import com.liferay.portlet.expando.model.ExpandoColumnConstants; //导入依赖的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!");
}
}