Re: [morph-user] Adapting legacy request parameters into new POJO?
Brought to you by:
orangeherbert,
sgarlatm
From: Mick K. <mkn...@ba...> - 2010-04-22 20:51:42
|
But that is what I am wondering about. My assumtion is the framework will do this newBean.setNewName( oldBean.getOldName() ) not: newBean.setNewName( map.get("oldName") ) is that correct, because I think I am in need of #2 --- Thank You… Mick Knutson, President BASE Logic, Inc. Enterprise Architecture, Design, Mentoring & Agile Consulting p. (866) BLiNC-411: (254-6241-1) f. (415) 685-4233 Website: http://www.baselogic.com Blog: http://www.baselogic.com/blog/ Linked IN: http://linkedin.com/in/mickknutson Twitter: http://twitter.com/mickknutson Vacation Rental: http://tahoe.baselogic.com --- On Thu, Apr 22, 2010 at 4:20 PM, Matt Sgarlata < mat...@sp...> wrote: > Hi Mick, > > I can't speak to how Groovy and Spring work, but you are on the right track > using a PropertyNameMappingCopier. I would suggest you first try out using > it in a programmatic way to make sure it does what you are looking for, then > see if you are able to wire it up how you would like with Groovy and Spring. > > Matt > > On Thu, Apr 22, 2010 at 2:17 PM, Mick Knutson <mkn...@ba...>wrote: > >> So looking through this again, I think I can create a copier in Groovy >> Spring DSL: >> >> caeCopier(net.sf.morph.transform.copiers.PropertyNameMatchingCopier){ >> mapping = [ >> "sDummySessionID": "sessionID" >> , "ivrportnum": "ivrPortNumber" >> , "ivrsystem": "ivrSystem" >> , "appname": "applicationName" >> , "dispatchcode": "dispatchCode" >> , "application_sANIID": "aniId" >> , "dnis": "dnis" >> >> ] >> } >> >> >> But What I really need to understand, is this mapping issue: >> >> Servlet.Request (Object) --> CallSession (Object) >> >> so basically what I am looking at is: >> >> *callSession.setAni( request.getParameter("application_sANIID") );* >> >> >> Is this mapping possible? >> >> --- >> Thank You… >> >> Mick Knutson, President >> >> BASE Logic, Inc. >> Enterprise Architecture, Design, Mentoring & Agile Consulting >> p. (866) BLiNC-411: (254-6241-1) >> f. (415) 685-4233 >> >> Website: http://www.baselogic.com >> Blog: http://www.baselogic.com/blog/ >> Linked IN: http://linkedin.com/in/mickknutson >> Twitter: http://twitter.com/mickknutson >> Vacation Rental: http://tahoe.baselogic.com >> --- >> >> >> >> On Mon, Apr 19, 2010 at 10:13 AM, Matt Sgarlata < >> mat...@sp...> wrote: >> >>> Hi Mick, >>> >>> Sorry about that! The new name is SimpleDelegatingTransformer. >>> >>> Matt >>> >>> On Mon, Apr 19, 2010 at 10:08 AM, Mick Knutson <mkn...@ba...>wrote: >>> >>>> I have an interesting issue I am trying to solve in a manageable way. >>>> >>>> I have a few dozen legacy JSP's that I am phasing out. But I have to do >>>> them 1by1. Each page create a POST of ~12 named request parameters that are >>>> ALL named different. VERY frustrating as there is no good convention. >>>> >>>> So, My thought is trying to create a Map for mapping the old names to >>>> the new names for each POST: >>>> Map reqParam = {"newName", "oldName"} >>>> >>>> Where I have a new POJO that has set/getNewName(..) >>>> >>>> >>>> Then, somehow copying from these old request properties from my request >>>> properties Map to the new one's in my new POJO. >>>> >>>> Once Mapped, I have no further use for the old names. >>>> >>>> >>>> *Next Post:* >>>> >>>> Morph seems to have what I think I want, but I have spent the past few >>>> hours trying to get a simple example working, and the docs are wrong. It >>>> referes to many classes that doe not exist in the jar. >>>> >>>> I also can not seem to find any other good examples. Can you point any >>>> out for me? >>>> >>>> >>>> Specifically, this is missing: >>>> >>>> >>>> <!-- the overall transformer we'll use to do the graph copy --> >>>> <bean >>>> id="graphTransformer" >>>> class="net.sf.morph.transform.DelegatingCopier"> >>>> <property name="components"> >>>> <list> >>>> <ref bean="personCopier"/> >>>> <ref bean="vehicleCopier"/> >>>> <ref bean="childrenCopier"/> >>>> <ref bean="addressConverter"/> >>>> </list> >>>> </property> >>>> </bean> >>>> >>>> *MISSING from the code: net.sf.morph.transform.DelegatingCopier* >>>> >>>> >>>> >>>> --- >>>> Thank You… >>>> >>>> Mick Knutson, President >>>> >>>> BASE Logic, Inc. >>>> Enterprise Architecture, Design, Mentoring & Agile Consulting >>>> p. (866) BLiNC-411: (254-6241-1) >>>> f. (415) 685-4233 >>>> >>>> Website: http://www.baselogic.com >>>> Blog: http://www.baselogic.com/blog/ >>>> Linked IN: http://linkedin.com/in/mickknutson >>>> Twitter: http://twitter.com/mickknutson >>>> Vacation Rental: http://tahoe.baselogic.com >>>> --- >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download Intel® Parallel Studio Eval >>>> Try the new software tools for yourself. Speed compiling, find bugs >>>> proactively, and fine-tune applications for parallel performance. >>>> See why Intel Parallel Studio got high marks during beta. >>>> http://p.sf.net/sfu/intel-sw-dev >>>> _______________________________________________ >>>> morph-user mailing list >>>> mor...@li... >>>> https://lists.sourceforge.net/lists/listinfo/morph-user >>>> >>>> >>> >>> >>> -- >>> Matthew Sgarlata >>> Executive Vice President, Software Development >>> Vicepresidente Ejecutivo de Desarrollo de Software >>> 202-210-7102 (phone/teléfono) >>> 651-286-2806 (fax) >>> >>> This message is intended only for the named recipient. If you are not the >>> intended recipient, you are notified that disclosing, copying, distributing, >>> or taking any action in reliance on the contents of this information is >>> strictly prohibited. >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> morph-user mailing list >>> mor...@li... >>> https://lists.sourceforge.net/lists/listinfo/morph-user >>> >>> >> >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> morph-user mailing list >> mor...@li... >> https://lists.sourceforge.net/lists/listinfo/morph-user >> >> > > > -- > Matthew Sgarlata > Executive Vice President, Software Development > Vicepresidente Ejecutivo de Desarrollo de Software > 202-210-7102 (phone/teléfono) > 651-286-2806 (fax) > > This message is intended only for the named recipient. If you are not the > intended recipient, you are notified that disclosing, copying, distributing, > or taking any action in reliance on the contents of this information is > strictly prohibited. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > morph-user mailing list > mor...@li... > https://lists.sourceforge.net/lists/listinfo/morph-user > > |