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:
@@ -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<String> brokenStaticFilesStart;
|
||||
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 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<String> 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<String>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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(":</td><td><div><img src='");
|
||||
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("<img src='");
|
||||
out.write(" <img src='");
|
||||
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(" ");
|
||||
Utils.encodeRecursive(context, updateStatusAction);
|
||||
@@ -180,7 +180,7 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
||||
out.write(initialCheckSummary);
|
||||
out.write("</div><div style='margin-bottom: 14px;'><img src='");
|
||||
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("</div>");
|
||||
}
|
||||
|
Reference in New Issue
Block a user