Interface IURLManager
-
- All Known Implementing Classes:
URLManager
public interface IURLManager
Provides URL resolution and mapping management.- Since:
- 5.0.0
- Version:
- $Revision: 24837 $ $Date: 2022-02-07 17:36:22 -0300 (Mon, 07 Feb 2022) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IURLManager.CreateStrategy
Contains creation strategy options.static class
IURLManager.PathReferenceType
Used to specify how html references should be made.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTO_GENERATE_WEB_RESOURCE_PROPERTY_NAME
Property used to indicate the automatic generation of web resources.static java.lang.String
EXTENSION_HTML_PROPERTY_NAME
Property used to indicate the extension to be used for HTML web resources.static java.lang.String
EXTENSION_SHTML_PROPERTY_NAME
Property used to indicate the extension to be used for SHTML web resources.static java.lang.String
FORCE_FIRST_PAGE_LINK_TO_CHANNEL_LINK_PROPERTY_NAME
Property used to indicate that links to the first page of a channel should link to the channel web resource instead.static java.lang.String
FRIENDLY_URL_ENABLE_PROPERTY_NAME
The name of the property that indicates where friendly URL is enabled.static java.lang.String
FRIENDLY_URL_PATTERN_PROPERTY_NAME
The name of a default property that contains a pattern for the IURLResolver.static java.lang.String
PATH_REFERENCE_TYPE_PROPERTY_NAME
Property name to define how paths should be fixed.static java.lang.String
URL_RESOLVER_PROPERTY_NAME
The name of the property where the class name of theIURLResolver
implementation is stored.static java.lang.String
WEBSITE_PROPERTY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.lang.String
convertHTMLPathsToDynamicPaths(java.lang.String html)
Deprecated.Since 6.2.0, replaced byconvertHTMLPathsToDynamicPaths(String, IWebsite)
due to the inclusion of multiple websites feature.java.lang.String
convertHTMLPathsToDynamicPaths(java.lang.String html, IWebsite baseWebsite)
Deprecated.since 8.2.0 replaced byprocessHTML(String, IPageWebResourceRenderRequest)
.java.lang.String
convertHTMLPathToDynamicPath(java.lang.String href, IWebsite baseWebsite)
Replaces the given path to web resource by the corresponding dynamic path.void
deleteWebResourceRedirection(java.lang.String sourceWebsiteId, java.lang.String sourcePath)
Deletes the web resource redirection rule for the specified source website and path.void
deleteWebResourcesFromPage(java.lang.String pageId)
Delete allweb resources
from the page that has the given identifier.void
deleteWebResourcesInChannelTree(java.lang.String rootChannelId)
Delete allweb resources
in the tree for which the root is the givenrootChannelId
.WebResource
findWebResourceByPathAndWebsite(java.lang.String websiteId, java.lang.String path)
Finds a web resource by it's website identifier and path.java.lang.String
fixReferencesAccordingToPath(java.lang.String html, java.lang.String path)
Deprecated.since 8.2.0 replaced byfixReferencesAccordingToPath(String, String, IPortalMode, String)
java.lang.String
fixReferencesAccordingToPath(java.lang.String html, java.lang.String path, IPortalMode portalMode)
Deprecated.since 8.2.0 replaced byfixReferencesAccordingToPath(String, String, IPortalMode, String)
java.lang.String
fixReferencesAccordingToPath(java.lang.String html, java.lang.String path, IPortalMode portalMode, java.lang.String pageId)
Fixes references within an HTML according to the given path.default WebResource
getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy)
Returns a web resource for the given dynamic path.default WebResource
getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy, java.util.Locale locale)
Returns a web resource for the given dynamic path.WebResource
getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy, java.util.Locale locale, WebResource creator)
Returns a web resource for the given dynamic path.java.util.Collection<WebResource>
getWebResourceByParameterAndValue(java.lang.String parameterName, java.lang.String parameterValue)
Get allweb resources
that fits the given parameter name with the given parameter value.java.lang.String
getWebResourcePathByDynamicPath(java.lang.String dynamicPath, java.util.Locale locale)
Deprecated.Since 6.2.0, due to inclusion of website feature, the web resource path is not unique, so this method is no longer appropriated for its original purpose of adjusting links URIs.WebResource
getWebResourceToRedirect(java.lang.String sourceWebsiteId, java.lang.String sourcePath)
Returns the web resource to redirect to when the given path on the given website is accessed.default java.net.URI
getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure)
Deprecated.The (portal mode
is now relevant and should be passed as parameter.default java.net.URI
getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure, IPortalMode portalMode)
Returns the URI for referencing a web resource given its dynamic path.java.net.URI
getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure, IPortalMode portalMode, WebResource creator)
Returns the URI for referencing a web resource given its dynamic path.default java.lang.String
processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure)
Deprecated.since 8.2.0 replaced byprocessHref(String, List, String, Locale, IWebsiteBaseURL, boolean, IPortalMode)
.default java.lang.String
processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode)
Deprecated.default java.lang.String
processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode, IURLManager.PathReferenceType pathReferenceType)
Processes a URL to be rendered correctly in a portal page.java.lang.String
processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode, IURLManager.PathReferenceType pathReferenceType, WebResource creator)
Processes a URL to be rendered correctly in a portal page.java.lang.String
processHTML(java.lang.String originalHtml, java.util.Locale locale)
Processes a HTML to be used.java.lang.String
processHTML(java.lang.String originalHtml, java.util.Locale locale, boolean baseSecure, IWebsiteBaseURL baseURL)
Processes a HTML to be used.java.lang.String
processHTML(java.lang.String originalHtml, IPageWebResourceRenderRequest renderRequest)
Processes a HTML to be rendered correctly in a portal page.java.lang.String
processHTMLDynamicPathReferences(java.lang.String html)
Deprecated.Since 6.2.0, replaced byprocessHTMLDynamicPathReferences(String, Locale, IWebsite, boolean)
due to the inclusion of multiple websites feature.java.lang.String
processHTMLDynamicPathReferences(java.lang.String htmlModifiedContent, java.util.Locale locale, boolean convertGuestOnlyCaches)
Deprecated.Since 6.2.0, replaced byprocessHTMLDynamicPathReferences(String, Locale, IWebsite, boolean)
due to the inclusion of multiple websites feature.java.lang.String
processHTMLDynamicPathReferences(java.lang.String htmlContent, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure)
Processes references to dynamic paths in a given HTML code.void
recalculateFriendlyPaths(java.util.Collection<? extends WebResource> webResources)
Calculates and updates friendly paths of the given web resources.void
recalculateFriendlyPathsInChannelTree(java.lang.String rootChannelId)
Calculates and updates friendly paths of allweb resources
in the tree for which the root is the givenrootChannelId
.void
setWebResourcesMissingData(IWebResourceFactory webResourceFactory, java.util.Collection<WebResource> webResources, boolean cacheEnabled, boolean friendlyURLEnabled)
Sets missing data in the given web resources.
-
-
-
Field Detail
-
PATH_REFERENCE_TYPE_PROPERTY_NAME
static final java.lang.String PATH_REFERENCE_TYPE_PROPERTY_NAME
Property name to define how paths should be fixed.- Since:
- 10.0.0
- See Also:
- Constant Field Values
-
URL_RESOLVER_PROPERTY_NAME
static final java.lang.String URL_RESOLVER_PROPERTY_NAME
The name of the property where the class name of theIURLResolver
implementation is stored.- Since:
- 5.0.0
- See Also:
- Constant Field Values
-
WEBSITE_PROPERTY_NAME
static final java.lang.String WEBSITE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
FRIENDLY_URL_ENABLE_PROPERTY_NAME
static final java.lang.String FRIENDLY_URL_ENABLE_PROPERTY_NAME
The name of the property that indicates where friendly URL is enabled.- Since:
- 5.0.0
- See Also:
- Constant Field Values
-
FRIENDLY_URL_PATTERN_PROPERTY_NAME
static final java.lang.String FRIENDLY_URL_PATTERN_PROPERTY_NAME
The name of a default property that contains a pattern for the IURLResolver.- Since:
- 5.0.0
- See Also:
- Constant Field Values
-
FORCE_FIRST_PAGE_LINK_TO_CHANNEL_LINK_PROPERTY_NAME
static final java.lang.String FORCE_FIRST_PAGE_LINK_TO_CHANNEL_LINK_PROPERTY_NAME
Property used to indicate that links to the first page of a channel should link to the channel web resource instead. Defaults totrue
.- Since:
- 6.0.0
- See Also:
#convertFirstPagePathToChannelPath(String)
, Constant Field Values
-
EXTENSION_HTML_PROPERTY_NAME
static final java.lang.String EXTENSION_HTML_PROPERTY_NAME
Property used to indicate the extension to be used for HTML web resources. Defaults tohtmlGeneration/htmlFileExtension
specified inlumisportalconfig.xml
.- Since:
- 6.0.0
- See Also:
EXTENSION_SHTML_PROPERTY_NAME
, Constant Field Values
-
EXTENSION_SHTML_PROPERTY_NAME
static final java.lang.String EXTENSION_SHTML_PROPERTY_NAME
Property used to indicate the extension to be used for SHTML web resources. Defaults tohtmlGeneration/shtmlFileExtension
specified inlumisportalconfig.xml
.- Since:
- 6.0.0
- See Also:
EXTENSION_HTML_PROPERTY_NAME
, Constant Field Values
-
AUTO_GENERATE_WEB_RESOURCE_PROPERTY_NAME
static final java.lang.String AUTO_GENERATE_WEB_RESOURCE_PROPERTY_NAME
Property used to indicate the automatic generation of web resources. By default it is disabled. A value of"true"
enables it.- Since:
- 14.0.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getWebResourcePathByDynamicPath
@Deprecated java.lang.String getWebResourcePathByDynamicPath(java.lang.String dynamicPath, java.util.Locale locale) throws PortalException
Deprecated.Since 6.2.0, due to inclusion of website feature, the web resource path is not unique, so this method is no longer appropriated for its original purpose of adjusting links URIs. Consider usinggetWebResourceURI(String, Locale, IWebsite, boolean)
instead.Returns the path for accessing the web resource of the given dynamic path. Uses theAUTO
strategy for getting the web resource.The returned path may be a variant from the real web resource path, according to the dynamicPath parameters and other configurations.
- Parameters:
dynamicPath
- the dynamic path.locale
- the the web resource locale.- Returns:
- the path for accessing the web resource.
- Throws:
PortalException
- Since:
- 5.6.0
-
getWebResourceURI
@Deprecated default java.net.URI getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure) throws PortalException
Deprecated.The (portal mode
is now relevant and should be passed as parameter. Prefer the methodgetWebResourceURI(String, Locale, IWebsite, boolean, IPortalMode)
.Returns the URI for referencing a web resource given its dynamic path.The returned URI may be relative to the specified base website, or absolute if it is not possible to create such relative URI.
- Parameters:
dynamicPath
- the web resource's dynamic path.locale
- the web resource's locale.baseWebsite
- the website the URI is relative to (in case it is generated as relative). May benull
if the base website is unknown. If not specified, the returned URI will be absolute.baseSecure
-true
if the base URL for the returned URI is secure,false
otherwise. If the web resource requires a different secure level (HTTP or HTTPS), the URI will have to be absolute.- Returns:
- the URI to access the specified web resource. It may be relative to the specified base website or absolute.
- Throws:
PortalException
- Since:
- 6.2.0
-
getWebResourceURI
default java.net.URI getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure, IPortalMode portalMode) throws PortalException
Returns the URI for referencing a web resource given its dynamic path.The returned URI may be relative to the specified base website, or absolute if it is not possible to create such relative URI.
- Parameters:
dynamicPath
- the web resource's dynamic path.locale
- the web resource's locale.baseWebsite
- the website the URI is relative to (in case it is generated as relative). May benull
if the base website is unknown. If not specified, the returned URI will be absolute.baseSecure
-true
if the base URL for the returned URI is secure,false
otherwise. If the web resource requires a different secure level (HTTP or HTTPS), the URI will have to be absolute.portalMode
- the desiredIPortalMode
.- Returns:
- the URI to access the specified web resource. It may be relative to the specified base website or absolute.
- Throws:
PortalException
- Since:
- 8.2.0
-
getWebResourceURI
java.net.URI getWebResourceURI(java.lang.String dynamicPath, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure, IPortalMode portalMode, WebResource creator) throws PortalException
Returns the URI for referencing a web resource given its dynamic path.The returned URI may be relative to the specified base website, or absolute if it is not possible to create such relative URI.
- Parameters:
dynamicPath
- the web resource's dynamic path.locale
- the web resource's locale.baseWebsite
- the website the URI is relative to (in case it is generated as relative). May benull
if the base website is unknown. If not specified, the returned URI will be absolute.baseSecure
-true
if the base URL for the returned URI is secure,false
otherwise. If the web resource requires a different secure level (HTTP or HTTPS), the URI will have to be absolute.portalMode
- the desiredIPortalMode
.- Returns:
- the URI to access the specified web resource. It may be relative to the specified base website or absolute.
- Throws:
PortalException
- Since:
- 8.2.0
-
getWebResourceByDynamicPath
default WebResource getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy) throws PortalException
Returns a web resource for the given dynamic path.If the corresponding web resource already exists in the persistence, that instance is returned. Otherwise,
createStrategy
defines the behavior:- NEVER: throws
PortalObjectNotFoundException
. - TRANSIENT: creates and returns a transient web resource.
- AUTO: if the web resource does not have friendly path or cache, behaves as TRANSIENT, otherwise also persists the web resource.
This method uses its own transactions.
- Parameters:
dynamicPath
- the dynamic path.createStrategy
- the strategy used if no web resource exists in persistence for the given dynamic path.- Returns:
- the web resource.
- Throws:
PortalObjectNotFoundException
- if no web resource for the given dynamic path exists, andcreateStrategy
isNEVER
.java.lang.IllegalArgumentException
- if the specified dynamic path could not be resolved into a web resource.PortalException
- Since:
- 5.0.0
- NEVER: throws
-
getWebResourceByDynamicPath
default WebResource getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy, java.util.Locale locale) throws PortalException
Returns a web resource for the given dynamic path.If the corresponding web resource already exists in the persistence, that instance is returned. Otherwise,
createStrategy
defines the behavior:- NEVER: throws
PortalObjectNotFoundException
. - TRANSIENT: creates and returns a transient web resource.
- AUTO: if the web resource does not have friendly path or cache, behaves as TRANSIENT, otherwise also persists the web resource.
This method uses its own transactions.
- Parameters:
dynamicPath
- the dynamic path.createStrategy
- the strategy used if no web resource exists in persistence for the given dynamic path.locale
- the web resource's locale.- Returns:
- the web resource.
- Throws:
PortalObjectNotFoundException
- if no web resource for the given dynamic path exists, andcreateStrategy
isNEVER
.java.lang.IllegalArgumentException
- if the specified dynamic path could not be resolved into a web resource.PortalException
- Since:
- 5.0.0
- NEVER: throws
-
getWebResourceByDynamicPath
WebResource getWebResourceByDynamicPath(java.lang.String dynamicPath, IURLManager.CreateStrategy createStrategy, java.util.Locale locale, WebResource creator) throws PortalException
Returns a web resource for the given dynamic path.If the corresponding web resource already exists in the persistence, that instance is returned. Otherwise,
createStrategy
defines the behavior:- NEVER: throws
PortalObjectNotFoundException
. - TRANSIENT: creates and returns a transient web resource.
- AUTO: if the web resource does not have friendly path or cache, behaves as TRANSIENT, otherwise also persists the web resource.
This method uses its own transactions.
- Parameters:
dynamicPath
- the dynamic path.createStrategy
- the strategy used if no web resource exists in persistence for the given dynamic path.locale
- the web resource's locale.creator
- the web resource that is requesting the given web resource (if any).- Returns:
- the web resource.
- Throws:
PortalObjectNotFoundException
- if no web resource for the given dynamic path exists, andcreateStrategy
isNEVER
.java.lang.IllegalArgumentException
- if the specified dynamic path could not be resolved into a web resource.PortalException
- Since:
- 10.3.0
- NEVER: throws
-
processHTMLDynamicPathReferences
@Deprecated java.lang.String processHTMLDynamicPathReferences(java.lang.String html) throws PortalException
Deprecated.Since 6.2.0, replaced byprocessHTMLDynamicPathReferences(String, Locale, IWebsite, boolean)
due to the inclusion of multiple websites feature.For best compatibility, this method resolves based on the default website's main non-secure URL. If there is no default website, it will throw an
IllegalStateException
.Processes references to dynamic paths in a given HTML code. Generates and persists corresponding web resources information, if necessary, and replaces the dynamic paths by the proper web resource paths.- Parameters:
html
- the HTML code.- Returns:
- the HTML code, with the references replaced.
- Throws:
PortalException
- Since:
- 5.0.0
-
convertHTMLPathsToDynamicPaths
@Deprecated java.lang.String convertHTMLPathsToDynamicPaths(java.lang.String html) throws PortalException
Deprecated.Since 6.2.0, replaced byconvertHTMLPathsToDynamicPaths(String, IWebsite)
due to the inclusion of multiple websites feature.For best compatibility, this method resolves based on the default website's main non-secure URL. If there is no default website, it will throw an
IllegalStateException
.Replaces, in an HTML code, paths to web resources by the corresponding dynamic path. If the path is absolute and it can be translated into dynamic path, it will be replaced by the relative dynamic path.- Parameters:
htmlContent
- the HTML code.- Returns:
- the converted HTML code.
- Throws:
PortalException
- Since:
- 5.0.0
-
convertHTMLPathsToDynamicPaths
@Deprecated java.lang.String convertHTMLPathsToDynamicPaths(java.lang.String html, IWebsite baseWebsite) throws PortalException
Deprecated.since 8.2.0 replaced byprocessHTML(String, IPageWebResourceRenderRequest)
.Replaces, in an HTML code, paths to web resources by the corresponding dynamic path. If the path is absolute and it can be translated into dynamic path, it will be replaced by the relative dynamic path.If the given HTML needs to be fully processed (including path fix, web resource and themes processing) prefer
processHTML(String, IPageWebResourceRenderRequest)
instead.- Parameters:
htmlContent
- the HTML code.baseWebsite
- the website the HTML belongs to.- Returns:
- the converted HTML code.
- Throws:
PortalException
- Since:
- 6.2.0
-
convertHTMLPathToDynamicPath
java.lang.String convertHTMLPathToDynamicPath(java.lang.String href, IWebsite baseWebsite) throws PortalException
Replaces the given path to web resource by the corresponding dynamic path. If the path is absolute and it can be translated into dynamic path, it will be replaced by the relative dynamic path.- Parameters:
href
- the path.baseWebsite
- the website the HTML belongs to.- Returns:
- the converted path.
- Throws:
PortalException
- Since:
- 8.2.0
-
processHTMLDynamicPathReferences
@Deprecated java.lang.String processHTMLDynamicPathReferences(java.lang.String htmlModifiedContent, java.util.Locale locale, boolean convertGuestOnlyCaches) throws PortalException
Deprecated.Since 6.2.0, replaced byprocessHTMLDynamicPathReferences(String, Locale, IWebsite, boolean)
due to the inclusion of multiple websites feature.For best compatibility, this method resolves based on the default website's main non-secure URL. If there is no default website, it will throw an
IllegalStateException
.convertGuestOnlyCaches
parameter is no longer supported and is ignored.Processes references to dynamic paths in a given HTML code. Generates and persists corresponding web resources information, if necessary, and replaces the dynamic paths by the proper web resource paths.- Parameters:
htmlContent
- the HTML code.locale
- the locale.convertGuestOnlyCaches
- if true, pages with cache enabled only for guest will also have their dynamic paths converted.- Returns:
- the HTML code, with the references replaced.
- Throws:
PortalException
- Since:
- 5.0.0
-
processHTMLDynamicPathReferences
java.lang.String processHTMLDynamicPathReferences(java.lang.String htmlContent, java.util.Locale locale, IWebsite baseWebsite, boolean baseSecure) throws PortalException
Processes references to dynamic paths in a given HTML code. Generates and persists corresponding web resources information, if necessary, and replaces the dynamic paths by the proper web resource hrefs.- Parameters:
htmlContent
- the HTML code.locale
- the locale.baseWebsite
- the website the HTML is relative to (in case it is generated as relative). May benull
if the base website is unknown. If not specified, the generated hrefs will be absolute.baseSecure
-true
if the base URL for the HTML is secure,false
otherwise. If a href requires a different secure level (HTTP or HTTPS), it will have to be absolute.- Returns:
- the HTML code, with the references replaced.
- Throws:
PortalException
- Since:
- 6.2.0
-
setWebResourcesMissingData
void setWebResourcesMissingData(IWebResourceFactory webResourceFactory, java.util.Collection<WebResource> webResources, boolean cacheEnabled, boolean friendlyURLEnabled) throws PortalException
Sets missing data in the given web resources.- Parameters:
webResourceFactory
- the web resource factory of the given web resources.webResources
- the web resources.cacheEnabled
- indicates that cache is enabled.friendlyURLEnabled
- indicates that friendly URL is enabled.- Throws:
PortalException
- Since:
- 5.0.0
-
fixReferencesAccordingToPath
@Deprecated java.lang.String fixReferencesAccordingToPath(java.lang.String html, java.lang.String path) throws PortalException
Deprecated.since 8.2.0 replaced byfixReferencesAccordingToPath(String, String, IPortalMode, String)
Fixes references within an HTML according to the given path.The HTML passed in to this method should be appropriate for the context root of the solution. This method changes path references in the HTML such that the references are relative to the specified path. The path must begin with the "/" character and be relative to the web application root.
- Parameters:
html
- the HTML content to be fixed.path
- the path.- Returns:
- the original HTML with adjusted references.
- Throws:
PortalException
- Since:
- 5.0.0
-
fixReferencesAccordingToPath
@Deprecated java.lang.String fixReferencesAccordingToPath(java.lang.String html, java.lang.String path, IPortalMode portalMode) throws PortalException
Deprecated.since 8.2.0 replaced byfixReferencesAccordingToPath(String, String, IPortalMode, String)
Fixes references within an HTML according to the given path.The HTML passed in to this method should be appropriate for the context root of the solution. This method changes path references in the HTML such that the references are relative to the specified path. The path must begin with the "/" character and be relative to the web application root.
- Parameters:
html
- the HTML content to be fixed.path
- the path.portalMode
- the current Portal Mode.- Returns:
- the original HTML with adjusted references.
- Throws:
PortalException
- Since:
- 5.0.0
-
fixReferencesAccordingToPath
java.lang.String fixReferencesAccordingToPath(java.lang.String html, java.lang.String path, IPortalMode portalMode, java.lang.String pageId) throws PortalException
Fixes references within an HTML according to the given path.The HTML passed in to this method should be appropriate for the context root of the solution. This method changes path references in the HTML such that the references are relative to the specified path. The path must begin with the "/" character and be relative to the web application root.
- Parameters:
html
- the HTML content to be fixed.path
- the path.portalMode
- the current Portal Mode.pageId
- the identifier of the page being rendered.- Returns:
- the original HTML with adjusted references.
- Throws:
PortalException
- Since:
- 8.2.0
-
processHTML
java.lang.String processHTML(java.lang.String originalHtml, IPageWebResourceRenderRequest renderRequest) throws PortalException
Processes a HTML to be rendered correctly in a portal page.The given HTML is adjusted according with themes, relative path, web resource path translations, file download path translations and websites.
- Parameters:
originalHtml
- the HTML to be processed.request
- the request.- Returns:
- the processed HTML.
- Throws:
PortalException
- Since:
- 8.2.0
-
processHTML
java.lang.String processHTML(java.lang.String originalHtml, java.util.Locale locale) throws PortalException
Processes a HTML to be used.Resources referred by the given HTML are adjusted
- Parameters:
originalHtml
- the HTML to be processed.locale
- the locale to use for resource resolution.- Returns:
- the processed HTML.
- Throws:
PortalException
- Since:
- 10.0.0
-
processHTML
java.lang.String processHTML(java.lang.String originalHtml, java.util.Locale locale, boolean baseSecure, IWebsiteBaseURL baseURL) throws PortalException
Processes a HTML to be used.Resources referred by the given HTML are adjusted
- Parameters:
originalHtml
- the HTML to be processed.locale
- the locale to use for resource resolution.baseSecure
- indicates if the process HTML should consider links to secure URLs.baseURL
- the base URL being accessed when the process is performed (if any).- Returns:
- the processed HTML.
- Throws:
PortalException
- Since:
- 11.0.0
-
processHref
@Deprecated default java.lang.String processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure) throws PortalException
Deprecated.since 8.2.0 replaced byprocessHref(String, List, String, Locale, IWebsiteBaseURL, boolean, IPortalMode)
.Processes a URL to be rendered correctly in a portal page.The given URL is adjusted according with themes, relative path, web resource path translations, file download path translations and websites.
The parameter
applicationRequestedPath
is used to adjust the URL to the application requested path. This method resolve path to public files.- Parameters:
url
- the URL to resolve. The URL must be absolute or relative to the portal web application root. If relative, a starting '/' character is optional.themes
- list of themes to be applied to the URL.applicationRequestedPath
- the application path of the request the URL will be used in. This path is used to adjust the URL.locale
- the locale for the URL. It is applied only if the URL does not already implies a specific locale.websiteBaseURL
- the website of the request the URL will be used in.baseSecure
- if the request the URL will be used in is secure or not.- Returns:
- the resolved URL.
- Throws:
PortalException
- if any error occurs during the process.- Since:
- 7.0.0
-
processHref
default java.lang.String processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode, IURLManager.PathReferenceType pathReferenceType) throws PortalException
Processes a URL to be rendered correctly in a portal page.The given URL is adjusted according with themes, relative path, web resource path translations, file download path translations and websites.
The parameter
applicationRequestedPath
is used to adjust the URL to the application requested path. This method resolve path to public files.- Parameters:
url
- the URL to resolve. The URL must be absolute or relative to the portal web application root. If relative, a starting '/' character is optional.themes
- list of themes to be applied to the URL.applicationRequestedPath
- the application path of the request the URL will be used in. This path is used to adjust the URL.locale
- the locale for the URL. It is applied only if the URL does not already implies a specific locale.websiteBaseURL
- the website of the request the URL will be used in.baseSecure
- if the request the URL will be used in is secure or not.portalMode
- the portal mode.pathReferenceType
- specifies how paths should be referenced.- Returns:
- the resolved URL.
- Throws:
PortalException
- if any error occurs during the process.- Since:
- 10.0.0
-
processHref
java.lang.String processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode, IURLManager.PathReferenceType pathReferenceType, WebResource creator) throws PortalException
Processes a URL to be rendered correctly in a portal page.The given URL is adjusted according with themes, relative path, web resource path translations, file download path translations and websites.
The parameter
applicationRequestedPath
is used to adjust the URL to the application requested path. This method resolve path to public files.- Parameters:
url
- the URL to resolve. The URL must be absolute or relative to the portal web application root. If relative, a starting '/' character is optional.themes
- list of themes to be applied to the URL.applicationRequestedPath
- the application path of the request the URL will be used in. This path is used to adjust the URL.locale
- the locale for the URL. It is applied only if the URL does not already implies a specific locale.websiteBaseURL
- the website of the request the URL will be used in.baseSecure
- if the request the URL will be used in is secure or not.portalMode
- the portal mode.pathReferenceType
- specifies how paths should be referenced.creator
- the web resource that is requesting the processing.- Returns:
- the resolved URL.
- Throws:
PortalException
- if any error occurs during the process.- Since:
- 10.0.0
-
processHref
@Deprecated default java.lang.String processHref(java.lang.String url, java.util.List<ITheme> themes, java.lang.String applicationRequestedPath, java.util.Locale locale, IWebsiteBaseURL websiteBaseURL, boolean baseSecure, IPortalMode portalMode) throws PortalException
Deprecated.Processes a URL to be rendered correctly in a portal page.The given URL is adjusted according with themes, relative path, web resource path translations, file download path translations and websites.
The parameter
applicationRequestedPath
is used to adjust the URL to the application requested path. This method resolve path to public files.- Parameters:
url
- the URL to resolve. The URL must be absolute or relative to the portal web application root. If relative, a starting '/' character is optional.themes
- list of themes to be applied to the URL.applicationRequestedPath
- the application path of the request the URL will be used in. This path is used to adjust the URL.locale
- the locale for the URL. It is applied only if the URL does not already implies a specific locale.websiteBaseURL
- the website of the request the URL will be used in.baseSecure
- if the request the URL will be used in is secure or not.portalMode
- the portal mode.- Returns:
- the resolved URL.
- Throws:
PortalException
- if any error occurs during the process.- Since:
- 8.2.0
-
findWebResourceByPathAndWebsite
WebResource findWebResourceByPathAndWebsite(java.lang.String websiteId, java.lang.String path) throws PortalException
Finds a web resource by it's website identifier and path.Warning: due to internal use of caches and optimization of this method, the returned web resource object does not reflect latest changes on the related page cache.
- Parameters:
websiteId
- the website identifier.path
- the path.- Returns:
- the found web resource or
null
if no web resource matches the given parameters. - Throws:
PortalException
- Since:
- 8.0.0
-
deleteWebResourcesInChannelTree
void deleteWebResourcesInChannelTree(java.lang.String rootChannelId) throws PortalException
Delete allweb resources
in the tree for which the root is the givenrootChannelId
.- Parameters:
rootChannelId
- The channelId to start recursing from- Throws:
PortalException
- Since:
- 8.1.0
-
deleteWebResourcesFromPage
void deleteWebResourcesFromPage(java.lang.String pageId) throws PortalException
Delete allweb resources
from the page that has the given identifier.- Parameters:
pageId
- The identifier of the page that has the web resources to be deleted- Throws:
PortalException
- Since:
- 8.1.0
-
getWebResourceByParameterAndValue
java.util.Collection<WebResource> getWebResourceByParameterAndValue(java.lang.String parameterName, java.lang.String parameterValue)
Get allweb resources
that fits the given parameter name with the given parameter value.- Parameters:
parameterName
- a given parameter nameparameterValue
- a given parameter value- Returns:
- list of all
web resources
that satisfies parameter name equals parameter value. - Since:
- 8.2.0
-
recalculateFriendlyPaths
void recalculateFriendlyPaths(java.util.Collection<? extends WebResource> webResources) throws PortalException
Calculates and updates friendly paths of the given web resources.The original values that get updated are stored to use for redirecting to the updated ones. This redirect information can be obtained using
getWebResourceToRedirect(String, String)
.- Parameters:
webResources
- the web resources.- Throws:
PortalException
- Since:
- 10.0.0
-
getWebResourceToRedirect
WebResource getWebResourceToRedirect(java.lang.String sourceWebsiteId, java.lang.String sourcePath) throws PortalException
Returns the web resource to redirect to when the given path on the given website is accessed.This method uses its own transaction.
- Parameters:
sourceWebsiteId
- the web site identifier.sourcePath
- the path, starting with '/', relative to the web site root.- Returns:
- the web resource to redirect to, or
null
if there is no redirect information for the specified website and path. - Throws:
PortalException
- Since:
- 10.0.0
-
deleteWebResourceRedirection
void deleteWebResourceRedirection(java.lang.String sourceWebsiteId, java.lang.String sourcePath) throws PortalException
Deletes the web resource redirection rule for the specified source website and path.- Parameters:
sourceWebsiteId
- the source website identifier.sourcePath
- the source path.- Throws:
PortalException
- Since:
- 10.0.0
-
recalculateFriendlyPathsInChannelTree
void recalculateFriendlyPathsInChannelTree(java.lang.String rootChannelId) throws PortalException
Calculates and updates friendly paths of allweb resources
in the tree for which the root is the givenrootChannelId
.The original values that get updated are stored to use for redirecting to the updated ones. This redirect information can be obtained using
getWebResourceToRedirect(String, String)
.- Parameters:
rootChannelId
- The channelId to start recursing from- Throws:
PortalException
- Since:
- 10.1.0
-
-