diff --git a/source/java/org/alfresco/web/bean/wcm/EditWebContentWizard.java b/source/java/org/alfresco/web/bean/wcm/EditWebContentWizard.java index c22d65fc5e..eb0c879769 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditWebContentWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/EditWebContentWizard.java @@ -234,18 +234,18 @@ public class EditWebContentWizard extends CreateWebContentWizard if (rr.getLockOwner() != null) { this.existingLocks.add(path); - } - String renditionStoreId = AVMUtil.getStoreId(path); - String renditionStorePath = AVMUtil.getStoreRelativePath(path); - String renditionStoreName = AVMUtil.getCorrespondingMainStoreName(AVMUtil.getStoreName(path)); - Map renditionlockData = this.getAvmLockingService().getLockData(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path)); - renditionlockData.put(WCMUtil.LOCK_KEY_STORE_NAME, renditionStoreName); - - if (logger.isDebugEnabled()) - logger.debug("transferring lock for " + path + " back to " + renditionStoreName); - - this.getAvmLockingService().modifyLock(renditionStoreId, renditionStorePath, lockOwner, renditionStoreId, renditionStorePath, renditionlockData); + String renditionStoreId = AVMUtil.getStoreId(path); + String renditionStorePath = AVMUtil.getStoreRelativePath(path); + String renditionStoreName = AVMUtil.getCorrespondingMainStoreName(AVMUtil.getStoreName(path)); + Map renditionlockData = this.getAvmLockingService().getLockData(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path)); + renditionlockData.put(WCMUtil.LOCK_KEY_STORE_NAME, renditionStoreName); + + if (logger.isDebugEnabled()) + logger.debug("transferring lock for " + path + " back to " + renditionStoreName); + + this.getAvmLockingService().modifyLock(renditionStoreId, renditionStorePath, lockOwner, renditionStoreId, renditionStorePath, renditionlockData); + } } } } diff --git a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java index daa7575a68..6c0bbd2ace 100644 --- a/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java +++ b/source/java/org/alfresco/web/forms/FormInstanceDataImpl.java @@ -45,6 +45,7 @@ import org.alfresco.web.app.Application; import org.alfresco.web.app.servlet.FacesHelper; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.wcm.AVMUtil; +import org.alfresco.web.bean.wcm.WebProject; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; @@ -62,11 +63,21 @@ import org.xml.sax.SAXException; private static final Log logger = LogFactory.getLog(RenditionImpl.class); private final NodeRef nodeRef; + private final WebProject webProject; private transient FormsService formsService; /* package */ FormInstanceDataImpl(final NodeRef nodeRef, - final FormsService formsService) + final FormsService formsService) { + this(nodeRef, formsService, null); + } + + /* package */ FormInstanceDataImpl(final NodeRef nodeRef, + final FormsService formsService, + final WebProject webProject) + { + this.webProject = webProject; + if (nodeRef == null) { throw new NullPointerException(); @@ -145,6 +156,11 @@ import org.xml.sax.SAXException; // TODO - forms should be identified by nodeRef rather than name (which can be non-unique) if (getNodeRef().getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM)) { + if (webProject != null) + { + return webProject.getForm(parentFormName); + } + return this.getFormsService().getWebForm(parentFormName); } else @@ -154,6 +170,11 @@ import org.xml.sax.SAXException; } catch (FormNotFoundException fnfe) { + if (webProject != null) + { + throw new FormNotFoundException(parentFormName, webProject, this); + } + throw new FormNotFoundException(parentFormName, this); } } @@ -279,9 +300,12 @@ import org.xml.sax.SAXException; String storePath = AVMUtil.getStoreRelativePath(path); String storeName = AVMUtil.getStoreName(path); - lockOwner = avmLockService.getLockOwner(storeId, storePath); Map lockData = avmLockService.getLockData(storeId, storePath); - currentLockStore = lockData.get(WCMUtil.LOCK_KEY_STORE_NAME); + if (lockData != null) + { + lockOwner = avmLockService.getLockOwner(storeId, storePath); + currentLockStore = lockData.get(WCMUtil.LOCK_KEY_STORE_NAME); + } if (lockOwner != null) { diff --git a/source/java/org/alfresco/web/forms/FormsService.java b/source/java/org/alfresco/web/forms/FormsService.java index caf16c4614..2fb805c5de 100644 --- a/source/java/org/alfresco/web/forms/FormsService.java +++ b/source/java/org/alfresco/web/forms/FormsService.java @@ -297,10 +297,13 @@ public final class FormsService public FormInstanceData getFormInstanceData(final NodeRef nodeRef) throws FormNotFoundException { + final String avmPath = AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(); + final WebProject webProject = new WebProject(avmPath); + FormInstanceData fid = null; try { - fid = new FormInstanceDataImpl(nodeRef, this); + fid = new FormInstanceDataImpl(nodeRef, this, webProject); return fid; } catch (IllegalArgumentException iae)