Author: kentam
Date: Sun Oct 24 21:56:11 2004
New Revision: 55487
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/controls/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/controls/methodTest/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/controls/methodTest/MethodTest.java
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTest.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/controls/methodTest/MethodTestImpl.jcs
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/datagrid/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/datagrid/controls/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/datagrid/controls/PortfolioControl.java
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/controls/PortfolioControl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/datagrid/controls/PortfolioControlImpl.jcs
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/controls/PortfolioControlImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/miscJpf/bug21124/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/miscJpf/bug21124/Ctrl.java
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug21124/Ctrl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/miscJpf/bug21124/CtrlImpl.jcs
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug21124/CtrlImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/pageFlowCore/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/pageFlowCore/lifecycle/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/pageFlowCore/lifecycle/TestControl.java
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/pageFlowCore/lifecycle/TestControlImpl.jcs
- copied unchanged from rev 55465,
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControlImpl.jcs
incubator/beehive/trunk/samples/petstoreWeb/webappRoot/
incubator/beehive/trunk/samples/petstoreWeb/webappRoot/SharedFlow.jpfs
- copied unchanged from rev 55468,
incubator/beehive/trunk/samples/petstoreWeb/SharedFlow.jpfs
Removed:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTest.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/controls/PortfolioControl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/controls/PortfolioControlImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug21124/Ctrl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miscJpf/bug21124/CtrlImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControl.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/pageFlowCore/lifecycle/TestControlImpl.jcs
incubator/beehive/trunk/samples/petstoreWeb/SharedFlow.jpfs
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
incubator/beehive/trunk/netui/ant/webappTemplate.xml
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
incubator/beehive/trunk/test/ant/buildWebappCore.xml
Log:
Beehive webapp build process fixes and standardization, needed to make the
petstore clean/build cycle work.
1) the Beehive webapp build process now builds all Java code using apt, instead
of trying to figure out what
.java files use annotations and which ones don't.
2) All Java code (including controls -- *.jcx and *.jcs files) should be kept
under WEB-INF/src.
3) To work around apt issues, shared pageflows that would normally be in the
root of the webapp should instead
be in a directory under the webapp root called "webappRoot" (and should be
declared as being in the "webappRoot"
package).
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
==============================================================================
---
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
(original)
+++
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptTask.java
Sun Oct 24 21:56:11 2004
@@ -18,22 +18,19 @@
* $Header:$
*/
-import java.io.File;
-import java.io.IOException;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.GlobPatternMapper;
import org.apache.tools.ant.util.SourceFileScanner;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.StringTokenizer;
+import java.util.Vector;
/**
* The AptTask class defines a custom ANT task for invoking APT-based code
generation. It
Modified: incubator/beehive/trunk/netui/ant/webappTemplate.xml
==============================================================================
--- incubator/beehive/trunk/netui/ant/webappTemplate.xml (original)
+++ incubator/beehive/trunk/netui/ant/webappTemplate.xml Sun Oct 24
21:56:11 2004
@@ -129,7 +129,11 @@
<property name="webinf.dir" location="${webapp.dir}/WEB-INF"/>
<delete dir="${resource.dir.name}" quiet="true"/>
+
+ <!-- This seems wrong, we shouldn't delete files that aren't generated
-->
+ <!--
<delete file="${webinf.dir}/netui-config.xml" quiet="true"/>
+ -->
<delete quiet="true">
<fileset dir="${webapp.dir}">
Modified:
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/PageFlowChecker.java
Sun Oct 24 21:56:11 2004
@@ -90,7 +90,20 @@
{
File[] sharedFlowFiles = i.listFiles( SHARED_FLOW_FILE_FILTER );
boolean atWebappRoot = i.equals( getWebappRoot() );
-
+
+ // HACK: apt doesn't like files whose pkg decl is inconsistent
with its directory location,
+ // so when looking for a shared pageflow in the webapp root, we
additionally look in a special
+ // subdir named "webappRoot". This should all go away when shared
pageflow usage is declared with
+ // annotations.
+ if ( atWebappRoot )
+ {
+ if ( sharedFlowFiles == null || sharedFlowFiles.length == 0 )
+ {
+ File specialRootPkg = new File( i, "webappRoot" );
+ sharedFlowFiles = specialRootPkg.listFiles(
SHARED_FLOW_FILE_FILTER );
+ }
+ }
+
if ( sharedFlowFiles != null && sharedFlowFiles.length > 0 )
{
File sfFile = sharedFlowFiles[0];
@@ -99,14 +112,14 @@
getEnv().getTypeDeclaration( WEBAPP_ROOT_PACKAGE + '.'
+
CompilerUtils.removeFileExtension( sfFile.getName() ) ):
CompilerUtils.inferTypeFromFile( sfFile,
webappRootPath, getEnv() );
-
+
if ( sfType != null && CompilerUtils.isAssignableFrom(
SHARED_FLOW_BASE_CLASS, sfType, getEnv() ) )
{
sharedFlowFileHierarchy.add( sfFile );
sharedFlowTypeHierarchy.add( sfType );
}
}
-
+
if ( atWebappRoot ) break;
}
Modified: incubator/beehive/trunk/test/ant/buildWebappCore.xml
==============================================================================
--- incubator/beehive/trunk/test/ant/buildWebappCore.xml (original)
+++ incubator/beehive/trunk/test/ant/buildWebappCore.xml Sun Oct 24
21:56:11 2004
@@ -80,11 +80,10 @@
classgendir="${webapp.dir}/WEB-INF/classes"
failonerror="true"/>
- <!-- .java source build -->
- <echo>========== Complie Java source in WEB-INF/src ==========</echo>
- <javac srcdir="${webapp.dir}/WEB-INF/src"
destdir="${webapp.dir}/WEB-INF/classes"
- classpathref="webapp.build.classpath"/>
-
+ <!-- Java and Controls build -->
+ <!-- Since some .java files have annotations, we want to make sure we
compile them using apt. -->
+ <!-- apt generates intermediate files Java files into a tmp directory;
WEB-INF/${tmp.sourcegen.dir} here -->
+ <echo>========== Compile Java sources in WEB-INF/src, including
controls ==========</echo>
<echo>netui-compiler.jar: ${netui-compiler.jar}</echo>
<echo>controls.jar: ${controls.jar}</echo>
@@ -93,11 +92,8 @@
classpath="${controls.jar};${netui-compiler.jar}"
onerror="report"/>
- <!-- Controls build -->
- <!-- apt generates intermediate files Java files into a tmp directory;
WEB-INF/${tmp.sourcegen.dir} here -->
- <echo>========== Generate and compile controls ==========</echo>
<mkdir dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"/>
- <apt srcdir="${webapp.dir}"
+ <apt srcdir="${webapp.dir}/WEB-INF/src"
destdir="${webapp.dir}/WEB-INF/classes"
gendir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
classpathref="controls.build.classpath"