mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
. 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:
@@ -166,6 +166,7 @@ choose_icon=Choose icon
|
||||
security=Security
|
||||
all_formats=All Formats
|
||||
rules_count=Number of rules applied to this Space
|
||||
working_copy_document=Working Copy
|
||||
|
||||
# Properties
|
||||
username=User Name
|
||||
|
@@ -662,7 +662,7 @@ public class BrowseBean implements IContextListener
|
||||
|
||||
results = this.searchService.query(
|
||||
Repository.getStoreRef(),
|
||||
"lucene", query, null, null);
|
||||
SearchService.LANGUAGE_LUCENE, query, null, null);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Search results returned: " + results.length());
|
||||
|
||||
@@ -777,7 +777,7 @@ public class BrowseBean implements IContextListener
|
||||
|
||||
public NodePropertyResolver resolverlocked = new NodePropertyResolver() {
|
||||
public Object get(Node node) {
|
||||
return Repository.isNodeLocked(node, lockService);
|
||||
return node.isLocked();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -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.
|
||||
*/
|
||||
|
@@ -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;
|
||||
|
@@ -783,6 +783,10 @@
|
||||
<property-name>ownableService</property-name>
|
||||
<value>#{OwnableService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>checkOutCheckInService</property-name>
|
||||
<value>#{CheckoutCheckinService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
|
@@ -483,7 +483,7 @@
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
</a:actionLink>
|
||||
</a:booleanEvaluator>
|
||||
</r:permissionEvaluator>
|
||||
</r:permissionEvaluator>
|
||||
<a:booleanEvaluator value="#{r.checkIn == true}">
|
||||
<a:actionLink value="#{msg.checkin}" image="/images/icons/CheckIn_icon.gif" showLink="false" styleClass="inlineAction" actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkinFile">
|
||||
<f:param name="id" value="#{r.id}" />
|
||||
|
@@ -72,7 +72,17 @@
|
||||
<div class="mainTitle">
|
||||
<h:outputText value="#{msg.details_of}" /> '<h:outputText value="#{DocumentDetailsBean.name}" />'<r:lockIcon value="#{DocumentDetailsBean.document.nodeRef}" align="absmiddle" />
|
||||
</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.location}" />: <r:nodePath value="#{DocumentDetailsBean.document.nodeRef}" breadcrumb="true" actionListener="#{BrowseBean.clickSpacePath}" /></div>
|
||||
<div class="mainSubText">
|
||||
<h:outputText value="#{msg.location}" />: <r:nodePath value="#{DocumentDetailsBean.document.nodeRef}" breadcrumb="true" actionListener="#{BrowseBean.clickSpacePath}" />
|
||||
</div>
|
||||
<a:panel id="working-copy" rendered="#{DocumentDetailsBean.locked}">
|
||||
<div class="mainSubText">
|
||||
<h:outputText value="#{msg.working_copy_document}" />:
|
||||
<a:actionLink value="#{DocumentDetailsBean.workingCopyDocument.properties.name}" actionListener="#{BrowseBean.setupContentAction}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.workingCopyDocument.id}" />
|
||||
</a:actionLink>
|
||||
</div>
|
||||
</a:panel>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.documentdetails_description}" /></div>
|
||||
</td>
|
||||
|
||||
@@ -81,14 +91,14 @@
|
||||
<nobr>
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="CheckOut">
|
||||
<a:booleanEvaluator value="#{DocumentDetailsBean.locked == false && DocumentDetailsBean.workingCopy == false}">
|
||||
<a:actionLink value="#{msg.checkout}" image="/images/icons/CheckOut_icon.gif" padding="2" style="white-space:nowrap"
|
||||
<a:actionLink value="#{msg.checkout}" image="/images/icons/CheckOut_icon.gif" padding="2" style="white-space:nowrap"
|
||||
actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkoutFile">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
</a:booleanEvaluator>
|
||||
</r:permissionEvaluator>
|
||||
<a:booleanEvaluator value="#{DocumentDetailsBean.document.properties.checkIn == true}">
|
||||
<a:actionLink value="#{msg.checkin}" image="/images/icons/CheckIn_icon.gif" padding="2" style="white-space:nowrap"
|
||||
<a:actionLink value="#{msg.checkin}" image="/images/icons/CheckIn_icon.gif" padding="2" style="white-space:nowrap"
|
||||
actionListener="#{CheckinCheckoutBean.setupContentAction}" action="checkinFile">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
@@ -310,9 +320,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
<br/>
|
||||
|
||||
<a:panel label="#{msg.properties}" id="properties-panel-locked" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE" rendered="#{DocumentDetailsBean.locked}"
|
||||
expanded='#{DocumentDetailsBean.panels["properties-panel-locked"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
@@ -346,6 +353,8 @@
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
<br/>
|
||||
|
||||
<h:panelGroup id="workflow-panel-facets">
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
|
||||
|
Reference in New Issue
Block a user