org.apache.cocoon.portal
Interface LinkService

All Known Implementing Classes:
DefaultLinkService

public interface LinkService

This is a central service of the portal. It should be used to create links inside the portal pages.

Version:
$Id: LinkService.java 328469 2005-10-25 20:18:47Z cziegeler $

Nested Class Summary
static class LinkService.ParameterDescription
           
 
Field Summary
static String DEFAULT_REQUEST_EVENT_PARAMETER_NAME
           
static String ROLE
           
 
Method Summary
 void addEventToLink(Event event)
          Add this event to the list of events contained in the uri
 void addParameterToLink(String name, String value)
          Add this parameter to every link.
 void addUniqueParameterToLink(String name, String value)
          Add this parameter to every link.
 String encodeURL(String url)
           
 List getInternalParameterNames()
          A list of parameters that should be filtered when coplets are called.
 String getLinkURI(Event event)
          Get the uri for this coplet containing the additional event
 String getLinkURI(Event event, Boolean secure)
          Get the uri for this coplet containing the additional event and using a secure protocol if requested.
 String getLinkURI(List events)
          Get the uri for this coplet containing the additional events.
 String getLinkURI(List events, Boolean secure)
          Get a uri for this coplet containing the additional events.
 String getRefreshLinkURI()
          Get a link that simply refreshs the portal
 String getRefreshLinkURI(Boolean secure)
          Get a link that simply refreshs the portal
 boolean isInternalParameterName(String name)
          Test if the parameter is an internal one.
 boolean isSecure()
          Determine whether the current url is using a secure protocol
 

Field Detail

ROLE

public static final String ROLE

DEFAULT_REQUEST_EVENT_PARAMETER_NAME

public static final String DEFAULT_REQUEST_EVENT_PARAMETER_NAME
See Also:
Constant Field Values
Method Detail

getLinkURI

public String getLinkURI(Event event)
Get the uri for this coplet containing the additional event

Parameters:
event - The event to add (null is also allowed for convenience)
Returns:
A URI

getLinkURI

public String getLinkURI(Event event,
                         Boolean secure)
Get the uri for this coplet containing the additional event and using a secure protocol if requested.

Parameters:
event - The event to add (null is also allowed for convenience)
secure - true if a secure protocol is required, false otherwise.
Returns:
A URI

getLinkURI

public String getLinkURI(List events)
Get the uri for this coplet containing the additional events.

Parameters:
events - The events to add: These can either be Events or LinkService.ParameterDescriptions.
Returns:
A URI

getLinkURI

public String getLinkURI(List events,
                         Boolean secure)
Get a uri for this coplet containing the additional events. Use a secure protocol if requested.

Parameters:
events - The events to add: These can either be Events or LinkService.ParameterDescriptions.
secure - true if a secure protocol is required, false otherwise.
Returns:
A URI

addEventToLink

public void addEventToLink(Event event)
Add this event to the list of events contained in the uri

Parameters:
event - Event to add

addParameterToLink

public void addParameterToLink(String name,
                               String value)
Add this parameter to every link. If the link already contains a parameter with this name, then the link will have both parameters with the same name, but different values.

Parameters:
name - The request parameter name
value - The value for the parameter
See Also:
addUniqueParameterToLink(String, String)

addUniqueParameterToLink

public void addUniqueParameterToLink(String name,
                                     String value)
Add this parameter to every link. If the link already contains a parameter with this name, then this old parameter will be removed and replaced by the new one.

Parameters:
name - The request parameter name
value - The value for the parameter
See Also:
addUniqueParameterToLink(String, String)

getRefreshLinkURI

public String getRefreshLinkURI()
Get a link that simply refreshs the portal

Returns:
A URI

getRefreshLinkURI

public String getRefreshLinkURI(Boolean secure)
Get a link that simply refreshs the portal

Parameters:
secure - true if a secure protocol is required, false otherwise.
Returns:
A URI

isSecure

public boolean isSecure()
Determine whether the current url is using a secure protocol

Returns:
true if the current url is using a secure protocol

encodeURL

public String encodeURL(String url)
Parameters:
url - The url to encode.
Returns:
The enocoded URL.
See Also:
HttpServletResponse.encodeURL(java.lang.String)

getInternalParameterNames

public List getInternalParameterNames()
A list of parameters that should be filtered when coplets are called. The list might consist of either a parameter name (string) or a prefix (string). A prefix ends with a '*'.

Returns:
A list of strings. This method always returns a list.

isInternalParameterName

public boolean isInternalParameterName(String name)
Test if the parameter is an internal one.



Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.