From 3ad9668624db71fb337de04cd78e1cf4bc9d0f2f Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Mon, 11 Jun 2007 20:54:23 +0000 Subject: [PATCH] - Partial first cut of initial version of links management UI git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5917 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 19 + config/alfresco/web-client-config-dialogs.xml | 16 +- .../alfresco/web/bean/wcm/AVMBrowseBean.java | 39 ++ .../bean/wcm/LinkValidationProgressBean.java | 74 ++++ .../bean/wcm/LinkValidationReportDialog.java | 136 +++++++ .../web/bean/wcm/LinkValidationRunDialog.java | 198 +++++++++ .../web/bean/wcm/LinkValidationState.java | 379 ++++++++++++++++++ ...AbstractLinkValidationReportComponent.java | 89 ++++ .../UILinkValidationBrokenFiles.java | 192 +++++++++ .../component/UILinkValidationFixedFiles.java | 144 +++++++ .../component/UILinkValidationProgress.java | 148 +++++++ .../component/UILinkValidationSummary.java | 115 ++++++ .../wcm/tag/LinkValidationBrokenFilesTag.java | 82 ++++ .../wcm/tag/LinkValidationFixedFilesTag.java | 82 ++++ .../ui/wcm/tag/LinkValidationProgressTag.java | 51 +++ .../ui/wcm/tag/LinkValidationSummaryTag.java | 82 ++++ source/web/WEB-INF/faces-config-beans.xml | 51 +++ source/web/WEB-INF/faces-config-wcm.xml | 20 + source/web/WEB-INF/wcm.tld | 108 +++++ source/web/css/main.css | 78 ++++ source/web/images/icons/fixed_link.gif | Bin 0 -> 335 bytes .../images/icons/link_validation_report.gif | Bin 0 -> 335 bytes .../icons/link_validation_report_large.gif | Bin 0 -> 967 bytes source/web/images/icons/placeholder.gif | Bin 0 -> 335 bytes source/web/images/icons/placeholder_large.gif | Bin 0 -> 967 bytes .../web/images/icons/run_link_validation.gif | Bin 0 -> 335 bytes .../icons/run_link_validation_large.gif | Bin 0 -> 967 bytes source/web/jsp/wcm/browse-website.jsp | 5 + source/web/jsp/wcm/link-validation-report.jsp | 46 +++ source/web/jsp/wcm/run-link-validation.jsp | 35 ++ .../scripts/ajax/link-validation-progress.js | 61 +++ 31 files changed, 2248 insertions(+), 2 deletions(-) create mode 100644 source/java/org/alfresco/web/bean/wcm/LinkValidationProgressBean.java create mode 100644 source/java/org/alfresco/web/bean/wcm/LinkValidationReportDialog.java create mode 100644 source/java/org/alfresco/web/bean/wcm/LinkValidationRunDialog.java create mode 100644 source/java/org/alfresco/web/bean/wcm/LinkValidationState.java create mode 100644 source/java/org/alfresco/web/ui/wcm/component/AbstractLinkValidationReportComponent.java create mode 100644 source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java create mode 100644 source/java/org/alfresco/web/ui/wcm/component/UILinkValidationFixedFiles.java create mode 100644 source/java/org/alfresco/web/ui/wcm/component/UILinkValidationProgress.java create mode 100644 source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java create mode 100644 source/java/org/alfresco/web/ui/wcm/tag/LinkValidationBrokenFilesTag.java create mode 100644 source/java/org/alfresco/web/ui/wcm/tag/LinkValidationFixedFilesTag.java create mode 100644 source/java/org/alfresco/web/ui/wcm/tag/LinkValidationProgressTag.java create mode 100644 source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java create mode 100644 source/web/images/icons/fixed_link.gif create mode 100644 source/web/images/icons/link_validation_report.gif create mode 100644 source/web/images/icons/link_validation_report_large.gif create mode 100644 source/web/images/icons/placeholder.gif create mode 100644 source/web/images/icons/placeholder_large.gif create mode 100644 source/web/images/icons/run_link_validation.gif create mode 100644 source/web/images/icons/run_link_validation_large.gif create mode 100644 source/web/jsp/wcm/link-validation-report.jsp create mode 100644 source/web/jsp/wcm/run-link-validation.jsp create mode 100644 source/web/scripts/ajax/link-validation-progress.js diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index b7b155a250..572ef27c39 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1131,6 +1131,25 @@ change_expiration_date_change=Note: To change individual expiration dates click change_expiration_date_title=Change Expiration Date change_expiration_date_desc=This dialog allows you to change the expiration date for a modified item. expired_content_for_review=Expired Content For Review +run_link_validaton_title=Run Link Validation +run_link_validaton_desc=This dialog shows the progress of the link validation check currently running. +check_links=Check Links +checking_links_progress=Generating links report, please wait... +checking_links_status=Checked 0 links in 0 files. +link_validation_unknown_error=An unknown error occurred during the link validation check +link_validation_error=An error occurred during the link validation check +link_validaton_report_title=Link Validation Report +link_validaton_report_desc=This dialog shows the results of the last link validation and allows broken links to be fixed. +initial_check=Initial check +current_status=Current status +files_links_checked={0} file(s) were checked, {1} link(s) were found. +files_links_broken={0} broken link(s) were found in {1} file(s). +files_links_still_broken={0} link(s) still broken in {1} file(s). +broken_links_fixed={0} broken link(s) have been fixed. +files_with_broken_links=Files with broken links +broken_links=Broken Links +rerun_report=Re-Run Report +fixed_files=Files that have been fixed # New User Wizard messages new_user_title=New User Wizard diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index 2445499e73..24f682a7f1 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -240,12 +240,24 @@ managed-bean="ViewDeploymentReportDialog" icon="/images/icons/deployment_report_large.gif" title-id="deployment_report_title" - description-id="deployment_report_desc" show-ok-button="false"/> + description-id="deployment_report_desc" show-ok-button="false" /> + description-id="monitor_deployment_desc" show-ok-button="false" /> + + + + expiredNodes = Collections.emptyList(); + /** Object used by link validation service to monitor the status of a link check */ + private HrefValidationProgress linkValidationMonitor; + + /** Link validation state instance used by link validation dialogs */ + private LinkValidationState linkValidationState; + /* component references */ private UIRichList foldersRichList; private UIRichList filesRichList; @@ -456,6 +463,38 @@ public class AVMBrowseBean implements IContextListener { this.deploymentMonitorIds = deploymentMonitorIds; } + + /** + * @return Returns the link validation monitor instance + */ + public HrefValidationProgress getLinkValidationMonitor() + { + return this.linkValidationMonitor; + } + + /** + * @param monitor The link validation monitor instance to use + */ + public void setLinkValidationMonitor(HrefValidationProgress monitor) + { + this.linkValidationMonitor = monitor; + } + + /** + * @return Returns the link validation state instance + */ + public LinkValidationState getLinkValidationState() + { + return this.linkValidationState; + } + + /** + * @param monitor The link validation state instance to use + */ + public void setLinkValidationState(LinkValidationState state) + { + this.linkValidationState = state; + } /** * Returns the list of expired nodes. Used by the submit dialog to retrieve diff --git a/source/java/org/alfresco/web/bean/wcm/LinkValidationProgressBean.java b/source/java/org/alfresco/web/bean/wcm/LinkValidationProgressBean.java new file mode 100644 index 0000000000..ed0164829c --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/LinkValidationProgressBean.java @@ -0,0 +1,74 @@ +/* + * 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.io.IOException; + +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean used by the AJAX callback from the RunLinkValidationDialog. + * + * @author gavinc + */ +public class LinkValidationProgressBean +{ + private AVMBrowseBean avmBrowseBean; + + private static Log logger = LogFactory.getLog(LinkValidationProgressBean.class); + + public void getStatus() throws IOException + { + FacesContext context = FacesContext.getCurrentInstance(); + ResponseWriter out = context.getResponseWriter(); + + if (logger.isDebugEnabled()) + logger.debug("Retrieving progress status for link validation check..."); + + StringBuilder xml = new StringBuilder(""); + xml.append(""); + + // send the generated XML back to the callee + out.write(xml.toString()); + + if (logger.isDebugEnabled()) + logger.debug("returning XML: " + xml.toString()); + } + + public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean) + { + this.avmBrowseBean = avmBrowseBean; + } +} diff --git a/source/java/org/alfresco/web/bean/wcm/LinkValidationReportDialog.java b/source/java/org/alfresco/web/bean/wcm/LinkValidationReportDialog.java new file mode 100644 index 0000000000..106f6de80c --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/LinkValidationReportDialog.java @@ -0,0 +1,136 @@ +/* + * 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.HashMap; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.service.cmr.action.ActionService; +import org.alfresco.service.cmr.avm.AVMService; +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; + +/** + * Implementation of the link validation report dialog. + * + * @author gavinc + */ +public class LinkValidationReportDialog extends BaseDialogBean +{ + protected AVMBrowseBean avmBrowseBean; + protected AVMService avmService; + protected ActionService actionService; + + private String store; + + private static final Log logger = LogFactory.getLog(LinkValidationReportDialog.class); + + // ------------------------------------------------------------------------------ + // Dialog implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + // setup context for dialog + store = parameters.get("store"); + + if (logger.isDebugEnabled()) + logger.debug("Showing link validation report for store '" + store + "'"); + } + + @SuppressWarnings("unchecked") + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + if (logger.isDebugEnabled()) + logger.debug("Re-running link validation report for store '" + store + "'"); + + Map params = new HashMap(1); + params.put("store", this.store); + params.put("rerun", "true"); + Application.getDialogManager().setupParameters(params); + + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + + "dialog:runLinkValidation"; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "rerun_report"); + } + + @Override + public boolean getFinishButtonDisabled() + { + return (this.avmBrowseBean.getLinkValidationState().getNumberBrokenLinks() == 0); + } + + @Override + public String getCancelButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "close"); + } + + @Override + protected String getDefaultCancelOutcome() + { + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + + "browseWebsite"; + } + + // ------------------------------------------------------------------------------ + // Bean getters and setters + + /** + * @param avmBrowseBean The AVM BrowseBean to set + */ + public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean) + { + this.avmBrowseBean = avmBrowseBean; + } + + public void setAvmService(AVMService avmService) + { + this.avmService = avmService; + } + + /** + * @param actionService The actionService to set. + */ + public void setActionService(ActionService actionService) + { + this.actionService = actionService; + } +} diff --git a/source/java/org/alfresco/web/bean/wcm/LinkValidationRunDialog.java b/source/java/org/alfresco/web/bean/wcm/LinkValidationRunDialog.java new file mode 100644 index 0000000000..739f6ac3c6 --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/LinkValidationRunDialog.java @@ -0,0 +1,198 @@ +/* + * 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.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.linkvalidation.HrefValidationProgress; +import org.alfresco.linkvalidation.LinkValidationAction; +import org.alfresco.linkvalidation.LinkValidationReport; +import org.alfresco.repo.avm.AVMNodeConverter; +import org.alfresco.repo.domain.PropertyValue; +import org.alfresco.sandbox.SandboxConstants; +import org.alfresco.service.cmr.action.Action; +import org.alfresco.service.cmr.action.ActionService; +import org.alfresco.service.cmr.avm.AVMService; +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.alfresco.web.ui.common.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Implementation of the run link validation dialog. + * + * @author gavinc + */ +public class LinkValidationRunDialog extends BaseDialogBean +{ + protected AVMBrowseBean avmBrowseBean; + protected AVMService avmService; + protected ActionService actionService; + + private String store; + private NodeRef storeRef; + private boolean rerun = false; + + private static final Log logger = LogFactory.getLog(LinkValidationRunDialog.class); + + // ------------------------------------------------------------------------------ + // Dialog implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + // TODO: determine whether the virtualisation server is running, if it's not + // we need to throw an exception to reflect that + + // setup context for dialog + store = parameters.get("store"); + + String storePath = this.store + ":/"; + this.storeRef = AVMNodeConverter.ToNodeRef(-1, storePath); + + this.rerun = false; + String rerunParam = parameters.get("rerun"); + if (rerunParam != null && rerunParam.equals("true")) + { + this.rerun = true; + } + + if (logger.isDebugEnabled()) + { + if (this.rerun) + logger.debug("Starting re-run link validation check for store '" + store + "'"); + else + logger.debug("Starting initial link validation check for store '" + store + "'"); + } + + // create context required to run and monitor the link check + HrefValidationProgress monitor = new HrefValidationProgress(); + Map args = new HashMap(1, 1.0f); + args.put(LinkValidationAction.PARAM_MONITOR, monitor); + this.avmBrowseBean.setLinkValidationMonitor(monitor); + + // create and execute the action in the background + Action action = this.actionService.createAction(LinkValidationAction.NAME, args); + this.actionService.executeAction(action, this.storeRef, false, true); + } + + @SuppressWarnings("unchecked") + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + return outcome; + } + + // ------------------------------------------------------------------------------ + // Event handlers + + public String linkCheckCompleted() + { + String outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; + + // the link validation report should be stored as a store property + // on the store the link check was run on, retrieve it and see if + // the link check was successful. + + PropertyValue val = this.avmService.getStoreProperty(this.store, + SandboxConstants.PROP_LINK_VALIDATION_REPORT); + if (val != null) + { + LinkValidationReport report = (LinkValidationReport)val.getSerializableValue(); + if (report != null) + { + if (report.wasSuccessful()) + { + // setup the context required by the reporting components to display the results + if (this.rerun) + { + this.avmBrowseBean.getLinkValidationState().updateState(report); + } + else + { + LinkValidationState state = new LinkValidationState(this.store, report); + this.avmBrowseBean.setLinkValidationState(state); + } + + Map params = new HashMap(1); + params.put("store", this.store); + Application.getDialogManager().setupParameters(params); + + outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + + "dialog:linkValidationReport"; + } + else + { + FacesContext context = FacesContext.getCurrentInstance(); + String errorMsg = Application.getMessage(context, "link_validation_unknown_error"); + Throwable cause = report.getError(); + if (cause != null) + { + errorMsg = Application.getMessage(context, "link_validation_error") + ": " + + cause.getMessage(); + } + + Utils.addErrorMessage(errorMsg); + } + } + } + + return outcome; + } + + // ------------------------------------------------------------------------------ + // Bean getters and setters + + /** + * @param avmBrowseBean The AVM BrowseBean to set + */ + public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean) + { + this.avmBrowseBean = avmBrowseBean; + } + + public void setAvmService(AVMService avmService) + { + this.avmService = avmService; + } + + /** + * @param actionService The actionService to set. + */ + public void setActionService(ActionService actionService) + { + this.actionService = actionService; + } +} diff --git a/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java b/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java new file mode 100644 index 0000000000..783c5ab33a --- /dev/null +++ b/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java @@ -0,0 +1,379 @@ +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.alfresco.linkvalidation.LinkValidationReport; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Object used to retrieve and store the state of a link validaton process. + * The object is given an initial link validation report object (the result + * of a LinkValidationService service call) which is used by components + * to display the result of the links check. + *

+ * Further reports can then subsequently be given to this object at which + * point a difference is calculated i.e. which links (if any) have been + * fixed. This allows components to display the progress of link fixing. + *

+ * + * @author gavinc + */ +public class LinkValidationState +{ + private String store; + private boolean checkBeenReRun = false; + + private int noFilesCheckedStart = 0; + private int noFilesCheckedLast = 0; + + private int noLinksCheckedStart = 0; + private int noLinksCheckedLast = 0; + + private int noBrokenFilesStart = 0; + private int noBrokenFilesLast = 0; + + private int noBrokenLinksStart = 0; + private int noBrokenLinksLast = 0; + + private int noFixedFiles = 0; + private int noFixedLinks = 0; + + private List brokenStaticFilesStart; + private List brokenFormsStart; + + private List brokenStaticFilesLast; + private List brokenFormsLast; + + private List fixedStaticFiles; + private List fixedForms; + + private List fixedStaticFilesLast; + private List fixedFormsLast; + + private Map> brokenLinksByFile; + private Map> brokenLinksByForm; + + private static Log logger = LogFactory.getLog(LinkValidationState.class); + + /** + * Default constructor + */ + public LinkValidationState(String store, LinkValidationReport initialReport) + { + this.store = store; + + processReport(initialReport, false); + } + + // ------------------------------------------------------------------------------ + // Getters + + /** + * @return The number of files checked by the initial link check + */ + public int getInitialNumberFilesChecked() + { + return this.noFilesCheckedStart; + } + + /** + * @return The number of links checked by the initial link check + */ + public int getInitialNumberLinksChecked() + { + return this.noLinksCheckedStart; + } + + /** + * @return The number of broken files found by the initial link check + */ + public int getInitialNumberBrokenFiles() + { + return this.noBrokenFilesStart; + } + + /** + * @return The number of broken links found by the initial link check + */ + public int getInitialNumberBrokenLinks() + { + return this.noBrokenLinksStart; + } + + /** + * @return The number of files checked by the latest link check + */ + public int getNumberFilesChecked() + { + return this.noFilesCheckedLast; + } + + /** + * @return The number of links checked by the latest link check + */ + public int getNumberLinksChecked() + { + return this.noLinksCheckedLast; + } + + /** + * @return The number of broken files found by the latest link check + */ + public int getNumberBrokenFiles() + { + return this.noBrokenFilesLast; + } + + /** + * @return The number of broken links found by the latest link check + */ + public int getNumberBrokenLinks() + { + return this.noBrokenLinksLast; + } + + /** + * @return The number of files fixed since the initial link check + */ + public int getNumberFixedFiles() + { + return this.noFixedFiles; + } + + /** + * @return The number of links fixed since the initial link check + */ + public int getNumberFixedLinks() + { + return this.noFixedLinks; + } + + /** + * @return A list of paths to non-generated files that contain broken links + */ + public List getStaticFilesWithBrokenLinks() + { + return this.brokenStaticFilesLast; + } + + /** + * @return A list of forms that have generated files containing broken links + */ + public List getFormsWithBrokenLinks() + { + return this.brokenFormsLast; + } + + /** + * @return A list of all files found (including those generated by forms) that + * contain broken links + */ + public List getAllFilesWithBrokenLinks() + { + throw new UnsupportedOperationException(); + } + + /** + * @param form The name of a form to find broken files for + * @return The list of broken files generated by the given form + */ + public List getFilesBrokenByForm(String form) + { + return this.brokenLinksByForm.get(form); + } + + /** + * @param file The path to a file with broken links + * @return The list of broken links within the given file + */ + public List getBrokenLinksForFile(String file) + { + return this.brokenLinksByFile.get(file); + } + + /** + * @return The list of non-generated files that have been fixed since the + * initial link check + */ + public List getFixedStaticFiles() + { + return this.fixedStaticFiles; + } + + /** + * @return The list of forms that have been fixed since the initial link check + */ + public List getFixedForms() + { + return this.fixedForms; + } + + /** + * @return The list of non-generated files fixed in the last run of the link check + */ + public List getStaticFilesFixedInLastRun() + { + return this.fixedStaticFilesLast; + } + + /** + * @return The list of forms fixed in the last run of the link check + */ + public List getFormsFixedInLastRun() + { + return this.fixedFormsLast; + } + + // ------------------------------------------------------------------------------ + // Implementation + + /** + * Determines whether the link validation check has been re-run since + * the intial check + * + * @return true if the link check has been re-run, false otherwise + */ + public boolean hasCheckBeenReRun() + { + return this.checkBeenReRun; + } + + /** + * Updates the link validation state with the result from a re-run of + * the link check + * + * @param newReport The report to compare the intial report with + */ + public void updateState(LinkValidationReport newReport) + { + // process the new report + processReport(newReport, true); + } + + public String toString() + { + StringBuilder buffer = new StringBuilder(super.toString()); + buffer.append(" (store=").append(this.store).append(")"); + return buffer.toString(); + } + + // ------------------------------------------------------------------------------ + // Private Helpers + + public void processReport(LinkValidationReport report, boolean updatedReport) + { + this.checkBeenReRun = updatedReport; + + if (updatedReport == false) + { + // setup initial counts + this.noBrokenFilesStart = report.getNumberBrokenFiles(); + this.noBrokenLinksStart = report.getNumberBrokenLinks(); + this.noFilesCheckedStart = report.getNumberFilesChecked(); + this.noLinksCheckedStart = report.getNumberLinksChecked(); + this.noBrokenFilesLast = report.getNumberBrokenFiles(); + this.noBrokenLinksLast = report.getNumberBrokenLinks(); + this.noFilesCheckedLast = report.getNumberFilesChecked(); + this.noLinksCheckedLast = report.getNumberLinksChecked(); + + // setup initial lists + this.brokenStaticFilesStart = report.getFilesWithBrokenLinks(); + this.brokenFormsStart = Collections.emptyList(); + this.brokenStaticFilesLast = report.getFilesWithBrokenLinks(); + this.brokenFormsLast = Collections.emptyList(); + + this.fixedStaticFiles = Collections.emptyList(); + this.fixedForms = Collections.emptyList(); + this.fixedFormsLast = Collections.emptyList(); + this.fixedStaticFiles = Collections.emptyList(); + this.fixedStaticFilesLast = Collections.emptyList(); + + // setup initial maps + this.brokenLinksByFile = new HashMap>(); + this.brokenLinksByForm = Collections.emptyMap(); + + // populate initial maps + for (String file : this.brokenStaticFilesLast) + { + this.brokenLinksByFile.put(file, report.getBrokenLinksForFile(file)); + } + } + else + { + // update the relevant counts + this.noBrokenFilesLast = report.getNumberBrokenFiles(); + this.noBrokenLinksLast = report.getNumberBrokenLinks(); + this.noFilesCheckedLast = report.getNumberFilesChecked(); + this.noLinksCheckedLast = report.getNumberLinksChecked(); + + this.noFixedFiles = this.noBrokenFilesStart - this.noBrokenFilesLast; + this.noFixedLinks = this.noBrokenLinksStart - this.noBrokenLinksLast; + + if (this.noFixedFiles < 0) + { + this.noFixedFiles = 0; + } + if (this.noFixedLinks < 0) + { + this.noFixedLinks = 0; + } + + // go through the list of files still broken and find which ones + // were fixed in the last re-run of the report + this.brokenStaticFilesLast = report.getFilesWithBrokenLinks(); + this.fixedStaticFiles = new ArrayList(); + this.fixedStaticFilesLast = new ArrayList(); + for (String file : this.brokenStaticFilesStart) + { + if (this.brokenStaticFilesLast.contains(file) == false) + { + this.fixedStaticFilesLast.add(file); + this.fixedStaticFiles.add(file); + } + } + + // update the broken files info + this.brokenLinksByFile.clear(); + for (String file : this.brokenStaticFilesLast) + { + this.brokenLinksByFile.put(file, report.getBrokenLinksForFile(file)); + } + } + } +} + + + + + + + diff --git a/source/java/org/alfresco/web/ui/wcm/component/AbstractLinkValidationReportComponent.java b/source/java/org/alfresco/web/ui/wcm/component/AbstractLinkValidationReportComponent.java new file mode 100644 index 0000000000..325652cc28 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/component/AbstractLinkValidationReportComponent.java @@ -0,0 +1,89 @@ +/* + * 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.ui.wcm.component; + +import javax.faces.context.FacesContext; +import javax.faces.el.ValueBinding; + +import org.alfresco.web.bean.wcm.LinkValidationState; +import org.alfresco.web.ui.common.component.SelfRenderingComponent; + +/** + * Base class for all the link validation report JSF components. + * + * @author gavinc + */ +public abstract class AbstractLinkValidationReportComponent extends SelfRenderingComponent +{ + protected LinkValidationState state; + + // ------------------------------------------------------------------------------ + // Component implementation + + @SuppressWarnings("unchecked") + @Override + public void restoreState(FacesContext context, Object state) + { + Object values[] = (Object[])state; + // standard component attributes are restored by the super class + super.restoreState(context, values[0]); + this.state = (LinkValidationState)values[1]; + } + + @Override + public Object saveState(FacesContext context) + { + Object values[] = new Object[2]; + // standard component attributes are saved by the super class + values[0] = super.saveState(context); + values[1] = this.state; + return values; + } + + // ------------------------------------------------------------------------------ + // Strongly typed component property accessors + + /** + * @return The LinkValidationState object holding the report information + */ + public LinkValidationState getValue() + { + ValueBinding vb = getValueBinding("value"); + if (vb != null) + { + this.state = (LinkValidationState)vb.getValue(getFacesContext()); + } + + return this.state; + } + + /** + * @param value The LinkValidationState object to get the summary info from + */ + public void setValue(LinkValidationState value) + { + this.state = value; + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java new file mode 100644 index 0000000000..8ac1acf895 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationBrokenFiles.java @@ -0,0 +1,192 @@ +/* + * 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.ui.wcm.component; + +import java.io.IOException; +import java.util.List; + +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; + +import org.alfresco.config.JNDIConstants; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.wcm.LinkValidationState; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * JSF component that shows the broken file information for a link + * validation report. + * + * @author gavinc + */ +public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportComponent +{ + private boolean oddRow = true; + + private static Log logger = LogFactory.getLog(UILinkValidationBrokenFiles.class); + + // ------------------------------------------------------------------------------ + // Component implementation + + @Override + public String getFamily() + { + return "org.alfresco.faces.LinkValidationBrokenFiles"; + } + + @SuppressWarnings("unchecked") + @Override + public void encodeBegin(FacesContext context) throws IOException + { + if (isRendered() == false) + { + return; + } + + // get the link validation state object to get the data from + ResponseWriter out = context.getResponseWriter(); + LinkValidationState linkState = getValue(); + + if (logger.isDebugEnabled()) + logger.debug("Rendering broken files from state object: " + linkState); + + // render the list of broken files and their contained links + out.write("
"); + out.write(Application.getMessage(context, "files_with_broken_links")); + out.write("
"); + + List brokenFiles = linkState.getStaticFilesWithBrokenLinks(); + for (String file : brokenFiles) + { + renderBrokenFile(context, out, file, linkState); + } + + out.write("
"); + } + + // ------------------------------------------------------------------------------ + // Helpers + + private void renderBrokenFile(FacesContext context, ResponseWriter out, + String file, LinkValidationState linkState) throws IOException + { + // gather the data to show for the file + String fileName = file; + String filePath = file; + + int idx = file.lastIndexOf("/"); + if (idx != -1) + { + fileName = file.substring(idx+1); + + int appbaseIdx = file.indexOf(JNDIConstants.DIR_DEFAULT_APPBASE); + if (appbaseIdx != -1) + { + filePath = file.substring(appbaseIdx+JNDIConstants.DIR_DEFAULT_APPBASE.length(), idx); + } + else + { + filePath = file.substring(0, idx); + } + } + + // build the list of broken links for the file + List brokenLinks = linkState.getBrokenLinksForFile(file); + StringBuilder builder = new StringBuilder(); + boolean first = true; + for (String link : brokenLinks) + { + if (first == false) + { + builder.append(", "); + } + else + { + first = false; + } + + builder.append(parseBrokenLink(link)); + } + String brokenLinksList = builder.toString(); + + // render the row with the appropriate background style + out.write(""); + out.write("
"); + out.write(fileName); + out.write("
"); + out.write(filePath); + out.write("
"); + out.write(Application.getMessage(context, "broken_links")); + out.write(":
"); + out.write(brokenLinksList); + out.write("
"); + out.write("
"); + out.write(" "); +// out.write(" "); +// out.write(" "); +// out.write(" "); +// out.write(" "); + out.write("
"); + } + + private String parseBrokenLink(String linkUrl) + { + String link = linkUrl; + + if (linkUrl.startsWith("http://") && linkUrl.indexOf("www--sandbox") != -1) + { + // remove the virtualisation server host name + int idx = linkUrl.indexOf("/", 7); + if (idx != -1) + { + link = linkUrl.substring(idx); + } + } + + return link; + } +} + + + + diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationFixedFiles.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationFixedFiles.java new file mode 100644 index 0000000000..8e15f13209 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationFixedFiles.java @@ -0,0 +1,144 @@ +/* + * 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.ui.wcm.component; + +import java.io.IOException; +import java.util.List; + +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; + +import org.alfresco.config.JNDIConstants; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.wcm.LinkValidationState; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * JSF component that shows the fixed files for a link validation report. + * + * @author gavinc + */ +public class UILinkValidationFixedFiles extends AbstractLinkValidationReportComponent +{ + private boolean oddRow = true; + + private static Log logger = LogFactory.getLog(UILinkValidationFixedFiles.class); + + // ------------------------------------------------------------------------------ + // Component implementation + + @Override + public String getFamily() + { + return "org.alfresco.faces.LinkValidationFixedFiles"; + } + + @SuppressWarnings("unchecked") + @Override + public void encodeBegin(FacesContext context) throws IOException + { + if (isRendered() == false) + { + return; + } + + // get the link validation state object to get the data from + ResponseWriter out = context.getResponseWriter(); + LinkValidationState linkState = getValue(); + + if (logger.isDebugEnabled()) + logger.debug("Rendering fixed files from state object: " + linkState); + + // render the list of broken files and their contained links + out.write("
"); + out.write(Application.getMessage(context, "fixed_files")); + out.write("
"); + + List fixedFiles = linkState.getFixedStaticFiles(); + for (String file : fixedFiles) + { + renderFixedFile(context, out, file, linkState); + } + + out.write("
"); + } + + // ------------------------------------------------------------------------------ + // Helpers + + private void renderFixedFile(FacesContext context, ResponseWriter out, + String file, LinkValidationState linkState) throws IOException + { + // gather the data to show for the file + String fileName = file; + String filePath = file; + + int idx = file.lastIndexOf("/"); + if (idx != -1) + { + fileName = file.substring(idx+1); + + int appbaseIdx = file.indexOf(JNDIConstants.DIR_DEFAULT_APPBASE); + if (appbaseIdx != -1) + { + filePath = file.substring(appbaseIdx+JNDIConstants.DIR_DEFAULT_APPBASE.length(), idx); + } + else + { + filePath = file.substring(0, idx); + } + } + + // render the row with the appropriate background style + out.write(""); + out.write("
"); + out.write(fileName); + out.write("
"); + out.write(filePath); + out.write("
"); + } +} + + + + diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationProgress.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationProgress.java new file mode 100644 index 0000000000..9c87a4011f --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationProgress.java @@ -0,0 +1,148 @@ +/* + * 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.ui.wcm.component; + +import java.io.IOException; +import java.util.List; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import javax.faces.el.MethodBinding; + +import org.alfresco.web.app.Application; +import org.alfresco.web.ui.common.Utils; +import org.alfresco.web.ui.common.component.SelfRenderingComponent; +import org.alfresco.web.ui.common.component.UIActionLink; +import org.alfresco.web.ui.repo.component.UIActions; + +/** + * JSF component that displays information about the workflows a node is involved in. + *

+ * The node to show workflow information on. + * + * @author gavinc + */ +public class UILinkValidationProgress extends SelfRenderingComponent +{ + // ------------------------------------------------------------------------------ + // Component Impl + + @Override + public String getFamily() + { + return "org.alfresco.faces.LinkValidationProgress"; + } + + @Override + public void restoreState(FacesContext context, Object state) + { + Object values[] = (Object[])state; + // standard component attributes are restored by the super class + super.restoreState(context, values[0]); + } + + @Override + public Object saveState(FacesContext context) + { + Object values[] = new Object[1]; + // standard component attributes are saved by the super class + values[0] = super.saveState(context); + return values; + } + + @Override + @SuppressWarnings("unchecked") + public void encodeBegin(FacesContext context) throws IOException + { + if (!isRendered()) return; + + ResponseWriter out = context.getResponseWriter(); + + // render the hidden action used to close the dialog + UIActionLink action = findOrCreateHiddenAction(context); + Utils.encodeRecursive(context, action); + + // output the script + out.write("\n"); + + // output the HTML + out.write("

"); + out.write("
"); + out.write("
"); + out.write(Application.getMessage(context, "checking_links_progress")); + out.write("
"); + out.write(Application.getMessage(context, "checking_links_status")); + out.write("
\n"); + } + + @Override + public void encodeEnd(FacesContext context) throws IOException + { + if (!isRendered()) return; + } + + // ------------------------------------------------------------------------------ + // Helper methods + + @SuppressWarnings("unchecked") + private UIActionLink findOrCreateHiddenAction(FacesContext fc) + { + UIActionLink action = null; + String actionId = "validation-callback-link"; + + for (UIComponent component : (List)getChildren()) + { + if (actionId.equals(component.getId())) + { + action = (UIActionLink)component; + break; + } + } + + if (action == null) + { + javax.faces.application.Application facesApp = fc.getApplication(); + action = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK); + + action.setRendererType(UIActions.RENDERER_ACTIONLINK); + action.setId(actionId); + action.setValue("Callback"); + action.setShowLink(false); + MethodBinding callback = facesApp.createMethodBinding( + "#{DialogManager.bean.linkCheckCompleted}", new Class[] {}); + action.setAction(callback); + action.getAttributes().put("style", "display:none;"); + + this.getChildren().add(action); + } + + return action; + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java new file mode 100644 index 0000000000..afcae3b3d1 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java @@ -0,0 +1,115 @@ +/* + * 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.ui.wcm.component; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ResourceBundle; + +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; + +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.wcm.LinkValidationState; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * JSF component that shows the summary information for a link + * validation report. + * + * @author gavinc + */ +public class UILinkValidationSummary extends AbstractLinkValidationReportComponent +{ + private static Log logger = LogFactory.getLog(UILinkValidationSummary.class); + + // ------------------------------------------------------------------------------ + // Component implementation + + @Override + public String getFamily() + { + return "org.alfresco.faces.LinkValidationSummary"; + } + + @SuppressWarnings("unchecked") + @Override + public void encodeBegin(FacesContext context) throws IOException + { + if (isRendered() == false) + { + return; + } + + // get the link validation state object to get the data from + ResponseWriter out = context.getResponseWriter(); + LinkValidationState linkState = getValue(); + + if (logger.isDebugEnabled()) + logger.debug("Rendering summary from state object: " + linkState); + + // resolve all the strings holding data + ResourceBundle bundle = Application.getBundle(context); + String pattern = bundle.getString("files_links_checked"); + String initialCheckSummary = MessageFormat.format(pattern, + new Object[] {linkState.getInitialNumberFilesChecked(), linkState.getInitialNumberLinksChecked()}); + pattern = bundle.getString("files_links_broken"); + String initialBrokenSummary = MessageFormat.format(pattern, + new Object[] {linkState.getInitialNumberBrokenFiles(), linkState.getInitialNumberBrokenLinks()}); + pattern = bundle.getString("files_links_still_broken"); + String stillBroken = MessageFormat.format(pattern, + new Object[] {linkState.getNumberBrokenFiles(), linkState.getNumberBrokenLinks()}); + pattern = bundle.getString("broken_links_fixed"); + String linksFixed = MessageFormat.format(pattern, + new Object[] {linkState.getNumberFixedLinks()}); + + // render the summary area + out.write("
"); + out.write(bundle.getString("summary")); + out.write("
"); + out.write(""); + out.write(""); + out.write("
"); + out.write(bundle.getString("initial_check")); + out.write(":
"); + out.write(initialCheckSummary); + out.write("
"); + out.write(initialBrokenSummary); + out.write("
"); + out.write(bundle.getString("current_status")); + out.write(":
"); + out.write(stillBroken); + out.write(""); + out.write(linksFixed); + out.write("
"); + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationBrokenFilesTag.java b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationBrokenFilesTag.java new file mode 100644 index 0000000000..d223a1657e --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationBrokenFilesTag.java @@ -0,0 +1,82 @@ +/* + * 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.ui.wcm.tag; + +import javax.faces.component.UIComponent; + +import org.alfresco.web.ui.common.tag.HtmlComponentTag; + +/** + * Tag class for adding the UILinkValidationBrokenFiles component to a JSP page. + * + * @author gavinc + */ +public class LinkValidationBrokenFilesTag extends HtmlComponentTag +{ + private String value; + + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.LinkValidationBrokenFiles"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return null; + } + + /** + * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent) + */ + protected void setProperties(UIComponent component) + { + super.setProperties(component); + + setStringProperty(component, "value", this.value); + } + + /** + * @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release() + */ + public void release() + { + super.release(); + this.value = null; + } + + /** + * @param value the value (the list of servers to deploy to) + */ + public void setValue(String value) + { + this.value = value; + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationFixedFilesTag.java b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationFixedFilesTag.java new file mode 100644 index 0000000000..094efeca57 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationFixedFilesTag.java @@ -0,0 +1,82 @@ +/* + * 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.ui.wcm.tag; + +import javax.faces.component.UIComponent; + +import org.alfresco.web.ui.common.tag.HtmlComponentTag; + +/** + * Tag class for adding the UILinkValidationFixedFiles component to a JSP page. + * + * @author gavinc + */ +public class LinkValidationFixedFilesTag extends HtmlComponentTag +{ + private String value; + + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.LinkValidationFixedFiles"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return null; + } + + /** + * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent) + */ + protected void setProperties(UIComponent component) + { + super.setProperties(component); + + setStringProperty(component, "value", this.value); + } + + /** + * @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release() + */ + public void release() + { + super.release(); + this.value = null; + } + + /** + * @param value the value (the list of servers to deploy to) + */ + public void setValue(String value) + { + this.value = value; + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationProgressTag.java b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationProgressTag.java new file mode 100644 index 0000000000..d08c967cac --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationProgressTag.java @@ -0,0 +1,51 @@ +/* + * 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.ui.wcm.tag; + +import org.alfresco.web.ui.common.tag.HtmlComponentTag; + +/** + * Tag class for adding the UILinkValidationProgress component to a JSP page. + * + * @author gavinc + */ +public class LinkValidationProgressTag extends HtmlComponentTag +{ + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.LinkValidationProgress"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return null; + } +} diff --git a/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java new file mode 100644 index 0000000000..225833ae06 --- /dev/null +++ b/source/java/org/alfresco/web/ui/wcm/tag/LinkValidationSummaryTag.java @@ -0,0 +1,82 @@ +/* + * 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.ui.wcm.tag; + +import javax.faces.component.UIComponent; + +import org.alfresco.web.ui.common.tag.HtmlComponentTag; + +/** + * Tag class for adding the UILinkValidationSummary component to a JSP page. + * + * @author gavinc + */ +public class LinkValidationSummaryTag extends HtmlComponentTag +{ + private String value; + + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.LinkValidationSummary"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return null; + } + + /** + * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent) + */ + protected void setProperties(UIComponent component) + { + super.setProperties(component); + + setStringProperty(component, "value", this.value); + } + + /** + * @see org.alfresco.web.ui.common.tag.HtmlComponentTag#release() + */ + public void release() + { + super.release(); + this.value = null; + } + + /** + * @param value the value (the list of servers to deploy to) + */ + public void setValue(String value) + { + this.value = value; + } +} diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 5910222c97..40a15854f0 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -3414,6 +3414,44 @@ nodeService #{NodeService} + + + + + The bean that backs up the Run Link Validation Dialog + + LinkValidationRunDialog + org.alfresco.web.bean.wcm.LinkValidationRunDialog + session + + avmBrowseBean + #{AVMBrowseBean} + + + actionService + #{ActionService} + + + avmService + #{AVMService} + + + + + + The bean that backs up the Link Validation Report Dialog + + LinkValidationReportDialog + org.alfresco.web.bean.wcm.LinkValidationReportDialog + session + + avmBrowseBean + #{AVMBrowseBean} + + + avmService + #{AVMService} + @@ -3753,5 +3791,18 @@ DeploymentProgressBean org.alfresco.web.bean.wcm.DeploymentProgressBean request + + + + + Bean that returns link validation progress status + + LinkValidationProgressBean + org.alfresco.web.bean.wcm.LinkValidationProgressBean + session + + avmBrowseBean + #{AVMBrowseBean} + diff --git a/source/web/WEB-INF/faces-config-wcm.xml b/source/web/WEB-INF/faces-config-wcm.xml index 55b00e15ff..dc680cc2bd 100644 --- a/source/web/WEB-INF/faces-config-wcm.xml +++ b/source/web/WEB-INF/faces-config-wcm.xml @@ -39,6 +39,26 @@ org.alfresco.web.ui.wcm.component.UIPendingSubmissions + + org.alfresco.faces.LinkValidationProgress + org.alfresco.web.ui.wcm.component.UILinkValidationProgress + + + + org.alfresco.faces.LinkValidationSummary + org.alfresco.web.ui.wcm.component.UILinkValidationSummary + + + + org.alfresco.faces.LinkValidationBrokenFiles + org.alfresco.web.ui.wcm.component.UILinkValidationBrokenFiles + + + + org.alfresco.faces.LinkValidationFixedFiles + org.alfresco.web.ui.wcm.component.UILinkValidationFixedFiles + + diff --git a/source/web/WEB-INF/wcm.tld b/source/web/WEB-INF/wcm.tld index 212e18ce28..3f31e3df83 100644 --- a/source/web/WEB-INF/wcm.tld +++ b/source/web/WEB-INF/wcm.tld @@ -267,4 +267,112 @@ + + linkValidationProgress + org.alfresco.web.ui.wcm.tag.LinkValidationProgressTag + Link Validation Progress + JSP + Monitors the progress of the current link validation check being executed. + + + id + false + true + + + + rendered + false + true + Flag to determine whether component should be rendered + + + + + linkValidationSummary + org.alfresco.web.ui.wcm.tag.LinkValidationSummaryTag + JSP + Link Validation Sumary + Displays summary information for a link validation report + + + value + true + true + The link validation state object holding the report data + + + + id + false + true + The component identifier for this component + + + + rendered + false + true + Flag to determine whether component should be rendered + + + + + linkValidationBrokenFiles + org.alfresco.web.ui.wcm.tag.LinkValidationBrokenFilesTag + JSP + Link Validation Broken Files + Displays broken file information for a link validation report + + + value + true + true + The link validation state object holding the report data + + + + id + false + true + The component identifier for this component + + + + rendered + false + true + Flag to determine whether component should be rendered + + + + + linkValidationFixedFiles + org.alfresco.web.ui.wcm.tag.LinkValidationFixedFilesTag + JSP + Link Validation Fixed Files + Displays the list of files fixed since the initial run of a link validation report + + + value + true + true + The link validation state object holding the report data + + + + id + false + true + The component identifier for this component + + + + rendered + false + true + Flag to determine whether component should be rendered + + + diff --git a/source/web/css/main.css b/source/web/css/main.css index 9dd3d077e4..cc1db08499 100644 --- a/source/web/css/main.css +++ b/source/web/css/main.css @@ -718,3 +718,81 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited { white-space: nowrap; } + +.linkValidationProgressPanel +{ + width: 100%; + margin: 30px; +} + +.linkValidationProgressWait +{ + font-size: 14px; + padding-bottom: 6px; +} + +.linkValidationProgressStatus +{ + font-size: 11px; +} + +.linkValidationReportTitle +{ + color: #004488; + font-size: 14px; + font-weight: bold; + padding-bottom: 8px; +} + +.linkValidationReportSubTitle +{ + color: #004488; + font-weight: bold; + font-size: 11px; + padding-right: 8px; +} + +.linkValidationSummaryPanel +{ + margin: 6px; + padding: 8px; + background-color: white; + /* border: 1px solid #babfc5; */ +} + +.linkValidationBrokenFilesPanel +{ + margin: 6px; + margin-top: 10px; + padding: 8px; + background-color: white; + /* border: 1px solid #babfc5; */ +} + +.linkValidationFixedFilesPanel +{ + margin: 6px; + margin-top: 10px; + padding: 8px; + background-color: white; + /* border: 1px solid #babfc5; */ +} + +.linkValidationList +{ + overflow: auto; + height: 150px; + border: 1px solid #aaa; +} + +.linkValidationListOddRow +{ + background-color: white; +} + +.linkValidationListEvenRow +{ + background-color: #f1f1f1; +} + + diff --git a/source/web/images/icons/fixed_link.gif b/source/web/images/icons/fixed_link.gif new file mode 100644 index 0000000000000000000000000000000000000000..43c5ec63ddc65d212f3a266630450f53c0bd57c6 GIT binary patch literal 335 zcmZ?wbhEHb6krfwSjxx%1poj4zw_Yf?fXw|-hFiA&co}sA6&e8>-^;#Z$Ex}@#f?6 z*B_p}dVl)D)nlhG96oXO(zRQs&tLxf^Y51*e?EWz{qgJ14_|(~|NQ;kr*CgQe0lx; z^Q(8Cp1pea^yS;{KYo7s`t9zcXSeP@zIpG_jk^!8-nw`4+@J;#2Y00vhzhY|Qj8#$V!?*$u zy{+1Nq_bj;*6L%ziz?6R32T4Y#>J-|_3qQ}xfL(f|21&d*19ydwYf-kwbyq^x=2l& qG_hfli}Z|{vu3$)&6~eqz6`&h3it9AE0?ni$P2n};9u*=U=08zFyr$8 literal 0 HcmV?d00001 diff --git a/source/web/images/icons/link_validation_report.gif b/source/web/images/icons/link_validation_report.gif new file mode 100644 index 0000000000000000000000000000000000000000..43c5ec63ddc65d212f3a266630450f53c0bd57c6 GIT binary patch literal 335 zcmZ?wbhEHb6krfwSjxx%1poj4zw_Yf?fXw|-hFiA&co}sA6&e8>-^;#Z$Ex}@#f?6 z*B_p}dVl)D)nlhG96oXO(zRQs&tLxf^Y51*e?EWz{qgJ14_|(~|NQ;kr*CgQe0lx; z^Q(8Cp1pea^yS;{KYo7s`t9zcXSeP@zIpG_jk^!8-nw`4+@J;#2Y00vhzhY|Qj8#$V!?*$u zy{+1Nq_bj;*6L%ziz?6R32T4Y#>J-|_3qQ}xfL(f|21&d*19ydwYf-kwbyq^x=2l& qG_hfli}Z|{vu3$)&6~eqz6`&h3it9AE0?ni$P2n};9u*=U=08zFyr$8 literal 0 HcmV?d00001 diff --git a/source/web/images/icons/link_validation_report_large.gif b/source/web/images/icons/link_validation_report_large.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f5293b446f7152fbafd614bb52e0d8ea0e34a99 GIT binary patch literal 967 zcmV;&133IgNk%w1VITk?0LB3T00030|NrRf?%(0%&(z!?N{1~}jXGbHJ71MXXqr=U zpk8~WVScD=hOBRiuy2X4d6Bbyl(&bRx{IK{il4oSp1g~ozLu!NnXAT_s>PqK#iq8+ zuDi}gX_`lBn^SY3ZHTUrqrIT8#=OVY!OYvj%GJTi)Y{+X(%0VV?eWdi+SA$K{r&y? z{QUd-`}+F&`T6+0(2>FMd{=;-I?=jP_-<>lq%CZ-rlqB&q@<*yqobmt zqM)FlpP!$Yn3#}|kdKd#j*gCriHZOJ|NsC0|NsC0|NsC0|NsC0A^8LW004ggEC2ui z03ZM$000O6fPaF6gnv_LZF!1$ZD>=4kdcCDd1_ZmHZUz&JTwcA|DvFfT93+AyrH z&^OXLJ6Y9`by_ho-rbtLGvLuVAdK``359Xxu-nKj6cka#j8 zt`jJbAi;wPeJr^%2u+w80pszLK{233f;#H;@bRNes6Tmz*r)+Aq^puA=^XO0#CoiWci-`~f6Ln?qc1+z>jns#S|SvgX*y5=hf9h@#}cL3XNHv(mO^&6=@m z5F!3l5(Uw5k*wXjYxDAC`c_C1MOjnkJejxfki$XV4k4n52amuhBS$Wr_wW$KM2aXH z;`lM;&y^1gIZR{;qbWU7cV6vSZQ-Vh7Z<70=!=irsdK0P!TZOM-d_8XE@EViqc**7 zD`(leId9=aG8-}S=20FdUV%8@-hA|8=|-UZ{Da0!;_T?T^Bzw8$PqLz|J-RJL`dTM zi7o$LAH7KXBT;ZPh!}GWQQv_F>StMI#2Ik}5=hX&&>(e)q2Psw`PZO(5R!pUA$D{T z-H6dy=HGM-^;#Z$Ex}@#f?6 z*B_p}dVl)D)nlhG96oXO(zRQs&tLxf^Y51*e?EWz{qgJ14_|(~|NQ;kr*CgQe0lx; z^Q(8Cp1pea^yS;{KYo7s`t9zcXSeP@zIpG_jk^!8-nw`4+@J;#2Y00vhzhY|Qj8#$V!?*$u zy{+1Nq_bj;*6L%ziz?6R32T4Y#>J-|_3qQ}xfL(f|21&d*19ydwYf-kwbyq^x=2l& qG_hfli}Z|{vu3$)&6~eqz6`&h3it9AE0?ni$P2n};9u*=U=08zFyr$8 literal 0 HcmV?d00001 diff --git a/source/web/images/icons/placeholder_large.gif b/source/web/images/icons/placeholder_large.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f5293b446f7152fbafd614bb52e0d8ea0e34a99 GIT binary patch literal 967 zcmV;&133IgNk%w1VITk?0LB3T00030|NrRf?%(0%&(z!?N{1~}jXGbHJ71MXXqr=U zpk8~WVScD=hOBRiuy2X4d6Bbyl(&bRx{IK{il4oSp1g~ozLu!NnXAT_s>PqK#iq8+ zuDi}gX_`lBn^SY3ZHTUrqrIT8#=OVY!OYvj%GJTi)Y{+X(%0VV?eWdi+SA$K{r&y? z{QUd-`}+F&`T6+0(2>FMd{=;-I?=jP_-<>lq%CZ-rlqB&q@<*yqobmt zqM)FlpP!$Yn3#}|kdKd#j*gCriHZOJ|NsC0|NsC0|NsC0|NsC0A^8LW004ggEC2ui z03ZM$000O6fPaF6gnv_LZF!1$ZD>=4kdcCDd1_ZmHZUz&JTwcA|DvFfT93+AyrH z&^OXLJ6Y9`by_ho-rbtLGvLuVAdK``359Xxu-nKj6cka#j8 zt`jJbAi;wPeJr^%2u+w80pszLK{233f;#H;@bRNes6Tmz*r)+Aq^puA=^XO0#CoiWci-`~f6Ln?qc1+z>jns#S|SvgX*y5=hf9h@#}cL3XNHv(mO^&6=@m z5F!3l5(Uw5k*wXjYxDAC`c_C1MOjnkJejxfki$XV4k4n52amuhBS$Wr_wW$KM2aXH z;`lM;&y^1gIZR{;qbWU7cV6vSZQ-Vh7Z<70=!=irsdK0P!TZOM-d_8XE@EViqc**7 zD`(leId9=aG8-}S=20FdUV%8@-hA|8=|-UZ{Da0!;_T?T^Bzw8$PqLz|J-RJL`dTM zi7o$LAH7KXBT;ZPh!}GWQQv_F>StMI#2Ik}5=hX&&>(e)q2Psw`PZO(5R!pUA$D{T z-H6dy=HGM-^;#Z$Ex}@#f?6 z*B_p}dVl)D)nlhG96oXO(zRQs&tLxf^Y51*e?EWz{qgJ14_|(~|NQ;kr*CgQe0lx; z^Q(8Cp1pea^yS;{KYo7s`t9zcXSeP@zIpG_jk^!8-nw`4+@J;#2Y00vhzhY|Qj8#$V!?*$u zy{+1Nq_bj;*6L%ziz?6R32T4Y#>J-|_3qQ}xfL(f|21&d*19ydwYf-kwbyq^x=2l& qG_hfli}Z|{vu3$)&6~eqz6`&h3it9AE0?ni$P2n};9u*=U=08zFyr$8 literal 0 HcmV?d00001 diff --git a/source/web/images/icons/run_link_validation_large.gif b/source/web/images/icons/run_link_validation_large.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f5293b446f7152fbafd614bb52e0d8ea0e34a99 GIT binary patch literal 967 zcmV;&133IgNk%w1VITk?0LB3T00030|NrRf?%(0%&(z!?N{1~}jXGbHJ71MXXqr=U zpk8~WVScD=hOBRiuy2X4d6Bbyl(&bRx{IK{il4oSp1g~ozLu!NnXAT_s>PqK#iq8+ zuDi}gX_`lBn^SY3ZHTUrqrIT8#=OVY!OYvj%GJTi)Y{+X(%0VV?eWdi+SA$K{r&y? z{QUd-`}+F&`T6+0(2>FMd{=;-I?=jP_-<>lq%CZ-rlqB&q@<*yqobmt zqM)FlpP!$Yn3#}|kdKd#j*gCriHZOJ|NsC0|NsC0|NsC0|NsC0A^8LW004ggEC2ui z03ZM$000O6fPaF6gnv_LZF!1$ZD>=4kdcCDd1_ZmHZUz&JTwcA|DvFfT93+AyrH z&^OXLJ6Y9`by_ho-rbtLGvLuVAdK``359Xxu-nKj6cka#j8 zt`jJbAi;wPeJr^%2u+w80pszLK{233f;#H;@bRNes6Tmz*r)+Aq^puA=^XO0#CoiWci-`~f6Ln?qc1+z>jns#S|SvgX*y5=hf9h@#}cL3XNHv(mO^&6=@m z5F!3l5(Uw5k*wXjYxDAC`c_C1MOjnkJejxfki$XV4k4n52amuhBS$Wr_wW$KM2aXH z;`lM;&y^1gIZR{;qbWU7cV6vSZQ-Vh7Z<70=!=irsdK0P!TZOM-d_8XE@EViqc**7 zD`(leId9=aG8-}S=20FdUV%8@-hA|8=|-UZ{Da0!;_T?T^Bzw8$PqLz|J-RJL`dTM zi7o$LAH7KXBT;ZPh!}GWQQv_F>StMI#2Ik}5=hX&&>(e)q2Psw`PZO(5R!pUA$D{T z-H6dy=HGM + + + +     diff --git a/source/web/jsp/wcm/link-validation-report.jsp b/source/web/jsp/wcm/link-validation-report.jsp new file mode 100644 index 0000000000..8a7a5a221c --- /dev/null +++ b/source/web/jsp/wcm/link-validation-report.jsp @@ -0,0 +1,46 @@ +<%-- + * 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 +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> +<%@ taglib uri="/WEB-INF/wcm.tld" prefix="w" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> + + + + + + + + + + + + + diff --git a/source/web/jsp/wcm/run-link-validation.jsp b/source/web/jsp/wcm/run-link-validation.jsp new file mode 100644 index 0000000000..108d679e8f --- /dev/null +++ b/source/web/jsp/wcm/run-link-validation.jsp @@ -0,0 +1,35 @@ +<%-- + * 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 +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> +<%@ taglib uri="/WEB-INF/wcm.tld" prefix="w" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> + + \ No newline at end of file diff --git a/source/web/scripts/ajax/link-validation-progress.js b/source/web/scripts/ajax/link-validation-progress.js new file mode 100644 index 0000000000..061d38daf0 --- /dev/null +++ b/source/web/scripts/ajax/link-validation-progress.js @@ -0,0 +1,61 @@ +Alfresco.LinkValidationMonitor = function() +{ + this.url = getContextPath() + '/ajax/invoke/LinkValidationProgressBean.getStatus'; + this.failedMsg = ''; + this.successMsg = ''; +} + +Alfresco.LinkValidationMonitor.prototype = { + url: null, + failedMsg: null, + successMsg: null, + retrieveLinkValidationStatus: function() { + YAHOO.util.Connect.asyncRequest('GET', this.url, + { + success: this.processResults, + failure: this.handleError, + scope: this + }, + null); + }, + processResults: function(ajaxResponse) { + var xml = ajaxResponse.responseXML.documentElement; + var finished = xml.getAttribute('finished'); + var fileCount = xml.getAttribute('file-count'); + var linkCount = xml.getAttribute('link-count'); + + var fileCountElem = document.getElementById('file-count'); + if (fileCountElem != null) { + fileCountElem.innerHTML = fileCount; + } + var linkCountElem = document.getElementById('link-count'); + if (linkCountElem != null) { + linkCountElem.innerHTML = linkCount; + } + + if (finished == 'true') { + var linkOnclick = document.getElementById('validation-callback-link').onclick; + linkOnclick(); + } else { + setTimeout('Alfresco.linkMonitor.retrieveLinkValidationStatus()', 2000); + } + }, + handleError: function(ajaxResponse) { + handleErrorYahoo(ajaxResponse.status + ' ' + ajaxResponse.statusText); + } +} + +Alfresco.initLinkValidationMonitor = function() { + Alfresco.linkMonitor = new Alfresco.LinkValidationMonitor(); + Alfresco.linkMonitor.retrieveLinkValidationStatus(); +} + +Alfresco.linkMonitor = null; +window.onload = Alfresco.initLinkValidationMonitor; + + + + + + +