@StableMinor(version="12.0", sinceVersion="4.0") public class GenericHyperLinkResolver extends Object implements IHyperLinkResolver
Constructor and Description |
---|
GenericHyperLinkResolver() |
Modifier and Type | Method and Description |
---|---|
protected IServiceInterfaceUrl |
createUrl(SessionConfig sessionConfig,
HyperLinkConfig hyperLinkConfig,
String pageId,
ITransaction transaction)
Creates an URL for the given hyperlink.
|
protected boolean |
interfaceInstanceCanBeUsedAsLinkTarget(String interfaceInstanceId)
Returns whether the interface instance with the given identifier can be used in hyperlinks or not.
|
protected void |
keepPagePreviousState(IServiceInterfaceUrl url,
HyperLinkConfig hyperLinkConfig)
Configures the URL object to keep the current page previous parameters.
|
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.
|
public IServiceInterfaceUrl resolveHyperLink(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction) throws PortalException
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.
Otherwise, if the requested interface and service instance can be resolved to be displayed in an auto administration page, a URL to it is returned.
Otherwise null
is returned.
resolveHyperLink
in interface IHyperLinkResolver
sessionConfig
- the user session information.hyperLinkConfig
- hyperlink informationtransaction
- the transaction for persistence access.PortalException
protected IServiceInterfaceUrl createUrl(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, String pageId, ITransaction transaction) throws PortalException
This implementation call
setUrlParameters(SessionConfig, IServiceInterfaceUrl, Map, ITransaction)
to fill the created URL's 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.PortalException
protected void keepPagePreviousState(IServiceInterfaceUrl url, HyperLinkConfig hyperLinkConfig)
HyperLinkConfig.HyperLinkConfig(IServiceInterfaceRequest, lumis.portal.serviceinterface.IServiceInterfaceResponse)
constructor must have been used or this method will have no effect.
Note that the parameters that belongs to the target of the URL will be replaced as defined by the URL. This method is intended to preserve the previous parameters of other targets in the current page.
url
- the URL object.hyperLinkConfig
- the HyperLinkConfig
being used to
create the URL object.IServiceInterfaceUrl.setTargetScope(int, String)
,
HyperLinkConfig.setTargetId(String)
,
HyperLinkConfig.setTargetType(int)
protected void setUrlParameters(SessionConfig sessionConfig, IServiceInterfaceUrl url, Map<String,String[]> parameters, ITransaction transaction) throws PortalException
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.PortalException
PortalRequestParameters.isReservedParameter(String)
protected String resolveDestinationPageId(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction) throws PortalException
resolveDestinationInterfaceId(SessionConfig, HyperLinkConfig, ITransaction)
method for resolving the destination interface id if it is not
specified in the hyperLinkConfig
.sessionConfig
- the user session information.hyperLinkConfig
- the hyperlink.transaction
- the transaction for persistence access.PortalException
protected String resolveDestinationInterfaceId(SessionConfig sessionConfig, HyperLinkConfig hyperLinkConfig, ITransaction transaction) throws PortalException
hyperlinkConfig
sessionConfig
- the user session information.hyperLinkConfig
- the hyperLink information.transaction
- theh transaction for persistence access.PortalException
protected boolean interfaceInstanceCanBeUsedAsLinkTarget(String interfaceInstanceId) throws PortalException
interfaceInstanceId
- the interface instance identifier.PortalException
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.