. 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

@@ -32,6 +32,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.CopyService;
@@ -85,6 +86,7 @@ public class DocumentDetailsBean
protected VersionService versionService;
protected OwnableService ownableService;
protected NavigationBean navigator;
protected CheckOutCheckInService cociService;
private Map<String, Boolean> panels = new HashMap<String, Boolean>(5, 1.0f);
@@ -1152,7 +1154,7 @@ public class DocumentDetailsBean
*/
public boolean isLocked()
{
return Repository.isNodeLocked(getDocument(), this.lockService);
return getDocument().isLocked();
}
/**
@@ -1165,6 +1167,25 @@ public class DocumentDetailsBean
return getDocument().hasAspect(ContentModel.ASPECT_WORKING_COPY);
}
/**
* @return the working copy document Node for this document if found or null if not
*/
public Node getWorkingCopyDocument()
{
Node workingCopyNode = null;
if (isLocked())
{
NodeRef workingCopyRef = this.cociService.getWorkingCopy(getDocument().getNodeRef());
if (workingCopyRef != null)
{
workingCopyNode = new Node(workingCopyRef);
}
}
return workingCopyNode;
}
/**
* Returns whether the current document is a working copy owned by the current User
*
@@ -1261,6 +1282,16 @@ public class DocumentDetailsBean
this.ownableService = ownableService;
}
/**
* Sets the checkincheckout service instance the bean should use
*
* @param cociService The CheckOutCheckInService
*/
public void setCheckOutCheckInService(CheckOutCheckInService cociService)
{
this.cociService = cociService;
}
/**
* @param navigator The NavigationBean to set.
*/