You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2004/04/01 15:59:11 UTC

Action->Action flow

Hi folks.

I have annoying problem with controling request flow in Turbine.
Few times I have come upon situation where some ActionA would need to check
will it forward request to ActionB or to some template (Screen) with form in
itself which when submitted will also call ActionB. In other words, this
ActionA decides will it skip page with form and execute ActionB directly.
But problem is that I cannot see the way to direct request from ActionA to
ActionB, because wherever I look, I just see examples with flow going from
Action->Screen and not Action->Action ?!
Is there some way to make it flow from Action to Action ?

Regards,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Action->Action flow

Posted by Eric Pugh <ep...@upstate.com>.
Here you go:

 VelocityAction action = (VelocityAction) ActionLoader
                        .getInstance().getInstance("CreateReactions");
                action.doPerform(data, context);

However, Oron is right..  You should have VERY little code in an action as
actions are hard to unit test.  (You are writing unit tests right :-) )

Eric

> -----Original Message-----
> From: Vjeran Marcinko [mailto:vjeran@tis.hr]
> Sent: Thursday, April 01, 2004 4:30 PM
> To: Turbine Users List
> Subject: Re: Action->Action flow
>
>
> Hi Oron.
>
> I am aware that such way only small amount of code will be repeated
> (doService and setting template), but I really wanted not to have any
> copies, but to reuse Action class maximally.
> Anyway, as I have understanding of Turbine, flow from :
> Action->Action
> Screen->Action
> Screen->Screen
> isn't possible.
> Only Action->Screen is allowed, which is limiting in some cases.
>
> Thanx anyway for advice.
>
> ----- Original Message -----
> From: "Oron O Adam" <or...@netada.co.uk>
> To: "'Turbine Users List'" <tu...@jakarta.apache.org>
> Sent: Thursday, April 01, 2004 4:24 PM
> Subject: RE: Action->Action flow
>
>
> > Hi Vjeran
> >
> > Seems to me if you make your actions thin and put the logic in
> some joint
> > service class you will have
> >
> > Action a code
> > {
> > if(need to display screen)
> > {
> > setTemplate(additional screen)
> > }
> > else  // no need for screen
> > {
> > doService
> > setTemplate(some final screen)
> > }
> >
> > }
> >
> > Action b code
> > {
> > doService()
> > settemplate(some final screen)
> > }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Action->Action flow

Posted by Vjeran Marcinko <vj...@tis.hr>.
Hi Oron.

I am aware that such way only small amount of code will be repeated
(doService and setting template), but I really wanted not to have any
copies, but to reuse Action class maximally.
Anyway, as I have understanding of Turbine, flow from :
Action->Action
Screen->Action
Screen->Screen
isn't possible.
Only Action->Screen is allowed, which is limiting in some cases.

Thanx anyway for advice.

----- Original Message ----- 
From: "Oron O Adam" <or...@netada.co.uk>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Thursday, April 01, 2004 4:24 PM
Subject: RE: Action->Action flow


> Hi Vjeran
>
> Seems to me if you make your actions thin and put the logic in some joint
> service class you will have
>
> Action a code
> {
> if(need to display screen)
> {
> setTemplate(additional screen)
> }
> else  // no need for screen
> {
> doService
> setTemplate(some final screen)
> }
>
> }
>
> Action b code
> {
> doService()
> settemplate(some final screen)
> }


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Action->Action flow

Posted by Oron O Adam <or...@netada.co.uk>.
Hi Vjeran

Seems to me if you make your actions thin and put the logic in some joint
service class you will have 

Action a code 
{
	if(need to display screen)
	{
		setTemplate(additional screen)
	}
	else  // no need for screen
	{
		doService
		setTemplate(some final screen)
	}

}

Action b code
{
	doService()		
	settemplate(some final screen)
}

Oron

http://netada.co.uk

-----Original Message-----
From: Vjeran Marcinko [mailto:vjeran@tis.hr] 
Sent: Thursday, April 01, 2004 2:59 PM
To: turbine-user@jakarta.apache.org
Subject: Action->Action flow

Hi folks.

I have annoying problem with controling request flow in Turbine.
Few times I have come upon situation where some ActionA would need to check
will it forward request to ActionB or to some template (Screen) with form in
itself which when submitted will also call ActionB. In other words, this
ActionA decides will it skip page with form and execute ActionB directly.
But problem is that I cannot see the way to direct request from ActionA to
ActionB, because wherever I look, I just see examples with flow going from
Action->Screen and not Action->Action ?!
Is there some way to make it flow from Action to Action ?

Regards,
Vjeran


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org