diff --git a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java index e8374c4ab2..8cae2efddb 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java @@ -167,6 +167,7 @@ public class AVMBrowseBean implements IContextListener UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this); } + // ------------------------------------------------------------------------------ // Bean property getters and setters diff --git a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java index 4e79f2e187..f8719f2e67 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMConstants.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMConstants.java @@ -761,5 +761,4 @@ public final class AVMConstants private final static Pattern SANDBOX_RELATIVE_PATH_PATTERN = Pattern.compile("([^:]+:/" + JNDIConstants.DIR_DEFAULT_WWW + "/" + JNDIConstants.DIR_DEFAULT_APPBASE + ")(.*)"); - } diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java index 94e203603b..b354ea5ae9 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java @@ -226,7 +226,8 @@ public class CreateWebContentWizard extends BaseContentWizard final int step = Application.getWizardManager().getCurrentStep(); if (step == 2) { - LOGGER.debug("clearing form instance data"); + if (LOGGER.isDebugEnabled()) + LOGGER.debug("clearing form instance data"); if (this.formInstanceData != null) { this.avmService.removeNode(this.formInstanceData.getPath()); @@ -302,16 +303,17 @@ public class CreateWebContentWizard extends BaseContentWizard // reset all paths and structures to the main store this.createdPath = AVMConstants.getCorrespondingPathInMainStore(this.createdPath); - LOGGER.debug("reset path " + this.createdPath + " to main store"); - + if (LOGGER.isDebugEnabled()) + LOGGER.debug("reset path " + this.createdPath + " to main store"); boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null); if (form) { this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath)); this.renditions = this.formInstanceData.getRenditions(); - LOGGER.debug("reset form instance data " + this.formInstanceData.getName() + - " and " + this.renditions.size() + " to main store"); + if (LOGGER.isDebugEnabled()) + LOGGER.debug("reset form instance data " + this.formInstanceData.getName() + + " and " + this.renditions.size() + " to main store"); } if (this.startWorkflow) { @@ -367,8 +369,8 @@ public class CreateWebContentWizard extends BaseContentWizard srcPaths.add(AVMConstants.getCorrespondingPath(this.createdPath, sandboxName)); } - LOGGER.debug("creating workflow package with " + srcPaths.size() + " files"); - + if (LOGGER.isDebugEnabled()) + LOGGER.debug("creating workflow package with " + srcPaths.size() + " files"); // Create workflow sandbox for workflow package SandboxInfo sandboxInfo = SandboxFactory.createWorkflowSandbox(storeId); diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index f96f85eeb8..3ff89aa0d4 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -122,6 +122,7 @@ public class CreateWebsiteWizard extends BaseWizardBean /** Data for virtualization server notification */ private SandboxInfo sandboxInfo; + // ------------------------------------------------------------------------------ // Wizard implementation @@ -212,27 +213,24 @@ public class CreateWebsiteWizard extends BaseWizardBean return outcome; } + /** + * @see org.alfresco.web.bean.dialog.BaseDialogBean#doPostCommitProcessing(javax.faces.context.FacesContext, java.lang.String) + */ @Override protected String doPostCommitProcessing(FacesContext context, String outcome) { - // TODO: ask about isStandalone() - // in InviteWebsiteUsersWizard - - if ( this.sandboxInfo != null ) + if (this.sandboxInfo != null) { - String newStoreName = - AVMConstants.buildStagingStoreName( sandboxInfo.getMainStoreName()); - - String path = AVMConstants.buildStoreWebappPath( - newStoreName, "ROOT" - ); - - AVMConstants.updateVServerWebapp(path, true); - } - return outcome; + // update the virtualisation server with the default ROOT webapp path + // performed after the main txn has committed successfully + String newStoreName = AVMConstants.buildStagingStoreName(sandboxInfo.getMainStoreName()); + + String path = AVMConstants.buildStoreWebappPath(newStoreName, WEBAPP_DEFAULT); + + AVMConstants.updateVServerWebapp(path, true); + } + return outcome; } - - /** * Persist the forms, templates, workflows and workflow defaults to the model for this web project diff --git a/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java index 42dfc2bcf3..6987e142fd 100644 --- a/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java @@ -196,33 +196,29 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard } /** - * Handle notification to the virtualization server - * (this needs to occur after the sandbox is created). - */ + * Handle notification to the virtualization server + * (this needs to occur after the sandbox is created in the main txn). + */ @Override protected String doPostCommitProcessing(FacesContext context, String outcome) { - // reload virtualisation server for webapp in this web project - if (isStandalone()) - { - for (SandboxInfo sandboxInfo : this.sandboxInfoList) - { - String newlyInvitedStoreName = - AVMConstants.buildStagingStoreName( - sandboxInfo.getMainStoreName()); - - String path = - AVMConstants.buildStoreWebappPath( - newlyInvitedStoreName, this.avmBrowseBean.getWebapp()); - - AVMConstants.updateVServerWebapp(path, true); - } - } - return outcome; + // reload virtualisation server for webapp in this web project + if (isStandalone()) + { + for (SandboxInfo sandboxInfo : this.sandboxInfoList) + { + String newlyInvitedStoreName = AVMConstants.buildStagingStoreName( + sandboxInfo.getMainStoreName()); + + String path = AVMConstants.buildStoreWebappPath( + newlyInvitedStoreName, this.avmBrowseBean.getWebapp()); + + AVMConstants.updateVServerWebapp(path, true); + } + } + return outcome; } - - - + /** * Find all nested user authorities contained with an authority * diff --git a/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java b/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java index 62e756fab3..15b473ebd0 100644 --- a/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java +++ b/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java @@ -465,8 +465,6 @@ public final class SandboxFactory new PropertyValue(DataTypeDefinition.INT, distance)); } - - /** * Debug helper method to dump the properties of a store * diff --git a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java index 2aa33fc91b..42df3dada2 100644 --- a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java @@ -88,7 +88,6 @@ public class SubmitDialog extends BaseDialogBean private Map formWorkflowMap; private List workflowItems; - // The virtualization server might need to be notified // because one or more of the files submitted could alter // the behavior the virtual webapp in the target of the submit. @@ -97,7 +96,6 @@ public class SubmitDialog extends BaseDialogBean // This must take place after the transaction has been completed; // therefore, a variable is needed to store the path to the // updated webapp so it can happen in doPostCommitProcessing. - // private String virtUpdatePath; protected AVMService avmService; @@ -247,9 +245,8 @@ public class SubmitDialog extends BaseDialogBean { // Example srcPath: // mysite--alice:/www/avm_webapps/ROOT/foo.txt - String srcPath = wrapper.getDescriptor().getPath(); - + // We *always* want to update virtualization server // when a workflow sandbox is given data in the // context of a submit workflow. Without this, @@ -266,41 +263,35 @@ public class SubmitDialog extends BaseDialogBean // the submiot list (even if it's not in WEB-INF), // and force the virt server notification after the // transaction has completed via doPostCommitProcessing. - - if ( this.virtUpdatePath == null ) + if (this.virtUpdatePath == null) { - // Example workflow main store name: - // mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652 - String workflowMainStoreName = sandboxInfo.getMainStoreName(); - - // The virtUpdatePath looks just like the srcPath - // except that it belongs to a the main store of - // the workflow sandbox instead of the sandbox - // that originated the submit. - - this.virtUpdatePath = workflowMainStoreName + - srcPath.substring( - srcPath.indexOf(':'), - srcPath.length() - ); + // Example workflow main store name: + // mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652 + String workflowMainStoreName = sandboxInfo.getMainStoreName(); + + // The virtUpdatePath looks just like the srcPath + // except that it belongs to a the main store of + // the workflow sandbox instead of the sandbox + // that originated the submit. + this.virtUpdatePath = + workflowMainStoreName + + srcPath.substring(srcPath.indexOf(':'),srcPath.length()); } - + srcPaths.add(srcPath); } - + final NodeRef workflowPackage = AVMWorkflowUtil.createWorkflowPackage(srcPaths, - sandboxInfo, - path, - avmSubmittedAspect, - this.avmSyncService, - this.avmService, - this.workflowService, - this.nodeService); - + sandboxInfo, + path, + avmSubmittedAspect, + this.avmSyncService, + this.avmService, + this.workflowService, + this.nodeService); + params.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage); - - // add submission parameters params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, getComment()); @@ -336,7 +327,7 @@ public class SubmitDialog extends BaseDialogBean List diffs = new ArrayList(items.size()); // flag indicating if virt server update is already implied - boolean update_vserver = false; + boolean updateVserver = false; for (ItemWrapper wrapper : items) { @@ -344,21 +335,21 @@ public class SubmitDialog extends BaseDialogBean String destPath = stagingPath + wrapper.getPath(); AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER); diffs.add(diff); - + // If nothing has required notifying the virtualization server // so far, check to see if destPath forces a notification // (e.g.: it might be a path to a jar file within WEB-INF/lib). - - if ( ! update_vserver ) + if (!updateVserver) { - // Examples of destPath that require virt server notification: - // - // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml - // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar - - update_vserver = VirtServerUtils.requiresUpdateNotification( destPath ); - - if ( update_vserver ) { this.virtUpdatePath = destPath; } + // Examples of destPath that require virt server notification: + // + // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml + // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar + updateVserver = VirtServerUtils.requiresUpdateNotification( destPath ); + if (updateVserver) + { + this.virtUpdatePath = destPath; + } } } @@ -372,28 +363,25 @@ public class SubmitDialog extends BaseDialogBean } /** - * Handle notification to the virtualization server - * (this needs to occur after the sandbox is updated). - */ + * Handle notification to the virtualization server + * (this needs to occur after the sandbox is updated). + */ @Override protected String doPostCommitProcessing(FacesContext context, String outcome) { - // Force the update because we've already determined - // that update_path requires virt server notification. - - if ( this.virtUpdatePath != null) - { - // Examples of destPath that require virt server notification: - // - // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml - // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar - - AVMConstants.updateVServerWebapp( this.virtUpdatePath, true ); - } - return outcome; + // Force the update because we've already determined + // that update_path requires virt server notification. + if (this.virtUpdatePath != null) + { + // Examples of destPath that require virt server notification: + // + // mysite:/www/avm_webapps/ROOT/WEB-INF/web.xml + // mysite:/www/avm_webapps/ROOT/WEB-INF/lib/moo.jar + AVMConstants.updateVServerWebapp(this.virtUpdatePath, true); + } + return outcome; } - /** * @see org.alfresco.web.bean.dialog.BaseDialogBean#getFinishButtonDisabled() */ diff --git a/source/web/jsp/dialog/rules.jsp b/source/web/jsp/dialog/rules.jsp index 1d5effe158..8991907720 100644 --- a/source/web/jsp/dialog/rules.jsp +++ b/source/web/jsp/dialog/rules.jsp @@ -102,7 +102,7 @@ - + <%-- infomation panel --%>