mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. Refactored client AVM Node class to extend existing Node class - allows the use of existing PermissionEvaluators etc. for a node action
. Permission evaluators added to AVM browse screen top-level actions and file/folder actions . Permission evaluators added to Edit Details action in File/Folder Details screens . Each user sandbox is now only visible to the assigned user and all Content Managers . Import Website Content action hidden unless user has appropriate Write permissions to the main staging area (Content Managers only) . Added Titled aspect to shtml content created through the XML Templating Service. . Remove Create Content action from sandbox screen - makes no sense here until we can create via workflow or destination folder . Fix nasty bug in Create Form Wizard where no default extension would be specified - this led to the XForms generating files such as "myfile.xml" and "myfile." - the generated HTML did not have a file extension... git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4048 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -90,6 +90,7 @@ public class AVMBrowseBean implements IContextListener
|
||||
private String username;
|
||||
private String sandboxTitle = null;
|
||||
private String currentPath = null;
|
||||
private AVMNode currentPathNode = null;
|
||||
|
||||
/* component references */
|
||||
private UIRichList foldersRichList;
|
||||
@@ -100,7 +101,7 @@ public class AVMBrowseBean implements IContextListener
|
||||
private List<Map> files = null;
|
||||
private List<Map> folders = null;
|
||||
|
||||
/** Current AVM Node context*/
|
||||
/** Current AVM Node action context */
|
||||
private AVMNode avmNode = null;
|
||||
|
||||
private String wcmDomain;
|
||||
@@ -415,25 +416,25 @@ public class AVMBrowseBean implements IContextListener
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the current AVM node context.
|
||||
* @return Returns the current AVM node action context.
|
||||
*/
|
||||
public AVMNode getAvmNode()
|
||||
public AVMNode getAvmActionNode()
|
||||
{
|
||||
return this.avmNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmNode The AVM node context to set.
|
||||
* @param avmNode The AVM node action context to set.
|
||||
*/
|
||||
public void setAvmNode(AVMNode avmNode)
|
||||
public void setAvmActionNode(AVMNode avmNode)
|
||||
{
|
||||
this.avmNode = avmNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmRef The AVMNodeDescriptor context to set.
|
||||
* @param avmRef The AVMNodeDescriptor action context to set.
|
||||
*/
|
||||
public void setAVMNodeDescriptor(AVMNodeDescriptor avmRef)
|
||||
public void setAVMActionNodeDescriptor(AVMNodeDescriptor avmRef)
|
||||
{
|
||||
AVMNode avmNode = new AVMNode(avmRef);
|
||||
this.avmNode = avmNode;
|
||||
@@ -457,11 +458,29 @@ public class AVMBrowseBean implements IContextListener
|
||||
public void setCurrentPath(String path)
|
||||
{
|
||||
this.currentPath = path;
|
||||
if (path == null)
|
||||
{
|
||||
// clear dependant objects (recreated when the path is reinitialised)
|
||||
this.currentPathNode = null;
|
||||
}
|
||||
|
||||
// update UI state ready for screen refresh
|
||||
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the AVMNode that represents the current browsing path
|
||||
*/
|
||||
public AVMNode getCurrentPathNode()
|
||||
{
|
||||
if (this.currentPathNode == null)
|
||||
{
|
||||
AVMNodeDescriptor node = this.avmService.lookup(-1, getCurrentPath(), true);
|
||||
this.currentPathNode = new AVMNode(node);
|
||||
}
|
||||
return this.currentPathNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Breadcrumb location list
|
||||
*/
|
||||
@@ -638,11 +657,11 @@ public class AVMBrowseBean implements IContextListener
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Setup content action for path: " + path);
|
||||
AVMNodeDescriptor node = avmService.lookup(-1, path, true);
|
||||
setAVMNodeDescriptor(node);
|
||||
setAVMActionNodeDescriptor(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
setAvmNode(null);
|
||||
setAvmActionNode(null);
|
||||
}
|
||||
|
||||
// update UI state ready for return after dialog close
|
||||
@@ -667,14 +686,14 @@ public class AVMBrowseBean implements IContextListener
|
||||
tx.begin();
|
||||
|
||||
Action action = this.actionService.createAction(ACTION_AVM_SUBMIT);
|
||||
this.actionService.executeAction(action, getAvmNode().getNodeRef());
|
||||
this.actionService.executeAction(action, getAvmActionNode().getNodeRef());
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// if we get here, all was well - output friendly status message to the user
|
||||
String msg = MessageFormat.format(Application.getMessage(
|
||||
context, MSG_SUBMIT_SUCCESS), getAvmNode().getName());
|
||||
context, MSG_SUBMIT_SUCCESS), getAvmActionNode().getName());
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
|
||||
String formId = Utils.getParentForm(context, event.getComponent()).getClientId(context);
|
||||
context.addMessage(formId + ':' + COMPONENT_SANDBOXESPANEL, facesMsg);
|
||||
|
Reference in New Issue
Block a user