From c86d38b8205e8f692e90653a795ff9b05b518ad7 Mon Sep 17 00:00:00 2001 From: Britt Park Date: Thu, 12 Jul 2007 16:26:02 +0000 Subject: [PATCH] Rejiggering of wiring to allow CIFS not to go through the lockin layer. AVMNodeService doesn't point at AVMLockingAwareService. Web Client now points at AVMLockingAwareService. Forced a couple of places in the Web Client that were going through NodeService to use AVMLockingAwareService to get proper locking behavior. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6234 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../bean/wcm/EditFilePropertiesDialog.java | 10 ++- .../bean/wcm/EditFolderPropertiesDialog.java | 13 +++- .../ui/wcm/component/UISandboxSnapshots.java | 2 +- .../web/ui/wcm/component/UIUserSandboxes.java | 2 +- source/web/WEB-INF/faces-config-beans.xml | 62 +++++++++---------- 5 files changed, 53 insertions(+), 36 deletions(-) diff --git a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java index 187f43193a..2d3a93ea9a 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java @@ -26,6 +26,7 @@ package org.alfresco.web.bean.wcm; import java.io.Serializable; import java.text.MessageFormat; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -33,6 +34,7 @@ import javax.faces.context.FacesContext; import org.alfresco.model.ContentModel; import org.alfresco.repo.avm.AVMNodeConverter; +import org.alfresco.repo.domain.PropertyValue; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition; @@ -156,8 +158,14 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog repoProps.put(qname, propValue); } + // Translate to what AVMService wants to take. + Map avmProps = new HashMap(); + for (Map.Entry entry : repoProps.entrySet()) + { + avmProps.put(entry.getKey(), new PropertyValue(entry.getKey(), entry.getValue())); + } // send the properties back to the repository - this.nodeService.setProperties(nodeRef, repoProps); + this.avmService.setNodeProperties(AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(), avmProps); // perform the rename last as for an AVM it changes the NodeRef if (name != null) diff --git a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java index f81c3b6373..3e10ae013d 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/EditFolderPropertiesDialog.java @@ -28,6 +28,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -37,6 +38,7 @@ import javax.faces.context.FacesContext; import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.avm.AVMNodeConverter; +import org.alfresco.repo.domain.PropertyValue; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition; @@ -141,9 +143,16 @@ public class EditFolderPropertiesDialog extends EditSpaceDialog repoProps.put(qname, propValue); } - + + // Translate to what AVMService wants to take. + Map avmProps = new HashMap(); + for (Map.Entry entry : repoProps.entrySet()) + { + avmProps.put(entry.getKey(), new PropertyValue(entry.getKey(), entry.getValue())); + } + // send the properties back to the repository - this.nodeService.setProperties(nodeRef, repoProps); + this.avmService.setNodeProperties(AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond(), avmProps); // perform the rename last as for an AVM it changes the NodeRef if (name != null) diff --git a/source/java/org/alfresco/web/ui/wcm/component/UISandboxSnapshots.java b/source/java/org/alfresco/web/ui/wcm/component/UISandboxSnapshots.java index 2e118777ce..18ada84b97 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UISandboxSnapshots.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UISandboxSnapshots.java @@ -564,7 +564,7 @@ public class UISandboxSnapshots extends SelfRenderingComponent private AVMService getAVMService(FacesContext fc) { - return (AVMService)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMService"); + return (AVMService)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMLockingAwareService"); } diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java index f1cb37ac43..52160aab01 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java @@ -1132,7 +1132,7 @@ public class UIUserSandboxes extends SelfRenderingComponent private AVMService getAVMService(FacesContext fc) { - return (AVMService)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMService"); + return (AVMService)FacesContextUtils.getRequiredWebApplicationContext(fc).getBean("AVMLockingAwareService"); } private NodeService getNodeService(FacesContext fc) diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 578f67ecc7..e8d60db371 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -1968,7 +1968,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2017,7 +2017,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2074,7 +2074,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2538,7 +2538,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2632,7 +2632,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} workflowService @@ -2677,7 +2677,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} workflowService @@ -2710,7 +2710,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2776,7 +2776,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2838,7 +2838,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -2863,7 +2863,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2880,7 +2880,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2897,7 +2897,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2914,7 +2914,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2931,7 +2931,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2948,7 +2948,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmLockingService @@ -2973,7 +2973,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -2994,7 +2994,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -3027,7 +3027,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -3048,7 +3048,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -3073,7 +3073,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -3094,7 +3094,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} fileFolderService @@ -3123,7 +3123,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} fileFolderService @@ -3148,7 +3148,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} navigator @@ -3177,7 +3177,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} createWebsiteWizard @@ -3198,7 +3198,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} createWebsiteWizard @@ -3232,7 +3232,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} createWebsiteWizard @@ -3253,7 +3253,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} createWebsiteWizard @@ -3287,7 +3287,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmSyncService @@ -3459,7 +3459,7 @@ avmService - #{AVMService} + #{AVMLockingAwareService} @@ -3834,7 +3834,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean @@ -3855,7 +3855,7 @@ session avmService - #{AVMService} + #{AVMLockingAwareService} avmBrowseBean