mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
Fix for WCM-648 (NullPointerException)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6270 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
aa5a8e5b9d
commit
a1abd6bfd9
@ -152,119 +152,54 @@ public class LinkValidationAction extends ActionExecuterAbstractBase
|
|||||||
if (destWebappPath != null)
|
if (destWebappPath != null)
|
||||||
{
|
{
|
||||||
// get the object to represent the broken files
|
// get the object to represent the broken files
|
||||||
HrefDifference hdiff =
|
HrefDifference hdiff = this.linkValidationService.getHrefDifference(
|
||||||
this.linkValidationService.getHrefDifference(
|
webappPath, destWebappPath, monitor);
|
||||||
webappPath, destWebappPath, monitor);
|
|
||||||
|
|
||||||
// get the broken files created due to deletions and new/modified files
|
// get the broken files created due to deletions and new/modified files
|
||||||
|
HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(hdiff);
|
||||||
|
|
||||||
// Gav TODO:
|
// TODO: use the counts retrieved from the manifest object and pass them
|
||||||
// Instead of calling
|
// into the constructor, the report object can then store these for
|
||||||
// getHrefManifestBrokenByDelete(hdiff)
|
// later retrieval.
|
||||||
// and getHrefManifestBrokenByNewOrMod(hdiff)
|
|
||||||
//
|
// int baseVersion = manifest.getBaseSnapshotVersion();
|
||||||
// You can now call:
|
// int latestVersion = manifest.getLatestSnapshotVersion();
|
||||||
// HrefManifest manifest =
|
// int fileCount = manifest.getBaseFileCount();
|
||||||
// this.linkValidationService.getBrokenHrefManifest(hdiff);
|
// int linkCount = manifest.getBaseLinkCount();
|
||||||
//
|
|
||||||
// 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 );
|
|
||||||
|
|
||||||
int baseVersion = manifest.getBaseSnapshotVersion(); // Gav TODO: make use of this
|
HrefManifest bogus = new HrefManifest();
|
||||||
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
|
|
||||||
|
|
||||||
|
// TODO: change the constructor to just take one manifest object
|
||||||
|
|
||||||
// create the report object using the 2 sets of results
|
// create the report object using the 2 sets of results
|
||||||
report = new LinkValidationReport(
|
report = new LinkValidationReport(storeName, webappName, monitor, manifest, bogus);
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
else
|
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
|
// retrieve the manifest of all the broken links and files for the webapp
|
||||||
//
|
HrefManifest manifest = this.linkValidationService.getBrokenHrefManifest(webappPath);
|
||||||
// Note that latestVersion >= baseVersion
|
|
||||||
// Whenever latestVersion > baseVersion,
|
|
||||||
// link validation is "behind".
|
|
||||||
|
|
||||||
HrefManifest manifest =
|
|
||||||
this.linkValidationService.getBrokenHrefManifest(webappPath);
|
|
||||||
|
|
||||||
List<HrefManifestEntry> manifests =
|
List<HrefManifestEntry> manifests =
|
||||||
manifest.getManifestEntries();
|
manifest.getManifestEntries();
|
||||||
int baseVersion = manifest.getBaseSnapshotVersion(); // Gav TODO: make use of this
|
|
||||||
int latestVersion = manifest.getLatestSnapshotVersion(); // 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
|
||||||
int fileCount = manifest.getBaseFileCount(); // Gav TODO: make use of this
|
// later retrieval to show how far 'bejind' the report is.
|
||||||
int linkCount = manifest.getBaseLinkCount(); // Gav TODO: make use of this
|
// 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
|
// Create the report object using the link check results
|
||||||
|
report = new LinkValidationReport(storeName, webappName, monitor, manifests);
|
||||||
report = new LinkValidationReport(
|
|
||||||
storeName,
|
// the monitor object is not used anymore so manually set
|
||||||
webappName,
|
// the done status so the client ca retrieve the report.
|
||||||
monitor,
|
monitor.setDone( true );
|
||||||
|
|
||||||
//
|
|
||||||
// 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
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Throwable err)
|
catch (Throwable err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user