Merged V2.1 to HEAD

6408: removing the avmsubmittedaspect
   6409: reintroducing the avmclearsubmittedhandler as a stub in order to keep inflight workflows operating properly.
   6412: Fix to a subtle navigation issue when browsing WCM projects.
   6415: WCM-678 - Page size WCM browse screens
   6417: Fixes WCM-556, WCM-557, WCM-618 & WCM-620
            Line endings change -- manual merge
            Manual 'root\projects\web-client\config\alfresco\messages\webclient.properties'


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6731 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 16:23:24 +00:00
parent 858faa9f7b
commit 10b7df662f
7 changed files with 413 additions and 666 deletions

View File

@@ -158,47 +158,21 @@ public class LinkValidationAction extends ActionExecuterAbstractBase
// get the broken files created due to deletions and new/modified files
HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(hdiff);
// TODO: use the counts retrieved from the manifest object and pass them
// into the constructor, the report object can then store these for
// later retrieval.
// int baseVersion = manifest.getBaseSnapshotVersion();
// int latestVersion = manifest.getLatestSnapshotVersion();
// int fileCount = manifest.getBaseFileCount();
// int linkCount = manifest.getBaseLinkCount();
HrefManifest bogus = new HrefManifest();
// TODO: change the constructor to just take one manifest object
// create the report object using the 2 sets of results
report = new LinkValidationReport(storeName, webappName, monitor, manifest, bogus);
report = new LinkValidationReport(storeName, webappName, manifest,
monitor.getFileUpdateCount(), monitor.getUrlUpdateCount());
}
else
{
// retrieve the manifest of all the broken links and files for the webapp
HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(webappPath);
List<HrefManifestEntry> manifests =
manifest.getManifestEntries();
// TODO: use the counts retrieved from the manifest object and pass them
// into the constructor, the report object can then store these for
// later retrieval to show how far 'bejind' the report is.
// NOTE: that latestVersion >= baseVersion
// Whenever latestVersion > baseVersion,
// link validation is "behind".
// int baseVersion = manifest.getBaseSnapshotVersion();
// int latestVersion = manifest.getLatestSnapshotVersion();
// int fileCount = manifest.getBaseFileCount();
// int linkCount = manifest.getBaseLinkCount();
// Create the report object using the link check results
report = new LinkValidationReport(storeName, webappName, monitor, manifests);
report = new LinkValidationReport(storeName, webappName, manifest,
manifest.getBaseFileCount(), manifest.getBaseLinkCount());
// the monitor object is not used anymore so manually set
// the done status so the client ca retrieve the report.
// the monitor object is not used here so manually set
// the done status so the client can retrieve the report.
monitor.setDone( true );
}
}

View File

@@ -52,6 +52,8 @@ public class LinkValidationReport implements Serializable
private int numberFilesChecked = -1;
private int numberLinksChecked = -1;
private int numberBrokenLinks = -1;
private int baseSnapshotVersion = -1;
private int latestSnapshotVersion = -1;
private boolean successful = true;
private Date completedAt;
@@ -67,21 +69,24 @@ public class LinkValidationReport implements Serializable
*
* @param store The store the link check was run against
* @param webapp The webapp within the store the check was run against
* @param status The object containing status i.e. file, link counts and the list
* of files containing broken links
* @param manifests The manifest of broken links and files
* @param manifest The manifest of broken links and snapshot info
* @param noFilesChecked The number of files checked
* @param noLinksChecked The number of links checked
*/
public LinkValidationReport(String store, String webapp, HrefValidationProgress status,
List<HrefManifestEntry> manifests)
public LinkValidationReport(String store, String webapp, HrefManifest manifest,
int noFilesChecked, int noLinksChecked)
{
this.store = store;
this.webapp = webapp;
this.completedAt = new Date();
this.numberFilesChecked = status.getFileUpdateCount();
this.numberLinksChecked = status.getUrlUpdateCount();
this.numberBrokenLinks = 0;
this.numberFilesChecked = noFilesChecked;
this.numberLinksChecked = noLinksChecked;
this.baseSnapshotVersion = manifest.getBaseSnapshotVersion();
this.latestSnapshotVersion = manifest.getLatestSnapshotVersion();
// create list and map
List<HrefManifestEntry> manifests = manifest.getManifestEntries();
this.brokenFiles = new ArrayList<String>(manifests.size());
this.brokenLinksByFile = new HashMap<String, HrefManifestEntry>(manifests.size());
@@ -89,43 +94,6 @@ public class LinkValidationReport implements Serializable
storeBrokenFiles(manifests);
}
/**
* Constructs a link validation report from the results of a comparison check
* between the staging area and another sandbox i.e. an authors sandbox or a
* workflow sandbox.
*
* @param store The store the link check was run against
* @param webapp The webapp within the store the check was run against
* @param status The object containing status i.e. file, link counts and the list
* of files containing broken links
* @param brokenByDelete Object representing the broken links caused by deleted assets
* @param brokenByNewOrMod Object representing the broken links caused by new or
* modified assets
*/
public LinkValidationReport(String store, String webapp, HrefValidationProgress status,
HrefManifest brokenByDelete, HrefManifest brokenByNewOrMod)
{
this.store = store;
this.webapp = webapp;
this.completedAt = new Date();
this.numberFilesChecked = status.getFileUpdateCount();
this.numberLinksChecked = status.getUrlUpdateCount();
this.numberBrokenLinks = 0;
// get the lists of broken files
List<HrefManifestEntry> byDelete = brokenByDelete.getManifestEntries();
List<HrefManifestEntry> byNewOrMod = brokenByNewOrMod.getManifestEntries();
// create list and map
this.brokenFiles = new ArrayList<String>(byDelete.size() + byNewOrMod.size());
this.brokenLinksByFile = new HashMap<String, HrefManifestEntry>(
byDelete.size() + byNewOrMod.size());
// build the required list and map
storeBrokenFiles(byDelete);
storeBrokenFiles(byNewOrMod);
}
/**
* Constructs a link validation report from an error that occurred
*
@@ -197,6 +165,16 @@ public class LinkValidationReport implements Serializable
return links;
}
public int getBaseSnapshotVersion()
{
return this.baseSnapshotVersion;
}
public int getLatestSnapshotVersion()
{
return this.latestSnapshotVersion;
}
public boolean wasSuccessful()
{
return this.successful;
@@ -219,6 +197,8 @@ public class LinkValidationReport implements Serializable
StringBuilder buffer = new StringBuilder(super.toString());
buffer.append(" (store=").append(this.store);
buffer.append(" webapp=").append(this.webapp);
buffer.append(" baseSnapshot=").append(this.baseSnapshotVersion);
buffer.append(" latestSnapshot=").append(this.latestSnapshotVersion);
buffer.append(" error=").append(this.error).append(")");
return buffer.toString();
}
@@ -236,13 +216,9 @@ public class LinkValidationReport implements Serializable
{
String fileName = manifest.getFileName();
// make sure the same file only gets added once
if (this.brokenFiles.contains(fileName) == false)
{
this.brokenFiles.add(fileName);
this.brokenLinksByFile.put(fileName, manifest);
this.numberBrokenLinks = this.numberBrokenLinks + manifest.getHrefs().size();
}
this.brokenFiles.add(fileName);
this.brokenLinksByFile.put(fileName, manifest);
this.numberBrokenLinks = this.numberBrokenLinks + manifest.getHrefs().size();
}
}
}