-
1. Re: accessing natural conversation when not logged in
eirirlar Mar 5, 2008 2:49 PM (in response to mars1412)Disclaimer: this answer is based on what I've learned trying to get natural conversations to work.
I don't think you're supposed to specify the conversation's parameter name and value as a page paramater; when you specify that you're using a natural conversation the natural conversation will take care of getting the parameter value from the el-expression, so just make sure webUserHome is in scope.
The other thing is that I think you have to start the natural conversation before you redirect to a page that uses a natural conversation. When you do so you say <begin-conversation join="true" conversation="Conv_EditWebUser"/>
Hope it helps. And if you manage to redirect to an existing natural conversation, please let me know :)
-
2. Re: accessing natural conversation when not logged in
mars1412 Mar 5, 2008 3:48 PM (in response to mars1412)
I don't think you're supposed to specify the conversation's parameter name and value as a page paramater;I can't drop the page parameter, because this statement initializes my EntityHome
@Name("webUserHome") @Scope(ScopeType.CONVERSATION) public class WebUserHome extends EntityHome<WebUser> { public void setWebUserId(Long id) { setId(id); }
should I use another name fot he page-parameter (like ?webUserId=2&initWebUserId=2)?
this does not seem to be reasonable..
The other thing is that I think you have to start the natural conversation before you redirect to a page that uses a natural conversation.<begin-conversation join="true" conversation="Conv_EditWebUser"/>
When I add the conversation attribute also to the begin-conversation tag, I get the same error.
My problem here is, that the natural conversation is not existing and I cannot directly control the redirect.
I'm not sure, if bookmarking a login-required page works at all.
The seam-bay example has the same problem.
If I directly access the bid.xhtml page (http://localhost:8080/seam-bay/bid.seam?auctionId=62748261 which is also used as an example in the docs: Redirecting to a natural conversation
I see the same errormessage.
(ok, this page is not desinged to be accessed directly, but anyway - when you access it directly after login, it works: means, the page is empty, but there is no excpetion -
3. Re: accessing natural conversation when not logged in
jacob.orshalick Mar 5, 2008 8:30 PM (in response to mars1412)Martin, I believe you may be running into JBSEAM-2449. This would seem to be a fairly common issue when using natural conversations on pages that a login is required. Your approach seems reasonable to me.
I don't think you're supposed to specify the conversation's parameter name and value as a page paramater;You actually can do this and it allows bookmarking since the conversation is started with page access (although, if you are not logged in this could lead to the issue Martin is describing).
The other thing is that I think you have to start the natural conversation before you redirect to a page that uses a natural conversation.This is not required. You can start the natural conversation when the page is accessed.
And if you manage to redirect to an existing natural conversation, please let me knowThis issue is reported at JBSEAM-2606 but if you use the approach Martin is taking, you will be able to join an existing conversation without issue (the redirect is the problem at the moment). Each of these approaches will be covered in detail in the new JBoss Seam book which should be on Safari any day now ;)
-
4. Re: accessing natural conversation when not logged in
jacob.orshalick Mar 5, 2008 8:39 PM (in response to mars1412)By the way, if you are looking for a workaround on the redirect issue, check out the source for the Natural Hotel Booking example at the preview chapter examples. This uses an approach that allows you to resume a natural conversation on redirect at the point where the conversation left off.
Hope that helps.
-
5. Re: accessing natural conversation when not logged in
mars1412 Mar 6, 2008 9:29 AM (in response to mars1412)tx jacob
looking forward to reading your book..
-
6. Re: accessing natural conversation when not logged in
eirirlar Mar 15, 2008 3:17 PM (in response to mars1412)Jacob, I used your examples as a template for my application and it works quite well. Thanks a lot!
A question regarding your example: I have a use case where I want to join an existing conversation, but not navigate to the same place I left off that conversation. ConversationEntry.select(); doesn't work in this case - any hints on how to do this?
-
7. Re: accessing natural conversation when not logged in
eirirlar Mar 16, 2008 4:07 PM (in response to mars1412)
Eirik Larsen wrote on Mar 15, 2008 03:17 PM:
A question regarding your example: I have a use case where I want to join an existing conversation, but not navigate to the same place I left off that conversation. ConversationEntry.select(); doesn't work in this case - any hints on how to do this?Found an ok-ish way to do it for those who might be interrested:
Manager.instance().redirect("/anotherpage.xhtml", "YourNaturalConversationName:" + componentThatProvidesNaturalConversationId.getId());