From: Walter M. <wal...@us...> - 2008-07-26 12:10:41
|
User: walterim Date: 08/07/26 05:10:50 Modified: andromda-jsf2/src/main/resources/META-INF/andromda metafacades.xml namespace.xml andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud Controller.java.vsl andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2 JSFGlobals.java andromda-jsf2/src/main/uml JSFMetafacadeModel.xml.zip andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFManageableEntityLogicImpl.java andromda-jsf2/src/main/resources/templates/jsf2/flow/crud ViewPopulator.java.vsl Log: Get rid off the manageableActionFormKey, since it looks not needed and was leading to errors in jsf messages forwarding. Revision Changes Path 1.6 +0 -1 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- metafacades.xml 10 Jul 2008 14:59:51 -0000 1.5 +++ metafacades.xml 26 Jul 2008 12:10:48 -0000 1.6 @@ -135,7 +135,6 @@ <stereotype>MANAGEABLE</stereotype> </mapping> <property reference="crudValueObjectSuffix"/> - <property reference="manageableActionFormKey"/> <property reference="defaultTableExportTypes"/> <property reference="viewPopulatorPattern"/> </metafacade> 1.13 +0 -8 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- namespace.xml 10 Jul 2008 14:59:51 -0000 1.12 +++ namespace.xml 26 Jul 2008 12:10:48 -0000 1.13 @@ -80,14 +80,6 @@ The suffix to append to the names of generated value objects used in CRUD (manageable entities). </documentation> </property> - <property name="manageableActionFormKey"> - <default>manageableForm</default> - <documentation> - The name of the key under which each manageable action form is stored. This - form is passed along from action to action in order to transfer - all parameters. - </documentation> - </property> </propertyGroup> <propertyGroup name="Configuration"> <documentation> 1.18 +31 -11 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/Controller.java.vsl Index: Controller.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/Controller.java.vsl,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- Controller.java.vsl 21 Jul 2008 22:35:56 -0000 1.17 +++ Controller.java.vsl 26 Jul 2008 12:10:48 -0000 1.18 @@ -14,7 +14,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doInit(form); } @@ -77,7 +77,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doLoad(${idParamClass}.valueOf(((javax.faces.component.UIParameter)event.getComponent().findComponent("${manageable.manageableIdentifier.name}")).getValue().toString()),form); } @@ -122,7 +122,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doCancel(form); } @@ -157,7 +157,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doStartNew(form); } @@ -245,7 +245,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doSave(form); } @@ -319,7 +319,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doSave(form); this.doStartNew(form); @@ -351,7 +351,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doSearch(form); } @@ -440,7 +440,7 @@ try { - contextWrapper.getCurrentInstance().getPageFlowScope().put("${manageable.formKey}", form); + contextWrapper.getCurrentInstance().getPageFlowScope().put("${actionFormKey}", form); this.doDelete(${idParamClass}.valueOf(((javax.faces.component.UIParameter)event.getComponent().findComponent("${manageable.manageableIdentifier.name}")).getValue().toString()),form); } @@ -600,8 +600,28 @@ */ protected java.lang.Object resolveVariable(final String name) { + org.apache.myfaces.trinidad.context.RequestContext adfContext = org.apache.myfaces.trinidad.context.RequestContext.getCurrentInstance(); + Object variable = adfContext.getPageFlowScope().get(name); + // - if we couldn't get the variable from the regular ADF context, see if + // the session contains an ADF context with the variable + if (variable == null) + { + final javax.servlet.http.HttpSession session = this.getSession(false); + if (session != null) + { + final org.trinityssm.webapp.AdfFacesContextWrapper contextWrapper = + (org.trinityssm.webapp.AdfFacesContextWrapper)session.getAttribute("AndroMDAADFContext"); + adfContext = contextWrapper != null ? contextWrapper.getCurrentInstance() : null; + } + variable = adfContext != null ? adfContext.getPageFlowScope().get(name) : null; + } + // - finally try resolving it in the standard JSF manner + if (variable == null) + { final javax.faces.context.FacesContext context = this.getContext(); - return context.getApplication().getVariableResolver().resolveVariable(context, name); + variable = context != null ? context.getApplication().getVariableResolver().resolveVariable(context, name) : null; + } + return variable; } /** @@ -677,7 +697,7 @@ { final javax.faces.application.FacesMessage facesMessage = new javax.faces.application.FacesMessage(severity, message, message); final org.apache.myfaces.trinidad.context.RequestContext adfContext = org.apache.myfaces.trinidad.context.RequestContext.getCurrentInstance(); - final Object form = adfContext.getPageFlowScope().get("$actionFormKey"); + final Object form = adfContext.getPageFlowScope().get("${actionFormKey}"); if (form != null) { try 1.6 +0 -5 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/JSFGlobals.java Index: JSFGlobals.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/JSFGlobals.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- JSFGlobals.java 10 Jul 2008 14:59:52 -0000 1.5 +++ JSFGlobals.java 26 Jul 2008 12:10:49 -0000 1.6 @@ -14,11 +14,6 @@ public static final String CRUD_VALUE_OBJECT_SUFFIX = "crudValueObjectSuffix"; /** - * The default key under which the manageable action form is stored. - */ - public static final String CRUD_ACTION_FORM_KEY = "manageableActionFormKey"; - - /** * A space-separated list of types to which displaytag table are to be exported by default. */ public static final String PROPERTY_DEFAULT_TABLE_EXPORT_TYPES = "defaultTableExportTypes"; 1.16 +190 -184 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip <<Binary file>> 1.9 +0 -10 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFManageableEntityLogicImpl.java Index: JSFManageableEntityLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFManageableEntityLogicImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- JSFManageableEntityLogicImpl.java 10 Jul 2008 14:59:52 -0000 1.8 +++ JSFManageableEntityLogicImpl.java 26 Jul 2008 12:10:50 -0000 1.9 @@ -368,16 +368,6 @@ } /** - * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity#getFormKey() - */ - protected java.lang.String handleGetFormKey() - { - final Object formKeyValue = this.findTaggedValue(JSFProfile.TAGGEDVALUE_ACTION_FORM_KEY); - return formKeyValue == null ? ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.CRUD_ACTION_FORM_KEY)) - : String.valueOf(formKeyValue); - } - - /** * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity#getViewFullPath() */ protected java.lang.String handleGetViewFullPath() 1.5 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/crud/ViewPopulator.java.vsl Index: ViewPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/crud/ViewPopulator.java.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- ViewPopulator.java.vsl 8 Apr 2008 16:29:07 -0000 1.4 +++ ViewPopulator.java.vsl 26 Jul 2008 12:10:50 -0000 1.5 @@ -68,7 +68,7 @@ org.apache.myfaces.trinidad.context.RequestContext adfContext = org.apache.myfaces.trinidad.context.RequestContext.getCurrentInstance(); final javax.faces.el.VariableResolver variableResolver = facesContext.getApplication().getVariableResolver(); - form = adfContext.getPageFlowScope().get("$manageable.formKey"); + form = adfContext.getPageFlowScope().get("$actionFormKey"); #if ($formSerialization) final javax.servlet.http.HttpSession session = ((javax.servlet.http.HttpServletRequest)request).getSession(); |