-
1. Re: Initiate a PageFlow via a URL which is not a page in the PageFlow
rgustav May 3, 2008 1:59 AM (in response to rgustav)Ok, I figured this out, hopefully someone else will find this useful.
I can access with /MyPageFlow.seam using something like:
<page view-id="/MyPageFlow.xhtml" action="#{MyPageFlowAction.init}"> <begin-conversation pageflow="MyPageFlow"/> </page>
Note: MyPageFlow.xhtml is a NON-EXISTANT file, this is what threw me for a loop, I hadn't realized this was even possible.
Given a PageFlowDefinition snippit like:
<start-state name="Start"> <transition name="init1" to="Page1"/> <transition name="init2" to="Page2"/> </start-state>
And an action class like:
@Name("MyPageFlowAction") public class MyPageFlowAction{ public String init() { if (condition1) { return "init1"; } else { return "init2"; } } }
Figuring out 'condition' is up to you. :) I still need to work on getting contextual parameters passed to the init() method, but that's a separate problem.
-
2. Re: Initiate a PageFlow via a URL which is not a page in the PageFlow
gothmog Dec 29, 2008 11:01 PM (in response to rgustav)Hi Ryan,
Interesting tip, I've book marked this for when I will need it!! Did you ever come across the need for page params in page flows and did you solve it or work around it?
Troy
-
3. Re: Initiate a PageFlow via a URL which is not a page in the PageFlow
andre1001 Apr 10, 2009 2:24 AM (in response to rgustav)Ryan,
I've got the same behavior without your workaround.
This is the URL sent in e-mail:
http://localhost:8080/menu/registroUsuario/UsuarioEdit.seam?conversationPropagation=begin.newuser&codigo=#{codigoConfirmacao}&taskId=#{taskInstance.id}
This is the newuser.jpdl.xml code:
<pageflow-definition xmlns="http://jboss.com/products/seam/pageflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.1.xsd" name="newuser"> <start-page name="usuario" view-id="/registroUsuario/UsuarioEdit.xhtml" redirect="true"> <action expression="#{registroUsuario.confirmar}"></action> <transition name="inicio" to="inicio"></transition> </start-page> <page name="inicio" view-id="/outros/inicio.xhtml"></page> </pageflow-definition>
There is no need for a UsuarioEdit.page.xml file.
Thasks. I've started with your tip.
-
4. Re: Initiate a PageFlow via a URL which is not a page in the PageFlow
andre1001 Apr 14, 2009 8:17 PM (in response to rgustav)By the way. The only way to choose the first page to show in pageflow is as suggested by Ryan.
I was not able to use something like a direct method invocation.
-
5. Re: Initiate a PageFlow via a URL which is not a page in the PageFlow
tazz786 May 19, 2009 12:52 PM (in response to rgustav)Hi Ryan
I am trying to create an application whereby , the user would enter the url, like
www.ab.com/xyz...where xyz can be anything...I would then have to get the value...i.e. xyz, and then do logic and forward to the necessary pages... I have seen you solution for the above..Would your solution work for my situation, and I am new to seam, so not sure where a pageflow definition would go..I only have a pages.xml and a web.xml