mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.1 to HEAD
6958: Fix for WCM-823 6959: Merged V1.4 to V2.1 6943: Upgrade scripts for transaction commit time and indexes for QName columns on alf_child_assoc 6960: Fixed script patch "applied on" date updates. 6961: Retry transactions on ConstraintViolationException. 6964: Added svn revision number to be substituted into build string if build number is not passed. 6965: Daylight savings for FTP. Fix for AR-1776. 6966: Added catch blocks for the AVMLockingException. WCM-877. 6967: Interim fix for WCM-866 (large link validation report causes SQL exception) 6968: Fixes for AWC-1309 "Broken preview image for Web Projects in MySpaces" and similar AWC-1635 "Broken/Missing images in MySpaces Web Script". 6970: Force DB write ordering of the NodeStatus vs Node object. 6971: More transaction demarcation fixes for special cases of non-executed script patches. 6972: Switch off session size management for the mass archive and restore test. 6973: Fixed AR-1801: Boolean isMultiValued() no longer returns null git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7370 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1242,6 +1242,7 @@ generated_tab={0} Generated Files
|
|||||||
all_items_tab=All Items
|
all_items_tab=All Items
|
||||||
inc_tab_size=Increases the size of the scrollable area by 100px
|
inc_tab_size=Increases the size of the scrollable area by 100px
|
||||||
dec_tab_size=Decreases the size of the scrollable area by 100px (to a minimum of 100px)
|
dec_tab_size=Decreases the size of the scrollable area by 100px (to a minimum of 100px)
|
||||||
|
failed_to_find_validation_report=Failed to find the link validation report, this is probably due to the report being too large, please lower the 'maxNumberLinksInReport' setting.
|
||||||
|
|
||||||
prompt_for_web_form=Select Web Form
|
prompt_for_web_form=Select Web Form
|
||||||
prompt_for_web_form_info=Select the Web Form to use for editing this file
|
prompt_for_web_form_info=Select the Web Form to use for editing this file
|
||||||
|
@@ -123,6 +123,7 @@ a.spacefilterLink:link, a.spacefilterLink:visited
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
}
|
}
|
||||||
@@ -531,6 +532,7 @@ a.refreshViewLink:link, a.refreshViewLink:visited, a.refreshViewLink:hover
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #515D6B;
|
color: #515D6B;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacePreview
|
.spacePreview
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
<#assign weekms=1000*60*60*24*7>
|
<#assign weekms=1000*60*60*24*7>
|
||||||
<#list companyhome.nodeByReference[args.h].children?sort_by('name') as d>
|
<#list companyhome.nodeByReference[args.h].children?sort_by('name') as d>
|
||||||
<#if (d.isContainer || d.isDocument) &&
|
<#if (d.isContainer || d.isDocument) &&
|
||||||
|
(d.type != "{http://www.alfresco.org/model/forum/1.0}forums") &&
|
||||||
|
(d.type != "{http://www.alfresco.org/model/wcmappmodel/1.0}webfolder") &&
|
||||||
((args.f="0") ||
|
((args.f="0") ||
|
||||||
(args.f="1" && d.isContainer) ||
|
(args.f="1" && d.isContainer) ||
|
||||||
(args.f="2" && d.isDocument) ||
|
(args.f="2" && d.isDocument) ||
|
||||||
|
@@ -60,6 +60,7 @@ public class LinkValidationState
|
|||||||
private String store;
|
private String store;
|
||||||
private String webapp;
|
private String webapp;
|
||||||
private boolean checkBeenReRun = false;
|
private boolean checkBeenReRun = false;
|
||||||
|
private boolean maxLinksReached = false;
|
||||||
private Date checkCompletedAt;
|
private Date checkCompletedAt;
|
||||||
|
|
||||||
private int noFilesCheckedStart = -1;
|
private int noFilesCheckedStart = -1;
|
||||||
@@ -82,6 +83,8 @@ public class LinkValidationState
|
|||||||
private int baseSnapshotVersion = 0;
|
private int baseSnapshotVersion = 0;
|
||||||
private int latestSnapshotVersion = 0;
|
private int latestSnapshotVersion = 0;
|
||||||
|
|
||||||
|
private int maxNumberLinksInReport = -1;
|
||||||
|
|
||||||
private List<String> brokenStaticFilesStart;
|
private List<String> brokenStaticFilesStart;
|
||||||
private List<String> brokenFormsStart;
|
private List<String> brokenFormsStart;
|
||||||
|
|
||||||
@@ -237,7 +240,7 @@ public class LinkValidationState
|
|||||||
*/
|
*/
|
||||||
public int getBaseSnapshotVersion()
|
public int getBaseSnapshotVersion()
|
||||||
{
|
{
|
||||||
return baseSnapshotVersion;
|
return this.baseSnapshotVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -245,7 +248,23 @@ public class LinkValidationState
|
|||||||
*/
|
*/
|
||||||
public int getLatestSnapshotVersion()
|
public int getLatestSnapshotVersion()
|
||||||
{
|
{
|
||||||
return latestSnapshotVersion;
|
return this.latestSnapshotVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The maximum number of links a report can have
|
||||||
|
*/
|
||||||
|
public int getMaxNumberLinksInReport()
|
||||||
|
{
|
||||||
|
return this.maxNumberLinksInReport;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the maximum number of links was exceeded in the last check
|
||||||
|
*/
|
||||||
|
public boolean hasMaxNumberLinksExceeded()
|
||||||
|
{
|
||||||
|
return this.maxLinksReached;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -360,6 +379,11 @@ public class LinkValidationState
|
|||||||
// get the snapshot versions
|
// get the snapshot versions
|
||||||
this.baseSnapshotVersion = report.getBaseSnapshotVersion();
|
this.baseSnapshotVersion = report.getBaseSnapshotVersion();
|
||||||
this.latestSnapshotVersion = report.getLatestSnapshotVersion();
|
this.latestSnapshotVersion = report.getLatestSnapshotVersion();
|
||||||
|
|
||||||
|
// get whether the max number of links was exceeded for the report
|
||||||
|
// and the maximum number of links allowed
|
||||||
|
this.maxLinksReached = report.hasMaxNumberLinksExceeded();
|
||||||
|
this.maxNumberLinksInReport = report.getMaxNumberLinksInReport();
|
||||||
|
|
||||||
if (this.cause == null)
|
if (this.cause == null)
|
||||||
{
|
{
|
||||||
|
@@ -119,206 +119,213 @@ public class UILinkValidationReport extends AbstractLinkValidationReportComponen
|
|||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Rendering report from state object: " + linkState);
|
logger.debug("Rendering report from state object: " + linkState);
|
||||||
|
|
||||||
if (linkState.getError() == null && linkState.getNumberBrokenLinks() > 0)
|
if (linkState != null)
|
||||||
{
|
{
|
||||||
// determine whether the generated files and broken links sections
|
if (linkState.getError() == null && linkState.getNumberBrokenLinks() > 0)
|
||||||
// should be expanded
|
|
||||||
boolean sectionsExpanded = this.getItemsExpanded();
|
|
||||||
|
|
||||||
// render the required JavaScript
|
|
||||||
String selectedTab = this.getInitialTab();
|
|
||||||
out.write("<script type='text/javascript'>");
|
|
||||||
out.write("var _alfCurrentTab = '");
|
|
||||||
out.write(selectedTab);
|
|
||||||
out.write("';</script>\n");
|
|
||||||
|
|
||||||
out.write("<script type='text/javascript' src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
out.write("/scripts/ajax/yahoo/dom/dom-min.js'></script>\n");
|
|
||||||
|
|
||||||
out.write("<script type='text/javascript' src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
out.write("/scripts/ajax/link-validation-report.js'></script>\n");
|
|
||||||
|
|
||||||
// gather count data for tab titles
|
|
||||||
int numStaticFiles = linkState.getStaticFilesWithBrokenLinks().size();
|
|
||||||
int numForms = linkState.getFormsWithBrokenLinks().size();
|
|
||||||
int numBrokenFileLinks = linkState.getNoBrokenLinksInStaticFiles();
|
|
||||||
int numBrokenFormLinks = linkState.getNoBrokenLinksInForms();
|
|
||||||
int numFixedItems = linkState.getNumberFixedItems();
|
|
||||||
|
|
||||||
String pattern = bundle.getString("static_tab");
|
|
||||||
String staticTabTitle = MessageFormat.format(pattern,
|
|
||||||
new Object[] {numStaticFiles});
|
|
||||||
|
|
||||||
pattern = bundle.getString("generated_tab");
|
|
||||||
String generatedTabTitle = MessageFormat.format(pattern,
|
|
||||||
new Object[] {numForms});
|
|
||||||
|
|
||||||
// render the tabs
|
|
||||||
out.write("<div class='tabs'><ul><li><span class='tabLabel'>");
|
|
||||||
out.write(bundle.getString("broken"));
|
|
||||||
out.write(":</span></li><li id='staticTab'");
|
|
||||||
if (selectedTab.equals("staticTab"))
|
|
||||||
{
|
{
|
||||||
out.write(" class='selectedTab'");
|
// determine whether the generated files and broken links sections
|
||||||
}
|
// should be expanded
|
||||||
out.write("><a href=\"");
|
boolean sectionsExpanded = this.getItemsExpanded();
|
||||||
out.write("javascript:Alfresco.tabSelected('static');\"><span>");
|
|
||||||
out.write(staticTabTitle);
|
|
||||||
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
out.write("/images/icons/broken_link.gif' />");
|
|
||||||
out.write(Integer.toString(numBrokenFileLinks));
|
|
||||||
out.write(")</span></a></li><li id='generatedTab'");
|
|
||||||
if (selectedTab.equals("generatedTab"))
|
|
||||||
{
|
|
||||||
out.write(" class='selectedTab'");
|
|
||||||
}
|
|
||||||
out.write("><a href=\"");
|
|
||||||
out.write("javascript:Alfresco.tabSelected('generated');\"><span>");
|
|
||||||
out.write(generatedTabTitle);
|
|
||||||
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
out.write("/images/icons/broken_link.gif' />");
|
|
||||||
out.write(Integer.toString(numBrokenFormLinks));
|
|
||||||
out.write(")</span></a></li><li><span class='tabLabel'>");
|
|
||||||
out.write(bundle.getString("fixed"));
|
|
||||||
out.write(":</span></li><li id='fixedTab'>");
|
|
||||||
if (selectedTab.equals("fixedTab"))
|
|
||||||
{
|
|
||||||
out.write(" class='selectedTab'");
|
|
||||||
}
|
|
||||||
out.write("<a href=\"");
|
|
||||||
out.write("javascript:Alfresco.tabSelected('fixed');\"><span>");
|
|
||||||
out.write(bundle.getString("all_items_tab"));
|
|
||||||
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
out.write("/images/icons/green_tick.gif' />");
|
|
||||||
out.write(Integer.toString(numFixedItems));
|
|
||||||
out.write(")</span></a></li>");
|
|
||||||
out.write("<li><span class='tabButton'>");
|
|
||||||
|
|
||||||
// render the update status button
|
|
||||||
UICommand updateStatusAction = aquireUpdateStatusAction(context,
|
|
||||||
"update_status_" + linkState.getStore());
|
|
||||||
Utils.encodeRecursive(context, updateStatusAction);
|
|
||||||
|
|
||||||
out.write("</span></li></ul></div>");
|
|
||||||
|
|
||||||
// reset the oddRow flag
|
|
||||||
this.oddRow = true;
|
|
||||||
|
|
||||||
// render the list of broken files and their contained links
|
|
||||||
out.write("<div id='staticTabContent'");
|
|
||||||
if (selectedTab.equals("staticTab") == false)
|
|
||||||
{
|
|
||||||
out.write(" style='display: none;'");
|
|
||||||
}
|
|
||||||
out.write(">");
|
|
||||||
renderTabHeader(out, context, "staticTab", true);
|
|
||||||
out.write("<div id='staticTabBody' class='linkValTabContentBody'>");
|
|
||||||
|
|
||||||
List<String> brokenFiles = linkState.getStaticFilesWithBrokenLinks();
|
// render the required JavaScript
|
||||||
if (brokenFiles == null || brokenFiles.size() == 0)
|
String selectedTab = this.getInitialTab();
|
||||||
{
|
out.write("<script type='text/javascript'>");
|
||||||
renderNoItems(out, context);
|
out.write("var _alfCurrentTab = '");
|
||||||
}
|
out.write(selectedTab);
|
||||||
else
|
out.write("';</script>\n");
|
||||||
{
|
|
||||||
UIActions actions = aquireFileActions("broken_file_actions", getValue().getStore());
|
|
||||||
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
|
||||||
int rootPathIndex = AVMUtil.buildSandboxRootPath(linkState.getStore()).length();
|
|
||||||
String dns = AVMUtil.lookupStoreDNS(linkState.getStore());
|
|
||||||
ClientConfigElement config = Application.getClientConfig(context);
|
|
||||||
String wcmDomain = config.getWCMDomain();
|
|
||||||
String wcmPort = config.getWCMPort();
|
|
||||||
|
|
||||||
// render each broken file
|
|
||||||
for (String file : brokenFiles)
|
|
||||||
{
|
|
||||||
renderBrokenFile(context, out, file, linkState, actions, avmService,
|
|
||||||
rootPathIndex, wcmDomain, wcmPort, dns, sectionsExpanded);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
out.write("</div></div>");
|
|
||||||
|
|
||||||
// reset the oddRow flag
|
|
||||||
this.oddRow = true;
|
|
||||||
|
|
||||||
// render the list of broken forms, the files it generated and their contained links
|
|
||||||
out.write("<div id='generatedTabContent'");
|
|
||||||
if (selectedTab.equals("generatedTab") == false)
|
|
||||||
{
|
|
||||||
out.write(" style='display: none;'");
|
|
||||||
}
|
|
||||||
out.write(">");
|
|
||||||
renderTabHeader(out, context, "generatedTab", true);
|
|
||||||
out.write("<div id='generatedTabBody' class='linkValTabContentBody'>");
|
|
||||||
|
|
||||||
List<String> brokenForms = linkState.getFormsWithBrokenLinks();
|
|
||||||
if (brokenForms == null || brokenForms.size() == 0)
|
|
||||||
{
|
|
||||||
renderNoItems(out, context);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UIActions actions = aquireFileActions("broken_form_actions", getValue().getStore());
|
|
||||||
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
|
||||||
|
|
||||||
for (String form : brokenForms)
|
out.write("<script type='text/javascript' src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/scripts/ajax/yahoo/dom/dom-min.js'></script>\n");
|
||||||
|
|
||||||
|
out.write("<script type='text/javascript' src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/scripts/ajax/link-validation-report.js'></script>\n");
|
||||||
|
|
||||||
|
// gather count data for tab titles
|
||||||
|
int numStaticFiles = linkState.getStaticFilesWithBrokenLinks().size();
|
||||||
|
int numForms = linkState.getFormsWithBrokenLinks().size();
|
||||||
|
int numBrokenFileLinks = linkState.getNoBrokenLinksInStaticFiles();
|
||||||
|
int numBrokenFormLinks = linkState.getNoBrokenLinksInForms();
|
||||||
|
int numFixedItems = linkState.getNumberFixedItems();
|
||||||
|
|
||||||
|
String pattern = bundle.getString("static_tab");
|
||||||
|
String staticTabTitle = MessageFormat.format(pattern,
|
||||||
|
new Object[] {numStaticFiles});
|
||||||
|
|
||||||
|
pattern = bundle.getString("generated_tab");
|
||||||
|
String generatedTabTitle = MessageFormat.format(pattern,
|
||||||
|
new Object[] {numForms});
|
||||||
|
|
||||||
|
// render the tabs
|
||||||
|
out.write("<div class='tabs'><ul><li><span class='tabLabel'>");
|
||||||
|
out.write(bundle.getString("broken"));
|
||||||
|
out.write(":</span></li><li id='staticTab'");
|
||||||
|
if (selectedTab.equals("staticTab"))
|
||||||
{
|
{
|
||||||
renderBrokenForm(context, out, form, linkState, actions,
|
out.write(" class='selectedTab'");
|
||||||
avmService, sectionsExpanded);
|
|
||||||
}
|
}
|
||||||
}
|
out.write("><a href=\"");
|
||||||
|
out.write("javascript:Alfresco.tabSelected('static');\"><span>");
|
||||||
out.write("</div></div>");
|
out.write(staticTabTitle);
|
||||||
|
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
||||||
// reset the oddRow flag
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
this.oddRow = true;
|
out.write("/images/icons/broken_link.gif' />");
|
||||||
|
out.write(Integer.toString(numBrokenFileLinks));
|
||||||
// render the list of fixed items
|
out.write(")</span></a></li><li id='generatedTab'");
|
||||||
out.write("<div id='fixedTabContent'");
|
if (selectedTab.equals("generatedTab"))
|
||||||
if (selectedTab.equals("fixedTab") == false)
|
|
||||||
{
|
|
||||||
out.write(" style='display: none;'");
|
|
||||||
}
|
|
||||||
out.write(">");
|
|
||||||
renderTabHeader(out, context, "fixedTab", false);
|
|
||||||
out.write("<div id='fixedTabBody' class='linkValTabContentBody'>");
|
|
||||||
|
|
||||||
int fixedItems = 0;
|
|
||||||
List<String> fixedFiles = linkState.getFixedFiles();
|
|
||||||
List<String> fixedForms = linkState.getFixedForms();
|
|
||||||
if (fixedFiles != null)
|
|
||||||
{
|
|
||||||
fixedItems = fixedFiles.size();
|
|
||||||
}
|
|
||||||
if (fixedForms != null)
|
|
||||||
{
|
|
||||||
fixedItems += fixedForms.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fixedItems == 0)
|
|
||||||
{
|
|
||||||
renderNoItems(out, context);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (String file : fixedFiles)
|
|
||||||
{
|
{
|
||||||
renderFixedItem(context, out, file, linkState);
|
out.write(" class='selectedTab'");
|
||||||
|
}
|
||||||
|
out.write("><a href=\"");
|
||||||
|
out.write("javascript:Alfresco.tabSelected('generated');\"><span>");
|
||||||
|
out.write(generatedTabTitle);
|
||||||
|
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/broken_link.gif' />");
|
||||||
|
out.write(Integer.toString(numBrokenFormLinks));
|
||||||
|
out.write(")</span></a></li><li><span class='tabLabel'>");
|
||||||
|
out.write(bundle.getString("fixed"));
|
||||||
|
out.write(":</span></li><li id='fixedTab'>");
|
||||||
|
if (selectedTab.equals("fixedTab"))
|
||||||
|
{
|
||||||
|
out.write(" class='selectedTab'");
|
||||||
|
}
|
||||||
|
out.write("<a href=\"");
|
||||||
|
out.write("javascript:Alfresco.tabSelected('fixed');\"><span>");
|
||||||
|
out.write(bundle.getString("all_items_tab"));
|
||||||
|
out.write(" (<img class='tabTitleBrokenLinkIcon' src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/green_tick.gif' />");
|
||||||
|
out.write(Integer.toString(numFixedItems));
|
||||||
|
out.write(")</span></a></li>");
|
||||||
|
out.write("<li><span class='tabButton'>");
|
||||||
|
|
||||||
|
// render the update status button
|
||||||
|
UICommand updateStatusAction = aquireUpdateStatusAction(context,
|
||||||
|
"update_status_" + linkState.getStore());
|
||||||
|
Utils.encodeRecursive(context, updateStatusAction);
|
||||||
|
|
||||||
|
out.write("</span></li></ul></div>");
|
||||||
|
|
||||||
|
// reset the oddRow flag
|
||||||
|
this.oddRow = true;
|
||||||
|
|
||||||
|
// render the list of broken files and their contained links
|
||||||
|
out.write("<div id='staticTabContent'");
|
||||||
|
if (selectedTab.equals("staticTab") == false)
|
||||||
|
{
|
||||||
|
out.write(" style='display: none;'");
|
||||||
|
}
|
||||||
|
out.write(">");
|
||||||
|
renderTabHeader(out, context, "staticTab", true);
|
||||||
|
out.write("<div id='staticTabBody' class='linkValTabContentBody'>");
|
||||||
|
|
||||||
|
List<String> brokenFiles = linkState.getStaticFilesWithBrokenLinks();
|
||||||
|
if (brokenFiles == null || brokenFiles.size() == 0)
|
||||||
|
{
|
||||||
|
renderNoItems(out, context);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UIActions actions = aquireFileActions("broken_file_actions", getValue().getStore());
|
||||||
|
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
||||||
|
int rootPathIndex = AVMUtil.buildSandboxRootPath(linkState.getStore()).length();
|
||||||
|
String dns = AVMUtil.lookupStoreDNS(linkState.getStore());
|
||||||
|
ClientConfigElement config = Application.getClientConfig(context);
|
||||||
|
String wcmDomain = config.getWCMDomain();
|
||||||
|
String wcmPort = config.getWCMPort();
|
||||||
|
|
||||||
|
// render each broken file
|
||||||
|
for (String file : brokenFiles)
|
||||||
|
{
|
||||||
|
renderBrokenFile(context, out, file, linkState, actions, avmService,
|
||||||
|
rootPathIndex, wcmDomain, wcmPort, dns, sectionsExpanded);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String file : fixedForms)
|
out.write("</div></div>");
|
||||||
|
|
||||||
|
// reset the oddRow flag
|
||||||
|
this.oddRow = true;
|
||||||
|
|
||||||
|
// render the list of broken forms, the files it generated and their contained links
|
||||||
|
out.write("<div id='generatedTabContent'");
|
||||||
|
if (selectedTab.equals("generatedTab") == false)
|
||||||
{
|
{
|
||||||
renderFixedItem(context, out, file, linkState);
|
out.write(" style='display: none;'");
|
||||||
}
|
}
|
||||||
|
out.write(">");
|
||||||
|
renderTabHeader(out, context, "generatedTab", true);
|
||||||
|
out.write("<div id='generatedTabBody' class='linkValTabContentBody'>");
|
||||||
|
|
||||||
|
List<String> brokenForms = linkState.getFormsWithBrokenLinks();
|
||||||
|
if (brokenForms == null || brokenForms.size() == 0)
|
||||||
|
{
|
||||||
|
renderNoItems(out, context);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UIActions actions = aquireFileActions("broken_form_actions", getValue().getStore());
|
||||||
|
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
||||||
|
|
||||||
|
for (String form : brokenForms)
|
||||||
|
{
|
||||||
|
renderBrokenForm(context, out, form, linkState, actions,
|
||||||
|
avmService, sectionsExpanded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out.write("</div></div>");
|
||||||
|
|
||||||
|
// reset the oddRow flag
|
||||||
|
this.oddRow = true;
|
||||||
|
|
||||||
|
// render the list of fixed items
|
||||||
|
out.write("<div id='fixedTabContent'");
|
||||||
|
if (selectedTab.equals("fixedTab") == false)
|
||||||
|
{
|
||||||
|
out.write(" style='display: none;'");
|
||||||
|
}
|
||||||
|
out.write(">");
|
||||||
|
renderTabHeader(out, context, "fixedTab", false);
|
||||||
|
out.write("<div id='fixedTabBody' class='linkValTabContentBody'>");
|
||||||
|
|
||||||
|
int fixedItems = 0;
|
||||||
|
List<String> fixedFiles = linkState.getFixedFiles();
|
||||||
|
List<String> fixedForms = linkState.getFixedForms();
|
||||||
|
if (fixedFiles != null)
|
||||||
|
{
|
||||||
|
fixedItems = fixedFiles.size();
|
||||||
|
}
|
||||||
|
if (fixedForms != null)
|
||||||
|
{
|
||||||
|
fixedItems += fixedForms.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fixedItems == 0)
|
||||||
|
{
|
||||||
|
renderNoItems(out, context);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (String file : fixedFiles)
|
||||||
|
{
|
||||||
|
renderFixedItem(context, out, file, linkState);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String file : fixedForms)
|
||||||
|
{
|
||||||
|
renderFixedItem(context, out, file, linkState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out.write("</div></div>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.write("<div> </div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
out.write("</div></div>");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -115,83 +115,99 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
|
|||||||
out.write("</div>");
|
out.write("</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linkState.getError() == null)
|
if (linkState != null)
|
||||||
{
|
{
|
||||||
// render the main summary info
|
if (linkState.getError() == null)
|
||||||
|
|
||||||
int latestVersion = linkState.getLatestSnapshotVersion();
|
|
||||||
int baseVersion = linkState.getBaseSnapshotVersion();
|
|
||||||
|
|
||||||
String pattern = bundle.getString("link_check_completed_at");
|
|
||||||
Date checkAt = linkState.getCheckCompletedAt();
|
|
||||||
String checkTime = Utils.getDateTimeFormat(context).format(checkAt);
|
|
||||||
String checkTimeSummary = MessageFormat.format(pattern,
|
|
||||||
new Object[] {checkTime, baseVersion});
|
|
||||||
|
|
||||||
out.write("<div class='linkValSummaryText'>");
|
|
||||||
out.write(checkTimeSummary);
|
|
||||||
|
|
||||||
// NOTE: Whenever latestVersion > baseVersion, link validation is "behind".
|
|
||||||
if (latestVersion > baseVersion)
|
|
||||||
{
|
{
|
||||||
pattern = bundle.getString("link_check_not_latest");
|
// render the main summary info
|
||||||
String latestVersionInfo =
|
|
||||||
MessageFormat.format(
|
int latestVersion = linkState.getLatestSnapshotVersion();
|
||||||
pattern, new Object[] { new Integer( latestVersion )});
|
int baseVersion = linkState.getBaseSnapshotVersion();
|
||||||
|
|
||||||
|
String pattern = bundle.getString("link_check_completed_at");
|
||||||
|
Date checkAt = linkState.getCheckCompletedAt();
|
||||||
|
String checkTime = Utils.getDateTimeFormat(context).format(checkAt);
|
||||||
|
String checkTimeSummary = MessageFormat.format(pattern,
|
||||||
|
new Object[] {checkTime, baseVersion});
|
||||||
|
|
||||||
|
out.write("<div class='linkValSummaryText'>");
|
||||||
|
out.write(checkTimeSummary);
|
||||||
|
|
||||||
|
// NOTE: Whenever latestVersion > baseVersion, link validation is "behind".
|
||||||
|
if (latestVersion > baseVersion)
|
||||||
|
{
|
||||||
|
pattern = bundle.getString("link_check_not_latest");
|
||||||
|
String latestVersionInfo =
|
||||||
|
MessageFormat.format(
|
||||||
|
pattern, new Object[] { new Integer( latestVersion )});
|
||||||
|
|
||||||
|
out.write(" <img src='");
|
||||||
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
|
out.write("/images/icons/warning.gif' /> ");
|
||||||
|
out.write( latestVersionInfo );
|
||||||
|
}
|
||||||
|
|
||||||
|
pattern = bundle.getString("link_check_items_found");
|
||||||
|
String checkedSummary = MessageFormat.format(pattern,
|
||||||
|
new Object[] {linkState.getNumberFilesChecked(),
|
||||||
|
linkState.getNumberLinksChecked()});
|
||||||
|
|
||||||
|
pattern = bundle.getString("link_check_items_broken");
|
||||||
|
|
||||||
|
String numBrokenLinks = Integer.toString(linkState.getNumberBrokenLinks());
|
||||||
|
if (linkState.hasMaxNumberLinksExceeded())
|
||||||
|
{
|
||||||
|
numBrokenLinks = Integer.toString(linkState.getMaxNumberLinksInReport()) + "+";
|
||||||
|
}
|
||||||
|
|
||||||
|
String brokenSummary = MessageFormat.format(pattern,
|
||||||
|
new Object[] {numBrokenLinks, linkState.getNumberBrokenFiles()});
|
||||||
|
|
||||||
|
out.write("</div><div class='linkValSummaryText'>");
|
||||||
|
out.write(checkedSummary);
|
||||||
out.write(" <img src='");
|
out.write(" <img src='");
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
out.write(context.getExternalContext().getRequestContextPath());
|
||||||
out.write("/images/icons/warning.gif' /> ");
|
|
||||||
out.write( latestVersionInfo );
|
if (linkState.getNumberBrokenLinks() == 0)
|
||||||
}
|
{
|
||||||
|
out.write("/images/icons/info_icon.gif' /> ");
|
||||||
pattern = bundle.getString("link_check_items_found");
|
out.write(bundle.getString("link_check_no_broken"));
|
||||||
String checkedSummary = MessageFormat.format(pattern,
|
}
|
||||||
new Object[] {linkState.getNumberFilesChecked(),
|
else
|
||||||
linkState.getNumberLinksChecked()});
|
{
|
||||||
|
out.write("/images/icons/warning.gif' /> ");
|
||||||
pattern = bundle.getString("link_check_items_broken");
|
out.write(brokenSummary);
|
||||||
String brokenSummary = MessageFormat.format(pattern,
|
}
|
||||||
new Object[] {linkState.getNumberBrokenLinks(),
|
out.write("</div>");
|
||||||
linkState.getNumberBrokenFiles()});
|
|
||||||
|
|
||||||
out.write("</div><div class='linkValSummaryText'>");
|
|
||||||
out.write(checkedSummary);
|
|
||||||
out.write(" <img src='");
|
|
||||||
out.write(context.getExternalContext().getRequestContextPath());
|
|
||||||
|
|
||||||
if (linkState.getNumberBrokenLinks() == 0)
|
|
||||||
{
|
|
||||||
out.write("/images/icons/info_icon.gif' /> ");
|
|
||||||
out.write(bundle.getString("link_check_no_broken"));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
out.write("/images/icons/warning.gif' /> ");
|
// render the error that occurred
|
||||||
out.write(brokenSummary);
|
String pattern = bundle.getString("link_check_error");
|
||||||
|
Date initialCheck = linkState.getCheckCompletedAt();
|
||||||
|
String initialCheckTime = Utils.getDateTimeFormat(context).format(initialCheck);
|
||||||
|
String initialCheckSummary = MessageFormat.format(pattern,
|
||||||
|
new Object[] {initialCheckTime});
|
||||||
|
|
||||||
|
out.write(initialCheckSummary);
|
||||||
|
out.write(" <span class='errorMessage'>");
|
||||||
|
String err = linkState.getError().getMessage();
|
||||||
|
if (err == null)
|
||||||
|
{
|
||||||
|
out.write(linkState.getError().toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.write(err);
|
||||||
|
}
|
||||||
|
out.write("</span>");
|
||||||
}
|
}
|
||||||
out.write("</div>");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// render the error that occurred
|
// if the report was not found at all, show an error to that effect
|
||||||
String pattern = bundle.getString("link_check_error");
|
out.write("<span class='errorMessage'>");
|
||||||
Date initialCheck = linkState.getCheckCompletedAt();
|
out.write(bundle.getString("failed_to_find_validation_report"));
|
||||||
String initialCheckTime = Utils.getDateTimeFormat(context).format(initialCheck);
|
|
||||||
String initialCheckSummary = MessageFormat.format(pattern,
|
|
||||||
new Object[] {initialCheckTime});
|
|
||||||
|
|
||||||
out.write(initialCheckSummary);
|
|
||||||
out.write(" <span class='errorMessage'>");
|
|
||||||
String err = linkState.getError().getMessage();
|
|
||||||
if (err == null)
|
|
||||||
{
|
|
||||||
out.write(linkState.getError().toString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
out.write(err);
|
|
||||||
}
|
|
||||||
out.write("</span>");
|
out.write("</span>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user