Return-Path: Delivered-To: apmail-beehive-dev-archive@www.apache.org Received: (qmail 6629 invoked from network); 16 Sep 2005 21:48:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Sep 2005 21:48:48 -0000 Received: (qmail 18467 invoked by uid 500); 16 Sep 2005 21:48:48 -0000 Delivered-To: apmail-beehive-dev-archive@beehive.apache.org Received: (qmail 18449 invoked by uid 500); 16 Sep 2005 21:48:47 -0000 Mailing-List: contact dev-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Developers" Delivered-To: mailing list dev@beehive.apache.org Received: (qmail 18438 invoked by uid 99); 16 Sep 2005 21:48:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2005 14:48:47 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DRUGS_PAIN,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ekoneil@gmail.com designates 66.249.82.193 as permitted sender) Received: from [66.249.82.193] (HELO xproxy.gmail.com) (66.249.82.193) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2005 14:48:55 -0700 Received: by xproxy.gmail.com with SMTP id h26so134946wxd for ; Fri, 16 Sep 2005 14:48:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fFecvR5k0KlxZgomhOrD0XJsLHNSdEd3+FX1AZmZl5qd4s3fYqCp+WbgFA22LiPzDA5AhblgCnmtCKeZGeg//wBwz+es9VzYM5K0hY+6K+bRAOHlREl6xeX3UHYXDvbRQHWmQuMzf8XFyctQ9rnK2c9E9IlpnlTph8S6AY7ezvk= Received: by 10.70.51.7 with SMTP id y7mr91154wxy; Fri, 16 Sep 2005 14:48:42 -0700 (PDT) Received: by 10.70.11.4 with HTTP; Fri, 16 Sep 2005 14:48:42 -0700 (PDT) Message-ID: Date: Fri, 16 Sep 2005 15:48:42 -0600 From: Eddie O'Neil Reply-To: ekoneil@gmail.com To: Beehive Developers Subject: Re: Fwd: svn commit: r289648 [1/6] - in /beehive/trunk/netui: src/compiler-core/ src/compiler-core/org/apache/beehive/netui/compiler/ src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ src/compiler-core/org/apache/beehive/netui/compiler/gr In-Reply-To: <432B3A1B.7010304@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050916203036.89937.qmail@minotaur.apache.org> <432B3A1B.7010304@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Rich-- One question -- there's still one XSD in: netui/src/compiler-core/schema/processed-annotations/... Is this still used? I just did a full BVT run and didn't encounter any build / test failures. Eddie On 9/16/05, Rich Feit wrote: > Great, thanks for verifying it. We're definitely on our way! > Rich >=20 > Eddie O'Neil wrote: >=20 > >Rich-- > > > > Excellent! Great to have the compiler moved over. > > > > I've just finished test runs on Linux (FC3) and on WinXP -- both > >passed at 100% for the JUnit, compiler, and test recorder tests. > > > > I'll be working on the distribution part of this next. > > > >Eddie > > > > > > > >---------- Forwarded message ---------- > >From: rich@apache.org > >Date: Sep 16, 2005 2:30 PM > >Subject: svn commit: r289648 [1/6] - in /beehive/trunk/netui: > >src/compiler-core/ > >src/compiler-core/org/apache/beehive/netui/compiler/ > >src/compiler-core/org/apache/beehive/netui/compiler/genmodel/ > >src/compiler-core/org/apache/beehive/netui/compiler/grammar/ src/... > >To: commits@beehive.apache.org > > > > > >Author: rich > >Date: Fri Sep 16 13:27:57 2005 > >New Revision: 289648 > > > >URL: http://svn.apache.org/viewcvs?rev=3D289648&view=3Drev > >Log: > >Moved the NetUI compiler layer off of XMLBeans. The generated files > >(struts-config-*.xml, pageflow-validation-*.xml, annotations-*.xml) > >are now created (and merged, if Struts Merge or Validator Merge is > >used) through APIs in the JDK. > > > >tests: bvt in netui (WinXP) > >BB: bvt, run.tests against a dist (linux) > > > > > >Added: > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/LocalFileEntityResolver.java > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/XmlElementSupport.java > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/XmlModelWriter.java > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/XmlModelWriterException.java > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/ > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/struts-config_1_1.dtd > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/struts-config_1_1.xsd > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/struts-validator_1_1.xsd > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/validator_1_0.dtd > > (with props) > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/resources/validator_1_1.dtd > > (with props) > > beehive/trunk/netui/src/compiler-xdoclet/org/apache/beehive/netui/co= mpiler/xdoclet/typesystem/impl/declaration/AnnotationInterfaceParser.java > > (with props) > > beehive/trunk/netui/src/compiler-xdoclet/org/apache/beehive/netui/co= mpiler/xdoclet/typesystem/impl/env/FilerImpl.java > > (with props) > >Removed: > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/ValidatableFieldFactory.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/ValidatableFieldOld.java > > beehive/trunk/netui/src/compiler-core/schema/struts-config/ > > beehive/trunk/netui/src/compiler-core/schema/struts-validator/ > >Modified: > > beehive/trunk/netui/src/compiler-core/build.xml > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/AnnotationToXML.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FacesBackingGenerator.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerChecker.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerGenerator.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowChecker.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowGenerator.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowChecker.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowGenerator.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/diagnostics.properties > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenSharedFlowStrutsApp.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenStrutsApp.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenValidationModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ControllerGrammar.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ValidXmlFileType.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/AbstractForwardContainer.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ActionModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ExceptionModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/FormBeanModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ForwardModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/MessageResourcesModel.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/StrutsApp.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/StrutsElementSupport.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/LocaleSet.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/ValidatableEntity.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/ValidatableField.java > > beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/validation/ValidationModel.java > > beehive/trunk/netui/src/compiler-xdoclet/org/apache/beehive/netui/co= mpiler/xdoclet/typesystem/impl/declaration/AnnotationInstanceImpl.java > > beehive/trunk/netui/src/compiler-xdoclet/org/apache/beehive/netui/co= mpiler/xdoclet/typesystem/impl/declaration/DeclarationImpl.java > > beehive/trunk/netui/src/compiler/build.xml > > beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/i= nternal/AnnotationReader.java > > beehive/trunk/netui/test/src/compilerTests/org/apache/beehive/netui/= test/compiler/OutputHandler.java > > beehive/trunk/netui/test/src/compilerTests/org/apache/beehive/netui/= test/compiler/PageFlowCompilerTest.java > > beehive/trunk/netui/test/src/compilerTests/org/apache/beehive/netui/= test/compiler/TestPropertyMgr.java > > beehive/trunk/netui/test/src/compilerTests/testsuite/GA_DeprecationW= arning/expectedOutput/struts-config--global.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/Jira390/expecte= dOutput/struts-config-Jira390.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/Jira611/expecte= dOutput/struts-config-Jira611-child.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/Jira611/expecte= dOutput/struts-config-Jira611-parent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/Nested_Abstract= /expectedOutput/struts-config-Nested_Abstract.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/Nested_NewRetur= nTo/expectedOutput/struts-config-Nested_NewReturnTo.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ActionMethod= Overload/expectedOutput/struts-config-PF_ActionMethodOverload.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ActionNegati= ves/expectedOutput/struts-config-PF_ActionNegatives.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ActionReadOn= ly/expectedOutput/struts-config-PF_ActionReadOnly.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ActionUseFor= mBean/expectedOutput/struts-config-PF_ActionUseFormBean.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ActionWithFo= rm/expectedOutput/struts-config-PF_ActionWithForm.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_AnyNumberAct= ionForward/expectedOutput/struts-config-PF_AnyNumberActionForward.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_CatchExcepti= onHandler/expectedOutput/struts-config-PF_CatchExceptionHandler.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_DeprecatedEx= ceptionHandler/expectedOutput/struts-config-PF_DeprecatedExceptionHandler.e= xpected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ForwardNotIn= ActionOrController/expectedOutput/struts-config-PF_ForwardNotInActionOrCont= roller.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ForwardRedir= ect/expectedOutput/struts-config-PF_ForwardRedirect.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ForwardSynta= x/expectedOutput/struts-config-PF_ForwardSyntax.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_InvalidAnnot= ations/expectedOutput/struts-config-PF_InvalidAnnotations.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_JustBeginAct= ion/expectedOutput/struts-config-PF_JustBeginAction.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_LongLivedTru= e/expectedOutput/struts-config-PF_LongLivedTrue.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_MissingForwa= rdJPF/expectedOutput/struts-config-MissingForwardJPF.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_RedirectWith= NavigateTo/expectedOutput/struts-config-PF_RedirectWithNavigateTo.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_RolesAllowed= /expectedOutput/struts-config-PF_RolesAllowed.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_SameGlobalAc= tionForwardName/expectedOutput/struts-config-PF_SameGlobalActionForwardName= .expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_SameMethodNa= meSig/expectedOutput/struts-config-PF_SameMethodNameSig.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_TwoActionVal= idationErrForward/expectedOutput/struts-config-PF_TwoActionValidationErrFor= ward.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_TwoActionsSa= meForward/expectedOutput/struts-config-PF_TwoActionsSameForward.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_TwoBeginActi= on/expectedOutput/struts-config-PF_TwoBeginAction.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_ValidateErro= rForward/expectedOutput/struts-config-PF_ValidateErrorForward.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_WrongActionM= ember/expectedOutput/struts-config-PF_WrongActionMember.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PF_WrongControl= Location/expectedOutput/struts-config-PF_WrongControlLocation.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_Abstract/exp= ectedOutput/struts-config-PI_Abstract.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_Begin/expect= edOutput/struts-config-PI_Begin-parent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_Begin/expect= edOutput/struts-config-PI_Begin.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ControlsOver= ride/expectedOutput/struts-config-PI_ControlsOverride-parent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ControlsOver= ride/expectedOutput/struts-config-PI_ControlsOverride.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ForwardPath/= expectedOutput/struts-config-PI_ForwardPath-parent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ForwardPath/= expectedOutput/struts-config-PI_ForwardPath.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ReturnAction= /expectedOutput/struts-config-PI_ReturnAction-parent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/PI_ReturnAction= /expectedOutput/struts-config-PI_ReturnAction.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_ImplicitRefe= rences/expectedOutput/struts-config--SF_ImplicitReferences.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_ImplicitRefe= rences/expectedOutput/struts-config-SF_ImplicitReferences.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_ImplicitRefe= rencesNested/expectedOutput/struts-config--SF_ImplicitReferencesNested.expe= cted > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_ImplicitRefe= rencesNested/expectedOutput/struts-config-SF_ImplicitReferencesNested.expec= ted > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_InvalidRelat= ivePath/expectedOutput/struts-config--SF_InvalidRelativePath.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/SF_InvalidRelat= ivePath/expectedOutput/struts-config-SF_InvalidRelativePath.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/retrievePopupOu= tput/expectedOutput/struts-config-retrievePopupOutput.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleActionRea= dOnlyUseFormBeanWarning/expectedOutput/struts-config-simpleActionReadOnlyUs= eFormBeanWarning.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleBeginAbst= ractParent/expectedOutput/struts-config-simpleBeginAbstractParent-childFlow= .expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleBeginAbst= ractParent/expectedOutput/struts-config-simpleBeginAbstractParent.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleBeginActi= onMethodOverride/expectedOutput/struts-config-simpleBeginActionMethodOverri= de-childFlow.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleBeginActi= onMethodOverride/expectedOutput/struts-config-simpleBeginActionMethodOverri= de.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleInherited= Begin/expectedOutput/struts-config-simpleInheritedBegin-childFlow.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleInherited= Begin/expectedOutput/struts-config-simpleInheritedBegin.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleInvalidPa= thWarning/expectedOutput/struts-config-simpleInvalidPathWarning.expected > > beehive/trunk/netui/test/src/compilerTests/testsuite/simpleReadOnlyU= seFormBeanWarning/expectedOutput/struts-config-simpleReadOnlyUseFormBeanWar= ning.expected > > beehive/trunk/netui/test/webapps/drt/coreWeb/strutsMerge/test6/merge= -jpf-struts-config.xml > > > >Modified: beehive/trunk/netui/src/compiler-core/build.xml > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /build.xml?rev=3D289648&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/build.xml (original) > >+++ beehive/trunk/netui/src/compiler-core/build.xml Fri Sep 16 13:27:57 = 2005 > >@@ -9,7 +9,6 @@ > > >location=3D"${classes.dir}/${module.name}"/> > > > > > >- > > > > > > > >@@ -21,8 +20,6 @@ > > > > > > > >- > >- > > > destdir=3D"${module.classes.dir}" > > classpathref=3D"module.classpath" > >@@ -37,34 +34,10 @@ > > > > > > > >+ > >+ > > > > > >- > >- > >- > >- > >- > >- >value=3D"${module.dir}/schema/struts-config"/> > >- > >- >value=3D"${module.dir}/schema/struts-config/*.xsd*"/> > >- >value=3D"${module.classes.dir}/org/apache/beehive/netui/compiler/model/s= chema/struts11/StrutsConfigDocument.class"/> > >- > >- > >- > >- > >- >value=3D"${module.dir}/schema/processed-annotations"/> > >- > >- >value=3D"${module.dir}/schema/processed-annotations/*.xsd*"/> > >- >value=3D"${module.classes.dir}/org/apache/beehive/netui/compiler/schema/= annotations/ProcessedAnnotationsDocument.class"/> > >- > > > > > > > > > >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=3D289648&r1=3D2= 89647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/AnnotationToXML.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/AnnotationToXML.java > >Fri Sep 16 13:27:57 2005 > >@@ -24,49 +24,53 @@ > > import org.apache.beehive.netui.compiler.typesystem.declaration.Annotat= ionValue; > > import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.beehive.netui.compiler.schema.annotations.ProcessedAn= notationsDocument; > >-import org.apache.beehive.netui.compiler.schema.annotations.AnnotatedEl= ement; > >-import org.apache.beehive.netui.compiler.schema.annotations.ProcessedAn= notation; > >-import org.apache.beehive.netui.compiler.schema.annotations.AnnotationA= ttribute; > > import org.apache.beehive.netui.compiler.model.StrutsApp; > >-import org.apache.xmlbeans.XmlOptions; > >+import org.apache.beehive.netui.compiler.model.XmlModelWriter; > >+import org.apache.beehive.netui.compiler.model.XmlModelWriterException; > >+import org.w3c.dom.Element; > > > > import java.util.Map; > > import java.util.Iterator; > > import java.util.List; > >+import java.util.Date; > > import java.io.File; > > import java.io.IOException; > > import java.io.PrintWriter; > > > > public class AnnotationToXML > > { > >- private static final String ANNOTATIONS_FILE_PREFIX =3D "jpf-annota= tions"; > >+ private static final String ANNOTATIONS_FILE_PREFIX =3D "annotation= s"; > > > >- private ProcessedAnnotationsDocument _doc; > >+ private XmlModelWriter _xw; > > private TypeDeclaration _typeDecl; > > > >- public AnnotationToXML( TypeDeclaration typeDecl ) > >+ public AnnotationToXML(TypeDeclaration typeDecl) > >+ throws IOException, XmlModelWriterException > > { > >- _doc =3D ProcessedAnnotationsDocument.Factory.newInstance(); > > _typeDecl =3D typeDecl; > >- ProcessedAnnotationsDocument.ProcessedAnnotations pa =3D > >_doc.addNewProcessedAnnotations(); > >- pa.setTypeName( typeDecl.getQualifiedName() ); > >+ String typeName =3D typeDecl.getQualifiedName(); > >+ StringBuffer comment =3D new StringBuffer(" Generated from "); > >+ comment.append(typeName); > >+ comment.append( " on " ).append( new Date().toString() ).append= ( ' ' ); > >+ _xw =3D new XmlModelWriter(null, "processed-annotations", null, > >null, comment.toString()); > >+ _xw.addElementWithText(_xw.getRootElement(), "type-name", typeN= ame); > > } > > > > public void include( MemberDeclaration memberDecl, > >AnnotationInstance annotation ) > > { > >- AnnotatedElement element =3D > >_doc.getProcessedAnnotations().addNewAnnotatedElement(); > > String name =3D memberDecl instanceof TypeDeclaration > > ? ( ( TypeDeclaration ) memberDecl ).getQualified= Name() > > : memberDecl.getSimpleName(); > >- element.setElementName( name ); > >- ProcessedAnnotation xmlAnnotation =3D element.addNewAnnotation(= ); > >+ Element annotatedElement =3D > >_xw.addElement(_xw.getRootElement(), "annotated-element"); > >+ _xw.addElementWithText(annotatedElement, "element-name", name); > >+ Element xmlAnnotation =3D _xw.addElement(annotatedElement, "ann= otation"); > > include( xmlAnnotation, annotation ); > > } > > > >- private void include( ProcessedAnnotation xmlAnnotation, > >AnnotationInstance annotation ) > >+ private void include( Element xmlAnnotation, AnnotationInstance > >annotation ) > > { > >- xmlAnnotation.setAnnotationName( > >annotation.getAnnotationType().getAnnotationTypeDeclaration().getQualifi= edName() > >); > >+ String annotationName =3D > >annotation.getAnnotationType().getAnnotationTypeDeclaration().getQualifi= edName(); > >+ _xw.addElementWithText(xmlAnnotation, "annotation-name", > >annotationName); > > > > Map elementValues =3D annotation.getElementValues(); > > > >@@ -78,8 +82,8 @@ > > > > String name =3D elementDecl.getSimpleName(); > > Object value =3D annotationValue.getValue(); > >- AnnotationAttribute xmlAttr =3D > >xmlAnnotation.addNewAnnotationAttribute(); > >- xmlAttr.setAttributeName( name ); > >+ Element xmlAttr =3D _xw.addElement(xmlAnnotation, > >"annotation-attribute"); > >+ _xw.addElementWithText(xmlAttr, "attribute-name", name); > > > > if ( value instanceof List ) > > { > >@@ -91,39 +95,35 @@ > > > > // we only handle lists of annotations at the momen= t > > assert listVal instanceof AnnotationInstance : > >listVal.getClass().getName(); > >- include( xmlAttr.addNewAnnotationValue(), ( > >AnnotationInstance ) listVal ); > >+ include(_xw.addElement(xmlAttr, > >"annotation-value"), (AnnotationInstance) listVal); > > } > > } > > else > > { > > // we only support a few types at the moment > > assert value instanceof TypeInstance || value > >instanceof String : value.getClass().getName(); > >- xmlAttr.setStringValue1( value.toString() ); > >+ _xw.addElementWithText(xmlAttr, "string-value", > >value.toString()); > > } > > } > > } > > > > public void writeXml( Diagnostics diagnostics, > >AnnotationProcessorEnvironment env ) > >+ throws IOException, XmlModelWriterException > > { > >- String typeName =3D _typeDecl.getQualifiedName(); > >- String outputFilePath =3D StrutsApp.getOutputFileURI( > >ANNOTATIONS_FILE_PREFIX, typeName, false ); > >- PrintWriter writer =3D null; > >- > >- try > >- { > >- XmlOptions options =3D new XmlOptions(); > >- options.setSavePrettyPrint(); > >- File outputFile =3D new File( outputFilePath ); > >- writer =3D env.getFiler().createTextFile( outputFile ); > >- _doc.save( writer, options ); > >- } > >- catch ( IOException e ) > >- { > >- diagnostics.addError( _typeDecl, > >"error.could-not-generate", outputFilePath, e.getMessage() ); > >- } > >- finally > >- { > >- if ( writer !=3D null ) writer.close(); > >+ String outputFilePath =3D getFilePath(_typeDecl); > >+ File outputFile =3D new File(outputFilePath); > >+ PrintWriter writer =3D env.getFiler().createTextFile(outputFile= ); > >+ > >+ try { > >+ _xw.simpleFastWrite(writer); > >+ } finally { > >+ writer.close(); > > } > >+ } > >+ > >+ public static String getFilePath(TypeDeclaration typeDecl) > >+ { > >+ String typeName =3D typeDecl.getQualifiedName(); > >+ return StrutsApp.getOutputFileURI( ANNOTATIONS_FILE_PREFIX, > >typeName, false ); > > } > > } > > > >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=3D289648&= r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FacesBackingGenerator.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FacesBackingGenerator.java > >Fri Sep 16 13:27:57 2005 > >@@ -22,8 +22,6 @@ > > import org.apache.beehive.netui.compiler.typesystem.declaration.MethodD= eclaration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > > > >-import java.io.File; > >- > > public class FacesBackingGenerator > > extends BaseGenerator > > implements JpfLanguageConstants > >@@ -36,26 +34,32 @@ > > public void generate( ClassDeclaration publicClass ) > > throws FatalCompileTimeException > > { > >- AnnotationInstance facesBackingAnnotation =3D > >CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME ); > >- assert facesBackingAnnotation !=3D null; // checker should enf= orce this > >- AnnotationToXML atx =3D new AnnotationToXML( publicClass ); > >- > >- // Add the class-level @Jpf.FacesBacking annotation. > >- atx.include( publicClass, facesBackingAnnotation ); > >- > >- // For each method, add the @Jpf.CommandHandler annotation. > >- MethodDeclaration[] methods =3D CompilerUtils.getClassMethods( > >publicClass, COMMAND_HANDLER_TAG_NAME ); > >- for ( int i =3D 0; i < methods.length; i++ ) > >- { > >- MethodDeclaration method =3D methods[i]; > >- AnnotationInstance commandHandlerAnn =3D > >CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ); > >- atx.include( method, commandHandlerAnn ); > >+ try { > >+ AnnotationInstance facesBackingAnnotation =3D > >CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME ); > >+ assert facesBackingAnnotation !=3D null; // checker should > >enforce this > >+ AnnotationToXML atx =3D new AnnotationToXML( publicClass ); > >+ > >+ // Add the class-level @Jpf.FacesBacking annotation. > >+ atx.include( publicClass, facesBackingAnnotation ); > >+ > >+ // For each method, add the @Jpf.CommandHandler annotation. > >+ MethodDeclaration[] methods =3D > >CompilerUtils.getClassMethods( publicClass, COMMAND_HANDLER_TAG_NAME > >); > >+ for ( int i =3D 0; i < methods.length; i++ ) > >+ { > >+ MethodDeclaration method =3D methods[i]; > >+ AnnotationInstance commandHandlerAnn =3D > >CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ); > >+ atx.include( method, commandHandlerAnn ); > >+ } > >+ > >+ // Add @Jpf.SharedFlowField, @Jpf.PageFlowField, @Control. > >+ FlowControllerGenerator.includeFieldAnnotations( atx, > >publicClass, PAGE_FLOW_FIELD_TAG_NAME ); > >+ > >+ // Write the file. > >+ atx.writeXml( getDiagnostics(), getEnv() ); > >+ } catch (Exception e) { > >+ getDiagnostics().addError( publicClass, "error.could-not-ge= nerate", > >+ > >AnnotationToXML.getFilePath(publicClass), e.getMessage() ); > >+ e.printStackTrace(); // TODO: log instead > > } > >- > >- // Add @Jpf.SharedFlowField, @Jpf.PageFlowField, @Control. > >- FlowControllerGenerator.includeFieldAnnotations( atx, > >publicClass, PAGE_FLOW_FIELD_TAG_NAME ); > >- > >- // Write the file. > >- 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=3D289648&= r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerChecker.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerChecker.java > >Fri Sep 16 13:27:57 2005 > >@@ -34,7 +34,6 @@ > > import org.apache.beehive.netui.compiler.typesystem.type.ClassType; > > import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; > > import org.apache.beehive.netui.compiler.processor.SilentDiagnostics; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.FilenameFilter; > >@@ -272,7 +271,7 @@ > > } > > > > protected abstract GenStrutsApp createStrutsApp( ClassDeclaration j= class ) > >- throws XmlException, IOException, FatalCompileTimeException; > >+ throws IOException, FatalCompileTimeException; > > > > protected void startCheckClass( ClassDeclaration jclass ) > > throws FatalCompileTimeException > >@@ -291,10 +290,6 @@ > > strutsApp =3D createStrutsApp( jclass ); > > strutsConfigFile =3D strutsApp.getStrutsConfigFile(); > > } > >- catch ( XmlException e ) > >- { > >- // will be reported at generate time > >- } > > catch ( IOException e ) > > { > > // will be reported at generate time > >@@ -302,8 +297,6 @@ > > > > if ( strutsConfigFile !=3D null ) > > { > >- File parentDir =3D strutsConfigFile.getParentFile(); > >- > > getFCSourceFileInfo().addReferencedFile( strutsConfigFile )= ; > > > > if ( strutsConfigFile.exists() && strutsApp !=3D null && ! > >strutsApp.canWrite() ) > > > >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=3D28964= 8&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerGenerator.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/FlowControllerGenerator.java > >Fri Sep 16 13:27:57 2005 > >@@ -24,7 +24,7 @@ > > import org.apache.beehive.netui.compiler.typesystem.declaration.FieldDe= claration; > > import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDec= laration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.xmlbeans.XmlException; > >+import org.apache.beehive.netui.compiler.model.XmlModelWriterException; > > > > import java.io.File; > > import java.io.FileNotFoundException; > >@@ -47,7 +47,7 @@ > > } > > > > protected abstract GenStrutsApp createStrutsApp( ClassDeclaration c= l ) > >- throws XmlException, IOException, FatalCompileTimeException= ; > >+ throws IOException, FatalCompileTimeException; > > > > public void generate( ClassDeclaration publicClass ) > > { > >@@ -78,8 +78,7 @@ > > catch ( Exception e ) > > { > > e.printStackTrace(); // @TODO log > >- assert e instanceof XmlException || e instanceof > >IOException || e instanceof FileNotFoundException > >- : e.getClass().getName(); > >+ assert e instanceof IOException : e.getClass().getName(); > > getDiagnostics().addError( publicClass, "error.could-not-ge= nerate", > > app !=3D null ? > >app.getStrutsConfigFile() : null, e.getMessage() ); > > } > >@@ -90,13 +89,18 @@ > > } > > > > private void writeFieldAnnotations( ClassDeclaration classDecl, > >GenStrutsApp app ) > >- throws FatalCompileTimeException > > { > >- AnnotationToXML atx =3D new AnnotationToXML( classDecl ); > >- > >- if ( includeFieldAnnotations( atx, classDecl, null ) ) > >- { > >- atx.writeXml( getDiagnostics(), getEnv() ); > >+ try { > >+ AnnotationToXML atx =3D new AnnotationToXML( classDecl ); > >+ > >+ if ( includeFieldAnnotations( atx, classDecl, null ) ) > >+ { > >+ atx.writeXml( getDiagnostics(), getEnv() ); > >+ } > >+ } catch (Exception e) { > >+ getDiagnostics().addError(classDecl, > >"error.could-not-generate", AnnotationToXML.getFilePath(classDecl), > >+ e.getMessage() ); > >+ e.printStackTrace(); // TODO: log instead > > } > > } > > > >@@ -167,7 +171,7 @@ > > e.printStackTrace(); // @TODO get rid of this > > assert e instanceof FileNotFoundException > > || e instanceof IOException > >- || e instanceof XmlException > >+ || e instanceof XmlModelWriterException > > : e.getClass().getName(); > > > > getDiagnostics().addError( publicClass, "error.could-not-ge= nerate", > > > >Added: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/co= mpiler/LocalFileEntityResolver.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/LocalFileEntityResolver.java?rev=3D28964= 8&view=3Dauto > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/LocalFileEntityResolver.java > >(added) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/LocalFileEntityResolver.java > >Fri Sep 16 13:27:57 2005 > >@@ -0,0 +1,67 @@ > >+/* > >+ * 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 impl= ied. > >+ * See the License for the specific language governing permissions and > >+ * limitations under the License. > >+ * > >+ * $Header:$ > >+ */ > >+package org.apache.beehive.netui.compiler; > >+ > >+import org.xml.sax.EntityResolver; > >+import org.xml.sax.InputSource; > >+import org.xml.sax.SAXException; > >+ > >+import java.io.IOException; > >+import java.io.InputStream; > >+ > >+/** > >+ * Entity resolver that tries to find the resource locally (from > >classloader, under > >+ * org/apache/beehive/netui/compiler/resources) before trying to > >resolve via the network. > >+ */ > >+public class LocalFileEntityResolver implements EntityResolver > >+{ > >+ private static final String RESORUCE_PATH_PREFIX =3D > >"org/apache/beehive/netui/compiler/resources/"; > >+ private static final LocalFileEntityResolver INSTANCE =3D new > >LocalFileEntityResolver(); > >+ > >+ protected LocalFileEntityResolver() { > >+ } > >+ > >+ public static LocalFileEntityResolver getInstance() { > >+ return INSTANCE; > >+ } > >+ > >+ /** > >+ * Resolve the entity. First try to find it locally, then > >fallback to the network. > >+ */ > >+ public InputSource resolveEntity(String publicID, String > >systemID) throws SAXException, IOException { > >+ InputSource localFileInput =3D resolveLocalEntity(systemID); > >+ return localFileInput !=3D null ? localFileInput : new > >InputSource(systemID); > >+ } > >+ > >+ /** > >+ * Resolve the given entity locally. > >+ */ > >+ public InputSource resolveLocalEntity(String systemID) throws > >SAXException, IOException { > >+ String localFileName =3D systemID; > >+ int fileNameStart =3D localFileName.lastIndexOf('/') + 1; > >+ if (fileNameStart < localFileName.length()) { > >+ localFileName =3D systemID.substring(fileNameStart); > >+ } > >+ ClassLoader cl =3D LocalFileEntityResolver.class.getClassLoader= (); > >+ InputStream stream =3D > >cl.getResourceAsStream(RESORUCE_PATH_PREFIX + localFileName); > >+ if (stream !=3D null) { > >+ return new InputSource(stream); > >+ } > >+ return null; > >+ } > >+} > > > >Propchange: beehive/trunk/netui/src/compiler-core/org/apache/beehive/net= ui/compiler/LocalFileEntityResolver.java > >------------------------------------------------------------------------= ------ > > svn:eol-style =3D native > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/PageFlowChecker.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/PageFlowChecker.java?rev=3D289648&r1=3D2= 89647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowChecker.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowChecker.java > >Fri Sep 16 13:27:57 2005 > >@@ -29,7 +29,6 @@ > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > > import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; > > import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.IOException; > >@@ -193,7 +192,7 @@ > > } > > > > protected GenStrutsApp createStrutsApp( ClassDeclaration jclass ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > File sourceFile =3D CompilerUtils.getSourceFile( jclass, true )= ; > > return new GenStrutsApp( sourceFile, jclass, getEnv(), > >getFCSourceFileInfo(), true, getDiagnostics() ); > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/PageFlowGenerator.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/PageFlowGenerator.java?rev=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowGenerator.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/PageFlowGenerator.java > >Fri Sep 16 13:27:57 2005 > >@@ -20,7 +20,6 @@ > > import org.apache.beehive.netui.compiler.genmodel.GenStrutsApp; > > import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDe= claration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.IOException; > >@@ -35,7 +34,7 @@ > > } > > > > protected GenStrutsApp createStrutsApp( ClassDeclaration jclass ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > File sourceFile =3D CompilerUtils.getSourceFile( jclass, true )= ; > > return new GenStrutsApp( sourceFile, jclass, getEnv(), > >getFCSourceFileInfo(), false, getDiagnostics() ); > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/SharedFlowChecker.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/SharedFlowChecker.java?rev=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowChecker.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowChecker.java > >Fri Sep 16 13:27:57 2005 > >@@ -23,7 +23,6 @@ > > import org.apache.beehive.netui.compiler.grammar.InvalidAttributeType; > > import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDe= claration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.IOException; > >@@ -72,7 +71,7 @@ > > } > > > > protected GenStrutsApp createStrutsApp( ClassDeclaration jclass ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > File sourceFile =3D CompilerUtils.getSourceFile( jclass, true )= ; > > return new GenSharedFlowStrutsApp( sourceFile, jclass, > >getEnv(), getFCSourceFileInfo(), true, getDiagnostics() ); > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/SharedFlowGenerator.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/SharedFlowGenerator.java?rev=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowGenerator.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/SharedFlowGenerator.java > >Fri Sep 16 13:27:57 2005 > >@@ -21,7 +21,6 @@ > > import org.apache.beehive.netui.compiler.genmodel.GenStrutsApp; > > import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDe= claration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.IOException; > >@@ -36,7 +35,7 @@ > > } > > > > protected GenStrutsApp createStrutsApp( ClassDeclaration jclass ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > File sourceFile =3D CompilerUtils.getSourceFile( jclass, true )= ; > > return new GenSharedFlowStrutsApp( sourceFile, jclass, > >getEnv(), getFCSourceFileInfo(), false, getDiagnostics() ); > > > >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=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/diagnostics.properties > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/diagnostics.properties > >Fri Sep 16 13:27:57 2005 > >@@ -15,6 +15,7 @@ > > error.atmost-one-may-exist-6 =3D Only one of attributes "{0}", "{1}", > >"{2}", "{3}", "{4}", or "{5}" may be present. > > error.attr-dependency-not-found-1 =3D Attribute "{0}" may only be > >present when attribute "{1}" is present. > > error.attr-dependency-not-found-2 =3D Attribute "{0}" may only be > >present when attribute "{1}" or "{2}" is present. > >+error.attr-dependency-not-found-3 =3D Attribute "{0}" may only be > >present when one of attributes "{1}", "{2}", or "{3}" is present. > > error.unresolved-exception-handler =3D No exception handler method > >named "{0}" could be found. > > error.invalid-parent-directory =3D Could not create parent directory "{= 0}". > > error.struts-config-not-writable =3D Cannot write to "{0}". > >@@ -78,7 +79,7 @@ > > error.xml-parse-error =3D Error while parsing {0} (line {1}, column {2}= ): {3} > > error.xml-parse-error-nocolumn =3D Error while parsing {0} (line {1}): = {2} > > error.xml-parse-error-nolinecolumn =3D Error while parsing {0}: {1} > >-error.xml-read-error =3D Could not load {0}: {1}. > >+error.xml-read-error =3D Could not load {0} due to {1}: {2}. > > > > error.invalid-uri =3D This URI is invalid: {0} > > error.relative-uri =3D This attribute requires a relative path. > > > >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= =3D289648&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenSharedFlowStrutsApp.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenSharedFlowStrutsApp.java > >Fri Sep 16 13:27:57 2005 > >@@ -23,7 +23,6 @@ > > import org.apache.beehive.netui.compiler.JpfLanguageConstants; > > import org.apache.beehive.netui.compiler.Diagnostics; > > import org.apache.beehive.netui.compiler.FatalCompileTimeException; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.IOException; > >@@ -35,7 +34,7 @@ > > { > > public GenSharedFlowStrutsApp( File sourceFile, ClassDeclaration > >jclass, AnnotationProcessorEnvironment env, > > FlowControllerInfo fcInfo, boolean > >checkOnly, Diagnostics diagnostics ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > super( sourceFile, jclass, env, fcInfo, checkOnly, diagnostics = ); > > recalculateStrutsConfigFile(); // it changes based on _isGloba= lApp > > > >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=3D289648&= r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenStrutsApp.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenStrutsApp.java > >Fri Sep 16 13:27:57 2005 > >@@ -28,20 +28,16 @@ > > import org.apache.beehive.netui.compiler.model.ForwardModel; > > import org.apache.beehive.netui.compiler.model.MessageResourcesModel; > > import org.apache.beehive.netui.compiler.model.StrutsApp; > >+import org.apache.beehive.netui.compiler.model.XmlModelWriterException; > > import org.apache.beehive.netui.compiler.typesystem.declaration.Annotat= ionInstance; > > import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDe= claration; > > import org.apache.beehive.netui.compiler.typesystem.declaration.MethodD= eclaration; > > import org.apache.beehive.netui.compiler.typesystem.declaration.Modifie= r; > >-import org.apache.beehive.netui.compiler.typesystem.declaration.Package= Declaration; > > import org.apache.beehive.netui.compiler.typesystem.declaration.Paramet= erDeclaration; > > import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDec= laration; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > > import org.apache.beehive.netui.compiler.typesystem.type.DeclaredType; > > import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; > >-import org.apache.beehive.netui.compiler.typesystem.type.ClassType; > >-import org.apache.xmlbeans.XmlCursor; > >-import org.apache.xmlbeans.XmlException; > >-import org.apache.xmlbeans.XmlObject; > > > > import java.io.File; > > import java.io.FileNotFoundException; > >@@ -68,7 +64,7 @@ > > private FlowControllerInfo _fcInfo; > > > > protected void recalculateStrutsConfigFile() > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > _strutsConfigFile =3D calculateStrutsConfigFile(); // caching t= his > > } > >@@ -80,7 +76,7 @@ > > > > public GenStrutsApp( File sourceFile, ClassDeclaration jclass, > >AnnotationProcessorEnvironment env, > > FlowControllerInfo fcInfo, boolean > >checkOnly, Diagnostics diagnostics ) > >- throws XmlException, IOException, FatalCompileTimeException > >+ throws IOException, FatalCompileTimeException > > { > > super( jclass.getQualifiedName() ); > > > >@@ -328,9 +324,19 @@ > > } > > > > public void writeToFile() > >- throws FileNotFoundException, IOException, XmlException, > >FatalCompileTimeException > >+ throws FileNotFoundException, IOException, > >XmlModelWriterException, FatalCompileTimeException > > { > >- writeToFile( getMergeFile( getMergeFileName() ) ); > >+ File strutsMergeFile =3D getMergeFile( getMergeFileName() ); > >+ PrintWriter writer =3D getEnv().getFiler().createTextFile( > >_strutsConfigFile ); > >+ > >+ try > >+ { > >+ writeXml( writer, strutsMergeFile ); > >+ } > >+ finally > >+ { > >+ writer.close(); > >+ } > > } > > > > public boolean isStale() > >@@ -419,23 +425,8 @@ > > > > return true; > > } > >- > >- > >- public void writeToFile( File strutsMergeFile ) > >- throws FileNotFoundException, IOException, XmlException, > >FatalCompileTimeException > >- { > >- PrintWriter writer =3D getEnv().getFiler().createTextFile( > >_strutsConfigFile ); > >- > >- try > >- { > >- writeXml( writer, strutsMergeFile ); > >- } > >- finally > >- { > >- writer.close(); > >- } > >- } > >- > >+ > >+ > > public File getStrutsConfigFile() > > { > > return _strutsConfigFile; > > > >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=3D2= 89648&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenValidationModel.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/genmodel/GenValidationModel.java > >Fri Sep 16 13:27:57 2005 > >@@ -20,9 +20,9 @@ > > import org.apache.beehive.netui.compiler.CompilerUtils; > > import org.apache.beehive.netui.compiler.JpfLanguageConstants; > > import org.apache.beehive.netui.compiler.MergedControllerAnnotation; > >-import org.apache.beehive.netui.compiler.Diagnostics; > > import org.apache.beehive.netui.compiler.FatalCompileTimeException; > > import org.apache.beehive.netui.compiler.model.FormBeanModel; > >+import org.apache.beehive.netui.compiler.model.XmlModelWriterException; > > import org.apache.beehive.netui.compiler.model.validation.ValidationMod= el; > > import org.apache.beehive.netui.compiler.model.validation.ValidatorCons= tants; > > import org.apache.beehive.netui.compiler.model.validation.ValidatorRule= ; > >@@ -37,13 +37,10 @@ > > import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; > > import org.apache.beehive.netui.compiler.typesystem.type.ClassType; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > >-import org.apache.xmlbeans.XmlException; > > > > import java.io.File; > > import java.io.FileNotFoundException; > >-import java.io.FileOutputStream; > > import java.io.IOException; > >-import java.io.PrintStream; > > import java.io.PrintWriter; > > import java.util.Collection; > > import java.util.Iterator; > >@@ -430,7 +427,7 @@ > > } > > > > public void writeToFile() > >- throws FileNotFoundException, XmlException, IOException, > >FatalCompileTimeException > >+ throws FileNotFoundException, IOException, > >FatalCompileTimeException, XmlModelWriterException > > { > > String outputFilePath =3D getOutputFileURI(); > > File outputFile =3D new File( outputFilePath ); > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/grammar/ControllerGrammar.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/grammar/ControllerGrammar.java?rev=3D289= 648&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ControllerGrammar.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ControllerGrammar.java > >Fri Sep 16 13:27:57 2005 > >@@ -21,28 +21,28 @@ > > import org.apache.beehive.netui.compiler.AnnotationMemberType; > > import org.apache.beehive.netui.compiler.FlowControllerInfo; > > import org.apache.beehive.netui.compiler.Diagnostics; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.StrutsCo= nfigDocument; > >-import org.apache.beehive.netui.compiler.model.schema.validator11.FormV= alidationDocument; > > import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProce= ssorEnvironment; > > > >+import java.net.URL; > >+ > > > > public class ControllerGrammar > > extends BaseFlowControllerGrammar > >-{ > >+{ > > public ControllerGrammar( AnnotationProcessorEnvironment env, > >Diagnostics diags, RuntimeVersionChecker rvc, > > FlowControllerInfo fcInfo ) > > { > > super( env, diags, null, rvc, fcInfo ); > >- > >+ > > addMemberType( LOGIN_REQUIRED_ATTR, new AnnotationMemberType( > >null, this ) ); > > addMemberType( ROLES_ALLOWED_ATTR, new RolesAllowedType( this )= ); > > addMemberType( READONLY_ATTR, new AnnotationMemberType( null, t= his ) ); > >- addMemberType( STRUTSMERGE_ATTR, new ValidXmlFileType( > >StrutsConfigDocument.type, null, this, fcInfo ) ); > >+ addMemberType( STRUTSMERGE_ATTR, new ValidXmlFileType( > >"struts-config_1_1.xsd", null, this, fcInfo ) ); > > addMemberType( VALIDATOR_VERSION_ATTR, new > >AnnotationMemberType( null, this ) ); > >- addMemberType( VALIDATOR_MERGE_ATTR, new ValidXmlFileType( > >FormValidationDocument.type, null, this, fcInfo ) ); > >+ addMemberType( VALIDATOR_MERGE_ATTR, new ValidXmlFileType( > >"struts-validator_1_1.xsd", null, this, fcInfo ) ); > > addMemberType( TILES_DEFINITIONS_CONFIGS_ATTR, new > >TilesDefinitionsConfigsType( null, this, fcInfo ) ); > > addMemberType( MULTIPART_HANDLER_ATTR, new > >AnnotationMemberType( null, this ) ); > >- > >+ > > addMemberArrayGrammar( SHARED_FLOW_REFS_ATTR, new > >SharedFlowRefGrammar( env, diags, rvc ) ); > > addMemberArrayGrammar( FORWARDS_ATTR, new ForwardGrammar( > >env, diags, null, rvc, fcInfo ) ); > > addMemberArrayGrammar( CATCHES_ATTR, new CatchGrammar( env, > >diags, null, rvc, CONTROLLER_TAG_NAME, fcInfo ) ); > >@@ -50,7 +50,7 @@ > > addMemberArrayGrammar( VALIDATABLE_BEANS_ATTR, new > >ValidatableBeanGrammar( env, diags, rvc ) ); > > addMemberArrayGrammar( SIMPLE_ACTIONS_ATTR, new > >SimpleActionGrammar( env, diags, rvc, fcInfo ) ); > > } > >- > >+ > > public String[][] getMutuallyExclusiveAttrs() > > { > > return null; > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/grammar/ValidXmlFileType.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/grammar/ValidXmlFileType.java?rev=3D2896= 48&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ValidXmlFileType.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/grammar/ValidXmlFileType.java > >Fri Sep 16 13:27:57 2005 > >@@ -19,154 +19,159 @@ > > > > import org.apache.beehive.netui.compiler.AnnotationGrammar; > > import org.apache.beehive.netui.compiler.FlowControllerInfo; > >-import org.apache.xmlbeans.SchemaType; > >-import org.apache.xmlbeans.XmlOptions; > >-import org.apache.xmlbeans.XmlObject; > >-import org.apache.xmlbeans.XmlError; > >-import org.apache.xmlbeans.XmlException; > >+import org.apache.beehive.netui.compiler.LocalFileEntityResolver; > > import org.apache.beehive.netui.compiler.typesystem.declaration.Annotat= ionValue; > >+import org.xml.sax.SAXParseException; > >+import org.xml.sax.SAXException; > >+import org.xml.sax.InputSource; > >+import org.xml.sax.helpers.DefaultHandler; > > > >+import javax.xml.parsers.DocumentBuilderFactory; > >+import javax.xml.parsers.DocumentBuilder; > > import java.util.Map; > > import java.util.Collections; > > import java.util.HashMap; > >-import java.util.List; > >-import java.util.ArrayList; > > import java.io.File; > >+import java.io.IOException; > > > > > > public class ValidXmlFileType > > extends WebappPathType > > { > >- private SchemaType _schema; > >+ private String _schemaFileName; > > private static Map _parseResults =3D Collections.synchronizedMap( > >new HashMap() ); > >- > >- public ValidXmlFileType( SchemaType schema, String > >requiredRuntimeVersion, AnnotationGrammar parentGrammar, > >+ > >+ public ValidXmlFileType( String schemaFileName, String > >requiredRuntimeVersion, AnnotationGrammar parentGrammar, > > FlowControllerInfo fcInfo ) > > { > > super( false, requiredRuntimeVersion, parentGrammar, fcInfo ); > >- _schema =3D schema; > >+ assert schemaFileName !=3D null; > >+ _schemaFileName =3D schemaFileName; > > } > > > >- > >+ > > protected boolean checkAnyExtension() > > { > > return true; > > } > > > >- > >+ > > protected boolean doFatalError() > > { > > return true; > > } > >- > >- > >+ > >+ > > protected boolean ignoreDirectories() > > { > > return false; > > } > >- > >- > >+ > >+ > > protected boolean allowFileInPageFlowSourceDir() > > { > > return true; > > } > >- > >- > >+ > >+ > > protected void runAdditionalChecks( File file, AnnotationValue valu= e ) > > { > >- try > >+ > >+ // > >+ // We cache the results of parsing the file until the file is > >actually modified, > >+ // so we don't end up continually re-parsing it. > >+ // > >+ ParseResults prevResults =3D ( ParseResults ) > >_parseResults.get( file.getPath() ); > >+ long lastModTime =3D file.lastModified(); > >+ > >+ if ( prevResults =3D=3D null || lastModTime > > >prevResults.getFileModTime() ) > > { > >- // > >- // We cache the results of parsing the file until the > >file is actually modified, > >- // so we don't end up continually re-parsing it. > >- // > >- ParseResults prevResults =3D ( ParseResults ) > >_parseResults.get( file.getPath() ); > >- > >- if ( prevResults =3D=3D null || file.lastModified() > > >prevResults.getFileModTime() ) > >+ try > > { > >- try > >- { > >- XmlOptions options =3D new XmlOptions(); > >- options.setDocumentType( _schema ); > >- XmlObject xml =3D XmlObject.Factory.parse( file, op= tions ); > >- List errorListener =3D new ArrayList(); > >- options.setErrorListener( errorListener ); > >- > >- if ( !xml.validate( options ) ) > >- { > >- assert !errorListener.isEmpty(); > >- > >- XmlError err =3D ( XmlError ) errorListener.get= ( 0 ); > >- assert err !=3D null; > >- > >- throw new XmlException( err.getMessage(), null,= err ); > >- } > >- } > >- catch ( Exception e ) > >- { > >- _parseResults.put( file.getPath(), new > >ParseResults( file.lastModified(), e ) ); > >- throw e; > >+ LocalFileEntityResolver entityResolver =3D > >LocalFileEntityResolver.getInstance(); > >+ InputSource schemaInput =3D > >entityResolver.resolveLocalEntity(_schemaFileName); > >+ assert schemaInput !=3D null : "could not get schema > >resource for " + _schemaFileName; > >+ DocumentBuilderFactory factory =3D > >DocumentBuilderFactory.newInstance(); > >+ factory.setNamespaceAware(true); > >+ factory.setValidating(true); > >+ factory.setAttribute( > >"http://java.sun.com/xml/jaxp/properties/schemaLanguage", > >+ "http://www.w3.org/2001/XMLSchema= "); > >+ factory.setAttribute( > >"http://java.sun.com/xml/jaxp/properties/schemaSource", schemaInput); > >+ DocumentBuilder builder =3D factory.newDocumentBuilder(= ); > >+ > >builder.setEntityResolver(LocalFileEntityResolver.getInstance()); > >+ Validator handler =3D new Validator(lastModTime, file, = value); > >+ builder.setErrorHandler(handler); > >+ builder.parse(file); > >+ if (handler.hadErrors()) { > >+ return; > > } > >- > >- _parseResults.put( file.getPath(), new ParseResults( > >file.lastModified(), null ) ); > > } > >- else > >+ catch ( SAXParseException e ) > > { > >- Exception e =3D prevResults.getException(); > >- > >- if ( e !=3D null ) > >- { > >- throw e; > >- } > >+ addErrorDiagnostic( file, e, value ); > >+ _parseResults.put( file.getPath(), new ParseResults( > >lastModTime, e ) ); > >+ return; > > } > >+ catch ( Exception e ) > >+ { > >+ _parseResults.put( file.getPath(), new ParseResults( > >lastModTime, e ) ); > >+ addError( value, "error.xml-read-error", > >+ new Object[]{ file.getPath(), > >e.getClass().getName(), e.getMessage() } ); > >+ return; > >+ } > >+ > >+ _parseResults.put( file.getPath(), new ParseResults( > >lastModTime, null ) ); > > } > >- catch ( XmlException e ) > >- { > >- addErrorDiagnostic( e.getError(), value ); > >- } > >- catch ( Exception e ) > >+ else > > { > >- addError( value, "error.xml-read-error", new Object[]{ > >file.getPath(), e.getMessage() } ); > >+ Exception e =3D prevResults.getException(); > >+ > >+ if (e instanceof SAXParseException) { > >+ addErrorDiagnostic(file, (SAXParseException) e, value); > >+ } else if (e !=3D null) { > >+ addError( value, "error.xml-read-error", > >+ new Object[]{ file.getPath(), > >e.getClass().getName(), e.getMessage() } ); > >+ } > > } > > } > >- > >- private void addErrorDiagnostic( XmlError err, AnnotationValue valu= e ) > >+ > >+ private void addErrorDiagnostic( File file, SAXParseException > >err, AnnotationValue value ) > > { > >- if ( err.getColumn() !=3D -1 && err.getLine() !=3D -1 ) > >+ if ( err.getColumnNumber() !=3D -1 && err.getLineNumber() !=3D = -1 ) > > { > > Object[] args =3D > > { > >- err.getSourceName(), > >- new Integer( err.getLine() ), > >- new Integer( err.getColumn() ), > >+ file.getPath(), > >+ new Integer( err.getLineNumber() ), > >+ new Integer( err.getColumnNumber() ), > > err.getMessage() > > }; > >- > >+ > > addError( value, "error.xml-parse-error", args ); > > } > >- else if ( err.getLine() !=3D -1 ) > >+ else if ( err.getLineNumber() !=3D -1 ) > > { > > Object[] args =3D > > { > >- err.getSourceName(), > >- new Integer( err.getLine() ), > >+ file.getPath(), > >+ new Integer( err.getLineNumber() ), > > err.getMessage() > > }; > >- > >+ > > addError( value, "error.xml-parse-error-nocolumn", args ); > >- } > >+ } > > else > > { > > Object[] args =3D > > { > >- err.getSourceName(), > >+ file.getPath(), > > err.getMessage() > > }; > >- > >+ > > addError( value, "error.xml-parse-error-nolinecolumn", args= ); > > } > > } > >- > >+ > > private static class ParseResults > > { > > private long _fileModTime; > >@@ -196,6 +201,46 @@ > > public void setException( Exception exception ) > > { > > _exception =3D exception; > >+ } > >+ } > >+ > >+ private class Validator extends DefaultHandler { > >+ > >+ private long _fileModTime; > >+ private File _file; > >+ private AnnotationValue _value; > >+ private boolean _hadErrors =3D false; > >+ > >+ public Validator(long fileModTime, File file, AnnotationValue v= alue) { > >+ _fileModTime =3D fileModTime; > >+ _file =3D file; > >+ _value =3D value; > >+ } > >+ > >+ public void error(SAXParseException ex) > >+ throws SAXException { > >+ ParseResults results =3D new ParseResults(_fileModTime, ex)= ; > >+ addErrorDiagnostic(_file, ex, _value ); > >+ _parseResults.put(_file.getPath(), results); > >+ _hadErrors =3D true; > >+ } > >+ > >+ public void fatalError(SAXParseException ex) > >+ throws SAXException { > >+ error(ex); > >+ } > >+ > >+ public void warning(SAXParseException exception) > >+ throws SAXException { > >+ // TODO: add a compiler warning? > >+ } > >+ > >+ public boolean hadErrors() { > >+ return _hadErrors; > >+ } > >+ > >+ public InputSource resolveEntity(String publicId, String > >systemId) throws IOException, SAXException { > >+ return super.resolveEntity(publicId, systemId); > > } > > } > > } > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/model/AbstractForwardContainer.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/model/AbstractForwardContainer.java?rev= =3D289648&r1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/AbstractForwardContainer.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/AbstractForwardContainer.java > >Fri Sep 16 13:27:57 2005 > >@@ -17,8 +17,7 @@ > > */ > > package org.apache.beehive.netui.compiler.model; > > > >-import org.apache.beehive.netui.compiler.model.schema.struts11.ForwardD= ocument; > >-import org.apache.xmlbeans.XmlObject; > >+import org.w3c.dom.Element; > > > > import java.util.LinkedHashMap; > > import java.util.Iterator; > >@@ -71,28 +70,13 @@ > > return ( ForwardModel ) _forwards.get( forwardName ); > > } > > > >- public void writeForwards( ForwardDocument.Forward[] > >existingForwards, XmlObject xmlForwardContainer ) > >+ public void writeForwards( XmlModelWriter xw, Element > >forwardsParentElement ) > > { > > for ( Iterator i =3D _forwards.values().iterator(); i.hasNext()= ; ) > > { > > ForwardModel fwd =3D ( ForwardModel ) i.next(); > >- ForwardDocument.Forward fwdToEdit =3D null; > >- > >- for ( int j =3D 0; j < existingForwards.length; ++j ) > >- { > >- if ( fwd.getName().equals( existingForwards[j].getName(= ) ) ) > >- { > >- fwdToEdit =3D existingForwards[j]; > >- break; > >- } > >- } > >- > >- if ( fwdToEdit =3D=3D null ) > >- { > >- fwdToEdit =3D addNewForward( xmlForwardContainer ); > >- } > >- > >- fwd.writeToXMLBean( fwdToEdit ); > >+ Element fwdToEdit =3D findChildElement(xw, > >forwardsParentElement, "forward", "name", fwd.getName(), true); > >+ fwd.writeXML( xw, fwdToEdit ); > > } > > } > > > >@@ -112,6 +96,5 @@ > > { > > _forwards.remove( forward.getName() ); > > } > >- > >- protected abstract ForwardDocument.Forward addNewForward( > >XmlObject xmlForwardContainer ); > >+ > > } > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/model/ActionModel.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/model/ActionModel.java?rev=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ActionModel.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ActionModel.java > >Fri Sep 16 13:27:57 2005 > >@@ -22,13 +22,8 @@ > > import java.util.LinkedHashMap; > > import java.util.Iterator; > > > >-import org.apache.beehive.netui.compiler.model.schema.struts11.ActionDo= cument.Action; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.SetPrope= rtyDocument.SetProperty; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.Exceptio= nDocument; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.ForwardD= ocument; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.ActionDo= cument; > > import org.apache.beehive.netui.compiler.JpfLanguageConstants; > >-import org.apache.xmlbeans.XmlObject; > >+import org.w3c.dom.Element; > > > > > > /** > >@@ -43,11 +38,10 @@ > > > > private static final String JPF_ACTION_MAPPING_CLASSNAME =3D > >PAGEFLOW_PACKAGE + ".config.PageFlowActionMapping"; > > > >- > >+ > > // Struts attributes. > > private ArrayList _exceptionCatches =3D new ArrayList(); > > private String _attribute; > >- private String _className; > > private String _forward; > > private String _include; > > private String _input; > >@@ -88,7 +82,7 @@ > > this._path =3D path; > > this._formBeanName =3D formName; > > } > >- > >+ > > protected ActionModel( StrutsApp parent ) > > { > > this( null, null, parent ); > >@@ -96,7 +90,7 @@ > > > > /** > > * Construct a copy of the given mapping, with the given path. > >- */ > >+ */ > > public ActionModel( ActionModel src, String newPath ) > > { > > super( src ); > >@@ -104,7 +98,6 @@ > > this._formBeanName =3D src._formBeanName; > > _exceptionCatches =3D ( ArrayList ) src._exceptionCatches.clone= (); > > _attribute =3D src._attribute; > >- _className =3D src._className; > > _forward =3D src._forward; > > _include =3D src._include; > > _input =3D src._input; > >@@ -126,127 +119,70 @@ > > _unqualifiedActionPath =3D src._unqualifiedActionPath; > > _defaultForwardName =3D src._defaultForwardName; > > } > >- > >+ > > public void setFormBeanName( String formBeanName ) > > { > > _formBeanName =3D formBeanName; > > } > >- > >- public void writeToXMLBean( Action xb ) > >+ > >+ protected void writeToElement(XmlModelWriter xw, Element element) > > { > >- xb.setPath( _path ); > >- > >- if ( xb.getName() =3D=3D null && _formBeanName !=3D null ) > >xb.setName( _formBeanName ); > >- if ( xb.getClassName() =3D=3D null && _className !=3D null ) > >xb.setClassName( _className ); > >- if ( xb.getType() =3D=3D null && _type !=3D null ) xb.setType( = _type ); > >- if ( xb.getAttribute() =3D=3D null && _attribute !=3D null ) > >xb.setAttribute( _attribute ); > >- if ( xb.getInput() =3D=3D null && _input !=3D null ) xb.setInpu= t( _input ); > >- if ( xb.getParameter() =3D=3D null && _parameter !=3D null ) > >xb.setParameter( _parameter ); > >- if ( xb.getPrefix() =3D=3D null && _prefix !=3D null ) > >xb.setPrefix( _prefix ); > >- if ( xb.getSuffix() =3D=3D null && _suffix !=3D null ) > >xb.setSuffix( _suffix ); > >- > >- if ( xb.getScope() =3D=3D null ) > >- { > >- if ( _scope !=3D null ) > >- { > >- if ( _scope.equals( "request" ) ) > >- { > >- xb.setScope( Action.Scope.REQUEST ); > >- } > >- else if ( _scope.equals( "session" ) ) > >- { > >- xb.setScope( Action.Scope.SESSION ); > >- } > >- else > >- { > >- assert false : _scope; > >- } > >- } > >- else > >- { > >- xb.setScope( Action.Scope.REQUEST ); > >- } > >- } > >- > >- if ( xb.getRoles() =3D=3D null && _roles !=3D null ) xb.setRole= s( _roles ); > >- if ( xb.getForward2() =3D=3D null && _forward !=3D null ) > >xb.setForward2( _forward ); > >- if ( xb.getInclude() =3D=3D null && _include !=3D null ) > >xb.setInclude( _include ); > >- if ( xb.getUnknown() =3D=3D null && _unknown ) xb.setUnknown( > >Action.Unknown.TRUE ); > >- if ( xb.getValidate() =3D=3D null ) xb.setValidate( _validate ? > >Action.Validate.TRUE : Action.Validate.FALSE ); > >- > >- if ( _unqualifiedActionPath !=3D null ) addSetProperty( xb, > >"unqualifiedActionPath", _unqualifiedActionPath ); > >- if ( _formMember !=3D null ) addSetProperty( xb, "formMember", > >_formMember ); > >- if ( _formClass !=3D null ) addSetProperty( xb, "formClass", > >_formClass ); > >- if ( _loginRequired ) addSetProperty( xb, "loginRequired", > >_loginRequired ); > >- if ( _preventDoubleSubmit ) addSetProperty( xb, > >"preventDoubleSubmit", _preventDoubleSubmit ); > >- if ( _isOverloaded ) addSetProperty( xb, "overloaded", _isOverl= oaded ); > >- if ( _readonly ) addSetProperty( xb, "readonly", _readonly ); > >- if ( _isSimpleAction ) addSetProperty( xb, "simpleAction", > >_isSimpleAction ); > >- if ( _defaultForwardName !=3D null ) addSetProperty( xb, > >"defaultForward", _defaultForwardName ); > >- > >+ element.setAttribute("path", _path); > >+ setElementAttribute(element, "name", _formBeanName); > >+ setElementAttribute(element, "className", getClassName()); > >+ setElementAttribute(element, "type", _type); > >+ setElementAttribute(element, "attribute", _attribute); > >+ setElementAttribute(element, "input", _input); > >+ setElementAttribute(element, "parameter", _parameter); > >+ setElementAttribute(element, "prefix", _prefix); > >+ setElementAttribute(element, "suffix", _suffix); > >+ setElementAttribute(element, "scope", _scope !=3D null ? _scope > >: "request"); > >+ setElementAttribute(element, "roles", _roles); > >+ setElementAttribute(element, "forward", _forward); > >+ setElementAttribute(element, "include", _include); > >+ setElementAttribute(element, "validate", > >Boolean.toString(_validate)); // always set the value, even if false > >+ addSetProperty( xw, element, "unqualifiedActionPath", > >_unqualifiedActionPath ); > >+ addSetProperty( xw, element, "formMember", _formMember ); > >+ addSetProperty( xw, element, "formClass", _formClass ); > >+ addSetProperty( xw, element, "loginRequired", _loginRequired ); > >+ addSetProperty( xw, element, "preventDoubleSubmit", > >_preventDoubleSubmit ); > >+ addSetProperty( xw, element, "overloaded", _isOverloaded ); > >+ addSetProperty( xw, element, "readonly", _readonly ); > >+ addSetProperty( xw, element, "simpleAction", _isSimpleAction ); > >+ addSetProperty( xw, element, "defaultForward", _defaultForwardN= ame ); > >+ addSetProperty( xw, element, "formBeanMessageResourcesKey", > >_formBeanMessageResourcesKey ); > >+ > > if ( _conditionalForwards !=3D null ) > > { > >- addSetProperty( xb, "conditionalForwards", getMapString( > >_conditionalForwards) ); > >- } > >- > >- if ( _formBeanMessageResourcesKey !=3D null ) > >- { > >- addSetProperty( xb, "formBeanMessageResourcesKey", > >_formBeanMessageResourcesKey ); > >+ addSetProperty( xw, element, "conditionalForwards", > >getMapString( _conditionalForwards) ); > > } > >- > >+ > > if ( _exceptionCatches !=3D null && ! _exceptionCatches.isEmpty= () ) > > { > >- ExceptionDocument.Exception[] existingExceptions =3D > >xb.getExceptionArray(); > >- > > for ( int i =3D 0; i < _exceptionCatches.size(); ++i ) > > { > > ExceptionModel ec =3D ( ExceptionModel ) > >_exceptionCatches.get( i ); > >- ExceptionDocument.Exception exceptionToEdit =3D null; > >- > >- for ( int j =3D 0; j < existingExceptions.length; ++j ) > >- { > >- if ( ec.getType().equals( > >existingExceptions[j].getType() ) ) > >- { > >- exceptionToEdit =3D existingExceptions[j]; > >- break; > >- } > >- } > >- > >- if ( exceptionToEdit =3D=3D null ) > >- { > >- exceptionToEdit =3D xb.addNewException(); > >- } > >- > >- ec.writeToXMLBean( exceptionToEdit ); > >+ Element exceptionToEdit =3D findChildElement(xw, > >element, "exception", "type", ec.getType(), true); > >+ ec.writeXML( xw, exceptionToEdit ); > > } > > } > >- > >+ > > // > > // forwards > > // > >- writeForwards( xb.getForwardArray(), xb ); > >- > >- addComment( xb ); > >- } > >- > >- private void addSetProperty( ActionDocument.Action xb, String > >propertyName, boolean propertyValue ) > >- { > >- addSetProperty( xb, propertyName, Boolean.toString( propertyVal= ue ) ); > >+ writeForwards( xw, element ); > > } > >- > >- private void addSetProperty( ActionDocument.Action xb, String > >propertyName, String propertyValue ) > >+ > >+ private void addSetProperty( XmlModelWriter xw, Element element, > >String propertyName, boolean propertyValue ) > > { > >- SetProperty prop =3D xb.addNewSetProperty(); > >- prop.setProperty( propertyName ); > >- prop.setValue( propertyValue ); > >- if ( xb.getClassName() =3D=3D null ) xb.setClassName( > >JPF_ACTION_MAPPING_CLASSNAME ); > >+ if (propertyValue) addSetProperty( xw, element, propertyName, > >Boolean.toString( propertyValue ) ); > > } > >- > >- protected ForwardDocument.Forward addNewForward( XmlObject xmlObjec= t ) > >+ > >+ private void addSetProperty( XmlModelWriter xw, Element element, > >String propertyName, String propertyValue ) > > { > >- return ( ( Action ) xmlObject ).addNewForward(); > >+ setCustomProperty(xw, element, propertyName, propertyValue, > >JPF_ACTION_MAPPING_CLASSNAME); > > } > >- > >+ > > /** > > * Implemented for {@link ExceptionContainer}. > > */ > >@@ -265,16 +201,6 @@ > > this._attribute =3D attribute; > > } > > > >- public String getClassName() > >- { > >- return _className; > >- } > >- > >- public void setClassName( String className ) > >- { > >- this._className =3D className; > >- } > >- > > public String getForward() > > { > > return _forward; > >@@ -309,7 +235,7 @@ > > { > > return _formBeanName; > > } > >- > >+ > > public String getFormBeanName() > > { > > return _formBeanName; > >@@ -344,7 +270,7 @@ > > { > > return _path; > > } > >- > >+ > > public String getPath( boolean useUnqualifiedPath ) > > { > > if ( useUnqualifiedPath && _unqualifiedActionPath !=3D null ) > >@@ -446,7 +372,7 @@ > > { > > _loginRequired =3D loginRequired; > > } > >- > >+ > > public void setPreventDoubleSubmit( boolean preventDoubleSubmit ) > > { > > _preventDoubleSubmit =3D preventDoubleSubmit; > >@@ -501,23 +427,23 @@ > > { > > _readonly =3D readonly; > > } > >- > >+ > > public void addConditionalForward( String expression, String forwar= dName ) > > { > > if ( _conditionalForwards =3D=3D null ) _conditionalForwards = =3D > >new LinkedHashMap(); > > _conditionalForwards.put( expression, forwardName ); > > } > >- > >+ > > private static String getMapString( Map map ) > > { > > StringBuffer retVal =3D new StringBuffer(); > >- > >+ > > for ( Iterator i =3D map.entrySet().iterator(); i.hasNext(); ) > > { > > Map.Entry entry =3D ( Map.Entry ) i.next(); > > retVal.append( entry.getValue() ).append( ':' ).append( > >entry.getKey() ).append( ';' ); > > } > >- > >+ > > return retVal.toString(); > > } > > > >@@ -525,6 +451,6 @@ > > { > > _formBeanMessageResourcesKey =3D formBeanMessageResourcesKey; > > } > >- > >+ > > > > } > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/model/ExceptionModel.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/model/ExceptionModel.java?rev=3D289648&r= 1=3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ExceptionModel.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/ExceptionModel.java > >Fri Sep 16 13:27:57 2005 > >@@ -17,10 +17,8 @@ > > */ > > package org.apache.beehive.netui.compiler.model; > > > >-import org.apache.beehive.netui.compiler.model.schema.struts11.SetPrope= rtyDocument.SetProperty; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.Exceptio= nDocument; > >-import org.apache.beehive.netui.compiler.model.validation.ValidatorCons= tants; > > import org.apache.beehive.netui.compiler.JpfLanguageConstants; > >+import org.w3c.dom.Element; > > > > public class ExceptionModel > > extends StrutsElementSupport > >@@ -36,18 +34,18 @@ > > private boolean _inheritedPath =3D false; > > > > private static final String JPF_EXCEPTION_CONFIG_CLASSNAME =3D > >PAGEFLOW_PACKAGE + ".config.PageFlowExceptionConfig"; > >- > >- > >+ > >+ > > protected ExceptionModel( StrutsApp parentApp ) > > { > > super( parentApp ); > > } > >- > >+ > > public ExceptionModel( String type, String path, String > >handlerMethod, String message, > > String messageKey, StrutsApp parentApp ) > > { > > super( parentApp ); > >- > >+ > > _type =3D type; > > _path =3D path; > > _handlerMethod =3D handlerMethod; > >@@ -115,56 +113,55 @@ > > _handlerClass =3D handlerClass; > > } > > > >- public void writeToXMLBean( ExceptionDocument.Exception xb ) > >- > >+ protected void writeToElement(XmlModelWriter xw, Element element) > > { > >- xb.setType( _type ); > >+ element.setAttribute("type", _type); > > > >- if ( xb.getPath() =3D=3D null && _path !=3D null ) > >+ if ( _path !=3D null ) > > { > > boolean relativeToModule =3D ! _path.startsWith( "/" ); > >- > >+ > > if ( relativeToModule ) > > { > >- xb.setPath( "/" + _path ); // struts wants "/" -- > >assumes this is module-relative path > >+ // struts wants "/" -- assumes this is module-relative = path > >+ setElementAttribute(element, "path", '/' + _path); > > } > > else > > { > >- xb.setPath( _path ); > >- addSetProperty( xb, "isPathContextRelative", "true" ); > >+ setElementAttributeMayBeEmpty(element, "path", _path); > >+ addSetProperty(xw, element, "isPathContextRelative", "t= rue" ); > > } > > } > >- > >- if ( _inheritedPath ) addSetProperty( xb, "inheritedPath", "tru= e" ); > >- > >- if ( xb.getKey() =3D=3D null && _messageKey !=3D null ) xb.setK= ey( > >_messageKey ); > >- > >+ > >+ if ( _inheritedPath ) addSetProperty(xw, element, > >"inheritedPath", "true" ); > >+ > >+ // > >+ // Set the message key. If there isn't one, use the typename > >as the message key. > >+ setElementAttribute(element, "key", _messageKey); > >+ if (_messageKey =3D=3D null) setElementAttribute(element, "key"= , _type); > >+ > > // > > // Struts doesn't support "message" directly -- we'll add > >this as a custom property. > > // > >- if ( _message !=3D null ) addSetProperty( xb, "defaultMessage", > >_message ); > >- > >- if ( xb.getKey() =3D=3D null ) xb.setKey( _type ); > >- > >+ addSetProperty(xw, element, "defaultMessage", _message ); > >+ > > // > > // Note that we're setting the handler *method* as the > >handler. This would break Struts. > > // > >- if ( xb.getHandler() =3D=3D null && _handlerMethod !=3D null && > >_handlerClass =3D=3D null ) > >- { > >- xb.setHandler( _handlerMethod ); > >- addSetProperty( xb, "isHandlerMethod", "true" ); > >+ if ( _handlerMethod !=3D null && _handlerClass =3D=3D null ) { > >+ setElementAttribute(element, "handler", _handlerMethod); > >+ addSetProperty(xw, element, "isHandlerMethod", "true" ); > >+ } > >+ else { > >+ setElementAttribute(element, "handler", _handlerClass); > > } > >- > >- if ( _readonly ) addSetProperty( xb, "readonly", "true" ); > >- if ( xb.getHandler() =3D=3D null && _handlerClass !=3D null ) > >xb.setHandler( _handlerClass ); > >- } > >- > >- private void addSetProperty( ExceptionDocument.Exception xb, > >String propertyName, String propertyValue ) > >- { > >- SetProperty prop =3D xb.addNewSetProperty(); > >- prop.setProperty( propertyName ); > >- prop.setValue( propertyValue ); > >- if ( xb.getClassName() =3D=3D null ) xb.setClassName( > >JPF_EXCEPTION_CONFIG_CLASSNAME ); > >+ > >+ if ( _readonly ) addSetProperty(xw, element, "readonly", "true"= ); > >+ } > >+ > >+ private void addSetProperty( XmlModelWriter xw, Element element, > >String propertyName, String propertyValue ) > >+ { > >+ setCustomProperty(xw, element, propertyName, propertyValue, > >JPF_EXCEPTION_CONFIG_CLASSNAME); > > } > > > > public boolean isReadonly() > > > >Modified: beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui= /compiler/model/FormBeanModel.java > >URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core= /org/apache/beehive/netui/compiler/model/FormBeanModel.java?rev=3D289648&r1= =3D289647&r2=3D289648&view=3Ddiff > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/FormBeanModel.java > >(original) > >+++ beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compi= ler/model/FormBeanModel.java > >Fri Sep 16 13:27:57 2005 > >@@ -21,9 +21,8 @@ > > import java.util.Collection; > > import java.util.List; > > > >-import org.apache.beehive.netui.compiler.model.schema.struts11.FormBean= Document; > >-import org.apache.beehive.netui.compiler.model.schema.struts11.SetPrope= rtyDocument.SetProperty; > > import org.apache.beehive.netui.compiler.JpfLanguageConstants; > >+import org.w3c.dom.Element; > > > > > > /** > >@@ -90,18 +89,17 @@ > > } > > > > > >- private static final String JPF_ACTION_FORM_BEAN_CLASSNAME =3D > >PAGEFLOW_PACKAGE + ".config.PageFlowActionFormBean"; > >+ private static final String CUSTOM_ACTION_FORM_BEAN_CLASSNAME =3D > >PAGEFLOW_PACKAGE + ".config.PageFlowActionFormBean"; > > > > private String _id =3D ""; // NOI18N > >- private String _className =3D null; > > private boolean _dynamic =3D false; > > private String _name =3D null; // required to be set > > private String _type =3D null; // required to be set > >- > >- /** This is a NetUI-specific property. */ > >+ > >+ /** This is a NetUI-specific property. */ > > private String _actualType =3D null; > >- > >- /** This is a NetUI-specific property. */ > >+ > >+ /** This is a NetUI-specific property. */ > > private boolean _pageFlowScoped; // required to be set > > > > private ArrayList _properties =3D new ArrayList(); > >@@ -115,25 +113,21 @@ > > _pageFlowScoped =3D pageFlowScoped; > > } > > > >- public void writeToXMLBean( FormBeanDocument.FormBean xb ) > >+ protected void writeToElement(XmlModelWriter xw, Element element) > > { > >- xb.setName( _name ); > >+ element.setAttribute("name", _name); > > > >- if ( xb.getType() =3D=3D null ) xb.setType( _type ); > >- if ( xb.getId() =3D=3D null && _id !=3D null && _id.length() > = 0 ) > >xb.setId( _id ); > >- if ( xb.getClassName() =3D=3D null &&_className !=3D null ) > >xb.setClassName( _className ); > >- if ( xb.getDynamic() =3D=3D null && _dynamic ) xb.setDynamic( > >FormBeanDocument.FormBean.Dynamic.TRUE ); > >- > >- if ( _actualType !=3D null && ! _actualType.equals( xb.getType(= ) ) ) > >- { > >- SetProperty prop =3D xb.addNewSetProperty(); > >- prop.setProperty( "actualType" ); > >- prop.setValue( _actualType ); > >- if ( xb.getClassName() =3D=3D null ) xb.setClassName( > >JPF_ACTION_FORM_BEAN_CLASSNAME ); > >- } > >+ setElementAttribute(element, "type", _type); > >+ setElementAttribute(element, "id", _id); > >+ setElementAttribute(element, "className", getClassName()); > >+ setElementAttribute(element, "dynamic", _dynamic); > > > >+ if ( _actualType !=3D null && ! > >_actualType.equals(element.getAttribute("type")) ) > >+ { > >+ setCustomProperty(xw, element, "actualType", _actualType, > >CUSTOM_ACTION_FORM_BEAN_CLASSNAME); > >+ } > > } > >- > >+ > > public String getId() > > { > > return _id; > >@@ -144,11 +138,6 @@ > > _id =3D id; > > } > > > >- public String getClassName() > >- { > >- return _className; > >- } > >- > > public void setClassName( String className ) > > { > > if ( className !=3D null ) > >@@ -156,7 +145,7 @@ > > if ("org.apache.struts.action.DynaActionForm".equals( > >className ) ) // NOI18N > > _dynamic =3D true; > > > >- _className =3D className; > >+ setClassName(className); > > } > > } > > > > > > >