Spicefactory Forum Index Spicefactory
Forum Archive
 
 SearchSearch    Log inLog in 

New Command Functionality in 2.2

 
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory
View previous topic :: View next topic  
Author Message
giles.roadnight



Joined: 20 Jul 2009
Posts: 76
Location: London

PostPosted: Tue Jan 19, 2010 5:13 pm    Post subject: New Command Functionality in 2.2 Reply with quote

Just wanted to say that I LOVE the new Command tags in 2.2.

Reduce the number of events you need to create a lot - really is so easy to use. The status tag is great too.

It'll make our code base look a lot neater.

Keep up the good work!
_________________
Giles Roadnight
http://giles.roadnight.name
blog: http://blog.giles.roadnight.name
Back to top
View user's profile Send private message
Jens Halm
Site Admin


Joined: 21 Sep 2007
Posts: 2631
Location: Cologne, Germany

PostPosted: Tue Jan 19, 2010 6:01 pm    Post subject: Reply with quote

Hey, glad you like it!

But for the majority of these ideas you have to thank the Cairngorm people! I just ported their ideas to a native Parsley implementation and polished them a bit and made them consistent with the rest of the messaging system.

The original Cairngorm 3 Command Library can be found here:
http://opensource.adobe.com/wiki/display/cairngorm/HowToUseCairngormIntegration
_________________
Jens Halm
Spicefactory
Back to top
View user's profile Send private message
giles.roadnight



Joined: 20 Jul 2009
Posts: 76
Location: London

PostPosted: Thu Jan 21, 2010 8:51 am    Post subject: Reply with quote

I was wondering about using the CommadnResult tag with message interceptors.

If for example I had a Command that loaded an XML file. Would I be able to write an inteceptor that would intercept the result event, turn the xml into objects then re-despatch the result event?

Thanks
_________________
Giles Roadnight
http://giles.roadnight.name
blog: http://blog.giles.roadnight.name
Back to top
View user's profile Send private message
Jens Halm
Site Admin


Joined: 21 Sep 2007
Posts: 2631
Location: Cologne, Germany

PostPosted: Thu Jan 21, 2010 11:32 am    Post subject: Reply with quote

No, you can only intercept the Command, not the result. The latter would be very difficult, not technically, but logically, as there'd be no easy way then to distinguish between interceptors for the command and for the result.

But you can order result handlers (with the order attribute) and then for example use a type of ResultTask that allows for modification of the result value.
_________________
Jens Halm
Spicefactory
Back to top
View user's profile Send private message
giles.roadnight



Joined: 20 Jul 2009
Posts: 76
Location: London

PostPosted: Fri Jan 22, 2010 9:04 am    Post subject: Reply with quote

I came up with an idea of how to handle the translation of XML whilst still retaining the usefulness of the Command tag last night. I detailed it in a couple of blog posts:

http://blog.giles.roadnight.name/2010/01/testing.html
http://blog.giles.roadnight.name/2010/01/asynctokenwrapper.html

I created a class called AsyncTokenWrapper that wraps the AsyncToken returned from the http service. The Token Wrapper is then returned to Parsley.

When the service token returns a result the wrapper uses an optional function to process the results and then uses the returned object to return to Parsley. It works quite well I think. Any opinions welcome.
_________________
Giles Roadnight
http://giles.roadnight.name
blog: http://blog.giles.roadnight.name
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group