- Fixed rendering issues of large reports and lots of broken links

- Fixed IE rendering issues

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6184 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2007-07-06 08:34:38 +00:00
parent eec22873c4
commit 2b1c90fa92
4 changed files with 20 additions and 13 deletions

View File

@@ -127,7 +127,7 @@ public abstract class AbstractLinkValidationReportComponent extends SelfRenderin
* @param linkState The current link valiation state * @param linkState The current link valiation state
* @return Comma separated list of broken links * @return Comma separated list of broken links
*/ */
protected String getBrokenLinks(String avmPath, LinkValidationState linkState) protected String getBrokenLinks(FacesContext context, String avmPath, LinkValidationState linkState)
{ {
List<String> brokenLinks = linkState.getBrokenLinksForFile(avmPath); List<String> brokenLinks = linkState.getBrokenLinksForFile(avmPath);
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@@ -136,13 +136,16 @@ public abstract class AbstractLinkValidationReportComponent extends SelfRenderin
{ {
if (first == false) if (first == false)
{ {
builder.append(", "); builder.append("<br/>");
} }
else else
{ {
first = false; first = false;
} }
builder.append("<img src='");
builder.append(context.getExternalContext().getRequestContextPath());
builder.append("/images/icons/broken_link.gif' style='vertical-align: -4px;' />");
builder.append(parseBrokenLink(link)); builder.append(parseBrokenLink(link));
} }
@@ -150,7 +153,7 @@ public abstract class AbstractLinkValidationReportComponent extends SelfRenderin
} }
/** /**
* Removes the virtulisation server host name from the link if appropriate * Removes the virtaulisation server host name from the link if appropriate
* *
* @param linkUrl The URL that is broken * @param linkUrl The URL that is broken
* @return Parsed URL * @return Parsed URL
@@ -169,7 +172,14 @@ public abstract class AbstractLinkValidationReportComponent extends SelfRenderin
} }
} }
return link; // truncate the link if it is longer than 100 chars
String title = link;
if (link.length() > 60)
{
link = link.substring(0, 60) + "...";
}
return "<span title='" + title + "'>&nbsp;" + link + "</span>";
} }
/** /**
@@ -188,7 +198,7 @@ public abstract class AbstractLinkValidationReportComponent extends SelfRenderin
out.write("<table cellpadding='0' cellspacing='0'><tr><td valign='top'><img src='"); out.write("<table cellpadding='0' cellspacing='0'><tr><td valign='top'><img src='");
out.write(context.getExternalContext().getRequestContextPath()); out.write(context.getExternalContext().getRequestContextPath());
out.write(getIcon(fileName)); out.write(getIcon(fileName));
out.write("' style='padding: 5px;' /></td>"); out.write("' style='margin: 5px;' /></td>");
out.write("<td width='100%'><div style='padding: 5px;'><div style='font-weight: bold;'>"); out.write("<td width='100%'><div style='padding: 5px;'><div style='font-weight: bold;'>");
out.write(fileName); out.write(fileName);
out.write("</div><div style='padding-top: 2px;'>"); out.write("</div><div style='padding-top: 2px;'>");

View File

@@ -126,7 +126,7 @@ public class UILinkValidationBrokenFiles extends AbstractLinkValidationReportCom
String filePath = nameAndPath[1]; String filePath = nameAndPath[1];
// build the list of broken links for the file // build the list of broken links for the file
String brokenLinks = getBrokenLinks(file, linkState); String brokenLinks = getBrokenLinks(context, file, linkState);
// render the row with the appropriate background style // render the row with the appropriate background style
out.write("<tr class='"); out.write("<tr class='");

View File

@@ -35,7 +35,6 @@ import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMNode; import org.alfresco.web.bean.wcm.AVMNode;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.LinkValidationState; import org.alfresco.web.bean.wcm.LinkValidationState;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.repo.component.UIActions; import org.alfresco.web.ui.repo.component.UIActions;
@@ -166,7 +165,7 @@ public class UILinkValidationBrokenForms extends AbstractLinkValidationReportCom
String filePath = nameAndPath[1]; String filePath = nameAndPath[1];
// build the list of broken links for the file // build the list of broken links for the file
String brokenLinks = getBrokenLinks(brokenFile, linkState); String brokenLinks = getBrokenLinks(context, brokenFile, linkState);
renderFile(out, context, fileName, filePath, brokenLinks); renderFile(out, context, fileName, filePath, brokenLinks);
} }

View File

@@ -758,7 +758,8 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
margin-top: 3px; margin-top: 3px;
padding: 8px; padding: 8px;
background-color: white; background-color: white;
/* border: 1px solid #babfc5; */
_width: 100%;
} }
.linkValidationBrokenFilesPanel .linkValidationBrokenFilesPanel
@@ -766,7 +767,6 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
margin: 6px; margin: 6px;
padding: 8px; padding: 8px;
background-color: white; background-color: white;
/* border: 1px solid #babfc5; */
} }
.linkValidationBrokenFormsPanel .linkValidationBrokenFormsPanel
@@ -774,7 +774,6 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
margin: 6px; margin: 6px;
padding: 8px; padding: 8px;
background-color: white; background-color: white;
/* border: 1px solid #babfc5; */
} }
.linkValidationFixedFilesPanel .linkValidationFixedFilesPanel
@@ -782,7 +781,6 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
margin: 6px; margin: 6px;
padding: 8px; padding: 8px;
background-color: white; background-color: white;
/* border: 1px solid #babfc5; */
} }
.linkValidationList .linkValidationList
@@ -799,7 +797,7 @@ a.sidebarButtonLink, a.sidebarButtonLink:link, a.sidebarButtonLink:visited
.linkValidationListEvenRow .linkValidationListEvenRow
{ {
background-color: #f1f1f1; background-color: #f9f9f9;
} }