You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Thorsten Scherler <th...@apache.org> on 2006/02/02 13:20:40 UTC

Re: usecases - dynamically setting exit url

El mar, 31-01-2006 a las 11:52 +0100, Andreas Hartmann escribió:
> Thorsten Scherler schrieb:
> > El mar, 31-01-2006 a las 11:25 +0100, Andreas Hartmann escribió:
> >> Thorsten Scherler schrieb:
> >>> Hi all,
> >>>
> >>> how can I set the exit url of a usecase dynamically?
> >> You can simply override Usecase.getTargetURL().
> > 
> > You mean in doExecute()?
> 
> No, just override the method:
> 
> public class MyUsecase extends AbstractUsecase {
> 
>      public String getTargetURL(boolean success) {
>          return "anotherPage.html";
>      }
> }
> 
> > 
> >>> My use case is that I have a form and you have two possibilities to exit
> >>> the usecase. 
> >>>
> >>> 1) Pressing on "submit" will save and exit to the same page to
> >>> authoring. 
> >> That's out of the box.
> >>
> >>> 2) The other exit point is a dynamic link based on a <a href=""/> where
> >>> the user get redirected.
> >> Hmmm, actually I don't see a problem here. Why do you need another
> >> "exit URL"? Why can't the user just click on the link?
> > 
> > I wrote a composer for a customer project that is generating a page out
> > of different articles. This includes a small preview of the title and
> > the first two lines of each included article.
> > 
> > Now the customer wishes to have the title linked to the BXE usecase of
> > the underlying article that she can click on the title and will get to
> > this bxe editing article url *after* the form is saved.
> 
> OK, then you can do it like this:
> 
> - add the request parameters (continuation ID, ...) to the link

Actually IMO this not needed since I submit the form before the
redirection, or do I miss something? It is working for me without.

> 
> - add another request parameter (e.g., "exitToBXE") denoting that
>    the user clicked the link

I added a hidden field "transfer" to the form. 

> 
> - override getTargetURL() to return the BXE usecase URL if the
>    "exitToBXE" parameter is set, and super.getTargetURL() otherwise
> 

Thanks again Andreas.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecases - dynamically setting exit url

Posted by Thorsten Scherler <th...@wyona.com>.
El jue, 02-02-2006 a las 14:02 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> 
> [...]
> 
> >> - add the request parameters (continuation ID, ...) to the link
> > 
> > Actually IMO this not needed since I submit the form before the
> > redirection, or do I miss something? It is working for me without.
> 
> OK, then it is fine. I thought the link was an alternative way
> to submit the form.
> 
> 
> >> - add another request parameter (e.g., "exitToBXE") denoting that
> >>    the user clicked the link
> > 
> > I added a hidden field "transfer" to the form. 
> 
> Good to know that it works this way :)

Yeah. :) 

...and for not forgetting it (like promised) ;-)
http://svn.apache.org/viewcvs?rev=374378&view=rev

Thx again

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: usecases - dynamically setting exit url

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:

[...]

>> - add the request parameters (continuation ID, ...) to the link
> 
> Actually IMO this not needed since I submit the form before the
> redirection, or do I miss something? It is working for me without.

OK, then it is fine. I thought the link was an alternative way
to submit the form.


>> - add another request parameter (e.g., "exitToBXE") denoting that
>>    the user clicked the link
> 
> I added a hidden field "transfer" to the form. 

Good to know that it works this way :)

-- Andreas

-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org