You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by josete <jo...@m-centric.com> on 2009/11/05 20:22:34 UTC
Missing a Business Service figure in T5.1
Hi all.
I'm facing some 'teorical' problem, i still haven't found a solution to.
Let me explain :
I have a page, with a list of pagelinks.
Clicking on a page link makes the application do lot of business logic,
and then, sends the user to the end page.
The business logic is done inside in a non-viewable ( has no .tml )
page, inside its onActivate method .. who then return the resulting page.
The flow is like this :
list.tml -> doTheLogic.java:onActivate -> result.tml / error.tml
I don't feel comfortable doing it like this .. but if any of you think
there's a better solution, please let me know.
As you can see, i am using a page as a 'business service' class ..
because i found no way to cook it ..
BTW: inside the doTheLogic.java i have a hibernate session injected, and
two T5 pages injected ( to be returned )
Thanks all.
---- some code ---
list.tml
<t:pagelink page="doSomeLogic" context="${thePlan.id}"><img
src="${buybutton}"/></t:pagelink>
doSomeLogic.Java
@Inject
Session session;
@InjectPage
ErrorPage errorPage;
@InjectPage
ResultPage resultPage;
Object onActivate(Long aPlanId) {
if ( condition1) {
heavy database stuff with the session
lots of logic
return resultPage
} else {
heavy database stuff with the session
lots of logic
return errorPage
}
}
result.tml/error.tml
<whatever>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Missing a Business Service figure in T5.1
Posted by Howard Lewis Ship <hl...@gmail.com>.
Futher, you can crate a zone and have the actionlink/eventlink update
the zone ... but the action handler method can return a page class or
page instance, and Tapestry will redirect to that page.
On Fri, Nov 6, 2009 at 1:51 AM, josete <jo...@m-centric.com> wrote:
> Uhm .. didn't know about event links .. i like it.
> Thanks.
>
>> Why not use action or event links to do this?
>> If you need the links available from every page, then write yourself a
>> component that you drop onto any page (eg: a layout component). Then you
>> can do your heavy processing inside of the event handlers, even return the
>> new page to render.
>>
>> Robert
>>
>> On Nov 5, 2009, at 11/51:22 PM , josete wrote:
>>
>>> king on a page link makes the application do lot of business logic, and
>>> then, sends the user to the end page.
>>>
>>> The business logic is done inside in a non-viewable ( has no .tml ) page,
>>> inside its onActivate method .. who then return the resulting page.
>>>
>>> The flow is like this :
>>>
>>> list.tml -> doTheLogic.java:onActivate -> result.tml / error.tml
>>>
>>> I don't feel comfortable doing it like this .. but if any of you think
>>> there's a better solution, please let me know.
>>> As you can see, i am using a page as a 'business service' class ..
>>> because i found no way to cook it ..
>>>
>>> BTW: inside the doTheLogic.java i have a hibernate session injected, and
>>> two T5 pages injected ( to be returned )
>>>
>>> Thanks all.
>>>
>>>
>>>
>>> ---- some code ---
>>>
>>> list.tml
>>>
>>> <t:pagelink page="doSomeLogic" context="${thePlan.id}"><img
>>> src="${buybutton}"/></t:pagelink>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Missing a Business Service figure in T5.1
Posted by josete <jo...@m-centric.com>.
Uhm .. didn't know about event links .. i like it.
Thanks.
> Why not use action or event links to do this?
> If you need the links available from every page, then write yourself a
> component that you drop onto any page (eg: a layout component). Then
> you can do your heavy processing inside of the event handlers, even
> return the new page to render.
>
> Robert
>
> On Nov 5, 2009, at 11/51:22 PM , josete wrote:
>
>> king on a page link makes the application do lot of business logic,
>> and then, sends the user to the end page.
>>
>> The business logic is done inside in a non-viewable ( has no .tml )
>> page, inside its onActivate method .. who then return the resulting
>> page.
>>
>> The flow is like this :
>>
>> list.tml -> doTheLogic.java:onActivate -> result.tml / error.tml
>>
>> I don't feel comfortable doing it like this .. but if any of you
>> think there's a better solution, please let me know.
>> As you can see, i am using a page as a 'business service' class ..
>> because i found no way to cook it ..
>>
>> BTW: inside the doTheLogic.java i have a hibernate session injected,
>> and two T5 pages injected ( to be returned )
>>
>> Thanks all.
>>
>>
>>
>> ---- some code ---
>>
>> list.tml
>>
>> <t:pagelink page="doSomeLogic" context="${thePlan.id}"><img
>> src="${buybutton}"/></t:pagelink>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Missing a Business Service figure in T5.1
Posted by Robert Zeigler <ro...@scazdl.org>.
Why not use action or event links to do this?
If you need the links available from every page, then write yourself a
component that you drop onto any page (eg: a layout component). Then
you can do your heavy processing inside of the event handlers, even
return the new page to render.
Robert
On Nov 5, 2009, at 11/51:22 PM , josete wrote:
> king on a page link makes the application do lot of business logic,
> and then, sends the user to the end page.
>
> The business logic is done inside in a non-viewable ( has no .tml )
> page, inside its onActivate method .. who then return the resulting
> page.
>
> The flow is like this :
>
> list.tml -> doTheLogic.java:onActivate -> result.tml / error.tml
>
> I don't feel comfortable doing it like this .. but if any of you
> think there's a better solution, please let me know.
> As you can see, i am using a page as a 'business service' class ..
> because i found no way to cook it ..
>
> BTW: inside the doTheLogic.java i have a hibernate session injected,
> and two T5 pages injected ( to be returned )
>
> Thanks all.
>
>
>
> ---- some code ---
>
> list.tml
>
> <t:pagelink page="doSomeLogic" context="${thePlan.id}"><img src="$
> {buybutton}"/></t:pagelink>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org