Abstract:
The present invention provides a method and system for implementing asynchronous portal pages, comprising a portlet monitor resident on a web browser and implemented with a script. When a user interacts with a portlet, the portlet monitor sends a XMLHTTP request to the portal server. The portal server obtains the corresponding web contents from the corresponding portlet based on the request. Then, the web contents are modified and the HTTP requests therein are redirected to XMLHTTP requests. The portlet monitor uses the modified web contents to refresh the web contents of the corresponding portlet in the portal page without reloading the whole portal page. Besides, after the user submits a request for a portlet, during waiting for the portlet being refreshed, the user may continue to interact with other portlets. Thus, the present invention has the abilities of partially refreshing and asynchronous communication.

Description:
TECHNICAL FIELD  
       [0001]     The present invention relates to portal technology, more particularly, to a method and system for providing asynchronous portal pages.  
       BACKGROUND OF THE INVENTION  
       [0002]     As the Internet becomes more and more pervasive, better technology is constantly being developed for displaying web contents. In this respect portal servers have become a technology of choice in delivering web contents to users. Typically, a portal server is a portal program (e.g. WebSphere Portal Server from International Business Corp. of Armonk, N.Y.) that organizes web contents into a portal page composed of portlets. A user, for instance, can set up his/her own portal page having portlets for news, weather and sports. The portal program would then obtain the desired web contents from appropriate content providers, aggregate the web contents and generate a portal page for end users.  
         [0003]     A traditional web application allows a user to fill out a form on a web page, and when the form is submitted, the web browser sends a request to the web server. The web server processes any information sent through the form, and then responds to the web browser with a new web page. In this way, a lot of bandwidth may be wasted since much of the web contents in the first page may also be contained in the second page. Because a request has to be transmitted to the web server on every interaction with the application, the application&#39;s response time is dependent on the response time of the web server. This leads to a much slower user interface of a web application than that of a native application.  
         [0004]     In the prior art, a portal system is just such a traditional web application. Whenever a user submits a form on a portlet, the portal server will respond by sending a new portal page. In fact, however, it is needless to send web contents of other portlets in the portal page. And it is enough to reload only the web contents of the portlet with which the user is interacting.  
         [0005]     An emerging technology, called as AJAX (Asynchronous and JavaScript XML), for asynchronous web is developed for refreshing part of a page instead of refreshing the whole page on every interaction between the user and application. In an AJAX application, when a user submits a form in a page, instead of the web browser directly sending a HTTP (Hypertext Transfer Protocol) request to the web server, a script program, usually a JavaScript program, resident on the web browser receives the user&#39;s request and sends a XMLHTTP (Extended Markup Language HTTP) request to the web server in background through an API (Application Program Interface), so as to retrieve only the needed web contents instead of the whole page and perform corresponding processing to partly refresh the page when receiving a response from the web server. In this way, the application response is speeded up, because the amount of data exchanged between the web browser and the web server is greatly reduced. And the processing time of the web server is saved because much of the processing is performed at client side.  
         [0006]     At present, portlet developers can use AJAX to develop portlets so as to provide an asynchronous portal program. But now the most popular portlet programming models are all based on non-AJAX technology (e.g. JSR 168), and almost all existing portlets have been developed in this way. Therefore, the solution of using AJAX to develop portlets would have the following shortcomings: 
    a) Using the new AJAX requires writing portlets in a completely new way, and rewriting millions of existing portlets is almost impossible.     b) Portlet developers have only to focus on portlet logic, and using AJAX will increase the complexity of the development because the developers have to take care of a lot of programming details.    
 
         [0009]     Another solution for providing an asynchronous portal page is to use the “IFrame” (inner Frame) tag in HTML, which can display a whole HTML page anywhere in another HTML page. The page in an IFrame can be loaded and operated separately. Thus, by combining portlets and the IFrame, asynchronous updating of portlets may be realized. However, this solution has the following defects: 
    a) The size of an IFrame is unchangeable. If its size is not big enough for the web contents, a scroll bar will be shown. This means dynamical adjustment of the portal page&#39;s layout is impossible when the web content of a portlet is changed.     b) All the web pages in an IFrame are separated, so that any common resource (e.g. CSS, images and others) cannot be shared. The same resource must be downloaded repeatedly.    
 
         [0012]     In view of the forgoing, there apparently exists a need for a system and method for providing asynchronous portal pages. Specifically, there exists a need for a system and method for providing asynchronous portal pages in a portal system where the portlets are developed using traditional web technology (i.e. developed by using programming models based on synchronous refreshing technology).  
       SUMMARY OF THE INVENTION  
       [0013]     In general, the present invention provides a system and method for providing asynchronous portal pages without changing traditional portlet programming models.  
         [0014]     According to an aspect of the present invention, there is provided a method for providing asynchronous portal pages in a portal system, wherein the portlets in the portal system are developed using a programming model based on synchronous refreshing technology, the method comprising the steps of:  
         [0015]     in response to a user&#39;s request for a portal page/portlet, a portlet monitor at client side sending a XMLHTTP request to a portal server;  
         [0016]     in response to the XMLHTTP request, the portal server invoking a corresponding portlet to obtain the corresponding web contents;  
         [0017]     modifying said b contents so that the HTTP requests therein are redirected to XMLHTTP requests, and  
         [0018]     the portlet monitor at client side refreshing the web contents of the corresponding portlet in said portal page with said modified web contents.  
         [0019]     Preferably, the method further comprises a step of initialization in which in response to a user request for a portal page from a web browser at client side, the portal server downloads said portlet monitor to the client side.  
         [0020]     Preferably, said step of initialization comprises the steps of:  
         [0021]     the web browser sending a request for a portal page to the portal server;  
         [0022]     the portal server returning a portal page with said portlet monitor to the web browser;  
         [0023]     the portlet monitor at client side sending XMLHTTP requests to said portal server asynchronously to obtain web contents of the corresponding portlet;  
         [0024]     modifying said web contents so that the HTTP requests therein are redirected to XMLHTTP requests; and  
         [0025]     the portlet monitor at client side loading portlets in the portal page respectively with said modified web contents and finally displaying the whole portal page.  
         [0026]     Preferably, said step of initialization comprises the steps of:  
         [0027]     the web browser sending a request for a portal page to the portal server;  
         [0028]     the portal server invoking portlets to obtain web contents of all the portlets in said portal page;  
         [0029]     modifying the web contents of all the portlets so that the HTTP requests therein are redirected to XMLHTTP requests and the web contents of all the portlets are organized into a portal page; and  
         [0030]     returning the portal page with said portlet monitor to the web browser.  
         [0031]     Preferably, said portlet monitor is implemented with a script embedded in said web contents.  
         [0032]     Preferably, said portlet monitor is implemented with a separate script file.  
         [0033]     Preferably, said step of modifying is performed in said portal server.  
         [0034]     Preferably said step of modifying is performed by the portlet monitor at client side.  
         [0035]     Preferably, said step of modifying comprises HTML rewriting and script rewriting.  
         [0036]     Preferably, said step of modifying comprises the steps of:  
         [0037]     for any HTML link tags, if it points to an Action URL, replacing its “href” attribute with a special script function call;  
         [0038]     for any HTML form tag, if its “action” attribute equals to an Action URL, replacing the “action” attribute with a special script function call;  
         [0039]     for any script statement that sends a HTTP request using the “GET” method, replacing it with a special script function call, and  
         [0040]     for any script statement that sends a HTTP request using the “POST” method, replacing it with a special script function call.  
         [0041]     According to another aspect of the present invention, there is provided a portal system, comprising:  
         [0042]     a portal server, comprising: a portlet service module configured to obtain the corresponding web contents from a corresponding portlet based on a XMLHTTP request from client side and send the web contents to the client side as a response; and at least one portlet that has been developed using a programming model based on synchronous refreshing technology, configured to process a request from the portlet service module and provide the corresponding web contents to it;  
         [0043]     a client, which comprises a portlet monitor resident on a web browser, and configured to send a XMLHTTP request to said portal server during an interaction between a user and a portlet and refresh the web contents of the corresponding portlet in said portal page with the web contents in the response from said portal server; and  
         [0044]     web content rewriting means configured to rewrite the web contents that are sent to the client side from the portal server and redirect the HTTP requests therein to XMLHTTP requests.  
         [0045]     According to a further aspect of the present invention, there is provided a system for providing asynchronous portal pages, comprising:  
         [0046]     a portlet service module at portal server side configured to obtain the corresponding web contents from a corresponding portlet based on a XMLHTTP request from client side and send the web contents to the client side as a response;  
         [0047]     a portlet monitor resident on a web browser at client side configured to send a XMLHTTP request to the portal service module during an interaction between a user and a portlet and refresh the web contents of the corresponding portlet in said portal page with the web contents in a response from the portal service module; and  
         [0048]     a web content rewriting means configured to rewrite the web contents that are sent to the client side from the portal server and redirect the HTTP requests therein to XMLHTTP requests.  
         [0049]     From above it can be seen that, in the present invention, there is provided a portlet monitor that is resident on a web browser and implemented with a script (such as JavaScript or VBScript). When a user interacts with a portlet, the portlet monitor sends a XMLHTTP request to the portal server. The portal server obtains the corresponding web contents from a corresponding portlet based on the request. Then, the web contents are modified and the HTTP requests therein are redirected to XMLHTTP requests and sent to the portlet monitor as a response. The portlet monitor uses the modified web contents to refresh the web contents of the corresponding portlet in the portal page without reloading the whole portal page. Besides, after the user submits a request for a portlet, during the time waiting for the contents of the portlet being refreshed, the user may continue to interact with other portlets. Thus, the present invention has the functions of partially refreshing and asynchronous communication. Furthermore, since the present invention redirects the HTTP requests in the web contents of portlets to XMLHTTP requests instead of modifying the portlets themselves, it is possible to use millions of existing portlets. In general, the present invention will bring the following advantages  
         [0050]     The present invention can provide portal pages with good response, which is obtained through partially refreshing and asynchronous communication. Such portal pages are called asynchronous portal pages.  
         [0051]     All portlets in a portal page may share any common resources without repeatedly downloading since these portlets are in the same web page.  
         [0052]     The present invention can integrate portlets based on traditional web technology into an asynchronous portal page. Portlet developers need not to rewrite them using AJAX.  
         [0053]     As a pluggable module, the present invention can be implemented easily at an existing portal server. The module is transparent to portlet developers. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0054]     A complete understanding of the present invention can be obtained through reading the following detailed description of embodiments of the present invention with reference to the drawings, wherein:  
         [0055]      FIG. 1  is a block diagram showing a portal system according to a preferred embodiment of the present invention;  
         [0056]      FIG. 2  is a flowchart showing a method for providing asynchronous portal pages according to a preferred embodiment of the present invention;  
         [0057]      FIG. 3   a  is a sequence chart showing a portal page initialization mechanism according to a preferred embodiment of the present invention;  
         [0058]      FIG. 3   b  is a sequence chart showing a portal page initialization mechanism according to another preferred embodiment of the present invention; and  
         [0059]      FIG. 4  is a sequence chart showing the asynchronous interaction mechanism according to a preferred embodiment of the present invention.  
     
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0060]     The present disclosure proposes a system for providing asynchronous portal pages.  FIG. 1  and  FIG. 2  show a block diagram of a portal system and a flowchart of a method for providing asynchronous portal pages, respectively, according to preferred embodiments of the present invention.  
         [0061]     Now referring to  FIG. 1 , a portal system according to a preferred embodiment of the present invention is shown. As shown in the figure, the portal system comprises a portal server  104  and a client  103 . The portal server  104  comprises three components, initiator  106 , portlet service module  106  and one or more portlets  107 . These portlets have been developed using programming models based on synchronous technology (such as JSR168). The client  103  comprises a portlet monitor  102  residents on a web browser. According to an embodiment of the present invention, the portal server  104  further comprises means for rewriting web contents (shown with dashed lines). According to another embodiment, the means for rewriting web contents is located at client side (shown with dashed lines).  
         [0062]     The portlet monitor  102  may be implemented with a script (such as JavaScript or VBScript) that is resident in web contents and running on a web browser. It has at least two functions, that is, sending a XMLHTTP request to the portal server  104  and replacing the web content of a portlet that needs to be updated with the web content in a response from the portal server  104 , without refreshing the whole portal page. The function of the portlet service module  106  is to obtain web contents from the portlets  107  based on a request from the portlet monitor  102  and send the web contents to the portlet monitor  102  as a response. The initiator  106  is used to download the portlet monitor  102  and a portlet configuration file etc. to the client side when a user initially requests a portal page, wherein the configuration file provides the information on portlet&#39;s ID, layout and style etc. The portlets  107  are used to process requests from the portlet service module  106  and provide web contents to it. The means for rewriting web contents is used to redirect the traditional HTTP requests in the web contents that are returned to the client side from the portal server  104  to XMLHTTP requests. It should be noted that the means may be implemented with a separate component in the portal server  104  or by the portlet service module  106 , and also may be implemented with a separate component at client side or as part of the portlet monitor.  
         [0063]     Now referring to  FIG. 2 , a flowchart of a method for providing asynchronous portal pages according to a preferred embodiment of the present invention is shown. The working flow may be divided into  6  phases  201  to  206 .  
         [0064]     In Phase  201 , the user requests a portal page with a URL. Then, in phase  202 , the web browser downloads the portal page. There are two portal initialization modes, which are, only downloading a portlet monitor (as shown in Phase  202   a , here downloading a portlet monitor usually comprises two parts: downloading the portlet monitor and downloading a portlet configuration file) or downloading both the portlet monitor and the web contents of the portlets (as shown in Phase  202   b ). If only the portlet monitor is downloaded, the portlet monitor will obtain the web contents subsequently and asynchronously. Thus, the users experience can be improved during the initialization. With such a solution, however, more times of network I/O between the browser and the portal server may be required. If both the portlet monitor and the web contents of the portlets are downloaded, less times of network I/O are required. But the portal page is loaded synchronously. Both in Phases  202   a  and  202   b , the web contents of the portlets will be rewritten to replace the original HTTP requests with XMLHTTP requests. Then, in Phase  203 , the user will submit a request in the portal page and this request will be submitted by the portlet monitor to the portal server through XMLHTTP. In Phase  204 , the portlet generates the web contents of the portlet based on the user&#39;s request received from the portlet service module, and will also rewrite the web contents in Phase  205 . Finally in Phase  206 , the portal page is partially refreshed by replacing the original web contents with new ones.  
         [0065]     It should be noted that Phase  205  can happen either at client side or at portal server side. If it happens at client side, more cost at client side and less cost at server side is needed, and vice versa.  
         [0066]     Besides, it should be further noted that in above embodiments it is in the phase of initialization that the portal server downloads the portlet monitor (including a portlet configuration file) to the client side based on the user&#39;s request for an initial portal page from the web browser. However, as an alternative, the portlet monitor may be embedded into an existing web browser, so that when the user requests an initial portal page, the portlet monitor can intercept the request and asynchronously load every portlet of the initial portal page through XMLHUTP requests.  
         [0067]     Next, a detailed description will be given to the six phases shown in  FIG. 2  according to the system shown in  FIG. 1 .  
         [0000]     Portal Page Initialization Mechanism  
         [0068]     As shown in  FIG. 2 , the portal page initialization steps comprise Phases  201  to  202 . In the present invention there are two initialization modes. Next, these two modes will be described respectively.  
         [0000]     1) Portal Page Initialization Mechanism (Downloading a Portlet Monitor Only)  
         [0069]      FIG. 3   a  is a sequence chart showing a portal page initialization mechanism (downloading a portlet monitor only) according to a preferred embodiment of the present invention.  
         [0070]     Referring to  FIG. 3   a , in the mode of downloading a portlet monitor only, Phase  202   a  comprises Steps  302  to  310 , which execute the function of downloading a portal page.  
         [0071]     In Step  301 , the user inputs a URL in a web browser to send a request to the portal server for obtaining a portal page.  
         [0072]     In Step  302 , the web browser sends the request for a portal page to the initiator on the portal server.  
         [0073]     In Step  303 , in a response, the initiator sends back a web page with a portlet monitor.  
         [0074]     In Step  3045  the web browser invokes the received portlet monitor to send XMLHTTP requests for obtaining the web contents of the portlets.  
         [0075]     In Step  305 , the portlet monitor asynchronously sends XMLHTTP requests to the portal server. In this step, the user can interact with the portal page without waiting.  
         [0076]     in Step  306 , the portlet service module requests the web contents from the portlets. The portlets may be a local portlet container or a remote service (e.g. a web service for remote portlets). So the step may be invoked locally or remotely.  
         [0077]     In Step  307 , the portlets return the web contents of the portlets.  
         [0078]     In Step  308 , the portlet service module sends back a response with the web contents of the portlets to the web browser. During this step, the web contents should be rewritten so as to redirect the requests therein to XMLHTTP. The rewriting operation can happen at the beginning or at the end of Step  308 , that is, the rewriting operation can be implemented in the portal server or portlet monitor at client side.  
         [0079]     In Step  309 , the web contents of the portlets are replaced with the new ones.  
         [0080]     In Step  310  the web browser displays the web contents When the web contents of all the portlets are obtained, the whole portal page is displayed.  
         [0000]     2) Portal Page Initialization Mechanism (Downloading Both a Portlet Monitor and Web Contents)  
         [0081]      FIG. 3   b  is a sequence chart showing a portal page initialization mechanism (downloading both a portlet monitor and web contents) according to another preferred embodiment of the present invention.  
         [0082]     Referring to  FIG. 3   b , in the mode of downloading both a portlet monitor and web contents, Phase  202   b  comprises Steps  351  to  356 , which perform the function of downloading a portal page.  
         [0083]     In Step  351 , the user inputs a URL in a web browser to send a request to the portal server for obtaining a portal page.  
         [0084]     In Step  352 , the web browser sends the request for a portal page to the initiator.  
         [0085]     In Step  363 , the initiator invokes the portlets to obtaining the web contents of all the portlets in the portal page.  
         [0086]     In Step  354 , the portlets return the web contents of all the portlets. The initiator rewrites the web contents so as to redirect the requests therein to XMLHTTP and combines them into a portal page with a portlet monitor.  
         [0087]     In Step  365 , the initiator returns the portal page to the web browser.  
         [0088]     In Step  356 , the web browser displays the portal page.  
         [0000]     Asynchronous Interaction Mechanism  
         [0089]     Referring to  FIG. 2 , the asynchronous interaction mechanism according to an embodiment of the present invention comprises four phases  203  to  206 A  FIG. 4  shows a sequence chart of the asynchronous interaction mechanism.  
         [0090]     Referring to  FIG. 4 , Phase  203  comprises Steps  401  to  403  and performs the function of sending a XMLHTTP request to the portlet service module through the portlet monitor; Phase  204  comprises Steps  404  to  406  and performs the function of obtaining web contents from portlets. Phase  205  may happen at the beginning or at the end of Step  406 . Phase  206  comprises Steps  407  and  408  and performs the function of replacing the original web contents of the portlets with the received new web contents and displaying them.  
         [0091]     In Step  401 , the user submits a form in a certain portlet.  
         [0092]     In Step  402 , the web browser invokes the portlet monitor so as to send a XMLHTTP request for obtaining the new web contents of the portlet.  
         [0093]     In Step  403 , the portlet monitor asynchronously sends a XMLHTTP request to the portal service. During this step, the user may interact with the portal page without waiting.  
         [0094]     In Step  404 , the portlet service module requests the web contents from the portlet.  
         [0095]     In Step  405 , the portlet returns the web contents of the portlet to the portlet service module.  
         [0096]     In Step  406 , the portlet service module sends a response with the web contents of the portlet to the portlet monitor. Phase  205  happens at the beginning or at the end of Step  406 , that is, Phase  206  may be implemented in the portal server or in the portlet monitor at client side.  
         [0097]     In Step  407 , the portlet monitor replaces the original web contents of the portlet with the new web contents received.  
         [0098]     In Step  408 , the web browser displays a portal page with the new web contents of the portlet without refreshing the whole portal page.  
         [0000]     Web Contents Rewriting Mechanism  
         [0099]     Phase  206  performs the function of web content rewriting. If the original web contents of the portlets are used, any submission will cause the web browser sending a HTTP request, resulting in refreshing the whole page. So the web contents should be rewritten to redirect any submission to XMLHTTP, so as to partially refresh the portal page. In an embodiment of the present invention, the rewriting process comprises two steps, that is, HTML rewriting and script rewriting.  
         [0100]     Next, these two steps will be described in detail based on principles and examples. In the following examples, function “xmlAction” will send a request through XMLHTTP and partially refresh the new portal page. In a typical implementation, the program of the portlet monitor should be stored in a separate script file in order to reuse it in different portal pages. For instance:
 
&lt;script src=“xmlaction.js”/&gt;&lt;/script&gt;
 
         [0101]     When different portal programs depend on the script file, the web browser may cache the script file.  
         [0000]     1) HTML Rewriting  
         [0102]     For any HTML link tag, if it points to an Action URL, a special script function call is used to replace the “href” attribute.  
         [0103]     For instance,
 
&lt;a href=“actionurl”&gt;link&lt;|a&gt;
 
 will be replaced with
 
&lt;a href=“javascript:xmlAction(‘actionurl’)”&gt;link&lt;/a&gt;
 
and
 
&lt;a href=“javascript:form.submit( )”&gt;link&lt;/a&gt;
 
 will be replaced with
 
&lt;a href=“javascript.xmlAction(form)”&gt;link&lt;/a&gt;
 
         [0104]     For any HTML form fag, if its “action” attribute equals to an Action URL, a special script function call is used to replace the “action” attribute.  
         [0105]     For instance,
 
&lt;form action=“actionurl”&gt;
 
&lt;input type=“submit” value=“submit”/&gt;
 
&lt;/form&gt;
 
 will be replaced with
 
&lt;form action=“actionurl” onsubmit=“xmlAction(‘actionurl’)”&gt;
 
&lt;input type=“submit” value=“submit”/&gt;
 
&lt;form&gt;
 
 2) Script Rewriting 
 
         [0106]     For any script statement that sends a HTTP request using the “GET” method, a special script function call is used to replace it.  
         [0107]     For instance,  
         [0108]     document location.href=“actionurl”;  
         [0000]     will be replaced with  
         [0109]     xmlAction(“actionurl”);  
         [0110]     For any script statement that sends an HTTP request using the POST” method, a special script function call is used to replace it.  
         [0111]     For instance,  
         [0112]     form.submit( );  
         [0000]     will be replaced with  
         [0113]     xmlAction(form);  
         [0114]     Above, embodiments of the present invention have been described, the description being illustrative and not restrictive. Various modifications may be made to the present invention without departing from the spirit and scope of the invention. For instance, the portlet monitor may be implemented in any script language that may runs on a browser. Furthermore, when the web content rewriting means is implemented in a portal server, it may either be integrated in the portlet service module or as a separate component, and may be connected with other components in various manners and orders. And when the web content rewriting means is implemented at the portlet monitor, it may either be a part of the portlet monitor or a separate component invoked by the portlet monitor. Besides, the functional modules in the embodiments of the present invention may either exist separately or be combined together in various manners, and may be implemented in hardware, software, firmware or any combination of them as long as being able to realize the functions of the present invention. Furthermore, the terms used in this specification are descriptive, and for the purpose of making those skilled in the art to understand the essence of the invention, not for imposing strict restrictions on the invention. The scope of the invention is uniquely defined by following claims.