org.alfresco.web.bean.wcm
Class LinkValidationState

java.lang.Object
  extended by org.alfresco.web.bean.wcm.LinkValidationState
All Implemented Interfaces:
java.io.Serializable

public class LinkValidationState
extends java.lang.Object
implements java.io.Serializable

Object used to retrieve and store the state of a link validaton process. The object is given an initial link validation report object (the result of a LinkValidationService service call) which is used by components to display the result of the links check.

Further reports can then subsequently be given to this object at which point a difference is calculated i.e. which links (if any) have been fixed. This allows components to display the progress of link fixing.

See Also:
Serialized Form

Constructor Summary
LinkValidationState(org.alfresco.linkvalidation.LinkValidationReport initialReport)
          Default constructor
 
Method Summary
 int getBaseSnapshotVersion()
           
 java.util.List getBrokenFilesByForm(java.lang.String form)
           
 java.util.List getBrokenLinksForFile(java.lang.String file)
           
 java.util.Date getCheckCompletedAt()
           
 java.lang.Throwable getError()
           
 java.util.List getFixedFiles()
           
 java.util.List getFixedForms()
           
 java.util.List getFormsWithBrokenLinks()
           
 int getInitialNumberBrokenFiles()
           
 int getInitialNumberBrokenLinks()
           
 int getInitialNumberFilesChecked()
           
 int getInitialNumberLinksChecked()
           
 int getLatestSnapshotVersion()
           
 int getMaxNumberLinksInReport()
           
 int getNoBrokenLinksInForms()
           
 int getNoBrokenLinksInStaticFiles()
           
 int getNumberBrokenFiles()
           
 int getNumberBrokenLinks()
           
 int getNumberFilesChecked()
           
 int getNumberFixedItems()
           
 int getNumberLinksChecked()
           
 java.util.List getStaticFilesWithBrokenLinks()
           
 java.lang.String getStore()
           
 java.lang.String getWebapp()
           
 boolean hasCheckBeenReRun()
          Determines whether the link validation check has been re-run since the intial check
 boolean hasMaxNumberLinksExceeded()
           
protected  void processFiles(java.util.List files, boolean updatedReport, org.alfresco.linkvalidation.LinkValidationReport report)
           
 void processReport(org.alfresco.linkvalidation.LinkValidationReport report, boolean updatedReport)
           
 java.lang.String toString()
           
 void updateState(org.alfresco.linkvalidation.LinkValidationReport newReport)
          Updates the link validation state with the result from a re-run of the link check
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkValidationState

public LinkValidationState(org.alfresco.linkvalidation.LinkValidationReport initialReport)
Default constructor

Method Detail

getStore

public java.lang.String getStore()
Returns:
The store this validation state represents

getWebapp

public java.lang.String getWebapp()
Returns:
The webapp within a store this validaton state represents

getCheckCompletedAt

public java.util.Date getCheckCompletedAt()
Returns:
The date the check was completed

getError

public java.lang.Throwable getError()
Returns:
The error that caused the last report to fail

getInitialNumberFilesChecked

public int getInitialNumberFilesChecked()
Returns:
The number of files checked by the initial link check

getInitialNumberLinksChecked

public int getInitialNumberLinksChecked()
Returns:
The number of links checked by the initial link check

getInitialNumberBrokenFiles

public int getInitialNumberBrokenFiles()
Returns:
The number of broken files found by the initial link check

getInitialNumberBrokenLinks

public int getInitialNumberBrokenLinks()
Returns:
The number of broken links found by the initial link check

getNumberFilesChecked

public int getNumberFilesChecked()
Returns:
The number of files checked by the latest link check

getNumberLinksChecked

public int getNumberLinksChecked()
Returns:
The number of links checked by the latest link check

getNumberBrokenFiles

public int getNumberBrokenFiles()
Returns:
The number of broken files found by the latest link check

getNumberBrokenLinks

public int getNumberBrokenLinks()
Returns:
The number of broken links found by the latest link check

getNoBrokenLinksInStaticFiles

public int getNoBrokenLinksInStaticFiles()
Returns:
The number of broken links in static files

getNoBrokenLinksInForms

public int getNoBrokenLinksInForms()
Returns:
The number of broken links in forms

getNumberFixedItems

public int getNumberFixedItems()
Returns:
The number of items fixed since the initial link check

getBaseSnapshotVersion

public int getBaseSnapshotVersion()
Returns:
The snapshot version of the staging area the link check was run against

getLatestSnapshotVersion

public int getLatestSnapshotVersion()
Returns:
The snapshot version of the staging area at the end of the link check

getMaxNumberLinksInReport

public int getMaxNumberLinksInReport()
Returns:
The maximum number of links a report can have

hasMaxNumberLinksExceeded

public boolean hasMaxNumberLinksExceeded()
Returns:
true if the maximum number of links was exceeded in the last check

getStaticFilesWithBrokenLinks

public java.util.List getStaticFilesWithBrokenLinks()
Returns:
A list of paths to non-generated files that contain broken links

getFormsWithBrokenLinks

public java.util.List getFormsWithBrokenLinks()
Returns:
A list of forms that have generated files containing broken links

getBrokenFilesByForm

public java.util.List getBrokenFilesByForm(java.lang.String form)
Parameters:
form - The name of a form to find broken files for
Returns:
The list of broken files generated by the given form

getBrokenLinksForFile

public java.util.List getBrokenLinksForFile(java.lang.String file)
Parameters:
file - The path to a file with broken links
Returns:
The list of broken links within the given file

getFixedFiles

public java.util.List getFixedFiles()
Returns:
The list of files that have been fixed since the initial link check

getFixedForms

public java.util.List getFixedForms()
Returns:
The list of forms that have been fixed since the initial link check

hasCheckBeenReRun

public boolean hasCheckBeenReRun()
Determines whether the link validation check has been re-run since the intial check

Returns:
true if the link check has been re-run, false otherwise

updateState

public void updateState(org.alfresco.linkvalidation.LinkValidationReport newReport)
Updates the link validation state with the result from a re-run of the link check

Parameters:
newReport - The report to compare the intial report with

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

processReport

public void processReport(org.alfresco.linkvalidation.LinkValidationReport report,
                          boolean updatedReport)

processFiles

protected void processFiles(java.util.List files,
                            boolean updatedReport,
                            org.alfresco.linkvalidation.LinkValidationReport report)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.