morph-user Mailing List for Morph
Brought to you by:
orangeherbert,
sgarlatm
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(4) |
Feb
(12) |
Mar
(11) |
Apr
(6) |
May
|
Jun
(6) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(17) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: reference.me <em...@re...> - 2011-10-26 17:35:13
|
Hi Morph user list, Matt Benson has started following you on reference.me! Wondering who else is following you? click here. Tired of hearing from us? Click here to <% unsubscribe %> |
|
From: Matthew S. <mat...@gm...> - 2011-04-08 18:42:31
|
Hi everyone, The server hosting provider that was hosting the Morph repository went out of business suddenly, so the Morph repository is temporarily unavailable. Fortunately, no data was lost. I will work on getting the repository back online next week. Matt |
|
From: Matt B. <gud...@gm...> - 2010-06-01 18:34:17
|
Mick, I don't recall where you were having trouble precisely. The
dead-simplest scenario here would be that all the properties of your
value object are Strings, in which case you should basically be
looking at populating a String-to-String map of property names e.g.
"callId":"callSessionId", and setting that as the "mapping" property
of a PropertyNameMatchingCopier, whose copy method you can call to do
the copy for you.
-Matt
On 6/1/10, Mick Knutson <mkn...@ba...> wrote:
> I still have an issue where I can not get a simple example working:
>
> Map converted -> Value Object
>
> I have a Map of Servlet POST parameters that are mapped to setters on a
> Value Object
>
> IE:
> valueObject.set*CallId*( map.get("*callSessionId*" ) ;
>
> I want to use Spring as well.
> Is there anyone that has working CODE that I can use to kick start this
> effort?
>
>
> ---
> 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
> ---
>
|
|
From: Mick K. <mkn...@ba...> - 2010-06-01 12:54:10
|
I still have an issue where I can not get a simple example working:
Map converted -> Value Object
I have a Map of Servlet POST parameters that are mapped to setters on a
Value Object
IE:
valueObject.set*CallId*( map.get("*callSessionId*" ) ;
I want to use Spring as well.
Is there anyone that has working CODE that I can use to kick start this
effort?
---
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
---
|
|
From: Matt S. <mat...@sp...> - 2010-04-26 20:08:11
|
Hi Mitch,
Try true instead of false. Hopefully that will do the trick.
Matt
On Mon, Apr 26, 2010 at 2:13 PM, Mick Knutson <mkn...@ba...>wrote:
> I even tried:
>
> simpleDelegatingTransformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer,
> ref("caeCopier"), false){
> components = [ref("caeCopier")]
> }
>
> But still the same error
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> morph-user mailing list
> mor...@li...
> https://lists.sourceforge.net/lists/listinfo/morph-user
>
>
|
|
From: Mick K. <mkn...@ba...> - 2010-04-26 18:40:35
|
I even tried:
simpleDelegatingTransformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer,
ref("caeCopier"), false){
components = [ref("caeCopier")]
}
But still the same error
|
|
From: Mick K. <mkn...@ba...> - 2010-04-26 17:48:12
|
I tried just my Copier but still get: Could not find a transformer that can transform objects of null to objects of (class java.lang.String) net.sf.morph.transform.TransformationException: Could not find a transformer that can transform objects of null to objects of (class java.lang.String) at net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:523) at net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:435) at net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:472) at net.sf.morph.transform.transformers.SimpleDelegatingTransformer.convertImpl(SimpleDelegatingTransformer.java:293) at net.sf.morph.transform.transformers.BaseTransformer.convert(BaseTransformer.java:368) at net.sf.morph.util.TransformerUtils.transform(TransformerUtils.java:168) at net.sf.morph.transform.copiers.BasePropertyNameCopier.copyProperty(BasePropertyNameCopier.java:160) at net.sf.morph.transform.copiers.PropertyNameMappingCopier.copyImpl(PropertyNameMappingCopier.java:138) at net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504) at net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:470) at com.comcast.uivr.divr.routing.CallTransferController.convertCallSession(CallTransferController.groovy:603) at com.comcast.uivr.divr.routing.CallTransferController$convertCallSession.call(Unknown Source) at com.comcast.uivr.divr.routing.CallTransferControllerTests.testSmokeTestCallSessionValueAssignment(CallTransferControllerTests.groovy:21) at junit.framework.Test$run.call(Unknown Source) at junit.framework.Test$run.call(Unknown Source) * * * * --- 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 26, 2010 at 8:49 AM, Matt Sgarlata < mat...@sp...> wrote: > Hi Mick, > > The SimpleDelegatingTransformer is used to group several transformers > together so that any type of transformation can be accomplished. In your > case, it looks like you are just trying to map the properties of one object > to another object, so you could probably use the PropertyNameMappingCopier > directly with no SimpleDelegatingTransformer. > > If for some reason that does not work for you (e.g. you need to also change > property types, not just property names), then the > SimpleDelegatingTransformer is the way to go. However, you need to include > all the default transformations along with the transformation you > specified. So take a look at SimpleDelegatingTransformer's default > components, and add those to your definition of the transformer. Put all > the standard transformers after your custom transformer. > > Matt > > On Sun, Apr 25, 2010 at 12:56 PM, Mick Knutson <mkn...@ba...>wrote: > >> I am closer. >> >> I have only one error: >> >> Could not find a transformer that can transform objects of null to objects >> of (class java.lang.String) >> >> net.sf.morph.transform.TransformationException: Could not find a >> transformer that can transform objects of null to objects of (class >> java.lang.String) >> at >> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:523) >> at >> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:435) >> at >> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:472) >> at >> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.convertImpl(SimpleDelegatingTransformer.java:293) >> at >> net.sf.morph.transform.transformers.BaseTransformer.convert(BaseTransformer.java:368) >> at net.sf.morph.util.TransformerUtils.transform(TransformerUtils.java:168) >> at >> net.sf.morph.transform.copiers.BasePropertyNameCopier.copyProperty(BasePropertyNameCopier.java:160) >> at >> net.sf.morph.transform.copiers.PropertyNameMappingCopier.copyImpl(PropertyNameMappingCopier.java:138) >> at >> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504) >> at >> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.copyImpl(SimpleDelegatingTransformer.java:276) >> at >> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504) >> at >> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:470) >> at >> com.comcast.uivr.divr.routing.CallTransferController.convertCallSession(CallTransferController.groovy:617) >> at >> com.comcast.uivr.divr.routing.CallTransferController$convertCallSession.call(Unknown >> Source) >> at >> com.comcast.uivr.divr.routing.CallTransferControllerTests.testSmokeTestCallSessionValueAssignment(CallTransferControllerTests.groovy:22) >> at junit.framework.Test$run.call(Unknown Source) >> at junit.framework.Test$run.call(Unknown Source) >> >> >> *Here is what is working thus:* >> >> /** >> * These are the Morph Beans for the JSP Adapters >> */ >> caeCopier(net.sf.morph.transform.copiers.PropertyNameMappingCopier, >> false){ >> mapping = [ >> "sDummySessionID": "sessionID" >> , "ivrportnum": "ivrPortNumber" >> , "ivrsystem": "ivrSystem" >> , "appname": "applicationName" >> , "dispatchcode": "dispatchCode" >> , "ani": "ani" >> , "application_sANIID": "aniId" >> , "dnis": "dnis" >> , "division": "division" >> , "region": "region" >> , "callid": "callID" >> , "globalzero": "globalZero" >> , "bContinueFromAuto": "continueFromAuto" >> , "CAE_Att_Soft_Disco": "isSoftDisco" >> //, "g_bIsSoftDisco": "isSoftDisco" >> , "CAE_Att_Delinquent": "isDelinquent" >> //, "g_bIsDelinquent": "isDelinquent" >> //, "CAELanguage": language >> , "application.Language": "language" >> , "np": "nextPage" >> , "fform": "firstForm" >> , "sAccountNumber": "accountNumber" >> //, "application.AccountNumber": accountNumber >> , "application.sPhoneID": "phoneID" >> , "sDefaultRoutingString": "defaultRoutingString" >> , "CAEFunction": "transferFunction" >> , "CAETransferReason": "transferReason" >> , "callType": "callType" >> , "CAELOB": "lob" >> , "CAE_Att_VIP": "vip" >> , "CAE_Att_SameDayAppointment": "isSameDayAppointment" >> , "ucid": "ucid" >> ] >> >> nestedTransformer = ref("transformer") >> } >> >> transformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer){ >> components = [ref("caeCopier")] >> } >> >> >> --- >> 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:56 PM, Matt Sgarlata < >> mat...@sp...> wrote: >> >>> Hello again Mick, >>> >>> If there is a Reflector for the bean you are trying to read from, the >>> properties will be read as expected. HttpServletRequests have a standard >>> reflector that is included by Morph by default. Maps also have reflectors >>> so their contents are read rather than looking at the Map's bean properties >>> using Java reflection. I'm not clear if your request and session are >>> Servlet requests and sessions or some other type of requests and sessions. >>> If they are from the Servlet spec you are in good shape. If they are from >>> some other API, you may need to write a custom reflector. >>> >>> You can look at SimpleDelegatingReflector.createDefaultComponents() to >>> see what special type of reflectors are included with Morph, beyond simple >>> Java reflection. >>> >>> Does that answer your question? >>> >>> Matt >>> >>> On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson <mkn...@ba...>wrote: >>> >>>> 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 >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> 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 > > |
|
From: Matt B. <gud...@gm...> - 2010-04-26 13:14:36
|
Don't forget that in newer iterations of Morph,
SimpleDelegatingTransformer has a constructor that takes a second
boolean argument which, when true, will append the default
transformers after the specified custom transformers.
On 4/26/10, Matt Sgarlata <mat...@sp...> wrote:
> Hi Mick,
>
> The SimpleDelegatingTransformer is used to group several transformers
> together so that any type of transformation can be accomplished. In your
> case, it looks like you are just trying to map the properties of one object
> to another object, so you could probably use the PropertyNameMappingCopier
> directly with no SimpleDelegatingTransformer.
>
> If for some reason that does not work for you (e.g. you need to also change
> property types, not just property names), then the
> SimpleDelegatingTransformer is the way to go. However, you need to include
> all the default transformations along with the transformation you
> specified. So take a look at SimpleDelegatingTransformer's default
> components, and add those to your definition of the transformer. Put all
> the standard transformers after your custom transformer.
>
> Matt
>
> On Sun, Apr 25, 2010 at 12:56 PM, Mick Knutson
> <mkn...@ba...>wrote:
>
>> I am closer.
>>
>> I have only one error:
>>
>> Could not find a transformer that can transform objects of null to objects
>> of (class java.lang.String)
>>
>> net.sf.morph.transform.TransformationException: Could not find a
>> transformer that can transform objects of null to objects of (class
>> java.lang.String)
>> at
>> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:523)
>> at
>> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:435)
>> at
>> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:472)
>> at
>> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.convertImpl(SimpleDelegatingTransformer.java:293)
>> at
>> net.sf.morph.transform.transformers.BaseTransformer.convert(BaseTransformer.java:368)
>> at net.sf.morph.util.TransformerUtils.transform(TransformerUtils.java:168)
>> at
>> net.sf.morph.transform.copiers.BasePropertyNameCopier.copyProperty(BasePropertyNameCopier.java:160)
>> at
>> net.sf.morph.transform.copiers.PropertyNameMappingCopier.copyImpl(PropertyNameMappingCopier.java:138)
>> at
>> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
>> at
>> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.copyImpl(SimpleDelegatingTransformer.java:276)
>> at
>> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
>> at
>> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:470)
>> at
>> com.comcast.uivr.divr.routing.CallTransferController.convertCallSession(CallTransferController.groovy:617)
>> at
>> com.comcast.uivr.divr.routing.CallTransferController$convertCallSession.call(Unknown
>> Source)
>> at
>> com.comcast.uivr.divr.routing.CallTransferControllerTests.testSmokeTestCallSessionValueAssignment(CallTransferControllerTests.groovy:22)
>> at junit.framework.Test$run.call(Unknown Source)
>> at junit.framework.Test$run.call(Unknown Source)
>>
>>
>> *Here is what is working thus:*
>>
>> /**
>> * These are the Morph Beans for the JSP Adapters
>> */
>> caeCopier(net.sf.morph.transform.copiers.PropertyNameMappingCopier,
>> false){
>> mapping = [
>> "sDummySessionID": "sessionID"
>> , "ivrportnum": "ivrPortNumber"
>> , "ivrsystem": "ivrSystem"
>> , "appname": "applicationName"
>> , "dispatchcode": "dispatchCode"
>> , "ani": "ani"
>> , "application_sANIID": "aniId"
>> , "dnis": "dnis"
>> , "division": "division"
>> , "region": "region"
>> , "callid": "callID"
>> , "globalzero": "globalZero"
>> , "bContinueFromAuto": "continueFromAuto"
>> , "CAE_Att_Soft_Disco": "isSoftDisco"
>> //, "g_bIsSoftDisco": "isSoftDisco"
>> , "CAE_Att_Delinquent": "isDelinquent"
>> //, "g_bIsDelinquent": "isDelinquent"
>> //, "CAELanguage": language
>> , "application.Language": "language"
>> , "np": "nextPage"
>> , "fform": "firstForm"
>> , "sAccountNumber": "accountNumber"
>> //, "application.AccountNumber": accountNumber
>> , "application.sPhoneID": "phoneID"
>> , "sDefaultRoutingString": "defaultRoutingString"
>> , "CAEFunction": "transferFunction"
>> , "CAETransferReason": "transferReason"
>> , "callType": "callType"
>> , "CAELOB": "lob"
>> , "CAE_Att_VIP": "vip"
>> , "CAE_Att_SameDayAppointment": "isSameDayAppointment"
>> , "ucid": "ucid"
>> ]
>>
>> nestedTransformer = ref("transformer")
>> }
>>
>>
>> transformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer){
>> components = [ref("caeCopier")]
>> }
>>
>>
>> ---
>> 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:56 PM, Matt Sgarlata <
>> mat...@sp...> wrote:
>>
>>> Hello again Mick,
>>>
>>> If there is a Reflector for the bean you are trying to read from, the
>>> properties will be read as expected. HttpServletRequests have a standard
>>> reflector that is included by Morph by default. Maps also have
>>> reflectors
>>> so their contents are read rather than looking at the Map's bean
>>> properties
>>> using Java reflection. I'm not clear if your request and session are
>>> Servlet requests and sessions or some other type of requests and
>>> sessions.
>>> If they are from the Servlet spec you are in good shape. If they are
>>> from
>>> some other API, you may need to write a custom reflector.
>>>
>>> You can look at SimpleDelegatingReflector.createDefaultComponents() to
>>> see
>>> what special type of reflectors are included with Morph, beyond simple
>>> Java
>>> reflection.
>>>
>>> Does that answer your question?
>>>
>>> Matt
>>>
>>> On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson
>>> <mkn...@ba...>wrote:
>>>
>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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.
>
|
|
From: Matt S. <mat...@sp...> - 2010-04-26 12:49:16
|
Hi Mick,
The SimpleDelegatingTransformer is used to group several transformers
together so that any type of transformation can be accomplished. In your
case, it looks like you are just trying to map the properties of one object
to another object, so you could probably use the PropertyNameMappingCopier
directly with no SimpleDelegatingTransformer.
If for some reason that does not work for you (e.g. you need to also change
property types, not just property names), then the
SimpleDelegatingTransformer is the way to go. However, you need to include
all the default transformations along with the transformation you
specified. So take a look at SimpleDelegatingTransformer's default
components, and add those to your definition of the transformer. Put all
the standard transformers after your custom transformer.
Matt
On Sun, Apr 25, 2010 at 12:56 PM, Mick Knutson <mkn...@ba...>wrote:
> I am closer.
>
> I have only one error:
>
> Could not find a transformer that can transform objects of null to objects
> of (class java.lang.String)
>
> net.sf.morph.transform.TransformationException: Could not find a
> transformer that can transform objects of null to objects of (class
> java.lang.String)
> at
> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:523)
> at
> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:435)
> at
> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:472)
> at
> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.convertImpl(SimpleDelegatingTransformer.java:293)
> at
> net.sf.morph.transform.transformers.BaseTransformer.convert(BaseTransformer.java:368)
> at net.sf.morph.util.TransformerUtils.transform(TransformerUtils.java:168)
> at
> net.sf.morph.transform.copiers.BasePropertyNameCopier.copyProperty(BasePropertyNameCopier.java:160)
> at
> net.sf.morph.transform.copiers.PropertyNameMappingCopier.copyImpl(PropertyNameMappingCopier.java:138)
> at
> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
> at
> net.sf.morph.transform.transformers.SimpleDelegatingTransformer.copyImpl(SimpleDelegatingTransformer.java:276)
> at
> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
> at
> net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:470)
> at
> com.comcast.uivr.divr.routing.CallTransferController.convertCallSession(CallTransferController.groovy:617)
> at
> com.comcast.uivr.divr.routing.CallTransferController$convertCallSession.call(Unknown
> Source)
> at
> com.comcast.uivr.divr.routing.CallTransferControllerTests.testSmokeTestCallSessionValueAssignment(CallTransferControllerTests.groovy:22)
> at junit.framework.Test$run.call(Unknown Source)
> at junit.framework.Test$run.call(Unknown Source)
>
>
> *Here is what is working thus:*
>
> /**
> * These are the Morph Beans for the JSP Adapters
> */
> caeCopier(net.sf.morph.transform.copiers.PropertyNameMappingCopier,
> false){
> mapping = [
> "sDummySessionID": "sessionID"
> , "ivrportnum": "ivrPortNumber"
> , "ivrsystem": "ivrSystem"
> , "appname": "applicationName"
> , "dispatchcode": "dispatchCode"
> , "ani": "ani"
> , "application_sANIID": "aniId"
> , "dnis": "dnis"
> , "division": "division"
> , "region": "region"
> , "callid": "callID"
> , "globalzero": "globalZero"
> , "bContinueFromAuto": "continueFromAuto"
> , "CAE_Att_Soft_Disco": "isSoftDisco"
> //, "g_bIsSoftDisco": "isSoftDisco"
> , "CAE_Att_Delinquent": "isDelinquent"
> //, "g_bIsDelinquent": "isDelinquent"
> //, "CAELanguage": language
> , "application.Language": "language"
> , "np": "nextPage"
> , "fform": "firstForm"
> , "sAccountNumber": "accountNumber"
> //, "application.AccountNumber": accountNumber
> , "application.sPhoneID": "phoneID"
> , "sDefaultRoutingString": "defaultRoutingString"
> , "CAEFunction": "transferFunction"
> , "CAETransferReason": "transferReason"
> , "callType": "callType"
> , "CAELOB": "lob"
> , "CAE_Att_VIP": "vip"
> , "CAE_Att_SameDayAppointment": "isSameDayAppointment"
> , "ucid": "ucid"
> ]
>
> nestedTransformer = ref("transformer")
> }
>
> transformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer){
> components = [ref("caeCopier")]
> }
>
>
> ---
> 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:56 PM, Matt Sgarlata <
> mat...@sp...> wrote:
>
>> Hello again Mick,
>>
>> If there is a Reflector for the bean you are trying to read from, the
>> properties will be read as expected. HttpServletRequests have a standard
>> reflector that is included by Morph by default. Maps also have reflectors
>> so their contents are read rather than looking at the Map's bean properties
>> using Java reflection. I'm not clear if your request and session are
>> Servlet requests and sessions or some other type of requests and sessions.
>> If they are from the Servlet spec you are in good shape. If they are from
>> some other API, you may need to write a custom reflector.
>>
>> You can look at SimpleDelegatingReflector.createDefaultComponents() to see
>> what special type of reflectors are included with Morph, beyond simple Java
>> reflection.
>>
>> Does that answer your question?
>>
>> Matt
>>
>> On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson <mkn...@ba...>wrote:
>>
>>> 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
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> 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.
|
|
From: Mick K. <mkn...@ba...> - 2010-04-25 16:56:33
|
I am closer.
I have only one error:
Could not find a transformer that can transform objects of null to objects
of (class java.lang.String)
net.sf.morph.transform.TransformationException: Could not find a transformer
that can transform objects of null to objects of (class java.lang.String)
at
net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:523)
at
net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:435)
at
net.sf.morph.transform.transformers.SimpleDelegatingTransformer.getTransformer(SimpleDelegatingTransformer.java:472)
at
net.sf.morph.transform.transformers.SimpleDelegatingTransformer.convertImpl(SimpleDelegatingTransformer.java:293)
at
net.sf.morph.transform.transformers.BaseTransformer.convert(BaseTransformer.java:368)
at net.sf.morph.util.TransformerUtils.transform(TransformerUtils.java:168)
at
net.sf.morph.transform.copiers.BasePropertyNameCopier.copyProperty(BasePropertyNameCopier.java:160)
at
net.sf.morph.transform.copiers.PropertyNameMappingCopier.copyImpl(PropertyNameMappingCopier.java:138)
at
net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
at
net.sf.morph.transform.transformers.SimpleDelegatingTransformer.copyImpl(SimpleDelegatingTransformer.java:276)
at
net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:504)
at
net.sf.morph.transform.transformers.BaseTransformer.copy(BaseTransformer.java:470)
at
com.comcast.uivr.divr.routing.CallTransferController.convertCallSession(CallTransferController.groovy:617)
at
com.comcast.uivr.divr.routing.CallTransferController$convertCallSession.call(Unknown
Source)
at
com.comcast.uivr.divr.routing.CallTransferControllerTests.testSmokeTestCallSessionValueAssignment(CallTransferControllerTests.groovy:22)
at junit.framework.Test$run.call(Unknown Source)
at junit.framework.Test$run.call(Unknown Source)
*Here is what is working thus:*
/**
* These are the Morph Beans for the JSP Adapters
*/
caeCopier(net.sf.morph.transform.copiers.PropertyNameMappingCopier,
false){
mapping = [
"sDummySessionID": "sessionID"
, "ivrportnum": "ivrPortNumber"
, "ivrsystem": "ivrSystem"
, "appname": "applicationName"
, "dispatchcode": "dispatchCode"
, "ani": "ani"
, "application_sANIID": "aniId"
, "dnis": "dnis"
, "division": "division"
, "region": "region"
, "callid": "callID"
, "globalzero": "globalZero"
, "bContinueFromAuto": "continueFromAuto"
, "CAE_Att_Soft_Disco": "isSoftDisco"
//, "g_bIsSoftDisco": "isSoftDisco"
, "CAE_Att_Delinquent": "isDelinquent"
//, "g_bIsDelinquent": "isDelinquent"
//, "CAELanguage": language
, "application.Language": "language"
, "np": "nextPage"
, "fform": "firstForm"
, "sAccountNumber": "accountNumber"
//, "application.AccountNumber": accountNumber
, "application.sPhoneID": "phoneID"
, "sDefaultRoutingString": "defaultRoutingString"
, "CAEFunction": "transferFunction"
, "CAETransferReason": "transferReason"
, "callType": "callType"
, "CAELOB": "lob"
, "CAE_Att_VIP": "vip"
, "CAE_Att_SameDayAppointment": "isSameDayAppointment"
, "ucid": "ucid"
]
nestedTransformer = ref("transformer")
}
transformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer){
components = [ref("caeCopier")]
}
---
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:56 PM, Matt Sgarlata <
mat...@sp...> wrote:
> Hello again Mick,
>
> If there is a Reflector for the bean you are trying to read from, the
> properties will be read as expected. HttpServletRequests have a standard
> reflector that is included by Morph by default. Maps also have reflectors
> so their contents are read rather than looking at the Map's bean properties
> using Java reflection. I'm not clear if your request and session are
> Servlet requests and sessions or some other type of requests and sessions.
> If they are from the Servlet spec you are in good shape. If they are from
> some other API, you may need to write a custom reflector.
>
> You can look at SimpleDelegatingReflector.createDefaultComponents() to see
> what special type of reflectors are included with Morph, beyond simple Java
> reflection.
>
> Does that answer your question?
>
> Matt
>
> On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson <mkn...@ba...>wrote:
>
>> 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
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> 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
>
>
|
|
From: Mick K. <mkn...@ba...> - 2010-04-25 16:42:14
|
I am close, but I have an issue:
I created this Spring Bean in Groovy DSL:
simpleDelegatingTransformer(net.sf.morph.transform.transformers.SimpleDelegatingTransformer){
components = [
propertyNameMappingCopier(net.sf.morph.transform.copiers.PropertyNameMappingCopier){
propertyTransformers = [
"sDummySessionID": "sessionID"
, "ivrportnum": "ivrPortNumber"
, "ivrsystem": "ivrSystem"
, "appname": "applicationName"
, "dispatchcode": "dispatchCode"
*, "ani": "ani"*
, "application_sANIID": "aniId"
,* "dnis": "dnis"*
*, "division": "division"*
,* "region": "region"*
, "callid": "callID"
, "globalzero": "globalZero"
, "bContinueFromAuto": "continueFromAuto"
, "CAE_Att_Soft_Disco": "isSoftDisco"
//, "g_bIsSoftDisco": "isSoftDisco"
, "CAE_Att_Delinquent": "isDelinquent"
//, "g_bIsDelinquent": "isDelinquent"
//, "CAELanguage": language
, "application.Language": "language"
, "np": "nextPage"
, "fform": "firstForm"
, "sAccountNumber": "accountNumber"
//, "application.AccountNumber": accountNumber
, "application.sPhoneID": "phoneID"
, "sDefaultRoutingString": "defaultRoutingString"
, "CAEFunction": "transferFunction"
, "CAETransferReason": "transferReason"
, "callType": "callType"
, "CAELOB": "lob"
, "CAE_Att_VIP": "vip"
, "CAE_Att_SameDayAppointment": "isSameDayAppointment"
, "ucid": "ucid"
]
}
]
}
This will convert my Servlet Request Parameters into my Custom POJO ONLY if
the names match.
This does not copy correctly:
"*sDummySessionID*": "sessionID"
Do you have any suggestions as to why the mapping is not happening?
---
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:56 PM, Matt Sgarlata <
mat...@sp...> wrote:
> Hello again Mick,
>
> If there is a Reflector for the bean you are trying to read from, the
> properties will be read as expected. HttpServletRequests have a standard
> reflector that is included by Morph by default. Maps also have reflectors
> so their contents are read rather than looking at the Map's bean properties
> using Java reflection. I'm not clear if your request and session are
> Servlet requests and sessions or some other type of requests and sessions.
> If they are from the Servlet spec you are in good shape. If they are from
> some other API, you may need to write a custom reflector.
>
> You can look at SimpleDelegatingReflector.createDefaultComponents() to see
> what special type of reflectors are included with Morph, beyond simple Java
> reflection.
>
> Does that answer your question?
>
> Matt
>
> On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson <mkn...@ba...>wrote:
>
>> 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
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> 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
>
>
|
|
From: Matt S. <mat...@sp...> - 2010-04-22 20:56:17
|
Hello again Mick,
If there is a Reflector for the bean you are trying to read from, the
properties will be read as expected. HttpServletRequests have a standard
reflector that is included by Morph by default. Maps also have reflectors
so their contents are read rather than looking at the Map's bean properties
using Java reflection. I'm not clear if your request and session are
Servlet requests and sessions or some other type of requests and sessions.
If they are from the Servlet spec you are in good shape. If they are from
some other API, you may need to write a custom reflector.
You can look at SimpleDelegatingReflector.createDefaultComponents() to see
what special type of reflectors are included with Morph, beyond simple Java
reflection.
Does that answer your question?
Matt
On Thu, Apr 22, 2010 at 4:51 PM, Mick Knutson <mkn...@ba...>wrote:
> 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
>>
>>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> morph-user mailing list
> mor...@li...
> https://lists.sourceforge.net/lists/listinfo/morph-user
>
>
|
|
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
>
>
|
|
From: Matt S. <mat...@sp...> - 2010-04-22 20:20:14
|
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.
|
|
From: Mick K. <mkn...@ba...> - 2010-04-22 18:23:57
|
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
>
>
|
|
From: Matt B. <gud...@gm...> - 2010-04-19 14:38:55
|
On 4/18/10, Mick Knutson <mkn...@ba...> wrote: > Where can I find the archives? The link on the subscription page is bad. > Thanks for letting us know. Apparently sf.net changed the locations of the archives at some point. I navigated to Morph's sourceforge project site from Morph's front-facing site to get to the archive links, of which the one for the user list is http://sourceforge.net/mailarchive/forum.php?forum_name=morph-user . Thanks, Matt > --- > 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 > --- > |
|
From: Matt S. <mat...@sp...> - 2010-04-19 14:38:10
|
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.
|
|
From: Matt B. <gud...@gm...> - 2010-04-19 14:26:49
|
Hi, Mick. Now that we're in the proper forum, let me apologize for
the state of Morph's documentation, but you can certainly appreciate
the universal axiom that documentation is always the lowest priority
for an OSS project, being the least fun of the necessary tasks.
DelegatingCopier has most likely become SimpleDelegatingTransformer
(SDT) in the net.sf.morph.transform.transformers package. Also, SDT's
default constructor initializes it with a best-guess at an all-purpose
set of delegate Transformers for a simple object graph. I would try
one of those out of the box unless you already know you have very
complex types to work with here. If these are all strings, you should
pretty much be set.
HTH,
Matt
On 4/19/10, 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
> ---
>
|
|
From: Mick K. <mkn...@ba...> - 2010-04-19 14:08:51
|
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
---
|
|
From: Matthew S. <mat...@gm...> - 2010-04-18 21:23:40
|
Hi Mick! The archives are here: http://sourceforge.net/mailarchive/forum.php?forum_name=morph-user Matt On Sun, Apr 18, 2010 at 3:03 PM, Mick Knutson <mkn...@ba...>wrote: > Where can I find the archives? The link on the subscription page is bad. > > --- > 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 > > |
|
From: Mick K. <mkn...@ba...> - 2010-04-18 19:11:37
|
Where can I find the archives? The link on the subscription page is bad. --- 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 --- |
|
From: Matt B. <gud...@ya...> - 2009-10-08 15:06:35
|
Please use the mailing list, such as it is, for help.
For this situation, though it might technically be categorized as an assembly/disassembly situation, I would consider it to be a little awkward to do it that way in practice. I could suggest two ways to do this:
A. Define a PropertyMappingCopier of SourceClass to DestinationClass, mapping 'docType' to 'this'. Then define a PropertyMappingCopier of DocType to DestinationClass, mapping 'id' to 'docTypeId' and 'name' to 'docTypeName'.
B. Use a PropertyExpressionMappingCopier to map 'docType.id' to 'docTypeId' and 'docType.name' to 'docTypeName'.
If you also need basic property matching with either of these approaches, remember that CumulativeCopier is a big help for multi-pronged transformations.
HTH,
Matt B
--- On Thu, 10/8/09, Han...@co... <Han...@co...> wrote:
> From: Han...@co... <Han...@co...>
> Subject: morph (dis-)assemble - howto?
> To: gud...@ya..., sga...@li...
> Date: Thursday, October 8, 2009, 9:18 AM
>
>
> Hello all,
>
> I use the morph framework
> for a web
> project and I'm facing the following mapping
> challenge:
>
>
>
> SourceClass
>
>
> ...
>
>
> private
> DocType docType;
>
>
> ...
>
>
>
> Destination
> Class
>
>
> ...
>
>
> private
> String docTypeId
>
>
> private
> String docTypeName
>
>
>
>
>
> Class
> DocType
>
>
> private
> long id;
>
>
> private
> String name;
>
>
>
> (each class with
> corresponding getters/setters)
>
>
>
> We've set up
> transforming like this:
>
>
> SimpleDelegatingTransformer
> suche2form = new SimpleDelegatingTransformer();
>
>
> suche2FormComponents.add(new
> EcmStringConverter()); // own
> converter
>
>
> suche2FormComponents.add(new
> EcmDateToStringConverter()); // own
> converter
>
>
> suche2FormComponents.add(new
> NumberToTextConverter());
>
>
> suche2FormComponents.add(new
> BooleanToTextConverter());
>
>
> suche2FormComponents.add(new
> ContainerCopier());
>
>
> suche2FormComponents.add(new
> PropertyNameMatchingCopier());
>
> Object[]
> suche2FormComponentsA
> = (Object[])suche2FormComponents.toArray(new
> Object[suche2FormComponents.size()]);
>
>
>
> suche2form.setComponents(suche2FormComponentsA);
>
>
>
>
> suche2form.copy(result,source);
>
>
> System.out.println(result.getDocTypeName());
>
>
> System.out.println(result.getDocTypeId());
>
>
> System.out.println(result.getDocType());
>
>
>
> --> Question: How can
> we disassemble
> sourceclass.docType into destinationClass.docTypeId and
> docTypeName properties
> and vice versa (assemble docTypeId / docTypeName into
> docType)?
>
> --> Are there any
> samples available
> about the net.sf.morph.transform.copiers.DisassemblerCopier
> / net.sf.morph.transform.copiers.AssemblerCopier
> ?
>
>
>
> Thanks &
> regards,
>
> Hansjörg
>
>
>
>
>
>
> Cortal Consors S.A.
> Zweigniederlassung Deutschland, Bahnhofstraße 55, D-90402
> Nürnberg, HR Nürnberg B 20075, USt-IdNr. DE225900761
>
>
>
> Sitz der Cortal Consors S.A.: 1, boulevard Haussmann,
> F-75318 Paris cedex 09, Registergericht: R.C.S. Paris 327
> 787 909
>
> Président du Conseil d'Administration
> (Verwaltungsratsvorsitzender) und Directeur Général
> (Generaldirektor) der Cortal Consors S.A.: Olivier Le Grand
>
> Leitung der Zweigniederlassung Deutschland: Martin Daut
> (CEO Deutschland), Olivier Le Grand, Richard Döppmann,
> Pascal Grundrich
>
>
>
> Before printing, think about environmental
> responsibility!
>
> Bitte denken Sie
> über Ihre Verantwortung gegenüber der Umwelt nach, bevor
> Sie diese E-Mail ausdrucken.
|
|
From: <pra...@wi...> - 2009-06-22 14:15:28
|
Hi,
I am trying to morph objects from str String using dynaMorpher in
Holiday Bean through this code.I am using Spring framework.
String[] dateFormats = new String[] {"yyyy-MM-dd"};
JSONUtils.getMorpherRegistry().registerMorpher (new DateMorpher
(dateFormats));
String str = "{param:[{\"date\":\"2009-06-15
00:00:00\",\"description\":\"holiday1\"},{\"date\":\"2009-06-17
00:00:00\",\"description\":\"holiday2\"}]}";
JSONObject jsonObject = JSONObject.fromObject(str);
Collection expected =
JSONArray.toCollection(jsonObject.getJSONArray("param"));
MorpherRegistry morpherRegistry = JSONUtils.getMorpherRegistry();
Morpher dynaMorpher = new BeanMorpher(Holiday.class,morpherRegistry);
morpherRegistry.registerMorpher(dynaMorpher);
Holiday holiday=new Holiday();
for (Iterator iterator = expected.iterator(); iterator.hasNext();) {
holiday = (Holiday) morpherRegistry.morph(
Holiday.class, iterator.next());
System.out.println(holiday.getDescription());
System.out.println(holiday.getDate());
}
When I run this code in main method it works without any error. But when
I put this code in some other method it throws following error.
14:57:44,673 INFO [BeanMorpher] Property 'com.entity.Holiday.class'
14:57:44,689 ERROR [[sysadminjason]] Servlet.service() for servlet
sysadminjason threw exception
net.sf.ezmorph.MorphException
at net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:132)
at
net.sf.ezmorph.MorpherRegistry.morph(MorpherRegistry.java:167)
at
com.wipro.base.domain.sysadmin.controller.json.ProcessManagementControll
er.testCode(Process
at
com.wipro.base.domain.sysadmin.controller.json.ProcessManagementControll
er.addHoliday(Proce
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doI
nvokeMethod(Handler
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.inv
okeHandlerMethod(Ha
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAd
apter.invokeHandler
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAd
apter.handle(Annota
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherS
ervlet.java:875)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherSe
rvlet.java:807)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(Framewor
kServlet.java:571)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet
.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterS
ecurityInterceptor.
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(Filte
rSecurityIntercepto
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTransl
ationFilter.java:12
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessin
gFilter.java:271)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(H
ttpSessionContextIn
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:1
49)
at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
:98)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFil
terInternal(OpenSes
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ
estFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipa
lValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:59)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85
6)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Pro
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorker
Thread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:108)
... 56 more
Any idea why am I getting this error?
Thanks in Advance.
|
|
From: Matt B. <gud...@ya...> - 2009-06-22 13:08:20
|
You seem to be on the wrong list, but feel free to return if you become a user of Morph, rather than EZMorph.
Matt
--- On Mon, 6/22/09, pra...@wi... <pra...@wi...> wrote:
> From: pra...@wi... <pra...@wi...>
> Subject: [morph-user] help required
> To: mor...@li...
> Date: Monday, June 22, 2009, 6:53 AM
>
>
>
>
>
>
> Hi,
> I am trying to
> morph objects from str String using dynaMorpher in Holiday
> Bean through this
> code.I am
> using Spring framework.
>
> String[]
> dateFormats = new String[]
> {"yyyy-MM-dd"};
> JSONUtils.getMorpherRegistry().registerMorpher
> (new DateMorpher
> (dateFormats));
> String str =
> "{param:[{\"date\":\"2009-06-15
> 00:00:00\",\"description\":\"holiday1\"},{\"date\":\"2009-06-17
>
> 00:00:00\",\"description\":\"holiday2\"}]}";
>
> JSONObject
> jsonObject =
> JSONObject.fromObject(str);
> Collection
> expected =
> JSONArray.toCollection(jsonObject.getJSONArray("param"));
> MorpherRegistry
> morpherRegistry =
> JSONUtils.getMorpherRegistry();
> Morpher
> dynaMorpher = new
> BeanMorpher(Holiday.class,morpherRegistry);
> morpherRegistry.registerMorpher(dynaMorpher);
> Holiday
> holiday=new Holiday();
> for (Iterator
> iterator =
> expected.iterator(); iterator.hasNext();) {
> holiday =
> (Holiday)
> morpherRegistry.morph(
> Holiday.class,
> iterator.next());
> System.out.println(holiday.getDescription());
> System.out.println(holiday.getDate());
>
> }
> When I run this code in main method it works
> without any error. But when
> I put this code in some other method it throws following
> error.
> 14:57:44,673 INFO [BeanMorpher] Property
> 'com.entity.Holiday.class'
> 14:57:44,689 ERROR [[sysadminjason]]
> Servlet.service() for servlet sysadminjason threw
> exception
> net.sf.ezmorph.MorphException
>
> at
> net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:132)
>
> at
> net.sf.ezmorph.MorpherRegistry.morph(MorpherRegistry.java:167)
>
> at
> com.wipro.base.domain.sysadmin.controller.json.ProcessManagementController.testCode(Process
>
> at
> com.wipro.base.domain.sysadmin.controller.json.ProcessManagementController.addHoliday(Proce
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at
> java.lang.reflect.Method.invoke(Method.java:585)
>
> at
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(Handler
>
> at
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(Ha
>
> at
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandler
>
> at
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(Annota
>
> at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
>
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
>
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
>
> at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
>
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.
>
> at
> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityIntercepto
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:12
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIn
>
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:2
>
> at
> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
>
> at
> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSes
>
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>
> at
> org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
>
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java
>
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Pro
>
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>
> at
> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
>
> at java.lang.Thread.run(Thread.java:595)
> Caused by:
> java.lang.NullPointerException
> at
> net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:108)
>
> ... 56 more
> Any idea why am I getting this
> error?
> Thanks in Advance.
>
>
>
>
>
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source
> Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of
> unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register
> today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> -----Inline Attachment Follows-----
>
> _______________________________________________
> morph-user mailing list
> mor...@li...
> https://lists.sourceforge.net/lists/listinfo/morph-user
>
|
|
From: <pra...@wi...> - 2009-06-22 11:54:33
|
Hi,
I am trying to morph objects from str String using dynaMorpher in
Holiday Bean through this code.I am using Spring framework.
String[] dateFormats = new String[] {"yyyy-MM-dd"};
JSONUtils.getMorpherRegistry().registerMorpher (new DateMorpher
(dateFormats));
String str = "{param:[{\"date\":\"2009-06-15
00:00:00\",\"description\":\"holiday1\"},{\"date\":\"2009-06-17
00:00:00\",\"description\":\"holiday2\"}]}";
JSONObject jsonObject = JSONObject.fromObject(str);
Collection expected =
JSONArray.toCollection(jsonObject.getJSONArray("param"));
MorpherRegistry morpherRegistry = JSONUtils.getMorpherRegistry();
Morpher dynaMorpher = new BeanMorpher(Holiday.class,morpherRegistry);
morpherRegistry.registerMorpher(dynaMorpher);
Holiday holiday=new Holiday();
for (Iterator iterator = expected.iterator(); iterator.hasNext();) {
holiday = (Holiday) morpherRegistry.morph(
Holiday.class, iterator.next());
System.out.println(holiday.getDescription());
System.out.println(holiday.getDate());
}
When I run this code in main method it works without any error. But when
I put this code in some other method it throws following error.
14:57:44,673 INFO [BeanMorpher] Property 'com.entity.Holiday.class'
14:57:44,689 ERROR [[sysadminjason]] Servlet.service() for servlet
sysadminjason threw exception
net.sf.ezmorph.MorphException
at net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:132)
at
net.sf.ezmorph.MorpherRegistry.morph(MorpherRegistry.java:167)
at
com.wipro.base.domain.sysadmin.controller.json.ProcessManagementControll
er.testCode(Process
at
com.wipro.base.domain.sysadmin.controller.json.ProcessManagementControll
er.addHoliday(Proce
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doI
nvokeMethod(Handler
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.inv
okeHandlerMethod(Ha
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAd
apter.invokeHandler
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAd
apter.handle(Annota
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherS
ervlet.java:875)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherSe
rvlet.java:807)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(Framewor
kServlet.java:571)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet
.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterS
ecurityInterceptor.
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(Filte
rSecurityIntercepto
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTransl
ationFilter.java:12
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessin
gFilter.java:271)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(H
ttpSessionContextIn
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(Filt
erChainProxy.java:2
at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:1
49)
at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
:98)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFil
terInternal(OpenSes
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ
estFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.jav
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipa
lValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:59)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85
6)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Pro
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorker
Thread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at net.sf.ezmorph.bean.BeanMorpher.morph(BeanMorpher.java:108)
... 56 more
Any idea why am I getting this error?
Thanks in Advance.
|