org.apache.cocoon.portal.impl
Class LinkInfo

java.lang.Object
  extended by org.apache.cocoon.portal.impl.LinkInfo
Direct Known Subclasses:
PageLabelLinkInfo

public class LinkInfo
extends Object

Helper class containing the information about common parts for each link that will be generated in the portal page.

Version:
$Id: LinkInfo.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  ArrayList comparableEvents
           
protected  boolean hasParameters
           
protected  String httpLinkBase
          Link base contains the base url for the http protocol.
protected  boolean isSecure
          Is the page called using https?
protected  Request request
           
protected  String secureLinkBase
           
protected  StringBuffer url
           
 
Constructor Summary
LinkInfo(Request request, int defaultPort, int defaultSecurePort)
           
 
Method Summary
 void addParameterToBase(String name, String value)
           
 LinkInfo appendToBase(char c)
           
 LinkInfo appendToBase(String value)
           
 void deleteParameterFromBase(String parameterName)
           
protected  String getAbsoluteUrl(Request request, boolean useSecure, int port)
          Return the absolute URL for a reqeust
 String getBase(Boolean secure)
           
protected  String getHttpLinkBase(Request request, String relativeURI, int defaultPort)
          Return the url for an http request
protected  String getRelativeURI(Request request)
           
protected  String getSecureLinkBase(Request request, String relativeURI, int defaultPort)
          Return the base url for a secure http request
 boolean hasParameters()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpLinkBase

protected final String httpLinkBase
Link base contains the base url for the http protocol.


secureLinkBase

protected final String secureLinkBase

hasParameters

protected boolean hasParameters

comparableEvents

protected final ArrayList comparableEvents

url

protected final StringBuffer url

request

protected final Request request

isSecure

protected final boolean isSecure
Is the page called using https?

Constructor Detail

LinkInfo

public LinkInfo(Request request,
                int defaultPort,
                int defaultSecurePort)
Method Detail

getRelativeURI

protected String getRelativeURI(Request request)

getSecureLinkBase

protected String getSecureLinkBase(Request request,
                                   String relativeURI,
                                   int defaultPort)
Return the base url for a secure http request

Parameters:
relativeURI - The current relative URI
defaultPort - The default port to use
Returns:
A String containing the base url for a secure http request

getHttpLinkBase

protected String getHttpLinkBase(Request request,
                                 String relativeURI,
                                 int defaultPort)
Return the url for an http request

Parameters:
relativeURI - The current relative URI
defaultPort - The default port to use
Returns:
A string containing the base url for an http request

getAbsoluteUrl

protected String getAbsoluteUrl(Request request,
                                boolean useSecure,
                                int port)
Return the absolute URL for a reqeust

Parameters:
request - The current Request
useSecure - true if the Request should be secure
port - The port to use
Returns:
A String containing the absolute url for a request

getBase

public String getBase(Boolean secure)

appendToBase

public LinkInfo appendToBase(String value)

appendToBase

public LinkInfo appendToBase(char c)

deleteParameterFromBase

public void deleteParameterFromBase(String parameterName)

addParameterToBase

public void addParameterToBase(String name,
                               String value)

hasParameters

public boolean hasParameters()


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.