From 667b29e43c7aa2264c82bc58a72b2a5c766714d6 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Sun, 24 Jun 2007 20:44:12 +0000 Subject: [PATCH] - Fixes and refinements to links management UI git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6082 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 2 +- .../web/bean/wcm/LinkValidationState.java | 44 ++++--------------- .../component/UILinkValidationSummary.java | 12 ++--- 3 files changed, 15 insertions(+), 43 deletions(-) diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 52a038438e..027d6cb9fd 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1183,7 +1183,7 @@ files_links_checked=The check was completed at {0}, {1} file(s) were checked and files_links_checked_error=The check failed at {0} due to the error: 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. +broken_items_fixed={0} broken items(s) have been fixed. files_with_broken_links=Non generated files with broken links forms_with_broken_links=Generated files with broken links generated_files=Generated Files diff --git a/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java b/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java index 089199840f..94cdb30f29 100644 --- a/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java +++ b/source/java/org/alfresco/web/bean/wcm/LinkValidationState.java @@ -74,8 +74,7 @@ public class LinkValidationState private int noBrokenLinksStart = -1; private int noBrokenLinksLast = -1; - private int noFixedFiles = -1; - private int noFixedLinks = -1; + private int noFixedItems = -1; private List brokenStaticFilesStart; private List brokenFormsStart; @@ -204,19 +203,11 @@ public class LinkValidationState } /** - * @return The number of files fixed since the initial link check + * @return The number of items fixed since the initial link check */ - public int getNumberFixedFiles() + public int getNumberFixedItems() { - return this.noFixedFiles; - } - - /** - * @return The number of links fixed since the initial link check - */ - public int getNumberFixedLinks() - { - return this.noFixedLinks; + return this.noFixedItems; } /** @@ -235,15 +226,6 @@ public class LinkValidationState 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 @@ -351,8 +333,7 @@ public class LinkValidationState this.noBrokenLinksLast = report.getNumberBrokenLinks(); this.noFilesCheckedLast = report.getNumberFilesChecked(); this.noLinksCheckedLast = report.getNumberLinksChecked(); - this.noFixedFiles = 0; - this.noFixedLinks = 0; + this.noFixedItems = 0; // setup fixed lists this.fixedFiles = new ArrayList(this.noBrokenFilesStart); @@ -370,18 +351,6 @@ public class LinkValidationState 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; - } - // process the broken files and determine which ones are static files // and which ones are generated processFiles(report.getFilesWithBrokenLinks(), updatedReport, report); @@ -404,6 +373,9 @@ public class LinkValidationState this.fixedForms.add(file); } } + + // calculate the number of fixed items we have + this.noFixedItems = this.fixedFiles.size() + this.fixedForms.size(); } } } diff --git a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java index e18cfef0bd..5249816069 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UILinkValidationSummary.java @@ -95,9 +95,9 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone String pattern = bundle.getString("files_links_still_broken"); String stillBroken = MessageFormat.format(pattern, new Object[] {linkState.getNumberBrokenLinks(), linkState.getNumberBrokenFiles()}); - pattern = bundle.getString("broken_links_fixed"); + pattern = bundle.getString("broken_items_fixed"); String linksFixed = MessageFormat.format(pattern, - new Object[] {linkState.getNumberFixedLinks()}); + new Object[] {linkState.getNumberFixedItems()}); // get the action to update the current status UICommand updateStatusAction = aquireAction(context, "update_status_" + linkState.getStore()); @@ -120,11 +120,11 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone out.write(bundle.getString("current_status")); out.write(":
"); + out.write("/images/icons/broken_link.gif' style='vertical-align: -4px;' > "); out.write(stillBroken); - out.write(""); + out.write("/images/icons/fixed_link.gif' style='vertical-align: -4px;' > "); out.write(linksFixed); out.write("  "); Utils.encodeRecursive(context, updateStatusAction); @@ -180,7 +180,7 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone out.write(initialCheckSummary); out.write("
"); + out.write("/images/icons/broken_link.gif'' style='vertical-align: -4px;'/> "); out.write(initialBrokenSummary); out.write("
"); }