com.iplanet.portalserver.providers
Class DesktopURL

java.lang.Object
  |
  +--com.iplanet.portalserver.providers.DesktopURL

public class DesktopURL
extends java.lang.Object

This class helps build URLs that refer back to the iPS Desktop Servlet.

Instead of returning content from a POST operation, the iPS desktop sends a redirect back to itself, thereby issuing a GET for the following content. It follows that the result of channel's edit form is also a redirect back to the iPS desktop. Specifically, the iPS desktop redirects itself to the URL returned from the provider's processEdit() method.

Note that the return value of processEdit() is a simple URL. It is not necessary to use this class to build URLs.

URLs formed by this class always use the standard iPS protocol, server, and port.

iPS Desktop URLs consist of an action, a provider to apply the action to, and one or more supporting parameters. The following are the recognized actions:

If the action parameter is not present, it default to "content".

In addition, the following parameters are used:

Here are some example desktop URLs. The following will create a URL to instruct the desktop to display the content from a provider named "iwtFooProvider":

DesktopURL dtu = new DesktopURL(session, "action=content&provider=iwtFooProvider");

The following will create a URL that would log the user out of the IPS platform when accessed:

DesktopURL dtu = new DesktopURL("/logout");

The following will create a URL that will load the iPS desktop's options page:

DesktopURL dtu = new DesktopURL(session, "action=edit&provider==iwtOptionsProvider");

The following will create a URL that causes the provider named "iwtBobProvider" to be removed from the desktop, and the desktop's front page to be refreshed:

DesktopURL dtu = new DesktopURL(session, "action=remove&provider=iwtBobProvider");

See Also:
Provider.processEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), URL

Constructor Summary
DesktopURL(Session s)
          Construct the default desktop URL to fetch the front page.
DesktopURL(Session s, java.lang.String params)
          Construct a desktop URL with custom parameters.
DesktopURL(java.lang.String u)
          Construct a custom desktop url.
DesktopURL(java.net.URL u)
          Construct a desktop URL based on an existing URL.
 
Method Summary
 java.net.URL getURL()
          Get the internally built URL object.
 java.lang.String toString()
          Get the URL as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DesktopURL

public DesktopURL(Session s)
Construct the default desktop URL to fetch the front page.

DesktopURL

public DesktopURL(Session s,
                  java.lang.String params)
Construct a desktop URL with custom parameters.
Parameters:
params - The custom parameters. The format should be identical to that of GET parameters in a URL. E.g., "action=foo&val=bob". Note that all parameter values should be URL URL encoded.

DesktopURL

public DesktopURL(java.net.URL u)
Construct a desktop URL based on an existing URL.

DesktopURL

public DesktopURL(java.lang.String u)
Construct a custom desktop url. If the argument starts with "http", then it is assumed that it represents an absolute URL. Otherwise, the argument is assumed to be relative (only the file portion of the URL). In this case, the local server's protocol, name, and port are prepended to the argument to form a valid URL.
Parameters:
u - Either an absolute (such as "http://foo.bar.com/farble.html") or relative (such as "farble.html") URL.
Method Detail

getURL

public java.net.URL getURL()
Get the internally built URL object.
Returns:
The URL object.
See Also:
URL

toString

public java.lang.String toString()
Get the URL as a String. If the URL references the standard iPS protocol, server and port, the returned string is a relative URL. Otherwise it is an absolute URL.
Overrides:
toString in class java.lang.Object
Returns:
The URL as a String.