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