com.ibm.portal.resolver.uri
Class PortletURI

java.lang.Object
  extended by com.ibm.portal.resolver.uri.BaseURI
      extended by com.ibm.portal.resolver.uri.PortletURI
All Implemented Interfaces:
Identifiable, Addressable, Constants

public class PortletURI
extends BaseURI
implements Addressable, Constants, Identifiable

Handles URIs of the format

   portlet:<portletWindowID>:<pageID>[:<pocURI>]
 
in case there are colons in the portletWindowID or pageID they must be escaped using URL escaping. pocURI does not need to be escaped specifically. The IDs can either be serialized objectIDs or unique names.


Field Summary
static java.lang.String COPYRIGHT
          copyright
protected static int LOG_LEVEL
          logging level
protected static Logger LOGGER
          class logger
protected  ObjectID pageID
          Object ID of the addressed page
protected  java.net.URI pocURI
          pocURI in the scope of the page/portlet
protected  ObjectID portletWindowID
          Object ID of the addressed portlet window
 
Fields inherited from interface com.ibm.portal.resolver.Constants
ALL_BINDING_SET, ALL_BINDINGS, DEFAULT_BINDING_SET, DEFAULT_BINDINGS, DEFAULT_POST_BINDING_SET, DEFAULT_POST_BINDINGS, HTTP_BINDING, HTTP_DELETE_BINDING, HTTP_GET_BINDING, HTTP_POST_BINDING, KEY_DIGEST, KEY_MIME_TYPE, KEY_MODE, KEY_POCURI_PARAM, KEY_URI, KEY_VERB, PORTLET_CONTENT_LOCATION_TYPE, RESOLVER_EXTENSION_POINT, SCHEME_PORTLET, VALUE_DOWNLOAD, VALUE_LOOKUP, VALUE_VIEW, WP_SELECTION_BINDING
 
Fields inherited from interface com.ibm.portal.resolver.uri.Constants
ESCAPE_CHAR, ESCAPE_STRG
 
Constructor Summary
com.ibm.portal.identification.Identification)">PortletURI(java.net.URI portletURI, Identification id)
          Tokenizes the uri into the components that make up a portlet URI
 
Method Summary
 ObjectID getObjectID()
          Returns the object ID of the portlet window
 ObjectID getPageID()
          Returns the objectID of the page
 java.util.Map<java.lang.String,java.lang.String[]> getParameters()
          Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.
 java.net.URI getPocURI()
           
 ObjectID getPortletWindowID()
          Returns the objectID of the portlet window.
 java.net.URI getURI()
          Returns the unique identifier of the object
static java.net.URI com.ibm.portal.identification.Identification)">newInstance(ObjectID portletWindowID, ObjectID pageID, java.net.URI pocURI, Identification id)
          Constructs a new URI that matches the pattern of a portlet URI.
 
Methods inherited from class com.ibm.portal.resolver.uri.BaseURI
createURI, createURI, java.io.StringWriter)">decode, decode, decode, java.io.Writer, java.lang.String)">encode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
copyright


LOG_LEVEL

protected static final int LOG_LEVEL
logging level


LOGGER

protected static final Logger LOGGER
class logger


pageID

protected final ObjectID pageID
Object ID of the addressed page


pocURI

protected final java.net.URI pocURI
pocURI in the scope of the page/portlet


portletWindowID

protected final ObjectID portletWindowID
Object ID of the addressed portlet window

Constructor Detail
com.ibm.portal.identification.Identification)">

PortletURI

public PortletURI(java.net.URI portletURI,
                  Identification id)
           throws SerializationException,
                  java.net.URISyntaxException,
                  java.io.IOException
Tokenizes the uri into the components that make up a portlet URI

Parameters:
portletURI - uri to decode
id - identification service used for string deserialization
Throws:
SerializationException - for errors during the serialization or deserialization of object IDs.
java.net.URISyntaxException - if a POCURI is available and if this URI is not a valid URI
java.io.IOException - for errors during the decoding process
Method Detail
com.ibm.portal.identification.Identification)">

newInstance

public static final java.net.URI newInstance(ObjectID portletWindowID,
                                             ObjectID pageID,
                                             java.net.URI pocURI,
                                             Identification id)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
portletWindowID - objectID to the portlet window
pageID - objectID of the page that contains the portlet window
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
java.net.URISyntaxException
java.io.IOException

getObjectID

public ObjectID getObjectID()
Returns the object ID of the portlet window

Specified by:
getObjectID in interface Identifiable
Returns:
the ObjectID of this resource, this can never be null
See Also:
Identifiable.getObjectID()

getPageID

public ObjectID getPageID()
Returns the objectID of the page

Returns:
the page ID, never null

getParameters

public java.util.Map<java.lang.String,java.lang.String[]> getParameters()
Description copied from interface: Addressable

Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.

The key is of type String, the values of type String[]

Specified by:
getParameters in interface Addressable
Returns:
parameter map

getPocURI

public java.net.URI getPocURI()
Returns:
the POC URI, potentially null

getPortletWindowID

public ObjectID getPortletWindowID()
Returns the objectID of the portlet window.

Returns:
the window ID, never null

getURI

public java.net.URI getURI()
                    throws java.net.URISyntaxException
Description copied from interface: Addressable
Returns the unique identifier of the object

Specified by:
getURI in interface Addressable
Returns:
URI of the object, never null
Throws:
java.net.URISyntaxException - - if the URL cannot be constructed