mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Converted 'manage groups' page to proper dialog and updated related pages to use pattern usethelink should use for all remaining pages
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6865 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -656,6 +656,54 @@
|
||||
<action>wizard:newEdition</action>
|
||||
</action>
|
||||
|
||||
<!-- Create a group -->
|
||||
<action id="create_group">
|
||||
<label-id>new_group</label-id>
|
||||
<image>/images/icons/create_group.gif</image>
|
||||
<action>dialog:createGroup</action>
|
||||
<action-listener>#{DialogManager.setupParameters}</action-listener>
|
||||
<params>
|
||||
<param name="group">#{actionContext.group}</param>
|
||||
<param name="groupName">#{actionContext.groupName}</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<!-- Create a sub group -->
|
||||
<action id="create_sub_group">
|
||||
<label-id>new_sub_group</label-id>
|
||||
<image>/images/icons/create_group.gif</image>
|
||||
<action>dialog:createGroup</action>
|
||||
<action-listener>#{DialogManager.setupParameters}</action-listener>
|
||||
<params>
|
||||
<param name="group">#{actionContext.group}</param>
|
||||
<param name="groupName">#{actionContext.groupName}</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<!-- Delete group -->
|
||||
<action id="delete_group">
|
||||
<label-id>delete_group</label-id>
|
||||
<image>/images/icons/delete_group.gif</image>
|
||||
<action>dialog:deleteGroup</action>
|
||||
<action-listener>#{DialogManager.setupParameters}</action-listener>
|
||||
<params>
|
||||
<param name="group">#{actionContext.group}</param>
|
||||
<param name="groupName">#{actionContext.groupName}</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<!-- Add a user to a group -->
|
||||
<action id="add_group_user">
|
||||
<label-id>add_user</label-id>
|
||||
<image>/images/icons/add_user.gif</image>
|
||||
<action>dialog:addUsers</action>
|
||||
<action-listener>#{DialogManager.setupParameters}</action-listener>
|
||||
<params>
|
||||
<param name="group">#{actionContext.group}</param>
|
||||
<param name="groupName">#{actionContext.groupName}</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<!-- the 'action-group' elements define unique blocks of actions that reference the actions
|
||||
as defined above and can override or supply display elements for the group of actions -->
|
||||
<!-- the component is responsible for making the context Node object available with name
|
||||
@@ -834,6 +882,22 @@
|
||||
<action idref="reset_navigator" />
|
||||
</action-group>
|
||||
|
||||
<!-- Actions for the manage group dialog -->
|
||||
<action-group id="group_actions">
|
||||
<action idref="create_group" />
|
||||
</action-group>
|
||||
|
||||
<action-group id="group_more_actions">
|
||||
<action idref="delete_group" />
|
||||
<action idref="add_group_user" />
|
||||
</action-group>
|
||||
|
||||
<action-group id="group_inline_actions">
|
||||
<action idref="create_sub_group" />
|
||||
<action idref="add_group_user" />
|
||||
<action idref="delete_group" />
|
||||
</action-group>
|
||||
|
||||
</actions>
|
||||
</config>
|
||||
|
||||
|
@@ -288,6 +288,11 @@
|
||||
icon="/images/icons/edit_large.gif" title-id="title_edit_file"
|
||||
description-id="editfile_description"/>
|
||||
|
||||
<dialog name="manageGroups" page="/jsp/groups/groups.jsp" managed-bean="GroupsDialog"
|
||||
icon="/images/icons/group_large.gif" title-id="groups_management"
|
||||
description-id="groups_description" show-ok-button="false"
|
||||
actions-config-id="group_actions" more-actions-config-id="group_more_actions" />
|
||||
|
||||
<dialog name="deleteGroup" page="/jsp/groups/delete-group.jsp" managed-bean="DeleteGroupDialog"
|
||||
icon="/images/icons/delete_group_large.gif" title-id="delete_group"
|
||||
description-id="delete_group_info"/>
|
||||
|
@@ -1161,4 +1161,14 @@ public class DocumentDetailsBean extends BaseDetailsBean implements IDialogBean
|
||||
{
|
||||
return baseDialogBean.getActionsContext();
|
||||
}
|
||||
|
||||
public String getActionsConfigId()
|
||||
{
|
||||
return baseDialogBean.getActionsConfigId();
|
||||
}
|
||||
|
||||
public String getMoreActionsConfigId()
|
||||
{
|
||||
return baseDialogBean.getMoreActionsConfigId();
|
||||
}
|
||||
}
|
||||
|
@@ -662,4 +662,14 @@ public class SpaceDetailsBean extends BaseDetailsBean implements IDialogBean
|
||||
{
|
||||
return baseDialogBean.getActionsContext();
|
||||
}
|
||||
|
||||
public String getActionsConfigId()
|
||||
{
|
||||
return baseDialogBean.getActionsConfigId();
|
||||
}
|
||||
|
||||
public String getMoreActionsConfigId()
|
||||
{
|
||||
return baseDialogBean.getMoreActionsConfigId();
|
||||
}
|
||||
}
|
||||
|
@@ -203,6 +203,20 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
return this.navigator.getCurrentNode();
|
||||
}
|
||||
|
||||
public String getActionsConfigId()
|
||||
{
|
||||
// nothing by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getMoreActionsConfigId()
|
||||
{
|
||||
// nothing by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param browseBean The BrowseBean to set.
|
||||
*/
|
||||
|
@@ -74,6 +74,17 @@ public final class DialogManager
|
||||
{
|
||||
// store the parameters
|
||||
this.paramsToApply = ((UIActionLink)component).getParameterMap();
|
||||
|
||||
// make sure "null" parameters are actually null, this can occur
|
||||
// when null parameters are sent to the client and posted back
|
||||
for (String name : this.paramsToApply.keySet())
|
||||
{
|
||||
String value = this.paramsToApply.get(name);
|
||||
if (value != null && value.equalsIgnoreCase("null"))
|
||||
{
|
||||
this.paramsToApply.put(name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +297,18 @@ public final class DialogManager
|
||||
*
|
||||
* @return The action group id
|
||||
*/
|
||||
public String getActions()
|
||||
public String getActionsId()
|
||||
{
|
||||
return this.currentDialogState.getConfig().getActionsConfigId();
|
||||
// first see if the dialog itself has supplied an actions id
|
||||
String configId = this.currentDialogState.getDialog().getActionsConfigId();
|
||||
|
||||
if (configId == null)
|
||||
{
|
||||
// see if an actions id was specified in the dialog config
|
||||
configId = this.currentDialogState.getConfig().getActionsConfigId();
|
||||
}
|
||||
|
||||
return configId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,9 +317,18 @@ public final class DialogManager
|
||||
*
|
||||
* @return The action group id
|
||||
*/
|
||||
public String getMoreActions()
|
||||
public String getMoreActionsId()
|
||||
{
|
||||
return this.currentDialogState.getConfig().getMoreActionsConfigId();
|
||||
// first see if the dialog itself has supplied a more actions id
|
||||
String configId = this.currentDialogState.getDialog().getMoreActionsConfigId();
|
||||
|
||||
if (configId == null)
|
||||
{
|
||||
// see if an actions id was specified in the dialog config
|
||||
configId = this.currentDialogState.getConfig().getMoreActionsConfigId();
|
||||
}
|
||||
|
||||
return configId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -124,4 +124,18 @@ public interface IDialogBean
|
||||
* @return Object to use as the context for actions
|
||||
*/
|
||||
public Object getActionsContext();
|
||||
|
||||
/**
|
||||
* Returns the id of an action group to use for the main actions
|
||||
*
|
||||
* @return Id of an action group
|
||||
*/
|
||||
public String getActionsConfigId();
|
||||
|
||||
/**
|
||||
* Returns the id of an action group to use for the more actions
|
||||
*
|
||||
* @return Id of an action group
|
||||
*/
|
||||
public String getMoreActionsConfigId();
|
||||
}
|
||||
|
@@ -41,12 +41,13 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.GroupsDialog;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.groups.GroupsDialog.UserAuthorityDetails;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.SortableSelectItem;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
@@ -58,48 +59,57 @@ import org.alfresco.web.ui.common.component.UIGenericPicker;
|
||||
* @author YanO
|
||||
* @author gavinc
|
||||
*/
|
||||
public class AddUsersDialog extends GroupsDialog
|
||||
public class AddUsersDialog extends BaseDialogBean
|
||||
{
|
||||
private static final String BUTTON_FINISH = "finish_button";
|
||||
/** The id of the group to add users to */
|
||||
protected String group;
|
||||
|
||||
/** Name of the group to add users to */
|
||||
protected String groupName;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
|
||||
/** personService bean reference */
|
||||
protected PersonService personService;
|
||||
|
||||
/** selected users to be added to a group */
|
||||
private List<UserAuthorityDetails> usersForGroup;
|
||||
protected List<UserAuthorityDetails> usersForGroup;
|
||||
|
||||
/** datamodel for table of users added to group */
|
||||
private DataModel usersDataModel = null;
|
||||
protected DataModel usersDataModel = null;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// retrieve parameters
|
||||
this.group = parameters.get(GroupsDialog.PARAM_GROUP);
|
||||
this.groupName = parameters.get(GroupsDialog.PARAM_GROUP_NAME);
|
||||
|
||||
usersForGroup = new ArrayList<UserAuthorityDetails>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// add each selected user to the current group in turn
|
||||
for (UserAuthorityDetails wrapper : this.usersForGroup)
|
||||
{
|
||||
properties.getAuthService().addAuthority(properties.getActionGroup(), wrapper.getAuthority());
|
||||
this.authService.addAuthority(this.group, wrapper.getAuthority());
|
||||
}
|
||||
}
|
||||
catch (Throwable err)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
outcome = null;
|
||||
}
|
||||
setActionGroup(null);
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerSubTitle()
|
||||
{
|
||||
return properties.getActionGroupName();
|
||||
return this.groupName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,12 +118,37 @@ public class AddUsersDialog extends GroupsDialog
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
public void setAuthService(AuthorityService authService)
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_FINISH);
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the usersDataModel.
|
||||
*/
|
||||
public DataModel getUsersDataModel()
|
||||
{
|
||||
if (this.usersDataModel == null)
|
||||
{
|
||||
this.usersDataModel = new ListDataModel();
|
||||
}
|
||||
|
||||
this.usersDataModel.setWrappedData(this.usersForGroup);
|
||||
|
||||
return this.usersDataModel;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
/**
|
||||
* Query callback method executed by the Generic Picker component. This
|
||||
* method is part of the contract to the Generic Picker, it is up to the
|
||||
@@ -141,7 +176,7 @@ public class AddUsersDialog extends GroupsDialog
|
||||
|
||||
// build xpath to match available User/Person objects
|
||||
ServiceRegistry services = Repository.getServiceRegistry(context);
|
||||
NodeRef peopleRef = properties.getPersonService().getPeopleContainer();
|
||||
NodeRef peopleRef = personService.getPeopleContainer();
|
||||
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains +
|
||||
"%', false)" + " or " + "like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" +
|
||||
"lastName, '%" + contains + "%', false)]";
|
||||
@@ -186,6 +221,9 @@ public class AddUsersDialog extends GroupsDialog
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Event handlers
|
||||
|
||||
/**
|
||||
* Add the selected User to the list for adding to a Group
|
||||
*/
|
||||
@@ -216,10 +254,10 @@ public class AddUsersDialog extends GroupsDialog
|
||||
StringBuilder label = new StringBuilder(48);
|
||||
|
||||
// build a display label showing the user person name
|
||||
if (properties.getPersonService().personExists(authority) == true)
|
||||
if (this.personService.personExists(authority) == true)
|
||||
{
|
||||
// found a Person with a User authority
|
||||
NodeRef ref = properties.getPersonService().getPerson(authority);
|
||||
NodeRef ref = this.personService.getPerson(authority);
|
||||
String firstName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
|
||||
String lastName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
||||
|
||||
@@ -248,19 +286,4 @@ public class AddUsersDialog extends GroupsDialog
|
||||
this.usersForGroup.remove(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the usersDataModel.
|
||||
*/
|
||||
public DataModel getUsersDataModel()
|
||||
{
|
||||
if (this.usersDataModel == null)
|
||||
{
|
||||
this.usersDataModel = new ListDataModel();
|
||||
}
|
||||
|
||||
this.usersDataModel.setWrappedData(this.usersForGroup);
|
||||
|
||||
return this.usersDataModel;
|
||||
}
|
||||
}
|
||||
|
@@ -32,53 +32,56 @@ import javax.faces.component.UIComponent;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.validator.ValidatorException;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.GroupsDialog;
|
||||
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
public class CreateGroupDialog extends GroupsDialog
|
||||
public class CreateGroupDialog extends BaseDialogBean
|
||||
{
|
||||
protected String parentGroup;
|
||||
protected String parentGroupName;
|
||||
protected String name;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
|
||||
private static final String MSG_ERR_EXISTS = "groups_err_exists";
|
||||
private static final String MSG_ERR_NAME = "groups_err_group_name";
|
||||
private static final String MSG_ROOT_GROUPS = "root_groups";
|
||||
private static final String MSG_BUTTON_NEW_GROUP = "new_group";
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
properties.setName("");
|
||||
|
||||
// retrieve parameters
|
||||
this.parentGroup = parameters.get(GroupsDialog.PARAM_GROUP);
|
||||
this.parentGroupName = parameters.get(GroupsDialog.PARAM_GROUP_NAME);
|
||||
|
||||
// reset variables
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// create new Group using Authentication Service
|
||||
String groupName = properties.getAuthService().getName(AuthorityType.GROUP, properties.getName());
|
||||
if (properties.getAuthService().authorityExists(groupName) == false)
|
||||
String groupName = this.authService.getName(AuthorityType.GROUP, this.name);
|
||||
if (this.authService.authorityExists(groupName) == false)
|
||||
{
|
||||
properties.getAuthService().createAuthority(AuthorityType.GROUP, properties.getActionGroup(), properties.getName());
|
||||
this.authService.createAuthority(AuthorityType.GROUP, this.parentGroup, this.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_EXISTS));
|
||||
outcome = null;
|
||||
}
|
||||
}
|
||||
catch (Throwable err)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
context, Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
outcome = null;
|
||||
}
|
||||
|
||||
if (outcome == null)
|
||||
{
|
||||
isFinished = false;
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
@@ -94,28 +97,48 @@ public class CreateGroupDialog extends GroupsDialog
|
||||
{
|
||||
String subtitle = null;
|
||||
|
||||
if (properties.getActionGroup() != null)
|
||||
if (this.parentGroupName != null)
|
||||
{
|
||||
subtitle = properties.getActionGroupName();
|
||||
subtitle = this.parentGroupName;
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitle = properties.getGroupName();
|
||||
subtitle = Application.getMessage(FacesContext.getCurrentInstance(), MSG_ROOT_GROUPS);
|
||||
}
|
||||
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setAuthService(AuthorityService authService)
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
public void validateGroupName(FacesContext context, UIComponent component, Object value) throws ValidatorException
|
||||
{
|
||||
String name = (String) value;
|
||||
|
||||
if (name.indexOf('\'') != -1 || name.indexOf('"') != -1 || name.indexOf('\\') != -1)
|
||||
{
|
||||
String err = MessageFormat.format(Application.getMessage(context, "groups_err_group_name"),
|
||||
String err = MessageFormat.format(Application.getMessage(context, MSG_ERR_NAME),
|
||||
new Object[] { "', \", \\" });
|
||||
throw new ValidatorException(new FacesMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -24,39 +24,69 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.groups;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.GroupsDialog;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
|
||||
public class DeleteGroupDialog extends GroupsDialog
|
||||
public class DeleteGroupDialog extends BaseDialogBean
|
||||
{
|
||||
private static final String BUTTON_DELETE = "delete";
|
||||
/** The group to be deleted */
|
||||
protected String group = null;
|
||||
protected String groupName = null;
|
||||
|
||||
/** The number of items the group contains */
|
||||
protected int numItemsInGroup = 0;
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
|
||||
private static final String MSG_DELETE = "delete";
|
||||
private static final String MSG_DELETE_GROUP = "delete_group";
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Dialog implementation
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// retrieve parameters
|
||||
this.group = parameters.get(GroupsDialog.PARAM_GROUP);
|
||||
this.groupName = parameters.get(GroupsDialog.PARAM_GROUP_NAME);
|
||||
|
||||
// calculate the number of items the givev group has
|
||||
if (this.group != null)
|
||||
{
|
||||
numItemsInGroup = this.authService.getContainedAuthorities(
|
||||
AuthorityType.GROUP, this.group, false).size();
|
||||
numItemsInGroup += this.authService.getContainedAuthorities(
|
||||
AuthorityType.USER, this.group, false).size();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
// delete group using the Authentication Service
|
||||
properties.getAuthService().deleteAuthority(properties.getActionGroup());
|
||||
removeFromBreadcrumb(properties.getActionGroup());
|
||||
this.authService.deleteAuthority(this.group);
|
||||
|
||||
// clear action context
|
||||
setActionGroup(null);
|
||||
return outcome;
|
||||
}
|
||||
catch (Throwable err)
|
||||
|
||||
@Override
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// rollback the transaction
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
outcome = null;
|
||||
}
|
||||
// add the group to the request object so it gets picked up by
|
||||
// groups dialog, this will allow it to be removed from the breadcrumb
|
||||
context.getExternalContext().getRequestMap().put(
|
||||
GroupsDialog.KEY_GROUP, this.group);
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@@ -69,12 +99,31 @@ public class DeleteGroupDialog extends GroupsDialog
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_DELETE);
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerTitle()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_GROUP) + " '" + properties.getActionGroupName() + "'";
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE_GROUP) + " '" +
|
||||
this.groupName + "'";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return this.groupName;
|
||||
}
|
||||
|
||||
public int getNumItemsInGroup()
|
||||
{
|
||||
return this.numItemsInGroup;
|
||||
}
|
||||
|
||||
public void setAuthService(AuthorityService authService)
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.web.bean;
|
||||
package org.alfresco.web.bean.groups;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -38,18 +38,23 @@ import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.context.IContextListener;
|
||||
import org.alfresco.web.app.context.UIContextService;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.web.bean.groups.GroupsProperties;
|
||||
import org.alfresco.web.bean.dialog.ChangeViewSupport;
|
||||
import org.alfresco.web.bean.dialog.FilterViewSupport;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
import org.alfresco.web.ui.common.component.UIBreadcrumb;
|
||||
import org.alfresco.web.ui.common.component.UIListItem;
|
||||
import org.alfresco.web.ui.common.component.UIModeList;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -58,12 +63,48 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
public class GroupsDialog extends BaseDialogBean
|
||||
implements IContextListener, FilterViewSupport, ChangeViewSupport
|
||||
{
|
||||
protected GroupsProperties properties;
|
||||
public static final String KEY_GROUP = "group";
|
||||
public static final String PARAM_GROUP = "group";
|
||||
public static final String PARAM_GROUP_NAME = "groupName";
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
protected AuthorityService authService;
|
||||
|
||||
/** personService bean reference */
|
||||
protected PersonService personService;
|
||||
|
||||
/** Component references */
|
||||
protected UIRichList groupsRichList;
|
||||
protected UIRichList usersRichList;
|
||||
|
||||
/** Currently visible Group Authority */
|
||||
protected String group = null;
|
||||
protected String groupName = null;
|
||||
|
||||
/** RichList view mode */
|
||||
protected String viewMode = VIEW_ICONS;
|
||||
|
||||
/** Filter mode */
|
||||
protected String filterMode = FILTER_CHILDREN;
|
||||
|
||||
/** Groups path breadcrumb location */
|
||||
protected List<IBreadcrumbHandler> location = null;
|
||||
|
||||
private static final String VIEW_ICONS = "icons";
|
||||
private static final String VIEW_DETAILS = "details";
|
||||
private static final String FILTER_CHILDREN = "children";
|
||||
private static final String MSG_GROUPS = "root_groups";
|
||||
private static final String FILTER_ALL = "all";
|
||||
|
||||
private static final String LABEL_VIEW_ICONS = "group_icons";
|
||||
private static final String LABEL_VIEW_DETAILS = "group_details";
|
||||
private static final String LABEL_FILTER_CHILDREN = "group_filter_children";
|
||||
private static final String LABEL_FILTER_ALL = "group_filter_all";
|
||||
|
||||
private static final String MSG_ROOT_GROUPS = "root_groups";
|
||||
private static final String MSG_CLOSE = "close";
|
||||
|
||||
private static Log logger = LogFactory.getLog(GroupsDialog.class);
|
||||
|
||||
@@ -79,67 +120,179 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
// Dialog implementation
|
||||
|
||||
public void setProperties(GroupsProperties properties)
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
this.properties = properties;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContainerSubTitle()
|
||||
{
|
||||
String subtitle = null;
|
||||
|
||||
if (this.group != null)
|
||||
{
|
||||
subtitle = this.groupName;
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitle = Application.getMessage(FacesContext.getCurrentInstance(), MSG_ROOT_GROUPS);
|
||||
}
|
||||
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCancelButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CLOSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restored()
|
||||
{
|
||||
Object groupToRemove = FacesContext.getCurrentInstance().getExternalContext().
|
||||
getRequestMap().get(KEY_GROUP);
|
||||
if (groupToRemove != null)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Removing group '" + groupToRemove + "' from breadcrumb");
|
||||
|
||||
removeFromBreadcrumb((String)groupToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getActionsContext()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// FilterViewSupport implementation
|
||||
|
||||
public List<UIListItem> getFilterItems()
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
List<UIListItem> items = new ArrayList<UIListItem>(2);
|
||||
|
||||
UIListItem item1 = new UIListItem();
|
||||
item1.setValue(FILTER_CHILDREN);
|
||||
item1.setLabel(Application.getMessage(context, LABEL_FILTER_CHILDREN));
|
||||
items.add(item1);
|
||||
|
||||
UIListItem item2 = new UIListItem();
|
||||
item2.setValue(FILTER_ALL);
|
||||
item2.setLabel(Application.getMessage(context, LABEL_FILTER_ALL));
|
||||
items.add(item2);
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
public void filterModeChanged(ActionEvent event)
|
||||
{
|
||||
UIModeList filterList = (UIModeList)event.getComponent();
|
||||
|
||||
// update list filter mode from user selection
|
||||
setFilterMode(filterList.getValue().toString());
|
||||
}
|
||||
|
||||
public String getFilterMode()
|
||||
{
|
||||
return this.filterMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filterMode The filterMode to set.
|
||||
*/
|
||||
public void setFilterMode(String filterMode)
|
||||
{
|
||||
properties.setFilterMode(filterMode);
|
||||
this.filterMode = filterMode;
|
||||
|
||||
// clear datalist cache ready to change results based on filter setting
|
||||
contextUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param group Set the Group to be used for the current action screen.
|
||||
*/
|
||||
public void setActionGroup(String group)
|
||||
{
|
||||
properties.setActionGroup(group);
|
||||
// ------------------------------------------------------------------------------
|
||||
// ChangeViewSupport implementation
|
||||
|
||||
if (group != null)
|
||||
public List<UIListItem> getViewItems()
|
||||
{
|
||||
// calculate action group metadata
|
||||
properties.setActionGroupName(properties.getAuthService().getShortName(group));
|
||||
int count = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, group, false).size();
|
||||
count += properties.getAuthService().getContainedAuthorities(AuthorityType.USER, group, false).size();
|
||||
properties.setActionGroupItems(count);
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.setActionGroupName(null);
|
||||
properties.setActionGroupItems(0);
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
List<UIListItem> items = new ArrayList<UIListItem>(2);
|
||||
|
||||
UIListItem item1 = new UIListItem();
|
||||
item1.setValue(VIEW_ICONS);
|
||||
item1.setLabel(Application.getMessage(context, LABEL_VIEW_ICONS));
|
||||
items.add(item1);
|
||||
|
||||
UIListItem item2 = new UIListItem();
|
||||
item2.setValue(VIEW_DETAILS);
|
||||
item2.setLabel(Application.getMessage(context, LABEL_VIEW_DETAILS));
|
||||
items.add(item2);
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
// clear value used by Create Group form
|
||||
properties.setName(null);
|
||||
public void viewModeChanged(ActionEvent event)
|
||||
{
|
||||
UIModeList viewList = (UIModeList)event.getComponent();
|
||||
|
||||
// update view mode from user selection
|
||||
setViewMode(viewList.getValue().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current Group Authority.
|
||||
* <p>
|
||||
* Setting this value causes the UI to update and display the specified node as current.
|
||||
*
|
||||
* @param group The current group authority.
|
||||
*/
|
||||
public void setCurrentGroup(String group, String groupName)
|
||||
public String getViewMode()
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Setting current group: " + group);
|
||||
return this.viewMode;
|
||||
}
|
||||
|
||||
// set the current Group Authority for our UI context operations
|
||||
properties.setGroup(group);
|
||||
properties.setGroupName(groupName);
|
||||
public void setViewMode(String viewMode)
|
||||
{
|
||||
this.viewMode = viewMode;
|
||||
}
|
||||
|
||||
// inform that the UI needs updating after this change
|
||||
contextUpdated();
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean property getters and setters
|
||||
|
||||
public String getGroup()
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return this.groupName;
|
||||
}
|
||||
|
||||
public void setAuthService(AuthorityService authService)
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
public UIRichList getGroupsRichList()
|
||||
{
|
||||
return groupsRichList;
|
||||
}
|
||||
|
||||
public void setGroupsRichList(UIRichList groupsRichList)
|
||||
{
|
||||
this.groupsRichList = groupsRichList;
|
||||
}
|
||||
|
||||
public UIRichList getUsersRichList()
|
||||
{
|
||||
return usersRichList;
|
||||
}
|
||||
|
||||
public void setUsersRichList(UIRichList usersRichList)
|
||||
{
|
||||
this.usersRichList = usersRichList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,16 +300,16 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
*/
|
||||
public List<IBreadcrumbHandler> getLocation()
|
||||
{
|
||||
if (properties.getLocation() == null)
|
||||
if (this.location == null)
|
||||
{
|
||||
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
|
||||
loc.add(new GroupBreadcrumbHandler(null,
|
||||
Application.getMessage(FacesContext.getCurrentInstance(), MSG_GROUPS)));
|
||||
Application.getMessage(FacesContext.getCurrentInstance(), MSG_ROOT_GROUPS)));
|
||||
|
||||
properties.setLocation(loc);
|
||||
this.location = loc;
|
||||
}
|
||||
|
||||
return properties.getLocation();
|
||||
return this.location;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,32 +328,34 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
tx.begin();
|
||||
|
||||
Set<String> authorities;
|
||||
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
|
||||
if (properties.getGroup() == null)
|
||||
boolean immediate = (this.filterMode.equals(FILTER_CHILDREN));
|
||||
if (this.group == null)
|
||||
{
|
||||
// root groups
|
||||
if (immediate == true)
|
||||
{
|
||||
authorities = properties.getAuthService().getAllRootAuthorities(AuthorityType.GROUP);
|
||||
authorities = this.authService.getAllRootAuthorities(AuthorityType.GROUP);
|
||||
}
|
||||
else
|
||||
{
|
||||
authorities = properties.getAuthService().getAllAuthorities(AuthorityType.GROUP);
|
||||
authorities = this.authService.getAllAuthorities(AuthorityType.GROUP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sub-group of an existing group
|
||||
authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.GROUP, properties.getGroup(), immediate);
|
||||
authorities = this.authService.getContainedAuthorities(AuthorityType.GROUP, this.group, immediate);
|
||||
}
|
||||
groups = new ArrayList<Map>(authorities.size());
|
||||
for (String authority : authorities)
|
||||
{
|
||||
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
|
||||
|
||||
String name = properties.getAuthService().getShortName(authority);
|
||||
String name = this.authService.getShortName(authority);
|
||||
authMap.put("name", name);
|
||||
authMap.put("id", authority);
|
||||
authMap.put("group", authority);
|
||||
authMap.put("groupName", name);
|
||||
|
||||
groups.add(authMap);
|
||||
}
|
||||
@@ -230,31 +385,31 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
try
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
tx = Repository.getUserTransaction(context);
|
||||
tx = Repository.getUserTransaction(context, true);
|
||||
tx.begin();
|
||||
|
||||
Set<String> authorities;
|
||||
if (properties.getGroup() == null)
|
||||
if (this.group == null)
|
||||
{
|
||||
authorities = Collections.<String>emptySet();
|
||||
}
|
||||
else
|
||||
{
|
||||
// users of an existing group
|
||||
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
|
||||
authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.USER, properties.getGroup(), immediate);
|
||||
boolean immediate = (this.filterMode.equals(FILTER_CHILDREN));
|
||||
authorities = this.authService.getContainedAuthorities(AuthorityType.USER, this.group, immediate);
|
||||
}
|
||||
users = new ArrayList<Map>(authorities.size());
|
||||
for (String authority : authorities)
|
||||
{
|
||||
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
|
||||
|
||||
String userName = properties.getAuthService().getShortName(authority);
|
||||
String userName = this.authService.getShortName(authority);
|
||||
authMap.put("userName", userName);
|
||||
authMap.put("id", authority);
|
||||
|
||||
// get Person details for this Authority
|
||||
NodeRef ref = properties.getPersonService().getPerson(authority);
|
||||
NodeRef ref = this.personService.getPerson(authority);
|
||||
String firstName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
|
||||
String lastName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
||||
|
||||
@@ -283,36 +438,27 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Group to be used for next action dialog
|
||||
* Set the current Group Authority.
|
||||
* <p>
|
||||
* Setting this value causes the UI to update and display the specified node as current.
|
||||
*
|
||||
* @param group The current group authority.
|
||||
*/
|
||||
public void setupGroupAction(ActionEvent event)
|
||||
{
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
Map<String, String> params = link.getParameterMap();
|
||||
String group = params.get("id");
|
||||
if (group != null && group.length() != 0)
|
||||
protected void setCurrentGroup(String group, String groupName)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Setup for action, setting current Group to: " + group);
|
||||
logger.debug("Setting current group: " + group);
|
||||
|
||||
// prepare a node for the action context
|
||||
setActionGroup(group);
|
||||
// set the current Group Authority for our UI context operations
|
||||
this.group = group;
|
||||
this.groupName = groupName;
|
||||
|
||||
// clear datalist cache ready from return from action dialog
|
||||
// inform that the UI needs updating after this change
|
||||
contextUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the Group action context - e.g. ready for a Create Root Group operation
|
||||
*/
|
||||
public void clearGroupAction(ActionEvent event)
|
||||
{
|
||||
setActionGroup(null);
|
||||
|
||||
// clear datalist cache ready from return from action dialog
|
||||
contextUpdated();
|
||||
}
|
||||
// ------------------------------------------------------------------------------
|
||||
// Action handlers
|
||||
|
||||
/**
|
||||
* Action called when a Group folder is clicked.
|
||||
@@ -340,9 +486,17 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
String authority = params.get("id");
|
||||
if (authority != null && authority.length() != 0)
|
||||
{
|
||||
UserTransaction tx = null;
|
||||
try
|
||||
{
|
||||
properties.getAuthService().removeAuthority(properties.getGroup(), authority);
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
tx = Repository.getUserTransaction(context);
|
||||
tx.begin();
|
||||
|
||||
this.authService.removeAuthority(this.group, authority);
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// refresh UI after change
|
||||
contextUpdated();
|
||||
@@ -351,45 +505,26 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the current view mode based on user selection
|
||||
*/
|
||||
public void viewModeChanged(ActionEvent event)
|
||||
{
|
||||
UIModeList viewList = (UIModeList)event.getComponent();
|
||||
|
||||
// update view mode from user selection
|
||||
properties.setViewMode(viewList.getValue().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the current list filter mode based on user selection
|
||||
*/
|
||||
public void filterModeChanged(ActionEvent event)
|
||||
{
|
||||
UIModeList viewList = (UIModeList)event.getComponent();
|
||||
|
||||
// update list filter mode from user selection
|
||||
setFilterMode(viewList.getValue().toString());
|
||||
}
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
/**
|
||||
* Update the breadcrumb with the clicked Group location
|
||||
*/
|
||||
private void updateUILocation(String group)
|
||||
protected void updateUILocation(String group)
|
||||
{
|
||||
String groupName = properties.getAuthService().getShortName(group);
|
||||
properties.getLocation().add(new GroupBreadcrumbHandler(group, groupName));
|
||||
String groupName = this.authService.getShortName(group);
|
||||
this.location.add(new GroupBreadcrumbHandler(group, groupName));
|
||||
this.setCurrentGroup(group, groupName);
|
||||
}
|
||||
|
||||
public void removeFromBreadcrumb(String group)
|
||||
protected void removeFromBreadcrumb(String group)
|
||||
{
|
||||
|
||||
// remove this node from the breadcrumb if required
|
||||
List<IBreadcrumbHandler> location = getLocation();
|
||||
GroupBreadcrumbHandler handler = (GroupBreadcrumbHandler) location.get(location.size() - 1);
|
||||
@@ -408,12 +543,6 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// IContextListener implementation
|
||||
|
||||
@@ -426,8 +555,15 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
logger.debug("Invalidating Group Management Components...");
|
||||
|
||||
// force a requery of the richlist dataset
|
||||
properties.getGroupsRichList().setValue(null);
|
||||
properties.getUsersRichList().setValue(null);
|
||||
if (this.groupsRichList != null)
|
||||
{
|
||||
this.groupsRichList.setValue(null);
|
||||
}
|
||||
|
||||
if (this.usersRichList != null)
|
||||
{
|
||||
this.usersRichList.setValue(null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -484,7 +620,7 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
||||
// All group breadcrumb elements relate to a Group
|
||||
// when selected we set the current Group Id and return
|
||||
setCurrentGroup(this.Group, this.Label);
|
||||
properties.setLocation( (List)breadcrumb.getValue() );
|
||||
location = (List<IBreadcrumbHandler>)breadcrumb.getValue();
|
||||
|
||||
return null;
|
||||
}
|
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.web.bean.groups;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
|
||||
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||
|
||||
public class GroupsProperties
|
||||
{
|
||||
private static final String FILTER_CHILDREN = "children";
|
||||
|
||||
/** The AuthorityService to be used by the bean */
|
||||
private AuthorityService authService;
|
||||
|
||||
/** personService bean reference */
|
||||
private PersonService personService;
|
||||
|
||||
/** Component references */
|
||||
private UIRichList groupsRichList;
|
||||
private UIRichList usersRichList;
|
||||
|
||||
/** Currently visible Group Authority */
|
||||
private String group = null;
|
||||
private String groupName = null;
|
||||
|
||||
/** Action group authority */
|
||||
private String actionGroup = null;
|
||||
private String actionGroupName = null;
|
||||
private int actionGroupItems = 0;
|
||||
|
||||
/** Dialog properties */
|
||||
private String name = null;
|
||||
|
||||
/** RichList view mode */
|
||||
private String viewMode = "icons";
|
||||
|
||||
/** List filter mode */
|
||||
private String filterMode = FILTER_CHILDREN;
|
||||
|
||||
/** Groups path breadcrumb location */
|
||||
private List<IBreadcrumbHandler> location = null;
|
||||
|
||||
public AuthorityService getAuthService()
|
||||
{
|
||||
return authService;
|
||||
}
|
||||
|
||||
public void setAuthService(AuthorityService authService)
|
||||
{
|
||||
this.authService = authService;
|
||||
}
|
||||
|
||||
public PersonService getPersonService()
|
||||
{
|
||||
return personService;
|
||||
}
|
||||
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.personService = personService;
|
||||
}
|
||||
|
||||
public UIRichList getGroupsRichList()
|
||||
{
|
||||
return groupsRichList;
|
||||
}
|
||||
|
||||
public void setGroupsRichList(UIRichList groupsRichList)
|
||||
{
|
||||
this.groupsRichList = groupsRichList;
|
||||
}
|
||||
|
||||
public UIRichList getUsersRichList()
|
||||
{
|
||||
return usersRichList;
|
||||
}
|
||||
|
||||
public void setUsersRichList(UIRichList usersRichList)
|
||||
{
|
||||
this.usersRichList = usersRichList;
|
||||
}
|
||||
|
||||
public String getGroup()
|
||||
{
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(String group)
|
||||
{
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName)
|
||||
{
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getActionGroup()
|
||||
{
|
||||
return actionGroup;
|
||||
}
|
||||
|
||||
public void setActionGroup(String actionGroup)
|
||||
{
|
||||
this.actionGroup = actionGroup;
|
||||
}
|
||||
|
||||
public String getActionGroupName()
|
||||
{
|
||||
return actionGroupName;
|
||||
}
|
||||
|
||||
public void setActionGroupName(String actionGroupName)
|
||||
{
|
||||
this.actionGroupName = actionGroupName;
|
||||
}
|
||||
|
||||
public int getActionGroupItems()
|
||||
{
|
||||
return actionGroupItems;
|
||||
}
|
||||
|
||||
public void setActionGroupItems(int actionGroupItems)
|
||||
{
|
||||
this.actionGroupItems = actionGroupItems;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getViewMode()
|
||||
{
|
||||
return viewMode;
|
||||
}
|
||||
|
||||
public void setViewMode(String viewMode)
|
||||
{
|
||||
this.viewMode = viewMode;
|
||||
}
|
||||
|
||||
public String getFilterMode()
|
||||
{
|
||||
return filterMode;
|
||||
}
|
||||
|
||||
public void setFilterMode(String filterMode)
|
||||
{
|
||||
this.filterMode = filterMode;
|
||||
}
|
||||
|
||||
public List<IBreadcrumbHandler> getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(List<IBreadcrumbHandler> location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
}
|
@@ -82,7 +82,18 @@ public final class WizardManager
|
||||
if (component instanceof UIActionLink)
|
||||
{
|
||||
// store the parameters
|
||||
setupParameters( ((UIActionLink)component).getParameterMap() );
|
||||
this.paramsToApply = ((UIActionLink)component).getParameterMap();
|
||||
|
||||
// make sure "null" parameters are actually null, this can occur
|
||||
// when null parameters are sent to the client and posted back
|
||||
for (String name : this.paramsToApply.keySet())
|
||||
{
|
||||
String value = this.paramsToApply.get(name);
|
||||
if (value != null && value.equalsIgnoreCase("null"))
|
||||
{
|
||||
this.paramsToApply.put(name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -562,9 +562,13 @@
|
||||
<description>
|
||||
The bean that holds state for the Groups Management screens.
|
||||
</description>
|
||||
<managed-bean-name>GroupsProperties</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.groups.GroupsProperties</managed-bean-class>
|
||||
<managed-bean-name>GroupsDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.groups.GroupsDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>authService</property-name>
|
||||
<value>#{AuthorityService}</value>
|
||||
@@ -575,23 +579,6 @@
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that holds state for the Groups Management screens.
|
||||
</description>
|
||||
<managed-bean-name>GroupsDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.GroupsDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>properties</property-name>
|
||||
<value>#{GroupsProperties}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that holds state for the Category Management screens.
|
||||
@@ -4371,8 +4358,12 @@
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>properties</property-name>
|
||||
<value>#{GroupsProperties}</value>
|
||||
<property-name>authService</property-name>
|
||||
<value>#{AuthorityService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>personService</property-name>
|
||||
<value>#{PersonService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
@@ -4384,12 +4375,8 @@
|
||||
</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>properties</property-name>
|
||||
<value>#{GroupsProperties}</value>
|
||||
<property-name>authService</property-name>
|
||||
<value>#{AuthorityService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
@@ -4401,12 +4388,8 @@
|
||||
</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>properties</property-name>
|
||||
<value>#{GroupsProperties}</value>
|
||||
<property-name>authService</property-name>
|
||||
<value>#{AuthorityService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
|
@@ -86,28 +86,28 @@
|
||||
<table cellspacing="4" cellpadding="1" width="100%">
|
||||
<tr>
|
||||
<%-- Main actions --%>
|
||||
<a:panel id="main-actions-panel" rendered="#{DialogManager.actions != null}">
|
||||
<a:panel id="main-actions-panel" rendered="#{DialogManager.actionsId != null}">
|
||||
<td style="white-space: nowrap;">
|
||||
<r:actions id="main_actions_list" rendered="#{DialogManager.actionsAsMenu == false}"
|
||||
styleClass="dialogMainActions" value="#{DialogManager.actions}"
|
||||
styleClass="dialogMainActions" value="#{DialogManager.actionsId}"
|
||||
context="#{DialogManager.actionsContext}" />
|
||||
|
||||
<a:menu id="main_actions_menu" rendered="#{DialogManager.actionsAsMenu == true}"
|
||||
itemSpacing="4" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
|
||||
style="white-space: nowrap" label="#{DialogManager.actionsMenuLabel}">
|
||||
<r:actions id="main_actions_menu_items" value="#{DialogManager.actions}"
|
||||
<r:actions id="main_actions_menu_items" value="#{DialogManager.actionsId}"
|
||||
context="#{DialogManager.actionsContext}" />
|
||||
</a:menu>
|
||||
</td>
|
||||
</a:panel>
|
||||
|
||||
<%-- More actions menu --%>
|
||||
<a:panel id="more-actions-panel" rendered="#{DialogManager.moreActions != null}">
|
||||
<a:panel id="more-actions-panel" rendered="#{DialogManager.moreActionsId != null}">
|
||||
<td style="padding-left: 4px" width="80">
|
||||
<a:menu id="more_actions_menu" itemSpacing="4" image="/images/icons/menu.gif"
|
||||
menuStyleClass="moreActionsMenu" style="white-space:nowrap"
|
||||
label="#{DialogManager.moreActionsMenuLabel}">
|
||||
<r:actions id="more_actions_menu_items" value="#{DialogManager.moreActions}"
|
||||
<r:actions id="more_actions_menu_items" value="#{DialogManager.moreActionsId}"
|
||||
context="#{DialogManager.actionsContext}" />
|
||||
</a:menu>
|
||||
</td>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
<f:verbatim>
|
||||
<table cellpadding="2" cellspacing="2" border="0">
|
||||
</f:verbatim>
|
||||
<a:panel id="delete-panel" rendered="#{GroupsProperties.actionGroupItems != 0}"><f:verbatim>
|
||||
<a:panel id="delete-panel" rendered="#{DialogManager.bean.numItemsInGroup != 0}"><f:verbatim>
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
|
||||
@@ -46,7 +46,7 @@
|
||||
<td class="mainSubText">
|
||||
</f:verbatim>
|
||||
<h:outputFormat value="#{msg.delete_group_warning}">
|
||||
<f:param value="#{GroupsProperties.actionGroupItems}" />
|
||||
<f:param value="#{DialogManager.bean.numItemsInGroup}" />
|
||||
</h:outputFormat>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
@@ -62,7 +62,7 @@
|
||||
<td class="mainSubTitle">
|
||||
</f:verbatim>
|
||||
<h:outputFormat value="#{msg.delete_group_confirm}">
|
||||
<f:param value="#{GroupsProperties.actionGroupName}"/>
|
||||
<f:param value="#{DialogManager.bean.groupName}"/>
|
||||
</h:outputFormat>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
|
@@ -27,170 +27,43 @@
|
||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
||||
|
||||
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
|
||||
<%@ page isELIgnored="false" %>
|
||||
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
|
||||
|
||||
<r:page titleId="title_groups_list">
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptcharset="UTF-8" id="groups">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#dfe6ed">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="logo" url="/images/icons/group_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.groups_management}" /></div>
|
||||
<div class="mainSubTitle">
|
||||
<%-- show either root message or the current group name --%>
|
||||
<h:outputText value="#{msg.root_groups}" rendered="#{GroupsProperties.group == null}" />
|
||||
<h:outputText value="#{GroupsProperties.groupName}" rendered="#{GroupsProperties.group != null}" />
|
||||
</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.groups_description}" /></div>
|
||||
</td>
|
||||
|
||||
<td align=right>
|
||||
<%-- Create actions menu --%>
|
||||
<a:menu id="createMenu" itemSpacing="4" label="#{msg.create_options}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
|
||||
<a:booleanEvaluator value="#{GroupsProperties.group == null}">
|
||||
<a:actionLink value="#{msg.new_group}" image="/images/icons/create_group.gif" action="dialog:createGroup" actionListener="#{GroupsDialog.clearGroupAction}" />
|
||||
</a:booleanEvaluator>
|
||||
<a:booleanEvaluator value="#{GroupsProperties.group != null}">
|
||||
<a:actionLink value="#{msg.new_sub_group}" image="/images/icons/create_group.gif" action="dialog:createGroup" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{GroupsProperties.group}" />
|
||||
</a:actionLink>
|
||||
</a:booleanEvaluator>
|
||||
</a:menu>
|
||||
</td>
|
||||
<td style="padding-left:4px" width=80>
|
||||
<%-- More actions menu --%>
|
||||
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
|
||||
<a:booleanEvaluator value="#{GroupsProperties.group != null}">
|
||||
<a:actionLink value="#{msg.new_sub_group}" image="/images/icons/create_group.gif" action="dialog:createGroup" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{GroupsProperties.group}" />
|
||||
</a:actionLink>
|
||||
<a:actionLink value="#{msg.delete_group}" image="/images/icons/delete_group.gif" action="dialog:deleteGroup" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{GroupsProperties.group}" />
|
||||
</a:actionLink>
|
||||
<%-- TODO: should this be add user(S) - multiple required on generic picker? --%>
|
||||
<a:actionLink value="#{msg.add_user}" image="/images/icons/add_user.gif" action="dialog:addUsers" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{GroupsProperties.group}" />
|
||||
</a:actionLink>
|
||||
</a:booleanEvaluator>
|
||||
</a:menu>
|
||||
</td>
|
||||
<td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td>
|
||||
<td style="padding-left:4px" width=80 valign=middle>
|
||||
<%-- Filter settings --%>
|
||||
<a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" selectedImage="/images/icons/filter.gif"
|
||||
value="#{GroupsProperties.filterMode}" actionListener="#{GroupsDialog.filterModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
|
||||
<a:listItem value="children" label="#{msg.group_filter_children}" />
|
||||
<a:listItem value="all" label="#{msg.group_filter_all}" />
|
||||
</a:modeList>
|
||||
</td>
|
||||
<td class="separator" width=1><img src="<%=request.getContextPath()%>/images/parts/dotted_separator.gif" border=0 height=29 width=1></td>
|
||||
<td style="padding-left:4px" width=80 valign=middle>
|
||||
<%-- View mode settings --%>
|
||||
<a:modeList itemSpacing="3" iconColumnWidth="20" selectedStyleClass="statusListHighlight" selectedImage="/images/icons/Details.gif"
|
||||
value="#{GroupsProperties.viewMode}" actionListener="#{GroupsDialog.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
|
||||
<a:listItem value="icons" label="#{msg.group_icons}" />
|
||||
<a:listItem value="details" label="#{msg.group_details}" />
|
||||
</a:modeList>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
<h:outputText value="<div style='padding-left: 8px; padding-top: 4px; padding-bottom: 4px'>" escape="false" />
|
||||
|
||||
<%-- Group Path Breadcrumb --%>
|
||||
<div style="padding-left:8px;padding-top:4px;padding-bottom:4px">
|
||||
<a:breadcrumb value="#{GroupsDialog.location}" styleClass="title" />
|
||||
</div>
|
||||
<a:breadcrumb value="#{DialogManager.bean.location}" styleClass="title" />
|
||||
|
||||
<h:outputText value="</div><div style='padding: 4px;'>" escape="false" />
|
||||
|
||||
<%-- Groups List --%>
|
||||
<div style="padding:4px">
|
||||
<a:panel id="groups-panel" border="innerwhite" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.groups}">
|
||||
|
||||
<a:panel id="groups-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.groups}">
|
||||
|
||||
<a:richList id="groups-list" binding="#{GroupsProperties.groupsRichList}" viewMode="#{GroupsProperties.viewMode}" pageSize="12"
|
||||
<a:richList id="groups-list" binding="#{DialogManager.bean.groupsRichList}" viewMode="#{DialogManager.bean.viewMode}" pageSize="12"
|
||||
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
value="#{GroupsDialog.groups}" var="r" initialSortColumn="name" initialSortDescending="true">
|
||||
value="#{DialogManager.bean.groups}" var="r" initialSortColumn="name" initialSortDescending="true">
|
||||
|
||||
<%-- Primary column for icons view mode --%>
|
||||
<a:column primary="true" style="padding:2px;text-align:left;vertical-align:top" rendered="#{GroupsProperties.viewMode == 'icons'}">
|
||||
<a:column primary="true" style="padding:2px;text-align:left;vertical-align:top" rendered="#{DialogManager.bean.viewMode == 'icons'}">
|
||||
<f:facet name="large-icon">
|
||||
<a:actionLink value="#{r.name}" image="/images/icons/group_large.gif" actionListener="#{GroupsDialog.clickGroup}" showLink="false">
|
||||
<a:actionLink value="#{r.name}" image="/images/icons/group_large.gif" actionListener="#{DialogManager.bean.clickGroup}" showLink="false">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</f:facet>
|
||||
<a:actionLink value="#{r.name}" actionListener="#{GroupsDialog.clickGroup}" styleClass="header">
|
||||
<a:actionLink value="#{r.name}" actionListener="#{DialogManager.bean.clickGroup}" styleClass="header">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</a:column>
|
||||
|
||||
<%-- Primary column for details view mode --%>
|
||||
<a:column primary="true" style="padding:2px;text-align:left" rendered="#{GroupsProperties.viewMode == 'details'}">
|
||||
<a:column primary="true" style="padding:2px;text-align:left" rendered="#{DialogManager.bean.viewMode == 'details'}">
|
||||
<f:facet name="small-icon">
|
||||
<a:actionLink value="#{r.name}" image="/images/icons/group.gif" actionListener="#{GroupsDialog.clickGroup}" showLink="false">
|
||||
<a:actionLink value="#{r.name}" image="/images/icons/group.gif" actionListener="#{DialogManager.bean.clickGroup}" showLink="false">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</f:facet>
|
||||
<f:facet name="header">
|
||||
<a:sortLink label="#{msg.identifier}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||
</f:facet>
|
||||
<a:actionLink value="#{r.name}" actionListener="#{GroupsDialog.clickGroup}">
|
||||
<a:actionLink value="#{r.name}" actionListener="#{DialogManager.bean.clickGroup}">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</a:column>
|
||||
@@ -200,35 +73,24 @@
|
||||
<f:facet name="header">
|
||||
<h:outputText value="#{msg.actions}"/>
|
||||
</f:facet>
|
||||
<a:actionLink value="#{msg.new_sub_group}" image="/images/icons/create_group.gif" showLink="false" styleClass="inlineAction" action="dialog:createGroup" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
<a:actionLink value="#{msg.add_user}" image="/images/icons/add_user.gif" showLink="false" styleClass="inlineAction" action="dialog:addUsers" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
<a:actionLink value="#{msg.delete}" image="/images/icons/delete_group.gif" showLink="false" styleClass="inlineAction" action="dialog:deleteGroup" actionListener="#{GroupsDialog.setupGroupAction}">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
<r:actions id="inline-group-actions" value="group_inline_actions" context="#{r}" showLink="false" styleClass="inlineAction" />
|
||||
</a:column>
|
||||
|
||||
<a:dataPager/>
|
||||
</a:richList>
|
||||
|
||||
</a:panel>
|
||||
|
||||
</div>
|
||||
<h:outputText value="</div><div style='padding: 4px; margin-bottom: 6px;'>" escape="false" />
|
||||
|
||||
<%-- Users in Group list --%>
|
||||
<div style="padding:4px">
|
||||
<a:panel id="users-panel" border="innerwhite" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.users}">
|
||||
|
||||
<a:panel id="users-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.users}">
|
||||
|
||||
<a:richList id="users-list" binding="#{GroupsProperties.usersRichList}" viewMode="#{GroupsProperties.viewMode}" pageSize="12"
|
||||
<a:richList id="users-list" binding="#{DialogManager.bean.usersRichList}" viewMode="#{DialogManager.bean.viewMode}" pageSize="12"
|
||||
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
value="#{GroupsDialog.users}" var="r" initialSortColumn="name" initialSortDescending="true">
|
||||
value="#{DialogManager.bean.users}" var="r" initialSortColumn="name" initialSortDescending="true">
|
||||
|
||||
<%-- Primary column for icons view mode --%>
|
||||
<a:column primary="true" style="padding:2px;text-align:left;vertical-align:top;font-weight: bold;" rendered="#{GroupsProperties.viewMode == 'icons'}">
|
||||
<a:column primary="true" style="padding:2px;text-align:left;vertical-align:top;font-weight: bold;" rendered="#{DialogManager.bean.viewMode == 'icons'}">
|
||||
<f:facet name="large-icon">
|
||||
<h:graphicImage alt="#{r.name}" value="/images/icons/user_large.gif" />
|
||||
</f:facet>
|
||||
@@ -236,7 +98,7 @@
|
||||
</a:column>
|
||||
|
||||
<%-- Primary column for details view mode --%>
|
||||
<a:column primary="true" style="padding:2px;text-align:left;" rendered="#{GroupsProperties.viewMode == 'details'}">
|
||||
<a:column primary="true" style="padding:2px;text-align:left;" rendered="#{DialogManager.bean.viewMode == 'details'}">
|
||||
<f:facet name="small-icon">
|
||||
<h:graphicImage alt="#{r.name}" value="/images/icons/person.gif" />
|
||||
</f:facet>
|
||||
@@ -259,61 +121,13 @@
|
||||
<f:facet name="header">
|
||||
<h:outputText value="#{msg.actions}"/>
|
||||
</f:facet>
|
||||
<a:actionLink value="#{msg.remove}" image="/images/icons/remove_user.gif" showLink="false" styleClass="inlineAction" actionListener="#{GroupsDialog.removeUser}">
|
||||
<a:actionLink value="#{msg.remove}" image="/images/icons/remove_user.gif" showLink="false" styleClass="inlineAction" actionListener="#{DialogManager.bean.removeUser}">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</a:column>
|
||||
|
||||
<a:dataPager/>
|
||||
</a:richList>
|
||||
|
||||
</a:panel>
|
||||
|
||||
<div>
|
||||
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Error Messages --%>
|
||||
<tr valign="top">
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<%-- messages tag to show messages not handled by other specific message tags --%>
|
||||
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
||||
<h:outputText value="</div>" escape="false" />
|
@@ -75,7 +75,7 @@
|
||||
<tr>
|
||||
<td></f:verbatim><h:outputText value="#{msg.identifier}" /><f:verbatim>:</td>
|
||||
<td width="100%">
|
||||
</f:verbatim><h:inputText id="name" value="#{GroupsProperties.name}" size="35" maxlength="1024" validator="#{DialogManager.bean.validateGroupName}"
|
||||
</f:verbatim><h:inputText id="name" value="#{DialogManager.bean.name}" size="35" maxlength="1024" validator="#{DialogManager.bean.validateGroupName}"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/><f:verbatim> *
|
||||
</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user