From: Chad B. <cwb...@us...> - 2006-08-30 18:04:46
|
User: cwbrandon Date: 06/08/30 11:04:46 Modified: andromda-jsf/src/META-INF/andromda Tag: V3_x_HEAD cartridge.xml andromda-jsf/src/templates/jsf/flow Tag: V3_x_HEAD ActionForward.java.vsl andromda-jsf/src/test/expected Tag: V3_x_HEAD cartridge-output.zip Added: andromda-jsf/src/templates/jsf/utils Tag: V3_x_HEAD FacesContextUtils.java.vsl Log: cleanup some duplicate code by using a utilitymethod Revision Changes Path No revision No revision 1.22.4.38 +6 -0 cartridges/andromda-jsf/src/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-jsf/src/META-INF/andromda/cartridge.xml,v retrieving revision 1.22.4.37 retrieving revision 1.22.4.38 diff -u -w -r1.22.4.37 -r1.22.4.38 --- cartridge.xml 17 Aug 2006 22:24:20 -0000 1.22.4.37 +++ cartridge.xml 30 Aug 2006 18:04:41 -0000 1.22.4.38 @@ -446,6 +446,12 @@ overwrite="true"/> <template + path="templates/jsf/utils/FacesContextUtils.java.vsl" + outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" + outlet="managed-beans" + overwrite="true"/> + + <template path="templates/jsf/exception/PatternMatchingExceptionHandler.java.vsl" outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${patternMatchingExceptionHandler}.java" outlet="managed-beans" No revision No revision 1.3.4.4 +7 -16 cartridges/andromda-jsf/src/templates/jsf/flow/ActionForward.java.vsl Index: ActionForward.java.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-jsf/src/templates/jsf/flow/ActionForward.java.vsl,v retrieving revision 1.3.4.3 retrieving revision 1.3.4.4 diff -u -w -r1.3.4.3 -r1.3.4.4 --- ActionForward.java.vsl 31 May 2006 19:08:37 -0000 1.3.4.3 +++ ActionForward.java.vsl 30 Aug 2006 18:04:41 -0000 1.3.4.4 @@ -31,24 +31,15 @@ final HttpServletResponse response) throws ServletException, IOException { - // - we need to retrieve the faces context differently since we're outside of the - // faces servlet - final LifecycleFactory lifecycleFactory = - (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); - final Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); - final FacesContextFactory facesContextFactory = - (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); - final FacesContext facesContext = - facesContextFactory.getFacesContext( - this.getServletContext(), - request, - response, - lifecycle); - final javax.faces.el.VariableResolver variableResolver = facesContext.getApplication().getVariableResolver(); + // - we need to resolve the controller differently since we're outside of the faces servlet +#set ($facesContextUtilsFullyQualifiedName = "FacesContextUtils") +#if ($stringUtils.isNotBlank($managedBeansPackage)) +#set($facesContextUtilsFullyQualifiedName = "${managedBeansPackage}.${facesContextUtilsFullyQualifiedName}") +#end #set ($controller = $action.controller) $controller.fullyQualifiedName controller = - ($controller.fullyQualifiedName)variableResolver.resolveVariable( - facesContext, + ($controller.fullyQualifiedName)${facesContextUtilsFullyQualifiedName}.resolveVariable( + this.getServletContext(), request, response, "$controller.beanName"); #if ($action.useCase) #set ($useCase = $action.useCase) No revision No revision 1.2.2.81 +425 -497 cartridges/andromda-jsf/src/test/expected/cartridge-output.zip <<Binary file>> No revision No revision 1.1.2.1 +87 -0 cartridges/andromda-jsf/src/templates/jsf/utils/Attic/FacesContextUtils.java.vsl |