Inter-Portlet Communication Best Practices

Here's the situation:
There are 2 Portlets on a page; a Search Portlet and a List Portlet. When a user selects search criteria in the Search Portlet and presses the Submit button the items displayed in the List Portlet must be updated to reflect the search criteria that was entered.
My approach to implementing this:
When the user presses the Submit button the Search Portlet code will take the information entered by the user and create a searchObj. This searchObj will be attached to the Http Session object. When the Search Portlet is rendered again in the browser it will recognize (via a hidden HTML attribute) that it needs to inform the List Portlet that there is new search criteria. The browser will then generate a Portal Event that will cause the List Portlet to refresh its list based on the searchObj it finds attached to the Http Session object.
Question 1:
Assuming this is a reasonable approach how do I get the Search Portlet to generate an event based on a HTML hidden field at the time the Portlet is rendered?
Question 2:
Is there a better way to implement this type of functionality? Essentially the problem is that one Portlet needs to process some data and once it's done it needs to notify other Portlets. What are the best practices for this type of situation?
Any suggestions are welcome.

Hi,
As per the JSR 168 Specification, we follow PortletSession with APPLICATION_SCOPE for implementing IPC ( inter portlet communication ).
Here are the steps for IPC:-
1. When you press submit from search portlet then fetch the search string value into the processAction method of the search portlet.
2. Put the search string value in the portlet session with APPLICATION_SCOPE.
3. When you press submit of search portlet, doView() method of both the portlets
( Search and List ) will be called.
4. in the doView() method of List portlet retrieve the search string from the portlet session and call the business logic based on the search criteria.
5. Put the search result into bean or as per your framework design.
6. Iterate the bean value on to your List portlet rendering jsp.
Note:-Here it is assumed that both the portlets are in the same ear/war.
The coming JSR 286 specification, allows a portlet to send and receive events and perform state changes or send further events as result of processing an event.
In JSR 286, we would be having one more request and reponse called EventRequest and EventResponse.
Comments and suggestions are welcome for IPC.
Thanks
<Neeraj Sidhaye/>
Try_Catch_Finally AT YAHOO DOT COM
http://ExtremePortal.blog.co.uk

Similar Messages

  • Threaded VI, Threaded Sequence inter process communication best practice

    I'm curious if others have any advice on best practice for the following.
    We have VIs that run continuously during our test execution sampling 4 different Analog Input boards in continous mode.  For quite awhile these VIs were passed the SequenceContext from the TS side along with the name of FileGlobals.  When the while loops had new samples from the boards it would use the SequenceContext to set them from the VI.  It would also use the SequenceContext to get "signals" from test stand.  That is, I'd set a variable on the TestStand side that would be read in the VI to make it behave differently (filtering, moving average, etc).  I used TS notifiers from the LV side to let TS know new data was available and there are TS rendezvous's used to partially synchronize the 4 seperate boards with each other.
    We never really had any trouble with this and even though the code wasn't terribly complicated for me, others on the team have had a little trouble comprehending it.
    Recently, we ran into some issues not related to this code but ultimately in an attempt to solve them I ended up re-writing this code to use functional globals.  Now, the VI uses the FGs to set the data and on the TestStand side the same FGs are used for reading.  Locking of data is handled by the non-rentrant VIs.  The FGs are also structured state machine-like for signaling the VI to do something and letting TS know something has happened.
    This code seems to work well also and I think my team (and anyone that follows) will be able to follow this code a little bit easier.
    I'm not classically trained so I suspect there may be standard patterns that work here, I just haven't sought them out.  
    Is there a better way to do this that I'm not thinking of?  

    Hi SmokeMonster,
    If things are looking more legible and everything functioning as desired it sounds like the improvements are going to be some of the best for your company. Without more specific information about seeing how information is being passed and handled, and a greater knowledge of the system and desired results, specific recommendations are going to be more difficult.
    From a higher level overview, the best resources you will find on development practices will be the NI TestStand Materials. A few that may be worth a look specific to your inquiry would be the following:
    Using LabVIEW with TestStand
    http://digital.ni.com/manuals.nsf/websearch/828A615BAB7CCECA86257A150065C12E
    TestStand System and Architecture Overview
    http://digital.ni.com/manuals.nsf/websearch/49D1BDF3B02279A8862579FB0063EC04
    TestStand Advanced Architecture Series
    http://www.ni.com/white-paper/7022/en
    Hopefully that gets you some good starting points to refer from.
    Regards,
    James W.
    Applications Engineer
    National Instruments

  • Inter portlet communication in SP4

    Can any one tell me in step by step process with sample code to do inter portlet communication in SP4
    Here i have 2 portlets
    Portlet A and portlet B
    Portlet A has 2 hyperlinks link1 and link2
    When i click link1 or link2 in portlet A, i am passing a parameter,depends on the paramater i have to display some details in portlet B
    Thanks
    maria
    [email protected]
    Message was edited by marianair at Feb 10, 2005 2:27 AM

    hi,
    implement both portlets as page flow portlets. For both the links in portlet A, implement an action that generates an event and fires thisone. Then let the pageflow in portlet A show whatever content is appropriate, eg. the same as before the link.
    Portlet B cathces this event and in the connected pageflow action does whatever it needs to do and redirects to the appripriate JSP.
    Just remeber that you probably needs to use a custom event here.
    For details on IPC and events, see doc:
    http://e-docs.bea.com/workshop/docs81/doc/en/portal/howdoi/howInterPortletComm_wkshp.html
    As an alternative you can use the SP3 mechanism, I find thisone somewhat more cumbersome and messy.
    http://e-docs.bea.com/workshop/docs81/doc/en/portal/howdoi/howInterPortletComm.html
    Feel free to post follow-ups if you get stuck.
    - Anders M.

  • Event interface for inter-portlet communication

    In which jar file can I find the com.bea.netuix.events.Event interface?
    I wish to offer some support for inter-portlet communication while running inside a 8.1sp4 weblogic portal server.
    Firstly, there is almost no documentation for working with Custom/Generic Events and definitely none for working with "Invoke a java portlet method"
    Found out by decompiling the code that you can do the following:
    add methodName(HttpServletRequest, HttpServletResponse, Event) to you backing file, or
    add methodName(ActionRequest, ActionResponse, Event) to your java portlet
    In both cases, I need find the jar file containing the "Event" interface. Have found most of the other classes in netuix_servlet.jar
    Would also appreciate any further info on when the above methods actually get called with respect to the "processAction" and "processRender" methods for jsr168 portlets...

    Found the answer after a pretty manual search - its located inside:
    BEA_HOME/weblogic81/portal/lib/netuix/system/netuix_system.jar
    All other interfaces being inside the WEB-INF/lib/netuix_servlet.jar, this one class from this package has been packed into a jar at the system classpath level!!
    Had to manually look at the classpath in startWeblogic.cmd and then open up every jar file, follow dependent jar files via the manifest.mf etc...

  • Inter Portlet communication without using workshop

    Hi
    Does any one have any luck trying to do inter portlet communication without using weblogic workshop IDE?

    Hi Curt,
    WLP's eventing system is designed such that portlet's don't have to care
    whether the source/destination is local or remote. If you have a portlet
    that fires/consumes events, when you create a proxy portlet on a
    consumer, the portlet on the producer will be able to fire and receive
    events without any changes to it. In this scenario, the proxy portlets
    work with the WLP's event runtime to collect and dispatch events on
    behalf of portlets on the producer. Going forward, WSRP 2.0 and
    JSR168-next's eventing models will be mapped to the same WLP event runtime.
    Subbu
    Curt Smith wrote:
    Thanks Subbu for your enlightenment here and in this group!!
    You mentioned my next quest, WSRP'ifying my portlet & IPC system.
    Can you suggest an WSRP example anywhere on the net or in bea?
    I guessing that suitability of IPC is also a function of whether the portlets are the remote portlets or the local portlets.
    Might a non-Bea IPC choice be usable within the local portlets, which are WSRP clients to stand alone remote portlets?
    I can imagine now that you mention it that the remote WRSP producer portlets can't use just any IPC facility and the events be pushed inband to the consumer portal...
    tnx curt

  • Inter portlet communication using a float portlet

    Hi,
    I am trying to achieve inter portlet communication between a jsp portlet and a pageflow portlet.
    The jsp portlet will open up as a pop up window or as a float portlet.
    I am using BEA Weblogic 8.1 SP5.
    Has any body tried this IPC when the jsp portlet is a float portlet?
    If there is any documentation available for the same?
    Thanks,
    Shreesh

    Hi,
    Thanks for the reply.
    In the search.jsp I am adding an action associated with a form bean, and passing the search string to the form, which will pass the request to the action method. This is the code snippet:
    * @jpf:action
    * @jpf:forward name="success" path="search.jsp"
    protected Forward searchcriteria(SearchcriteriaForm form)
    String searchString = form.getString();
    try {
    URL url = new URL("http://localhost/demo_search.asp");
    HttpURLConnection http = (HttpURLConnection) url.openConnection();
    http.setRequestMethod("POST");
    PrintStream out=new PrintStream(http.getOutputStream());
    out.println("searchParam=searchstring");
    out.flush();
    out.close();
    BufferedReader reader=new BufferedReader(new InputStreamReader(http.getInputStream()));
    reader.readLine();
    String patternStr = "pattern";
    Pattern pattern = Pattern.compile(patternStr);
    Matcher matcher = pattern.matcher("<a href");
    // Retrieve all lines that match pattern
    String line = null;
    while ((line = reader.readLine()) != null)
    out.println("***"+line+"***");
    matcher.reset(line);
    if (matcher.find()) {
    // line matches the pattern
    } catch(Exception e)
    e.printStackTrace();
    return new Forward("success");
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class SearchcriteriaForm extends FormData
    private String string;
    public void setString(String string)
    this.string = string;
    public String getString()
    return this.string;
    The question is what should be the return forward for the search coz, the result should be displayed in a seperate portlet. Also, how do I capture only the result in the result.jsp.
    I would appreciate if you help me,
    Thanks in Advance,
    Sailatha

  • Struts Portlet - inter Portlet communication

    Hi
    How to make inter Portlet communication in Struts portlets?
    Thanks
    Subin

    A quick google search brought back this:
    http://download.oracle.com/docs/cd/B15904_01/portal.1012/b14134/pdg_java.htm

  • How to perform inter-portlet communication in alui6.1.

    I want to perform perform inter-portlet communication in alui6.1. I don't have any clue to how to do it.
    Can anyone help me.

    Frankly, I did it using jQuery. When you have just two portlests on page, you can hardcode object id of second portlet in a code (not so nice, but very fast to see results). Otherwise you can use portlet settings to stay more environment independent.
    In brief, in first portlet via ajax I request for data, using css selector jQuery, paste content to div in second portlet.

  • Inter portlet Communication - Events and Parameters

    Hi,
    I just tried a sample inter portlet communication using events and parameters.
    I used the below code to enable inter portlet communication between two struts portlet.
    UrlUtils.constructLink etc
    The above works fine. Instead of link, I would like to use a form button to fire the event.
    Is there any way of using button to fire the event.
    Another thing I noticed is that when the event is fired the page gets refreshed.
    How to enable inter portlet communication without the portal page refreshing.
    Many Thanks in advance!!!!!!!!
    -Chid

    Hi Natu,
    To start: read the documentation: http://download.oracle.com/docs/cd/B32110_01/webcenter.1013/b31074/jpsdg_java_adv.htm#CHDHDCGI
    Then, you need to make sure the portlets can operate independently. That means: the locations portlet should be able to run without the incidents portlet.
    What you should try to achieve is create a locations jspx that uses a page parameter with the incident number as input. The page can then be populated based on that id.
    The key thing here is: input portlet variables are available as page parameters.
    Then, you need to add some functionality to the incidents portlet to submit the selected incident number to the outside world. You can do this using some backing bean code. Example:
        public void transmitEvent(ActionEvent actionEvent) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            Object response = externalContext.getResponse();
            if (response instanceof javax.portlet.ActionResponse) {
                ActionResponse actionResponse = (ActionResponse)response;
                // setting the portlet OUT parameter
                String outResult = "my output";
                actionResponse.setRenderParameter("outParam",  outResult);
           } else {
                // not in portlet environment
        }Hope this brings you further.
    Jeroen van Veldhuizen

  • How we develop inter-portlet communication in plumtree portal using IDK

    1)How we will develop inter-portlet communication in plumtree portal using IDK .
    is it possiable using Master Detail Pattern? or any other alternate way.
    Regards
    Dheeraj Sai

    This can be done by developing Adaptive Portlets:
    http://edocs.bea.com/alui/devdoc/docs60/Portlets/Adaptive_Portlets/PlumtreeDevDoc_Integration_Portlets_Adaptive_Intro.htm

  • IVR (Inter-VSAN Routing) - Best practices questions

    Hi there,
    We have a situation where we will have multiple customers hosted on a 9513 and sharing a single storage array.
    We want to keep the logically seperated in their own VSANs, but of course the storage array will need to be zoned to all the customers hosts.
    Now IVR should be the thing to use, but I'm getting resistance from the local team (screams of "Nooooo!!! They're EVILLLLL!!!") ... so I want to find out if there are some best practices around IVR use ?
    Should they be used only for light duty stuff ? (though at present we use them with tape backup, which isn't exactly "light")
    Do they impact performance to a measurable degree ?
    Are they stable ?
    What can go wrong with them ? And does it happen often ?
    Thanks!

    IVR does not impact application I/O performance because all the vsan rewrite and fcid rewrite actions are done in hardware asics. The IVR process on supervisor is responsible for managing the configuration and ensuring the rewrite tables are programmed in the linecards. The process is stable.
    Most of the issues I have seen are in environments with multiple IVR enabled MDS switches ISL'd together or an MDS IVR enabled switch connected to a McData/Brocade in an interop mode.
    Like any feature there have been bugs and it pays to check the SAN-OS release notes when planning installs. For example, a config change on one switch does not get properly pushed to another IVR switch or a forwarding table for an ISL interface does not get correctly programmed. There have also been a fair share of user misconfigurations which could have been avoided if Cisco Fabric Services (CFS) was enabled for IVR. This is done with the 'ivr distribute' command. Without this it is very difficult in large topologies of multiple IVR switches to ensure they have a consistent IVR config. In other cases there have been problems from a mix of IVR enabled switches running different releases of SAN-OS, e.g. mixing 3.0 with 3.2.
    Best practice is to have dual physical fabrics, upgrade one fabric at a time ensuring all IVR switches in a fabric run same SAN-OS release.
    A single IVR switch is much easier to implement. The MDS Configuration Guide has a list of best practices for IVR and one of those is to use the NAT option. Personally I would avoid NAT option where you can as NAT makes any troubleshooting harder trying to figure out the domain ID translations. You would also minimize risk of hitting some NAT related bugs, but you could also avoid most of these by checking the workarounds documented in the Release Notes. And with NAT you need to also configure persistent virtual domains and fcids to cater for AIX and HP-UX systems that cannot handle the FCID of the target changing whenever the exported virtual domain ID changes. To give NAT credit, each vsan is represented by a single virtual domain. In regular non-NAT mode, each switch in a vsan is represented by a virtual domain, meaning you eat up more virtual domain IDs. So in large topologies with many domain IDs there are scalability advantages to using NAT and the IVR updates between switches are more efficient with fewer virtual domain IDs to advertize. Of course, NAT must be used if merging physical fabrics with same domain ID and you cannot afford the downtime to change one of the switch domain IDs.
    However if it is just a single IVR switch I would avoid NAT. To do this all your domain IDs should be statically defined and there must be no overlapping domain IDs between IVR'd vsans. If it is a brand new install you can easily achieve this by specifying unique allowed domain ID ranges per vsan.
    For example, each customer can have their own vsan with say 10 domain IDs and the storage can be in vsan 2. You will only use one domain ID per vsan on day 1. Allowing 10 domain ids per vsan means you can add up to 9 other switches per vsan should you need to in the future. There is a maximum 239 domains per vsan so you could have up to 23 customers on your 9513 working with a range of 10 domain IDs per vsan.
    fcdomain domain 2 static vsan 2
    fcdomain domain 10 static vsan 10
    fcdomain domain 20 static vsan 20
    fcdomain domain 30 static vsan 30
    ..and so on..
    fcdomain domain 230 static vsan 230
    fcdomain allowed 01-09 vsan 2
    fcdomain allowed 10-19 vsan 10
    fcdomain allowed 20-29 vsan 20
    fcdomain allowed 30-39 vsan 30
    ..and so on..
    fcdomain allowed 230-239 vsan 230
    With or without IVR you should still run dual fabrics (e.g. 95xx in each fabric) and host based multipathing for redundancy.
    And don't forget IVR will require an Enterprise license. I have even seen a large outage because the customer forgot to install the license before the 120 day grace period expired.

  • Inter Portlet Communication for JSR 168 Portlets

    Hi,
    I want to invoke one JSR168 Portlet from another and also pass parameters between the two.I did the same using Events for Oracle Portlets.
    I would like to know how to do the same when I build JSR 168 Portlets.
    Also Pls let me know where I can get documentation which describes all the possible options that I can try out on JSR168 Portlets
    Regards
    Yash

    Hello Yash,
    The current version of the specifications does not support Parameter and Events that allow you to create portlet 2 portlet communication using OracleAS Portal framework.
    If the reusability of the parameter is not a major requirement of your application you can simply use URL parameters and this will authorize you implement that.
    Regards
    Tugdual Grall

  • Application communication - Best practice

    Hello
    I am eager in understanding the best ways to create communication between applications (Server to client) in Java.
    In the past, I have attempted to make applications using the Socket and ServerSocket class. The concept works of course, but I was wondering if this technique is also being used on enterprise level.
    I would be most interested in:
    - A system that does not rely on request & response, so that the client can receive information without requesting any.
    - The ability for users to send and recieve String messages. (e.g. server announcements).
    - The ability for users to send and receive objects. (e.g. sending or receiving user information).
    - (optional) Security (e.g. encrypted information).
    - (optional) Possible communication with clients using different technologies (e.g. .NET client) while using a server in Java.
    Any information about this is greatly appreciated.
    Vincent

    A system that does not rely on request & response, so that the client can receive information without requesting any.Datagram
    The ability for users to send and recieve String messages. (e.g. server announcements).Ditto. Investigate Multicast also.
    The ability for users to send and receive objects. (e.g. sending or receiving user information).RMI.
    (optional) Security (e.g. encrypted information).SSL.
    Possible communication with clients using different technologies (e.g. .NET client) while using a server in Java.SOAP.
    I think you should spend a bit more time with Google, or better yet buy a book or three on Java networking. This one is good: [http://www.amazon.com/Fundamental-Networking-Java-Esmond-Pitt/dp/1846280303|http://www.amazon.com/Fundamental-Networking-Java-Esmond-Pitt/dp/1846280303]

  • Remote Inter Portlet Communication for JSR 168

    Hi All,
    We are stuck in a big problem using JSR 168 as remote portlets. We will be relieved if someone can suggest few ideas on this. I will provide the scenario which we are trying now.
    We have two portlets namely portlet A and portlet B which are Java(JSR 168) type portlets. These two portlets are offered as remote and they reside in the producer application. We have consumed these two portlets in our consumer application.
    The portlet A is triggering an event and portlet B is listening to the event triggered by portlet A. Currently we are trying to implement this functionality using Ajax. We tried to use customEventUrl tag in our jsp belonging to portlet A and we finally figured out that customEventUrl will not work in Remote portlets. We are not sure as how to pass the information from remote portlet A to remote portlet B. Please let us know your thoughts about this as whether the implementation is really possible when using Remote portlets.
    IMPORTANT NOTE: The event handling and the configuration code that we have made in the above scenario is working perfectly for non-remote java portlets. The problem is occurring only when we consume them in the consumer application.
    Thanks
    Vijay

    Hello Ashwin,
    What version of WebLogic Portal are you using? And is this the same for both the consumer and producer?
    If you are using WLP 10.3.2 I would highly recommend using JSR286 portlets (the next version of the Java Portlet (JSR168) specification) and the JSR286-standard eventing. The JSR286 eventing model is actually much cleaner and easier to understand than the WLP-proprietary support for events in JSR168 portlets.
    However, if you are using a version of WLP prior to 10.3.2 and can't upgrade, JSR168-style events are your only choice. I can give you examples, but they all look very similar to the examples in the online documentation.
    When events work between portlets locally, but not over WSRP, the usual problems are:
    - There is one or more of "onlyIfDisplayed", "sourceDefinitionLabels" or "sourceInstanceLabels" attributes declared on the handle*Event element in the .portlet file. These attributes restrict when the portlet should receive an event, and they usually don't work the way you think when running over WSRP. It is best to not use these attributes for portlets which are going to be used over WSRP.
    - A payload is being sent with the event which is not actually serializable. If serialization of the event payload (which is required for versions of WLP prior to 10.3.2 for WSRP) fails, the event will not be delivered to the portlet.
    - The producer may be configured to not accept events. Check your producer's WEB-INF/wsrp-producer-config.xml file; the "service-config" element should either not have an "offer-extensions" attribute, or this attribute's value should be "true".
    - The events may be getting sent during a portlet lifecycle other than processAction or handleEvent. There is no way for WSRP to handle events which have been sent during preRender or render, so it simply doesn't work.
    - In the case of JSR168 portlets, if you have a backing file on the portlet (in addition to the portlet implementation as well), that may not work in some circumstances over WSRP. It is best to have the event handlers be in the portlet implementation class and avoid the use of backing files for JSR168 portlets.
    If none of those things help you, my suggestion would be to post a sample .portlet file for one of the portlets that is supposed to be receiving the event, as well as the method signature in that portlet's implementation class that is supposed to be receiving the event, and the code which is sending the event that is supposed to be received.
    Kevin

  • Inter portlet communication, load order, portal server 7

    Hi.
    I�m struggling with a portlet application, which uses interportlet communication. PortletOne creates an ArrayList of objects and add the list to the portletSession. PortletTwo displays the first object in the ArrayList.
    The trouble seams to be the load order of the portlets. If portletTwo loads before PortletOne, the ArrayList is empty, and it displays nothing.
    Any idea how I can be sure that my page loads PortletOne before PortletTwo?

    If your intention is to transfer data(Array List of Objects) from from one portlet to the other, you need to use InterPortlet Communication API rather than putting the data in the session. In the first portlet set the event data and fire the event and in the second portlet, get the event data.
    The order in which the events are fired is not guaranteed. i.e if portlet fires an event to portlet1, portlet2 and portlet3, the order in which the portlet1, 2 & 3 will receive the events is not guaranteed. Load order of portlets does not cause any problems.

Maybe you are looking for

  • Put itunes downloaded from different computers on same ipod?

    Hello, I have downloaded itunes onto two different computers using the same account. How do I put these itunes onto my ipod without deleting any content? Thanks, Jake.

  • Adobe CS5.5 Acrobat encountered installation errors. Exit code: 7 and Error: DW020

    I have CS 5.5 Master Collection running on my Mac Pro 2 x 2.4 Ghz Quad-Core with OS 10.7.4. Recently Acrobat had been quitting on me after it launched. I tried to delete all preference, but nothing worked. I decided to uninstall Acrobat and install i

  • AppleTV not recognized by TV

    When I connect my new Apple TV to my Hitachi TV  (about 5 years old)  it is not recognized on any input.  I have tried 3 different HDMI  input ports with nothing coming up except a black screen.  I took the AppleTV unit  back to Best Buy to see if th

  • Can't delete a row with a long raw in it

    I have a table with a long raw column. I am using the following to try to delete the row from a copy of 8i Lite: stmt.executeUpdate("delete from blobs where blobid="+blobId); My application hangs at this point. Any theories? I am using this driver: o

  • Elements 12 organiser not loading mac

    Hi, just got elements for the 1st time and when i'm trying to open organiser, i get the following error message: Process:         Adobe Elements 12 Organizer [584] Path:            /Applications/Adobe Elements 12 Organizer.app/Contents/MacOS/Adobe El