Change restart settings

 

+

Search Tips   |   Advanced Search

 

Web clipping portlets support an inter-portlet communication mechanism that allows clipping portlets on the same page as a given Web portlet to "restart." That is, portlets that share a page with a Web clipping portlet can reset the Web clipping portlets' state. This is very useful in conjunction with overriding pre-configured settings to cause the Web clipping portlet to restart on a different URL. This mechanism is supported through the use of portlet messages. A portlet sends a message to the Web clipping portlet telling it to restart. The message can be sent to a specific Web clipping portlet on the same page (by name) or to all portlets on the same page. The key is that the sending and the receiving portlets must be on the same page.

In the message-sending portlet's actionPerformed() method, send a DefaultPortletMessage with the message "restart_cliplet". For example:

    getConfig().getContext().send(null, new DefaultPortletMessage("restart_cliplet"));

This causes all clipping portlets on the page to restart at the beginning.

We can also pass a URL parameter so that the Web content with the URL can start. In the DefaultPortletMessage, construct this with the following syntax:

   new DefaultPortletMessage("restart_cliplet:<url>");

Where <url> is the new target URL that we want the clipping portlet to use. Separate the string restart_cliplet string from the URL using a colon.

 

Related information

 

Parent topic:

Use Web clipping to import content