. Added link to the associated Working Copy for a locked document to the Document Details page

. Improved performance of "locked" status check for a cached client Node object
. Adding missing method to the list of authenticated methods for the CheckoutCheckinService to public-services-security-context.xml

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2509 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-03-01 14:17:30 +00:00
parent 758c7c191b
commit 42d464cc82
7 changed files with 81 additions and 10 deletions

View File

@@ -25,7 +25,9 @@ import java.util.Set;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.lock.LockStatus;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -54,6 +56,7 @@ public class Node implements Serializable
private String id;
private Set<QName> aspects = null;
private Map<String, Boolean> permissions;
private Boolean locked = null;
protected QNameNodeMap<String, Object> properties;
protected boolean propsRetrieved = false;
protected ServiceRegistry services = null;
@@ -379,6 +382,28 @@ public class Node implements Serializable
return this.path;
}
/**
* @return If the node is currently locked
*/
public final boolean isLocked()
{
if (this.locked == null)
{
this.locked = Boolean.FALSE;
if (hasAspect(ContentModel.ASPECT_LOCKABLE))
{
LockStatus lockStatus = getServiceRegistry().getLockService().getLockStatus(getNodeRef());
if (lockStatus == LockStatus.LOCKED || lockStatus == LockStatus.LOCK_OWNER)
{
locked = Boolean.TRUE;
}
}
}
return this.locked.booleanValue();
}
/**
* Resets the state of the node to force re-retrieval of the data
*/
@@ -387,6 +412,7 @@ public class Node implements Serializable
this.name = null;
this.type = null;
this.path = null;
this.locked = null;
this.properties.clear();
this.propsRetrieved = false;
this.aspects = null;