lumis.portal.hyperlink
Class GenericHyperLinkResolver

Package class diagram package GenericHyperLinkResolver
java.lang.Object
  extended by lumis.portal.hyperlink.GenericHyperLinkResolver
All Implemented Interfaces:
IHyperLinkResolver
Direct Known Subclasses:
DouiHyperLinkResolver

@StableMinor(version="5.5",
             sinceVersion="4.0")
public class GenericHyperLinkResolver
extends Object
implements IHyperLinkResolver

A generic implementation for resolving hyperlinks. This implementation contains some protected methods that may be overriden for easier customization.

Since:
4.0.10

Constructor Summary
GenericHyperLinkResolver()
           
 
Method Summary
protected  IServiceInterfaceUrl createUrl(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, String pageId, ITransaction transaction)
          Creates an URL for the given hyperlink.
protected  String resolveDestinationInterfaceId(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction)
          Resolves the interface that should be the destination for the given hyperlinkConfig
protected  String resolveDestinationPageId(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction)
          Tries to resolve the destination page for the specified hyperlink.
 IServiceInterfaceUrl resolveHyperLink(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction)
          Resolves an hyperlink to the corresponding URL.
protected  void setUrlParameters(SessionConfig sessionConfig, IServiceInterfaceUrl url, Map<String,String[]> parameters, ITransaction transaction)
          Replaces the parameters in the url with the parameters in the given map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericHyperLinkResolver

public GenericHyperLinkResolver()
Method Detail

resolveHyperLink

public IServiceInterfaceUrl resolveHyperLink(SessionConfig sessionConfig,
                                             HyperLinkConfig hyperLinkConfig,
                                             ITransaction transaction)
                                      throws PortalException
Resolves an hyperlink to the corresponding URL.

If no destination service interface instance was specified in the hyperLinkConfig, then this method calls resolveDestinationPageId(SessionConfig, HyperLinkConfig, ITransaction) to resolve the destination page. If there is a destination service interface instance or a destination page could be resolved, then createUrl(SessionConfig, HyperLinkConfig, String, ITransaction) is called to create the resulting URL, else null is returned.

Specified by:
resolveHyperLink in interface IHyperLinkResolver
Parameters:
sessionConfig - the user session information.
hyperLinkConfig - hyperlink information
transaction - the transaction for persistence access.
Returns:
the url, or null if the hyperlink could not be resolved.
Throws:
PortalException

createUrl

protected IServiceInterfaceUrl createUrl(SessionConfig sessionConfig,
                                         HyperLinkConfig hyperLinkConfig,
                                         String pageId,
                                         ITransaction transaction)
                                  throws PortalException
Creates an URL for the given hyperlink.

This implementation call setUrlParameters(SessionConfig, IServiceInterfaceUrl, Map, ITransaction) to fill the created URL's parameters.

Parameters:
sessionConfig - the user session information.
hyperLinkConfig - the hyperlink value.
pageId - the destination page. If null the created URL will not have an explicit pageId specified.
transaction - the transaction for persistence access.
Returns:
the created URL, or null if the arguments could not be resolved into a URL.
Throws:
PortalException
Since:
4.0.10

setUrlParameters

protected void setUrlParameters(SessionConfig sessionConfig,
                                IServiceInterfaceUrl url,
                                Map<String,String[]> parameters,
                                ITransaction transaction)
                         throws PortalException
Replaces the parameters in the url with the parameters in the given map. To customize the parameters set in the url, this method may be overrided.

Parameters:
sessionConfig - the user session information.
url - the url to set parameters.
parameters - the parameters to set in the url.
transaction - the transaction for persistence access.
Throws:
PortalException
Since:
4.0.10
See Also:
PortalRequestParameters.isReservedParameter(String)

resolveDestinationPageId

protected String resolveDestinationPageId(SessionConfig sessionConfig,
                                          HyperLinkConfig hyperLinkConfig,
                                          ITransaction transaction)
                                   throws PortalException
Tries to resolve the destination page for the specified hyperlink. Calls the resolveDestinationInterfaceId(SessionConfig, HyperLinkConfig, ITransaction) method for resolving the destination interface id if it is not specified in the hyperLinkConfig.

Parameters:
sessionConfig - the user session information.
hyperLinkConfig - the hyperlink.
transaction - the transaction for persistence access.
Returns:
the pageId, or null if the destination page could not be resolved.
Throws:
PortalException
Since:
4.0.10

resolveDestinationInterfaceId

protected String resolveDestinationInterfaceId(SessionConfig sessionConfig,
                                               HyperLinkConfig hyperLinkConfig,
                                               ITransaction transaction)
                                        throws PortalException
Resolves the interface that should be the destination for the given hyperlinkConfig

Parameters:
sessionConfig - the user session information.
hyperLinkConfig - the hyperLink information.
transaction - theh transaction for persistence access.
Returns:
the resolved destination interface id, or null if it could not be resolved.
Throws:
PortalException
Since:
4.0.10


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.