diff --git a/config/alfresco/messages/patch-service.properties b/config/alfresco/messages/patch-service.properties
index cbafd04f06..d402062bb1 100644
--- a/config/alfresco/messages/patch-service.properties
+++ b/config/alfresco/messages/patch-service.properties
@@ -156,4 +156,7 @@ patch.groupMembersAsIdentifiers.description=Reindex usr:authorityContainer membe
patch.genericWorkflow.result.deployed=Re-deployed {0} workflows.
-patch.redeploySubmitProcess.description=Re-deploy WCM Submit Process Definition.
\ No newline at end of file
+patch.redeploySubmitProcess.description=Re-deploy WCM Submit Process Definition.
+
+patch.AVMLocking.description=Adds existing web projects to locking service.
+patch.AVMLocking.result=Necessary web projects added.
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index aebd5ff50e..f467bca85c 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -814,6 +814,17 @@
-
-
+
+
+
+ patch.AVMLocking
+ patch.AVMLocking.description
+ 0
+ 58
+ 59
+
+
+
+
+
diff --git a/config/alfresco/public-services-context.xml b/config/alfresco/public-services-context.xml
index 2a57798381..759f7b9903 100644
--- a/config/alfresco/public-services-context.xml
+++ b/config/alfresco/public-services-context.xml
@@ -752,7 +752,7 @@
+ are grabbed at bootstrap time.x -->
diff --git a/config/alfresco/version.properties b/config/alfresco/version.properties
index b2f259a8f2..d9f8dcf2df 100644
--- a/config/alfresco/version.properties
+++ b/config/alfresco/version.properties
@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number
-version.schema=58
+version.schema=59
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AVMLockingPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AVMLockingPatch.java
new file mode 100644
index 0000000000..56f5369420
--- /dev/null
+++ b/source/java/org/alfresco/repo/admin/patch/impl/AVMLockingPatch.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * 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
+ */
+
+package org.alfresco.repo.admin.patch.impl;
+
+import org.alfresco.i18n.I18NUtil;
+import org.alfresco.model.WCMAppModel;
+import org.alfresco.repo.admin.patch.AbstractPatch;
+import org.alfresco.service.cmr.avm.locking.AVMLockingService;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.cmr.search.ResultSet;
+
+/**
+ * This creates web project tables for AVMLockingService as needed.
+ * @author britt
+ */
+public class AVMLockingPatch extends AbstractPatch
+{
+ private static final String STORE = "workspace://SpacesStore";
+ private static final String MSG_SUCCESS = "patch.AVMLocking.result";
+
+ private AVMLockingService fLockingService;
+
+ public void setAvmLockingService(AVMLockingService service)
+ {
+ fLockingService = service;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.alfresco.repo.admin.patch.AbstractPatch#applyInternal()
+ */
+ @Override
+ protected String applyInternal() throws Exception
+ {
+ ResultSet results =
+ searchService.query(new StoreRef(STORE), "lucene", "TYPE:\"wca:webfolder\"");
+ for (NodeRef nodeRef : results.getNodeRefs())
+ {
+ String webProject = (String)nodeService.getProperty(nodeRef, WCMAppModel.PROP_AVMSTORE);
+ fLockingService.addWebProject(webProject);
+ }
+ return I18NUtil.getMessage(MSG_SUCCESS);
+ }
+}