mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. First cut of the Externalised UI Actions
- XML Config for UI actions: web-client-config-actions.xml - commented examples are included in the config, I will write up a Wiki page to document it properly :) - Named groups of actions can also be reused across screens (where as previously individual ActionLink components had to be coded up for each screen by hand in the JSP) - Individual Actions can be reused across action groups or defined against a specific action group - UI actions for Browse (Create, More, Document and Space actions), Document and Space details pages now externalised into config - Refactoring of other JSPs to use externalised config - big reduction in hand coded JSF tags and code duplication between pages . Document Details and Space Details pages now have Actions panel on the right hand side instead of an Actions drop-down menu . Several unreported minor bugs fixed where actions conditions or listeners were inconsistent between browse and details pages git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2553 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,7 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -57,6 +58,7 @@ public class Node implements Serializable
|
||||
private Set<QName> aspects = null;
|
||||
private Map<String, Boolean> permissions;
|
||||
private Boolean locked = null;
|
||||
private Boolean workingCopyOwner = null;
|
||||
protected QNameNodeMap<String, Object> properties;
|
||||
protected boolean propsRetrieved = false;
|
||||
protected ServiceRegistry services = null;
|
||||
@@ -404,6 +406,32 @@ public class Node implements Serializable
|
||||
return this.locked.booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether a the Node is a WorkingCopy owned by the current User
|
||||
*/
|
||||
public final boolean isWorkingCopyOwner()
|
||||
{
|
||||
if (this.workingCopyOwner == null)
|
||||
{
|
||||
this.workingCopyOwner = Boolean.FALSE;
|
||||
|
||||
if (hasAspect(ContentModel.ASPECT_WORKING_COPY))
|
||||
{
|
||||
Object obj = getProperties().get(ContentModel.PROP_WORKING_COPY_OWNER);
|
||||
if (obj instanceof String)
|
||||
{
|
||||
User user = Application.getCurrentUser(FacesContext.getCurrentInstance());
|
||||
if ( ((String)obj).equals(user.getUserName()))
|
||||
{
|
||||
this.workingCopyOwner = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return workingCopyOwner.booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the state of the node to force re-retrieval of the data
|
||||
*/
|
||||
@@ -413,6 +441,7 @@ public class Node implements Serializable
|
||||
this.type = null;
|
||||
this.path = null;
|
||||
this.locked = null;
|
||||
this.workingCopyOwner = null;
|
||||
this.properties.clear();
|
||||
this.propsRetrieved = false;
|
||||
this.aspects = null;
|
||||
|
@@ -219,34 +219,6 @@ public final class Repository
|
||||
return locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether a WorkingCopy Node is owned by the current User
|
||||
*
|
||||
* @param node The Node wrapper to test against
|
||||
* @param lockService The LockService to use
|
||||
*
|
||||
* @return whether a WorkingCopy Node is owned by the current User
|
||||
*/
|
||||
public static Boolean isNodeOwner(Node node, LockService lockService)
|
||||
{
|
||||
Boolean locked = Boolean.FALSE;
|
||||
|
||||
if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY))
|
||||
{
|
||||
Object obj = node.getProperties().get("workingCopyOwner");
|
||||
if (obj instanceof String)
|
||||
{
|
||||
User user = Application.getCurrentUser(FacesContext.getCurrentInstance());
|
||||
if ( ((String)obj).equals(user.getUserName()))
|
||||
{
|
||||
locked = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the human readable form of the specified node Path. Fast version of the method that
|
||||
* simply converts QName localname components to Strings.
|
||||
|
Reference in New Issue
Block a user