Results 1 to 2 of 2

Thread: portlet webflow with portlet2.0 events

  1. #1
    Join Date
    Oct 2010
    Posts
    4

    Default portlet webflow with portlet2.0 events

    Does anyone have an example of using portlet 2.0 events with spring webflow 2.1 and spring 3.x? I am trying trying to convert some portlets that use spring 3.0.5 with annotated controllers to webflow portlets while keeping the inter-portlet communication. so far ive just converted the controllers to service classes and all appears to be well but i dont see a way to use events.

    i was happy using portlet MVC without webflow but it appears that i need the conversation support to support multiple browser tabs.


    Thank you,
    montgomery

  2. #2
    Join Date
    Feb 2011
    Posts
    9

    Default

    Hi,

    I'm working on something similar.

    To fire portlet-events from a webflow, I use a Custom-Action:
    Code:
    package myPackage;
    
    import javax.portlet.ActionResponse;
    import javax.xml.namespace.QName;
    
    import org.springframework.webflow.execution.Action;
    import org.springframework.webflow.execution.Event;
    import org.springframework.webflow.execution.RequestContext;
    
    public class FireCreateAccountEvent implements Action {
    /**
     * Fires portlet 2.0 event to initialize CreateAccount
     */
    	public Event execute(RequestContext context) throws Exception {
    		
    		System.out.println("Fire Account Event");
    		ActionResponse response = (ActionResponse) context.getExternalContext().getNativeResponse();
    		response.setEvent(new QName("http://myDomain/events", "x:showCreateAccount"), "");
    		return new Event(this ,"success");
    	}
    
    }
    Now, I'm looking for a solution to start Webflows based on a Event, I think, I have to modify the ViewFlowHandler-Bean, but I don't know how at tihs time.

    Regards,
    Michael

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •