org.apache.wsrp4j.consumer.app.driver
Class URLTemplateComposerImpl

java.lang.Object
  extended byorg.apache.wsrp4j.consumer.app.driver.URLTemplateComposerImpl
All Implemented Interfaces:
URLTemplateComposer

public class URLTemplateComposerImpl
extends java.lang.Object
implements URLTemplateComposer

This class implements the URLTemplateComposer interface providing methods to generate URL templates.

The generated templates will be transmitted to Producers (or respectively portlets) that are willing to properly write URLs for a Consumer. (With templates the Consumer indicates how it needs URLs formatted in order to process them properly.)

Version:
$Id: URLTemplateComposerImpl.java,v 1.4 2005/08/15 12:31:09 cziegeler Exp $
Author:
Stefan Behl

Field Summary
private static URLTemplateComposer instance
           
private  URLGenerator urlGenerator
           
 
Constructor Summary
private URLTemplateComposerImpl()
           
 
Method Summary
 java.lang.String createBlockingActionTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a blocking action template.
 java.lang.String createDefaultTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a default template.
 java.lang.String createRenderTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a render template.
 java.lang.String createResourceTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a resource template.
 java.lang.String createSecureBlockingActionTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a secure blocking action template.
 java.lang.String createSecureDefaultTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a secure default template.
 java.lang.String createSecureRenderTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a secure render template.
 java.lang.String createSecureResourceTemplate(boolean includePortletHandle, boolean includeUserContextKey, boolean includePortletInstanceKey, boolean includeSessionID)
          Creates a secure resource template.
private  java.lang.String createTemplate(java.lang.String url, boolean needsURLType, boolean needsPortletMode, boolean needsNavState, boolean needsInteractionState, boolean needsWinState, boolean needsSecURL, boolean needsURL, boolean needsRewriteResource, boolean needsPortletHandle, boolean needsUserContextKey, boolean needsPortletInstanceKey, boolean needsSessionID)
           
static URLTemplateComposer getInstance()
           
 java.lang.String getNamespacePrefix()
          Get the consumers namespace prefix which is used by the portlet to namespace tokens which need to be unique on a aggregated page.
private  java.lang.String insertPair(java.lang.String token)
           
 void setURLGenerator(URLGenerator urlGenerator)
          Sets the url generator to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static URLTemplateComposer instance

urlGenerator

private URLGenerator urlGenerator
Constructor Detail

URLTemplateComposerImpl

private URLTemplateComposerImpl()
Method Detail

getInstance

public static URLTemplateComposer getInstance()

setURLGenerator

public void setURLGenerator(URLGenerator urlGenerator)
Sets the url generator to be used.

Specified by:
setURLGenerator in interface URLTemplateComposer

createBlockingActionTemplate

public java.lang.String createBlockingActionTemplate(boolean includePortletHandle,
                                                     boolean includeUserContextKey,
                                                     boolean includePortletInstanceKey,
                                                     boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a blocking action template. Includes tokens for url-type, portletMode, navigationalState, interactionState and windowState to be replaced by the producer.

Specified by:
createBlockingActionTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createSecureBlockingActionTemplate

public java.lang.String createSecureBlockingActionTemplate(boolean includePortletHandle,
                                                           boolean includeUserContextKey,
                                                           boolean includePortletInstanceKey,
                                                           boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a secure blocking action template. Includes tokens for url-type, portletMode, navigationalState, interactionState, windowState and secureURL to be replaced by the producer.

Specified by:
createSecureBlockingActionTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createRenderTemplate

public java.lang.String createRenderTemplate(boolean includePortletHandle,
                                             boolean includeUserContextKey,
                                             boolean includePortletInstanceKey,
                                             boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a render template. Includes tokens for url-type, portletMode, navigationalState, interactionState and windowState to be replaced by the producer.

Specified by:
createRenderTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createSecureRenderTemplate

public java.lang.String createSecureRenderTemplate(boolean includePortletHandle,
                                                   boolean includeUserContextKey,
                                                   boolean includePortletInstanceKey,
                                                   boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a secure render template. Includes tokens for url-type, portletMode, navigationalState, interactionState, windowState and secureURL to be replaced by the producer.

Specified by:
createSecureRenderTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createResourceTemplate

public java.lang.String createResourceTemplate(boolean includePortletHandle,
                                               boolean includeUserContextKey,
                                               boolean includePortletInstanceKey,
                                               boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a resource template. Includes tokens for url-type, rewriteResource and url to be replaced by the producer.

Specified by:
createResourceTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createSecureResourceTemplate

public java.lang.String createSecureResourceTemplate(boolean includePortletHandle,
                                                     boolean includeUserContextKey,
                                                     boolean includePortletInstanceKey,
                                                     boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a secure resource template. Includes tokens for url-type, url, rewriteResource, and secureURL to be replaced by the producer.

Specified by:
createSecureResourceTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createDefaultTemplate

public java.lang.String createDefaultTemplate(boolean includePortletHandle,
                                              boolean includeUserContextKey,
                                              boolean includePortletInstanceKey,
                                              boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a default template. Includes tokens for url-type, portletMode, navigationalState, interactionState, windowState, url, rewriteResource and secureURL to be replaced by the producer.

Specified by:
createDefaultTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

createSecureDefaultTemplate

public java.lang.String createSecureDefaultTemplate(boolean includePortletHandle,
                                                    boolean includeUserContextKey,
                                                    boolean includePortletInstanceKey,
                                                    boolean includeSessionID)
Description copied from interface: URLTemplateComposer
Creates a secure default template. Includes tokens for url-type, portletMode, navigationalState, interactionState, windowState, url, rewriteResource and secureURL to be replaced by the producer.

Specified by:
createSecureDefaultTemplate in interface URLTemplateComposer
Returns:
String representing the entire template.

getNamespacePrefix

public java.lang.String getNamespacePrefix()
Description copied from interface: URLTemplateComposer
Get the consumers namespace prefix which is used by the portlet to namespace tokens which need to be unique on a aggregated page.

Specified by:
getNamespacePrefix in interface URLTemplateComposer
Returns:
The namespace prefix of the consumer.

createTemplate

private java.lang.String createTemplate(java.lang.String url,
                                        boolean needsURLType,
                                        boolean needsPortletMode,
                                        boolean needsNavState,
                                        boolean needsInteractionState,
                                        boolean needsWinState,
                                        boolean needsSecURL,
                                        boolean needsURL,
                                        boolean needsRewriteResource,
                                        boolean needsPortletHandle,
                                        boolean needsUserContextKey,
                                        boolean needsPortletInstanceKey,
                                        boolean needsSessionID)

insertPair

private java.lang.String insertPair(java.lang.String token)


--