dion        02/05/20 17:01:12

  Modified:    src/java/org/apache/maven/j2ee WarValidator.java
  Log:
  Changes to allow Struts plugin to extend j2ee classes
  
  Revision  Changes    Path
  1.19      +34 -6     
jakarta-turbine-maven/src/java/org/apache/maven/j2ee/WarValidator.java
  
  Index: WarValidator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/j2ee/WarValidator.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- WarValidator.java 20 May 2002 07:07:31 -0000      1.18
  +++ WarValidator.java 21 May 2002 00:01:12 -0000      1.19
  @@ -93,9 +93,14 @@
    *      </li>
    *      <li>Taglibs defined by a <code>&lt;taglib&gt;</code> have a <code>
    *          &lt;taglib-location&gt;</code> that exists in the war</li>
  + *      <li>Error pages specified by a <code>&lt;location&gt;</code> nested 
  + *          within an <code>&lt;error-page&gt;</code> element must exist in the
  + *          war file</li>
  + *      <li>Login and error pages specified in the <code>&lt;form-login-config
  + *          &gt;</code> element must exist in the war file</li>
    * </ol>
    * @author  dIon Gillard
  - * @version $Id: WarValidator.java,v 1.18 2002/05/20 07:07:31 dion Exp $
  + * @version $Id: WarValidator.java,v 1.19 2002/05/21 00:01:12 dion Exp $
    */
   public class WarValidator extends AbstractExecutor
   {
  @@ -168,12 +173,10 @@
       {
           try
           {
  -            getBroadcaster().fireStartedEvent( new ValidationEvent(this,
  -                getWarFileName(), "war validation started"));
  -            validateFile();
  +            startValidation();
               if (!getStatus().isError())
               {
  -                validateWebXml();
  +                validateWarContents();
               }
           }
           finally
  @@ -183,6 +186,31 @@
           }
       }
   
  +    /** Start validation - issue a started event, and check the war file is
  +     * ok from a filesystem perspective - exists and is readable
  +     */
  +    protected void startValidation()
  +    {
  +        getBroadcaster().fireStartedEvent( new ValidationEvent(this,
  +            getWarFileName(), "war validation started"));
  +        validateFile();
  +    }
  +    
  +    /** Hook point for subclasses to add validations
  +     */
  +    protected void validateWarContents()
  +    {
  +        validateWebXml();
  +    }
  +    
  +    /** End validation - fire an ended event
  +     */
  +    protected void endValidation()
  +    {
  +        getBroadcaster().fireEndedEvent( new ValidationEvent(this,
  +            getWarFileName(), "war validation ended"));
  +    }
  +    
       /** validate the war file can be read and exists
        */
       private void validateFile()
  @@ -447,7 +475,7 @@
       /** Getter for property broadcaster.
        * @return Value of property broadcaster.
        */
  -    private ValidationBroadcaster getBroadcaster()
  +    protected ValidationBroadcaster getBroadcaster()
       {
           return broadcaster;
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to