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:
@@ -655,12 +655,60 @@
|
|||||||
<image>/images/icons/new_edition_icon.gif</image>
|
<image>/images/icons/new_edition_icon.gif</image>
|
||||||
<action>wizard:newEdition</action>
|
<action>wizard:newEdition</action>
|
||||||
</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
|
<!-- 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 -->
|
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
|
<!-- the component is responsible for making the context Node object available with name
|
||||||
of 'actionContext' so the actions can access it directly to get properties -->
|
of 'actionContext' so the actions can access it directly to get properties -->
|
||||||
|
|
||||||
<!-- Action for adding content - quick upload -->
|
<!-- Action for adding content - quick upload -->
|
||||||
<action-group id="add_content_menu">
|
<action-group id="add_content_menu">
|
||||||
<style>white-space:nowrap</style>
|
<style>white-space:nowrap</style>
|
||||||
@@ -834,6 +882,22 @@
|
|||||||
<action idref="reset_navigator" />
|
<action idref="reset_navigator" />
|
||||||
</action-group>
|
</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>
|
</actions>
|
||||||
</config>
|
</config>
|
||||||
|
|
||||||
|
@@ -288,6 +288,11 @@
|
|||||||
icon="/images/icons/edit_large.gif" title-id="title_edit_file"
|
icon="/images/icons/edit_large.gif" title-id="title_edit_file"
|
||||||
description-id="editfile_description"/>
|
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"
|
<dialog name="deleteGroup" page="/jsp/groups/delete-group.jsp" managed-bean="DeleteGroupDialog"
|
||||||
icon="/images/icons/delete_group_large.gif" title-id="delete_group"
|
icon="/images/icons/delete_group_large.gif" title-id="delete_group"
|
||||||
description-id="delete_group_info"/>
|
description-id="delete_group_info"/>
|
||||||
|
@@ -1161,4 +1161,14 @@ public class DocumentDetailsBean extends BaseDetailsBean implements IDialogBean
|
|||||||
{
|
{
|
||||||
return baseDialogBean.getActionsContext();
|
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();
|
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();
|
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.
|
* @param browseBean The BrowseBean to set.
|
||||||
*/
|
*/
|
||||||
|
@@ -74,6 +74,17 @@ public final class DialogManager
|
|||||||
{
|
{
|
||||||
// store the parameters
|
// store the parameters
|
||||||
this.paramsToApply = ((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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,9 +297,18 @@ public final class DialogManager
|
|||||||
*
|
*
|
||||||
* @return The action group id
|
* @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
|
* @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
|
* @return Object to use as the context for actions
|
||||||
*/
|
*/
|
||||||
public Object getActionsContext();
|
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.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
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.PermissionService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.web.app.Application;
|
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.bean.repository.Repository;
|
||||||
import org.alfresco.web.ui.common.SortableSelectItem;
|
import org.alfresco.web.ui.common.SortableSelectItem;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
@@ -58,48 +59,57 @@ import org.alfresco.web.ui.common.component.UIGenericPicker;
|
|||||||
* @author YanO
|
* @author YanO
|
||||||
* @author gavinc
|
* @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 */
|
/** selected users to be added to a group */
|
||||||
private List<UserAuthorityDetails> usersForGroup;
|
protected List<UserAuthorityDetails> usersForGroup;
|
||||||
|
|
||||||
/** datamodel for table of users added to group */
|
/** datamodel for table of users added to group */
|
||||||
private DataModel usersDataModel = null;
|
protected DataModel usersDataModel = null;
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Dialog implementation
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Map<String, String> parameters)
|
public void init(Map<String, String> parameters)
|
||||||
{
|
{
|
||||||
super.init(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>();
|
usersForGroup = new ArrayList<UserAuthorityDetails>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
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)
|
||||||
{
|
{
|
||||||
// add each selected user to the current group in turn
|
this.authService.addAuthority(this.group, wrapper.getAuthority());
|
||||||
for (UserAuthorityDetails wrapper : this.usersForGroup)
|
|
||||||
{
|
|
||||||
properties.getAuthService().addAuthority(properties.getActionGroup(), 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;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getContainerSubTitle()
|
public String getContainerSubTitle()
|
||||||
{
|
{
|
||||||
return properties.getActionGroupName();
|
return this.groupName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -108,12 +118,37 @@ public class AddUsersDialog extends GroupsDialog
|
|||||||
return false;
|
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
|
* 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
|
* 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
|
// build xpath to match available User/Person objects
|
||||||
ServiceRegistry services = Repository.getServiceRegistry(context);
|
ServiceRegistry services = Repository.getServiceRegistry(context);
|
||||||
NodeRef peopleRef = properties.getPersonService().getPeopleContainer();
|
NodeRef peopleRef = personService.getPeopleContainer();
|
||||||
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains +
|
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains +
|
||||||
"%', false)" + " or " + "like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" +
|
"%', false)" + " or " + "like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" +
|
||||||
"lastName, '%" + contains + "%', false)]";
|
"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
|
* 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);
|
StringBuilder label = new StringBuilder(48);
|
||||||
|
|
||||||
// build a display label showing the user person name
|
// 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
|
// 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 firstName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
|
||||||
String lastName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
String lastName = (String) this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
||||||
|
|
||||||
@@ -248,19 +286,4 @@ public class AddUsersDialog extends GroupsDialog
|
|||||||
this.usersForGroup.remove(wrapper);
|
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,54 +32,57 @@ import javax.faces.component.UIComponent;
|
|||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
import javax.faces.validator.ValidatorException;
|
import javax.faces.validator.ValidatorException;
|
||||||
|
|
||||||
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.GroupsDialog;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
|
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
|
||||||
import org.alfresco.web.ui.common.Utils;
|
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_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";
|
private static final String MSG_BUTTON_NEW_GROUP = "new_group";
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Dialog implementation
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Map<String, String> parameters)
|
public void init(Map<String, String> parameters)
|
||||||
{
|
{
|
||||||
super.init(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
|
@Override
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||||
{
|
{
|
||||||
try
|
// create new Group using Authentication Service
|
||||||
|
String groupName = this.authService.getName(AuthorityType.GROUP, this.name);
|
||||||
|
if (this.authService.authorityExists(groupName) == false)
|
||||||
{
|
{
|
||||||
// create new Group using Authentication Service
|
this.authService.createAuthority(AuthorityType.GROUP, this.parentGroup, this.name);
|
||||||
String groupName = properties.getAuthService().getName(AuthorityType.GROUP, properties.getName());
|
|
||||||
if (properties.getAuthService().authorityExists(groupName) == false)
|
|
||||||
{
|
|
||||||
properties.getAuthService().createAuthority(AuthorityType.GROUP, properties.getActionGroup(), properties.getName());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_EXISTS));
|
|
||||||
outcome = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Throwable err)
|
else
|
||||||
{
|
{
|
||||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_EXISTS));
|
||||||
context, Repository.ERROR_GENERIC), err.getMessage()), err);
|
|
||||||
outcome = null;
|
outcome = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outcome == null)
|
|
||||||
{
|
|
||||||
isFinished = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,17 +97,38 @@ public class CreateGroupDialog extends GroupsDialog
|
|||||||
{
|
{
|
||||||
String subtitle = null;
|
String subtitle = null;
|
||||||
|
|
||||||
if (properties.getActionGroup() != null)
|
if (this.parentGroupName != null)
|
||||||
{
|
{
|
||||||
subtitle = properties.getActionGroupName();
|
subtitle = this.parentGroupName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
subtitle = properties.getGroupName();
|
subtitle = Application.getMessage(FacesContext.getCurrentInstance(), MSG_ROOT_GROUPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return subtitle;
|
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
|
public void validateGroupName(FacesContext context, UIComponent component, Object value) throws ValidatorException
|
||||||
{
|
{
|
||||||
@@ -112,10 +136,9 @@ public class CreateGroupDialog extends GroupsDialog
|
|||||||
|
|
||||||
if (name.indexOf('\'') != -1 || name.indexOf('"') != -1 || name.indexOf('\\') != -1)
|
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[] { "', \", \\" });
|
new Object[] { "', \", \\" });
|
||||||
throw new ValidatorException(new FacesMessage(err));
|
throw new ValidatorException(new FacesMessage(err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -24,57 +24,106 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.web.bean.groups;
|
package org.alfresco.web.bean.groups;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
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.app.Application;
|
||||||
import org.alfresco.web.bean.GroupsDialog;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
|
||||||
import org.alfresco.web.ui.common.Utils;
|
|
||||||
|
|
||||||
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";
|
||||||
|
|
||||||
private static final String MSG_DELETE_GROUP = "delete_group";
|
// ------------------------------------------------------------------------------
|
||||||
|
// Dialog implementation
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Map<String, String> parameters)
|
||||||
|
{
|
||||||
|
super.init(parameters);
|
||||||
|
|
||||||
@Override
|
// retrieve parameters
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
this.group = parameters.get(GroupsDialog.PARAM_GROUP);
|
||||||
{
|
this.groupName = parameters.get(GroupsDialog.PARAM_GROUP_NAME);
|
||||||
try
|
|
||||||
{
|
// calculate the number of items the givev group has
|
||||||
// delete group using the Authentication Service
|
if (this.group != null)
|
||||||
properties.getAuthService().deleteAuthority(properties.getActionGroup());
|
{
|
||||||
removeFromBreadcrumb(properties.getActionGroup());
|
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
|
||||||
|
{
|
||||||
|
// delete group using the Authentication Service
|
||||||
|
this.authService.deleteAuthority(this.group);
|
||||||
|
|
||||||
|
return outcome;
|
||||||
|
}
|
||||||
|
|
||||||
// clear action context
|
@Override
|
||||||
setActionGroup(null);
|
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||||
}
|
{
|
||||||
catch (Throwable err)
|
// 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
|
||||||
// rollback the transaction
|
context.getExternalContext().getRequestMap().put(
|
||||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
GroupsDialog.KEY_GROUP, this.group);
|
||||||
outcome = null;
|
|
||||||
}
|
return outcome;
|
||||||
return outcome;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getFinishButtonDisabled()
|
public boolean getFinishButtonDisabled()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFinishButtonLabel()
|
public String getFinishButtonLabel()
|
||||||
{
|
{
|
||||||
return Application.getMessage(FacesContext.getCurrentInstance(), BUTTON_DELETE);
|
return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DELETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getContainerTitle()
|
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:
|
* the FLOSS exception, and it is also available here:
|
||||||
* http://www.alfresco.com/legal/licensing"
|
* http://www.alfresco.com/legal/licensing"
|
||||||
*/
|
*/
|
||||||
package org.alfresco.web.bean;
|
package org.alfresco.web.bean.groups;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -38,18 +38,23 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
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.AuthorityType;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.context.IContextListener;
|
import org.alfresco.web.app.context.IContextListener;
|
||||||
import org.alfresco.web.app.context.UIContextService;
|
import org.alfresco.web.app.context.UIContextService;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
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.bean.repository.Repository;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
|
import org.alfresco.web.ui.common.component.IBreadcrumbHandler;
|
||||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||||
import org.alfresco.web.ui.common.component.UIBreadcrumb;
|
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.UIModeList;
|
||||||
|
import org.alfresco.web.ui.common.component.data.UIRichList;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -58,12 +63,48 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
*
|
*
|
||||||
* @author Kevin Roast
|
* @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 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);
|
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)
|
||||||
* @param filterMode The filterMode to set.
|
{
|
||||||
*/
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
public void setFilterMode(String filterMode)
|
public void setFilterMode(String filterMode)
|
||||||
{
|
{
|
||||||
properties.setFilterMode(filterMode);
|
this.filterMode = filterMode;
|
||||||
|
|
||||||
// clear datalist cache ready to change results based on filter setting
|
// clear datalist cache ready to change results based on filter setting
|
||||||
contextUpdated();
|
contextUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// ------------------------------------------------------------------------------
|
||||||
* @param group Set the Group to be used for the current action screen.
|
// ChangeViewSupport implementation
|
||||||
*/
|
|
||||||
public void setActionGroup(String group)
|
public List<UIListItem> getViewItems()
|
||||||
{
|
{
|
||||||
properties.setActionGroup(group);
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
List<UIListItem> items = new ArrayList<UIListItem>(2);
|
||||||
|
|
||||||
if (group != null)
|
UIListItem item1 = new UIListItem();
|
||||||
{
|
item1.setValue(VIEW_ICONS);
|
||||||
// calculate action group metadata
|
item1.setLabel(Application.getMessage(context, LABEL_VIEW_ICONS));
|
||||||
properties.setActionGroupName(properties.getAuthService().getShortName(group));
|
items.add(item1);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear value used by Create Group form
|
UIListItem item2 = new UIListItem();
|
||||||
properties.setName(null);
|
item2.setValue(VIEW_DETAILS);
|
||||||
|
item2.setLabel(Application.getMessage(context, LABEL_VIEW_DETAILS));
|
||||||
|
items.add(item2);
|
||||||
|
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void viewModeChanged(ActionEvent event)
|
||||||
* 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)
|
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
UIModeList viewList = (UIModeList)event.getComponent();
|
||||||
logger.debug("Setting current group: " + group);
|
|
||||||
|
|
||||||
// set the current Group Authority for our UI context operations
|
// update view mode from user selection
|
||||||
properties.setGroup(group);
|
setViewMode(viewList.getValue().toString());
|
||||||
properties.setGroupName(groupName);
|
}
|
||||||
|
|
||||||
// inform that the UI needs updating after this change
|
public String getViewMode()
|
||||||
contextUpdated();
|
{
|
||||||
|
return this.viewMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViewMode(String viewMode)
|
||||||
|
{
|
||||||
|
this.viewMode = viewMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// 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()
|
public List<IBreadcrumbHandler> getLocation()
|
||||||
{
|
{
|
||||||
if (properties.getLocation() == null)
|
if (this.location == null)
|
||||||
{
|
{
|
||||||
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
|
List<IBreadcrumbHandler> loc = new ArrayList<IBreadcrumbHandler>(8);
|
||||||
loc.add(new GroupBreadcrumbHandler(null,
|
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();
|
tx.begin();
|
||||||
|
|
||||||
Set<String> authorities;
|
Set<String> authorities;
|
||||||
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
|
boolean immediate = (this.filterMode.equals(FILTER_CHILDREN));
|
||||||
if (properties.getGroup() == null)
|
if (this.group == null)
|
||||||
{
|
{
|
||||||
// root groups
|
// root groups
|
||||||
if (immediate == true)
|
if (immediate == true)
|
||||||
{
|
{
|
||||||
authorities = properties.getAuthService().getAllRootAuthorities(AuthorityType.GROUP);
|
authorities = this.authService.getAllRootAuthorities(AuthorityType.GROUP);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
authorities = properties.getAuthService().getAllAuthorities(AuthorityType.GROUP);
|
authorities = this.authService.getAllAuthorities(AuthorityType.GROUP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// sub-group of an existing group
|
// 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());
|
groups = new ArrayList<Map>(authorities.size());
|
||||||
for (String authority : authorities)
|
for (String authority : authorities)
|
||||||
{
|
{
|
||||||
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
|
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("name", name);
|
||||||
authMap.put("id", authority);
|
authMap.put("id", authority);
|
||||||
|
authMap.put("group", authority);
|
||||||
|
authMap.put("groupName", name);
|
||||||
|
|
||||||
groups.add(authMap);
|
groups.add(authMap);
|
||||||
}
|
}
|
||||||
@@ -230,31 +385,31 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
tx = Repository.getUserTransaction(context);
|
tx = Repository.getUserTransaction(context, true);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
Set<String> authorities;
|
Set<String> authorities;
|
||||||
if (properties.getGroup() == null)
|
if (this.group == null)
|
||||||
{
|
{
|
||||||
authorities = Collections.<String>emptySet();
|
authorities = Collections.<String>emptySet();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// users of an existing group
|
// users of an existing group
|
||||||
boolean immediate = (properties.getFilterMode().equals(FILTER_CHILDREN));
|
boolean immediate = (this.filterMode.equals(FILTER_CHILDREN));
|
||||||
authorities = properties.getAuthService().getContainedAuthorities(AuthorityType.USER, properties.getGroup(), immediate);
|
authorities = this.authService.getContainedAuthorities(AuthorityType.USER, this.group, immediate);
|
||||||
}
|
}
|
||||||
users = new ArrayList<Map>(authorities.size());
|
users = new ArrayList<Map>(authorities.size());
|
||||||
for (String authority : authorities)
|
for (String authority : authorities)
|
||||||
{
|
{
|
||||||
Map<String, String> authMap = new HashMap<String, String>(3, 1.0f);
|
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("userName", userName);
|
||||||
authMap.put("id", authority);
|
authMap.put("id", authority);
|
||||||
|
|
||||||
// get Person details for this 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 firstName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
|
||||||
String lastName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
String lastName = (String)this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
|
||||||
|
|
||||||
@@ -283,37 +438,28 @@ 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)
|
protected void setCurrentGroup(String group, String groupName)
|
||||||
{
|
{
|
||||||
UIActionLink link = (UIActionLink)event.getComponent();
|
if (logger.isDebugEnabled())
|
||||||
Map<String, String> params = link.getParameterMap();
|
logger.debug("Setting current group: " + group);
|
||||||
String group = params.get("id");
|
|
||||||
if (group != null && group.length() != 0)
|
|
||||||
{
|
|
||||||
if (logger.isDebugEnabled())
|
|
||||||
logger.debug("Setup for action, setting current Group to: " + group);
|
|
||||||
|
|
||||||
// prepare a node for the action context
|
|
||||||
setActionGroup(group);
|
|
||||||
|
|
||||||
// clear datalist cache ready from return from action dialog
|
|
||||||
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
|
// set the current Group Authority for our UI context operations
|
||||||
|
this.group = group;
|
||||||
|
this.groupName = groupName;
|
||||||
|
|
||||||
|
// inform that the UI needs updating after this change
|
||||||
contextUpdated();
|
contextUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Action handlers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action called when a Group folder is clicked.
|
* Action called when a Group folder is clicked.
|
||||||
* Navigate into the Group and show child Groups and child Users.
|
* Navigate into the Group and show child Groups and child Users.
|
||||||
@@ -340,9 +486,17 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
|||||||
String authority = params.get("id");
|
String authority = params.get("id");
|
||||||
if (authority != null && authority.length() != 0)
|
if (authority != null && authority.length() != 0)
|
||||||
{
|
{
|
||||||
|
UserTransaction tx = null;
|
||||||
try
|
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
|
// refresh UI after change
|
||||||
contextUpdated();
|
contextUpdated();
|
||||||
@@ -351,45 +505,26 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
|||||||
{
|
{
|
||||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
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
|
// Helpers
|
||||||
*/
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the breadcrumb with the clicked Group location
|
* Update the breadcrumb with the clicked Group location
|
||||||
*/
|
*/
|
||||||
private void updateUILocation(String group)
|
protected void updateUILocation(String group)
|
||||||
{
|
{
|
||||||
String groupName = properties.getAuthService().getShortName(group);
|
String groupName = this.authService.getShortName(group);
|
||||||
properties.getLocation().add(new GroupBreadcrumbHandler(group, groupName));
|
this.location.add(new GroupBreadcrumbHandler(group, groupName));
|
||||||
this.setCurrentGroup(group, groupName);
|
this.setCurrentGroup(group, groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFromBreadcrumb(String group)
|
protected void removeFromBreadcrumb(String group)
|
||||||
{
|
{
|
||||||
|
|
||||||
// remove this node from the breadcrumb if required
|
// remove this node from the breadcrumb if required
|
||||||
List<IBreadcrumbHandler> location = getLocation();
|
List<IBreadcrumbHandler> location = getLocation();
|
||||||
GroupBreadcrumbHandler handler = (GroupBreadcrumbHandler) location.get(location.size() - 1);
|
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
|
// IContextListener implementation
|
||||||
|
|
||||||
@@ -426,8 +555,15 @@ public class GroupsDialog extends BaseDialogBean implements IContextListener
|
|||||||
logger.debug("Invalidating Group Management Components...");
|
logger.debug("Invalidating Group Management Components...");
|
||||||
|
|
||||||
// force a requery of the richlist dataset
|
// force a requery of the richlist dataset
|
||||||
properties.getGroupsRichList().setValue(null);
|
if (this.groupsRichList != null)
|
||||||
properties.getUsersRichList().setValue(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
|
// All group breadcrumb elements relate to a Group
|
||||||
// when selected we set the current Group Id and return
|
// when selected we set the current Group Id and return
|
||||||
setCurrentGroup(this.Group, this.Label);
|
setCurrentGroup(this.Group, this.Label);
|
||||||
properties.setLocation( (List)breadcrumb.getValue() );
|
location = (List<IBreadcrumbHandler>)breadcrumb.getValue();
|
||||||
|
|
||||||
return null;
|
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)
|
if (component instanceof UIActionLink)
|
||||||
{
|
{
|
||||||
// store the parameters
|
// 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>
|
<description>
|
||||||
The bean that holds state for the Groups Management screens.
|
The bean that holds state for the Groups Management screens.
|
||||||
</description>
|
</description>
|
||||||
<managed-bean-name>GroupsProperties</managed-bean-name>
|
<managed-bean-name>GroupsDialog</managed-bean-name>
|
||||||
<managed-bean-class>org.alfresco.web.bean.groups.GroupsProperties</managed-bean-class>
|
<managed-bean-class>org.alfresco.web.bean.groups.GroupsDialog</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>nodeService</property-name>
|
||||||
|
<value>#{NodeService}</value>
|
||||||
|
</managed-property>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>authService</property-name>
|
<property-name>authService</property-name>
|
||||||
<value>#{AuthorityService}</value>
|
<value>#{AuthorityService}</value>
|
||||||
@@ -575,23 +579,6 @@
|
|||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</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>
|
<managed-bean>
|
||||||
<description>
|
<description>
|
||||||
The bean that holds state for the Category Management screens.
|
The bean that holds state for the Category Management screens.
|
||||||
@@ -4371,8 +4358,12 @@
|
|||||||
<value>#{NodeService}</value>
|
<value>#{NodeService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>properties</property-name>
|
<property-name>authService</property-name>
|
||||||
<value>#{GroupsProperties}</value>
|
<value>#{AuthorityService}</value>
|
||||||
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>personService</property-name>
|
||||||
|
<value>#{PersonService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
@@ -4384,12 +4375,8 @@
|
|||||||
</managed-bean-class>
|
</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>nodeService</property-name>
|
<property-name>authService</property-name>
|
||||||
<value>#{NodeService}</value>
|
<value>#{AuthorityService}</value>
|
||||||
</managed-property>
|
|
||||||
<managed-property>
|
|
||||||
<property-name>properties</property-name>
|
|
||||||
<value>#{GroupsProperties}</value>
|
|
||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
@@ -4401,12 +4388,8 @@
|
|||||||
</managed-bean-class>
|
</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>nodeService</property-name>
|
<property-name>authService</property-name>
|
||||||
<value>#{NodeService}</value>
|
<value>#{AuthorityService}</value>
|
||||||
</managed-property>
|
|
||||||
<managed-property>
|
|
||||||
<property-name>properties</property-name>
|
|
||||||
<value>#{GroupsProperties}</value>
|
|
||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
|
@@ -86,28 +86,28 @@
|
|||||||
<table cellspacing="4" cellpadding="1" width="100%">
|
<table cellspacing="4" cellpadding="1" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<%-- Main actions --%>
|
<%-- 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;">
|
<td style="white-space: nowrap;">
|
||||||
<r:actions id="main_actions_list" rendered="#{DialogManager.actionsAsMenu == false}"
|
<r:actions id="main_actions_list" rendered="#{DialogManager.actionsAsMenu == false}"
|
||||||
styleClass="dialogMainActions" value="#{DialogManager.actions}"
|
styleClass="dialogMainActions" value="#{DialogManager.actionsId}"
|
||||||
context="#{DialogManager.actionsContext}" />
|
context="#{DialogManager.actionsContext}" />
|
||||||
|
|
||||||
<a:menu id="main_actions_menu" rendered="#{DialogManager.actionsAsMenu == true}"
|
<a:menu id="main_actions_menu" rendered="#{DialogManager.actionsAsMenu == true}"
|
||||||
itemSpacing="4" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
|
itemSpacing="4" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu"
|
||||||
style="white-space: nowrap" label="#{DialogManager.actionsMenuLabel}">
|
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}" />
|
context="#{DialogManager.actionsContext}" />
|
||||||
</a:menu>
|
</a:menu>
|
||||||
</td>
|
</td>
|
||||||
</a:panel>
|
</a:panel>
|
||||||
|
|
||||||
<%-- More actions menu --%>
|
<%-- 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">
|
<td style="padding-left: 4px" width="80">
|
||||||
<a:menu id="more_actions_menu" itemSpacing="4" image="/images/icons/menu.gif"
|
<a:menu id="more_actions_menu" itemSpacing="4" image="/images/icons/menu.gif"
|
||||||
menuStyleClass="moreActionsMenu" style="white-space:nowrap"
|
menuStyleClass="moreActionsMenu" style="white-space:nowrap"
|
||||||
label="#{DialogManager.moreActionsMenuLabel}">
|
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}" />
|
context="#{DialogManager.actionsContext}" />
|
||||||
</a:menu>
|
</a:menu>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
<table cellpadding="2" cellspacing="2" border="0">
|
<table cellpadding="2" cellspacing="2" border="0">
|
||||||
</f:verbatim>
|
</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>
|
<tr>
|
||||||
<td width="100%" valign="top">
|
<td width="100%" valign="top">
|
||||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
|
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc"); %>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<td class="mainSubText">
|
<td class="mainSubText">
|
||||||
</f:verbatim>
|
</f:verbatim>
|
||||||
<h:outputFormat value="#{msg.delete_group_warning}">
|
<h:outputFormat value="#{msg.delete_group_warning}">
|
||||||
<f:param value="#{GroupsProperties.actionGroupItems}" />
|
<f:param value="#{DialogManager.bean.numItemsInGroup}" />
|
||||||
</h:outputFormat>
|
</h:outputFormat>
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
</td>
|
</td>
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
<td class="mainSubTitle">
|
<td class="mainSubTitle">
|
||||||
</f:verbatim>
|
</f:verbatim>
|
||||||
<h:outputFormat value="#{msg.delete_group_confirm}">
|
<h:outputFormat value="#{msg.delete_group_confirm}">
|
||||||
<f:param value="#{GroupsProperties.actionGroupName}"/>
|
<f:param value="#{DialogManager.bean.groupName}"/>
|
||||||
</h:outputFormat>
|
</h:outputFormat>
|
||||||
<f:verbatim>
|
<f:verbatim>
|
||||||
</td>
|
</td>
|
||||||
|
@@ -26,294 +26,108 @@
|
|||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||||
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
|
||||||
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
|
<%@ 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 --%>
|
<h:outputText value="<div style='padding-left: 8px; padding-top: 4px; padding-bottom: 4px'>" escape="false" />
|
||||||
<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">
|
|
||||||
|
|
||||||
<%-- Group Path Breadcrumb --%>
|
|
||||||
<div style="padding-left:8px;padding-top:4px;padding-bottom:4px">
|
|
||||||
<a:breadcrumb value="#{GroupsDialog.location}" styleClass="title" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%-- Groups List --%>
|
|
||||||
<div style="padding:4px">
|
|
||||||
|
|
||||||
<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"
|
|
||||||
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
|
||||||
value="#{GroupsDialog.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'}">
|
|
||||||
<f:facet name="large-icon">
|
|
||||||
<a:actionLink value="#{r.name}" image="/images/icons/group_large.gif" actionListener="#{GroupsDialog.clickGroup}" showLink="false">
|
|
||||||
<f:param name="id" value="#{r.id}" />
|
|
||||||
</a:actionLink>
|
|
||||||
</f:facet>
|
|
||||||
<a:actionLink value="#{r.name}" actionListener="#{GroupsDialog.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'}">
|
|
||||||
<f:facet name="small-icon">
|
|
||||||
<a:actionLink value="#{r.name}" image="/images/icons/group.gif" actionListener="#{GroupsDialog.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}">
|
|
||||||
<f:param name="id" value="#{r.id}" />
|
|
||||||
</a:actionLink>
|
|
||||||
</a:column>
|
|
||||||
|
|
||||||
<%-- Actions column --%>
|
|
||||||
<a:column actions="true" style="text-align:left">
|
|
||||||
<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>
|
|
||||||
</a:column>
|
|
||||||
|
|
||||||
<a:dataPager/>
|
|
||||||
</a:richList>
|
|
||||||
|
|
||||||
</a:panel>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%-- Users in Group list --%>
|
|
||||||
<div style="padding:4px">
|
|
||||||
|
|
||||||
<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"
|
|
||||||
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
|
||||||
value="#{GroupsDialog.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'}">
|
|
||||||
<f:facet name="large-icon">
|
|
||||||
<h:graphicImage alt="#{r.name}" value="/images/icons/user_large.gif" />
|
|
||||||
</f:facet>
|
|
||||||
<h:outputText value="#{r.name}" />
|
|
||||||
</a:column>
|
|
||||||
|
|
||||||
<%-- Primary column for details view mode --%>
|
|
||||||
<a:column primary="true" style="padding:2px;text-align:left;" rendered="#{GroupsProperties.viewMode == 'details'}">
|
|
||||||
<f:facet name="small-icon">
|
|
||||||
<h:graphicImage alt="#{r.name}" value="/images/icons/person.gif" />
|
|
||||||
</f:facet>
|
|
||||||
<f:facet name="header">
|
|
||||||
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
|
||||||
</f:facet>
|
|
||||||
<h:outputText value="#{r.name}" />
|
|
||||||
</a:column>
|
|
||||||
|
|
||||||
<%-- Username column --%>
|
|
||||||
<a:column width="120" style="text-align:left">
|
|
||||||
<f:facet name="header">
|
|
||||||
<a:sortLink label="#{msg.username}" value="userName" styleClass="header"/>
|
|
||||||
</f:facet>
|
|
||||||
<h:outputText value="#{r.userName}" />
|
|
||||||
</a:column>
|
|
||||||
|
|
||||||
<%-- Actions column --%>
|
|
||||||
<a:column actions="true" style="text-align:left">
|
|
||||||
<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}">
|
|
||||||
<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>
|
<%-- Group Path Breadcrumb --%>
|
||||||
|
<a:breadcrumb value="#{DialogManager.bean.location}" styleClass="title" />
|
||||||
|
|
||||||
|
<h:outputText value="</div><div style='padding: 4px;'>" escape="false" />
|
||||||
|
|
||||||
|
<%-- Groups List --%>
|
||||||
|
<a:panel id="groups-panel" border="innerwhite" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.groups}">
|
||||||
|
|
||||||
|
<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="#{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="#{DialogManager.bean.viewMode == 'icons'}">
|
||||||
|
<f:facet name="large-icon">
|
||||||
|
<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="#{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="#{DialogManager.bean.viewMode == 'details'}">
|
||||||
|
<f:facet name="small-icon">
|
||||||
|
<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="#{DialogManager.bean.clickGroup}">
|
||||||
|
<f:param name="id" value="#{r.id}" />
|
||||||
|
</a:actionLink>
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<%-- Actions column --%>
|
||||||
|
<a:column actions="true" style="text-align:left">
|
||||||
|
<f:facet name="header">
|
||||||
|
<h:outputText value="#{msg.actions}"/>
|
||||||
|
</f:facet>
|
||||||
|
<r:actions id="inline-group-actions" value="group_inline_actions" context="#{r}" showLink="false" styleClass="inlineAction" />
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<a:dataPager/>
|
||||||
|
</a:richList>
|
||||||
|
</a:panel>
|
||||||
|
|
||||||
|
<h:outputText value="</div><div style='padding: 4px; margin-bottom: 6px;'>" escape="false" />
|
||||||
|
|
||||||
|
<%-- Users in Group list --%>
|
||||||
|
<a:panel id="users-panel" border="innerwhite" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle" label="#{msg.users}">
|
||||||
|
|
||||||
|
<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="#{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="#{DialogManager.bean.viewMode == 'icons'}">
|
||||||
|
<f:facet name="large-icon">
|
||||||
|
<h:graphicImage alt="#{r.name}" value="/images/icons/user_large.gif" />
|
||||||
|
</f:facet>
|
||||||
|
<h:outputText value="#{r.name}" />
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<%-- Primary column for details view mode --%>
|
||||||
|
<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>
|
||||||
|
<f:facet name="header">
|
||||||
|
<a:sortLink label="#{msg.name}" value="name" mode="case-insensitive" styleClass="header"/>
|
||||||
|
</f:facet>
|
||||||
|
<h:outputText value="#{r.name}" />
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<%-- Username column --%>
|
||||||
|
<a:column width="120" style="text-align:left">
|
||||||
|
<f:facet name="header">
|
||||||
|
<a:sortLink label="#{msg.username}" value="userName" styleClass="header"/>
|
||||||
|
</f:facet>
|
||||||
|
<h:outputText value="#{r.userName}" />
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<%-- Actions column --%>
|
||||||
|
<a:column actions="true" style="text-align:left">
|
||||||
|
<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="#{DialogManager.bean.removeUser}">
|
||||||
|
<f:param name="id" value="#{r.id}" />
|
||||||
|
</a:actionLink>
|
||||||
|
</a:column>
|
||||||
|
|
||||||
|
<a:dataPager/>
|
||||||
|
</a:richList>
|
||||||
|
</a:panel>
|
||||||
|
|
||||||
|
<h:outputText value="</div>" escape="false" />
|
@@ -75,7 +75,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td></f:verbatim><h:outputText value="#{msg.identifier}" /><f:verbatim>:</td>
|
<td></f:verbatim><h:outputText value="#{msg.identifier}" /><f:verbatim>:</td>
|
||||||
<td width="100%">
|
<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> *
|
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/><f:verbatim> *
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Reference in New Issue
Block a user