mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Fix to paging (refresh) issue in Rules and Manage Space/Content Users screens
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2483 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,6 +31,8 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.rule.Rule;
|
import org.alfresco.service.cmr.rule.Rule;
|
||||||
import org.alfresco.service.cmr.rule.RuleService;
|
import org.alfresco.service.cmr.rule.RuleService;
|
||||||
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.UIContextService;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
import org.alfresco.web.bean.repository.Node;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||||
@@ -44,7 +46,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
*
|
*
|
||||||
* @author gavinc
|
* @author gavinc
|
||||||
*/
|
*/
|
||||||
public class RulesBean
|
public class RulesBean implements IContextListener
|
||||||
{
|
{
|
||||||
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
|
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
|
||||||
private static final String LOCAL = "local";
|
private static final String LOCAL = "local";
|
||||||
@@ -59,6 +61,15 @@ public class RulesBean
|
|||||||
private Rule currentRule;
|
private Rule currentRule;
|
||||||
private UIRichList richList;
|
private UIRichList richList;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor
|
||||||
|
*/
|
||||||
|
public RulesBean()
|
||||||
|
{
|
||||||
|
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current view mode the list of rules is in
|
* Returns the current view mode the list of rules is in
|
||||||
*
|
*
|
||||||
@@ -122,6 +133,9 @@ public class RulesBean
|
|||||||
|
|
||||||
this.currentRule = this.ruleService.getRule(
|
this.currentRule = this.ruleService.getRule(
|
||||||
getSpace().getNodeRef(), id);
|
getSpace().getNodeRef(), id);
|
||||||
|
|
||||||
|
// refresh list
|
||||||
|
contextUpdated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +215,6 @@ public class RulesBean
|
|||||||
public void setRichList(UIRichList richList)
|
public void setRichList(UIRichList richList)
|
||||||
{
|
{
|
||||||
this.richList = richList;
|
this.richList = richList;
|
||||||
this.richList.setValue(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,6 +242,22 @@ public class RulesBean
|
|||||||
{
|
{
|
||||||
this.ruleService = ruleService;
|
this.ruleService = ruleService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// IContextListener implementation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
|
||||||
|
*/
|
||||||
|
public void contextUpdated()
|
||||||
|
{
|
||||||
|
if (this.richList != null)
|
||||||
|
{
|
||||||
|
this.richList.setValue(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class to wrap the Rule objects so we can expose a flag to indicate whether
|
* Inner class to wrap the Rule objects so we can expose a flag to indicate whether
|
||||||
|
@@ -45,6 +45,8 @@ import org.alfresco.service.cmr.security.OwnableService;
|
|||||||
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.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.UIContextService;
|
||||||
import org.alfresco.web.bean.BrowseBean;
|
import org.alfresco.web.bean.BrowseBean;
|
||||||
import org.alfresco.web.bean.repository.MapNode;
|
import org.alfresco.web.bean.repository.MapNode;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
import org.alfresco.web.bean.repository.Node;
|
||||||
@@ -57,7 +59,7 @@ import org.alfresco.web.ui.repo.WebResources;
|
|||||||
/**
|
/**
|
||||||
* @author Kevin Roast
|
* @author Kevin Roast
|
||||||
*/
|
*/
|
||||||
public abstract class UserMembersBean
|
public abstract class UserMembersBean implements IContextListener
|
||||||
{
|
{
|
||||||
private static final String MSG_SUCCESS_INHERIT_NOT = "success_not_inherit_permissions";
|
private static final String MSG_SUCCESS_INHERIT_NOT = "success_not_inherit_permissions";
|
||||||
private static final String MSG_SUCCESS_INHERIT = "success_inherit_permissions";
|
private static final String MSG_SUCCESS_INHERIT = "success_inherit_permissions";
|
||||||
@@ -100,6 +102,15 @@ public abstract class UserMembersBean
|
|||||||
private List<PermissionWrapper> personRoles = null;
|
private List<PermissionWrapper> personRoles = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor
|
||||||
|
*/
|
||||||
|
public UserMembersBean()
|
||||||
|
{
|
||||||
|
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Abstract methods
|
// Abstract methods
|
||||||
|
|
||||||
@@ -176,9 +187,6 @@ public abstract class UserMembersBean
|
|||||||
public void setUsersRichList(UIRichList usersRichList)
|
public void setUsersRichList(UIRichList usersRichList)
|
||||||
{
|
{
|
||||||
this.usersRichList = usersRichList;
|
this.usersRichList = usersRichList;
|
||||||
|
|
||||||
// force refresh on exit of the page (as this property is set by JSF on view restore)
|
|
||||||
this.usersRichList.setValue(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,9 +403,32 @@ public abstract class UserMembersBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// IContextListener implementation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
|
||||||
|
*/
|
||||||
|
public void contextUpdated()
|
||||||
|
{
|
||||||
|
if (this.usersRichList != null)
|
||||||
|
{
|
||||||
|
this.usersRichList.setValue(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Action event handlers
|
// Action event handlers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action called to Close the dialog
|
||||||
|
*/
|
||||||
|
public void close(ActionEvent event)
|
||||||
|
{
|
||||||
|
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action event called by all actions that need to setup a Person context on
|
* Action event called by all actions that need to setup a Person context on
|
||||||
* the UserMembers bean before an action page is called. The context will be a
|
* the UserMembers bean before an action page is called. The context will be a
|
||||||
@@ -465,9 +496,11 @@ public abstract class UserMembersBean
|
|||||||
{
|
{
|
||||||
setPersonAuthority(null);
|
setPersonAuthority(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force refresh on return to this page
|
||||||
|
contextUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inherit parent Space permissions value changed by the user
|
* Inherit parent Space permissions value changed by the user
|
||||||
*/
|
*/
|
||||||
@@ -514,6 +547,9 @@ public abstract class UserMembersBean
|
|||||||
PermissionWrapper wrapper = new PermissionWrapper(role, Application.getMessage(context, role));
|
PermissionWrapper wrapper = new PermissionWrapper(role, Application.getMessage(context, role));
|
||||||
this.personRoles.add(wrapper);
|
this.personRoles.add(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force refresh on return to this page
|
||||||
|
contextUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -526,6 +562,9 @@ public abstract class UserMembersBean
|
|||||||
{
|
{
|
||||||
this.personRoles.remove(wrapper);
|
this.personRoles.remove(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force refresh on return to this page
|
||||||
|
contextUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -171,7 +171,7 @@
|
|||||||
<table cellpadding="0" cellspacing="0" border="0">
|
<table cellpadding="0" cellspacing="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
<h:commandButton value="#{msg.close}" actionListener="#{ContentUsersBean.users}" action="dialog:close" styleClass="wizardButton" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@@ -171,7 +171,7 @@
|
|||||||
<table cellpadding="0" cellspacing="0" border="0">
|
<table cellpadding="0" cellspacing="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
<h:commandButton value="#{msg.close}" actionListener="#{SpaceUsersBean.close}" action="dialog:close" styleClass="wizardButton" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user