a_cmsgroupuserslist.java
来自「找了很久才找到到源代码」· Java 代码 · 共 449 行 · 第 1/2 页
JAVA
449 行
* @param ouFqn the organizational unit fqn parameter value
*/
public void setParamOufqn(String ouFqn) {
if (ouFqn == null) {
ouFqn = "";
}
m_paramOufqn = ouFqn;
}
/**
* Updates the main user list.<p>
*/
public void updateGroupList() {
Map objects = (Map)getSettings().getListObject();
if (objects != null) {
objects.remove(CmsGroupsList.class.getName());
objects.remove(A_CmsUsersList.class.getName());
}
}
/**
* @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String)
*/
protected void fillDetails(String detailId) {
// noop
}
/**
* @see org.opencms.workplace.list.A_CmsListDialog#getListItems()
*/
protected List getListItems() throws CmsException {
List ret = new ArrayList();
boolean withOtherOus = hasUsersInOtherOus()
&& getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible();
// get content
Iterator itUsers = getUsers(withOtherOus).iterator();
while (itUsers.hasNext()) {
CmsUser user = (CmsUser)itUsers.next();
CmsListItem item = getList().newItem(user.getId().toString());
item.set(LIST_COLUMN_LOGIN, user.getName());
item.set(LIST_COLUMN_NAME, user.getSimpleName());
item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + user.getOuFqn());
item.set(LIST_COLUMN_FULLNAME, user.getFullName());
ret.add(item);
}
return ret;
}
/**
* Returns a list of users to display.<p>
*
* @param withOtherOus if not set only users of the current ou should be returned
*
* @return a list of <code><{@link CmsUser}</code>s
*
* @throws CmsException if something goes wrong
*/
protected abstract List getUsers(boolean withOtherOus) throws CmsException;
/**
* @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String)
*/
protected void initializeDetail(String detailId) {
super.initializeDetail(detailId);
if (detailId.equals(LIST_DETAIL_OTHEROU)) {
boolean visible = hasUsersInOtherOus()
&& getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible();
getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible);
getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible);
}
}
/**
* @see org.opencms.workplace.CmsWorkplace#initMessages()
*/
protected void initMessages() {
// add specific dialog resource bundle
addMessages(Messages.get().getBundleName());
// add default resource bundles
super.initMessages();
}
/**
* @see org.opencms.workplace.list.A_CmsListDialog#setColumns(org.opencms.workplace.list.CmsListMetadata)
*/
protected void setColumns(CmsListMetadata metadata) {
// create column for icon display
CmsListColumnDefinition iconCol = new CmsListColumnDefinition(LIST_COLUMN_ICON);
iconCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_ICON_0));
iconCol.setHelpText(Messages.get().container(Messages.GUI_USERS_LIST_COLS_ICON_HELP_0));
iconCol.setWidth("20");
iconCol.setAlign(CmsListColumnAlignEnum.ALIGN_CENTER);
iconCol.setSorteable(false);
// set icon action
setIconAction(iconCol);
// add it to the list definition
metadata.addColumn(iconCol);
setStateActionCol(metadata);
// create column for login
CmsListColumnDefinition loginCol = new CmsListColumnDefinition(LIST_COLUMN_LOGIN);
loginCol.setVisible(false);
// add it to the list definition
metadata.addColumn(loginCol);
// create column for name
CmsListColumnDefinition nameCol = new CmsListColumnDefinition(LIST_COLUMN_NAME);
nameCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_LOGIN_0));
nameCol.setWidth("35%");
setDefaultAction(nameCol);
// add it to the list definition
metadata.addColumn(nameCol);
// create column for orgunit
CmsListColumnDefinition orgunitCol = new CmsListColumnDefinition(LIST_COLUMN_ORGUNIT);
orgunitCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_ORGUNIT_0));
orgunitCol.setVisible(false);
// add it to the list definition
metadata.addColumn(orgunitCol);
// create column for fullname
CmsListColumnDefinition fullnameCol = new CmsListColumnDefinition(LIST_COLUMN_FULLNAME);
fullnameCol.setName(Messages.get().container(Messages.GUI_USERS_LIST_COLS_FULLNAME_0));
fullnameCol.setWidth("65%");
fullnameCol.setTextWrapping(true);
// add it to the list definition
metadata.addColumn(fullnameCol);
}
/**
* Sets the optional login default action.<p>
*
* @param loginCol the login column
*/
protected abstract void setDefaultAction(CmsListColumnDefinition loginCol);
/**
* Sets the needed icon action(s).<p>
*
* @param iconCol the list column for edition.
*/
protected abstract void setIconAction(CmsListColumnDefinition iconCol);
/**
* @see org.opencms.workplace.list.A_CmsListDialog#setIndependentActions(org.opencms.workplace.list.CmsListMetadata)
*/
protected void setIndependentActions(CmsListMetadata metadata) {
// add other ou button
CmsListItemDetails otherOuDetails = new CmsListItemDetails(LIST_DETAIL_OTHEROU);
otherOuDetails.setVisible(false);
otherOuDetails.setHideAction(new CmsListIndependentAction(LIST_DETAIL_OTHEROU) {
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#getIconPath()
*/
public String getIconPath() {
return A_CmsListDialog.ICON_DETAILS_HIDE;
}
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
*/
public boolean isVisible() {
return ((A_CmsGroupUsersList)getWp()).hasUsersInOtherOus();
}
});
otherOuDetails.setShowAction(new CmsListIndependentAction(LIST_DETAIL_OTHEROU) {
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#getIconPath()
*/
public String getIconPath() {
return A_CmsListDialog.ICON_DETAILS_SHOW;
}
/**
* @see org.opencms.workplace.tools.A_CmsHtmlIconButton#isVisible()
*/
public boolean isVisible() {
return ((A_CmsGroupUsersList)getWp()).hasUsersInOtherOus();
}
});
otherOuDetails.setShowActionName(Messages.get().container(Messages.GUI_USERS_DETAIL_SHOW_OTHEROU_NAME_0));
otherOuDetails.setShowActionHelpText(Messages.get().container(Messages.GUI_USERS_DETAIL_SHOW_OTHEROU_HELP_0));
otherOuDetails.setHideActionName(Messages.get().container(Messages.GUI_USERS_DETAIL_HIDE_OTHEROU_NAME_0));
otherOuDetails.setHideActionHelpText(Messages.get().container(Messages.GUI_USERS_DETAIL_HIDE_OTHEROU_HELP_0));
otherOuDetails.setName(Messages.get().container(Messages.GUI_USERS_DETAIL_OTHEROU_NAME_0));
otherOuDetails.setFormatter(new CmsListItemDetailsFormatter(Messages.get().container(
Messages.GUI_USERS_DETAIL_OTHEROU_NAME_0)));
metadata.addItemDetails(otherOuDetails);
}
/**
* Sets the optional state change action column.<p>
*
* @param metadata the list metadata object
*/
protected abstract void setStateActionCol(CmsListMetadata metadata);
/**
* @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters()
*/
protected void validateParamaters() throws Exception {
// test the needed parameters
m_paramGroupname = getCms().readGroup(new CmsUUID(getParamGroupid())).getName();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?