mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- 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
This commit is contained in:
@@ -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_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_broken={0} broken link(s) were found in {1} file(s).
|
||||||
files_links_still_broken={0} link(s) still broken 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
|
files_with_broken_links=Non generated files with broken links
|
||||||
forms_with_broken_links=Generated files with broken links
|
forms_with_broken_links=Generated files with broken links
|
||||||
generated_files=Generated Files
|
generated_files=Generated Files
|
||||||
|
@@ -74,8 +74,7 @@ public class LinkValidationState
|
|||||||
private int noBrokenLinksStart = -1;
|
private int noBrokenLinksStart = -1;
|
||||||
private int noBrokenLinksLast = -1;
|
private int noBrokenLinksLast = -1;
|
||||||
|
|
||||||
private int noFixedFiles = -1;
|
private int noFixedItems = -1;
|
||||||
private int noFixedLinks = -1;
|
|
||||||
|
|
||||||
private List<String> brokenStaticFilesStart;
|
private List<String> brokenStaticFilesStart;
|
||||||
private List<String> brokenFormsStart;
|
private List<String> 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 this.noFixedItems;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The number of links fixed since the initial link check
|
|
||||||
*/
|
|
||||||
public int getNumberFixedLinks()
|
|
||||||
{
|
|
||||||
return this.noFixedLinks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -235,15 +226,6 @@ public class LinkValidationState
|
|||||||
return this.brokenFormsLast;
|
return this.brokenFormsLast;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return A list of all files found (including those generated by forms) that
|
|
||||||
* contain broken links
|
|
||||||
*/
|
|
||||||
public List<String> getAllFilesWithBrokenLinks()
|
|
||||||
{
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param form The name of a form to find broken files for
|
* @param form The name of a form to find broken files for
|
||||||
* @return The list of broken files generated by the given form
|
* @return The list of broken files generated by the given form
|
||||||
@@ -351,8 +333,7 @@ public class LinkValidationState
|
|||||||
this.noBrokenLinksLast = report.getNumberBrokenLinks();
|
this.noBrokenLinksLast = report.getNumberBrokenLinks();
|
||||||
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
||||||
this.noLinksCheckedLast = report.getNumberLinksChecked();
|
this.noLinksCheckedLast = report.getNumberLinksChecked();
|
||||||
this.noFixedFiles = 0;
|
this.noFixedItems = 0;
|
||||||
this.noFixedLinks = 0;
|
|
||||||
|
|
||||||
// setup fixed lists
|
// setup fixed lists
|
||||||
this.fixedFiles = new ArrayList<String>(this.noBrokenFilesStart);
|
this.fixedFiles = new ArrayList<String>(this.noBrokenFilesStart);
|
||||||
@@ -370,18 +351,6 @@ public class LinkValidationState
|
|||||||
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
this.noFilesCheckedLast = report.getNumberFilesChecked();
|
||||||
this.noLinksCheckedLast = report.getNumberLinksChecked();
|
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
|
// process the broken files and determine which ones are static files
|
||||||
// and which ones are generated
|
// and which ones are generated
|
||||||
processFiles(report.getFilesWithBrokenLinks(), updatedReport, report);
|
processFiles(report.getFilesWithBrokenLinks(), updatedReport, report);
|
||||||
@@ -404,6 +373,9 @@ public class LinkValidationState
|
|||||||
this.fixedForms.add(file);
|
this.fixedForms.add(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// calculate the number of fixed items we have
|
||||||
|
this.noFixedItems = this.fixedFiles.size() + this.fixedForms.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,9 +95,9 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
|||||||
String pattern = bundle.getString("files_links_still_broken");
|
String pattern = bundle.getString("files_links_still_broken");
|
||||||
String stillBroken = MessageFormat.format(pattern,
|
String stillBroken = MessageFormat.format(pattern,
|
||||||
new Object[] {linkState.getNumberBrokenLinks(), linkState.getNumberBrokenFiles()});
|
new Object[] {linkState.getNumberBrokenLinks(), linkState.getNumberBrokenFiles()});
|
||||||
pattern = bundle.getString("broken_links_fixed");
|
pattern = bundle.getString("broken_items_fixed");
|
||||||
String linksFixed = MessageFormat.format(pattern,
|
String linksFixed = MessageFormat.format(pattern,
|
||||||
new Object[] {linkState.getNumberFixedLinks()});
|
new Object[] {linkState.getNumberFixedItems()});
|
||||||
|
|
||||||
// get the action to update the current status
|
// get the action to update the current status
|
||||||
UICommand updateStatusAction = aquireAction(context, "update_status_" + linkState.getStore());
|
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(bundle.getString("current_status"));
|
||||||
out.write(":</td><td><div><img src='");
|
out.write(":</td><td><div><img src='");
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
out.write("/images/icons/broken_link.gif' style='vertical-align: -4px; padding-right: 4px;' >");
|
out.write("/images/icons/broken_link.gif' style='vertical-align: -4px;' > ");
|
||||||
out.write(stillBroken);
|
out.write(stillBroken);
|
||||||
out.write("<img src='");
|
out.write(" <img src='");
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
out.write("/images/icons/fixed_link.gif' style='vertical-align: -4px; padding-left: 6px; padding-right: 4px;' >");
|
out.write("/images/icons/fixed_link.gif' style='vertical-align: -4px;' > ");
|
||||||
out.write(linksFixed);
|
out.write(linksFixed);
|
||||||
out.write(" ");
|
out.write(" ");
|
||||||
Utils.encodeRecursive(context, updateStatusAction);
|
Utils.encodeRecursive(context, updateStatusAction);
|
||||||
@@ -180,7 +180,7 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
|||||||
out.write(initialCheckSummary);
|
out.write(initialCheckSummary);
|
||||||
out.write("</div><div style='margin-bottom: 14px;'><img src='");
|
out.write("</div><div style='margin-bottom: 14px;'><img src='");
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
out.write("/images/icons/broken_link.gif'' style='vertical-align: -4px; padding-right: 4px;'/>");
|
out.write("/images/icons/broken_link.gif'' style='vertical-align: -4px;'/> ");
|
||||||
out.write(initialBrokenSummary);
|
out.write(initialBrokenSummary);
|
||||||
out.write("</div>");
|
out.write("</div>");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user