diff --git a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java index 93fe9a316d..4e79f2e187 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java @@ -28,16 +28,18 @@ import org.alfresco.config.JNDIConstants; import org.alfresco.mbeans.VirtServerRegistry; import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.domain.PropertyValue; -import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.avm.AVMNotFoundException; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.namespace.QName; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.util.VirtServerUtils; import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.config.ClientConfigElement; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.jsf.FacesContextUtils; + /** * Helper methods and constants related to AVM directories, paths and store name manipulation. * @@ -654,21 +656,6 @@ public final class AVMConstants } } - /** - * @param path Path to match against - * - * @return true if the path should require a virtualisation server reload, false otherwise - */ - public static boolean requiresVServerUpdate(String path) - { - if (path == null || path.length() == 0) - { - throw new IllegalArgumentException("Path value is mandatory."); - } - - return WEB_INF_PATH_PATTERN.matcher(path).matches(); - } - /** * Update notification on the virtualisation server webapp as required for the specified path * @@ -677,7 +664,7 @@ public final class AVMConstants */ public static void updateVServerWebapp(String path, boolean force) { - if (force || requiresVServerUpdate(path)) + if (force || VirtServerUtils.requiresUpdateNotification(path)) { VirtServerRegistry vServerRegistry = AVMConstants.getVirtServerRegistry(); @@ -701,7 +688,7 @@ public final class AVMConstants */ public static void removeVServerWebapp(String path, boolean force) { - if (force || requiresVServerUpdate(path)) + if (force || VirtServerUtils.requiresUpdateNotification(path)) { VirtServerRegistry vServerRegistry = AVMConstants.getVirtServerRegistry(); @@ -775,10 +762,4 @@ public final class AVMConstants Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW + "/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)"); - // patterns for WEB-INF files that require virtualisation server reload - private final static Pattern WEB_INF_PATH_PATTERN = - Pattern.compile(".*:/" + JNDIConstants.DIR_DEFAULT_WWW + - "/" + JNDIConstants.DIR_DEFAULT_APPBASE + "/" + - ".*/WEB-INF/((classes/.*)|(lib/.*)|(web.xml))", - Pattern.CASE_INSENSITIVE); } diff --git a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java index 50fdec7dd9..fca720f850 100644 --- a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java @@ -62,6 +62,9 @@ import org.alfresco.web.forms.Rendition; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.component.UIListItem; import org.alfresco.web.ui.wcm.WebResources; +import org.alfresco.util.VirtServerUtils; + + /** * Submit items for WCM workflow dialog. @@ -352,7 +355,8 @@ public class SubmitDialog extends BaseDialogBean // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar - update_vserver = AVMConstants.requiresVServerUpdate( destPath ); + update_vserver = VirtServerUtils.requiresUpdateNotification( destPath ); + if ( update_vserver ) { this.virtUpdatePath = destPath; } } }