diff --git a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java index 20f3a3eef5..367e5bf728 100644 --- a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java +++ b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java @@ -152,119 +152,54 @@ public class LinkValidationAction extends ActionExecuterAbstractBase if (destWebappPath != null) { // get the object to represent the broken files - HrefDifference hdiff = - this.linkValidationService.getHrefDifference( - webappPath, destWebappPath, monitor); + HrefDifference hdiff = this.linkValidationService.getHrefDifference( + webappPath, destWebappPath, monitor); // get the broken files created due to deletions and new/modified files + HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(hdiff); - // Gav TODO: - // Instead of calling - // getHrefManifestBrokenByDelete(hdiff) - // and getHrefManifestBrokenByNewOrMod(hdiff) - // - // You can now call: - // HrefManifest manifest = - // this.linkValidationService.getBrokenHrefManifest(hdiff); - // - // This will give you a pre-merged manifest of all the broken items - // - // This means you can also clean up the broken link report calling - // signature, and remove your merge logic from the implementation. - // - // - // HrefManifest brokenByDelete = this.linkValidationService.getHrefManifestBrokenByDelete(hdiff); - // HrefManifest brokenByNewOrMod = this.linkValidationService.getHrefManifestBrokenByNewOrMod(hdiff); - // - // - 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(); - int baseVersion = manifest.getBaseSnapshotVersion(); // Gav TODO: make use of this - int latestVersion = manifest.getLatestSnapshotVersion(); // Gav TODO: make use of this - int fileCount = manifest.getBaseFileCount(); // Gav TODO: make use of this - int linkCount = manifest.getBaseLinkCount(); // Gav TODO: make use of this - - HrefManifest bogus = new HrefManifest(); // Gav TODO: make this go away + 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, - - // Gav TODO: - // Here's where you can enhance the report: - // - // Pass the following extra parameters - // to the report generator so it can - // put up some sort of indication when - // we're "behind" (and by how much): - // - // baseVersion, - // latestVersion, - - - // Gav TODO: You can replace brokenByDelete - // and brokenByNewOrMod with the - // new pre-merged manifest. - // - // brokenByDelete, - // brokenByNewOrMod - - manifest, - bogus); // Gav TODO: - // Remove this last 'bogus' arg when you re-work the report - // It's just here to satisfy your merge logic - // (which should also probably go away) + report = new LinkValidationReport(storeName, webappName, monitor, manifest, bogus); } else { - // Not updating href info explicitly anymore, - // so tell the system that's already done. - // Note that the monitor won't have valid update counts - - monitor.setDone( true ); - // retrieve the manifest of all the broken links and files for the webapp - // - // Note that latestVersion >= baseVersion - // Whenever latestVersion > baseVersion, - // link validation is "behind". - - HrefManifest manifest = - this.linkValidationService.getBrokenHrefManifest(webappPath); + HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(webappPath); List manifests = manifest.getManifestEntries(); - int baseVersion = manifest.getBaseSnapshotVersion(); // Gav TODO: make use of this - int latestVersion = manifest.getLatestSnapshotVersion(); // Gav TODO: make use of this - - int fileCount = manifest.getBaseFileCount(); // Gav TODO: make use of this - int linkCount = manifest.getBaseLinkCount(); // Gav TODO: make use of this - + + // 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, - - // - // Gav TODO: - // Here's where you can enhance the report: - // - // Pass the following extra parameters - // to the report generator so it can - // put up some sort of indication when - // we're "behind" (and by how much): - // - // baseVersion, - // latestVersion, - - manifests - ); + report = new LinkValidationReport(storeName, webappName, monitor, manifests); + + // the monitor object is not used anymore so manually set + // the done status so the client ca retrieve the report. + monitor.setDone( true ); } } catch (Throwable err)