Manual merge of V2.1 to HEAD: ETWOONE-92: If two users update the same contents at the same time, you get an unfriendly InvalidNodeRefException

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10981 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2008-09-23 09:50:47 +00:00
parent 997e6537aa
commit ee55f90a07
2 changed files with 18 additions and 4 deletions

View File

@@ -234,11 +234,25 @@ public class DocumentDetailsDialog extends BaseDetailsBean implements Navigatio
} }
/** /**
* Adds the node to the dispatch context so that overridden dialogs can be picked up * Fixes an issue reported in https://issues.alfresco.com/jira/browse/ETWOONE-92
*
* @return Returns action
*/ */
public void setupEditContext(ActionEvent event) public String editContentProperties()
{ {
this.navigator.setupDispatchContext(getDocument()); NodeRef nodeRef = getDocument().getNodeRef();
if (this.getNodeService().exists(nodeRef))
{
navigator.setupDispatchContext(getDocument());
return "dialog:editContentProperties";
}
else
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] {nodeRef}) );
return "browse";
}
} }
/** /**

View File

@@ -96,7 +96,7 @@
<h:panelGroup id="props-panel-facets"> <h:panelGroup id="props-panel-facets">
<f:facet name="title"> <f:facet name="title">
<r:permissionEvaluator value="#{DialogManager.bean.document}" allow="Write"> <r:permissionEvaluator value="#{DialogManager.bean.document}" allow="Write">
<a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif" action="dialog:editContentProperties" actionListener="#{DialogManager.bean.setupEditContext}" /> <a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif" action="#{DialogManager.bean.editContentProperties}" />
</r:permissionEvaluator> </r:permissionEvaluator>
</f:facet> </f:facet>
</h:panelGroup> </h:panelGroup>