From 3197d1a2aedf57922fd448750d30d175a6dc9c6e Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Thu, 6 Mar 2008 14:43:55 +0000 Subject: [PATCH] Merged V2.2 to HEAD 7575: Permission changes for AVM. 7577: Incorporated most of the feedback provided by Kevin C earlier today 7578: Removed directory not removed by patch 7579: EmailServer bug fixes AR-1902: Double posts when emailing to a document AR-1904: Attachments via email should be allowed on forum posts AR-1903: (Partial Fix) Text attachments should be treated the same way as other attachments 7583: Fixed WCM-961 & WCM-962: Added confirm dialog for 'Delete All Deployment Reports' and 'Release Server' actions git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8434 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 11 +- config/alfresco/web-client-config-dialogs.xml | 8 + .../web-client-config-wcm-actions.xml | 2 +- .../alfresco/web/bean/wcm/AVMBrowseBean.java | 123 -------------- .../org/alfresco/web/bean/wcm/AVMUtil.java | 6 +- .../wcm/DeleteDeploymentReportsDialog.java | 160 ++++++++++++++++++ .../web/bean/wcm/ReleaseTestServerDialog.java | 118 +++++++++++++ .../ui/wcm/component/UIDeploymentReports.java | 14 +- .../ui/wcm/component/UIDeploymentServers.java | 54 +++++- .../web/ui/wcm/component/UIUserSandboxes.java | 7 +- source/web/WEB-INF/faces-config-beans.xml | 30 ++++ source/web/css/main.css | 5 + source/web/jsp/wcm/deployment-report.jsp | 2 +- .../web/jsp/wcm/manage-review-task-dialog.jsp | 6 +- source/web/scripts/ajax/deployment.js | 4 +- 15 files changed, 401 insertions(+), 149 deletions(-) create mode 100644 source/java/org/alfresco/web/bean/wcm/DeleteDeploymentReportsDialog.java create mode 100644 source/java/org/alfresco/web/bean/wcm/ReleaseTestServerDialog.java diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 57324bcedd..66a12ad5ed 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -129,6 +129,7 @@ new_category_description=Enter information about the new Category then click Cre status_message_default=No messages. no_icons_found=No icons found required_field=Required Field +no_data=-- # UI Component messages yes=Yes @@ -1140,6 +1141,11 @@ pending_promote=Submit Now pending_abort=Abort Submission task_done_resubmit_all=Task Done & Re-Submit All delete_all_deploy_reports=Delete All Deploy Reports +delete_reports_info=To remove all deployment reports in the web project, click Yes. +delete_reports_confirm=Are you sure you want to delete all deployment reports across all sandboxes in this webproject? +release_server_title=Release Test Server +release_server_info=To release the test server from this sandbox, click Yes. +release_server_confirm=Are you sure you want to release the test server allocated to this sandbox? # Website actions and dialog messages title_import_content=Web Project Bulk Import @@ -1247,13 +1253,14 @@ deploy_server_allocated=Allocated deploy_server_source_path=Source Path deploy_server_excludes=Excludes deploy_server_target_name=Target Name +deploy_server_include_auto_deploy=Include In Auto Deploy deploy_automatically=Auto Deploy deploy_automatically_info=This will deploy the changes from this submission upon approval. deploy_attempt_date=Attempt Date select_deploy_attempt=View Deployment Attempt deployed_to_servers=Deployed To no_deploy_attempts=There are no deployment attempts to display in this date range. -no_deploy_reports=Deployment details can not be found, this is probably because the deployment is still progressing, refresh this page until details appear. +no_deploy_reports=Deployment details cannot be found, this is probably because the deployment is still progressing, refresh this page until details appear. port_must_be_number=Port must contain a number. edit_deploy_server=Edit Deployment Server Details delete_deploy_server=Delete Deployment Server @@ -1264,6 +1271,8 @@ edit_alf_deploy_server_info=Edit details of the Alfresco Server Receiver edit_file_deploy_server_info=Edit details of the File System Receiver reason=Reason snapshot=Snapshot +current_working_version=current working version +review_sandbox=Review Sandbox content_launch=Content Launch launch_date=Launch Date expiration_date_header=Content Expiration diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index 260a0af26b..eb6f5946e3 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -282,6 +282,14 @@ icon="/images/icons/deploy_large.gif" title-id="monitor_deployment_title" description-id="monitor_deployment_desc" show-ok-button="false" /> + + + + delete_all_deploy_reports /images/icons/delete_deploy_reports.gif - #{AVMBrowseBean.deleteAllDeploymentReports} + dialog:deleteDeploymentReports #{BrowseBean.setupSpaceAction} #{actionContext.id} diff --git a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java index a7cb2ab623..bb6bdff80c 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java @@ -50,8 +50,6 @@ import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.actions.AVMRevertStoreAction; import org.alfresco.repo.avm.actions.AVMUndoSandboxListAction; import org.alfresco.repo.domain.PropertyValue; -import org.alfresco.repo.transaction.RetryingTransactionHelper; -import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.sandbox.SandboxConstants; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionService; @@ -60,7 +58,6 @@ import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMStoreDescriptor; import org.alfresco.service.cmr.avmsync.AVMDifference; import org.alfresco.service.cmr.avmsync.AVMSyncService; -import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; @@ -71,7 +68,6 @@ import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.cmr.workflow.WorkflowService; import org.alfresco.service.namespace.QName; -import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.util.Pair; import org.alfresco.util.VirtServerUtils; import org.alfresco.web.app.Application; @@ -1422,125 +1418,6 @@ public class AVMBrowseBean implements IContextListener AVMUtil.updateVServerWebapp(webappPath, true); } - /** - * Releases the test server allocated to the store - */ - public void releaseTestServer(ActionEvent event) - { - UIActionLink link = (UIActionLink)event.getComponent(); - Map params = link.getParameterMap(); - String store = params.get("store"); - - if (store != null) - { - UserTransaction tx = null; - try - { - FacesContext context = FacesContext.getCurrentInstance(); - tx = Repository.getUserTransaction(context, false); - tx.begin(); - - NodeRef testServer = DeploymentUtil.findAllocatedTestServer(store); - if (testServer != null) - { - getNodeService().setProperty(testServer, - WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO, null); - - if (logger.isDebugEnabled()) - logger.debug("Released test server '" + testServer + "' from store: " + store); - } - - tx.commit(); - } - catch (Throwable err) - { - Utils.addErrorMessage(MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err); - try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} - } - } - } - - /** - * Deletes all deploymentreport nodes associated with the web project - */ - public String deleteAllDeploymentReports() - { - FacesContext context = FacesContext.getCurrentInstance(); - RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context); - RetryingTransactionCallback callback = new RetryingTransactionCallback() - { - @SuppressWarnings("unchecked") - public String execute() throws Throwable - { - // just in case there are any left, iterate through any old deploymentreport - // associations from the current web project and delete them. - List deployReportRefs = nodeService.getChildAssocs( - getWebsite().getNodeRef(), WCMAppModel.ASSOC_DEPLOYMENTREPORT, - RegexQNamePattern.MATCH_ALL); - int count = deployReportRefs.size(); - for (ChildAssociationRef ref : deployReportRefs) - { - NodeRef report = ref.getChildRef(); - if (report != null) - { - // remove the node - nodeService.deleteNode(report); - } - } - - // iterate through all deploymentattempt associations from the current - // web project and delete them. - List deployAttemptRefs = nodeService.getChildAssocs( - getWebsite().getNodeRef(), WCMAppModel.ASSOC_DEPLOYMENTATTEMPT, - RegexQNamePattern.MATCH_ALL); - count += deployAttemptRefs.size(); - for (ChildAssociationRef ref : deployAttemptRefs) - { - NodeRef attempt = ref.getChildRef(); - if (attempt != null) - { - // remove the node - nodeService.deleteNode(attempt); - } - } - - // remove the old properties in case they are still present - nodeService.removeProperty(getWebsite().getNodeRef(), - WCMAppModel.PROP_DEPLOYTO); - nodeService.removeProperty(getWebsite().getNodeRef(), - WCMAppModel.PROP_SELECTEDDEPLOYTO); - nodeService.removeProperty(getWebsite().getNodeRef(), - WCMAppModel.PROP_SELECTEDDEPLOYVERSION); - - // remove the hasBeenDeployed object from the session so it gets - // re-evaluated (and disappears) - Map request = FacesContext.getCurrentInstance(). - getExternalContext().getRequestMap(); - request.remove(REQUEST_BEEN_DEPLOYED_RESULT); - - if (logger.isDebugEnabled()) - logger.debug("Removed " + count + " previous deployment attempts"); - - return null; - } - }; - - try - { - // Execute - txnHelper.doInTransaction(callback); - } - catch (Exception err) - { - Utils.addErrorMessage(MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), - err.getMessage()), err); - } - - return "browseWebsite"; - } - /** * Undo changes to a single node */ diff --git a/source/java/org/alfresco/web/bean/wcm/AVMUtil.java b/source/java/org/alfresco/web/bean/wcm/AVMUtil.java index d6e2790081..01484f7eef 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMUtil.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMUtil.java @@ -956,12 +956,12 @@ public final class AVMUtil } // Component Separator. - /*package*/ static final String STORE_SEPARATOR = "--"; + public static final String STORE_SEPARATOR = "--"; // names of the stores representing the layers for an AVM website //XXXarielb this should be private - /*package*/ final static String STORE_WORKFLOW = "workflow"; - private final static String STORE_PREVIEW = "preview"; + public final static String STORE_WORKFLOW = "workflow"; + public final static String STORE_PREVIEW = "preview"; // servlet default webapp // Note: this webapp is mapped to the URL path "" diff --git a/source/java/org/alfresco/web/bean/wcm/DeleteDeploymentReportsDialog.java b/source/java/org/alfresco/web/bean/wcm/DeleteDeploymentReportsDialog.java new file mode 100644 index 0000000000..ff6b22ab40 --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/DeleteDeploymentReportsDialog.java @@ -0,0 +1,160 @@ +/* + * 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.web.bean.wcm; + +import java.util.List; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.WCMAppModel; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.RegexQNamePattern; +import org.alfresco.web.app.AlfrescoNavigationHandler; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.dialog.BaseDialogBean; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean implementation for the "Delete Deployment Reports" dialog + * + * @author gavinc + */ +public class DeleteDeploymentReportsDialog extends BaseDialogBean +{ + protected AVMBrowseBean avmBrowseBean; + + private static final long serialVersionUID = -3702005115210010993L; + + private static final Log logger = LogFactory.getLog(DeleteDeploymentReportsDialog.class); + + // ------------------------------------------------------------------------------ + // Dialog implementation + + @SuppressWarnings("unchecked") + @Override + protected String finishImpl(FacesContext context, String outcome) + throws Exception + { + // get the node service and the website we are deleting reports for + NodeService nodeService = this.getNodeService(); + NodeRef websiteRef = this.avmBrowseBean.getWebsite().getNodeRef(); + + // just in case there are any left, iterate through any old deploymentreport + // associations from the current web project and delete them. + List deployReportRefs = nodeService.getChildAssocs( + websiteRef, WCMAppModel.ASSOC_DEPLOYMENTREPORT, + RegexQNamePattern.MATCH_ALL); + int count = deployReportRefs.size(); + for (ChildAssociationRef ref : deployReportRefs) + { + NodeRef report = ref.getChildRef(); + if (report != null) + { + // remove the node + nodeService.deleteNode(report); + } + } + + // iterate through all deploymentattempt associations from the current + // web project and delete them. + List deployAttemptRefs = nodeService.getChildAssocs( + websiteRef, WCMAppModel.ASSOC_DEPLOYMENTATTEMPT, + RegexQNamePattern.MATCH_ALL); + count += deployAttemptRefs.size(); + for (ChildAssociationRef ref : deployAttemptRefs) + { + NodeRef attempt = ref.getChildRef(); + if (attempt != null) + { + // remove the node + nodeService.deleteNode(attempt); + } + } + + // remove the old properties in case they are still present + nodeService.removeProperty(websiteRef, + WCMAppModel.PROP_DEPLOYTO); + nodeService.removeProperty(websiteRef, + WCMAppModel.PROP_SELECTEDDEPLOYTO); + nodeService.removeProperty(websiteRef, + WCMAppModel.PROP_SELECTEDDEPLOYVERSION); + + // remove the hasBeenDeployed object from the session so it gets + // re-evaluated (and disappears) + Map request = FacesContext.getCurrentInstance(). + getExternalContext().getRequestMap(); + request.remove(AVMBrowseBean.REQUEST_BEEN_DEPLOYED_RESULT); + + if (logger.isDebugEnabled()) + logger.debug("Removed " + count + " previous deployment attempts"); + + // close dialog and refresh website view + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browseWebsite"; + } + + @Override + public boolean getFinishButtonDisabled() + { + return false; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "yes"); + } + + @Override + public String getCancelButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "no"); + } + + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + /** + * @param avmBrowseBean The AVM BrowseBean to set + */ + public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean) + { + this.avmBrowseBean = avmBrowseBean; + } + + /** + * Returns the confirmation to display to the user before deleting the reports. + * + * @return The message to display + */ + public String getConfirmMessage() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "delete_reports_confirm"); + } +} diff --git a/source/java/org/alfresco/web/bean/wcm/ReleaseTestServerDialog.java b/source/java/org/alfresco/web/bean/wcm/ReleaseTestServerDialog.java new file mode 100644 index 0000000000..ad03c4c57e --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/ReleaseTestServerDialog.java @@ -0,0 +1,118 @@ +/* + * 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.web.bean.wcm; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.WCMAppModel; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.web.app.AlfrescoNavigationHandler; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.dialog.BaseDialogBean; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean implementation for the "Release Test Server" dialog + * + * @author gavinc + */ +public class ReleaseTestServerDialog extends BaseDialogBean +{ + protected String store; + + private static final long serialVersionUID = -3702005115210010993L; + + private static final Log logger = LogFactory.getLog(ReleaseTestServerDialog.class); + + // ------------------------------------------------------------------------------ + // Dialog implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + this.store = parameters.get("store"); + + if (this.store == null || this.store.length() == 0) + { + throw new IllegalArgumentException("store parameter is mandatory"); + } + } + + @SuppressWarnings("unchecked") + @Override + protected String finishImpl(FacesContext context, String outcome) + throws Exception + { + NodeRef testServer = DeploymentUtil.findAllocatedTestServer(this.store); + if (testServer != null) + { + getNodeService().setProperty(testServer, + WCMAppModel.PROP_DEPLOYSERVERALLOCATEDTO, null); + + if (logger.isDebugEnabled()) + logger.debug("Released test server '" + testServer + "' from store: " + this.store); + } + + // close dialog and refresh website view + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browseWebsite"; + } + + @Override + public boolean getFinishButtonDisabled() + { + return false; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "yes"); + } + + @Override + public String getCancelButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "no"); + } + + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + /** + * Returns the confirmation to display to the user before deleting the reports. + * + * @return The message to display + */ + public String getConfirmMessage() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "release_server_confirm"); + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentReports.java b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentReports.java index 5d7a2e09f3..1dd9fcfa88 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentReports.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentReports.java @@ -371,9 +371,16 @@ public class UIDeploymentReports extends SelfRenderingComponent out.write(""); out.write(attempt.getServers()); out.write(""); - if (attempt.getVersion() != null) + Integer version = attempt.getVersion(); + if (version != null) { - out.write(attempt.getVersion().toString()); + out.write(version.toString()); + if (version.intValue() == -1) + { + out.write(" ("); + out.write(bundle.getString("current_working_version")); + out.write(")"); + } } out.write(""); } @@ -527,6 +534,7 @@ public class UIDeploymentReports extends SelfRenderingComponent content = reader.getContentString(); if (content != null) { + content = Utils.encode(content); content = StringUtils.replace(content, "\r\n", "
"); } else @@ -673,7 +681,7 @@ public class UIDeploymentReports extends SelfRenderingComponent out.write(""); } out.write("\n
\n"); diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java index fb98ba6dd8..e16bdd2011 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java @@ -48,6 +48,7 @@ import org.alfresco.repo.avm.actions.AVMDeployWebsiteAction; 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.DeploymentServerConfig; import org.alfresco.web.ui.common.ComponentConstants; import org.alfresco.web.ui.common.PanelGenerator; @@ -76,10 +77,11 @@ public class UIDeploymentServers extends UIInput private static final String MSG_SOURCE = "deploy_server_source_path"; private static final String MSG_TARGET = "deploy_server_target_name"; private static final String MSG_EXCLUDES = "deploy_server_excludes"; - private static final String MSG_AUTO_DEPLOY = "deploy_automatically"; + private static final String MSG_INCLUDE_AUTO_DEPLOY = "deploy_server_include_auto_deploy"; private static final String MSG_EDIT = "edit_deploy_server"; private static final String MSG_DELETE = "delete_deploy_server"; private static final String MSG_NO_DEPLOY_SERVERS = "no_deploy_servers"; + private static final String MSG_NO_DATA = "no_data"; private List servers; private DeploymentServerConfig currentServer; @@ -319,6 +321,7 @@ public class UIDeploymentServers extends UIInput { String contextPath = context.getExternalContext().getRequestContextPath(); ResourceBundle bundle = Application.getBundle(context); + String noData = bundle.getString(MSG_NO_DATA); String serverName = (String)server.getProperties().get(DeploymentServerConfig.PROP_NAME); if (serverName == null || serverName.length() == 0) @@ -358,6 +361,10 @@ public class UIDeploymentServers extends UIInput { out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_PORT)); } + else + { + out.write(noData); + } out.write(""); out.write(""); @@ -384,6 +391,10 @@ public class UIDeploymentServers extends UIInput { out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_URL))); } + else + { + out.write(noData); + } out.write(""); out.write(""); @@ -393,6 +404,10 @@ public class UIDeploymentServers extends UIInput { out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_USER))); } + else + { + out.write(noData); + } out.write(""); out.write(""); @@ -403,6 +418,10 @@ public class UIDeploymentServers extends UIInput { out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH))); } + else + { + out.write(noData); + } out.write(""); out.write(""); if (WCMAppModel.CONSTRAINT_FILEDEPLOY.equals(server.getDeployType())) @@ -423,6 +446,10 @@ public class UIDeploymentServers extends UIInput { out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME))); } + else + { + out.write(noData); + } out.write(""); } @@ -430,7 +457,7 @@ public class UIDeploymentServers extends UIInput server.getProperties().get(DeploymentServerConfig.PROP_TYPE))) { out.write(""); // create and add the cancel button 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 de5442150c..4e2fe1a46e 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java @@ -46,8 +46,6 @@ import javax.transaction.UserTransaction; import org.alfresco.model.WCMAppModel; import org.alfresco.repo.avm.AVMNodeConverter; -import org.alfresco.repo.domain.PropertyValue; -import org.alfresco.sandbox.SandboxConstants; import org.alfresco.service.cmr.avm.AVMNodeDescriptor; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avmsync.AVMDifference; @@ -65,8 +63,8 @@ import org.alfresco.web.app.servlet.FacesHelper; import org.alfresco.web.bean.BrowseBean; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.User; -import org.alfresco.web.bean.wcm.AVMUtil; import org.alfresco.web.bean.wcm.AVMNode; +import org.alfresco.web.bean.wcm.AVMUtil; import org.alfresco.web.bean.wcm.DeploymentUtil; import org.alfresco.web.bean.wcm.WebProject; import org.alfresco.web.config.ClientConfigElement; @@ -491,7 +489,8 @@ public class UIUserSandboxes extends SelfRenderingComponent implements Serializa { UIActionLink releaseServer = createAction(context, mainStore, username, ACT_SANDBOX_RELEASE_SERVER, "/images/icons/release_server.gif", - "#{AVMBrowseBean.releaseTestServer}", null, null, null, false); + "#{DialogManager.setupParameters}", "dialog:releaseTestServer", + null, null, false); menu.getChildren().add(releaseServer); } diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index c14372f06d..65606393b7 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -4079,6 +4079,36 @@ nodeService#{NodeService} + + + + + The bean that backs up the Delete Deployment Reports Dialog + + DeleteDeploymentReportsDialog + org.alfresco.web.bean.wcm.DeleteDeploymentReportsDialog + session + + nodeService + #{NodeService} + + + avmBrowseBean + #{AVMBrowseBean} + + + + + + The bean that backs up the Release Test Server Dialog + + ReleaseTestServerDialog + org.alfresco.web.bean.wcm.ReleaseTestServerDialog + session + + nodeService + #{NodeService} + diff --git a/source/web/css/main.css b/source/web/css/main.css index 45eca03e88..3ae60e1c2b 100644 --- a/source/web/css/main.css +++ b/source/web/css/main.css @@ -766,6 +766,11 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited width: 200px; } +#autoDeployLabel +{ + vertical-align: 3px; +} + .deployNoConfigServers { margin: 26px 5px 16px 3px; diff --git a/source/web/jsp/wcm/deployment-report.jsp b/source/web/jsp/wcm/deployment-report.jsp index 01d18a7f0b..738c5595f5 100644 --- a/source/web/jsp/wcm/deployment-report.jsp +++ b/source/web/jsp/wcm/deployment-report.jsp @@ -36,7 +36,7 @@ - diff --git a/source/web/jsp/wcm/manage-review-task-dialog.jsp b/source/web/jsp/wcm/manage-review-task-dialog.jsp index db1eb80b0b..c1d33473f7 100644 --- a/source/web/jsp/wcm/manage-review-task-dialog.jsp +++ b/source/web/jsp/wcm/manage-review-task-dialog.jsp @@ -66,11 +66,9 @@ + action="#{DialogManager.bean.deploy}" rendered="#{DialogManager.bean.testServersAvailable}" /> + action="#{DialogManager.bean.viewDeployReport}" rendered="#{DialogManager.bean.deployAttempted}" /> diff --git a/source/web/scripts/ajax/deployment.js b/source/web/scripts/ajax/deployment.js index 106f278396..2da2cbfe57 100644 --- a/source/web/scripts/ajax/deployment.js +++ b/source/web/scripts/ajax/deployment.js @@ -176,7 +176,7 @@ Alfresco.deployServerTypeChanged = function() } else { - autoDeployLabel.style.display = "block"; + autoDeployLabel.style.display = "inline"; } } @@ -190,7 +190,7 @@ Alfresco.deployServerTypeChanged = function() } else { - autoDeployCheckbox.style.display = "block"; + autoDeployCheckbox.style.display = "inline"; } } }
"); @@ -412,6 +431,10 @@ public class UIDeploymentServers extends UIInput { out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_EXCLUDES))); } + else + { + out.write(noData); + } out.write("
"); - out.write(bundle.getString(MSG_AUTO_DEPLOY)); + out.write(bundle.getString(MSG_INCLUDE_AUTO_DEPLOY)); out.write(":"); if (server.getProperties().get(DeploymentServerConfig.PROP_ON_APPROVAL) != null) { @@ -459,9 +486,22 @@ public class UIDeploymentServers extends UIInput DeploymentServerConfig.PROP_ALLOCATED_TO); out.write(""); + out.write("'>"); out.write(bundle.getString("yes")); - out.write(""); + out.write(" ("); + if (allocatedToTip.indexOf( + AVMUtil.STORE_SEPARATOR + AVMUtil.STORE_WORKFLOW + "-") != -1) + { + out.write(bundle.getString("review_sandbox")); + } + else + { + String username = allocatedToTip.substring( + allocatedToTip.indexOf(AVMUtil.STORE_SEPARATOR) + + AVMUtil.STORE_SEPARATOR.length()); + out.write(username); + } + out.write(")"); } else { @@ -716,9 +756,7 @@ public class UIDeploymentServers extends UIInput } // create the auto deploy checkbox - out.write("
"); - out.write(bundle.getString(MSG_AUTO_DEPLOY)); - out.write(":"); + out.write("
"); UIComponent auto = context.getApplication().createComponent( UISelectBoolean.COMPONENT_TYPE); FacesHelper.setupComponentId(context, auto, "autoDeployCheckbox"); @@ -728,6 +766,8 @@ public class UIDeploymentServers extends UIInput auto.setValueBinding("value", vbAuto); this.getChildren().add(auto); Utils.encodeRecursive(context, auto); + out.write(" "); + out.write(bundle.getString(MSG_INCLUDE_AUTO_DEPLOY)); out.write("