From f7dfae61e2fc19b15d9e947bdb805a084a8d057a Mon Sep 17 00:00:00 2001 From: Ariel Backenroth Date: Wed, 20 Jun 2007 19:07:49 +0000 Subject: [PATCH] more locking related ui work - unlocking files on submit - unlocking file on revert - adding AVMLockingAwareService to serviceregistry - locking renditions (using the lockingawareservice) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6040 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/forms/FormInstanceDataImpl.java | 5 +++-- .../web/forms/RenderingEngineTemplateImpl.java | 11 +++-------- source/java/org/alfresco/web/forms/RenditionImpl.java | 11 +++-------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java index d3932c4d20..27534dc5c8 100644 --- a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java +++ b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java @@ -19,7 +19,8 @@ * and Open Source Software ("FLOSS") applications as described in Alfresco's * FLOSS exception. You should have recieved a copy of the text describing * the FLOSS exception, and it is also available here: - * http://www.alfresco.com/legal/licensing" */ + * http://www.alfresco.com/legal/licensing" + */ package org.alfresco.web.forms; import java.io.*; @@ -176,7 +177,7 @@ public class FormInstanceDataImpl public List getRenditions() { - final AVMService avmService = this.getServiceRegistry().getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); final PropertyValue pv = avmService.getNodeProperty(-1, this.getPath(), WCMAppModel.PROP_RENDITIONS); final Collection renditionPaths = (pv == null diff --git a/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java b/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java index c547b2a5ad..23b393fa19 100644 --- a/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java +++ b/source/java/org/alfresco/web/forms/RenderingEngineTemplateImpl.java @@ -178,7 +178,7 @@ public class RenderingEngineTemplateImpl public String getOutputPathForRendition(final FormInstanceData formInstanceData, final String currentAVMPath) { final ServiceRegistry sr = this.getServiceRegistry(); - final AVMService avmService = this.getAVMService(); + final AVMService avmService = sr.getAVMLockingAwareService(); final String formInstanceDataAVMPath = formInstanceData.getPath(); @@ -252,7 +252,7 @@ public class RenderingEngineTemplateImpl SAXException, RenderingEngine.RenderingException { - final AVMService avmService = this.getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); final boolean isRegenerate = avmService.lookup(-1, renditionAvmPath) != null; if (!isRegenerate) { @@ -329,7 +329,7 @@ public class RenderingEngineTemplateImpl new PropertyValue(DataTypeDefinition.TEXT, AVMUtil.getStoreRelativePath(formInstanceData.getPath()))); - final AVMService avmService = this.getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); avmService.setNodeProperties(rendition.getPath(), props); } @@ -554,11 +554,6 @@ public class RenderingEngineTemplateImpl return new FormDataFunctions((AVMRemote)wac.getBean("avmRemote")); } - private AVMService getAVMService() - { - return this.getServiceRegistry().getAVMService(); - } - private ServiceRegistry getServiceRegistry() { final FacesContext fc = FacesContext.getCurrentInstance(); diff --git a/source/java/org/alfresco/web/forms/RenditionImpl.java b/source/java/org/alfresco/web/forms/RenditionImpl.java index 3d70303597..2fdd8bf727 100644 --- a/source/java/org/alfresco/web/forms/RenditionImpl.java +++ b/source/java/org/alfresco/web/forms/RenditionImpl.java @@ -103,7 +103,7 @@ public class RenditionImpl public FormInstanceData getPrimaryFormInstanceData() throws FileNotFoundException { - final AVMService avmService = this.getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); final String fidAVMStoreRelativePath = (String) avmService.getNodeProperty(AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getFirst(), AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond(), @@ -123,7 +123,7 @@ public class RenditionImpl { if (this.renderingEngineTemplate == null) { - final AVMService avmService = this.getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); PropertyValue pv = avmService.getNodeProperty(AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getFirst(), AVMNodeConverter.ToAVMVersionPath(this.nodeRef).getSecond(), @@ -187,7 +187,7 @@ public class RenditionImpl public OutputStream getOutputStream() { - final AVMService avmService = this.getAVMService(); + final AVMService avmService = this.getServiceRegistry().getAVMLockingAwareService(); final Pair p = AVMNodeConverter.ToAVMVersionPath(this.nodeRef); return (avmService.lookup(p.getFirst(), p.getSecond()) == null ? avmService.createFile(AVMNodeConverter.SplitBase(p.getSecond())[0], @@ -212,11 +212,6 @@ public class RenditionImpl this.getRenderingEngineTemplate().render(formInstanceData, this); } - private AVMService getAVMService() - { - return this.getServiceRegistry().getAVMService(); - } - private ServiceRegistry getServiceRegistry() { final FacesContext fc = FacesContext.getCurrentInstance();