You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/09/09 23:12:40 UTC

svn commit: r279881 [1/2] - in /beehive/trunk: ant/ controls/test/perf/webapps/controlsPerfWeb/WEB-INF/ controls/test/perf/webapps/reportWeb/WEB-INF/ controls/test/webapps/controlsWeb/WEB-INF/ docs/forrest/release/src/documentation/content/xdocs/infra/...

Author: rich
Date: Fri Sep  9 14:11:01 2005
New Revision: 279881

URL: http://svn.apache.org/viewcvs?rev=279881&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-915 : Page Flow annotation processors generate files in an IDE-unfriendly way

In a nutshell, this moves our generated Struts (and Validator) config files from the pattern

    /WEB-INF/.pageflow-struts-generated/jpf-struts-config-<module>.xml

to
    /WEB-INF/classes/_pageflow/struts-config-<module>.xml

tests: bvt in netui, run.tests against the distribution (WinXP, linux)
BB: self (linux)


Added:
    beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java   (with props)
Modified:
    beehive/trunk/ant/beehive-tools.xml
    beehive/trunk/ant/buildWebapp.xml
    beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/WEB-INF/web.xml
    beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/web.xml
    beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/infra/beehive-ant-macros.xml
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/config/beehive-netui-config.xml
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/projects.xml
    beehive/trunk/netui/ant/webappTemplate.xml
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/AnnotationToXML.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MissingOptionException.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidationModel.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/TwoPhaseAnnotationProcessor.java
    beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/typesystem/env/Filer.java
    beehive/trunk/netui/src/compiler-xdoclet/pageflow-webapp-build-xdoclet.xml
    beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/AnnotationProcessorEnvironmentImpl.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DynamicSubappActionServlet.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/AnnotationReader.java
    beehive/trunk/netui/src/webapp-template/default/WEB-INF/web.xml
    beehive/trunk/netui/test/src/junitTests/build.xml
    beehive/trunk/netui/test/webapps/drt/bvt-jdk14.xml
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PageFlowUtils.xml
    beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.jsf-ri
    beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.myfaces
    beehive/trunk/netui/test/webapps/projectModel/build.xml
    beehive/trunk/netui/test/webapps/projectModel/webContent/WEB-INF/web.xml
    beehive/trunk/netui/test/webapps/testRecorder-test/testRecorder-test/WEB-INF/web.xml
    beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/WEB-INF/web.xml
    beehive/trunk/netui/test/webapps/urlTemplates/urlTemplates/WEB-INF/web.xml
    beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml
    beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.jsf-ri
    beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces
    beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml
    beehive/trunk/samples/netui-samples/WEB-INF/web.xml
    beehive/trunk/samples/petstoreWeb/build-dist.xml
    beehive/trunk/samples/petstoreWeb/build.xml
    beehive/trunk/samples/petstoreWeb/web/WEB-INF/web.xml
    beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/WEB-INF/src/build.xml
    beehive/trunk/system-controls/samples/jdbc/jdbcControlSample/WEB-INF/web.xml
    beehive/trunk/test/dist-test/ant/testdist-buildWebapp.xml
    beehive/trunk/user/netui-blank/build.xml

Modified: beehive/trunk/ant/beehive-tools.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/ant/beehive-tools.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/ant/beehive-tools.xml (original)
+++ beehive/trunk/ant/beehive-tools.xml Fri Sep  9 14:11:01 2005
@@ -83,9 +83,9 @@
         <attribute name="classpathref" description="The classpath reference for building page flows. Required."/>
         <attribute name="sourcepathref" default="_pageflow.default.sourcepath" description="A reference to a path that contains all the source roots.  Defaults to a path that contains @{srcdir} and @{srcdir}/WEB-INF/src."/>
         <attribute name="webcontentdir" default="@{srcdir}" description="The root location for web content (e.g., JSPs, web.xml, etc.).  Defaults to @{srcdir}."/>
-        <attribute name="weboutputdir" default="@{srcdir}" description="The root of the webapp build output directory, for generated webapp files (e.g., generated Struts config files in WEB-INF/.pageflow-struts-generated).  Defaults to @{srcdir}."/>
-        <attribute name="classoutputdir" default="@{weboutputdir}/WEB-INF/classes" description="The directory for compiled classes.  Defaults to @{weboutputdir}/WEB-INF/classes."/>
-        <attribute name="tempdir" default="@{weboutputdir}/WEB-INF/.tmpbeansrc" description="The directory for temporary .java files, copied from page flows (etc.) with non-.java extensions.  Defaults to @{weboutputdir}/WEB-INF/.tmpbeansrc."/>
+        <attribute name="weboutputdir" default="@{srcdir}" description="Deprecated. All files are generated into @{classoutputdir}."/>
+        <attribute name="classoutputdir" default="@{srcdir}/WEB-INF/classes" description="The directory for compiled classes.  Defaults to @{srcdir}/WEB-INF/classes."/>
+        <attribute name="tempdir" default="@{srcdir}/WEB-INF/.tmpbeansrc" description="The directory for temporary .java files, copied from page flows (etc.) with non-.java extensions.  Defaults to @{srcdir}/WEB-INF/.tmpbeansrc."/>
 
         <sequential>
             <taskdef name="apt" 
@@ -115,7 +115,6 @@
             <echo>    classpath: ${_pageflow.build.classpath}</echo>
             <echo>    sourcepath: ${_pageflow.build.sourcepath}</echo>
             <echo>    webcontentdir: @{webcontentdir}</echo>
-            <echo>    weboutputdir: @{weboutputdir}</echo>
             <echo>    classoutputdir: @{classoutputdir}</echo>
             <echo>    tempdir: @{tempdir}</echo>
 
@@ -127,7 +126,7 @@
                  classpathref="_pageflow.build.classpath"
                  sourcepathref="@{sourcepathref}"
                  srcExtensions="*.jpf,*.jpfs,*.app,*.jsfb,*.java" 
-                 processorOptions="web.content.root=@{webcontentdir},web.source.roots=${_pageflow.build.sourcepath},web.output.root=@{weboutputdir}"
+                 processorOptions="web.content.root=@{webcontentdir}"
                  debug="true"/>
         </sequential>
     </macrodef>

Modified: beehive/trunk/ant/buildWebapp.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/ant/buildWebapp.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/ant/buildWebapp.xml (original)
+++ beehive/trunk/ant/buildWebapp.xml Fri Sep  9 14:11:01 2005
@@ -3,7 +3,6 @@
 <project name="Beehive/SVN/WebappBuild" default="usage">
 
     <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
-    <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
 
     <import file="../beehive-imports.xml"/>
     <import file="beehive-tools.xml"/>
@@ -68,7 +67,6 @@
 
         <delete dir="${webapp.dir}/WEB-INF/classes" includeEmptyDirs="true"/>
         <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" includeEmptyDirs="true"/>
-        <delete dir="${webapp.dir}/WEB-INF/${tmp.jpfgen.dir}" includeEmptyDirs="true" failOnError="false"/>
     </target>
 
 </project>

Modified: beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/WEB-INF/web.xml (original)
+++ beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -24,11 +24,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        </init-param>
-        <init-param>
-            <param-name>config/-global</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/web.xml (original)
+++ beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -50,11 +50,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        </init-param>
-        <init-param>
-            <param-name>config/-global</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml (original)
+++ beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -39,11 +39,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        </init-param>
-        <init-param>
-            <param-name>config/-global</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/infra/beehive-ant-macros.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/infra/beehive-ant-macros.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/infra/beehive-ant-macros.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/infra/beehive-ant-macros.xml Fri Sep  9 14:11:01 2005
@@ -99,22 +99,15 @@
                 <td>The root location for web content (e.g., JSPs, web.xml, etc.).  Defaults to ${srcdir}.</td>
               </tr>
               <tr>
-                <td>weboutputdir</td>
-                <td>No</td>
-                <td>The root of the webapp build output directory, for generated webapp files
-                (e.g., generated Struts config files in WEB-INF/.pageflow-struts-generated).
-                Defaults to ${srcdir}.</td>
-              </tr>
-              <tr>
                 <td>classoutputdir</td>
                 <td>No</td>
-                <td>The directory for compiled classes.  Defaults to ${weboutputdir}/WEB-INF/classes.</td>
+                <td>The directory for compiled classes.  Defaults to ${srcdir}/WEB-INF/classes.</td>
               </tr>
               <tr>
                 <td>tempdir</td>
                 <td>No</td>
                 <td>The directory for temporary .java files, copied from page flows (etc.) with non-.java extensions.
-                    Defaults to ${weboutputdir}/WEB-INF/.tmpbeansrc.</td>
+                    Defaults to ${srcdir}/WEB-INF/.tmpbeansrc.</td>
               </tr>
            </table>
 
@@ -154,7 +147,7 @@
                 <source>
 &lt;build-pageflows srcdir="project/src"
                  webcontentdir="project/web"
-                 weboutputdir="project/build/webapp"
+                 classoutputdir="project/build/webapp/WEB-INF/classes"
                  classpathref="<em>webapp.build.classpath</em>"/&gt;</source>
             </section>
         </section>

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/config/beehive-netui-config.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/config/beehive-netui-config.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/config/beehive-netui-config.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/config/beehive-netui-config.xml Fri Sep  9 14:11:01 2005
@@ -690,7 +690,7 @@
         <section id="module-config-locators"><title>&lt;module-config-locators&gt;</title>
 			<p>Names a class or group of classes that know the location of the web application's 
 				Struts module configuration files.  By default these configuation files are saved to 
-				<code>WEB-INF/.pageflow-struts-generated/</code>.  In cases where this default location
+				<code>WEB-INF/classes/_pageflow/</code>.  In cases where this default location
 				has been overridden or augmented by a custom compilation process, use
                 <code>&lt;module-config-locators></code> to point to a Java class that knows the
 				new location.  </p>

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/projects.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/projects.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/projects.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/netui/projects.xml Fri Sep  9 14:11:01 2005
@@ -62,7 +62,7 @@
 
     <build-pageflows srcdir="src/"
                      webcontentdir="web/"
-                     weboutputdir="build/"
+                     classoutputdir="build/WEB-INF/classes/"
                      tempdir="build/WEB-INF/.tmpbeansrc"
                      classpathref="webapp.classpath"/>
             ]]></source>
@@ -80,7 +80,7 @@
 
     <build-pageflows srcdir="web/"
                      webcontentdir="web/"
-                     weboutputdir="build/"
+                     classoutputdir="build/WEB-INF/classes/"
                      tempdir="build/WEB-INF/.tmpbeansrc"
                      classpathref="webapp.classpath"/>
             ]]></source>
@@ -131,7 +131,7 @@
             ]]></source>
             <p>
             The difference between this <code>&lt;build-pageflows></code> call and the previous examples is that the <code>webcontentdir</code> and 
-            <code>weboutputdir</code> directories are implicitly set by only using the <code>srcdir</code> attribute.  This causes the web projec
+            <code>classoutputdir</code> directories are implicitly set by only using the <code>srcdir</code> attribute.  This causes the web project
             to build directly into the <code>fooWebProject/</code> directory and to generate classes into <code>fooWebProject/WEB-INF/classes</code>.
             </p>
         </section>
@@ -343,8 +343,8 @@
 WEB-INF/classes/
              foo/
                  Controller.class
-       /.pageflow-struts-generated
-           jpf-struts-config-foo.xml
+             _pageflow/
+                 struts-config-foo.xml
         </source>
         <p>
         By default, the Struts module config file is placed in the <code>WEB-INF/.pageflow-struts-generated</code> directory and the 

Modified: beehive/trunk/netui/ant/webappTemplate.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/ant/webappTemplate.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/ant/webappTemplate.xml (original)
+++ beehive/trunk/netui/ant/webappTemplate.xml Fri Sep  9 14:11:01 2005
@@ -122,8 +122,6 @@
         <delete quiet="true">
             <fileset dir="${webapp.dir}">
                 <include name="${resource.dir.name}/javascript/netui-*.js"/>
-                <include name="WEB-INF/**/jpf-struts-config-*.xml"/>
-                <include name="WEB-INF/**/jpf-validation-*.xml"/>
                 <include name="WEB-INF/classes/**/*.class"/>
                 <include name="WEB-INF/classes/**/*.java"/>
                 <include name="WEB-INF/classes/**/*.properties"/>

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/AnnotationToXML.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/AnnotationToXML.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/AnnotationToXML.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/AnnotationToXML.java Fri Sep  9 14:11:01 2005
@@ -23,6 +23,7 @@
 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration;
 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue;
 import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance;
+import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment;
 import org.apache.beehive.netui.compiler.schema.annotations.ProcessedAnnotationsDocument;
 import org.apache.beehive.netui.compiler.schema.annotations.AnnotatedElement;
 import org.apache.beehive.netui.compiler.schema.annotations.ProcessedAnnotation;
@@ -35,14 +36,15 @@
 import java.util.List;
 import java.io.File;
 import java.io.IOException;
+import java.io.PrintWriter;
 
 public class AnnotationToXML
 {
     private static final String ANNOTATIONS_FILE_PREFIX = "jpf-annotations";
-    
+
     private ProcessedAnnotationsDocument _doc;
     private TypeDeclaration _typeDecl;
-    
+
     public AnnotationToXML( TypeDeclaration typeDecl )
     {
         _doc = ProcessedAnnotationsDocument.Factory.newInstance();
@@ -50,7 +52,7 @@
         ProcessedAnnotationsDocument.ProcessedAnnotations pa = _doc.addNewProcessedAnnotations();
         pa.setTypeName( typeDecl.getQualifiedName() );
     }
-    
+
     public void include( MemberDeclaration memberDecl, AnnotationInstance annotation )
     {
         AnnotatedElement element = _doc.getProcessedAnnotations().addNewAnnotatedElement();
@@ -61,24 +63,24 @@
         ProcessedAnnotation xmlAnnotation = element.addNewAnnotation();
         include( xmlAnnotation, annotation );
     }
-    
+
     private void include( ProcessedAnnotation xmlAnnotation, AnnotationInstance annotation )
     {
         xmlAnnotation.setAnnotationName( annotation.getAnnotationType().getAnnotationTypeDeclaration().getQualifiedName() );
-        
+
         Map elementValues = annotation.getElementValues();
-        
+
         for ( Iterator i = elementValues.entrySet().iterator(); i.hasNext(); )
         {
             Map.Entry entry = ( Map.Entry ) i.next();
             AnnotationTypeElementDeclaration elementDecl = ( AnnotationTypeElementDeclaration ) entry.getKey();
             AnnotationValue annotationValue = ( AnnotationValue ) entry.getValue();
-            
+
             String name = elementDecl.getSimpleName();
             Object value = annotationValue.getValue();
             AnnotationAttribute xmlAttr = xmlAnnotation.addNewAnnotationAttribute();
             xmlAttr.setAttributeName( name );
-            
+
             if ( value instanceof List )
             {
                 for ( Iterator j = ( ( List ) value ).iterator(); j.hasNext(); )
@@ -86,7 +88,7 @@
                     Object o = j.next();
                     assert o instanceof AnnotationValue : o.getClass().getName();
                     Object listVal = ( ( AnnotationValue ) o ).getValue();
-                    
+
                     // we only handle lists of annotations at the moment
                     assert listVal instanceof AnnotationInstance : listVal.getClass().getName();
                     include( xmlAttr.addNewAnnotationValue(), ( AnnotationInstance ) listVal );
@@ -100,21 +102,28 @@
             }
         }
     }
-    
-    public void writeXml( String webappBuildRoot, Diagnostics diagnostics )
+
+    public void writeXml( Diagnostics diagnostics, AnnotationProcessorEnvironment env )
     {
         String typeName = _typeDecl.getQualifiedName();
-        String outputFilePath = webappBuildRoot + StrutsApp.getOutputFileURI( ANNOTATIONS_FILE_PREFIX, typeName, false );
-        
+        String outputFilePath = StrutsApp.getOutputFileURI( ANNOTATIONS_FILE_PREFIX, typeName, false );
+        PrintWriter writer = null;
+
         try
         {
             XmlOptions options = new XmlOptions();
             options.setSavePrettyPrint();
-            _doc.save( new File( outputFilePath ), options );
+            File outputFile = new File( outputFilePath );
+            writer = env.getFiler().createTextFile( outputFile );
+            _doc.save( writer, options );
         }
         catch ( IOException e )
         {
             diagnostics.addError( _typeDecl, "error.could-not-generate", outputFilePath, e.getMessage() );
+        }
+        finally
+        {
+            if ( writer != null ) writer.close();
         }
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java Fri Sep  9 14:11:01 2005
@@ -181,7 +181,10 @@
     public static TypeInstance getTypeInstance( AnnotationInstance annotation, String memberName, boolean defaultIsNull )
     {
         AnnotationValue value = getAnnotationValue( annotation, memberName, defaultIsNull );
-        return value != null ? ( TypeInstance ) value.getValue() : null;
+        if ( value == null ) return null;
+        Object typeInstance = value.getValue();
+        if ( isErrorString( typeInstance ) ) return new ErrorTypeInstance();
+        return ( TypeInstance ) typeInstance;
     }
     
     public static String getEnumFieldName( AnnotationInstance annotation, String memberName, boolean defaultIsNull )
@@ -1013,6 +1016,15 @@
         return type != null ? type.getDeclaration() : ERROR_TYPE_DECLARATION;
     }
     
+    private static class ErrorTypeInstance
+        implements TypeInstance
+    {
+        public String toString()
+        {
+            return ERROR_STRING;
+        }
+    }
+    
     private static class ErrorTypeDeclaration
         implements TypeDeclaration
     {
@@ -1262,38 +1274,32 @@
     public static String[] getWebSourceRoots( AnnotationProcessorEnvironment env )
         throws FatalCompileTimeException
     {
-        return ( String[] ) getOption( "web.source.roots", true, env );
+        return ( String[] ) getOption( "-sourcepath", true, env );
     }
     
     public static String[] getWebContentRoots( AnnotationProcessorEnvironment env )
             throws FatalCompileTimeException
     {
-        return ( String[] ) getOption( "web.content.root", true, env );
+        return ( String[] ) getOption( "-Aweb.content.root", true, env );
     }
-    
-    public static String getWebBuildRoot( AnnotationProcessorEnvironment env )
-            throws FatalCompileTimeException
-    {
-        return ( String ) getOption( "web.output.root", false, env );
-    }
-    
+
     private static Object getOption( String optionName, boolean isList, AnnotationProcessorEnvironment env )
         throws MissingOptionException
     {
         Object cached = env.getAttribute( optionName );
         if ( cached != null ) return cached;
-        
+
         Map options = env.getOptions();
         String value = ( String ) options.get( optionName );
-        
+
         if ( value == null )
         {
             // TODO: there appears to be a bug in APT where both the key/value are contained in the key
-            String aptOption = "-A" + optionName + '=';
-            for ( Iterator i = options.keySet().iterator(); i.hasNext(); )  
+            String aptOption = optionName + '=';
+            for ( Iterator i = options.keySet().iterator(); i.hasNext(); )
             {
                 String key = ( String ) i.next();
-                
+
                 if ( key.startsWith( aptOption ) )
                 {
                     value = key.substring( aptOption.length() );
@@ -1301,11 +1307,11 @@
                 }
             }
         }
-        
+
         if ( value == null ) throw new MissingOptionException( optionName );
-        
+
         Object retVal = value;
-        
+
         if ( isList )
         {
             String[] values = ( ( String ) retVal ).trim().split( File.pathSeparator );
@@ -1315,7 +1321,7 @@
             }
             retVal = values;
         }
-        
+
         env.setAttribute( optionName, retVal );
         return retVal;
     }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FacesBackingGenerator.java Fri Sep  9 14:11:01 2005
@@ -36,7 +36,6 @@
     public void generate( ClassDeclaration publicClass )
         throws FatalCompileTimeException
     {
-        File sourceFile = CompilerUtils.getSourceFile( publicClass, true );
         AnnotationInstance facesBackingAnnotation = CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME );
         assert facesBackingAnnotation != null;  // checker should enforce this
         AnnotationToXML atx = new AnnotationToXML( publicClass );
@@ -57,6 +56,6 @@
         FlowControllerGenerator.includeFieldAnnotations( atx, publicClass, PAGE_FLOW_FIELD_TAG_NAME );
         
         // Write the file.
-        atx.writeXml( CompilerUtils.getWebBuildRoot( getEnv() ), getDiagnostics() );
+        atx.writeXml( getDiagnostics(), getEnv() );
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerChecker.java Fri Sep  9 14:11:01 2005
@@ -306,19 +306,6 @@
     
             getFCSourceFileInfo().addReferencedFile( strutsConfigFile );
             
-            if ( ! parentDir.isDirectory() )
-            {
-                //
-                // The second call to isDirectory below accounts for the possibility that another thread has created
-                // the directory.  Filesystem-based double-checked-locking... works.  We don't need to have
-                // compiler-wide contention around this check.
-                //
-                if ( ! parentDir.mkdirs() && ! parentDir.isDirectory() )
-                {
-                    getDiagnostics().addError( jclass, "error.invalid-parent-directory", parentDir );
-                }
-            }
-    
             if ( strutsConfigFile.exists() && strutsApp != null && ! strutsApp.canWrite() )
             {
                 getDiagnostics().addError( jclass, "error.struts-config-not-writable", strutsConfigFile );

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java Fri Sep  9 14:11:01 2005
@@ -96,7 +96,7 @@
         
         if ( includeFieldAnnotations( atx, classDecl, null ) )
         {
-            atx.writeXml( CompilerUtils.getWebBuildRoot( getEnv() ), getDiagnostics() );
+            atx.writeXml( getDiagnostics(), getEnv() );
         }
     }
     

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/JpfLanguageConstants.java Fri Sep  9 14:11:01 2005
@@ -91,7 +91,6 @@
     public static final String GLOBALAPP_FULL_CLASSNAME = GLOBALAPP_PACKAGE + '.' + GLOBALAPP_CLASSNAME;
     public static final String WEBINF_DIR_NAME = "WEB-INF";
     public static final String WEBINF_SRC_PATH = '/' + WEBINF_DIR_NAME + "/src";
-    public static final String WEBINF_SRC_DIR = WEBINF_DIR_NAME + File.separatorChar + "src";
     public static final String GLOBALAPP_PARENT_PATH = WEBINF_SRC_PATH + '/' + GLOBALAPP_PACKAGE;
     public static final String GLOBALAPP_SOURCE_NAME = GLOBALAPP_CLASSNAME + GLOBALAPP_FILE_EXTENSION_DOT;
     public static final String GLOBALAPP_URI = GLOBALAPP_PARENT_PATH + '/' + GLOBALAPP_SOURCE_NAME;
@@ -169,6 +168,7 @@
     public static final String SHARED_FLOW_REFS_ATTR = "sharedFlowRefs";
     public static final String PREVENT_DOUBLE_SUBMIT_ATTR = "preventDoubleSubmit";
     public static final String FORWARD_REF_ATTR = "forwardRef";
+    public static final String TYPE_HINT_ATTR = "typeHint";
     
     public static final String MIN_INT_ATTR = "minInt";
     public static final String MAX_INT_ATTR = "maxInt";
@@ -248,9 +248,4 @@
             return _val;
         }
     }
-
-    /**
-     * When this APT option is set, the logic that warns about missing files looks here for web files, like .jsps.
-     */
-    public static final String ALTERNATE_WEB_ROOT_DIR_OPTION = "-AalternateWebRootDir";
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MissingOptionException.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MissingOptionException.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MissingOptionException.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/MissingOptionException.java Fri Sep  9 14:11:01 2005
@@ -30,6 +30,7 @@
     
     public void printDiagnostic( Diagnostics diagnostics )
     {
-        diagnostics.addErrorNoPosition( "error.missing-option", new Object[]{ _optionName } );
+        String separator = _optionName.startsWith( "-A" ) ? "=" : " ";
+        diagnostics.addErrorNoPosition( "error.missing-option", new Object[]{ _optionName, separator } );
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/diagnostics.properties Fri Sep  9 14:11:01 2005
@@ -212,7 +212,7 @@
 warning.shared-flow-field-no-annotation = \
 Field {0} is of a type that extends {1}, but it has no @{2} annotation.  It will not be initialized automatically.
 
-error.missing-option = The "{0}" option is required.  It is specified by passing "-A{0}=<value>" as an option to apt.
+error.missing-option = The "{0}" option is required.  It is specified by passing "{0}{1}<value>" as an option to apt.
 warning.could-not-read-web-xml = Could not find/read web.xml.
 
 error.only-valid-on-pageflow = The "{0}" attribute may only be used on a class that extends {1}.

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenSharedFlowStrutsApp.java Fri Sep  9 14:11:01 2005
@@ -33,27 +33,22 @@
         extends GenStrutsApp
         implements JpfLanguageConstants
 {
-    private boolean _isGlobalApp;
-    
-    
     public GenSharedFlowStrutsApp( File sourceFile, ClassDeclaration jclass, AnnotationProcessorEnvironment env,
                                    FlowControllerInfo fcInfo, boolean checkOnly, Diagnostics diagnostics )
             throws XmlException, IOException, FatalCompileTimeException
     {
         super( sourceFile, jclass, env, fcInfo, checkOnly, diagnostics );
-        _isGlobalApp = GLOBALAPP_PACKAGE.equals( jclass.getPackage().getQualifiedName() ) 
-                       && sourceFile.getName().startsWith( GLOBALAPP_CLASSNAME );
         recalculateStrutsConfigFile();  // it changes based on _isGlobalApp
         setSharedFlow( true );
     }
-    
-    protected boolean isModuleDeclaredInWebXml()
+
+    String getStrutsConfigURI()
     {
-        return _isGlobalApp;
+        return getStrutsConfigURI( getContainingPackage(), true );
     }
     
-    String getStrutsConfigURI()
+    protected String getValidationFilePrefix()
     {
-        return getStrutsConfigURI( getContainingPackage(), true );
+        return "sharedflow-validation";
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java Fri Sep  9 14:11:01 2005
@@ -48,6 +48,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -65,7 +66,6 @@
     private File _sourceFile;
     private AnnotationProcessorEnvironment _env;
     private FlowControllerInfo _fcInfo;
-    private Diagnostics _diagnostics;
     
     protected void recalculateStrutsConfigFile()
         throws XmlException, IOException, FatalCompileTimeException
@@ -90,7 +90,6 @@
         _env = env;
         assert fcInfo != null;
         _fcInfo = fcInfo;
-        _diagnostics = diagnostics;
         
         recalculateStrutsConfigFile();
         
@@ -339,14 +338,7 @@
     {
         return isStale( getMergeFile( getMergeFileName() ) );
     }
-    
-    protected boolean isModuleDeclaredInWebXml()
-    {
-        // Only the root page flow (which generates a module for path "/") is declared in web.xml
-        PackageDeclaration pkg = _jclass.getPackage();
-        return ! isSharedFlow() && pkg == null || pkg.getQualifiedName().length() == 0;
-    }
-    
+
     String getOutputFileURI( String filePrefix )
     {
         return getOutputFileURI( filePrefix, _containingPackage, false );
@@ -363,41 +355,17 @@
     }
     
     private File calculateStrutsConfigFile()
-        throws XmlException, IOException, FatalCompileTimeException
     {
-        String webappBuildRoot = CompilerUtils.getWebBuildRoot( getEnv() );
-        File strutsConfigFile = new File( webappBuildRoot + getStrutsConfigURI() );
-        
-        //
-        // For the root Controller.jpf and for Global.app, we have to look in web.xml to get the output location.
-        // See the comment on getAlternateLocation for a rationale...
-        //
-        if ( isModuleDeclaredInWebXml() )
-        {
-            String alternateLocation = getAlternateLocation( strutsConfigFile );
-            if ( alternateLocation != null ) return new File( webappBuildRoot + alternateLocation );
-        }
-        
-        return strutsConfigFile;
+        return new File( getStrutsConfigURI() );
     }
     
     /**
-     * Tell whether the struts output file (jpf-struts-config-*.xml) is out of date, based on the
+     * Tell whether the struts output file (struts-config-*.xml) is out of date, based on the
      * file times of the source file and the (optional) struts-merge file.
      */ 
     public boolean isStale( File mergeFile )
     {
         //
-        // We always write the root-level JPF and Global.app, because the struts XML
-        // config files for these modules are provided by default, and may be out of
-        // date, even if the file modification times don't indicate that this is true.
-        //
-        if ( isModuleDeclaredInWebXml() )
-        {
-            return true;
-        }
-        
-        //
         // We can write to the file if it doesn't exist yet.
         //
         if ( ! _strutsConfigFile.exists() )
@@ -456,161 +424,23 @@
     public void writeToFile( File strutsMergeFile )
         throws FileNotFoundException, IOException, XmlException, FatalCompileTimeException
     {
-        _strutsConfigFile.getParentFile().mkdirs();
-        PrintStream out = new PrintStream( new FileOutputStream( _strutsConfigFile ) );
-        writeXml( out, strutsMergeFile, CompilerUtils.getWebBuildRoot( getEnv() ) );
-        out.close();
-    }    
-    
-    public File getStrutsConfigFile()
-    {
-        return _strutsConfigFile;
-    }
-    
-    private static boolean isAtElement( XmlCursor curs, String localName )
-    {
-        return curs.getName().getLocalPart().equals( localName );
-    }
-    
-    /**
-     * Two special files, the module configs for the root module and "-global", are registered in
-     * web.xml explicitly.  If the user is pointing to an alternate (e.g., old) location for these
-     * files, we need to compile to that location.
-     */ 
-    private String getAlternateLocation( File strutsConfigFile )
-        throws XmlException, IOException, FatalCompileTimeException
-    {
-        boolean canRead = false;
-        File webXmlFile = null;
-        
-        String[] webContentRoots = CompilerUtils.getWebContentRoots( getEnv() );
-        for ( int i = 0; i < webContentRoots.length; i++ )
-        {
-            String webContentRoot = webContentRoots[i];
-            webXmlFile = new File( webContentRoot + '/' + StrutsApp.WEBINF_DIR_NAME + "/web.xml" );
-            
-            if ( webXmlFile.canRead() )
-            {
-                canRead = true;
-                break;
-            }
-        }
-        
+        PrintWriter writer = getEnv().getFiler().createTextFile( _strutsConfigFile );
         
-        if ( ! canRead )
+        try
         {
-            _diagnostics.addWarning( _jclass, "warning.could-not-read-web-xml" );
-            return null;
+            writeXml( writer, strutsMergeFile );
         }
-        
-        String strutsConfigFileName = strutsConfigFile.getName();
-        
-        //
-        // We're going to parse web.xml in a "loose" way, so we can accept both the Servlet 2.3 and Servlet 2.4 versions
-        // (and beyond) of the schema.  We're looking for this fragment:
-        //    
-        //        <servlet-name>action</servlet-name>
-        //            <init-param>
-        //                <param-name>config</param-name>
-        //                <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        //            </init-param>
-        //            ...
-        //
-        // If this refers to the basename of our generated struts-config file, we'll use it to determine (override) the
-        // location of the output file.
-        //
-        XmlObject webXmlDoc = XmlObject.Factory.parse( webXmlFile );
-        XmlCursor curs = webXmlDoc.newCursor();
-        if ( curs.toFirstChild() && curs.toFirstChild() )
+        finally
         {
-            do
-            {
-                if ( isAtElement( curs, "servlet" ) )
-                {
-                    XmlCursor i = curs.newCursor();
-                    i.toFirstChild();
-                    do
-                    {
-                        if ( isAtElement( i, "servlet-name" ) && i.getTextValue().equals( "action" ) )
-                        {
-                            XmlCursor j = curs.newCursor();
-                            j.toFirstChild();
-                            
-                            do
-                            {
-                                if ( isAtElement( j, "init-param" ) )
-                                {
-                                    XmlCursor k = j.newCursor();
-                                    k.toFirstChild();
-                                    boolean isConfig = false;
-                                    String alternateLocation = null;
-                                    
-                                    do
-                                    {
-                                        if ( isAtElement( k, "param-name" ) && k.getTextValue().startsWith( "config" ) )
-                                        {
-                                            isConfig = true;
-                                        }
-                                        else if ( isAtElement( k, "param-value" ) )
-                                        {
-                                            alternateLocation =
-                                                parseAlternateLocation( k.getTextValue(), strutsConfigFileName );
-                                        }
-                                    } while ( k.toNextSibling() );
-                                    
-                                    if ( isConfig && alternateLocation != null )
-                                    {
-                                        return alternateLocation;
-                                    }
-                                }
-                            } while ( j.toNextSibling() );
-                            
-                            //
-                            // We found the action servlet, but no init-param gave an alternate location for our
-                            // struts-config output file.
-                            //
-                            return null;
-                        }
-                    } while ( i.toNextSibling() );
-                }
-            } while ( curs.toNextSibling() );
+            writer.close();
         }
-        
-        return null;
-    }
+    }    
     
-    private static String parseAlternateLocation( String paramValue, String strutsConfigFileName )
+    public File getStrutsConfigFile()
     {
-        //
-        // If the referenced struts-config file has the same name as the file
-        // we're going to generate, use the referenced file (its location may be
-        // different than our default location).
-        //
-        if ( paramValue.indexOf( strutsConfigFileName ) != -1 )
-        {
-            //
-            // This may be a comma-separated list of files.  Find the right one.
-            //
-            if ( paramValue.indexOf( "," ) != -1 )
-            {
-                String[] files = paramValue.split( "," );
-                for ( int k = 0; k < files.length; ++k )
-                {
-                    if ( files[k].indexOf( strutsConfigFileName ) != -1 )
-                    {
-                        return files[k].trim();
-                    }
-                }
-            }
-            else
-            {
-                return paramValue;
-            }
-        }
-        
-        return null;
+        return _strutsConfigFile;
     }
-    
+
     public File getMergeFile( String mergeFileName )
         throws FatalCompileTimeException
     {
@@ -618,7 +448,7 @@
         {
             return CompilerUtils.getFileRelativeToSourceFile( _jclass, mergeFileName, getEnv() );
         }
-        
+
         return null;
     }
 
@@ -646,11 +476,11 @@
         //
         for ( int i = 0; i < sourceRoots.length; i++ )
         {
-            String sourceRoot = sourceRoots[i];
+            String sourceRoot = sourceRoots[i].replace( '/', File.separatorChar );
             
             if ( filePath.startsWith( sourceRoot ) )
             {
-                return file.toString().substring( sourceRoot.length() ).replace( '\\', '/' );
+                return filePath.substring( sourceRoot.length() ).replace( '\\', '/' );
             }
         }
         
@@ -660,11 +490,11 @@
         String[] webContentRoots = CompilerUtils.getWebContentRoots( getEnv() );
         for ( int i = 0; i < webContentRoots.length; i++ )
         {
-            String webContentRoot = webContentRoots[i];
+            String webContentRoot = webContentRoots[i].replace( '/', File.separatorChar );
             
             if ( filePath.startsWith( webContentRoot ) )
             {
-                return file.toString().substring( webContentRoot.length() ).replace( '\\', '/' );
+                return filePath.substring( webContentRoot.length() ).replace( '\\', '/' );
             }
         }
         
@@ -675,5 +505,10 @@
     AnnotationProcessorEnvironment getEnv()
     {
         return _env;
+    }
+    
+    protected String getValidationFilePrefix()
+    {
+        return "pageflow-validation";
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java Fri Sep  9 14:11:01 2005
@@ -44,6 +44,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
@@ -55,7 +56,7 @@
         extends ValidationModel
         implements JpfLanguageConstants, ValidatorConstants
 {
-    private static final String STRUTS_VALIDATION_PREFIX = "jpf-validation";
+    private static final String STRUTS_VALIDATION_PREFIX = "validation";
     private static final ValidatorRuleFactory VALIDATOR_RULE_FACTORY = new DefaultValidatorRuleFactory();
     
     private GenStrutsApp _strutsApp;
@@ -431,15 +432,21 @@
     public void writeToFile()
         throws FileNotFoundException, XmlException, IOException, FatalCompileTimeException
     {
-        String outputFile =
-                CompilerUtils.getWebBuildRoot( _env ) + _strutsApp.getOutputFileURI( STRUTS_VALIDATION_PREFIX );
-        PrintStream printStream = new PrintStream( new FileOutputStream( outputFile ) );
-        writeXml( printStream, _mergeFile );
-        printStream.close();
+        String outputFilePath = getOutputFileURI();
+        File outputFile = new File( outputFilePath );
+        PrintWriter writer = _env.getFiler().createTextFile( outputFile );
+        try
+        {
+            writeXml( writer, _mergeFile );
+        }
+        finally
+        {
+            writer.close();
+        }
     }
 
     public String getOutputFileURI()
     {
-        return _strutsApp.getOutputFileURI( STRUTS_VALIDATION_PREFIX );
+        return _strutsApp.getOutputFileURI( _strutsApp.getValidationFilePrefix() );
     }
 }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java Fri Sep  9 14:11:01 2005
@@ -30,6 +30,7 @@
 import java.io.File;
 import java.io.PrintStream;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Map;
 import java.util.HashMap;
@@ -74,11 +75,11 @@
     protected static final String PAGEFLOW_CONTROLLER_CONFIG_CLASSNAME
                                    = PAGEFLOW_PACKAGE + ".config.PageFlowControllerConfig";
 
-    protected static final String STRUTS_CONFIG_PREFIX = "jpf-struts-config";
+    protected static final String STRUTS_CONFIG_PREFIX = "struts-config";
     protected static final String STRUTS_CONFIG_EXTENSION = ".xml";
     protected static final char STRUTS_CONFIG_SEPARATOR = '-';
     protected static final String WEBINF_DIR_NAME = "WEB-INF";
-    protected static final String STRUTSCONFIG_OUTPUT_DIR = '/' + WEBINF_DIR_NAME + "/.pageflow-struts-generated";
+    protected static final String STRUTSCONFIG_OUTPUT_DIR = "_pageflow";
     protected static final String VALIDATOR_PLUG_IN_CLASSNAME = STRUTS_PACKAGE + ".validator.ValidatorPlugIn";
     protected static final String VALIDATOR_PATHNAMES_PROPERTY = "pathnames";
     protected static final String TILES_PLUG_IN_CLASSNAME = STRUTS_PACKAGE + ".tiles.TilesPlugin";
@@ -418,7 +419,7 @@
         }
     }
     
-    public void writeXml( PrintStream outputStream, File mergeFile, String webappBuildRoot )
+    public void writeXml( PrintWriter writer, File mergeFile )
         throws IOException, XmlException, FatalCompileTimeException
     {
         StrutsConfigDocument doc;
@@ -530,7 +531,7 @@
         //
         XmlOptions options = new XmlOptions();
         options.setSavePrettyPrint();
-        doc.save( outputStream, options );
+        doc.save( writer, options );
     }
 
     private void writeMessageResources( StrutsConfigDocument.StrutsConfig scElement )
@@ -798,7 +799,7 @@
             
             if ( _validationModel != null && ! _validationModel.isEmpty() )
             {
-                pathNames.append( ',' ).append( _validationModel.getOutputFileURI() );
+                pathNames.append( ",/WEB-INF/classes/" ).append( _validationModel.getOutputFileURI() );
             }
             
             if ( _additionalValidatorConfigs != null )

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidationModel.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidationModel.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidationModel.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidationModel.java Fri Sep  9 14:11:01 2005
@@ -29,6 +29,7 @@
 import java.io.PrintStream;
 import java.io.File;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.List;
 import java.util.Map;
 import java.util.Locale;
@@ -216,7 +217,7 @@
         if ( rule != null ) { field.addRule( rule ); }
     }
     
-    public void writeXml( PrintStream outputStream, File mergeFile )
+    public void writeXml( PrintWriter writer, File mergeFile )
         throws XmlException, IOException, FatalCompileTimeException
     {
         //
@@ -321,7 +322,7 @@
         //
         XmlOptions options = new XmlOptions();
         options.setSavePrettyPrint();
-        doc.save( outputStream, options );
+        doc.save( writer, options );
     }
     
     protected String getHeaderComment( File mergeFile )

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/TwoPhaseAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/TwoPhaseAnnotationProcessor.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/TwoPhaseAnnotationProcessor.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/processor/TwoPhaseAnnotationProcessor.java Fri Sep  9 14:11:01 2005
@@ -134,6 +134,8 @@
     {
         try
         {
+            HashSet alreadyProcessed = new HashSet();
+            
             for ( int i = 0; i < _atds.length; i++ )
             {
                 AnnotationTypeDeclaration atd = _atds[i];
@@ -141,7 +143,9 @@
                 
                 for ( int j = 0; j < decls.length; j++ )
                 {
-                    generate( decls[j] );
+                    Declaration decl = decls[j];
+                    if ( ! alreadyProcessed.contains( decl ) ) generate( decl );
+                    alreadyProcessed.add( decl );
                 }
             }
         }

Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/typesystem/env/Filer.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/typesystem/env/Filer.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/typesystem/env/Filer.java (original)
+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/typesystem/env/Filer.java Fri Sep  9 14:11:01 2005
@@ -17,6 +17,11 @@
  */
 package org.apache.beehive.netui.compiler.typesystem.env;
 
+import java.io.PrintWriter;
+import java.io.File;
+import java.io.IOException;
+
 public interface Filer
 {
+    PrintWriter createTextFile(File file) throws IOException;
 }

Modified: beehive/trunk/netui/src/compiler-xdoclet/pageflow-webapp-build-xdoclet.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-xdoclet/pageflow-webapp-build-xdoclet.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler-xdoclet/pageflow-webapp-build-xdoclet.xml (original)
+++ beehive/trunk/netui/src/compiler-xdoclet/pageflow-webapp-build-xdoclet.xml Fri Sep  9 14:11:01 2005
@@ -139,7 +139,6 @@
     <target name="clean" depends="init">
         <delete dir="${temp.build.dir}"/>
         <delete dir="${webapp.classes.dir}"/>
-        <delete dir="${webinf.dir}/.pageflow-struts-generated"/>
         <delete dir="${temp.build.dir}"/>
     </target>
 

Modified: beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/AnnotationProcessorEnvironmentImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/AnnotationProcessorEnvironmentImpl.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/AnnotationProcessorEnvironmentImpl.java (original)
+++ beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/AnnotationProcessorEnvironmentImpl.java Fri Sep  9 14:11:01 2005
@@ -38,7 +38,6 @@
 {
     private TypeDeclaration[] _specifiedTypeDeclarations;
     private Map _attributes;
-    private Diagnostics _diagnostics;
     
     protected AnnotationProcessorEnvironmentImpl( com.sun.mirror.apt.AnnotationProcessorEnvironment delegate )
     {
@@ -62,8 +61,7 @@
 
     public Filer getFiler()
     {
-        assert false : "NYI";
-        throw new UnsupportedOperationException( "not implemented" );
+        return FilerImpl.get( getDelegate().getFiler() );
     }
 
     public TypeDeclaration[] getSpecifiedTypeDeclarations()

Added: beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java?rev=279881&view=auto
==============================================================================
--- beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java (added)
+++ beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java Fri Sep  9 14:11:01 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.compiler.typesystem.impl.env;
+
+import org.apache.beehive.netui.compiler.typesystem.impl.DelegatingImpl;
+import org.apache.beehive.netui.compiler.typesystem.env.Filer;
+
+import java.io.PrintWriter;
+import java.io.File;
+import java.io.IOException;
+
+public class FilerImpl
+    extends DelegatingImpl
+    implements Filer
+{
+
+    protected FilerImpl( com.sun.mirror.apt.Filer delegate )
+    {
+        super( delegate );
+    }
+
+    public static Filer get( com.sun.mirror.apt.Filer delegate )
+    {
+        return new FilerImpl(delegate);
+    }
+
+    public PrintWriter createTextFile(File file)
+            throws IOException
+    {
+        return getDelegate().createTextFile(com.sun.mirror.apt.Filer.Location.CLASS_TREE, "", file, null);
+    }
+
+    protected com.sun.mirror.apt.Filer getDelegate()
+    {
+        return ( com.sun.mirror.apt.Filer ) super.getDelegate();
+    }
+}

Propchange: beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/typesystem/impl/env/FilerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DynamicSubappActionServlet.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DynamicSubappActionServlet.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DynamicSubappActionServlet.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DynamicSubappActionServlet.java Fri Sep  9 14:11:01 2005
@@ -26,7 +26,7 @@
 /**
  * ActionServlet that dynamically registers modules based on naming/location conventions for Struts
  * configuration files that are generated by the Page Flow compiler.  These files are located in
- * /WEB-INF/.pageflow-struts-generated, and are named jpf-struts-config-<i>module-name</i>.xml.
+ * /WEB-INF/classes/_pageflow, and are named struts-config-<i>module-name</i>.xml.
  * The user may specify additional ModuleConfigLocator classes in web.xml, using the
  * "moduleConfigLocators" init-parameter; this allows the user to define other patterns for
  * auto-registered Struts modules.

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java Fri Sep  9 14:11:01 2005
@@ -40,7 +40,7 @@
 /**
  * ActionServlet that dynamically registers modules based on naming/location conventions for Struts
  * configuration files that are generated by the Page Flow compiler.  These files are located in
- * /WEB-INF/.pageflow-struts-generated, and are named jpf-struts-config-<i>module-name</i>.xml.
+ * /WEB-INF/classes/_pageflow, and are named struts-config-<i>module-name</i>.xml.
  * For auto-registration of config files in other locations, the user may specify additional
  * {@link ModuleConfigLocator} classes in /WEB-INF/beehive-netui-config.xml using the
  * <code>&lt;module-config-locators&gt;</code> element. 
@@ -61,7 +61,7 @@
     /**
      * Get the base list of ModuleConfigLocators, to specify locations for auto-registered Struts modules.  By default,
      * this ActionServlet auto-registers Struts modules whose configuration files are located at
-     * "/WEB-INF/.pageflow-struts-generated/jpf-struts-config-<i>&lt;module&gt;</i>".  Overriding this method allows
+     * "/WEB-INF/classes/_pageflow/struts-config-<i>&lt;module&gt;</i>".  Overriding this method allows
      * alternate locations to be specified.  When an unrecognized Struts module is requested, each registered
      * ModuleConfigLocator is queried for a possible path to the configuration file for the module.  If the
      * configuration file is found, the module is auto-registered against the file.
@@ -73,7 +73,7 @@
     
     /**
      * Default ModuleConfigLocator that looks for Struts module configuration files according to the pattern
-     * "/WEB-INF/.pageflow-struts-generated/jpf-struts-config-<i>&lt;module&gt;</i>".  An instance of this class
+     * "/WEB-INF/classes/_pageflow/struts-config-<i>&lt;module&gt;</i>".  An instance of this class
      * is registered by default.
      * 
      * @see PageFlowActionServlet#getDefaultModuleConfigLocators
@@ -102,7 +102,7 @@
     
     /**
      * ModuleConfigLocator that looks for legacy Struts module configuration files according to the pattern
-     * "/WEB-INF/jpf-struts-config-<i>&lt;module&gt;</i>".  An instance of this class is registered by default.
+     * "/WEB-INF/struts-config-<i>&lt;module&gt;</i>".  An instance of this class is registered by default.
      * 
      * @see PageFlowActionServlet#getDefaultModuleConfigLocators
      */ 
@@ -159,7 +159,7 @@
 
     /**
      * Get the webapp-relative path to the Struts module configration file for a given module path.  By default,
-     * this is "/WEB-INF/.pageflow-struts-generated/jpf-struts-config-<i>&lt;module&gt;</i>", but alternate
+     * this is "/WEB-INF/classes/_pageflow/struts-config-<i>&lt;module&gt;</i>", but alternate
      * locations can be specified by adding {@link ModuleConfigLocator}s.  
      * 
      * @param modulePath the Struts module path.

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java Fri Sep  9 14:11:01 2005
@@ -64,7 +64,7 @@
     /**
      * The filename prefix for Struts module configuration files generated from page flow source files.
      */ 
-    public static final String PAGEFLOW_MODULE_CONFIG_PREFIX = "jpf-struts-config";
+    public static final String PAGEFLOW_MODULE_CONFIG_PREFIX = "struts-config";
     
     /**
      * The filename prefix for Struts module configuration files generated from page flow source files.
@@ -127,14 +127,14 @@
      * flow actions.  Normally, security constraints are not applied on server forwards.
      * 
      * @deprecated Instead of this context-param, use the <code>ensure-secure-forwards</code> element within
-     *             <code>pageflow-config</code> in /WEB-INF/netui-config.xml.
+     *             <code>pageflow-config</code> in /WEB-INF/beehive-netui-config.xml.
      */ 
     public static final String SECURE_FORWARDS_PARAM = "jpf-secure-forwards";
     
     /**
-     * The default webapp-relative directory for Struts module configuration files generated by the Page Flow compiler.
+     * The default classloader-relative directory for Struts module configuration files generated by the Page Flow compiler.
      */ 
-    public static final String PAGEFLOW_MODULE_CONFIG_GEN_DIR = InternalConstants.WEBINF_DIR + "/.pageflow-struts-generated";
+    public static final String PAGEFLOW_MODULE_CONFIG_GEN_DIR = "/_pageflow";
     
     /**
      * The default webapp-relative directory for Struts module configuration files generated by the Page Flow compiler.

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java Fri Sep  9 14:11:01 2005
@@ -722,7 +722,7 @@
         {
             //
             // Make sure the current module config matches the request URI.  If not, this could be an
-            // EAR where the jpf-struts-config.xml wasn't included because of a compilation error.
+            // EAR where the struts-config.xml wasn't included because of a compilation error.
             //
             String modulePath = PageFlowUtils.getModulePath( request );
             if ( ! moduleConfig.getPrefix().equals( modulePath ) )

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java Fri Sep  9 14:11:01 2005
@@ -817,7 +817,7 @@
      * @deprecated Use {@link PageFlowActionServlet#getModuleConfPath} instead.
      * 
      * Get the path to the Struts module configration file (e.g.,
-     * "/WEB-INF/.pageflow-struts-generated/jpf-struts-config-someModule") for a given module
+     * "/WEB-INF/classes/_pageflow/struts-config-someModule") for a given module
      * path (e.g., "someModule"), according to the PageFlow convention.
      * 
      * @param modulePath the Struts module path.

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/AnnotationReader.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/AnnotationReader.java?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/AnnotationReader.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/AnnotationReader.java Fri Sep  9 14:11:01 2005
@@ -70,6 +70,13 @@
                 PageFlowConstants.PAGEFLOW_MODULE_CONFIG_GEN_DIR + "/jpf-annotations-"
                 + type.getName().replace( '.', '-' ) + ".xml";
         InputStream in = servletContext.getResourceAsStream( annotationsXml );
+        if ( in == null )
+        {
+            assert annotationsXml.startsWith( "/" ) : annotationsXml;
+            annotationsXml = annotationsXml.substring( 1 );
+            in = Thread.currentThread().getContextClassLoader().getResourceAsStream( annotationsXml );
+        }
+        
         
         if ( in != null )
         {

Modified: beehive/trunk/netui/src/webapp-template/default/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/webapp-template/default/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/src/webapp-template/default/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/src/webapp-template/default/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -94,7 +94,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/netui/test/src/junitTests/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/src/junitTests/build.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/src/junitTests/build.xml (original)
+++ beehive/trunk/netui/test/src/junitTests/build.xml Fri Sep  9 14:11:01 2005
@@ -26,9 +26,9 @@
 
         <copy todir="${module.classes.dir}">
           <fileset dir="${module.dir}">
-                  <exclude name="./build.xml"/>
-                  <exclude name="**/*.java"/>
-              </fileset>
+              <exclude name="./build.xml"/>
+              <exclude name="**/*.java"/>
+          </fileset>
         </copy>
 
         <copy todir="${module.classes.dir}/WEB-INF/" file="${netuiconfig.xml}"/>
@@ -40,8 +40,19 @@
         <build-pageflows
                srcdir="${module.dir}"
                classoutputdir="${module.classes.dir}"
-               weboutputdir="${module.classes.dir}"
                classpathref="junit.classpath"/>
+
+        <!-- Generated struts-config and validator files are built into the classes dir.  In a
+             webapp, this is WEB-INF/classes (where the runtime expects the files to be), but here
+             it is simply the build dir.  We have to copy the files into the right place -
+             this is an artifact of using MockStrutsTestCase against a nonstandard webapp build
+             structure. -->
+        <mkdir dir="${module.classes.dir}/WEB-INF/classes"/>
+        <copy todir="${module.classes.dir}/WEB-INF/classes/_pageflow">
+            <fileset dir="${module.classes.dir}/_pageflow">
+                <include name="**"/>
+            </fileset>
+        </copy>
 
         <jar jarfile="${module.jar}" basedir="${module.classes.dir}">
             <manifest>

Modified: beehive/trunk/netui/test/webapps/drt/bvt-jdk14.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/bvt-jdk14.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/bvt-jdk14.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/bvt-jdk14.xml Fri Sep  9 14:11:01 2005
@@ -95,7 +95,6 @@
                 <include name="**/*.jpfs"/>
                 <include name="**/*.java"/>
                 <include name="**/Global.app"/>
-                <exclude name="WEB-INF/.pageflow-struts-generated/**"/>
                 <exclude name="WEB-INF/.tmpbeansrc/**"/>
                 <exclude name="WEB-INF/classes/**"/>
                 <exclude name="**/miniTests/generics/**"/>

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PageFlowUtils.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PageFlowUtils.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PageFlowUtils.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/PageFlowUtils.xml Fri Sep  9 14:11:01 2005
@@ -149,13 +149,13 @@
             /foo/bar/barController.jpf<br>
 
         <code>getModuleConfPath( "/foo/bar" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config-foo-bar.xml<br>
+            /_pageflow/struts-config-foo-bar.xml<br>
 
         <code>getModuleConfPath( "/" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml<br>
+            /_pageflow/struts-config.xml<br>
 
         <code>getModuleConfPath( "" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml<br>
+            /_pageflow/struts-config.xml<br>
 
         <code>getActionURI( request )</code>:
             /coreWeb/miniTests/pageFlowUtils/begin.do<br>
@@ -463,13 +463,13 @@
             /foo/bar/barController.jpf<br>
 
         <code>getModuleConfPath( "/foo/bar" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config-foo-bar.xml<br>
+            /_pageflow/struts-config-foo-bar.xml<br>
 
         <code>getModuleConfPath( "/" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml<br>
+            /_pageflow/struts-config.xml<br>
 
         <code>getModuleConfPath( "" )</code>:
-            /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml<br>
+            /_pageflow/struts-config.xml<br>
 
         <code>getActionURI( request )</code>:
             /coreWeb/miniTests/pageFlowUtils/nestedDone.do<br>

Modified: beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.jsf-ri
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.jsf-ri?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.jsf-ri (original)
+++ beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.jsf-ri Fri Sep  9 14:11:01 2005
@@ -109,7 +109,7 @@
 
     <init-param>
       <param-name>config</param-name>
-      <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+      <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
     </init-param>
 
     <init-param>

Modified: beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.myfaces
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.myfaces?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.myfaces (original)
+++ beehive/trunk/netui/test/webapps/jsf/jsfWeb/WEB-INF/web.xml.myfaces Fri Sep  9 14:11:01 2005
@@ -116,7 +116,7 @@
 
       <init-param>
         <param-name>config</param-name>
-        <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+        <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
       </init-param>
 
       <init-param>

Modified: beehive/trunk/netui/test/webapps/projectModel/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/projectModel/build.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/projectModel/build.xml (original)
+++ beehive/trunk/netui/test/webapps/projectModel/build.xml Fri Sep  9 14:11:01 2005
@@ -82,7 +82,7 @@
         <echo>Building Page Flows</echo>
         <build-pageflows srcdir="${web.source.dir}"
                          webcontentdir="${web.content.dir}"
-                         weboutputdir="${web.output.dir}"
+                         classoutputdir="${web.classes.dir}"
                          tempdir="${temp.gen.dir}"
                          classpathref="projectmodel.webapp.classpath"
                          sourcepathref="projectmodel.webapp.sourcepath" />

Modified: beehive/trunk/netui/test/webapps/projectModel/webContent/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/projectModel/webContent/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/projectModel/webContent/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/test/webapps/projectModel/webContent/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -54,7 +54,7 @@
 
     <init-param>
       <param-name>config</param-name>
-      <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+      <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
     </init-param>
 
     <init-param>

Modified: beehive/trunk/netui/test/webapps/testRecorder-test/testRecorder-test/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/testRecorder-test/testRecorder-test/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/testRecorder-test/testRecorder-test/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/test/webapps/testRecorder-test/testRecorder-test/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -86,11 +86,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        </init-param>
-        <init-param>
-            <param-name>config/-global</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/test/webapps/tomcat/tomcatWeb/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -54,7 +54,7 @@
 
     <init-param>
       <param-name>config</param-name>
-      <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+      <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
     </init-param>
 
     <init-param>

Modified: beehive/trunk/netui/test/webapps/urlTemplates/urlTemplates/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/urlTemplates/urlTemplates/WEB-INF/web.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/urlTemplates/urlTemplates/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/test/webapps/urlTemplates/urlTemplates/WEB-INF/web.xml Fri Sep  9 14:11:01 2005
@@ -85,11 +85,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
-        </init-param>
-        <init-param>
-            <param-name>config/-global</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config--global.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml (original)
+++ beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml Fri Sep  9 14:11:01 2005
@@ -31,7 +31,6 @@
     <property name="webapp.dir" location="${basedir}/../.."/>
 
     <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
-    <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
 
     <!-- Define the classpath used to build the webapp -->
     <path id="webapp.build.classpath">
@@ -94,7 +93,6 @@
 
         <!-- compile JPFs -->
         <build-pageflows srcdir="${webapp.dir}" 
-                         weboutputdir="${webapp.dir}" 
                          classoutputdir="${webapp.dir}/WEB-INF/classes" 
                          tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
                          classpathref="webapp.build.classpath"/>
@@ -117,7 +115,6 @@
         <delete dir="${webapp.dir}/WEB-INF/classes"/>
         <delete dir="${webapp.dir}/WEB-INF/lib"/>
         <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"/>
-        <delete dir="${webapp.dir}/WEB-INF/.pageflow-struts-generated"/>
 
         <!-- web.xml is copied, depending on whether MyFaces or the JSF Reference Implementation is used -->
         <delete file="${webapp.dir}/WEB-INF/web.xml"/>

Modified: beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.jsf-ri
URL: http://svn.apache.org/viewcvs/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.jsf-ri?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.jsf-ri (original)
+++ beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.jsf-ri Fri Sep  9 14:11:01 2005
@@ -122,7 +122,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>

Modified: beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces
URL: http://svn.apache.org/viewcvs/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces?rev=279881&r1=279880&r2=279881&view=diff
==============================================================================
--- beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces (original)
+++ beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces Fri Sep  9 14:11:01 2005
@@ -99,7 +99,7 @@
         <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
         <init-param>
             <param-name>config</param-name>
-            <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+            <param-value>/WEB-INF/classes/_pageflow/struts-config.xml</param-value>
         </init-param>
         <init-param>
             <param-name>debug</param-name>